Created
November 6, 2015 21:29
-
-
Save sparkhom/f5af2083e6202c3e1d05 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Common subdirectories: flex-2.5.39/.git and openbsd-flex/.git | |
Only in flex-2.5.39: .indent.pro | |
Only in flex-2.5.39: ABOUT-NLS | |
Only in flex-2.5.39: AUTHORS | |
Only in flex-2.5.39: INSTALL | |
diff -Pu flex-2.5.39/Makefile openbsd-flex/Makefile | |
--- flex-2.5.39/Makefile Wed Dec 31 16:00:00 1969 | |
+++ openbsd-flex/Makefile Fri Nov 6 08:46:30 2015 | |
@@ -0,0 +1,53 @@ | |
+# | |
+# By default, flex will be configured to generate 8-bit scanners only if the | |
+# -8 flag is given. If you want it to always generate 8-bit scanners, add | |
+# "-DDEFAULT_CSIZE=256" to CFLAGS. Note that doing so will double the size | |
+# of all uncompressed scanners. | |
+# | |
+# If on your system you have trouble building flex due to 8-bit character | |
+# problems, remove the -8 from FLEX_FLAGS and the "#define FLEX_8_BIT_CHARS" | |
+# from the beginning of flexdef.h. | |
+# | |
+# To bootstrap lex, cp initscan.c to scan.c and run make. | |
+ | |
+PROG= lex | |
+CFLAGS+=-I. -I${.CURDIR} -DHAVE_CONFIG_H | |
+SRCS= buf.c ccl.c dfa.c ecs.c filter.c gen.c main.c misc.c \ | |
+ nfa.c options.c parse.y regex.c scan.l scanflags.c \ | |
+ scanopt.c skel.c sym.c tables.c tables_shared.c \ | |
+ tblcmp.c yylex.c | |
+ | |
+CLEANFILES+=skel.c parse.h | |
+LDADD+=-lm | |
+ | |
+MAN = flex.1 | |
+ | |
+LINKS= ${BINDIR}/lex ${BINDIR}/flex \ | |
+ ${BINDIR}/lex ${BINDIR}/flex++ | |
+MLINKS= flex.1 lex.1 | |
+ | |
+VERSION="2.5.39" | |
+ | |
+# Our yacc is too old to compile parse.y; use bootstrapped parse.c instead | |
+parse.h parse.c: parse.y | |
+ cp ${.CURDIR}/initparse.c parse.c | |
+ cp ${.CURDIR}/initparse.h parse.h | |
+ | |
+skel.c: flex.skl mkskel.sh flexint.h tables_shared.h | |
+ sed -e 's/m4_/m4postproc_/g' -e 's/m4preproc_/m4_/g' \ | |
+ ${.CURDIR}/flex.skl | m4 -I${.CURDIR} -P \ | |
+ -DFLEX_MAJOR_VERSION=`echo ${VERSION} | cut -f 1 -d .` \ | |
+ -DFLEX_MINOR_VERSION=`echo ${VERSION} | cut -f 2 -d .` \ | |
+ -DFLEX_SUBMINOR_VERSION=`echo ${VERSION} | cut -f 3 -d .` | \ | |
+ sed -e 's/m4postproc_/m4_/g' | \ | |
+ sh ${.CURDIR}/mkskel.sh > ${.TARGET} | |
+ | |
+includes: | |
+.if !exists(${DESTDIR}/usr/include/g++) | |
+ ${INSTALL} -d -o root -g bin -m 755 \ | |
+ ${DESTDIR}/usr/include/g++ | |
+.endif | |
+ ${INSTALL} ${INSTALL_COPY} -o ${BINOWN} -g ${BINGRP} -m 444 \ | |
+ ${.CURDIR}/FlexLexer.h ${DESTDIR}/usr/include/g++/ | |
+ | |
+.include <bsd.prog.mk> | |
Only in flex-2.5.39: Makefile.am | |
Only in flex-2.5.39: Makefile.in | |
Only in flex-2.5.39: THANKS | |
Only in flex-2.5.39: TODO | |
Only in flex-2.5.39: aclocal.m4 | |
Only in flex-2.5.39: autogen.sh | |
diff -Pu flex-2.5.39/buf.c openbsd-flex/buf.c | |
--- flex-2.5.39/buf.c Wed Mar 26 05:46:44 2014 | |
+++ openbsd-flex/buf.c Mon Nov 2 15:20:26 2015 | |
@@ -90,15 +90,17 @@ | |
*/ | |
struct Buf *buf_linedir (struct Buf *buf, const char* filename, int lineno) | |
{ | |
- char *dst, *src, *t; | |
+ const char *src; | |
+ char *dst, *t; | |
+ size_t tsz; | |
- t = flex_alloc (strlen ("#line \"\"\n") + /* constant parts */ | |
+ t = flex_alloc (tsz = strlen ("#line \"\"\n") + /* constant parts */ | |
2 * strlen (filename) + /* filename with possibly all backslashes escaped */ | |
(int) (1 + log10 (abs (lineno))) + /* line number */ | |
1); /* NUL */ | |
if (!t) | |
flexfatal (_("Allocation of buffer for line directive failed")); | |
- for (dst = t + sprintf (t, "#line %d \"", lineno), src = filename; *src; *dst++ = *src++) | |
+ for (dst = t + snprintf (t, tsz, "#line %d \"", lineno), src = filename; *src; *dst++ = *src++) | |
if (*src == '\\') /* escape backslashes */ | |
*dst++ = '\\'; | |
*dst++ = '"'; | |
Only in flex-2.5.39: compile | |
Only in flex-2.5.39: conf.in | |
Only in flex-2.5.39: config.guess | |
diff -Pu flex-2.5.39/config.h openbsd-flex/config.h | |
--- flex-2.5.39/config.h Wed Dec 31 16:00:00 1969 | |
+++ openbsd-flex/config.h Mon Nov 2 14:10:52 2015 | |
@@ -0,0 +1,222 @@ | |
+/* config.h. Generated from conf.in by configure. */ | |
+/* conf.in. Generated from configure.ac by autoheader. */ | |
+ | |
+/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP | |
+ systems. This function is required for `alloca.c' support on those systems. | |
+ */ | |
+/* #undef CRAY_STACKSEG_END */ | |
+ | |
+/* Define to 1 if using `alloca.c'. */ | |
+/* #undef C_ALLOCA */ | |
+ | |
+/* Define to 1 if translation of program messages to the user's native | |
+ language is requested. */ | |
+/* #undef ENABLE_NLS */ | |
+ | |
+/* Define to 1 if you have `alloca', as a function or macro. */ | |
+#define HAVE_ALLOCA 1 | |
+ | |
+/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix). | |
+ */ | |
+/* #undef HAVE_ALLOCA_H */ | |
+ | |
+/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the | |
+ CoreFoundation framework. */ | |
+/* #undef HAVE_CFLOCALECOPYCURRENT */ | |
+ | |
+/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in | |
+ the CoreFoundation framework. */ | |
+/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ | |
+ | |
+/* Define if the GNU dcgettext() function is already present or preinstalled. | |
+ */ | |
+/* #undef HAVE_DCGETTEXT */ | |
+ | |
+/* Define to 1 if you have the <dlfcn.h> header file. */ | |
+#define HAVE_DLFCN_H 1 | |
+ | |
+/* Define to 1 if you have the `dup2' function. */ | |
+#define HAVE_DUP2 1 | |
+ | |
+/* Define to 1 if you have the `fork' function. */ | |
+#define HAVE_FORK 1 | |
+ | |
+/* Define if the GNU gettext() function is already present or preinstalled. */ | |
+/* #undef HAVE_GETTEXT */ | |
+ | |
+/* Define if you have the iconv() function and it works. */ | |
+#define HAVE_ICONV 1 | |
+ | |
+/* Define to 1 if you have the <inttypes.h> header file. */ | |
+#define HAVE_INTTYPES_H 1 | |
+ | |
+/* Define to 1 if you have the `isascii' function. */ | |
+#define HAVE_ISASCII 1 | |
+ | |
+/* Define to 1 if you have the <libintl.h> header file. */ | |
+/* #undef HAVE_LIBINTL_H */ | |
+ | |
+/* Define to 1 if you have the `m' library (-lm). */ | |
+#define HAVE_LIBM 1 | |
+ | |
+/* pthread library */ | |
+#define HAVE_LIBPTHREAD 1 | |
+ | |
+/* Define to 1 if you have the <limits.h> header file. */ | |
+#define HAVE_LIMITS_H 1 | |
+ | |
+/* Define to 1 if you have the <locale.h> header file. */ | |
+#define HAVE_LOCALE_H 1 | |
+ | |
+/* Define to 1 if your system has a GNU libc compatible `malloc' function, and | |
+ to 0 otherwise. */ | |
+#define HAVE_MALLOC 1 | |
+ | |
+/* Define to 1 if you have the <malloc.h> header file. */ | |
+#define HAVE_MALLOC_H 1 | |
+ | |
+/* Define to 1 if you have the <memory.h> header file. */ | |
+#define HAVE_MEMORY_H 1 | |
+ | |
+/* Define to 1 if you have the `memset' function. */ | |
+#define HAVE_MEMSET 1 | |
+ | |
+/* Define to 1 if you have the <netinet/in.h> header file. */ | |
+#define HAVE_NETINET_IN_H 1 | |
+ | |
+/* Define to 1 if you have the `pow' function. */ | |
+#define HAVE_POW 1 | |
+ | |
+/* Define to 1 if you have the <pthread.h> header file. */ | |
+#define HAVE_PTHREAD_H 1 | |
+ | |
+/* Define to 1 if your system has a GNU libc compatible `realloc' function, | |
+ and to 0 otherwise. */ | |
+#define HAVE_REALLOC 1 | |
+ | |
+/* Define to 1 if you have the `regcomp' function. */ | |
+#define HAVE_REGCOMP 1 | |
+ | |
+/* Define to 1 if you have the <regex.h> header file. */ | |
+#define HAVE_REGEX_H 1 | |
+ | |
+/* Define to 1 if you have the `setlocale' function. */ | |
+#define HAVE_SETLOCALE 1 | |
+ | |
+/* Define to 1 if stdbool.h conforms to C99. */ | |
+#define HAVE_STDBOOL_H 1 | |
+ | |
+/* Define to 1 if you have the <stddef.h> header file. */ | |
+#define HAVE_STDDEF_H 1 | |
+ | |
+/* Define to 1 if you have the <stdint.h> header file. */ | |
+#define HAVE_STDINT_H 1 | |
+ | |
+/* Define to 1 if you have the <stdlib.h> header file. */ | |
+#define HAVE_STDLIB_H 1 | |
+ | |
+/* Define to 1 if you have the `strchr' function. */ | |
+#define HAVE_STRCHR 1 | |
+ | |
+/* Define to 1 if you have the <strings.h> header file. */ | |
+#define HAVE_STRINGS_H 1 | |
+ | |
+/* Define to 1 if you have the <string.h> header file. */ | |
+#define HAVE_STRING_H 1 | |
+ | |
+/* Define to 1 if you have the `strtol' function. */ | |
+#define HAVE_STRTOL 1 | |
+ | |
+/* Define to 1 if you have the <sys/stat.h> header file. */ | |
+#define HAVE_SYS_STAT_H 1 | |
+ | |
+/* Define to 1 if you have the <sys/types.h> header file. */ | |
+#define HAVE_SYS_TYPES_H 1 | |
+ | |
+/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */ | |
+#define HAVE_SYS_WAIT_H 1 | |
+ | |
+/* Define to 1 if you have the <unistd.h> header file. */ | |
+#define HAVE_UNISTD_H 1 | |
+ | |
+/* Define to 1 if you have the `vfork' function. */ | |
+#define HAVE_VFORK 1 | |
+ | |
+/* Define to 1 if you have the <vfork.h> header file. */ | |
+/* #undef HAVE_VFORK_H */ | |
+ | |
+/* Define to 1 if `fork' works. */ | |
+#define HAVE_WORKING_FORK 1 | |
+ | |
+/* Define to 1 if `vfork' works. */ | |
+#define HAVE_WORKING_VFORK 1 | |
+ | |
+/* Define to 1 if the system has the type `_Bool'. */ | |
+#define HAVE__BOOL 1 | |
+ | |
+/* Define to the sub-directory in which libtool stores uninstalled libraries. | |
+ */ | |
+#define LT_OBJDIR ".libs/" | |
+ | |
+/* Define to the m4 executable name. */ | |
+#define M4 "/usr/bin/m4" | |
+ | |
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */ | |
+/* #undef NO_MINUS_C_MINUS_O */ | |
+ | |
+/* Name of package */ | |
+#define PACKAGE "flex" | |
+ | |
+/* Define to the address where bug reports for this package should be sent. */ | |
+#define PACKAGE_BUGREPORT "[email protected]" | |
+ | |
+/* Define to the full name of this package. */ | |
+#define PACKAGE_NAME "the fast lexical analyser generator" | |
+ | |
+/* Define to the full name and version of this package. */ | |
+#define PACKAGE_STRING "the fast lexical analyser generator 2.5.39" | |
+ | |
+/* Define to the one symbol short name of this package. */ | |
+#define PACKAGE_TARNAME "flex" | |
+ | |
+/* Define to the home page for this package. */ | |
+#define PACKAGE_URL "" | |
+ | |
+/* Define to the version of this package. */ | |
+#define PACKAGE_VERSION "2.5.39" | |
+ | |
+/* If using the C implementation of alloca, define if you know the | |
+ direction of stack growth for your system; otherwise it will be | |
+ automatically deduced at runtime. | |
+ STACK_DIRECTION > 0 => grows toward higher addresses | |
+ STACK_DIRECTION < 0 => grows toward lower addresses | |
+ STACK_DIRECTION = 0 => direction of growth unknown */ | |
+/* #undef STACK_DIRECTION */ | |
+ | |
+/* Define to 1 if you have the ANSI C header files. */ | |
+#define STDC_HEADERS 1 | |
+ | |
+/* Version number of package */ | |
+#define VERSION "2.5.39" | |
+ | |
+/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a | |
+ `char[]'. */ | |
+#define YYTEXT_POINTER 1 | |
+ | |
+/* Define to empty if `const' does not conform to ANSI C. */ | |
+/* #undef const */ | |
+ | |
+/* Define to rpl_malloc if the replacement function should be used. */ | |
+/* #undef malloc */ | |
+ | |
+/* Define to `int' if <sys/types.h> does not define. */ | |
+/* #undef pid_t */ | |
+ | |
+/* Define to rpl_realloc if the replacement function should be used. */ | |
+/* #undef realloc */ | |
+ | |
+/* Define to `unsigned int' if <sys/types.h> does not define. */ | |
+/* #undef size_t */ | |
+ | |
+/* Define as `fork' if `vfork' does not work. */ | |
+/* #undef vfork */ | |
Only in flex-2.5.39: config.rpath | |
Only in flex-2.5.39: config.sub | |
Only in flex-2.5.39: configure | |
Only in flex-2.5.39: configure.ac | |
Only in flex-2.5.39: depcomp | |
Only in flex-2.5.39: doc | |
Only in flex-2.5.39: examples | |
diff -Pu flex-2.5.39/flex.1 openbsd-flex/flex.1 | |
--- flex-2.5.39/flex.1 Wed Dec 31 16:00:00 1969 | |
+++ openbsd-flex/flex.1 Tue Nov 3 02:40:18 2015 | |
@@ -0,0 +1,4438 @@ | |
+.\" $OpenBSD: flex.1,v 1.43 2015/09/21 10:03:46 jmc Exp $ | |
+.\" | |
+.\" Copyright (c) 1990 The Regents of the University of California. | |
+.\" All rights reserved. | |
+.\" | |
+.\" This code is derived from software contributed to Berkeley by | |
+.\" Vern Paxson. | |
+.\" | |
+.\" The United States Government has rights in this work pursuant | |
+.\" to contract no. DE-AC03-76SF00098 between the United States | |
+.\" Department of Energy and the University of California. | |
+.\" | |
+.\" Redistribution and use in source and binary forms, with or without | |
+.\" modification, are permitted provided that the following conditions | |
+.\" are met: | |
+.\" | |
+.\" 1. Redistributions of source code must retain the above copyright | |
+.\" notice, this list of conditions and the following disclaimer. | |
+.\" 2. Redistributions in binary form must reproduce the above copyright | |
+.\" notice, this list of conditions and the following disclaimer in the | |
+.\" documentation and/or other materials provided with the distribution. | |
+.\" | |
+.\" Neither the name of the University nor the names of its contributors | |
+.\" may be used to endorse or promote products derived from this software | |
+.\" without specific prior written permission. | |
+.\" | |
+.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR | |
+.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED | |
+.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
+.\" PURPOSE. | |
+.\" | |
+.Dd $Mdocdate: September 21 2015 $ | |
+.Dt FLEX 1 | |
+.Os | |
+.Sh NAME | |
+.Nm flex , | |
+.Nm flex++ , | |
+.Nm lex | |
+.Nd fast lexical analyzer generator | |
+.Sh SYNOPSIS | |
+.Nm | |
+.Bk -words | |
+.Op Fl 78BbdFfhIiLlnpsTtVvw+? | |
+.Op Fl C Ns Op Cm aeFfmr | |
+.Op Fl Fl help | |
+.Op Fl Fl version | |
+.Op Fl o Ns Ar output | |
+.Op Fl P Ns Ar prefix | |
+.Op Fl S Ns Ar skeleton | |
+.Op Ar | |
+.Ek | |
+.Sh DESCRIPTION | |
+.Nm | |
+is a tool for generating | |
+.Em scanners : | |
+programs which recognize lexical patterns in text. | |
+.Nm | |
+reads the given input files, or its standard input if no file names are given, | |
+for a description of a scanner to generate. | |
+The description is in the form of pairs of regular expressions and C code, | |
+called | |
+.Em rules . | |
+.Nm | |
+generates as output a C source file, | |
+.Pa lex.yy.c , | |
+which defines a routine | |
+.Fn yylex . | |
+This file is compiled and linked with the | |
+.Fl lfl | |
+library to produce an executable. | |
+When the executable is run, it analyzes its input for occurrences | |
+of the regular expressions. | |
+Whenever it finds one, it executes the corresponding C code. | |
+.Pp | |
+.Nm lex | |
+is a synonym for | |
+.Nm flex . | |
+.Nm flex++ | |
+is a synonym for | |
+.Nm | |
+.Fl + . | |
+.Pp | |
+The manual includes both tutorial and reference sections: | |
+.Bl -ohang | |
+.It Sy Some Simple Examples | |
+.It Sy Format of the Input File | |
+.It Sy Patterns | |
+The extended regular expressions used by | |
+.Nm . | |
+.It Sy How the Input is Matched | |
+The rules for determining what has been matched. | |
+.It Sy Actions | |
+How to specify what to do when a pattern is matched. | |
+.It Sy The Generated Scanner | |
+Details regarding the scanner that | |
+.Nm | |
+produces; | |
+how to control the input source. | |
+.It Sy Start Conditions | |
+Introducing context into scanners, and managing | |
+.Qq mini-scanners . | |
+.It Sy Multiple Input Buffers | |
+How to manipulate multiple input sources; | |
+how to scan from strings instead of files. | |
+.It Sy End-of-File Rules | |
+Special rules for matching the end of the input. | |
+.It Sy Miscellaneous Macros | |
+A summary of macros available to the actions. | |
+.It Sy Values Available to the User | |
+A summary of values available to the actions. | |
+.It Sy Interfacing with Yacc | |
+Connecting flex scanners together with | |
+.Xr yacc 1 | |
+parsers. | |
+.It Sy Options | |
+.Nm | |
+command-line options, and the | |
+.Dq %option | |
+directive. | |
+.It Sy Performance Considerations | |
+How to make scanners go as fast as possible. | |
+.It Sy Generating C++ Scanners | |
+The | |
+.Pq experimental | |
+facility for generating C++ scanner classes. | |
+.It Sy Incompatibilities with Lex and POSIX | |
+How | |
+.Nm | |
+differs from | |
+.At | |
+.Nm lex | |
+and the | |
+.Tn POSIX | |
+.Nm lex | |
+standard. | |
+.It Sy Files | |
+Files used by | |
+.Nm . | |
+.It Sy Diagnostics | |
+Those error messages produced by | |
+.Nm | |
+.Pq or scanners it generates | |
+whose meanings might not be apparent. | |
+.It Sy See Also | |
+Other documentation, related tools. | |
+.It Sy Authors | |
+Includes contact information. | |
+.It Sy Bugs | |
+Known problems with | |
+.Nm . | |
+.El | |
+.Sh SOME SIMPLE EXAMPLES | |
+First some simple examples to get the flavor of how one uses | |
+.Nm . | |
+The following | |
+.Nm | |
+input specifies a scanner which whenever it encounters the string | |
+.Qq username | |
+will replace it with the user's login name: | |
+.Bd -literal -offset indent | |
+%% | |
+username printf("%s", getlogin()); | |
+.Ed | |
+.Pp | |
+By default, any text not matched by a | |
+.Nm | |
+scanner is copied to the output, so the net effect of this scanner is | |
+to copy its input file to its output with each occurrence of | |
+.Qq username | |
+expanded. | |
+In this input, there is just one rule. | |
+.Qq username | |
+is the | |
+.Em pattern | |
+and the | |
+.Qq printf | |
+is the | |
+.Em action . | |
+The | |
+.Qq %% | |
+marks the beginning of the rules. | |
+.Pp | |
+Here's another simple example: | |
+.Bd -literal -offset indent | |
+%{ | |
+int num_lines = 0, num_chars = 0; | |
+%} | |
+ | |
+%% | |
+\en ++num_lines; ++num_chars; | |
+\&. ++num_chars; | |
+ | |
+%% | |
+main() | |
+{ | |
+ yylex(); | |
+ printf("# of lines = %d, # of chars = %d\en", | |
+ num_lines, num_chars); | |
+} | |
+.Ed | |
+.Pp | |
+This scanner counts the number of characters and the number | |
+of lines in its input | |
+(it produces no output other than the final report on the counts). | |
+The first line declares two globals, | |
+.Qq num_lines | |
+and | |
+.Qq num_chars , | |
+which are accessible both inside | |
+.Fn yylex | |
+and in the | |
+.Fn main | |
+routine declared after the second | |
+.Qq %% . | |
+There are two rules, one which matches a newline | |
+.Pq \&"\en\&" | |
+and increments both the line count and the character count, | |
+and one which matches any character other than a newline | |
+(indicated by the | |
+.Qq \&. | |
+regular expression). | |
+.Pp | |
+A somewhat more complicated example: | |
+.Bd -literal -offset indent | |
+/* scanner for a toy Pascal-like language */ | |
+ | |
+%{ | |
+/* need this for the call to atof() below */ | |
+#include <math.h> | |
+%} | |
+ | |
+DIGIT [0-9] | |
+ID [a-z][a-z0-9]* | |
+ | |
+%% | |
+ | |
+{DIGIT}+ { | |
+ printf("An integer: %s (%d)\en", yytext, | |
+ atoi(yytext)); | |
+} | |
+ | |
+{DIGIT}+"."{DIGIT}* { | |
+ printf("A float: %s (%g)\en", yytext, | |
+ atof(yytext)); | |
+} | |
+ | |
+if|then|begin|end|procedure|function { | |
+ printf("A keyword: %s\en", yytext); | |
+} | |
+ | |
+{ID} printf("An identifier: %s\en", yytext); | |
+ | |
+"+"|"-"|"*"|"/" printf("An operator: %s\en", yytext); | |
+ | |
+"{"[^}\en]*"}" /* eat up one-line comments */ | |
+ | |
+[ \et\en]+ /* eat up whitespace */ | |
+ | |
+\&. printf("Unrecognized character: %s\en", yytext); | |
+ | |
+%% | |
+ | |
+main(int argc, char *argv[]) | |
+{ | |
+ ++argv; --argc; /* skip over program name */ | |
+ if (argc > 0) | |
+ yyin = fopen(argv[0], "r"); | |
+ else | |
+ yyin = stdin; | |
+ | |
+ yylex(); | |
+} | |
+.Ed | |
+.Pp | |
+This is the beginnings of a simple scanner for a language like Pascal. | |
+It identifies different types of | |
+.Em tokens | |
+and reports on what it has seen. | |
+.Pp | |
+The details of this example will be explained in the following sections. | |
+.Sh FORMAT OF THE INPUT FILE | |
+The | |
+.Nm | |
+input file consists of three sections, separated by a line with just | |
+.Qq %% | |
+in it: | |
+.Bd -unfilled -offset indent | |
+definitions | |
+%% | |
+rules | |
+%% | |
+user code | |
+.Ed | |
+.Pp | |
+The | |
+.Em definitions | |
+section contains declarations of simple | |
+.Em name | |
+definitions to simplify the scanner specification, and declarations of | |
+.Em start conditions , | |
+which are explained in a later section. | |
+.Pp | |
+Name definitions have the form: | |
+.Pp | |
+.D1 name definition | |
+.Pp | |
+The | |
+.Qq name | |
+is a word beginning with a letter or an underscore | |
+.Pq Sq _ | |
+followed by zero or more letters, digits, | |
+.Sq _ , | |
+or | |
+.Sq - | |
+.Pq dash . | |
+The definition is taken to begin at the first non-whitespace character | |
+following the name and continuing to the end of the line. | |
+The definition can subsequently be referred to using | |
+.Qq {name} , | |
+which will expand to | |
+.Qq (definition) . | |
+For example: | |
+.Bd -literal -offset indent | |
+DIGIT [0-9] | |
+ID [a-z][a-z0-9]* | |
+.Ed | |
+.Pp | |
+This defines | |
+.Qq DIGIT | |
+to be a regular expression which matches a single digit, and | |
+.Qq ID | |
+to be a regular expression which matches a letter | |
+followed by zero-or-more letters-or-digits. | |
+A subsequent reference to | |
+.Pp | |
+.Dl {DIGIT}+"."{DIGIT}* | |
+.Pp | |
+is identical to | |
+.Pp | |
+.Dl ([0-9])+"."([0-9])* | |
+.Pp | |
+and matches one-or-more digits followed by a | |
+.Sq .\& | |
+followed by zero-or-more digits. | |
+.Pp | |
+The | |
+.Em rules | |
+section of the | |
+.Nm | |
+input contains a series of rules of the form: | |
+.Pp | |
+.Dl pattern action | |
+.Pp | |
+The pattern must be unindented and the action must begin | |
+on the same line. | |
+.Pp | |
+See below for a further description of patterns and actions. | |
+.Pp | |
+Finally, the user code section is simply copied to | |
+.Pa lex.yy.c | |
+verbatim. | |
+It is used for companion routines which call or are called by the scanner. | |
+The presence of this section is optional; | |
+if it is missing, the second | |
+.Qq %% | |
+in the input file may be skipped too. | |
+.Pp | |
+In the definitions and rules sections, any indented text or text enclosed in | |
+.Sq %{ | |
+and | |
+.Sq %} | |
+is copied verbatim to the output | |
+.Pq with the %{}'s removed . | |
+The %{}'s must appear unindented on lines by themselves. | |
+.Pp | |
+In the rules section, | |
+any indented or %{} text appearing before the first rule may be used to | |
+declare variables which are local to the scanning routine and | |
+.Pq after the declarations | |
+code which is to be executed whenever the scanning routine is entered. | |
+Other indented or %{} text in the rule section is still copied to the output, | |
+but its meaning is not well-defined and it may well cause compile-time | |
+errors (this feature is present for | |
+.Tn POSIX | |
+compliance; see below for other such features). | |
+.Pp | |
+In the definitions section | |
+.Pq but not in the rules section , | |
+an unindented comment | |
+(i.e., a line beginning with | |
+.Qq /* ) | |
+is also copied verbatim to the output up to the next | |
+.Qq */ . | |
+.Sh PATTERNS | |
+The patterns in the input are written using an extended set of regular | |
+expressions. | |
+These are: | |
+.Bl -tag -width "XXXXXXXX" | |
+.It x | |
+Match the character | |
+.Sq x . | |
+.It .\& | |
+Any character | |
+.Pq byte | |
+except newline. | |
+.It [xyz] | |
+A | |
+.Qq character class ; | |
+in this case, the pattern matches either an | |
+.Sq x , | |
+a | |
+.Sq y , | |
+or a | |
+.Sq z . | |
+.It [abj-oZ] | |
+A | |
+.Qq character class | |
+with a range in it; matches an | |
+.Sq a , | |
+a | |
+.Sq b , | |
+any letter from | |
+.Sq j | |
+through | |
+.Sq o , | |
+or a | |
+.Sq Z . | |
+.It [^A-Z] | |
+A | |
+.Qq negated character class , | |
+i.e., any character but those in the class. | |
+In this case, any character EXCEPT an uppercase letter. | |
+.It [^A-Z\en] | |
+Any character EXCEPT an uppercase letter or a newline. | |
+.It r* | |
+Zero or more r's, where | |
+.Sq r | |
+is any regular expression. | |
+.It r+ | |
+One or more r's. | |
+.It r? | |
+Zero or one r's (that is, | |
+.Qq an optional r ) . | |
+.It r{2,5} | |
+Anywhere from two to five r's. | |
+.It r{2,} | |
+Two or more r's. | |
+.It r{4} | |
+Exactly 4 r's. | |
+.It {name} | |
+The expansion of the | |
+.Qq name | |
+definition | |
+.Pq see above . | |
+.It \&"[xyz]\e\&"foo\&" | |
+The literal string: [xyz]"foo. | |
+.It \eX | |
+If | |
+.Sq X | |
+is an | |
+.Sq a , | |
+.Sq b , | |
+.Sq f , | |
+.Sq n , | |
+.Sq r , | |
+.Sq t , | |
+or | |
+.Sq v , | |
+then the ANSI-C interpretation of | |
+.Sq \eX . | |
+Otherwise, a literal | |
+.Sq X | |
+(used to escape operators such as | |
+.Sq * ) . | |
+.It \e0 | |
+A NUL character | |
+.Pq ASCII code 0 . | |
+.It \e123 | |
+The character with octal value 123. | |
+.It \ex2a | |
+The character with hexadecimal value 2a. | |
+.It (r) | |
+Match an | |
+.Sq r ; | |
+parentheses are used to override precedence | |
+.Pq see below . | |
+.It rs | |
+The regular expression | |
+.Sq r | |
+followed by the regular expression | |
+.Sq s ; | |
+called | |
+.Qq concatenation . | |
+.It r|s | |
+Either an | |
+.Sq r | |
+or an | |
+.Sq s . | |
+.It r/s | |
+An | |
+.Sq r , | |
+but only if it is followed by an | |
+.Sq s . | |
+The text matched by | |
+.Sq s | |
+is included when determining whether this rule is the | |
+.Qq longest match , | |
+but is then returned to the input before the action is executed. | |
+So the action only sees the text matched by | |
+.Sq r . | |
+This type of pattern is called | |
+.Qq trailing context . | |
+(There are some combinations of r/s that | |
+.Nm | |
+cannot match correctly; see notes in the | |
+.Sx BUGS | |
+section below regarding | |
+.Qq dangerous trailing context . ) | |
+.It ^r | |
+An | |
+.Sq r , | |
+but only at the beginning of a line | |
+(i.e., just starting to scan, or right after a newline has been scanned). | |
+.It r$ | |
+An | |
+.Sq r , | |
+but only at the end of a line | |
+.Pq i.e., just before a newline . | |
+Equivalent to | |
+.Qq r/\en . | |
+.Pp | |
+Note that | |
+.Nm flex Ns 's | |
+notion of | |
+.Qq newline | |
+is exactly whatever the C compiler used to compile | |
+.Nm | |
+interprets | |
+.Sq \en | |
+as. | |
+.\" In particular, on some DOS systems you must either filter out \er's in the | |
+.\" input yourself, or explicitly use r/\er\en for | |
+.\" .Qq r$ . | |
+.It <s>r | |
+An | |
+.Sq r , | |
+but only in start condition | |
+.Sq s | |
+.Pq see below for discussion of start conditions . | |
+.It <s1,s2,s3>r | |
+The same, but in any of start conditions s1, s2, or s3. | |
+.It <*>r | |
+An | |
+.Sq r | |
+in any start condition, even an exclusive one. | |
+.It <<EOF>> | |
+An end-of-file. | |
+.It <s1,s2><<EOF>> | |
+An end-of-file when in start condition s1 or s2. | |
+.El | |
+.Pp | |
+Note that inside of a character class, all regular expression operators | |
+lose their special meaning except escape | |
+.Pq Sq \e | |
+and the character class operators, | |
+.Sq - , | |
+.Sq ]\& , | |
+and, at the beginning of the class, | |
+.Sq ^ . | |
+.Pp | |
+The regular expressions listed above are grouped according to | |
+precedence, from highest precedence at the top to lowest at the bottom. | |
+Those grouped together have equal precedence. | |
+For example, | |
+.Pp | |
+.D1 foo|bar* | |
+.Pp | |
+is the same as | |
+.Pp | |
+.D1 (foo)|(ba(r*)) | |
+.Pp | |
+since the | |
+.Sq * | |
+operator has higher precedence than concatenation, | |
+and concatenation higher than alternation | |
+.Pq Sq |\& . | |
+This pattern therefore matches | |
+.Em either | |
+the string | |
+.Qq foo | |
+.Em or | |
+the string | |
+.Qq ba | |
+followed by zero-or-more r's. | |
+To match | |
+.Qq foo | |
+or zero-or-more "bar"'s, | |
+use: | |
+.Pp | |
+.D1 foo|(bar)* | |
+.Pp | |
+and to match zero-or-more "foo"'s-or-"bar"'s: | |
+.Pp | |
+.D1 (foo|bar)* | |
+.Pp | |
+In addition to characters and ranges of characters, character classes | |
+can also contain character class | |
+.Em expressions . | |
+These are expressions enclosed inside | |
+.Sq [: | |
+and | |
+.Sq :] | |
+delimiters (which themselves must appear between the | |
+.Sq \&[ | |
+and | |
+.Sq ]\& | |
+of the | |
+character class; other elements may occur inside the character class, too). | |
+The valid expressions are: | |
+.Bd -unfilled -offset indent | |
+[:alnum:] [:alpha:] [:blank:] | |
+[:cntrl:] [:digit:] [:graph:] | |
+[:lower:] [:print:] [:punct:] | |
+[:space:] [:upper:] [:xdigit:] | |
+.Ed | |
+.Pp | |
+These expressions all designate a set of characters equivalent to | |
+the corresponding standard C | |
+.Fn isXXX | |
+function. | |
+For example, [:alnum:] designates those characters for which | |
+.Xr isalnum 3 | |
+returns true \- i.e., any alphabetic or numeric. | |
+Some systems don't provide | |
+.Xr isblank 3 , | |
+so | |
+.Nm | |
+defines [:blank:] as a blank or a tab. | |
+.Pp | |
+For example, the following character classes are all equivalent: | |
+.Bd -unfilled -offset indent | |
+[[:alnum:]] | |
+[[:alpha:][:digit:]] | |
+[[:alpha:]0-9] | |
+[a-zA-Z0-9] | |
+.Ed | |
+.Pp | |
+If the scanner is case-insensitive (the | |
+.Fl i | |
+flag), then [:upper:] and [:lower:] are equivalent to [:alpha:]. | |
+.Pp | |
+Some notes on patterns: | |
+.Bl -dash | |
+.It | |
+A negated character class such as the example | |
+.Qq [^A-Z] | |
+above will match a newline unless "\en" | |
+.Pq or an equivalent escape sequence | |
+is one of the characters explicitly present in the negated character class | |
+(e.g., | |
+.Qq [^A-Z\en] ) . | |
+This is unlike how many other regular expression tools treat negated character | |
+classes, but unfortunately the inconsistency is historically entrenched. | |
+Matching newlines means that a pattern like | |
+.Qq [^"]* | |
+can match the entire input unless there's another quote in the input. | |
+.It | |
+A rule can have at most one instance of trailing context | |
+(the | |
+.Sq / | |
+operator or the | |
+.Sq $ | |
+operator). | |
+The start condition, | |
+.Sq ^ , | |
+and | |
+.Qq <<EOF>> | |
+patterns can only occur at the beginning of a pattern and, as well as with | |
+.Sq / | |
+and | |
+.Sq $ , | |
+cannot be grouped inside parentheses. | |
+A | |
+.Sq ^ | |
+which does not occur at the beginning of a rule or a | |
+.Sq $ | |
+which does not occur at the end of a rule loses its special properties | |
+and is treated as a normal character. | |
+.It | |
+The following are illegal: | |
+.Bd -unfilled -offset indent | |
+foo/bar$ | |
+<sc1>foo<sc2>bar | |
+.Ed | |
+.Pp | |
+Note that the first of these, can be written | |
+.Qq foo/bar\en . | |
+.It | |
+The following will result in | |
+.Sq $ | |
+or | |
+.Sq ^ | |
+being treated as a normal character: | |
+.Bd -unfilled -offset indent | |
+foo|(bar$) | |
+foo|^bar | |
+.Ed | |
+.Pp | |
+If what's wanted is a | |
+.Qq foo | |
+or a bar-followed-by-a-newline, the following could be used | |
+(the special | |
+.Sq |\& | |
+action is explained below): | |
+.Bd -unfilled -offset indent | |
+foo | | |
+bar$ /* action goes here */ | |
+.Ed | |
+.Pp | |
+A similar trick will work for matching a foo or a | |
+bar-at-the-beginning-of-a-line. | |
+.El | |
+.Sh HOW THE INPUT IS MATCHED | |
+When the generated scanner is run, | |
+it analyzes its input looking for strings which match any of its patterns. | |
+If it finds more than one match, | |
+it takes the one matching the most text | |
+(for trailing context rules, this includes the length of the trailing part, | |
+even though it will then be returned to the input). | |
+If it finds two or more matches of the same length, | |
+the rule listed first in the | |
+.Nm | |
+input file is chosen. | |
+.Pp | |
+Once the match is determined, the text corresponding to the match | |
+(called the | |
+.Em token ) | |
+is made available in the global character pointer | |
+.Fa yytext , | |
+and its length in the global integer | |
+.Fa yyleng . | |
+The | |
+.Em action | |
+corresponding to the matched pattern is then executed | |
+.Pq a more detailed description of actions follows , | |
+and then the remaining input is scanned for another match. | |
+.Pp | |
+If no match is found, then the default rule is executed: | |
+the next character in the input is considered matched and | |
+copied to the standard output. | |
+Thus, the simplest legal | |
+.Nm | |
+input is: | |
+.Pp | |
+.D1 %% | |
+.Pp | |
+which generates a scanner that simply copies its input | |
+.Pq one character at a time | |
+to its output. | |
+.Pp | |
+Note that | |
+.Fa yytext | |
+can be defined in two different ways: | |
+either as a character pointer or as a character array. | |
+Which definition | |
+.Nm | |
+uses can be controlled by including one of the special directives | |
+.Dq %pointer | |
+or | |
+.Dq %array | |
+in the first | |
+.Pq definitions | |
+section of flex input. | |
+The default is | |
+.Dq %pointer , | |
+unless the | |
+.Fl l | |
+.Nm lex | |
+compatibility option is used, in which case | |
+.Fa yytext | |
+will be an array. | |
+The advantage of using | |
+.Dq %pointer | |
+is substantially faster scanning and no buffer overflow when matching | |
+very large tokens | |
+.Pq unless not enough dynamic memory is available . | |
+The disadvantage is that actions are restricted in how they can modify | |
+.Fa yytext | |
+.Pq see the next section , | |
+and calls to the | |
+.Fn unput | |
+function destroy the present contents of | |
+.Fa yytext , | |
+which can be a considerable porting headache when moving between different | |
+.Nm lex | |
+versions. | |
+.Pp | |
+The advantage of | |
+.Dq %array | |
+is that | |
+.Fa yytext | |
+can be modified as much as wanted, and calls to | |
+.Fn unput | |
+do not destroy | |
+.Fa yytext | |
+.Pq see below . | |
+Furthermore, existing | |
+.Nm lex | |
+programs sometimes access | |
+.Fa yytext | |
+externally using declarations of the form: | |
+.Pp | |
+.D1 extern char yytext[]; | |
+.Pp | |
+This definition is erroneous when used with | |
+.Dq %pointer , | |
+but correct for | |
+.Dq %array . | |
+.Pp | |
+.Dq %array | |
+defines | |
+.Fa yytext | |
+to be an array of | |
+.Dv YYLMAX | |
+characters, which defaults to a fairly large value. | |
+The size can be changed by simply #define'ing | |
+.Dv YYLMAX | |
+to a different value in the first section of | |
+.Nm | |
+input. | |
+As mentioned above, with | |
+.Dq %pointer | |
+yytext grows dynamically to accommodate large tokens. | |
+While this means a | |
+.Dq %pointer | |
+scanner can accommodate very large tokens | |
+.Pq such as matching entire blocks of comments , | |
+bear in mind that each time the scanner must resize | |
+.Fa yytext | |
+it also must rescan the entire token from the beginning, so matching such | |
+tokens can prove slow. | |
+.Fa yytext | |
+presently does not dynamically grow if a call to | |
+.Fn unput | |
+results in too much text being pushed back; instead, a run-time error results. | |
+.Pp | |
+Also note that | |
+.Dq %array | |
+cannot be used with C++ scanner classes | |
+.Pq the c++ option; see below . | |
+.Sh ACTIONS | |
+Each pattern in a rule has a corresponding action, | |
+which can be any arbitrary C statement. | |
+The pattern ends at the first non-escaped whitespace character; | |
+the remainder of the line is its action. | |
+If the action is empty, | |
+then when the pattern is matched the input token is simply discarded. | |
+For example, here is the specification for a program | |
+which deletes all occurrences of | |
+.Qq zap me | |
+from its input: | |
+.Bd -literal -offset indent | |
+%% | |
+"zap me" | |
+.Ed | |
+.Pp | |
+(It will copy all other characters in the input to the output since | |
+they will be matched by the default rule.) | |
+.Pp | |
+Here is a program which compresses multiple blanks and tabs down to | |
+a single blank, and throws away whitespace found at the end of a line: | |
+.Bd -literal -offset indent | |
+%% | |
+[ \et]+ putchar(' '); | |
+[ \et]+$ /* ignore this token */ | |
+.Ed | |
+.Pp | |
+If the action contains a | |
+.Sq { , | |
+then the action spans till the balancing | |
+.Sq } | |
+is found, and the action may cross multiple lines. | |
+.Nm | |
+knows about C strings and comments and won't be fooled by braces found | |
+within them, but also allows actions to begin with | |
+.Sq %{ | |
+and will consider the action to be all the text up to the next | |
+.Sq %} | |
+.Pq regardless of ordinary braces inside the action . | |
+.Pp | |
+An action consisting solely of a vertical bar | |
+.Pq Sq |\& | |
+means | |
+.Qq same as the action for the next rule . | |
+See below for an illustration. | |
+.Pp | |
+Actions can include arbitrary C code, | |
+including return statements to return a value to whatever routine called | |
+.Fn yylex . | |
+Each time | |
+.Fn yylex | |
+is called, it continues processing tokens from where it last left off | |
+until it either reaches the end of the file or executes a return. | |
+.Pp | |
+Actions are free to modify | |
+.Fa yytext | |
+except for lengthening it | |
+(adding characters to its end \- these will overwrite later characters in the | |
+input stream). | |
+This, however, does not apply when using | |
+.Dq %array | |
+.Pq see above ; | |
+in that case, | |
+.Fa yytext | |
+may be freely modified in any way. | |
+.Pp | |
+Actions are free to modify | |
+.Fa yyleng | |
+except they should not do so if the action also includes use of | |
+.Fn yymore | |
+.Pq see below . | |
+.Pp | |
+There are a number of special directives which can be included within | |
+an action: | |
+.Bl -tag -width Ds | |
+.It ECHO | |
+Copies | |
+.Fa yytext | |
+to the scanner's output. | |
+.It BEGIN | |
+Followed by the name of a start condition, places the scanner in the | |
+corresponding start condition | |
+.Pq see below . | |
+.It REJECT | |
+Directs the scanner to proceed on to the | |
+.Qq second best | |
+rule which matched the input | |
+.Pq or a prefix of the input . | |
+The rule is chosen as described above in | |
+.Sx HOW THE INPUT IS MATCHED , | |
+and | |
+.Fa yytext | |
+and | |
+.Fa yyleng | |
+set up appropriately. | |
+It may either be one which matched as much text | |
+as the originally chosen rule but came later in the | |
+.Nm | |
+input file, or one which matched less text. | |
+For example, the following will both count the | |
+words in the input and call the routine | |
+.Fn special | |
+whenever | |
+.Qq frob | |
+is seen: | |
+.Bd -literal -offset indent | |
+int word_count = 0; | |
+%% | |
+ | |
+frob special(); REJECT; | |
+[^ \et\en]+ ++word_count; | |
+.Ed | |
+.Pp | |
+Without the | |
+.Em REJECT , | |
+any "frob"'s in the input would not be counted as words, | |
+since the scanner normally executes only one action per token. | |
+Multiple | |
+.Em REJECT Ns 's | |
+are allowed, | |
+each one finding the next best choice to the currently active rule. | |
+For example, when the following scanner scans the token | |
+.Qq abcd , | |
+it will write | |
+.Qq abcdabcaba | |
+to the output: | |
+.Bd -literal -offset indent | |
+%% | |
+a | | |
+ab | | |
+abc | | |
+abcd ECHO; REJECT; | |
+\&.|\en /* eat up any unmatched character */ | |
+.Ed | |
+.Pp | |
+(The first three rules share the fourth's action since they use | |
+the special | |
+.Sq |\& | |
+action.) | |
+.Em REJECT | |
+is a particularly expensive feature in terms of scanner performance; | |
+if it is used in any of the scanner's actions it will slow down | |
+all of the scanner's matching. | |
+Furthermore, | |
+.Em REJECT | |
+cannot be used with the | |
+.Fl Cf | |
+or | |
+.Fl CF | |
+options | |
+.Pq see below . | |
+.Pp | |
+Note also that unlike the other special actions, | |
+.Em REJECT | |
+is a | |
+.Em branch ; | |
+code immediately following it in the action will not be executed. | |
+.It yymore() | |
+Tells the scanner that the next time it matches a rule, the corresponding | |
+token should be appended onto the current value of | |
+.Fa yytext | |
+rather than replacing it. | |
+For example, given the input | |
+.Qq mega-kludge | |
+the following will write | |
+.Qq mega-mega-kludge | |
+to the output: | |
+.Bd -literal -offset indent | |
+%% | |
+mega- ECHO; yymore(); | |
+kludge ECHO; | |
+.Ed | |
+.Pp | |
+First | |
+.Qq mega- | |
+is matched and echoed to the output. | |
+Then | |
+.Qq kludge | |
+is matched, but the previous | |
+.Qq mega- | |
+is still hanging around at the beginning of | |
+.Fa yytext | |
+so the | |
+.Em ECHO | |
+for the | |
+.Qq kludge | |
+rule will actually write | |
+.Qq mega-kludge . | |
+.Pp | |
+Two notes regarding use of | |
+.Fn yymore : | |
+First, | |
+.Fn yymore | |
+depends on the value of | |
+.Fa yyleng | |
+correctly reflecting the size of the current token, so | |
+.Fa yyleng | |
+must not be modified when using | |
+.Fn yymore . | |
+Second, the presence of | |
+.Fn yymore | |
+in the scanner's action entails a minor performance penalty in the | |
+scanner's matching speed. | |
+.It yyless(n) | |
+Returns all but the first | |
+.Ar n | |
+characters of the current token back to the input stream, where they | |
+will be rescanned when the scanner looks for the next match. | |
+.Fa yytext | |
+and | |
+.Fa yyleng | |
+are adjusted appropriately (e.g., | |
+.Fa yyleng | |
+will now be equal to | |
+.Ar n ) . | |
+For example, on the input | |
+.Qq foobar | |
+the following will write out | |
+.Qq foobarbar : | |
+.Bd -literal -offset indent | |
+%% | |
+foobar ECHO; yyless(3); | |
+[a-z]+ ECHO; | |
+.Ed | |
+.Pp | |
+An argument of 0 to | |
+.Fa yyless | |
+will cause the entire current input string to be scanned again. | |
+Unless how the scanner will subsequently process its input has been changed | |
+(using | |
+.Em BEGIN , | |
+for example), | |
+this will result in an endless loop. | |
+.Pp | |
+Note that | |
+.Fa yyless | |
+is a macro and can only be used in the | |
+.Nm | |
+input file, not from other source files. | |
+.It unput(c) | |
+Puts the character | |
+.Ar c | |
+back into the input stream. | |
+It will be the next character scanned. | |
+The following action will take the current token and cause it | |
+to be rescanned enclosed in parentheses. | |
+.Bd -literal -offset indent | |
+{ | |
+ int i; | |
+ char *yycopy; | |
+ | |
+ /* Copy yytext because unput() trashes yytext */ | |
+ if ((yycopy = strdup(yytext)) == NULL) | |
+ err(1, NULL); | |
+ unput(')'); | |
+ for (i = yyleng - 1; i >= 0; --i) | |
+ unput(yycopy[i]); | |
+ unput('('); | |
+ free(yycopy); | |
+} | |
+.Ed | |
+.Pp | |
+Note that since each | |
+.Fn unput | |
+puts the given character back at the beginning of the input stream, | |
+pushing back strings must be done back-to-front. | |
+.Pp | |
+An important potential problem when using | |
+.Fn unput | |
+is that if using | |
+.Dq %pointer | |
+.Pq the default , | |
+a call to | |
+.Fn unput | |
+destroys the contents of | |
+.Fa yytext , | |
+starting with its rightmost character and devouring one character to | |
+the left with each call. | |
+If the value of | |
+.Fa yytext | |
+should be preserved after a call to | |
+.Fn unput | |
+.Pq as in the above example , | |
+it must either first be copied elsewhere, or the scanner must be built using | |
+.Dq %array | |
+instead (see | |
+.Sx HOW THE INPUT IS MATCHED ) . | |
+.Pp | |
+Finally, note that EOF cannot be put back | |
+to attempt to mark the input stream with an end-of-file. | |
+.It input() | |
+Reads the next character from the input stream. | |
+For example, the following is one way to eat up C comments: | |
+.Bd -literal -offset indent | |
+%% | |
+"/*" { | |
+ int c; | |
+ | |
+ for (;;) { | |
+ while ((c = input()) != '*' && c != EOF) | |
+ ; /* eat up text of comment */ | |
+ | |
+ if (c == '*') { | |
+ while ((c = input()) == '*') | |
+ ; | |
+ if (c == '/') | |
+ break; /* found the end */ | |
+ } | |
+ | |
+ if (c == EOF) { | |
+ errx(1, "EOF in comment"); | |
+ break; | |
+ } | |
+ } | |
+} | |
+.Ed | |
+.Pp | |
+(Note that if the scanner is compiled using C++, then | |
+.Fn input | |
+is instead referred to as | |
+.Fn yyinput , | |
+in order to avoid a name clash with the C++ stream by the name of input.) | |
+.It YY_FLUSH_BUFFER | |
+Flushes the scanner's internal buffer | |
+so that the next time the scanner attempts to match a token, | |
+it will first refill the buffer using | |
+.Dv YY_INPUT | |
+(see | |
+.Sx THE GENERATED SCANNER , | |
+below). | |
+This action is a special case of the more general | |
+.Fn yy_flush_buffer | |
+function, described below in the section | |
+.Sx MULTIPLE INPUT BUFFERS . | |
+.It yyterminate() | |
+Can be used in lieu of a return statement in an action. | |
+It terminates the scanner and returns a 0 to the scanner's caller, indicating | |
+.Qq all done . | |
+By default, | |
+.Fn yyterminate | |
+is also called when an end-of-file is encountered. | |
+It is a macro and may be redefined. | |
+.El | |
+.Sh THE GENERATED SCANNER | |
+The output of | |
+.Nm | |
+is the file | |
+.Pa lex.yy.c , | |
+which contains the scanning routine | |
+.Fn yylex , | |
+a number of tables used by it for matching tokens, | |
+and a number of auxiliary routines and macros. | |
+By default, | |
+.Fn yylex | |
+is declared as follows: | |
+.Bd -unfilled -offset indent | |
+int yylex() | |
+{ | |
+ ... various definitions and the actions in here ... | |
+} | |
+.Ed | |
+.Pp | |
+(If the environment supports function prototypes, then it will | |
+be "int yylex(void)".) | |
+This definition may be changed by defining the | |
+.Dv YY_DECL | |
+macro. | |
+For example: | |
+.Bd -literal -offset indent | |
+#define YY_DECL float lexscan(a, b) float a, b; | |
+.Ed | |
+.Pp | |
+would give the scanning routine the name | |
+.Em lexscan , | |
+returning a float, and taking two floats as arguments. | |
+Note that if arguments are given to the scanning routine using a | |
+K&R-style/non-prototyped function declaration, | |
+the definition must be terminated with a semi-colon | |
+.Pq Sq ;\& . | |
+.Pp | |
+Whenever | |
+.Fn yylex | |
+is called, it scans tokens from the global input file | |
+.Pa yyin | |
+.Pq which defaults to stdin . | |
+It continues until it either reaches an end-of-file | |
+.Pq at which point it returns the value 0 | |
+or one of its actions executes a | |
+.Em return | |
+statement. | |
+.Pp | |
+If the scanner reaches an end-of-file, subsequent calls are undefined | |
+unless either | |
+.Em yyin | |
+is pointed at a new input file | |
+.Pq in which case scanning continues from that file , | |
+or | |
+.Fn yyrestart | |
+is called. | |
+.Fn yyrestart | |
+takes one argument, a | |
+.Fa FILE * | |
+pointer (which can be nil, if | |
+.Dv YY_INPUT | |
+has been set up to scan from a source other than | |
+.Em yyin ) , | |
+and initializes | |
+.Em yyin | |
+for scanning from that file. | |
+Essentially there is no difference between just assigning | |
+.Em yyin | |
+to a new input file or using | |
+.Fn yyrestart | |
+to do so; the latter is available for compatibility with previous versions of | |
+.Nm , | |
+and because it can be used to switch input files in the middle of scanning. | |
+It can also be used to throw away the current input buffer, | |
+by calling it with an argument of | |
+.Em yyin ; | |
+but better is to use | |
+.Dv YY_FLUSH_BUFFER | |
+.Pq see above . | |
+Note that | |
+.Fn yyrestart | |
+does not reset the start condition to | |
+.Em INITIAL | |
+(see | |
+.Sx START CONDITIONS , | |
+below). | |
+.Pp | |
+If | |
+.Fn yylex | |
+stops scanning due to executing a | |
+.Em return | |
+statement in one of the actions, the scanner may then be called again and it | |
+will resume scanning where it left off. | |
+.Pp | |
+By default | |
+.Pq and for purposes of efficiency , | |
+the scanner uses block-reads rather than simple | |
+.Xr getc 3 | |
+calls to read characters from | |
+.Em yyin . | |
+The nature of how it gets its input can be controlled by defining the | |
+.Dv YY_INPUT | |
+macro. | |
+.Dv YY_INPUT Ns 's | |
+calling sequence is | |
+.Qq YY_INPUT(buf,result,max_size) . | |
+Its action is to place up to | |
+.Dv max_size | |
+characters in the character array | |
+.Em buf | |
+and return in the integer variable | |
+.Em result | |
+either the number of characters read or the constant | |
+.Dv YY_NULL | |
+(0 on | |
+.Ux | |
+systems) | |
+to indicate | |
+.Dv EOF . | |
+The default | |
+.Dv YY_INPUT | |
+reads from the global file-pointer | |
+.Qq yyin . | |
+.Pp | |
+A sample definition of | |
+.Dv YY_INPUT | |
+.Pq in the definitions section of the input file : | |
+.Bd -unfilled -offset indent | |
+%{ | |
+#define YY_INPUT(buf,result,max_size) \e | |
+{ \e | |
+ int c = getchar(); \e | |
+ result = (c == EOF) ? YY_NULL : (buf[0] = c, 1); \e | |
+} | |
+%} | |
+.Ed | |
+.Pp | |
+This definition will change the input processing to occur | |
+one character at a time. | |
+.Pp | |
+When the scanner receives an end-of-file indication from | |
+.Dv YY_INPUT , | |
+it then checks the | |
+.Fn yywrap | |
+function. | |
+If | |
+.Fn yywrap | |
+returns false | |
+.Pq zero , | |
+then it is assumed that the function has gone ahead and set up | |
+.Em yyin | |
+to point to another input file, and scanning continues. | |
+If it returns true | |
+.Pq non-zero , | |
+then the scanner terminates, returning 0 to its caller. | |
+Note that in either case, the start condition remains unchanged; | |
+it does not revert to | |
+.Em INITIAL . | |
+.Pp | |
+If you do not supply your own version of | |
+.Fn yywrap , | |
+then you must either use | |
+.Dq %option noyywrap | |
+(in which case the scanner behaves as though | |
+.Fn yywrap | |
+returned 1), or you must link with | |
+.Fl lfl | |
+to obtain the default version of the routine, which always returns 1. | |
+.Pp | |
+Three routines are available for scanning from in-memory buffers rather | |
+than files: | |
+.Fn yy_scan_string , | |
+.Fn yy_scan_bytes , | |
+and | |
+.Fn yy_scan_buffer . | |
+See the discussion of them below in the section | |
+.Sx MULTIPLE INPUT BUFFERS . | |
+.Pp | |
+The scanner writes its | |
+.Em ECHO | |
+output to the | |
+.Em yyout | |
+global | |
+.Pq default, stdout , | |
+which may be redefined by the user simply by assigning it to some other | |
+.Va FILE | |
+pointer. | |
+.Sh START CONDITIONS | |
+.Nm | |
+provides a mechanism for conditionally activating rules. | |
+Any rule whose pattern is prefixed with | |
+.Qq Aq sc | |
+will only be active when the scanner is in the start condition named | |
+.Qq sc . | |
+For example, | |
+.Bd -literal -offset indent | |
+<STRING>[^"]* { /* eat up the string body ... */ | |
+ ... | |
+} | |
+.Ed | |
+.Pp | |
+will be active only when the scanner is in the | |
+.Qq STRING | |
+start condition, and | |
+.Bd -literal -offset indent | |
+<INITIAL,STRING,QUOTE>\e. { /* handle an escape ... */ | |
+ ... | |
+} | |
+.Ed | |
+.Pp | |
+will be active only when the current start condition is either | |
+.Qq INITIAL , | |
+.Qq STRING , | |
+or | |
+.Qq QUOTE . | |
+.Pp | |
+Start conditions are declared in the definitions | |
+.Pq first | |
+section of the input using unindented lines beginning with either | |
+.Sq %s | |
+or | |
+.Sq %x | |
+followed by a list of names. | |
+The former declares | |
+.Em inclusive | |
+start conditions, the latter | |
+.Em exclusive | |
+start conditions. | |
+A start condition is activated using the | |
+.Em BEGIN | |
+action. | |
+Until the next | |
+.Em BEGIN | |
+action is executed, rules with the given start condition will be active and | |
+rules with other start conditions will be inactive. | |
+If the start condition is inclusive, | |
+then rules with no start conditions at all will also be active. | |
+If it is exclusive, | |
+then only rules qualified with the start condition will be active. | |
+A set of rules contingent on the same exclusive start condition | |
+describe a scanner which is independent of any of the other rules in the | |
+.Nm | |
+input. | |
+Because of this, exclusive start conditions make it easy to specify | |
+.Qq mini-scanners | |
+which scan portions of the input that are syntactically different | |
+from the rest | |
+.Pq e.g., comments . | |
+.Pp | |
+If the distinction between inclusive and exclusive start conditions | |
+is still a little vague, here's a simple example illustrating the | |
+connection between the two. | |
+The set of rules: | |
+.Bd -literal -offset indent | |
+%s example | |
+%% | |
+ | |
+<example>foo do_something(); | |
+ | |
+bar something_else(); | |
+.Ed | |
+.Pp | |
+is equivalent to | |
+.Bd -literal -offset indent | |
+%x example | |
+%% | |
+ | |
+<example>foo do_something(); | |
+ | |
+<INITIAL,example>bar something_else(); | |
+.Ed | |
+.Pp | |
+Without the | |
+.Aq INITIAL,example | |
+qualifier, the | |
+.Dq bar | |
+pattern in the second example wouldn't be active | |
+.Pq i.e., couldn't match | |
+when in start condition | |
+.Dq example . | |
+If we just used | |
+.Aq example | |
+to qualify | |
+.Dq bar , | |
+though, then it would only be active in | |
+.Dq example | |
+and not in | |
+.Em INITIAL , | |
+while in the first example it's active in both, | |
+because in the first example the | |
+.Dq example | |
+start condition is an inclusive | |
+.Pq Sq %s | |
+start condition. | |
+.Pp | |
+Also note that the special start-condition specifier | |
+.Sq Aq * | |
+matches every start condition. | |
+Thus, the above example could also have been written: | |
+.Bd -literal -offset indent | |
+%x example | |
+%% | |
+ | |
+<example>foo do_something(); | |
+ | |
+<*>bar something_else(); | |
+.Ed | |
+.Pp | |
+The default rule (to | |
+.Em ECHO | |
+any unmatched character) remains active in start conditions. | |
+It is equivalent to: | |
+.Bd -literal -offset indent | |
+<*>.|\en ECHO; | |
+.Ed | |
+.Pp | |
+.Dq BEGIN(0) | |
+returns to the original state where only the rules with | |
+no start conditions are active. | |
+This state can also be referred to as the start-condition | |
+.Em INITIAL , | |
+so | |
+.Dq BEGIN(INITIAL) | |
+is equivalent to | |
+.Dq BEGIN(0) . | |
+(The parentheses around the start condition name are not required but | |
+are considered good style.) | |
+.Pp | |
+.Em BEGIN | |
+actions can also be given as indented code at the beginning | |
+of the rules section. | |
+For example, the following will cause the scanner to enter the | |
+.Qq SPECIAL | |
+start condition whenever | |
+.Fn yylex | |
+is called and the global variable | |
+.Fa enter_special | |
+is true: | |
+.Bd -literal -offset indent | |
+int enter_special; | |
+ | |
+%x SPECIAL | |
+%% | |
+ if (enter_special) | |
+ BEGIN(SPECIAL); | |
+ | |
+<SPECIAL>blahblahblah | |
+\&...more rules follow... | |
+.Ed | |
+.Pp | |
+To illustrate the uses of start conditions, | |
+here is a scanner which provides two different interpretations | |
+of a string like | |
+.Qq 123.456 . | |
+By default it will treat it as three tokens: the integer | |
+.Qq 123 , | |
+a dot | |
+.Pq Sq .\& , | |
+and the integer | |
+.Qq 456 . | |
+But if the string is preceded earlier in the line by the string | |
+.Qq expect-floats | |
+it will treat it as a single token, the floating-point number 123.456: | |
+.Bd -literal -offset indent | |
+%{ | |
+#include <math.h> | |
+%} | |
+%s expect | |
+ | |
+%% | |
+expect-floats BEGIN(expect); | |
+ | |
+<expect>[0-9]+"."[0-9]+ { | |
+ printf("found a float, = %f\en", | |
+ atof(yytext)); | |
+} | |
+<expect>\en { | |
+ /* | |
+ * That's the end of the line, so | |
+ * we need another "expect-number" | |
+ * before we'll recognize any more | |
+ * numbers. | |
+ */ | |
+ BEGIN(INITIAL); | |
+} | |
+ | |
+[0-9]+ { | |
+ printf("found an integer, = %d\en", | |
+ atoi(yytext)); | |
+} | |
+ | |
+"." printf("found a dot\en"); | |
+.Ed | |
+.Pp | |
+Here is a scanner which recognizes | |
+.Pq and discards | |
+C comments while maintaining a count of the current input line: | |
+.Bd -literal -offset indent | |
+%x comment | |
+%% | |
+int line_num = 1; | |
+ | |
+"/*" BEGIN(comment); | |
+ | |
+<comment>[^*\en]* /* eat anything that's not a '*' */ | |
+<comment>"*"+[^*/\en]* /* eat up '*'s not followed by '/'s */ | |
+<comment>\en ++line_num; | |
+<comment>"*"+"/" BEGIN(INITIAL); | |
+.Ed | |
+.Pp | |
+This scanner goes to a bit of trouble to match as much | |
+text as possible with each rule. | |
+In general, when attempting to write a high-speed scanner | |
+try to match as much as possible in each rule, as it's a big win. | |
+.Pp | |
+Note that start-condition names are really integer values and | |
+can be stored as such. | |
+Thus, the above could be extended in the following fashion: | |
+.Bd -literal -offset indent | |
+%x comment foo | |
+%% | |
+int line_num = 1; | |
+int comment_caller; | |
+ | |
+"/*" { | |
+ comment_caller = INITIAL; | |
+ BEGIN(comment); | |
+} | |
+ | |
+\&... | |
+ | |
+<foo>"/*" { | |
+ comment_caller = foo; | |
+ BEGIN(comment); | |
+} | |
+ | |
+<comment>[^*\en]* /* eat anything that's not a '*' */ | |
+<comment>"*"+[^*/\en]* /* eat up '*'s not followed by '/'s */ | |
+<comment>\en ++line_num; | |
+<comment>"*"+"/" BEGIN(comment_caller); | |
+.Ed | |
+.Pp | |
+Furthermore, the current start condition can be accessed by using | |
+the integer-valued | |
+.Dv YY_START | |
+macro. | |
+For example, the above assignments to | |
+.Em comment_caller | |
+could instead be written | |
+.Pp | |
+.Dl comment_caller = YY_START; | |
+.Pp | |
+Flex provides | |
+.Dv YYSTATE | |
+as an alias for | |
+.Dv YY_START | |
+(since that is what's used by | |
+.At | |
+.Nm lex ) . | |
+.Pp | |
+Note that start conditions do not have their own name-space; | |
+%s's and %x's declare names in the same fashion as #define's. | |
+.Pp | |
+Finally, here's an example of how to match C-style quoted strings using | |
+exclusive start conditions, including expanded escape sequences | |
+(but not including checking for a string that's too long): | |
+.Bd -literal -offset indent | |
+%x str | |
+ | |
+%% | |
+#define MAX_STR_CONST 1024 | |
+char string_buf[MAX_STR_CONST]; | |
+char *string_buf_ptr; | |
+ | |
+\e" string_buf_ptr = string_buf; BEGIN(str); | |
+ | |
+<str>\e" { /* saw closing quote - all done */ | |
+ BEGIN(INITIAL); | |
+ *string_buf_ptr = '\e0'; | |
+ /* | |
+ * return string constant token type and | |
+ * value to parser | |
+ */ | |
+} | |
+ | |
+<str>\en { | |
+ /* error - unterminated string constant */ | |
+ /* generate error message */ | |
+} | |
+ | |
+<str>\e\e[0-7]{1,3} { | |
+ /* octal escape sequence */ | |
+ int result; | |
+ | |
+ (void) sscanf(yytext + 1, "%o", &result); | |
+ | |
+ if (result > 0xff) { | |
+ /* error, constant is out-of-bounds */ | |
+ } else | |
+ *string_buf_ptr++ = result; | |
+} | |
+ | |
+<str>\e\e[0-9]+ { | |
+ /* | |
+ * generate error - bad escape sequence; something | |
+ * like '\e48' or '\e0777777' | |
+ */ | |
+} | |
+ | |
+<str>\e\en *string_buf_ptr++ = '\en'; | |
+<str>\e\et *string_buf_ptr++ = '\et'; | |
+<str>\e\er *string_buf_ptr++ = '\er'; | |
+<str>\e\eb *string_buf_ptr++ = '\eb'; | |
+<str>\e\ef *string_buf_ptr++ = '\ef'; | |
+ | |
+<str>\e\e(.|\en) *string_buf_ptr++ = yytext[1]; | |
+ | |
+<str>[^\e\e\en\e"]+ { | |
+ char *yptr = yytext; | |
+ | |
+ while (*yptr) | |
+ *string_buf_ptr++ = *yptr++; | |
+} | |
+.Ed | |
+.Pp | |
+Often, such as in some of the examples above, | |
+a whole bunch of rules are all preceded by the same start condition(s). | |
+.Nm | |
+makes this a little easier and cleaner by introducing a notion of | |
+start condition | |
+.Em scope . | |
+A start condition scope is begun with: | |
+.Pp | |
+.Dl <SCs>{ | |
+.Pp | |
+where | |
+.Dq SCs | |
+is a list of one or more start conditions. | |
+Inside the start condition scope, every rule automatically has the prefix | |
+.Aq SCs | |
+applied to it, until a | |
+.Sq } | |
+which matches the initial | |
+.Sq { . | |
+So, for example, | |
+.Bd -literal -offset indent | |
+<ESC>{ | |
+ "\e\en" return '\en'; | |
+ "\e\er" return '\er'; | |
+ "\e\ef" return '\ef'; | |
+ "\e\e0" return '\e0'; | |
+} | |
+.Ed | |
+.Pp | |
+is equivalent to: | |
+.Bd -literal -offset indent | |
+<ESC>"\e\en" return '\en'; | |
+<ESC>"\e\er" return '\er'; | |
+<ESC>"\e\ef" return '\ef'; | |
+<ESC>"\e\e0" return '\e0'; | |
+.Ed | |
+.Pp | |
+Start condition scopes may be nested. | |
+.Pp | |
+Three routines are available for manipulating stacks of start conditions: | |
+.Bl -tag -width Ds | |
+.It void yy_push_state(int new_state) | |
+Pushes the current start condition onto the top of the start condition | |
+stack and switches to | |
+.Fa new_state | |
+as though | |
+.Dq BEGIN new_state | |
+had been used | |
+.Pq recall that start condition names are also integers . | |
+.It void yy_pop_state() | |
+Pops the top of the stack and switches to it via | |
+.Em BEGIN . | |
+.It int yy_top_state() | |
+Returns the top of the stack without altering the stack's contents. | |
+.El | |
+.Pp | |
+The start condition stack grows dynamically and so has no built-in | |
+size limitation. | |
+If memory is exhausted, program execution aborts. | |
+.Pp | |
+To use start condition stacks, scanners must include a | |
+.Dq %option stack | |
+directive (see | |
+.Sx OPTIONS | |
+below). | |
+.Sh MULTIPLE INPUT BUFFERS | |
+Some scanners | |
+(such as those which support | |
+.Qq include | |
+files) | |
+require reading from several input streams. | |
+As | |
+.Nm | |
+scanners do a large amount of buffering, one cannot control | |
+where the next input will be read from by simply writing a | |
+.Dv YY_INPUT | |
+which is sensitive to the scanning context. | |
+.Dv YY_INPUT | |
+is only called when the scanner reaches the end of its buffer, which | |
+may be a long time after scanning a statement such as an | |
+.Qq include | |
+which requires switching the input source. | |
+.Pp | |
+To negotiate these sorts of problems, | |
+.Nm | |
+provides a mechanism for creating and switching between multiple | |
+input buffers. | |
+An input buffer is created by using: | |
+.Pp | |
+.D1 YY_BUFFER_STATE yy_create_buffer(FILE *file, int size) | |
+.Pp | |
+which takes a | |
+.Fa FILE | |
+pointer and a | |
+.Fa size | |
+and creates a buffer associated with the given file and large enough to hold | |
+.Fa size | |
+characters (when in doubt, use | |
+.Dv YY_BUF_SIZE | |
+for the size). | |
+It returns a | |
+.Dv YY_BUFFER_STATE | |
+handle, which may then be passed to other routines | |
+.Pq see below . | |
+The | |
+.Dv YY_BUFFER_STATE | |
+type is a pointer to an opaque | |
+.Dq struct yy_buffer_state | |
+structure, so | |
+.Dv YY_BUFFER_STATE | |
+variables may be safely initialized to | |
+.Dq ((YY_BUFFER_STATE) 0) | |
+if desired, and the opaque structure can also be referred to in order to | |
+correctly declare input buffers in source files other than that of scanners. | |
+Note that the | |
+.Fa FILE | |
+pointer in the call to | |
+.Fn yy_create_buffer | |
+is only used as the value of | |
+.Fa yyin | |
+seen by | |
+.Dv YY_INPUT ; | |
+if | |
+.Dv YY_INPUT | |
+is redefined so that it no longer uses | |
+.Fa yyin , | |
+then a nil | |
+.Fa FILE | |
+pointer can safely be passed to | |
+.Fn yy_create_buffer . | |
+To select a particular buffer to scan: | |
+.Pp | |
+.D1 void yy_switch_to_buffer(YY_BUFFER_STATE new_buffer) | |
+.Pp | |
+It switches the scanner's input buffer so subsequent tokens will | |
+come from | |
+.Fa new_buffer . | |
+Note that | |
+.Fn yy_switch_to_buffer | |
+may be used by | |
+.Fn yywrap | |
+to set things up for continued scanning, | |
+instead of opening a new file and pointing | |
+.Fa yyin | |
+at it. | |
+Note also that switching input sources via either | |
+.Fn yy_switch_to_buffer | |
+or | |
+.Fn yywrap | |
+does not change the start condition. | |
+.Pp | |
+.D1 void yy_delete_buffer(YY_BUFFER_STATE buffer) | |
+.Pp | |
+is used to reclaim the storage associated with a buffer. | |
+.Pf ( Fa buffer | |
+can be nil, in which case the routine does nothing.) | |
+To clear the current contents of a buffer: | |
+.Pp | |
+.D1 void yy_flush_buffer(YY_BUFFER_STATE buffer) | |
+.Pp | |
+This function discards the buffer's contents, | |
+so the next time the scanner attempts to match a token from the buffer, | |
+it will first fill the buffer anew using | |
+.Dv YY_INPUT . | |
+.Pp | |
+.Fn yy_new_buffer | |
+is an alias for | |
+.Fn yy_create_buffer , | |
+provided for compatibility with the C++ use of | |
+.Em new | |
+and | |
+.Em delete | |
+for creating and destroying dynamic objects. | |
+.Pp | |
+Finally, the | |
+.Dv YY_CURRENT_BUFFER | |
+macro returns a | |
+.Dv YY_BUFFER_STATE | |
+handle to the current buffer. | |
+.Pp | |
+Here is an example of using these features for writing a scanner | |
+which expands include files (the | |
+.Aq Aq EOF | |
+feature is discussed below): | |
+.Bd -literal -offset indent | |
+/* | |
+ * the "incl" state is used for picking up the name | |
+ * of an include file | |
+ */ | |
+%x incl | |
+ | |
+%{ | |
+#define MAX_INCLUDE_DEPTH 10 | |
+YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH]; | |
+int include_stack_ptr = 0; | |
+%} | |
+ | |
+%% | |
+include BEGIN(incl); | |
+ | |
+[a-z]+ ECHO; | |
+[^a-z\en]*\en? ECHO; | |
+ | |
+<incl>[ \et]* /* eat the whitespace */ | |
+<incl>[^ \et\en]+ { /* got the include file name */ | |
+ if (include_stack_ptr >= MAX_INCLUDE_DEPTH) | |
+ errx(1, "Includes nested too deeply"); | |
+ | |
+ include_stack[include_stack_ptr++] = | |
+ YY_CURRENT_BUFFER; | |
+ | |
+ yyin = fopen(yytext, "r"); | |
+ | |
+ if (yyin == NULL) | |
+ err(1, NULL); | |
+ | |
+ yy_switch_to_buffer( | |
+ yy_create_buffer(yyin, YY_BUF_SIZE)); | |
+ | |
+ BEGIN(INITIAL); | |
+} | |
+ | |
+<<EOF>> { | |
+ if (--include_stack_ptr < 0) | |
+ yyterminate(); | |
+ else { | |
+ yy_delete_buffer(YY_CURRENT_BUFFER); | |
+ yy_switch_to_buffer( | |
+ include_stack[include_stack_ptr]); | |
+ } | |
+} | |
+.Ed | |
+.Pp | |
+Three routines are available for setting up input buffers for | |
+scanning in-memory strings instead of files. | |
+All of them create a new input buffer for scanning the string, | |
+and return a corresponding | |
+.Dv YY_BUFFER_STATE | |
+handle (which should be deleted afterwards using | |
+.Fn yy_delete_buffer ) . | |
+They also switch to the new buffer using | |
+.Fn yy_switch_to_buffer , | |
+so the next call to | |
+.Fn yylex | |
+will start scanning the string. | |
+.Bl -tag -width Ds | |
+.It yy_scan_string(const char *str) | |
+Scans a NUL-terminated string. | |
+.It yy_scan_bytes(const char *bytes, int len) | |
+Scans | |
+.Fa len | |
+bytes | |
+.Pq including possibly NUL's | |
+starting at location | |
+.Fa bytes . | |
+.El | |
+.Pp | |
+Note that both of these functions create and scan a copy | |
+of the string or bytes. | |
+(This may be desirable, since | |
+.Fn yylex | |
+modifies the contents of the buffer it is scanning.) | |
+The copy can be avoided by using: | |
+.Bl -tag -width Ds | |
+.It yy_scan_buffer(char *base, yy_size_t size) | |
+Which scans the buffer starting at | |
+.Fa base , | |
+consisting of | |
+.Fa size | |
+bytes, the last two bytes of which must be | |
+.Dv YY_END_OF_BUFFER_CHAR | |
+.Pq ASCII NUL . | |
+These last two bytes are not scanned; thus, scanning consists of | |
+base[0] through base[size-2], inclusive. | |
+.Pp | |
+If | |
+.Fa base | |
+is not set up in this manner | |
+(i.e., forget the final two | |
+.Dv YY_END_OF_BUFFER_CHAR | |
+bytes), then | |
+.Fn yy_scan_buffer | |
+returns a nil pointer instead of creating a new input buffer. | |
+.Pp | |
+The type | |
+.Fa yy_size_t | |
+is an integral type which can be cast to an integer expression | |
+reflecting the size of the buffer. | |
+.El | |
+.Sh END-OF-FILE RULES | |
+The special rule | |
+.Qq Aq Aq EOF | |
+indicates actions which are to be taken when an end-of-file is encountered and | |
+.Fn yywrap | |
+returns non-zero | |
+.Pq i.e., indicates no further files to process . | |
+The action must finish by doing one of four things: | |
+.Bl -dash | |
+.It | |
+Assigning | |
+.Em yyin | |
+to a new input file | |
+(in previous versions of | |
+.Nm , | |
+after doing the assignment, it was necessary to call the special action | |
+.Dv YY_NEW_FILE ; | |
+this is no longer necessary). | |
+.It | |
+Executing a | |
+.Em return | |
+statement. | |
+.It | |
+Executing the special | |
+.Fn yyterminate | |
+action. | |
+.It | |
+Switching to a new buffer using | |
+.Fn yy_switch_to_buffer | |
+as shown in the example above. | |
+.El | |
+.Pp | |
+.Aq Aq EOF | |
+rules may not be used with other patterns; | |
+they may only be qualified with a list of start conditions. | |
+If an unqualified | |
+.Aq Aq EOF | |
+rule is given, it applies to all start conditions which do not already have | |
+.Aq Aq EOF | |
+actions. | |
+To specify an | |
+.Aq Aq EOF | |
+rule for only the initial start condition, use | |
+.Pp | |
+.Dl <INITIAL><<EOF>> | |
+.Pp | |
+These rules are useful for catching things like unclosed comments. | |
+An example: | |
+.Bd -literal -offset indent | |
+%x quote | |
+%% | |
+ | |
+\&...other rules for dealing with quotes... | |
+ | |
+<quote><<EOF>> { | |
+ error("unterminated quote"); | |
+ yyterminate(); | |
+} | |
+<<EOF>> { | |
+ if (*++filelist) | |
+ yyin = fopen(*filelist, "r"); | |
+ else | |
+ yyterminate(); | |
+} | |
+.Ed | |
+.Sh MISCELLANEOUS MACROS | |
+The macro | |
+.Dv YY_USER_ACTION | |
+can be defined to provide an action | |
+which is always executed prior to the matched rule's action. | |
+For example, | |
+it could be #define'd to call a routine to convert yytext to lower-case. | |
+When | |
+.Dv YY_USER_ACTION | |
+is invoked, the variable | |
+.Fa yy_act | |
+gives the number of the matched rule | |
+.Pq rules are numbered starting with 1 . | |
+For example, to profile how often each rule is matched, | |
+the following would do the trick: | |
+.Pp | |
+.Dl #define YY_USER_ACTION ++ctr[yy_act] | |
+.Pp | |
+where | |
+.Fa ctr | |
+is an array to hold the counts for the different rules. | |
+Note that the macro | |
+.Dv YY_NUM_RULES | |
+gives the total number of rules | |
+(including the default rule, even if | |
+.Fl s | |
+is used), | |
+so a correct declaration for | |
+.Fa ctr | |
+is: | |
+.Pp | |
+.Dl int ctr[YY_NUM_RULES]; | |
+.Pp | |
+The macro | |
+.Dv YY_USER_INIT | |
+may be defined to provide an action which is always executed before | |
+the first scan | |
+.Pq and before the scanner's internal initializations are done . | |
+For example, it could be used to call a routine to read | |
+in a data table or open a logging file. | |
+.Pp | |
+The macro | |
+.Dv yy_set_interactive(is_interactive) | |
+can be used to control whether the current buffer is considered | |
+.Em interactive . | |
+An interactive buffer is processed more slowly, | |
+but must be used when the scanner's input source is indeed | |
+interactive to avoid problems due to waiting to fill buffers | |
+(see the discussion of the | |
+.Fl I | |
+flag below). | |
+A non-zero value in the macro invocation marks the buffer as interactive, | |
+a zero value as non-interactive. | |
+Note that use of this macro overrides | |
+.Dq %option always-interactive | |
+or | |
+.Dq %option never-interactive | |
+(see | |
+.Sx OPTIONS | |
+below). | |
+.Fn yy_set_interactive | |
+must be invoked prior to beginning to scan the buffer that is | |
+.Pq or is not | |
+to be considered interactive. | |
+.Pp | |
+The macro | |
+.Dv yy_set_bol(at_bol) | |
+can be used to control whether the current buffer's scanning | |
+context for the next token match is done as though at the | |
+beginning of a line. | |
+A non-zero macro argument makes rules anchored with | |
+.Sq ^ | |
+active, while a zero argument makes | |
+.Sq ^ | |
+rules inactive. | |
+.Pp | |
+The macro | |
+.Dv YY_AT_BOL | |
+returns true if the next token scanned from the current buffer will have | |
+.Sq ^ | |
+rules active, false otherwise. | |
+.Pp | |
+In the generated scanner, the actions are all gathered in one large | |
+switch statement and separated using | |
+.Dv YY_BREAK , | |
+which may be redefined. | |
+By default, it is simply a | |
+.Qq break , | |
+to separate each rule's action from the following rules. | |
+Redefining | |
+.Dv YY_BREAK | |
+allows, for example, C++ users to | |
+.Dq #define YY_BREAK | |
+to do nothing | |
+(while being very careful that every rule ends with a | |
+.Qq break | |
+or a | |
+.Qq return ! ) | |
+to avoid suffering from unreachable statement warnings where because a rule's | |
+action ends with | |
+.Dq return , | |
+the | |
+.Dv YY_BREAK | |
+is inaccessible. | |
+.Sh VALUES AVAILABLE TO THE USER | |
+This section summarizes the various values available to the user | |
+in the rule actions. | |
+.Bl -tag -width Ds | |
+.It char *yytext | |
+Holds the text of the current token. | |
+It may be modified but not lengthened | |
+.Pq characters cannot be appended to the end . | |
+.Pp | |
+If the special directive | |
+.Dq %array | |
+appears in the first section of the scanner description, then | |
+.Fa yytext | |
+is instead declared | |
+.Dq char yytext[YYLMAX] , | |
+where | |
+.Dv YYLMAX | |
+is a macro definition that can be redefined in the first section | |
+to change the default value | |
+.Pq generally 8KB . | |
+Using | |
+.Dq %array | |
+results in somewhat slower scanners, but the value of | |
+.Fa yytext | |
+becomes immune to calls to | |
+.Fn input | |
+and | |
+.Fn unput , | |
+which potentially destroy its value when | |
+.Fa yytext | |
+is a character pointer. | |
+The opposite of | |
+.Dq %array | |
+is | |
+.Dq %pointer , | |
+which is the default. | |
+.Pp | |
+.Dq %array | |
+cannot be used when generating C++ scanner classes | |
+(the | |
+.Fl + | |
+flag). | |
+.It int yyleng | |
+Holds the length of the current token. | |
+.It FILE *yyin | |
+Is the file which by default | |
+.Nm | |
+reads from. | |
+It may be redefined, but doing so only makes sense before | |
+scanning begins or after an | |
+.Dv EOF | |
+has been encountered. | |
+Changing it in the midst of scanning will have unexpected results since | |
+.Nm | |
+buffers its input; use | |
+.Fn yyrestart | |
+instead. | |
+Once scanning terminates because an end-of-file | |
+has been seen, | |
+.Fa yyin | |
+can be assigned as the new input file | |
+and the scanner can be called again to continue scanning. | |
+.It void yyrestart(FILE *new_file) | |
+May be called to point | |
+.Fa yyin | |
+at the new input file. | |
+The switch-over to the new file is immediate | |
+.Pq any previously buffered-up input is lost . | |
+Note that calling | |
+.Fn yyrestart | |
+with | |
+.Fa yyin | |
+as an argument thus throws away the current input buffer and continues | |
+scanning the same input file. | |
+.It FILE *yyout | |
+Is the file to which | |
+.Em ECHO | |
+actions are done. | |
+It can be reassigned by the user. | |
+.It YY_CURRENT_BUFFER | |
+Returns a | |
+.Dv YY_BUFFER_STATE | |
+handle to the current buffer. | |
+.It YY_START | |
+Returns an integer value corresponding to the current start condition. | |
+This value can subsequently be used with | |
+.Em BEGIN | |
+to return to that start condition. | |
+.El | |
+.Sh INTERFACING WITH YACC | |
+One of the main uses of | |
+.Nm | |
+is as a companion to the | |
+.Xr yacc 1 | |
+parser-generator. | |
+yacc parsers expect to call a routine named | |
+.Fn yylex | |
+to find the next input token. | |
+The routine is supposed to return the type of the next token | |
+as well as putting any associated value in the global | |
+.Fa yylval , | |
+which is defined externally, | |
+and can be a union or any other complex data structure. | |
+To use | |
+.Nm | |
+with yacc, one specifies the | |
+.Fl d | |
+option to yacc to instruct it to generate the file | |
+.Pa y.tab.h | |
+containing definitions of all the | |
+.Dq %tokens | |
+appearing in the yacc input. | |
+This file is then included in the | |
+.Nm | |
+scanner. | |
+For example, if one of the tokens is | |
+.Qq TOK_NUMBER , | |
+part of the scanner might look like: | |
+.Bd -literal -offset indent | |
+%{ | |
+#include "y.tab.h" | |
+%} | |
+ | |
+%% | |
+ | |
+[0-9]+ yylval = atoi(yytext); return TOK_NUMBER; | |
+.Ed | |
+.Sh OPTIONS | |
+.Nm | |
+has the following options: | |
+.Bl -tag -width Ds | |
+.It Fl 7 | |
+Instructs | |
+.Nm | |
+to generate a 7-bit scanner, i.e., one which can only recognize 7-bit | |
+characters in its input. | |
+The advantage of using | |
+.Fl 7 | |
+is that the scanner's tables can be up to half the size of those generated | |
+using the | |
+.Fl 8 | |
+option | |
+.Pq see below . | |
+The disadvantage is that such scanners often hang | |
+or crash if their input contains an 8-bit character. | |
+.Pp | |
+Note, however, that unless generating a scanner using the | |
+.Fl Cf | |
+or | |
+.Fl CF | |
+table compression options, use of | |
+.Fl 7 | |
+will save only a small amount of table space, | |
+and make the scanner considerably less portable. | |
+.Nm flex Ns 's | |
+default behavior is to generate an 8-bit scanner unless | |
+.Fl Cf | |
+or | |
+.Fl CF | |
+is specified, in which case | |
+.Nm | |
+defaults to generating 7-bit scanners unless it was | |
+configured to generate 8-bit scanners | |
+(as will often be the case with non-USA sites). | |
+It is possible tell whether | |
+.Nm | |
+generated a 7-bit or an 8-bit scanner by inspecting the flag summary in the | |
+.Fl v | |
+output as described below. | |
+.Pp | |
+Note that if | |
+.Fl Cfe | |
+or | |
+.Fl CFe | |
+are used | |
+(the table compression options, but also using equivalence classes as | |
+discussed below), | |
+.Nm | |
+still defaults to generating an 8-bit scanner, | |
+since usually with these compression options full 8-bit tables | |
+are not much more expensive than 7-bit tables. | |
+.It Fl 8 | |
+Instructs | |
+.Nm | |
+to generate an 8-bit scanner, i.e., one which can recognize 8-bit | |
+characters. | |
+This flag is only needed for scanners generated using | |
+.Fl Cf | |
+or | |
+.Fl CF , | |
+as otherwise | |
+.Nm | |
+defaults to generating an 8-bit scanner anyway. | |
+.Pp | |
+See the discussion of | |
+.Fl 7 | |
+above for | |
+.Nm flex Ns 's | |
+default behavior and the tradeoffs between 7-bit and 8-bit scanners. | |
+.It Fl B | |
+Instructs | |
+.Nm | |
+to generate a | |
+.Em batch | |
+scanner, the opposite of | |
+.Em interactive | |
+scanners generated by | |
+.Fl I | |
+.Pq see below . | |
+In general, | |
+.Fl B | |
+is used when the scanner will never be used interactively, | |
+and you want to squeeze a little more performance out of it. | |
+If the aim is instead to squeeze out a lot more performance, | |
+use the | |
+.Fl Cf | |
+or | |
+.Fl CF | |
+options | |
+.Pq discussed below , | |
+which turn on | |
+.Fl B | |
+automatically anyway. | |
+.It Fl b | |
+Generate backing-up information to | |
+.Pa lex.backup . | |
+This is a list of scanner states which require backing up | |
+and the input characters on which they do so. | |
+By adding rules one can remove backing-up states. | |
+If all backing-up states are eliminated and | |
+.Fl Cf | |
+or | |
+.Fl CF | |
+is used, the generated scanner will run faster (see the | |
+.Fl p | |
+flag). | |
+Only users who wish to squeeze every last cycle out of their | |
+scanners need worry about this option. | |
+(See the section on | |
+.Sx PERFORMANCE CONSIDERATIONS | |
+below.) | |
+.It Fl C Ns Op Cm aeFfmr | |
+Controls the degree of table compression and, more generally, trade-offs | |
+between small scanners and fast scanners. | |
+.Bl -tag -width Ds | |
+.It Fl Ca | |
+Instructs | |
+.Nm | |
+to trade off larger tables in the generated scanner for faster performance | |
+because the elements of the tables are better aligned for memory access | |
+and computation. | |
+On some | |
+.Tn RISC | |
+architectures, fetching and manipulating longwords is more efficient | |
+than with smaller-sized units such as shortwords. | |
+This option can double the size of the tables used by the scanner. | |
+.It Fl Ce | |
+Directs | |
+.Nm | |
+to construct | |
+.Em equivalence classes , | |
+i.e., sets of characters which have identical lexical properties | |
+(for example, if the only appearance of digits in the | |
+.Nm | |
+input is in the character class | |
+.Qq [0-9] | |
+then the digits | |
+.Sq 0 , | |
+.Sq 1 , | |
+.Sq ... , | |
+.Sq 9 | |
+will all be put in the same equivalence class). | |
+Equivalence classes usually give dramatic reductions in the final | |
+table/object file sizes | |
+.Pq typically a factor of 2\-5 | |
+and are pretty cheap performance-wise | |
+.Pq one array look-up per character scanned . | |
+.It Fl CF | |
+Specifies that the alternate fast scanner representation | |
+(described below under the | |
+.Fl F | |
+option) | |
+should be used. | |
+This option cannot be used with | |
+.Fl + . | |
+.It Fl Cf | |
+Specifies that the | |
+.Em full | |
+scanner tables should be generated \- | |
+.Nm | |
+should not compress the tables by taking advantage of | |
+similar transition functions for different states. | |
+.It Fl \&Cm | |
+Directs | |
+.Nm | |
+to construct | |
+.Em meta-equivalence classes , | |
+which are sets of equivalence classes | |
+(or characters, if equivalence classes are not being used) | |
+that are commonly used together. | |
+Meta-equivalence classes are often a big win when using compressed tables, | |
+but they have a moderate performance impact | |
+(one or two | |
+.Qq if | |
+tests and one array look-up per character scanned). | |
+.It Fl Cr | |
+Causes the generated scanner to | |
+.Em bypass | |
+use of the standard I/O library | |
+.Pq stdio | |
+for input. | |
+Instead of calling | |
+.Xr fread 3 | |
+or | |
+.Xr getc 3 , | |
+the scanner will use the | |
+.Xr read 2 | |
+system call, | |
+resulting in a performance gain which varies from system to system, | |
+but in general is probably negligible unless | |
+.Fl Cf | |
+or | |
+.Fl CF | |
+are being used. | |
+Using | |
+.Fl Cr | |
+can cause strange behavior if, for example, reading from | |
+.Fa yyin | |
+using stdio prior to calling the scanner | |
+(because the scanner will miss whatever text previous reads left | |
+in the stdio input buffer). | |
+.Pp | |
+.Fl Cr | |
+has no effect if | |
+.Dv YY_INPUT | |
+is defined | |
+(see | |
+.Sx THE GENERATED SCANNER | |
+above). | |
+.El | |
+.Pp | |
+A lone | |
+.Fl C | |
+specifies that the scanner tables should be compressed but neither | |
+equivalence classes nor meta-equivalence classes should be used. | |
+.Pp | |
+The options | |
+.Fl Cf | |
+or | |
+.Fl CF | |
+and | |
+.Fl \&Cm | |
+do not make sense together \- there is no opportunity for meta-equivalence | |
+classes if the table is not being compressed. | |
+Otherwise the options may be freely mixed, and are cumulative. | |
+.Pp | |
+The default setting is | |
+.Fl Cem | |
+which specifies that | |
+.Nm | |
+should generate equivalence classes and meta-equivalence classes. | |
+This setting provides the highest degree of table compression. | |
+It is possible to trade off faster-executing scanners at the cost of | |
+larger tables with the following generally being true: | |
+.Bd -unfilled -offset indent | |
+slowest & smallest | |
+ -Cem | |
+ -Cm | |
+ -Ce | |
+ -C | |
+ -C{f,F}e | |
+ -C{f,F} | |
+ -C{f,F}a | |
+fastest & largest | |
+.Ed | |
+.Pp | |
+Note that scanners with the smallest tables are usually generated and | |
+compiled the quickest, | |
+so during development the default is usually best, | |
+maximal compression. | |
+.Pp | |
+.Fl Cfe | |
+is often a good compromise between speed and size for production scanners. | |
+.It Fl d | |
+Makes the generated scanner run in debug mode. | |
+Whenever a pattern is recognized and the global | |
+.Fa yy_flex_debug | |
+is non-zero | |
+.Pq which is the default , | |
+the scanner will write to stderr a line of the form: | |
+.Pp | |
+.D1 --accepting rule at line 53 ("the matched text") | |
+.Pp | |
+The line number refers to the location of the rule in the file | |
+defining the scanner | |
+(i.e., the file that was fed to | |
+.Nm ) . | |
+Messages are also generated when the scanner backs up, | |
+accepts the default rule, | |
+reaches the end of its input buffer | |
+(or encounters a NUL; | |
+at this point, the two look the same as far as the scanner's concerned), | |
+or reaches an end-of-file. | |
+.It Fl F | |
+Specifies that the fast scanner table representation should be used | |
+.Pq and stdio bypassed . | |
+This representation is about as fast as the full table representation | |
+.Pq Fl f , | |
+and for some sets of patterns will be considerably smaller | |
+.Pq and for others, larger . | |
+In general, if the pattern set contains both | |
+.Qq keywords | |
+and a catch-all, | |
+.Qq identifier | |
+rule, such as in the set: | |
+.Bd -unfilled -offset indent | |
+"case" return TOK_CASE; | |
+"switch" return TOK_SWITCH; | |
+\&... | |
+"default" return TOK_DEFAULT; | |
+[a-z]+ return TOK_ID; | |
+.Ed | |
+.Pp | |
+then it's better to use the full table representation. | |
+If only the | |
+.Qq identifier | |
+rule is present and a hash table or some such is used to detect the keywords, | |
+it's better to use | |
+.Fl F . | |
+.Pp | |
+This option is equivalent to | |
+.Fl CFr | |
+.Pq see above . | |
+It cannot be used with | |
+.Fl + . | |
+.It Fl f | |
+Specifies | |
+.Em fast scanner . | |
+No table compression is done and stdio is bypassed. | |
+The result is large but fast. | |
+This option is equivalent to | |
+.Fl Cfr | |
+.Pq see above . | |
+.It Fl h | |
+Generates a help summary of | |
+.Nm flex Ns 's | |
+options to stdout and then exits. | |
+.Fl ?\& | |
+and | |
+.Fl Fl help | |
+are synonyms for | |
+.Fl h . | |
+.It Fl I | |
+Instructs | |
+.Nm | |
+to generate an | |
+.Em interactive | |
+scanner. | |
+An interactive scanner is one that only looks ahead to decide | |
+what token has been matched if it absolutely must. | |
+It turns out that always looking one extra character ahead, | |
+even if the scanner has already seen enough text | |
+to disambiguate the current token, is a bit faster than | |
+only looking ahead when necessary. | |
+But scanners that always look ahead give dreadful interactive performance; | |
+for example, when a user types a newline, | |
+it is not recognized as a newline token until they enter | |
+.Em another | |
+token, which often means typing in another whole line. | |
+.Pp | |
+.Nm | |
+scanners default to | |
+.Em interactive | |
+unless | |
+.Fl Cf | |
+or | |
+.Fl CF | |
+table-compression options are specified | |
+.Pq see above . | |
+That's because if high-performance is most important, | |
+one of these options should be used, | |
+so if they weren't, | |
+.Nm | |
+assumes it is preferable to trade off a bit of run-time performance for | |
+intuitive interactive behavior. | |
+Note also that | |
+.Fl I | |
+cannot be used in conjunction with | |
+.Fl Cf | |
+or | |
+.Fl CF . | |
+Thus, this option is not really needed; it is on by default for all those | |
+cases in which it is allowed. | |
+.Pp | |
+A scanner can be forced to not be interactive by using | |
+.Fl B | |
+.Pq see above . | |
+.It Fl i | |
+Instructs | |
+.Nm | |
+to generate a case-insensitive scanner. | |
+The case of letters given in the | |
+.Nm | |
+input patterns will be ignored, | |
+and tokens in the input will be matched regardless of case. | |
+The matched text given in | |
+.Fa yytext | |
+will have the preserved case | |
+.Pq i.e., it will not be folded . | |
+.It Fl L | |
+Instructs | |
+.Nm | |
+not to generate | |
+.Dq #line | |
+directives. | |
+Without this option, | |
+.Nm | |
+peppers the generated scanner with #line directives so error messages | |
+in the actions will be correctly located with respect to either the original | |
+.Nm | |
+input file | |
+(if the errors are due to code in the input file), | |
+or | |
+.Pa lex.yy.c | |
+(if the errors are | |
+.Nm flex Ns 's | |
+fault \- these sorts of errors should be reported to the email address | |
+given below). | |
+.It Fl l | |
+Turns on maximum compatibility with the original | |
+.At | |
+.Nm lex | |
+implementation. | |
+Note that this does not mean full compatibility. | |
+Use of this option costs a considerable amount of performance, | |
+and it cannot be used with the | |
+.Fl + , f , F , Cf , | |
+or | |
+.Fl CF | |
+options. | |
+For details on the compatibilities it provides, see the section | |
+.Sx INCOMPATIBILITIES WITH LEX AND POSIX | |
+below. | |
+This option also results in the name | |
+.Dv YY_FLEX_LEX_COMPAT | |
+being #define'd in the generated scanner. | |
+.It Fl n | |
+Another do-nothing, deprecated option included only for | |
+.Tn POSIX | |
+compliance. | |
+.It Fl o Ns Ar output | |
+Directs | |
+.Nm | |
+to write the scanner to the file | |
+.Ar output | |
+instead of | |
+.Pa lex.yy.c . | |
+If | |
+.Fl o | |
+is combined with the | |
+.Fl t | |
+option, then the scanner is written to stdout but its | |
+.Dq #line | |
+directives | |
+(see the | |
+.Fl L | |
+option above) | |
+refer to the file | |
+.Ar output . | |
+.It Fl P Ns Ar prefix | |
+Changes the default | |
+.Qq yy | |
+prefix used by | |
+.Nm | |
+for all globally visible variable and function names to instead be | |
+.Ar prefix . | |
+For example, | |
+.Fl P Ns Ar foo | |
+changes the name of | |
+.Fa yytext | |
+to | |
+.Fa footext . | |
+It also changes the name of the default output file from | |
+.Pa lex.yy.c | |
+to | |
+.Pa lex.foo.c . | |
+Here are all of the names affected: | |
+.Bd -unfilled -offset indent | |
+yy_create_buffer | |
+yy_delete_buffer | |
+yy_flex_debug | |
+yy_init_buffer | |
+yy_flush_buffer | |
+yy_load_buffer_state | |
+yy_switch_to_buffer | |
+yyin | |
+yyleng | |
+yylex | |
+yylineno | |
+yyout | |
+yyrestart | |
+yytext | |
+yywrap | |
+.Ed | |
+.Pp | |
+(If using a C++ scanner, then only | |
+.Fa yywrap | |
+and | |
+.Fa yyFlexLexer | |
+are affected.) | |
+Within the scanner itself, it is still possible to refer to the global variables | |
+and functions using either version of their name; but externally, they | |
+have the modified name. | |
+.Pp | |
+This option allows multiple | |
+.Nm | |
+programs to be easily linked together into the same executable. | |
+Note, though, that using this option also renames | |
+.Fn yywrap , | |
+so now either an | |
+.Pq appropriately named | |
+version of the routine for the scanner must be supplied, or | |
+.Dq %option noyywrap | |
+must be used, as linking with | |
+.Fl lfl | |
+no longer provides one by default. | |
+.It Fl p | |
+Generates a performance report to stderr. | |
+The report consists of comments regarding features of the | |
+.Nm | |
+input file which will cause a serious loss of performance in the resulting | |
+scanner. | |
+If the flag is specified twice, | |
+comments regarding features that lead to minor performance losses | |
+will also be reported> | |
+.Pp | |
+Note that the use of | |
+.Em REJECT , | |
+.Dq %option yylineno , | |
+and variable trailing context | |
+(see the | |
+.Sx BUGS | |
+section below) | |
+entails a substantial performance penalty; use of | |
+.Fn yymore , | |
+the | |
+.Sq ^ | |
+operator, and the | |
+.Fl I | |
+flag entail minor performance penalties. | |
+.It Fl S Ns Ar skeleton | |
+Overrides the default skeleton file from which | |
+.Nm | |
+constructs its scanners. | |
+This option is needed only for | |
+.Nm | |
+maintenance or development. | |
+.It Fl s | |
+Causes the default rule | |
+.Pq that unmatched scanner input is echoed to stdout | |
+to be suppressed. | |
+If the scanner encounters input that does not | |
+match any of its rules, it aborts with an error. | |
+This option is useful for finding holes in a scanner's rule set. | |
+.It Fl T | |
+Makes | |
+.Nm | |
+run in | |
+.Em trace | |
+mode. | |
+It will generate a lot of messages to stderr concerning | |
+the form of the input and the resultant non-deterministic and deterministic | |
+finite automata. | |
+This option is mostly for use in maintaining | |
+.Nm . | |
+.It Fl t | |
+Instructs | |
+.Nm | |
+to write the scanner it generates to standard output instead of | |
+.Pa lex.yy.c . | |
+.It Fl V | |
+Prints the version number to stdout and exits. | |
+.Fl Fl version | |
+is a synonym for | |
+.Fl V . | |
+.It Fl v | |
+Specifies that | |
+.Nm | |
+should write to stderr | |
+a summary of statistics regarding the scanner it generates. | |
+Most of the statistics are meaningless to the casual | |
+.Nm | |
+user, but the first line identifies the version of | |
+.Nm | |
+(same as reported by | |
+.Fl V ) , | |
+and the next line the flags used when generating the scanner, | |
+including those that are on by default. | |
+.It Fl w | |
+Suppresses warning messages. | |
+.It Fl + | |
+Specifies that | |
+.Nm | |
+should generate a C++ scanner class. | |
+See the section on | |
+.Sx GENERATING C++ SCANNERS | |
+below for details. | |
+.El | |
+.Pp | |
+.Nm | |
+also provides a mechanism for controlling options within the | |
+scanner specification itself, rather than from the | |
+.Nm | |
+command line. | |
+This is done by including | |
+.Dq %option | |
+directives in the first section of the scanner specification. | |
+Multiple options can be specified with a single | |
+.Dq %option | |
+directive, and multiple directives in the first section of the | |
+.Nm | |
+input file. | |
+.Pp | |
+Most options are given simply as names, optionally preceded by the word | |
+.Qq no | |
+.Pq with no intervening whitespace | |
+to negate their meaning. | |
+A number are equivalent to | |
+.Nm | |
+flags or their negation: | |
+.Bd -unfilled -offset indent | |
+7bit -7 option | |
+8bit -8 option | |
+align -Ca option | |
+backup -b option | |
+batch -B option | |
+c++ -+ option | |
+ | |
+caseful or | |
+case-sensitive opposite of -i (default) | |
+ | |
+case-insensitive or | |
+caseless -i option | |
+ | |
+debug -d option | |
+default opposite of -s option | |
+ecs -Ce option | |
+fast -F option | |
+full -f option | |
+interactive -I option | |
+lex-compat -l option | |
+meta-ecs -Cm option | |
+perf-report -p option | |
+read -Cr option | |
+stdout -t option | |
+verbose -v option | |
+warn opposite of -w option | |
+ (use "%option nowarn" for -w) | |
+ | |
+array equivalent to "%array" | |
+pointer equivalent to "%pointer" (default) | |
+.Ed | |
+.Pp | |
+Some %option's provide features otherwise not available: | |
+.Bl -tag -width Ds | |
+.It always-interactive | |
+Instructs | |
+.Nm | |
+to generate a scanner which always considers its input | |
+.Qq interactive . | |
+Normally, on each new input file the scanner calls | |
+.Fn isatty | |
+in an attempt to determine whether the scanner's input source is interactive | |
+and thus should be read a character at a time. | |
+When this option is used, however, no such call is made. | |
+.It main | |
+Directs | |
+.Nm | |
+to provide a default | |
+.Fn main | |
+program for the scanner, which simply calls | |
+.Fn yylex . | |
+This option implies | |
+.Dq noyywrap | |
+.Pq see below . | |
+.It never-interactive | |
+Instructs | |
+.Nm | |
+to generate a scanner which never considers its input | |
+.Qq interactive | |
+(again, no call made to | |
+.Fn isatty ) . | |
+This is the opposite of | |
+.Dq always-interactive . | |
+.It stack | |
+Enables the use of start condition stacks | |
+(see | |
+.Sx START CONDITIONS | |
+above). | |
+.It stdinit | |
+If set (i.e., | |
+.Dq %option stdinit ) , | |
+initializes | |
+.Fa yyin | |
+and | |
+.Fa yyout | |
+to stdin and stdout, instead of the default of | |
+.Dq nil . | |
+Some existing | |
+.Nm lex | |
+programs depend on this behavior, even though it is not compliant with ANSI C, | |
+which does not require stdin and stdout to be compile-time constant. | |
+.It yylineno | |
+Directs | |
+.Nm | |
+to generate a scanner that maintains the number of the current line | |
+read from its input in the global variable | |
+.Fa yylineno . | |
+This option is implied by | |
+.Dq %option lex-compat . | |
+.It yywrap | |
+If unset (i.e., | |
+.Dq %option noyywrap ) , | |
+makes the scanner not call | |
+.Fn yywrap | |
+upon an end-of-file, but simply assume that there are no more files to scan | |
+(until the user points | |
+.Fa yyin | |
+at a new file and calls | |
+.Fn yylex | |
+again). | |
+.El | |
+.Pp | |
+.Nm | |
+scans rule actions to determine whether the | |
+.Em REJECT | |
+or | |
+.Fn yymore | |
+features are being used. | |
+The | |
+.Dq reject | |
+and | |
+.Dq yymore | |
+options are available to override its decision as to whether to use the | |
+options, either by setting them (e.g., | |
+.Dq %option reject ) | |
+to indicate the feature is indeed used, | |
+or unsetting them to indicate it actually is not used | |
+(e.g., | |
+.Dq %option noyymore ) . | |
+.Pp | |
+Three options take string-delimited values, offset with | |
+.Sq = : | |
+.Pp | |
+.D1 %option outfile="ABC" | |
+.Pp | |
+is equivalent to | |
+.Fl o Ns Ar ABC , | |
+and | |
+.Pp | |
+.D1 %option prefix="XYZ" | |
+.Pp | |
+is equivalent to | |
+.Fl P Ns Ar XYZ . | |
+Finally, | |
+.Pp | |
+.D1 %option yyclass="foo" | |
+.Pp | |
+only applies when generating a C++ scanner | |
+.Pf ( Fl + | |
+option). | |
+It informs | |
+.Nm | |
+that | |
+.Dq foo | |
+has been derived as a subclass of yyFlexLexer, so | |
+.Nm | |
+will place actions in the member function | |
+.Dq foo::yylex() | |
+instead of | |
+.Dq yyFlexLexer::yylex() . | |
+It also generates a | |
+.Dq yyFlexLexer::yylex() | |
+member function that emits a run-time error (by invoking | |
+.Dq yyFlexLexer::LexerError() ) | |
+if called. | |
+See | |
+.Sx GENERATING C++ SCANNERS , | |
+below, for additional information. | |
+.Pp | |
+A number of options are available for | |
+lint | |
+purists who want to suppress the appearance of unneeded routines | |
+in the generated scanner. | |
+Each of the following, if unset | |
+(e.g., | |
+.Dq %option nounput ) , | |
+results in the corresponding routine not appearing in the generated scanner: | |
+.Bd -unfilled -offset indent | |
+input, unput | |
+yy_push_state, yy_pop_state, yy_top_state | |
+yy_scan_buffer, yy_scan_bytes, yy_scan_string | |
+.Ed | |
+.Pp | |
+(though | |
+.Fn yy_push_state | |
+and friends won't appear anyway unless | |
+.Dq %option stack | |
+is being used). | |
+.Sh PERFORMANCE CONSIDERATIONS | |
+The main design goal of | |
+.Nm | |
+is that it generate high-performance scanners. | |
+It has been optimized for dealing well with large sets of rules. | |
+Aside from the effects on scanner speed of the table compression | |
+.Fl C | |
+options outlined above, | |
+there are a number of options/actions which degrade performance. | |
+These are, from most expensive to least: | |
+.Bd -unfilled -offset indent | |
+REJECT | |
+%option yylineno | |
+arbitrary trailing context | |
+ | |
+pattern sets that require backing up | |
+%array | |
+%option interactive | |
+%option always-interactive | |
+ | |
+\&'^' beginning-of-line operator | |
+yymore() | |
+.Ed | |
+.Pp | |
+with the first three all being quite expensive | |
+and the last two being quite cheap. | |
+Note also that | |
+.Fn unput | |
+is implemented as a routine call that potentially does quite a bit of work, | |
+while | |
+.Fn yyless | |
+is a quite-cheap macro; so if just putting back some excess text, | |
+use | |
+.Fn yyless . | |
+.Pp | |
+.Em REJECT | |
+should be avoided at all costs when performance is important. | |
+It is a particularly expensive option. | |
+.Pp | |
+Getting rid of backing up is messy and often may be an enormous | |
+amount of work for a complicated scanner. | |
+In principal, one begins by using the | |
+.Fl b | |
+flag to generate a | |
+.Pa lex.backup | |
+file. | |
+For example, on the input | |
+.Bd -literal -offset indent | |
+%% | |
+foo return TOK_KEYWORD; | |
+foobar return TOK_KEYWORD; | |
+.Ed | |
+.Pp | |
+the file looks like: | |
+.Bd -literal -offset indent | |
+State #6 is non-accepting - | |
+ associated rule line numbers: | |
+ 2 3 | |
+ out-transitions: [ o ] | |
+ jam-transitions: EOF [ \e001-n p-\e177 ] | |
+ | |
+State #8 is non-accepting - | |
+ associated rule line numbers: | |
+ 3 | |
+ out-transitions: [ a ] | |
+ jam-transitions: EOF [ \e001-` b-\e177 ] | |
+ | |
+State #9 is non-accepting - | |
+ associated rule line numbers: | |
+ 3 | |
+ out-transitions: [ r ] | |
+ jam-transitions: EOF [ \e001-q s-\e177 ] | |
+ | |
+Compressed tables always back up. | |
+.Ed | |
+.Pp | |
+The first few lines tell us that there's a scanner state in | |
+which it can make a transition on an | |
+.Sq o | |
+but not on any other character, | |
+and that in that state the currently scanned text does not match any rule. | |
+The state occurs when trying to match the rules found | |
+at lines 2 and 3 in the input file. | |
+If the scanner is in that state and then reads something other than an | |
+.Sq o , | |
+it will have to back up to find a rule which is matched. | |
+With a bit of headscratching one can see that this must be the | |
+state it's in when it has seen | |
+.Sq fo . | |
+When this has happened, if anything other than another | |
+.Sq o | |
+is seen, the scanner will have to back up to simply match the | |
+.Sq f | |
+.Pq by the default rule . | |
+.Pp | |
+The comment regarding State #8 indicates there's a problem when | |
+.Qq foob | |
+has been scanned. | |
+Indeed, on any character other than an | |
+.Sq a , | |
+the scanner will have to back up to accept | |
+.Qq foo . | |
+Similarly, the comment for State #9 concerns when | |
+.Qq fooba | |
+has been scanned and an | |
+.Sq r | |
+does not follow. | |
+.Pp | |
+The final comment reminds us that there's no point going to | |
+all the trouble of removing backing up from the rules unless we're using | |
+.Fl Cf | |
+or | |
+.Fl CF , | |
+since there's no performance gain doing so with compressed scanners. | |
+.Pp | |
+The way to remove the backing up is to add | |
+.Qq error | |
+rules: | |
+.Bd -literal -offset indent | |
+%% | |
+foo return TOK_KEYWORD; | |
+foobar return TOK_KEYWORD; | |
+ | |
+fooba | | |
+foob | | |
+fo { | |
+ /* false alarm, not really a keyword */ | |
+ return TOK_ID; | |
+} | |
+.Ed | |
+.Pp | |
+Eliminating backing up among a list of keywords can also be done using a | |
+.Qq catch-all | |
+rule: | |
+.Bd -literal -offset indent | |
+%% | |
+foo return TOK_KEYWORD; | |
+foobar return TOK_KEYWORD; | |
+ | |
+[a-z]+ return TOK_ID; | |
+.Ed | |
+.Pp | |
+This is usually the best solution when appropriate. | |
+.Pp | |
+Backing up messages tend to cascade. | |
+With a complicated set of rules it's not uncommon to get hundreds of messages. | |
+If one can decipher them, though, | |
+it often only takes a dozen or so rules to eliminate the backing up | |
+(though it's easy to make a mistake and have an error rule accidentally match | |
+a valid token; a possible future | |
+.Nm | |
+feature will be to automatically add rules to eliminate backing up). | |
+.Pp | |
+It's important to keep in mind that the benefits of eliminating | |
+backing up are gained only if | |
+.Em every | |
+instance of backing up is eliminated. | |
+Leaving just one gains nothing. | |
+.Pp | |
+.Em Variable | |
+trailing context | |
+(where both the leading and trailing parts do not have a fixed length) | |
+entails almost the same performance loss as | |
+.Em REJECT | |
+.Pq i.e., substantial . | |
+So when possible a rule like: | |
+.Bd -literal -offset indent | |
+%% | |
+mouse|rat/(cat|dog) run(); | |
+.Ed | |
+.Pp | |
+is better written: | |
+.Bd -literal -offset indent | |
+%% | |
+mouse/cat|dog run(); | |
+rat/cat|dog run(); | |
+.Ed | |
+.Pp | |
+or as | |
+.Bd -literal -offset indent | |
+%% | |
+mouse|rat/cat run(); | |
+mouse|rat/dog run(); | |
+.Ed | |
+.Pp | |
+Note that here the special | |
+.Sq |\& | |
+action does not provide any savings, and can even make things worse (see | |
+.Sx BUGS | |
+below). | |
+.Pp | |
+Another area where the user can increase a scanner's performance | |
+.Pq and one that's easier to implement | |
+arises from the fact that the longer the tokens matched, | |
+the faster the scanner will run. | |
+This is because with long tokens the processing of most input | |
+characters takes place in the | |
+.Pq short | |
+inner scanning loop, and does not often have to go through the additional work | |
+of setting up the scanning environment (e.g., | |
+.Fa yytext ) | |
+for the action. | |
+Recall the scanner for C comments: | |
+.Bd -literal -offset indent | |
+%x comment | |
+%% | |
+int line_num = 1; | |
+ | |
+"/*" BEGIN(comment); | |
+ | |
+<comment>[^*\en]* | |
+<comment>"*"+[^*/\en]* | |
+<comment>\en ++line_num; | |
+<comment>"*"+"/" BEGIN(INITIAL); | |
+.Ed | |
+.Pp | |
+This could be sped up by writing it as: | |
+.Bd -literal -offset indent | |
+%x comment | |
+%% | |
+int line_num = 1; | |
+ | |
+"/*" BEGIN(comment); | |
+ | |
+<comment>[^*\en]* | |
+<comment>[^*\en]*\en ++line_num; | |
+<comment>"*"+[^*/\en]* | |
+<comment>"*"+[^*/\en]*\en ++line_num; | |
+<comment>"*"+"/" BEGIN(INITIAL); | |
+.Ed | |
+.Pp | |
+Now instead of each newline requiring the processing of another action, | |
+recognizing the newlines is | |
+.Qq distributed | |
+over the other rules to keep the matched text as long as possible. | |
+Note that adding rules does | |
+.Em not | |
+slow down the scanner! | |
+The speed of the scanner is independent of the number of rules or | |
+(modulo the considerations given at the beginning of this section) | |
+how complicated the rules are with regard to operators such as | |
+.Sq * | |
+and | |
+.Sq |\& . | |
+.Pp | |
+A final example in speeding up a scanner: | |
+scan through a file containing identifiers and keywords, one per line | |
+and with no other extraneous characters, and recognize all the keywords. | |
+A natural first approach is: | |
+.Bd -literal -offset indent | |
+%% | |
+asm | | |
+auto | | |
+break | | |
+\&... etc ... | |
+volatile | | |
+while /* it's a keyword */ | |
+ | |
+\&.|\en /* it's not a keyword */ | |
+.Ed | |
+.Pp | |
+To eliminate the back-tracking, introduce a catch-all rule: | |
+.Bd -literal -offset indent | |
+%% | |
+asm | | |
+auto | | |
+break | | |
+\&... etc ... | |
+volatile | | |
+while /* it's a keyword */ | |
+ | |
+[a-z]+ | | |
+\&.|\en /* it's not a keyword */ | |
+.Ed | |
+.Pp | |
+Now, if it's guaranteed that there's exactly one word per line, | |
+then we can reduce the total number of matches by a half by | |
+merging in the recognition of newlines with that of the other tokens: | |
+.Bd -literal -offset indent | |
+%% | |
+asm\en | | |
+auto\en | | |
+break\en | | |
+\&... etc ... | |
+volatile\en | | |
+while\en /* it's a keyword */ | |
+ | |
+[a-z]+\en | | |
+\&.|\en /* it's not a keyword */ | |
+.Ed | |
+.Pp | |
+One has to be careful here, | |
+as we have now reintroduced backing up into the scanner. | |
+In particular, while we know that there will never be any characters | |
+in the input stream other than letters or newlines, | |
+.Nm | |
+can't figure this out, and it will plan for possibly needing to back up | |
+when it has scanned a token like | |
+.Qq auto | |
+and then the next character is something other than a newline or a letter. | |
+Previously it would then just match the | |
+.Qq auto | |
+rule and be done, but now it has no | |
+.Qq auto | |
+rule, only an | |
+.Qq auto\en | |
+rule. | |
+To eliminate the possibility of backing up, | |
+we could either duplicate all rules but without final newlines or, | |
+since we never expect to encounter such an input and therefore don't | |
+how it's classified, we can introduce one more catch-all rule, | |
+this one which doesn't include a newline: | |
+.Bd -literal -offset indent | |
+%% | |
+asm\en | | |
+auto\en | | |
+break\en | | |
+\&... etc ... | |
+volatile\en | | |
+while\en /* it's a keyword */ | |
+ | |
+[a-z]+\en | | |
+[a-z]+ | | |
+\&.|\en /* it's not a keyword */ | |
+.Ed | |
+.Pp | |
+Compiled with | |
+.Fl Cf , | |
+this is about as fast as one can get a | |
+.Nm | |
+scanner to go for this particular problem. | |
+.Pp | |
+A final note: | |
+.Nm | |
+is slow when matching NUL's, | |
+particularly when a token contains multiple NUL's. | |
+It's best to write rules which match short | |
+amounts of text if it's anticipated that the text will often include NUL's. | |
+.Pp | |
+Another final note regarding performance: as mentioned above in the section | |
+.Sx HOW THE INPUT IS MATCHED , | |
+dynamically resizing | |
+.Fa yytext | |
+to accommodate huge tokens is a slow process because it presently requires that | |
+the | |
+.Pq huge | |
+token be rescanned from the beginning. | |
+Thus if performance is vital, it is better to attempt to match | |
+.Qq large | |
+quantities of text but not | |
+.Qq huge | |
+quantities, where the cutoff between the two is at about 8K characters/token. | |
+.Sh GENERATING C++ SCANNERS | |
+.Nm | |
+provides two different ways to generate scanners for use with C++. | |
+The first way is to simply compile a scanner generated by | |
+.Nm | |
+using a C++ compiler instead of a C compiler. | |
+This should not generate any compilation errors | |
+(please report any found to the email address given in the | |
+.Sx AUTHORS | |
+section below). | |
+C++ code can then be used in rule actions instead of C code. | |
+Note that the default input source for scanners remains | |
+.Fa yyin , | |
+and default echoing is still done to | |
+.Fa yyout . | |
+Both of these remain | |
+.Fa FILE * | |
+variables and not C++ streams. | |
+.Pp | |
+.Nm | |
+can also be used to generate a C++ scanner class, using the | |
+.Fl + | |
+option (or, equivalently, | |
+.Dq %option c++ ) , | |
+which is automatically specified if the name of the flex executable ends in a | |
+.Sq + , | |
+such as | |
+.Nm flex++ . | |
+When using this option, | |
+.Nm | |
+defaults to generating the scanner to the file | |
+.Pa lex.yy.cc | |
+instead of | |
+.Pa lex.yy.c . | |
+The generated scanner includes the header file | |
+.In g++/FlexLexer.h , | |
+which defines the interface to two C++ classes. | |
+.Pp | |
+The first class, | |
+.Em FlexLexer , | |
+provides an abstract base class defining the general scanner class interface. | |
+It provides the following member functions: | |
+.Bl -tag -width Ds | |
+.It const char* YYText() | |
+Returns the text of the most recently matched token, the equivalent of | |
+.Fa yytext . | |
+.It int YYLeng() | |
+Returns the length of the most recently matched token, the equivalent of | |
+.Fa yyleng . | |
+.It int lineno() const | |
+Returns the current input line number | |
+(see | |
+.Dq %option yylineno ) , | |
+or 1 if | |
+.Dq %option yylineno | |
+was not used. | |
+.It void set_debug(int flag) | |
+Sets the debugging flag for the scanner, equivalent to assigning to | |
+.Fa yy_flex_debug | |
+(see the | |
+.Sx OPTIONS | |
+section above). | |
+Note that the scanner must be built using | |
+.Dq %option debug | |
+to include debugging information in it. | |
+.It int debug() const | |
+Returns the current setting of the debugging flag. | |
+.El | |
+.Pp | |
+Also provided are member functions equivalent to | |
+.Fn yy_switch_to_buffer , | |
+.Fn yy_create_buffer | |
+(though the first argument is an | |
+.Fa std::istream* | |
+object pointer and not a | |
+.Fa FILE* ) , | |
+.Fn yy_flush_buffer , | |
+.Fn yy_delete_buffer , | |
+and | |
+.Fn yyrestart | |
+(again, the first argument is an | |
+.Fa std::istream* | |
+object pointer). | |
+.Pp | |
+The second class defined in | |
+.In g++/FlexLexer.h | |
+is | |
+.Fa yyFlexLexer , | |
+which is derived from | |
+.Fa FlexLexer . | |
+It defines the following additional member functions: | |
+.Bl -tag -width Ds | |
+.It "yyFlexLexer(std::istream* arg_yyin = 0, std::ostream* arg_yyout = 0)" | |
+Constructs a | |
+.Fa yyFlexLexer | |
+object using the given streams for input and output. | |
+If not specified, the streams default to | |
+.Fa cin | |
+and | |
+.Fa cout , | |
+respectively. | |
+.It virtual int yylex() | |
+Performs the same role as | |
+.Fn yylex | |
+does for ordinary flex scanners: it scans the input stream, consuming | |
+tokens, until a rule's action returns a value. | |
+If subclass | |
+.Sq S | |
+is derived from | |
+.Fa yyFlexLexer , | |
+in order to access the member functions and variables of | |
+.Sq S | |
+inside | |
+.Fn yylex , | |
+use | |
+.Dq %option yyclass="S" | |
+to inform | |
+.Nm | |
+that the | |
+.Sq S | |
+subclass will be used instead of | |
+.Fa yyFlexLexer . | |
+In this case, rather than generating | |
+.Dq yyFlexLexer::yylex() , | |
+.Nm | |
+generates | |
+.Dq S::yylex() | |
+(and also generates a dummy | |
+.Dq yyFlexLexer::yylex() | |
+that calls | |
+.Dq yyFlexLexer::LexerError() | |
+if called). | |
+.It "virtual void switch_streams(std::istream* new_in = 0, std::ostream* new_out = 0)" | |
+Reassigns | |
+.Fa yyin | |
+to | |
+.Fa new_in | |
+.Pq if non-nil | |
+and | |
+.Fa yyout | |
+to | |
+.Fa new_out | |
+.Pq ditto , | |
+deleting the previous input buffer if | |
+.Fa yyin | |
+is reassigned. | |
+.It int yylex(std::istream* new_in, std::ostream* new_out = 0) | |
+First switches the input streams via | |
+.Dq switch_streams(new_in, new_out) | |
+and then returns the value of | |
+.Fn yylex . | |
+.El | |
+.Pp | |
+In addition, | |
+.Fa yyFlexLexer | |
+defines the following protected virtual functions which can be redefined | |
+in derived classes to tailor the scanner: | |
+.Bl -tag -width Ds | |
+.It virtual int LexerInput(char* buf, int max_size) | |
+Reads up to | |
+.Fa max_size | |
+characters into | |
+.Fa buf | |
+and returns the number of characters read. | |
+To indicate end-of-input, return 0 characters. | |
+Note that | |
+.Qq interactive | |
+scanners (see the | |
+.Fl B | |
+and | |
+.Fl I | |
+flags) define the macro | |
+.Dv YY_INTERACTIVE . | |
+If | |
+.Fn LexerInput | |
+has been redefined, and it's necessary to take different actions depending on | |
+whether or not the scanner might be scanning an interactive input source, | |
+it's possible to test for the presence of this name via | |
+.Dq #ifdef . | |
+.It virtual void LexerOutput(const char* buf, int size) | |
+Writes out | |
+.Fa size | |
+characters from the buffer | |
+.Fa buf , | |
+which, while NUL-terminated, may also contain | |
+.Qq internal | |
+NUL's if the scanner's rules can match text with NUL's in them. | |
+.It virtual void LexerError(const char* msg) | |
+Reports a fatal error message. | |
+The default version of this function writes the message to the stream | |
+.Fa cerr | |
+and exits. | |
+.El | |
+.Pp | |
+Note that a | |
+.Fa yyFlexLexer | |
+object contains its entire scanning state. | |
+Thus such objects can be used to create reentrant scanners. | |
+Multiple instances of the same | |
+.Fa yyFlexLexer | |
+class can be instantiated, and multiple C++ scanner classes can be combined | |
+in the same program using the | |
+.Fl P | |
+option discussed above. | |
+.Pp | |
+Finally, note that the | |
+.Dq %array | |
+feature is not available to C++ scanner classes; | |
+.Dq %pointer | |
+must be used | |
+.Pq the default . | |
+.Pp | |
+Here is an example of a simple C++ scanner: | |
+.Bd -literal -offset indent | |
+// An example of using the flex C++ scanner class. | |
+ | |
+%{ | |
+#include <errno.h> | |
+int mylineno = 0; | |
+%} | |
+ | |
+string \e"[^\en"]+\e" | |
+ | |
+ws [ \et]+ | |
+ | |
+alpha [A-Za-z] | |
+dig [0-9] | |
+name ({alpha}|{dig}|\e$)({alpha}|{dig}|[_.\e-/$])* | |
+num1 [-+]?{dig}+\e.?([eE][-+]?{dig}+)? | |
+num2 [-+]?{dig}*\e.{dig}+([eE][-+]?{dig}+)? | |
+number {num1}|{num2} | |
+ | |
+%% | |
+ | |
+{ws} /* skip blanks and tabs */ | |
+ | |
+"/*" { | |
+ int c; | |
+ | |
+ while ((c = yyinput()) != 0) { | |
+ if(c == '\en') | |
+ ++mylineno; | |
+ else if(c == '*') { | |
+ if ((c = yyinput()) == '/') | |
+ break; | |
+ else | |
+ unput(c); | |
+ } | |
+ } | |
+} | |
+ | |
+{number} cout << "number " << YYText() << '\en'; | |
+ | |
+\en mylineno++; | |
+ | |
+{name} cout << "name " << YYText() << '\en'; | |
+ | |
+{string} cout << "string " << YYText() << '\en'; | |
+ | |
+%% | |
+ | |
+int main(int /* argc */, char** /* argv */) | |
+{ | |
+ FlexLexer* lexer = new yyFlexLexer; | |
+ while(lexer->yylex() != 0) | |
+ ; | |
+ return 0; | |
+} | |
+.Ed | |
+.Pp | |
+To create multiple | |
+.Pq different | |
+lexer classes, use the | |
+.Fl P | |
+flag | |
+(or the | |
+.Dq prefix= | |
+option) | |
+to rename each | |
+.Fa yyFlexLexer | |
+to some other | |
+.Fa xxFlexLexer . | |
+.In g++/FlexLexer.h | |
+can then be included in other sources once per lexer class, first renaming | |
+.Fa yyFlexLexer | |
+as follows: | |
+.Bd -literal -offset indent | |
+#undef yyFlexLexer | |
+#define yyFlexLexer xxFlexLexer | |
+#include <g++/FlexLexer.h> | |
+ | |
+#undef yyFlexLexer | |
+#define yyFlexLexer zzFlexLexer | |
+#include <g++/FlexLexer.h> | |
+.Ed | |
+.Pp | |
+If, for example, | |
+.Dq %option prefix="xx" | |
+is used for one scanner and | |
+.Dq %option prefix="zz" | |
+is used for the other. | |
+.Pp | |
+.Sy IMPORTANT : | |
+the present form of the scanning class is experimental | |
+and may change considerably between major releases. | |
+.Sh INCOMPATIBILITIES WITH LEX AND POSIX | |
+.Nm | |
+is a rewrite of the | |
+.At | |
+.Nm lex | |
+tool | |
+(the two implementations do not share any code, though), | |
+with some extensions and incompatibilities, both of which are of concern | |
+to those who wish to write scanners acceptable to either implementation. | |
+.Nm | |
+is fully compliant with the | |
+.Tn POSIX | |
+.Nm lex | |
+specification, except that when using | |
+.Dq %pointer | |
+.Pq the default , | |
+a call to | |
+.Fn unput | |
+destroys the contents of | |
+.Fa yytext , | |
+which is counter to the | |
+.Tn POSIX | |
+specification. | |
+.Pp | |
+In this section we discuss all of the known areas of incompatibility between | |
+.Nm , | |
+.At | |
+.Nm lex , | |
+and the | |
+.Tn POSIX | |
+specification. | |
+.Pp | |
+.Nm flex Ns 's | |
+.Fl l | |
+option turns on maximum compatibility with the original | |
+.At | |
+.Nm lex | |
+implementation, at the cost of a major loss in the generated scanner's | |
+performance. | |
+We note below which incompatibilities can be overcome using the | |
+.Fl l | |
+option. | |
+.Pp | |
+.Nm | |
+is fully compatible with | |
+.Nm lex | |
+with the following exceptions: | |
+.Bl -dash | |
+.It | |
+The undocumented | |
+.Nm lex | |
+scanner internal variable | |
+.Fa yylineno | |
+is not supported unless | |
+.Fl l | |
+or | |
+.Dq %option yylineno | |
+is used. | |
+.Pp | |
+.Fa yylineno | |
+should be maintained on a per-buffer basis, rather than a per-scanner | |
+.Pq single global variable | |
+basis. | |
+.Pp | |
+.Fa yylineno | |
+is not part of the | |
+.Tn POSIX | |
+specification. | |
+.It | |
+The | |
+.Fn input | |
+routine is not redefinable, though it may be called to read characters | |
+following whatever has been matched by a rule. | |
+If | |
+.Fn input | |
+encounters an end-of-file, the normal | |
+.Fn yywrap | |
+processing is done. | |
+A | |
+.Dq real | |
+end-of-file is returned by | |
+.Fn input | |
+as | |
+.Dv EOF . | |
+.Pp | |
+Input is instead controlled by defining the | |
+.Dv YY_INPUT | |
+macro. | |
+.Pp | |
+The | |
+.Nm | |
+restriction that | |
+.Fn input | |
+cannot be redefined is in accordance with the | |
+.Tn POSIX | |
+specification, which simply does not specify any way of controlling the | |
+scanner's input other than by making an initial assignment to | |
+.Fa yyin . | |
+.It | |
+The | |
+.Fn unput | |
+routine is not redefinable. | |
+This restriction is in accordance with | |
+.Tn POSIX . | |
+.It | |
+.Nm | |
+scanners are not as reentrant as | |
+.Nm lex | |
+scanners. | |
+In particular, if a scanner is interactive and | |
+an interrupt handler long-jumps out of the scanner, | |
+and the scanner is subsequently called again, | |
+the following error message may be displayed: | |
+.Pp | |
+.D1 fatal flex scanner internal error--end of buffer missed | |
+.Pp | |
+To reenter the scanner, first use | |
+.Pp | |
+.Dl yyrestart(yyin); | |
+.Pp | |
+Note that this call will throw away any buffered input; | |
+usually this isn't a problem with an interactive scanner. | |
+.Pp | |
+Also note that flex C++ scanner classes are reentrant, | |
+so if using C++ is an option , they should be used instead. | |
+See | |
+.Sx GENERATING C++ SCANNERS | |
+above for details. | |
+.It | |
+.Fn output | |
+is not supported. | |
+Output from the | |
+.Em ECHO | |
+macro is done to the file-pointer | |
+.Fa yyout | |
+.Pq default stdout . | |
+.Pp | |
+.Fn output | |
+is not part of the | |
+.Tn POSIX | |
+specification. | |
+.It | |
+.Nm lex | |
+does not support exclusive start conditions | |
+.Pq %x , | |
+though they are in the | |
+.Tn POSIX | |
+specification. | |
+.It | |
+When definitions are expanded, | |
+.Nm | |
+encloses them in parentheses. | |
+With | |
+.Nm lex , | |
+the following: | |
+.Bd -literal -offset indent | |
+NAME [A-Z][A-Z0-9]* | |
+%% | |
+foo{NAME}? printf("Found it\en"); | |
+%% | |
+.Ed | |
+.Pp | |
+will not match the string | |
+.Qq foo | |
+because when the macro is expanded the rule is equivalent to | |
+.Qq foo[A-Z][A-Z0-9]*? | |
+and the precedence is such that the | |
+.Sq ?\& | |
+is associated with | |
+.Qq [A-Z0-9]* . | |
+With | |
+.Nm , | |
+the rule will be expanded to | |
+.Qq foo([A-Z][A-Z0-9]*)? | |
+and so the string | |
+.Qq foo | |
+will match. | |
+.Pp | |
+Note that if the definition begins with | |
+.Sq ^ | |
+or ends with | |
+.Sq $ | |
+then it is not expanded with parentheses, to allow these operators to appear in | |
+definitions without losing their special meanings. | |
+But the | |
+.Sq Aq s , | |
+.Sq / , | |
+and | |
+.Aq Aq EOF | |
+operators cannot be used in a | |
+.Nm | |
+definition. | |
+.Pp | |
+Using | |
+.Fl l | |
+results in the | |
+.Nm lex | |
+behavior of no parentheses around the definition. | |
+.Pp | |
+The | |
+.Tn POSIX | |
+specification is that the definition be enclosed in parentheses. | |
+.It | |
+Some implementations of | |
+.Nm lex | |
+allow a rule's action to begin on a separate line, | |
+if the rule's pattern has trailing whitespace: | |
+.Bd -literal -offset indent | |
+%% | |
+foo|bar<space here> | |
+ { foobar_action(); } | |
+.Ed | |
+.Pp | |
+.Nm | |
+does not support this feature. | |
+.It | |
+The | |
+.Nm lex | |
+.Sq %r | |
+.Pq generate a Ratfor scanner | |
+option is not supported. | |
+It is not part of the | |
+.Tn POSIX | |
+specification. | |
+.It | |
+After a call to | |
+.Fn unput , | |
+.Fa yytext | |
+is undefined until the next token is matched, | |
+unless the scanner was built using | |
+.Dq %array . | |
+This is not the case with | |
+.Nm lex | |
+or the | |
+.Tn POSIX | |
+specification. | |
+The | |
+.Fl l | |
+option does away with this incompatibility. | |
+.It | |
+The precedence of the | |
+.Sq {} | |
+.Pq numeric range | |
+operator is different. | |
+.Nm lex | |
+interprets | |
+.Qq abc{1,3} | |
+as match one, two, or three occurrences of | |
+.Sq abc , | |
+whereas | |
+.Nm | |
+interprets it as match | |
+.Sq ab | |
+followed by one, two, or three occurrences of | |
+.Sq c . | |
+The latter is in agreement with the | |
+.Tn POSIX | |
+specification. | |
+.It | |
+The precedence of the | |
+.Sq ^ | |
+operator is different. | |
+.Nm lex | |
+interprets | |
+.Qq ^foo|bar | |
+as match either | |
+.Sq foo | |
+at the beginning of a line, or | |
+.Sq bar | |
+anywhere, whereas | |
+.Nm | |
+interprets it as match either | |
+.Sq foo | |
+or | |
+.Sq bar | |
+if they come at the beginning of a line. | |
+The latter is in agreement with the | |
+.Tn POSIX | |
+specification. | |
+.It | |
+The special table-size declarations such as | |
+.Sq %a | |
+supported by | |
+.Nm lex | |
+are not required by | |
+.Nm | |
+scanners; | |
+.Nm | |
+ignores them. | |
+.It | |
+The name | |
+.Dv FLEX_SCANNER | |
+is #define'd so scanners may be written for use with either | |
+.Nm | |
+or | |
+.Nm lex . | |
+Scanners also include | |
+.Dv YY_FLEX_MAJOR_VERSION | |
+and | |
+.Dv YY_FLEX_MINOR_VERSION | |
+indicating which version of | |
+.Nm | |
+generated the scanner | |
+(for example, for the 2.5 release, these defines would be 2 and 5, | |
+respectively). | |
+.El | |
+.Pp | |
+The following | |
+.Nm | |
+features are not included in | |
+.Nm lex | |
+or the | |
+.Tn POSIX | |
+specification: | |
+.Bd -unfilled -offset indent | |
+C++ scanners | |
+%option | |
+start condition scopes | |
+start condition stacks | |
+interactive/non-interactive scanners | |
+yy_scan_string() and friends | |
+yyterminate() | |
+yy_set_interactive() | |
+yy_set_bol() | |
+YY_AT_BOL() | |
+<<EOF>> | |
+<*> | |
+YY_DECL | |
+YY_START | |
+YY_USER_ACTION | |
+YY_USER_INIT | |
+#line directives | |
+%{}'s around actions | |
+multiple actions on a line | |
+.Ed | |
+.Pp | |
+plus almost all of the | |
+.Nm | |
+flags. | |
+The last feature in the list refers to the fact that with | |
+.Nm | |
+multiple actions can be placed on the same line, | |
+separated with semi-colons, while with | |
+.Nm lex , | |
+the following | |
+.Pp | |
+.Dl foo handle_foo(); ++num_foos_seen; | |
+.Pp | |
+is | |
+.Pq rather surprisingly | |
+truncated to | |
+.Pp | |
+.Dl foo handle_foo(); | |
+.Pp | |
+.Nm | |
+does not truncate the action. | |
+Actions that are not enclosed in braces | |
+are simply terminated at the end of the line. | |
+.Sh FILES | |
+.Bl -tag -width "<g++/FlexLexer.h>" | |
+.It Pa flex.skl | |
+Skeleton scanner. | |
+This file is only used when building flex, not when | |
+.Nm | |
+executes. | |
+.It Pa lex.backup | |
+Backing-up information for the | |
+.Fl b | |
+flag (called | |
+.Pa lex.bck | |
+on some systems). | |
+.It Pa lex.yy.c | |
+Generated scanner | |
+(called | |
+.Pa lexyy.c | |
+on some systems). | |
+.It Pa lex.yy.cc | |
+Generated C++ scanner class, when using | |
+.Fl + . | |
+.It In g++/FlexLexer.h | |
+Header file defining the C++ scanner base class, | |
+.Fa FlexLexer , | |
+and its derived class, | |
+.Fa yyFlexLexer . | |
+.It Pa /usr/lib/libl.* | |
+.Nm | |
+libraries. | |
+The | |
+.Pa /usr/lib/libfl.*\& | |
+libraries are links to these. | |
+Scanners must be linked using either | |
+.Fl \&ll | |
+or | |
+.Fl lfl . | |
+.El | |
+.Sh EXIT STATUS | |
+.Ex -std flex | |
+.Sh DIAGNOSTICS | |
+.Bl -diag | |
+.It warning, rule cannot be matched | |
+Indicates that the given rule cannot be matched because it follows other rules | |
+that will always match the same text as it. | |
+For example, in the following | |
+.Dq foo | |
+cannot be matched because it comes after an identifier | |
+.Qq catch-all | |
+rule: | |
+.Bd -literal -offset indent | |
+[a-z]+ got_identifier(); | |
+foo got_foo(); | |
+.Ed | |
+.Pp | |
+Using | |
+.Em REJECT | |
+in a scanner suppresses this warning. | |
+.It "warning, \-s option given but default rule can be matched" | |
+Means that it is possible | |
+.Pq perhaps only in a particular start condition | |
+that the default rule | |
+.Pq match any single character | |
+is the only one that will match a particular input. | |
+Since | |
+.Fl s | |
+was given, presumably this is not intended. | |
+.It reject_used_but_not_detected undefined | |
+.It yymore_used_but_not_detected undefined | |
+These errors can occur at compile time. | |
+They indicate that the scanner uses | |
+.Em REJECT | |
+or | |
+.Fn yymore | |
+but that | |
+.Nm | |
+failed to notice the fact, meaning that | |
+.Nm | |
+scanned the first two sections looking for occurrences of these actions | |
+and failed to find any, but somehow they snuck in | |
+.Pq via an #include file, for example . | |
+Use | |
+.Dq %option reject | |
+or | |
+.Dq %option yymore | |
+to indicate to | |
+.Nm | |
+that these features are really needed. | |
+.It flex scanner jammed | |
+A scanner compiled with | |
+.Fl s | |
+has encountered an input string which wasn't matched by any of its rules. | |
+This error can also occur due to internal problems. | |
+.It token too large, exceeds YYLMAX | |
+The scanner uses | |
+.Dq %array | |
+and one of its rules matched a string longer than the | |
+.Dv YYLMAX | |
+constant | |
+.Pq 8K bytes by default . | |
+The value can be increased by #define'ing | |
+.Dv YYLMAX | |
+in the definitions section of | |
+.Nm | |
+input. | |
+.It "scanner requires \-8 flag to use the character 'x'" | |
+The scanner specification includes recognizing the 8-bit character | |
+.Sq x | |
+and the | |
+.Fl 8 | |
+flag was not specified, and defaulted to 7-bit because the | |
+.Fl Cf | |
+or | |
+.Fl CF | |
+table compression options were used. | |
+See the discussion of the | |
+.Fl 7 | |
+flag for details. | |
+.It flex scanner push-back overflow | |
+unput() was used to push back so much text that the scanner's buffer | |
+could not hold both the pushed-back text and the current token in | |
+.Fa yytext . | |
+Ideally the scanner should dynamically resize the buffer in this case, | |
+but at present it does not. | |
+.It "input buffer overflow, can't enlarge buffer because scanner uses REJECT" | |
+The scanner was working on matching an extremely large token and needed | |
+to expand the input buffer. | |
+This doesn't work with scanners that use | |
+.Em REJECT . | |
+.It "fatal flex scanner internal error--end of buffer missed" | |
+This can occur in an scanner which is reentered after a long-jump | |
+has jumped out | |
+.Pq or over | |
+the scanner's activation frame. | |
+Before reentering the scanner, use: | |
+.Pp | |
+.Dl yyrestart(yyin); | |
+.Pp | |
+or, as noted above, switch to using the C++ scanner class. | |
+.It "too many start conditions in <> construct!" | |
+More start conditions than exist were listed in a <> construct | |
+(so at least one of them must have been listed twice). | |
+.El | |
+.Sh SEE ALSO | |
+.Xr awk 1 , | |
+.Xr sed 1 , | |
+.Xr yacc 1 | |
+.Rs | |
+.%A John Levine | |
+.%A Tony Mason | |
+.%A Doug Brown | |
+.%B Lex & Yacc | |
+.%I O'Reilly and Associates | |
+.%N 2nd edition | |
+.Re | |
+.Rs | |
+.%A Alfred Aho | |
+.%A Ravi Sethi | |
+.%A Jeffrey Ullman | |
+.%B Compilers: Principles, Techniques and Tools | |
+.%I Addison-Wesley | |
+.%D 1986 | |
+.%O "Describes the pattern-matching techniques used by flex (deterministic finite automata)" | |
+.Re | |
+.Sh STANDARDS | |
+The | |
+.Nm lex | |
+utility is compliant with the | |
+.St -p1003.1-2008 | |
+specification, | |
+though its presence is optional. | |
+.Pp | |
+The flags | |
+.Op Fl 78BbCdFfhIiLloPpSsTVw+? , | |
+.Op Fl -help , | |
+and | |
+.Op Fl -version | |
+are extensions to that specification. | |
+.Pp | |
+See also the | |
+.Sx INCOMPATIBILITIES WITH LEX AND POSIX | |
+section, above. | |
+.Sh AUTHORS | |
+Vern Paxson, with the help of many ideas and much inspiration from | |
+Van Jacobson. | |
+Original version by Jef Poskanzer. | |
+The fast table representation is a partial implementation of a design done by | |
+Van Jacobson. | |
+The implementation was done by Kevin Gong and Vern Paxson. | |
+.Pp | |
+Thanks to the many | |
+.Nm | |
+beta-testers, feedbackers, and contributors, especially Francois Pinard, | |
+Casey Leedom, | |
+Robert Abramovitz, | |
+Stan Adermann, Terry Allen, David Barker-Plummer, John Basrai, | |
+Neal Becker, Nelson H.F. Beebe, | |
+.Mt [email protected] , | |
+Karl Berry, Peter A. Bigot, Simon Blanchard, | |
+Keith Bostic, Frederic Brehm, Ian Brockbank, Kin Cho, Nick Christopher, | |
+Brian Clapper, J.T. Conklin, | |
+Jason Coughlin, Bill Cox, Nick Cropper, Dave Curtis, Scott David | |
+Daniels, Chris G. Demetriou, Theo de Raadt, | |
+Mike Donahue, Chuck Doucette, Tom Epperly, Leo Eskin, | |
+Chris Faylor, Chris Flatters, Jon Forrest, Jeffrey Friedl, | |
+Joe Gayda, Kaveh R. Ghazi, Wolfgang Glunz, | |
+Eric Goldman, Christopher M. Gould, Ulrich Grepel, Peer Griebel, | |
+Jan Hajic, Charles Hemphill, NORO Hideo, | |
+Jarkko Hietaniemi, Scott Hofmann, | |
+Jeff Honig, Dana Hudes, Eric Hughes, John Interrante, | |
+Ceriel Jacobs, Michal Jaegermann, Sakari Jalovaara, Jeffrey R. Jones, | |
+Henry Juengst, Klaus Kaempf, Jonathan I. Kamens, Terrence O Kane, | |
+Amir Katz, | |
+.Mt [email protected] , | |
+Kevin B. Kenny, | |
+Steve Kirsch, Winfried Koenig, Marq Kole, Ronald Lamprecht, | |
+Greg Lee, Rohan Lenard, Craig Leres, John Levine, Steve Liddle, | |
+David Loffredo, Mike Long, | |
+Mohamed el Lozy, Brian Madsen, Malte, Joe Marshall, | |
+Bengt Martensson, Chris Metcalf, | |
+Luke Mewburn, Jim Meyering, R. Alexander Milowski, Erik Naggum, | |
+G.T. Nicol, Landon Noll, James Nordby, Marc Nozell, | |
+Richard Ohnemus, Karsten Pahnke, | |
+Sven Panne, Roland Pesch, Walter Pelissero, Gaumond Pierre, | |
+Esmond Pitt, Jef Poskanzer, Joe Rahmeh, Jarmo Raiha, | |
+Frederic Raimbault, Pat Rankin, Rick Richardson, | |
+Kevin Rodgers, Kai Uwe Rommel, Jim Roskind, Alberto Santini, | |
+Andreas Scherer, Darrell Schiebel, Raf Schietekat, | |
+Doug Schmidt, Philippe Schnoebelen, Andreas Schwab, | |
+Larry Schwimmer, Alex Siegel, Eckehard Stolz, Jan-Erik Strvmquist, | |
+Mike Stump, Paul Stuart, Dave Tallman, Ian Lance Taylor, | |
+Chris Thewalt, Richard M. Timoney, Jodi Tsai, | |
+Paul Tuinenga, Gary Weik, Frank Whaley, Gerhard Wilhelms, Kent Williams, | |
+Ken Yap, Ron Zellar, Nathan Zelle, David Zuhn, | |
+and those whose names have slipped my marginal mail-archiving skills | |
+but whose contributions are appreciated all the | |
+same. | |
+.Pp | |
+Thanks to Keith Bostic, Jon Forrest, Noah Friedman, | |
+John Gilmore, Craig Leres, John Levine, Bob Mulcahy, G.T. | |
+Nicol, Francois Pinard, Rich Salz, and Richard Stallman for help with various | |
+distribution headaches. | |
+.Pp | |
+Thanks to Esmond Pitt and Earle Horton for 8-bit character support; | |
+to Benson Margulies and Fred Burke for C++ support; | |
+to Kent Williams and Tom Epperly for C++ class support; | |
+to Ove Ewerlid for support of NUL's; | |
+and to Eric Hughes for support of multiple buffers. | |
+.Pp | |
+This work was primarily done when I was with the Real Time Systems Group | |
+at the Lawrence Berkeley Laboratory in Berkeley, CA. | |
+Many thanks to all there for the support I received. | |
+.Pp | |
+Send comments to | |
+.Aq Mt [email protected] . | |
+.Sh BUGS | |
+Some trailing context patterns cannot be properly matched and generate | |
+warning messages | |
+.Pq "dangerous trailing context" . | |
+These are patterns where the ending of the first part of the rule | |
+matches the beginning of the second part, such as | |
+.Qq zx*/xy* , | |
+where the | |
+.Sq x* | |
+matches the | |
+.Sq x | |
+at the beginning of the trailing context. | |
+(Note that the POSIX draft states that the text matched by such patterns | |
+is undefined.) | |
+.Pp | |
+For some trailing context rules, parts which are actually fixed-length are | |
+not recognized as such, leading to the above mentioned performance loss. | |
+In particular, parts using | |
+.Sq |\& | |
+or | |
+.Sq {n} | |
+(such as | |
+.Qq foo{3} ) | |
+are always considered variable-length. | |
+.Pp | |
+Combining trailing context with the special | |
+.Sq |\& | |
+action can result in fixed trailing context being turned into | |
+the more expensive variable trailing context. | |
+For example, in the following: | |
+.Bd -literal -offset indent | |
+%% | |
+abc | | |
+xyz/def | |
+.Ed | |
+.Pp | |
+Use of | |
+.Fn unput | |
+invalidates yytext and yyleng, unless the | |
+.Dq %array | |
+directive | |
+or the | |
+.Fl l | |
+option has been used. | |
+.Pp | |
+Pattern-matching of NUL's is substantially slower than matching other | |
+characters. | |
+.Pp | |
+Dynamic resizing of the input buffer is slow, as it entails rescanning | |
+all the text matched so far by the current | |
+.Pq generally huge | |
+token. | |
+.Pp | |
+Due to both buffering of input and read-ahead, | |
+it is not possible to intermix calls to | |
+.In stdio.h | |
+routines, such as, for example, | |
+.Fn getchar , | |
+with | |
+.Nm | |
+rules and expect it to work. | |
+Call | |
+.Fn input | |
+instead. | |
+.Pp | |
+The total table entries listed by the | |
+.Fl v | |
+flag excludes the number of table entries needed to determine | |
+what rule has been matched. | |
+The number of entries is equal to the number of DFA states | |
+if the scanner does not use | |
+.Em REJECT , | |
+and somewhat greater than the number of states if it does. | |
+.Pp | |
+.Em REJECT | |
+cannot be used with the | |
+.Fl f | |
+or | |
+.Fl F | |
+options. | |
+.Pp | |
+The | |
+.Nm | |
+internal algorithms need documentation. | |
diff -Pu flex-2.5.39/gen.c openbsd-flex/gen.c | |
--- flex-2.5.39/gen.c Wed Mar 26 05:46:44 2014 | |
+++ openbsd-flex/gen.c Mon Nov 2 15:24:17 2015 | |
@@ -873,9 +873,9 @@ | |
} | |
else | |
- strcpy (char_map, useecs ? | |
- "yy_ec[YY_SC_TO_UI(*yy_cp)] " : | |
- "YY_SC_TO_UI(*yy_cp)"); | |
+ strlcpy (char_map, useecs ? | |
+ "yy_ec[YY_SC_TO_UI(*yy_cp)] " : "YY_SC_TO_UI(*yy_cp)", | |
+ sizeof char_map ); | |
if (worry_about_NULs && nultrans) { | |
if (!fulltbl && !fullspd) | |
diff -Pu flex-2.5.39/initparse.c openbsd-flex/initparse.c | |
--- flex-2.5.39/initparse.c Wed Dec 31 16:00:00 1969 | |
+++ openbsd-flex/initparse.c Mon Nov 2 06:32:35 2015 | |
@@ -0,0 +1,3221 @@ | |
+/* A Bison parser, made by GNU Bison 2.5. */ | |
+ | |
+/* Bison implementation for Yacc-like parsers in C | |
+ | |
+ Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. | |
+ | |
+ This program is free software: you can redistribute it and/or modify | |
+ it under the terms of the GNU General Public License as published by | |
+ the Free Software Foundation, either version 3 of the License, or | |
+ (at your option) any later version. | |
+ | |
+ This program is distributed in the hope that it will be useful, | |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of | |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
+ GNU General Public License for more details. | |
+ | |
+ You should have received a copy of the GNU General Public License | |
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */ | |
+ | |
+/* As a special exception, you may create a larger work that contains | |
+ part or all of the Bison parser skeleton and distribute that work | |
+ under terms of your choice, so long as that work isn't itself a | |
+ parser generator using the skeleton or a modified version thereof | |
+ as a parser skeleton. Alternatively, if you modify or redistribute | |
+ the parser skeleton itself, you may (at your option) remove this | |
+ special exception, which will cause the skeleton and the resulting | |
+ Bison output files to be licensed under the GNU General Public | |
+ License without this special exception. | |
+ | |
+ This special exception was added by the Free Software Foundation in | |
+ version 2.2 of Bison. */ | |
+ | |
+/* C LALR(1) parser skeleton written by Richard Stallman, by | |
+ simplifying the original so-called "semantic" parser. */ | |
+ | |
+/* All symbols defined below should begin with yy or YY, to avoid | |
+ infringing on user name space. This should be done even for local | |
+ variables, as they might otherwise be expanded by user macros. | |
+ There are some unavoidable exceptions within include files to | |
+ define necessary library symbols; they are noted "INFRINGES ON | |
+ USER NAME SPACE" below. */ | |
+ | |
+/* Identify Bison output. */ | |
+#define YYBISON 1 | |
+ | |
+/* Bison version. */ | |
+#define YYBISON_VERSION "2.5" | |
+ | |
+/* Skeleton name. */ | |
+#define YYSKELETON_NAME "yacc.c" | |
+ | |
+/* Pure parsers. */ | |
+#define YYPURE 0 | |
+ | |
+/* Push parsers. */ | |
+#define YYPUSH 0 | |
+ | |
+/* Pull parsers. */ | |
+#define YYPULL 1 | |
+ | |
+/* Using locations. */ | |
+#define YYLSP_NEEDED 0 | |
+ | |
+ | |
+ | |
+/* Copy the first part of user declarations. */ | |
+ | |
+/* Line 268 of yacc.c */ | |
+#line 34 "parse.y" | |
+ | |
+/* Copyright (c) 1990 The Regents of the University of California. */ | |
+/* All rights reserved. */ | |
+ | |
+/* This code is derived from software contributed to Berkeley by */ | |
+/* Vern Paxson. */ | |
+ | |
+/* The United States Government has rights in this work pursuant */ | |
+/* to contract no. DE-AC03-76SF00098 between the United States */ | |
+/* Department of Energy and the University of California. */ | |
+ | |
+/* This file is part of flex. */ | |
+ | |
+/* Redistribution and use in source and binary forms, with or without */ | |
+/* modification, are permitted provided that the following conditions */ | |
+/* are met: */ | |
+ | |
+/* 1. Redistributions of source code must retain the above copyright */ | |
+/* notice, this list of conditions and the following disclaimer. */ | |
+/* 2. Redistributions in binary form must reproduce the above copyright */ | |
+/* notice, this list of conditions and the following disclaimer in the */ | |
+/* documentation and/or other materials provided with the distribution. */ | |
+ | |
+/* Neither the name of the University nor the names of its contributors */ | |
+/* may be used to endorse or promote products derived from this software */ | |
+/* without specific prior written permission. */ | |
+ | |
+/* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR */ | |
+/* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED */ | |
+/* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */ | |
+/* PURPOSE. */ | |
+ | |
+#include "flexdef.h" | |
+#include "tables.h" | |
+ | |
+int pat, scnum, eps, headcnt, trailcnt, lastchar, i, rulelen; | |
+int trlcontxt, xcluflg, currccl, cclsorted, varlength, variable_trail_rule; | |
+ | |
+int *scon_stk; | |
+int scon_stk_ptr; | |
+ | |
+static int madeany = false; /* whether we've made the '.' character class */ | |
+static int ccldot, cclany; | |
+int previous_continued_action; /* whether the previous rule's action was '|' */ | |
+ | |
+#define format_warn3(fmt, a1, a2) \ | |
+ do{ \ | |
+ char fw3_msg[MAXLINE];\ | |
+ snprintf( fw3_msg, MAXLINE,(fmt), (a1), (a2) );\ | |
+ warn( fw3_msg );\ | |
+ }while(0) | |
+ | |
+/* Expand a POSIX character class expression. */ | |
+#define CCL_EXPR(func) \ | |
+ do{ \ | |
+ int c; \ | |
+ for ( c = 0; c < csize; ++c ) \ | |
+ if ( isascii(c) && func(c) ) \ | |
+ ccladd( currccl, c ); \ | |
+ }while(0) | |
+ | |
+/* negated class */ | |
+#define CCL_NEG_EXPR(func) \ | |
+ do{ \ | |
+ int c; \ | |
+ for ( c = 0; c < csize; ++c ) \ | |
+ if ( !func(c) ) \ | |
+ ccladd( currccl, c ); \ | |
+ }while(0) | |
+ | |
+/* While POSIX defines isblank(), it's not ANSI C. */ | |
+#define IS_BLANK(c) ((c) == ' ' || (c) == '\t') | |
+ | |
+/* On some over-ambitious machines, such as DEC Alpha's, the default | |
+ * token type is "long" instead of "int"; this leads to problems with | |
+ * declaring yylval in flexdef.h. But so far, all the yacc's I've seen | |
+ * wrap their definitions of YYSTYPE with "#ifndef YYSTYPE"'s, so the | |
+ * following should ensure that the default token type is "int". | |
+ */ | |
+#define YYSTYPE int | |
+ | |
+ | |
+ | |
+/* Line 268 of yacc.c */ | |
+#line 155 "parse.c" | |
+ | |
+/* Enabling traces. */ | |
+#ifndef YYDEBUG | |
+# define YYDEBUG 0 | |
+#endif | |
+ | |
+/* Enabling verbose error messages. */ | |
+#ifdef YYERROR_VERBOSE | |
+# undef YYERROR_VERBOSE | |
+# define YYERROR_VERBOSE 1 | |
+#else | |
+# define YYERROR_VERBOSE 0 | |
+#endif | |
+ | |
+/* Enabling the token table. */ | |
+#ifndef YYTOKEN_TABLE | |
+# define YYTOKEN_TABLE 0 | |
+#endif | |
+ | |
+ | |
+/* Tokens. */ | |
+#ifndef YYTOKENTYPE | |
+# define YYTOKENTYPE | |
+ /* Put the tokens into the symbol table, so that GDB and other debuggers | |
+ know about them. */ | |
+ enum yytokentype { | |
+ CHAR = 258, | |
+ NUMBER = 259, | |
+ SECTEND = 260, | |
+ SCDECL = 261, | |
+ XSCDECL = 262, | |
+ NAME = 263, | |
+ PREVCCL = 264, | |
+ EOF_OP = 265, | |
+ OPTION_OP = 266, | |
+ OPT_OUTFILE = 267, | |
+ OPT_PREFIX = 268, | |
+ OPT_YYCLASS = 269, | |
+ OPT_HEADER = 270, | |
+ OPT_EXTRA_TYPE = 271, | |
+ OPT_TABLES = 272, | |
+ CCE_ALNUM = 273, | |
+ CCE_ALPHA = 274, | |
+ CCE_BLANK = 275, | |
+ CCE_CNTRL = 276, | |
+ CCE_DIGIT = 277, | |
+ CCE_GRAPH = 278, | |
+ CCE_LOWER = 279, | |
+ CCE_PRINT = 280, | |
+ CCE_PUNCT = 281, | |
+ CCE_SPACE = 282, | |
+ CCE_UPPER = 283, | |
+ CCE_XDIGIT = 284, | |
+ CCE_NEG_ALNUM = 285, | |
+ CCE_NEG_ALPHA = 286, | |
+ CCE_NEG_BLANK = 287, | |
+ CCE_NEG_CNTRL = 288, | |
+ CCE_NEG_DIGIT = 289, | |
+ CCE_NEG_GRAPH = 290, | |
+ CCE_NEG_LOWER = 291, | |
+ CCE_NEG_PRINT = 292, | |
+ CCE_NEG_PUNCT = 293, | |
+ CCE_NEG_SPACE = 294, | |
+ CCE_NEG_UPPER = 295, | |
+ CCE_NEG_XDIGIT = 296, | |
+ CCL_OP_UNION = 297, | |
+ CCL_OP_DIFF = 298, | |
+ BEGIN_REPEAT_POSIX = 299, | |
+ END_REPEAT_POSIX = 300, | |
+ BEGIN_REPEAT_FLEX = 301, | |
+ END_REPEAT_FLEX = 302 | |
+ }; | |
+#endif | |
+/* Tokens. */ | |
+#define CHAR 258 | |
+#define NUMBER 259 | |
+#define SECTEND 260 | |
+#define SCDECL 261 | |
+#define XSCDECL 262 | |
+#define NAME 263 | |
+#define PREVCCL 264 | |
+#define EOF_OP 265 | |
+#define OPTION_OP 266 | |
+#define OPT_OUTFILE 267 | |
+#define OPT_PREFIX 268 | |
+#define OPT_YYCLASS 269 | |
+#define OPT_HEADER 270 | |
+#define OPT_EXTRA_TYPE 271 | |
+#define OPT_TABLES 272 | |
+#define CCE_ALNUM 273 | |
+#define CCE_ALPHA 274 | |
+#define CCE_BLANK 275 | |
+#define CCE_CNTRL 276 | |
+#define CCE_DIGIT 277 | |
+#define CCE_GRAPH 278 | |
+#define CCE_LOWER 279 | |
+#define CCE_PRINT 280 | |
+#define CCE_PUNCT 281 | |
+#define CCE_SPACE 282 | |
+#define CCE_UPPER 283 | |
+#define CCE_XDIGIT 284 | |
+#define CCE_NEG_ALNUM 285 | |
+#define CCE_NEG_ALPHA 286 | |
+#define CCE_NEG_BLANK 287 | |
+#define CCE_NEG_CNTRL 288 | |
+#define CCE_NEG_DIGIT 289 | |
+#define CCE_NEG_GRAPH 290 | |
+#define CCE_NEG_LOWER 291 | |
+#define CCE_NEG_PRINT 292 | |
+#define CCE_NEG_PUNCT 293 | |
+#define CCE_NEG_SPACE 294 | |
+#define CCE_NEG_UPPER 295 | |
+#define CCE_NEG_XDIGIT 296 | |
+#define CCL_OP_UNION 297 | |
+#define CCL_OP_DIFF 298 | |
+#define BEGIN_REPEAT_POSIX 299 | |
+#define END_REPEAT_POSIX 300 | |
+#define BEGIN_REPEAT_FLEX 301 | |
+#define END_REPEAT_FLEX 302 | |
+ | |
+ | |
+ | |
+ | |
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED | |
+typedef int YYSTYPE; | |
+# define YYSTYPE_IS_TRIVIAL 1 | |
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */ | |
+# define YYSTYPE_IS_DECLARED 1 | |
+#endif | |
+ | |
+ | |
+/* Copy the second part of user declarations. */ | |
+ | |
+ | |
+/* Line 343 of yacc.c */ | |
+#line 291 "parse.c" | |
+ | |
+#ifdef short | |
+# undef short | |
+#endif | |
+ | |
+#ifdef YYTYPE_UINT8 | |
+typedef YYTYPE_UINT8 yytype_uint8; | |
+#else | |
+typedef unsigned char yytype_uint8; | |
+#endif | |
+ | |
+#ifdef YYTYPE_INT8 | |
+typedef YYTYPE_INT8 yytype_int8; | |
+#elif (defined __STDC__ || defined __C99__FUNC__ \ | |
+ || defined __cplusplus || defined _MSC_VER) | |
+typedef signed char yytype_int8; | |
+#else | |
+typedef short int yytype_int8; | |
+#endif | |
+ | |
+#ifdef YYTYPE_UINT16 | |
+typedef YYTYPE_UINT16 yytype_uint16; | |
+#else | |
+typedef unsigned short int yytype_uint16; | |
+#endif | |
+ | |
+#ifdef YYTYPE_INT16 | |
+typedef YYTYPE_INT16 yytype_int16; | |
+#else | |
+typedef short int yytype_int16; | |
+#endif | |
+ | |
+#ifndef YYSIZE_T | |
+# ifdef __SIZE_TYPE__ | |
+# define YYSIZE_T __SIZE_TYPE__ | |
+# elif defined size_t | |
+# define YYSIZE_T size_t | |
+# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ | |
+ || defined __cplusplus || defined _MSC_VER) | |
+# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ | |
+# define YYSIZE_T size_t | |
+# else | |
+# define YYSIZE_T unsigned int | |
+# endif | |
+#endif | |
+ | |
+#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) | |
+ | |
+#ifndef YY_ | |
+# if defined YYENABLE_NLS && YYENABLE_NLS | |
+# if ENABLE_NLS | |
+# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ | |
+# define YY_(msgid) dgettext ("bison-runtime", msgid) | |
+# endif | |
+# endif | |
+# ifndef YY_ | |
+# define YY_(msgid) msgid | |
+# endif | |
+#endif | |
+ | |
+/* Suppress unused-variable warnings by "using" E. */ | |
+#if ! defined lint || defined __GNUC__ | |
+# define YYUSE(e) ((void) (e)) | |
+#else | |
+# define YYUSE(e) /* empty */ | |
+#endif | |
+ | |
+/* Identity function, used to suppress warnings about constant conditions. */ | |
+#ifndef lint | |
+# define YYID(n) (n) | |
+#else | |
+#if (defined __STDC__ || defined __C99__FUNC__ \ | |
+ || defined __cplusplus || defined _MSC_VER) | |
+static int | |
+YYID (int yyi) | |
+#else | |
+static int | |
+YYID (yyi) | |
+ int yyi; | |
+#endif | |
+{ | |
+ return yyi; | |
+} | |
+#endif | |
+ | |
+#if ! defined yyoverflow || YYERROR_VERBOSE | |
+ | |
+/* The parser invokes alloca or malloc; define the necessary symbols. */ | |
+ | |
+# ifdef YYSTACK_USE_ALLOCA | |
+# if YYSTACK_USE_ALLOCA | |
+# ifdef __GNUC__ | |
+# define YYSTACK_ALLOC __builtin_alloca | |
+# elif defined __BUILTIN_VA_ARG_INCR | |
+# include <alloca.h> /* INFRINGES ON USER NAME SPACE */ | |
+# elif defined _AIX | |
+# define YYSTACK_ALLOC __alloca | |
+# elif defined _MSC_VER | |
+# include <malloc.h> /* INFRINGES ON USER NAME SPACE */ | |
+# define alloca _alloca | |
+# else | |
+# define YYSTACK_ALLOC alloca | |
+# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ | |
+ || defined __cplusplus || defined _MSC_VER) | |
+# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ | |
+# ifndef EXIT_SUCCESS | |
+# define EXIT_SUCCESS 0 | |
+# endif | |
+# endif | |
+# endif | |
+# endif | |
+# endif | |
+ | |
+# ifdef YYSTACK_ALLOC | |
+ /* Pacify GCC's `empty if-body' warning. */ | |
+# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) | |
+# ifndef YYSTACK_ALLOC_MAXIMUM | |
+ /* The OS might guarantee only one guard page at the bottom of the stack, | |
+ and a page size can be as small as 4096 bytes. So we cannot safely | |
+ invoke alloca (N) if N exceeds 4096. Use a slightly smaller number | |
+ to allow for a few compiler-allocated temporary stack slots. */ | |
+# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ | |
+# endif | |
+# else | |
+# define YYSTACK_ALLOC YYMALLOC | |
+# define YYSTACK_FREE YYFREE | |
+# ifndef YYSTACK_ALLOC_MAXIMUM | |
+# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM | |
+# endif | |
+# if (defined __cplusplus && ! defined EXIT_SUCCESS \ | |
+ && ! ((defined YYMALLOC || defined malloc) \ | |
+ && (defined YYFREE || defined free))) | |
+# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ | |
+# ifndef EXIT_SUCCESS | |
+# define EXIT_SUCCESS 0 | |
+# endif | |
+# endif | |
+# ifndef YYMALLOC | |
+# define YYMALLOC malloc | |
+# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ | |
+ || defined __cplusplus || defined _MSC_VER) | |
+void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ | |
+# endif | |
+# endif | |
+# ifndef YYFREE | |
+# define YYFREE free | |
+# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ | |
+ || defined __cplusplus || defined _MSC_VER) | |
+void free (void *); /* INFRINGES ON USER NAME SPACE */ | |
+# endif | |
+# endif | |
+# endif | |
+#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ | |
+ | |
+ | |
+#if (! defined yyoverflow \ | |
+ && (! defined __cplusplus \ | |
+ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) | |
+ | |
+/* A type that is properly aligned for any stack member. */ | |
+union yyalloc | |
+{ | |
+ yytype_int16 yyss_alloc; | |
+ YYSTYPE yyvs_alloc; | |
+}; | |
+ | |
+/* The size of the maximum gap between one aligned stack and the next. */ | |
+# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) | |
+ | |
+/* The size of an array large to enough to hold all stacks, each with | |
+ N elements. */ | |
+# define YYSTACK_BYTES(N) \ | |
+ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ | |
+ + YYSTACK_GAP_MAXIMUM) | |
+ | |
+# define YYCOPY_NEEDED 1 | |
+ | |
+/* Relocate STACK from its old location to the new one. The | |
+ local variables YYSIZE and YYSTACKSIZE give the old and new number of | |
+ elements in the stack, and YYPTR gives the new location of the | |
+ stack. Advance YYPTR to a properly aligned location for the next | |
+ stack. */ | |
+# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ | |
+ do \ | |
+ { \ | |
+ YYSIZE_T yynewbytes; \ | |
+ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ | |
+ Stack = &yyptr->Stack_alloc; \ | |
+ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ | |
+ yyptr += yynewbytes / sizeof (*yyptr); \ | |
+ } \ | |
+ while (YYID (0)) | |
+ | |
+#endif | |
+ | |
+#if defined YYCOPY_NEEDED && YYCOPY_NEEDED | |
+/* Copy COUNT objects from FROM to TO. The source and destination do | |
+ not overlap. */ | |
+# ifndef YYCOPY | |
+# if defined __GNUC__ && 1 < __GNUC__ | |
+# define YYCOPY(To, From, Count) \ | |
+ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) | |
+# else | |
+# define YYCOPY(To, From, Count) \ | |
+ do \ | |
+ { \ | |
+ YYSIZE_T yyi; \ | |
+ for (yyi = 0; yyi < (Count); yyi++) \ | |
+ (To)[yyi] = (From)[yyi]; \ | |
+ } \ | |
+ while (YYID (0)) | |
+# endif | |
+# endif | |
+#endif /* !YYCOPY_NEEDED */ | |
+ | |
+/* YYFINAL -- State number of the termination state. */ | |
+#define YYFINAL 3 | |
+/* YYLAST -- Last index in YYTABLE. */ | |
+#define YYLAST 161 | |
+ | |
+/* YYNTOKENS -- Number of terminals. */ | |
+#define YYNTOKENS 69 | |
+/* YYNNTS -- Number of nonterminals. */ | |
+#define YYNNTS 27 | |
+/* YYNRULES -- Number of rules. */ | |
+#define YYNRULES 97 | |
+/* YYNRULES -- Number of states. */ | |
+#define YYNSTATES 140 | |
+ | |
+/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ | |
+#define YYUNDEFTOK 2 | |
+#define YYMAXUTOK 302 | |
+ | |
+#define YYTRANSLATE(YYX) \ | |
+ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) | |
+ | |
+/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ | |
+static const yytype_uint8 yytranslate[] = | |
+{ | |
+ 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
+ 49, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
+ 2, 2, 2, 2, 63, 2, 57, 2, 2, 2, | |
+ 64, 65, 55, 60, 56, 68, 62, 59, 2, 2, | |
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
+ 53, 48, 54, 61, 2, 2, 2, 2, 2, 2, | |
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
+ 2, 66, 2, 67, 52, 2, 2, 2, 2, 2, | |
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
+ 2, 2, 2, 50, 58, 51, 2, 2, 2, 2, | |
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
+ 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, | |
+ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, | |
+ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, | |
+ 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, | |
+ 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, | |
+ 45, 46, 47 | |
+}; | |
+ | |
+#if YYDEBUG | |
+/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in | |
+ YYRHS. */ | |
+static const yytype_uint16 yyprhs[] = | |
+{ | |
+ 0, 0, 3, 9, 10, 14, 17, 18, 20, 22, | |
+ 24, 26, 29, 31, 33, 36, 39, 40, 44, 48, | |
+ 52, 56, 60, 64, 70, 76, 77, 78, 81, 83, | |
+ 85, 87, 88, 93, 97, 98, 102, 104, 106, 108, | |
+ 111, 115, 118, 120, 124, 126, 129, 132, 134, 141, | |
+ 147, 152, 155, 158, 161, 168, 174, 179, 181, 183, | |
+ 185, 189, 193, 195, 199, 203, 205, 209, 214, 219, | |
+ 222, 225, 226, 228, 230, 232, 234, 236, 238, 240, | |
+ 242, 244, 246, 248, 250, 252, 254, 256, 258, 260, | |
+ 262, 264, 266, 268, 270, 272, 274, 277 | |
+}; | |
+ | |
+/* YYRHS -- A `-1'-separated list of the rules' RHS. */ | |
+static const yytype_int8 yyrhs[] = | |
+{ | |
+ 70, 0, -1, 71, 72, 73, 79, 80, -1, -1, | |
+ 72, 74, 75, -1, 72, 76, -1, -1, 1, -1, | |
+ 5, -1, 6, -1, 7, -1, 75, 8, -1, 8, | |
+ -1, 1, -1, 11, 77, -1, 77, 78, -1, -1, | |
+ 12, 48, 8, -1, 16, 48, 8, -1, 13, 48, | |
+ 8, -1, 14, 48, 8, -1, 15, 48, 8, -1, | |
+ 17, 48, 8, -1, 79, 83, 80, 81, 49, -1, | |
+ 79, 83, 50, 79, 51, -1, -1, -1, 52, 86, | |
+ -1, 86, -1, 10, -1, 1, -1, -1, 53, 82, | |
+ 84, 54, -1, 53, 55, 54, -1, -1, 84, 56, | |
+ 85, -1, 85, -1, 1, -1, 8, -1, 88, 87, | |
+ -1, 88, 87, 57, -1, 87, 57, -1, 87, -1, | |
+ 87, 58, 89, -1, 89, -1, 87, 59, -1, 89, | |
+ 90, -1, 90, -1, 89, 44, 4, 56, 4, 45, | |
+ -1, 89, 44, 4, 56, 45, -1, 89, 44, 4, | |
+ 45, -1, 90, 55, -1, 90, 60, -1, 90, 61, | |
+ -1, 90, 46, 4, 56, 4, 47, -1, 90, 46, | |
+ 4, 56, 47, -1, 90, 46, 4, 47, -1, 62, | |
+ -1, 91, -1, 9, -1, 63, 95, 63, -1, 64, | |
+ 87, 65, -1, 3, -1, 91, 43, 92, -1, 91, | |
+ 42, 92, -1, 92, -1, 66, 93, 67, -1, 66, | |
+ 52, 93, 67, -1, 93, 3, 68, 3, -1, 93, | |
+ 3, -1, 93, 94, -1, -1, 18, -1, 19, -1, | |
+ 20, -1, 21, -1, 22, -1, 23, -1, 24, -1, | |
+ 25, -1, 26, -1, 27, -1, 29, -1, 28, -1, | |
+ 30, -1, 31, -1, 32, -1, 33, -1, 34, -1, | |
+ 35, -1, 37, -1, 38, -1, 39, -1, 41, -1, | |
+ 36, -1, 40, -1, 95, 3, -1, -1 | |
+}; | |
+ | |
+/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ | |
+static const yytype_uint16 yyrline[] = | |
+{ | |
+ 0, 118, 118, 148, 155, 156, 157, 158, 162, 170, | |
+ 173, 177, 180, 183, 187, 190, 191, 194, 199, 201, | |
+ 203, 205, 207, 211, 213, 215, 219, 231, 267, 291, | |
+ 314, 319, 322, 325, 343, 346, 348, 350, 354, 377, | |
+ 433, 436, 479, 497, 503, 508, 535, 543, 546, 574, | |
+ 588, 610, 617, 623, 629, 657, 671, 690, 724, 742, | |
+ 752, 755, 758, 773, 774, 775, 780, 782, 789, 849, | |
+ 867, 875, 883, 884, 885, 886, 887, 888, 889, 894, | |
+ 895, 896, 897, 898, 904, 905, 906, 907, 908, 909, | |
+ 910, 911, 912, 913, 914, 920, 928, 944 | |
+}; | |
+#endif | |
+ | |
+#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE | |
+/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. | |
+ First, the terminals, then, starting at YYNTOKENS, nonterminals. */ | |
+static const char *const yytname[] = | |
+{ | |
+ "$end", "error", "$undefined", "CHAR", "NUMBER", "SECTEND", "SCDECL", | |
+ "XSCDECL", "NAME", "PREVCCL", "EOF_OP", "OPTION_OP", "OPT_OUTFILE", | |
+ "OPT_PREFIX", "OPT_YYCLASS", "OPT_HEADER", "OPT_EXTRA_TYPE", | |
+ "OPT_TABLES", "CCE_ALNUM", "CCE_ALPHA", "CCE_BLANK", "CCE_CNTRL", | |
+ "CCE_DIGIT", "CCE_GRAPH", "CCE_LOWER", "CCE_PRINT", "CCE_PUNCT", | |
+ "CCE_SPACE", "CCE_UPPER", "CCE_XDIGIT", "CCE_NEG_ALNUM", "CCE_NEG_ALPHA", | |
+ "CCE_NEG_BLANK", "CCE_NEG_CNTRL", "CCE_NEG_DIGIT", "CCE_NEG_GRAPH", | |
+ "CCE_NEG_LOWER", "CCE_NEG_PRINT", "CCE_NEG_PUNCT", "CCE_NEG_SPACE", | |
+ "CCE_NEG_UPPER", "CCE_NEG_XDIGIT", "CCL_OP_UNION", "CCL_OP_DIFF", | |
+ "BEGIN_REPEAT_POSIX", "END_REPEAT_POSIX", "BEGIN_REPEAT_FLEX", | |
+ "END_REPEAT_FLEX", "'='", "'\\n'", "'{'", "'}'", "'^'", "'<'", "'>'", | |
+ "'*'", "','", "'$'", "'|'", "'/'", "'+'", "'?'", "'.'", "'\"'", "'('", | |
+ "')'", "'['", "']'", "'-'", "$accept", "goal", "initlex", "sect1", | |
+ "sect1end", "startconddecl", "namelist1", "options", "optionlist", | |
+ "option", "sect2", "initforrule", "flexrule", "scon_stk_ptr", "scon", | |
+ "namelist2", "sconname", "rule", "re", "re2", "series", "singleton", | |
+ "fullccl", "braceccl", "ccl", "ccl_expr", "string", 0 | |
+}; | |
+#endif | |
+ | |
+# ifdef YYPRINT | |
+/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to | |
+ token YYLEX-NUM. */ | |
+static const yytype_uint16 yytoknum[] = | |
+{ | |
+ 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, | |
+ 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, | |
+ 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, | |
+ 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, | |
+ 295, 296, 297, 298, 299, 300, 301, 302, 61, 10, | |
+ 123, 125, 94, 60, 62, 42, 44, 36, 124, 47, | |
+ 43, 63, 46, 34, 40, 41, 91, 93, 45 | |
+}; | |
+# endif | |
+ | |
+/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ | |
+static const yytype_uint8 yyr1[] = | |
+{ | |
+ 0, 69, 70, 71, 72, 72, 72, 72, 73, 74, | |
+ 74, 75, 75, 75, 76, 77, 77, 78, 78, 78, | |
+ 78, 78, 78, 79, 79, 79, 80, 81, 81, 81, | |
+ 81, 82, 83, 83, 83, 84, 84, 84, 85, 86, | |
+ 86, 86, 86, 87, 87, 88, 89, 89, 89, 89, | |
+ 89, 90, 90, 90, 90, 90, 90, 90, 90, 90, | |
+ 90, 90, 90, 91, 91, 91, 92, 92, 93, 93, | |
+ 93, 93, 94, 94, 94, 94, 94, 94, 94, 94, | |
+ 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, | |
+ 94, 94, 94, 94, 94, 94, 95, 95 | |
+}; | |
+ | |
+/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ | |
+static const yytype_uint8 yyr2[] = | |
+{ | |
+ 0, 2, 5, 0, 3, 2, 0, 1, 1, 1, | |
+ 1, 2, 1, 1, 2, 2, 0, 3, 3, 3, | |
+ 3, 3, 3, 5, 5, 0, 0, 2, 1, 1, | |
+ 1, 0, 4, 3, 0, 3, 1, 1, 1, 2, | |
+ 3, 2, 1, 3, 1, 2, 2, 1, 6, 5, | |
+ 4, 2, 2, 2, 6, 5, 4, 1, 1, 1, | |
+ 3, 3, 1, 3, 3, 1, 3, 4, 4, 2, | |
+ 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, | |
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
+ 1, 1, 1, 1, 1, 1, 2, 0 | |
+}; | |
+ | |
+/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. | |
+ Performed when YYTABLE doesn't specify something else to do. Zero | |
+ means the default is an error. */ | |
+static const yytype_uint8 yydefact[] = | |
+{ | |
+ 3, 0, 0, 1, 7, 0, 8, 9, 10, 16, | |
+ 25, 0, 5, 14, 34, 13, 12, 4, 0, 0, | |
+ 0, 0, 0, 0, 15, 31, 2, 26, 11, 0, | |
+ 0, 0, 0, 0, 0, 0, 0, 25, 0, 17, | |
+ 19, 20, 21, 18, 22, 33, 37, 38, 0, 36, | |
+ 34, 30, 62, 59, 29, 0, 57, 97, 0, 71, | |
+ 0, 28, 42, 0, 44, 47, 58, 65, 32, 0, | |
+ 24, 27, 0, 0, 71, 0, 23, 41, 0, 45, | |
+ 39, 0, 46, 0, 51, 52, 53, 0, 0, 35, | |
+ 96, 60, 61, 0, 69, 72, 73, 74, 75, 76, | |
+ 77, 78, 79, 80, 81, 83, 82, 84, 85, 86, | |
+ 87, 88, 89, 94, 90, 91, 92, 95, 93, 66, | |
+ 70, 43, 40, 0, 0, 64, 63, 67, 0, 50, | |
+ 0, 56, 0, 68, 0, 49, 0, 55, 48, 54 | |
+}; | |
+ | |
+/* YYDEFGOTO[NTERM-NUM]. */ | |
+static const yytype_int8 yydefgoto[] = | |
+{ | |
+ -1, 1, 2, 5, 10, 11, 17, 12, 13, 24, | |
+ 14, 26, 60, 36, 27, 48, 49, 61, 62, 63, | |
+ 64, 65, 66, 67, 75, 120, 72 | |
+}; | |
+ | |
+/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing | |
+ STATE-NUM. */ | |
+#define YYPACT_NINF -52 | |
+static const yytype_int16 yypact[] = | |
+{ | |
+ -52, 17, 103, -52, -52, 113, -52, -52, -52, -52, | |
+ -52, 48, -52, 114, 6, -52, -52, 42, 7, 12, | |
+ 58, 77, 88, 89, -52, 43, -52, 73, -52, 130, | |
+ 131, 132, 133, 134, 135, 90, 91, -52, -1, -52, | |
+ -52, -52, -52, -52, -52, -52, -52, -52, 40, -52, | |
+ 44, -52, -52, -52, -52, 39, -52, -52, 39, 93, | |
+ 97, -52, -12, 39, 49, 61, -31, -52, -52, 139, | |
+ -52, -52, 1, -51, -52, 0, -52, -52, 39, -52, | |
+ 75, 144, 61, 145, -52, -52, -52, 84, 84, -52, | |
+ -52, -52, -52, 50, 83, -52, -52, -52, -52, -52, | |
+ -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, | |
+ -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, | |
+ -52, 49, -52, -40, 10, -52, -52, -52, 149, -52, | |
+ 9, -52, -3, -52, 108, -52, 107, -52, -52, -52 | |
+}; | |
+ | |
+/* YYPGOTO[NTERM-NUM]. */ | |
+static const yytype_int16 yypgoto[] = | |
+{ | |
+ -52, -52, -52, -52, -52, -52, -52, -52, -52, -52, | |
+ 118, 129, -52, -52, -52, -52, 92, 102, -48, -52, | |
+ 80, -21, -52, 47, 85, -52, -52 | |
+}; | |
+ | |
+/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If | |
+ positive, shift that token. If negative, reduce the rule which | |
+ number is the opposite. If YYTABLE_NINF, syntax error. */ | |
+#define YYTABLE_NINF -27 | |
+static const yytype_int16 yytable[] = | |
+{ | |
+ 51, 136, 52, 94, 90, 129, -26, 78, 53, 54, | |
+ 73, 87, 88, 134, 92, 80, 130, 3, 95, 96, | |
+ 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, | |
+ 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, | |
+ 117, 118, 52, 82, 137, 77, 78, 79, 53, 15, | |
+ 28, 55, 52, 94, 135, 29, 16, 131, 53, 25, | |
+ 30, 56, 57, 58, 91, 59, 132, 119, 95, 96, | |
+ 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, | |
+ 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, | |
+ 117, 118, 46, 81, 68, 70, 69, 25, 35, 47, | |
+ 82, 56, 57, 58, 4, 59, 31, 83, -6, -6, | |
+ -6, 56, 57, 58, -6, 59, 84, 127, 6, 7, | |
+ 8, 85, 86, 37, 9, 32, 18, 19, 20, 21, | |
+ 22, 23, 122, 78, 125, 126, 33, 34, 39, 40, | |
+ 41, 42, 43, 44, 45, 74, 76, 47, 123, 124, | |
+ 59, 128, 133, 138, 139, 50, 38, 71, 121, 93, | |
+ 0, 89 | |
+}; | |
+ | |
+#define yypact_value_is_default(yystate) \ | |
+ ((yystate) == (-52)) | |
+ | |
+#define yytable_value_is_error(yytable_value) \ | |
+ YYID (0) | |
+ | |
+static const yytype_int8 yycheck[] = | |
+{ | |
+ 1, 4, 3, 3, 3, 45, 0, 58, 9, 10, | |
+ 58, 42, 43, 4, 65, 63, 56, 0, 18, 19, | |
+ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, | |
+ 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, | |
+ 40, 41, 3, 64, 47, 57, 58, 59, 9, 1, | |
+ 8, 52, 3, 3, 45, 48, 8, 47, 9, 53, | |
+ 48, 62, 63, 64, 63, 66, 56, 67, 18, 19, | |
+ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, | |
+ 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, | |
+ 40, 41, 1, 44, 54, 51, 56, 53, 55, 8, | |
+ 121, 62, 63, 64, 1, 66, 48, 46, 5, 6, | |
+ 7, 62, 63, 64, 11, 66, 55, 67, 5, 6, | |
+ 7, 60, 61, 50, 11, 48, 12, 13, 14, 15, | |
+ 16, 17, 57, 58, 87, 88, 48, 48, 8, 8, | |
+ 8, 8, 8, 8, 54, 52, 49, 8, 4, 4, | |
+ 66, 68, 3, 45, 47, 37, 27, 55, 78, 74, | |
+ -1, 69 | |
+}; | |
+ | |
+/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing | |
+ symbol of state STATE-NUM. */ | |
+static const yytype_uint8 yystos[] = | |
+{ | |
+ 0, 70, 71, 0, 1, 72, 5, 6, 7, 11, | |
+ 73, 74, 76, 77, 79, 1, 8, 75, 12, 13, | |
+ 14, 15, 16, 17, 78, 53, 80, 83, 8, 48, | |
+ 48, 48, 48, 48, 48, 55, 82, 50, 80, 8, | |
+ 8, 8, 8, 8, 8, 54, 1, 8, 84, 85, | |
+ 79, 1, 3, 9, 10, 52, 62, 63, 64, 66, | |
+ 81, 86, 87, 88, 89, 90, 91, 92, 54, 56, | |
+ 51, 86, 95, 87, 52, 93, 49, 57, 58, 59, | |
+ 87, 44, 90, 46, 55, 60, 61, 42, 43, 85, | |
+ 3, 63, 65, 93, 3, 18, 19, 20, 21, 22, | |
+ 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, | |
+ 33, 34, 35, 36, 37, 38, 39, 40, 41, 67, | |
+ 94, 89, 57, 4, 4, 92, 92, 67, 68, 45, | |
+ 56, 47, 56, 3, 4, 45, 4, 47, 45, 47 | |
+}; | |
+ | |
+#define yyerrok (yyerrstatus = 0) | |
+#define yyclearin (yychar = YYEMPTY) | |
+#define YYEMPTY (-2) | |
+#define YYEOF 0 | |
+ | |
+#define YYACCEPT goto yyacceptlab | |
+#define YYABORT goto yyabortlab | |
+#define YYERROR goto yyerrorlab | |
+ | |
+ | |
+/* Like YYERROR except do call yyerror. This remains here temporarily | |
+ to ease the transition to the new meaning of YYERROR, for GCC. | |
+ Once GCC version 2 has supplanted version 1, this can go. However, | |
+ YYFAIL appears to be in use. Nevertheless, it is formally deprecated | |
+ in Bison 2.4.2's NEWS entry, where a plan to phase it out is | |
+ discussed. */ | |
+ | |
+#define YYFAIL goto yyerrlab | |
+#if defined YYFAIL | |
+ /* This is here to suppress warnings from the GCC cpp's | |
+ -Wunused-macros. Normally we don't worry about that warning, but | |
+ some users do, and we want to make it easy for users to remove | |
+ YYFAIL uses, which will produce warnings from Bison 2.5. */ | |
+#endif | |
+ | |
+#define YYRECOVERING() (!!yyerrstatus) | |
+ | |
+#define YYBACKUP(Token, Value) \ | |
+do \ | |
+ if (yychar == YYEMPTY && yylen == 1) \ | |
+ { \ | |
+ yychar = (Token); \ | |
+ yylval = (Value); \ | |
+ YYPOPSTACK (1); \ | |
+ goto yybackup; \ | |
+ } \ | |
+ else \ | |
+ { \ | |
+ yyerror (YY_("syntax error: cannot back up")); \ | |
+ YYERROR; \ | |
+ } \ | |
+while (YYID (0)) | |
+ | |
+ | |
+#define YYTERROR 1 | |
+#define YYERRCODE 256 | |
+ | |
+ | |
+/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. | |
+ If N is 0, then set CURRENT to the empty location which ends | |
+ the previous symbol: RHS[0] (always defined). */ | |
+ | |
+#define YYRHSLOC(Rhs, K) ((Rhs)[K]) | |
+#ifndef YYLLOC_DEFAULT | |
+# define YYLLOC_DEFAULT(Current, Rhs, N) \ | |
+ do \ | |
+ if (YYID (N)) \ | |
+ { \ | |
+ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ | |
+ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ | |
+ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ | |
+ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ | |
+ } \ | |
+ else \ | |
+ { \ | |
+ (Current).first_line = (Current).last_line = \ | |
+ YYRHSLOC (Rhs, 0).last_line; \ | |
+ (Current).first_column = (Current).last_column = \ | |
+ YYRHSLOC (Rhs, 0).last_column; \ | |
+ } \ | |
+ while (YYID (0)) | |
+#endif | |
+ | |
+ | |
+/* This macro is provided for backward compatibility. */ | |
+ | |
+#ifndef YY_LOCATION_PRINT | |
+# define YY_LOCATION_PRINT(File, Loc) ((void) 0) | |
+#endif | |
+ | |
+ | |
+/* YYLEX -- calling `yylex' with the right arguments. */ | |
+ | |
+#ifdef YYLEX_PARAM | |
+# define YYLEX yylex (YYLEX_PARAM) | |
+#else | |
+# define YYLEX yylex () | |
+#endif | |
+ | |
+/* Enable debugging if requested. */ | |
+#if YYDEBUG | |
+ | |
+# ifndef YYFPRINTF | |
+# include <stdio.h> /* INFRINGES ON USER NAME SPACE */ | |
+# define YYFPRINTF fprintf | |
+# endif | |
+ | |
+# define YYDPRINTF(Args) \ | |
+do { \ | |
+ if (yydebug) \ | |
+ YYFPRINTF Args; \ | |
+} while (YYID (0)) | |
+ | |
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ | |
+do { \ | |
+ if (yydebug) \ | |
+ { \ | |
+ YYFPRINTF (stderr, "%s ", Title); \ | |
+ yy_symbol_print (stderr, \ | |
+ Type, Value); \ | |
+ YYFPRINTF (stderr, "\n"); \ | |
+ } \ | |
+} while (YYID (0)) | |
+ | |
+ | |
+/*--------------------------------. | |
+| Print this symbol on YYOUTPUT. | | |
+`--------------------------------*/ | |
+ | |
+/*ARGSUSED*/ | |
+#if (defined __STDC__ || defined __C99__FUNC__ \ | |
+ || defined __cplusplus || defined _MSC_VER) | |
+static void | |
+yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) | |
+#else | |
+static void | |
+yy_symbol_value_print (yyoutput, yytype, yyvaluep) | |
+ FILE *yyoutput; | |
+ int yytype; | |
+ YYSTYPE const * const yyvaluep; | |
+#endif | |
+{ | |
+ if (!yyvaluep) | |
+ return; | |
+# ifdef YYPRINT | |
+ if (yytype < YYNTOKENS) | |
+ YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); | |
+# else | |
+ YYUSE (yyoutput); | |
+# endif | |
+ switch (yytype) | |
+ { | |
+ default: | |
+ break; | |
+ } | |
+} | |
+ | |
+ | |
+/*--------------------------------. | |
+| Print this symbol on YYOUTPUT. | | |
+`--------------------------------*/ | |
+ | |
+#if (defined __STDC__ || defined __C99__FUNC__ \ | |
+ || defined __cplusplus || defined _MSC_VER) | |
+static void | |
+yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) | |
+#else | |
+static void | |
+yy_symbol_print (yyoutput, yytype, yyvaluep) | |
+ FILE *yyoutput; | |
+ int yytype; | |
+ YYSTYPE const * const yyvaluep; | |
+#endif | |
+{ | |
+ if (yytype < YYNTOKENS) | |
+ YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); | |
+ else | |
+ YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); | |
+ | |
+ yy_symbol_value_print (yyoutput, yytype, yyvaluep); | |
+ YYFPRINTF (yyoutput, ")"); | |
+} | |
+ | |
+/*------------------------------------------------------------------. | |
+| yy_stack_print -- Print the state stack from its BOTTOM up to its | | |
+| TOP (included). | | |
+`------------------------------------------------------------------*/ | |
+ | |
+#if (defined __STDC__ || defined __C99__FUNC__ \ | |
+ || defined __cplusplus || defined _MSC_VER) | |
+static void | |
+yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) | |
+#else | |
+static void | |
+yy_stack_print (yybottom, yytop) | |
+ yytype_int16 *yybottom; | |
+ yytype_int16 *yytop; | |
+#endif | |
+{ | |
+ YYFPRINTF (stderr, "Stack now"); | |
+ for (; yybottom <= yytop; yybottom++) | |
+ { | |
+ int yybot = *yybottom; | |
+ YYFPRINTF (stderr, " %d", yybot); | |
+ } | |
+ YYFPRINTF (stderr, "\n"); | |
+} | |
+ | |
+# define YY_STACK_PRINT(Bottom, Top) \ | |
+do { \ | |
+ if (yydebug) \ | |
+ yy_stack_print ((Bottom), (Top)); \ | |
+} while (YYID (0)) | |
+ | |
+ | |
+/*------------------------------------------------. | |
+| Report that the YYRULE is going to be reduced. | | |
+`------------------------------------------------*/ | |
+ | |
+#if (defined __STDC__ || defined __C99__FUNC__ \ | |
+ || defined __cplusplus || defined _MSC_VER) | |
+static void | |
+yy_reduce_print (YYSTYPE *yyvsp, int yyrule) | |
+#else | |
+static void | |
+yy_reduce_print (yyvsp, yyrule) | |
+ YYSTYPE *yyvsp; | |
+ int yyrule; | |
+#endif | |
+{ | |
+ int yynrhs = yyr2[yyrule]; | |
+ int yyi; | |
+ unsigned long int yylno = yyrline[yyrule]; | |
+ YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", | |
+ yyrule - 1, yylno); | |
+ /* The symbols being reduced. */ | |
+ for (yyi = 0; yyi < yynrhs; yyi++) | |
+ { | |
+ YYFPRINTF (stderr, " $%d = ", yyi + 1); | |
+ yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], | |
+ &(yyvsp[(yyi + 1) - (yynrhs)]) | |
+ ); | |
+ YYFPRINTF (stderr, "\n"); | |
+ } | |
+} | |
+ | |
+# define YY_REDUCE_PRINT(Rule) \ | |
+do { \ | |
+ if (yydebug) \ | |
+ yy_reduce_print (yyvsp, Rule); \ | |
+} while (YYID (0)) | |
+ | |
+/* Nonzero means print parse trace. It is left uninitialized so that | |
+ multiple parsers can coexist. */ | |
+int yydebug; | |
+#else /* !YYDEBUG */ | |
+# define YYDPRINTF(Args) | |
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location) | |
+# define YY_STACK_PRINT(Bottom, Top) | |
+# define YY_REDUCE_PRINT(Rule) | |
+#endif /* !YYDEBUG */ | |
+ | |
+ | |
+/* YYINITDEPTH -- initial size of the parser's stacks. */ | |
+#ifndef YYINITDEPTH | |
+# define YYINITDEPTH 200 | |
+#endif | |
+ | |
+/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only | |
+ if the built-in stack extension method is used). | |
+ | |
+ Do not make this value too large; the results are undefined if | |
+ YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) | |
+ evaluated with infinite-precision integer arithmetic. */ | |
+ | |
+#ifndef YYMAXDEPTH | |
+# define YYMAXDEPTH 10000 | |
+#endif | |
+ | |
+ | |
+#if YYERROR_VERBOSE | |
+ | |
+# ifndef yystrlen | |
+# if defined __GLIBC__ && defined _STRING_H | |
+# define yystrlen strlen | |
+# else | |
+/* Return the length of YYSTR. */ | |
+#if (defined __STDC__ || defined __C99__FUNC__ \ | |
+ || defined __cplusplus || defined _MSC_VER) | |
+static YYSIZE_T | |
+yystrlen (const char *yystr) | |
+#else | |
+static YYSIZE_T | |
+yystrlen (yystr) | |
+ const char *yystr; | |
+#endif | |
+{ | |
+ YYSIZE_T yylen; | |
+ for (yylen = 0; yystr[yylen]; yylen++) | |
+ continue; | |
+ return yylen; | |
+} | |
+# endif | |
+# endif | |
+ | |
+# ifndef yystpcpy | |
+# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE | |
+# define yystpcpy stpcpy | |
+# else | |
+/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in | |
+ YYDEST. */ | |
+#if (defined __STDC__ || defined __C99__FUNC__ \ | |
+ || defined __cplusplus || defined _MSC_VER) | |
+static char * | |
+yystpcpy (char *yydest, const char *yysrc) | |
+#else | |
+static char * | |
+yystpcpy (yydest, yysrc) | |
+ char *yydest; | |
+ const char *yysrc; | |
+#endif | |
+{ | |
+ char *yyd = yydest; | |
+ const char *yys = yysrc; | |
+ | |
+ while ((*yyd++ = *yys++) != '\0') | |
+ continue; | |
+ | |
+ return yyd - 1; | |
+} | |
+# endif | |
+# endif | |
+ | |
+# ifndef yytnamerr | |
+/* Copy to YYRES the contents of YYSTR after stripping away unnecessary | |
+ quotes and backslashes, so that it's suitable for yyerror. The | |
+ heuristic is that double-quoting is unnecessary unless the string | |
+ contains an apostrophe, a comma, or backslash (other than | |
+ backslash-backslash). YYSTR is taken from yytname. If YYRES is | |
+ null, do not copy; instead, return the length of what the result | |
+ would have been. */ | |
+static YYSIZE_T | |
+yytnamerr (char *yyres, const char *yystr) | |
+{ | |
+ if (*yystr == '"') | |
+ { | |
+ YYSIZE_T yyn = 0; | |
+ char const *yyp = yystr; | |
+ | |
+ for (;;) | |
+ switch (*++yyp) | |
+ { | |
+ case '\'': | |
+ case ',': | |
+ goto do_not_strip_quotes; | |
+ | |
+ case '\\': | |
+ if (*++yyp != '\\') | |
+ goto do_not_strip_quotes; | |
+ /* Fall through. */ | |
+ default: | |
+ if (yyres) | |
+ yyres[yyn] = *yyp; | |
+ yyn++; | |
+ break; | |
+ | |
+ case '"': | |
+ if (yyres) | |
+ yyres[yyn] = '\0'; | |
+ return yyn; | |
+ } | |
+ do_not_strip_quotes: ; | |
+ } | |
+ | |
+ if (! yyres) | |
+ return yystrlen (yystr); | |
+ | |
+ return yystpcpy (yyres, yystr) - yyres; | |
+} | |
+# endif | |
+ | |
+/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message | |
+ about the unexpected token YYTOKEN for the state stack whose top is | |
+ YYSSP. | |
+ | |
+ Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is | |
+ not large enough to hold the message. In that case, also set | |
+ *YYMSG_ALLOC to the required number of bytes. Return 2 if the | |
+ required number of bytes is too large to store. */ | |
+static int | |
+yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, | |
+ yytype_int16 *yyssp, int yytoken) | |
+{ | |
+ YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); | |
+ YYSIZE_T yysize = yysize0; | |
+ YYSIZE_T yysize1; | |
+ enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; | |
+ /* Internationalized format string. */ | |
+ const char *yyformat = 0; | |
+ /* Arguments of yyformat. */ | |
+ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; | |
+ /* Number of reported tokens (one for the "unexpected", one per | |
+ "expected"). */ | |
+ int yycount = 0; | |
+ | |
+ /* There are many possibilities here to consider: | |
+ - Assume YYFAIL is not used. It's too flawed to consider. See | |
+ <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html> | |
+ for details. YYERROR is fine as it does not invoke this | |
+ function. | |
+ - If this state is a consistent state with a default action, then | |
+ the only way this function was invoked is if the default action | |
+ is an error action. In that case, don't check for expected | |
+ tokens because there are none. | |
+ - The only way there can be no lookahead present (in yychar) is if | |
+ this state is a consistent state with a default action. Thus, | |
+ detecting the absence of a lookahead is sufficient to determine | |
+ that there is no unexpected or expected token to report. In that | |
+ case, just report a simple "syntax error". | |
+ - Don't assume there isn't a lookahead just because this state is a | |
+ consistent state with a default action. There might have been a | |
+ previous inconsistent state, consistent state with a non-default | |
+ action, or user semantic action that manipulated yychar. | |
+ - Of course, the expected token list depends on states to have | |
+ correct lookahead information, and it depends on the parser not | |
+ to perform extra reductions after fetching a lookahead from the | |
+ scanner and before detecting a syntax error. Thus, state merging | |
+ (from LALR or IELR) and default reductions corrupt the expected | |
+ token list. However, the list is correct for canonical LR with | |
+ one exception: it will still contain any token that will not be | |
+ accepted due to an error action in a later state. | |
+ */ | |
+ if (yytoken != YYEMPTY) | |
+ { | |
+ int yyn = yypact[*yyssp]; | |
+ yyarg[yycount++] = yytname[yytoken]; | |
+ if (!yypact_value_is_default (yyn)) | |
+ { | |
+ /* Start YYX at -YYN if negative to avoid negative indexes in | |
+ YYCHECK. In other words, skip the first -YYN actions for | |
+ this state because they are default actions. */ | |
+ int yyxbegin = yyn < 0 ? -yyn : 0; | |
+ /* Stay within bounds of both yycheck and yytname. */ | |
+ int yychecklim = YYLAST - yyn + 1; | |
+ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; | |
+ int yyx; | |
+ | |
+ for (yyx = yyxbegin; yyx < yyxend; ++yyx) | |
+ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR | |
+ && !yytable_value_is_error (yytable[yyx + yyn])) | |
+ { | |
+ if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) | |
+ { | |
+ yycount = 1; | |
+ yysize = yysize0; | |
+ break; | |
+ } | |
+ yyarg[yycount++] = yytname[yyx]; | |
+ yysize1 = yysize + yytnamerr (0, yytname[yyx]); | |
+ if (! (yysize <= yysize1 | |
+ && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) | |
+ return 2; | |
+ yysize = yysize1; | |
+ } | |
+ } | |
+ } | |
+ | |
+ switch (yycount) | |
+ { | |
+# define YYCASE_(N, S) \ | |
+ case N: \ | |
+ yyformat = S; \ | |
+ break | |
+ YYCASE_(0, YY_("syntax error")); | |
+ YYCASE_(1, YY_("syntax error, unexpected %s")); | |
+ YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); | |
+ YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); | |
+ YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); | |
+ YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); | |
+# undef YYCASE_ | |
+ } | |
+ | |
+ yysize1 = yysize + yystrlen (yyformat); | |
+ if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) | |
+ return 2; | |
+ yysize = yysize1; | |
+ | |
+ if (*yymsg_alloc < yysize) | |
+ { | |
+ *yymsg_alloc = 2 * yysize; | |
+ if (! (yysize <= *yymsg_alloc | |
+ && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) | |
+ *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; | |
+ return 1; | |
+ } | |
+ | |
+ /* Avoid sprintf, as that infringes on the user's name space. | |
+ Don't have undefined behavior even if the translation | |
+ produced a string with the wrong number of "%s"s. */ | |
+ { | |
+ char *yyp = *yymsg; | |
+ int yyi = 0; | |
+ while ((*yyp = *yyformat) != '\0') | |
+ if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) | |
+ { | |
+ yyp += yytnamerr (yyp, yyarg[yyi++]); | |
+ yyformat += 2; | |
+ } | |
+ else | |
+ { | |
+ yyp++; | |
+ yyformat++; | |
+ } | |
+ } | |
+ return 0; | |
+} | |
+#endif /* YYERROR_VERBOSE */ | |
+ | |
+/*-----------------------------------------------. | |
+| Release the memory associated to this symbol. | | |
+`-----------------------------------------------*/ | |
+ | |
+/*ARGSUSED*/ | |
+#if (defined __STDC__ || defined __C99__FUNC__ \ | |
+ || defined __cplusplus || defined _MSC_VER) | |
+static void | |
+yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) | |
+#else | |
+static void | |
+yydestruct (yymsg, yytype, yyvaluep) | |
+ const char *yymsg; | |
+ int yytype; | |
+ YYSTYPE *yyvaluep; | |
+#endif | |
+{ | |
+ YYUSE (yyvaluep); | |
+ | |
+ if (!yymsg) | |
+ yymsg = "Deleting"; | |
+ YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); | |
+ | |
+ switch (yytype) | |
+ { | |
+ | |
+ default: | |
+ break; | |
+ } | |
+} | |
+ | |
+ | |
+/* Prevent warnings from -Wmissing-prototypes. */ | |
+#ifdef YYPARSE_PARAM | |
+#if defined __STDC__ || defined __cplusplus | |
+int yyparse (void *YYPARSE_PARAM); | |
+#else | |
+int yyparse (); | |
+#endif | |
+#else /* ! YYPARSE_PARAM */ | |
+#if defined __STDC__ || defined __cplusplus | |
+int yyparse (void); | |
+#else | |
+int yyparse (); | |
+#endif | |
+#endif /* ! YYPARSE_PARAM */ | |
+ | |
+ | |
+/* The lookahead symbol. */ | |
+int yychar; | |
+ | |
+/* The semantic value of the lookahead symbol. */ | |
+YYSTYPE yylval; | |
+ | |
+/* Number of syntax errors so far. */ | |
+int yynerrs; | |
+ | |
+ | |
+/*----------. | |
+| yyparse. | | |
+`----------*/ | |
+ | |
+#ifdef YYPARSE_PARAM | |
+#if (defined __STDC__ || defined __C99__FUNC__ \ | |
+ || defined __cplusplus || defined _MSC_VER) | |
+int | |
+yyparse (void *YYPARSE_PARAM) | |
+#else | |
+int | |
+yyparse (YYPARSE_PARAM) | |
+ void *YYPARSE_PARAM; | |
+#endif | |
+#else /* ! YYPARSE_PARAM */ | |
+#if (defined __STDC__ || defined __C99__FUNC__ \ | |
+ || defined __cplusplus || defined _MSC_VER) | |
+int | |
+yyparse (void) | |
+#else | |
+int | |
+yyparse () | |
+ | |
+#endif | |
+#endif | |
+{ | |
+ int yystate; | |
+ /* Number of tokens to shift before error messages enabled. */ | |
+ int yyerrstatus; | |
+ | |
+ /* The stacks and their tools: | |
+ `yyss': related to states. | |
+ `yyvs': related to semantic values. | |
+ | |
+ Refer to the stacks thru separate pointers, to allow yyoverflow | |
+ to reallocate them elsewhere. */ | |
+ | |
+ /* The state stack. */ | |
+ yytype_int16 yyssa[YYINITDEPTH]; | |
+ yytype_int16 *yyss; | |
+ yytype_int16 *yyssp; | |
+ | |
+ /* The semantic value stack. */ | |
+ YYSTYPE yyvsa[YYINITDEPTH]; | |
+ YYSTYPE *yyvs; | |
+ YYSTYPE *yyvsp; | |
+ | |
+ YYSIZE_T yystacksize; | |
+ | |
+ int yyn; | |
+ int yyresult; | |
+ /* Lookahead token as an internal (translated) token number. */ | |
+ int yytoken; | |
+ /* The variables used to return semantic value and location from the | |
+ action routines. */ | |
+ YYSTYPE yyval; | |
+ | |
+#if YYERROR_VERBOSE | |
+ /* Buffer for error messages, and its allocated size. */ | |
+ char yymsgbuf[128]; | |
+ char *yymsg = yymsgbuf; | |
+ YYSIZE_T yymsg_alloc = sizeof yymsgbuf; | |
+#endif | |
+ | |
+#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) | |
+ | |
+ /* The number of symbols on the RHS of the reduced rule. | |
+ Keep to zero when no symbol should be popped. */ | |
+ int yylen = 0; | |
+ | |
+ yytoken = 0; | |
+ yyss = yyssa; | |
+ yyvs = yyvsa; | |
+ yystacksize = YYINITDEPTH; | |
+ | |
+ YYDPRINTF ((stderr, "Starting parse\n")); | |
+ | |
+ yystate = 0; | |
+ yyerrstatus = 0; | |
+ yynerrs = 0; | |
+ yychar = YYEMPTY; /* Cause a token to be read. */ | |
+ | |
+ /* Initialize stack pointers. | |
+ Waste one element of value and location stack | |
+ so that they stay on the same level as the state stack. | |
+ The wasted elements are never initialized. */ | |
+ yyssp = yyss; | |
+ yyvsp = yyvs; | |
+ | |
+ goto yysetstate; | |
+ | |
+/*------------------------------------------------------------. | |
+| yynewstate -- Push a new state, which is found in yystate. | | |
+`------------------------------------------------------------*/ | |
+ yynewstate: | |
+ /* In all cases, when you get here, the value and location stacks | |
+ have just been pushed. So pushing a state here evens the stacks. */ | |
+ yyssp++; | |
+ | |
+ yysetstate: | |
+ *yyssp = yystate; | |
+ | |
+ if (yyss + yystacksize - 1 <= yyssp) | |
+ { | |
+ /* Get the current used size of the three stacks, in elements. */ | |
+ YYSIZE_T yysize = yyssp - yyss + 1; | |
+ | |
+#ifdef yyoverflow | |
+ { | |
+ /* Give user a chance to reallocate the stack. Use copies of | |
+ these so that the &'s don't force the real ones into | |
+ memory. */ | |
+ YYSTYPE *yyvs1 = yyvs; | |
+ yytype_int16 *yyss1 = yyss; | |
+ | |
+ /* Each stack pointer address is followed by the size of the | |
+ data in use in that stack, in bytes. This used to be a | |
+ conditional around just the two extra args, but that might | |
+ be undefined if yyoverflow is a macro. */ | |
+ yyoverflow (YY_("memory exhausted"), | |
+ &yyss1, yysize * sizeof (*yyssp), | |
+ &yyvs1, yysize * sizeof (*yyvsp), | |
+ &yystacksize); | |
+ | |
+ yyss = yyss1; | |
+ yyvs = yyvs1; | |
+ } | |
+#else /* no yyoverflow */ | |
+# ifndef YYSTACK_RELOCATE | |
+ goto yyexhaustedlab; | |
+# else | |
+ /* Extend the stack our own way. */ | |
+ if (YYMAXDEPTH <= yystacksize) | |
+ goto yyexhaustedlab; | |
+ yystacksize *= 2; | |
+ if (YYMAXDEPTH < yystacksize) | |
+ yystacksize = YYMAXDEPTH; | |
+ | |
+ { | |
+ yytype_int16 *yyss1 = yyss; | |
+ union yyalloc *yyptr = | |
+ (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); | |
+ if (! yyptr) | |
+ goto yyexhaustedlab; | |
+ YYSTACK_RELOCATE (yyss_alloc, yyss); | |
+ YYSTACK_RELOCATE (yyvs_alloc, yyvs); | |
+# undef YYSTACK_RELOCATE | |
+ if (yyss1 != yyssa) | |
+ YYSTACK_FREE (yyss1); | |
+ } | |
+# endif | |
+#endif /* no yyoverflow */ | |
+ | |
+ yyssp = yyss + yysize - 1; | |
+ yyvsp = yyvs + yysize - 1; | |
+ | |
+ YYDPRINTF ((stderr, "Stack size increased to %lu\n", | |
+ (unsigned long int) yystacksize)); | |
+ | |
+ if (yyss + yystacksize - 1 <= yyssp) | |
+ YYABORT; | |
+ } | |
+ | |
+ YYDPRINTF ((stderr, "Entering state %d\n", yystate)); | |
+ | |
+ if (yystate == YYFINAL) | |
+ YYACCEPT; | |
+ | |
+ goto yybackup; | |
+ | |
+/*-----------. | |
+| yybackup. | | |
+`-----------*/ | |
+yybackup: | |
+ | |
+ /* Do appropriate processing given the current state. Read a | |
+ lookahead token if we need one and don't already have one. */ | |
+ | |
+ /* First try to decide what to do without reference to lookahead token. */ | |
+ yyn = yypact[yystate]; | |
+ if (yypact_value_is_default (yyn)) | |
+ goto yydefault; | |
+ | |
+ /* Not known => get a lookahead token if don't already have one. */ | |
+ | |
+ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ | |
+ if (yychar == YYEMPTY) | |
+ { | |
+ YYDPRINTF ((stderr, "Reading a token: ")); | |
+ yychar = YYLEX; | |
+ } | |
+ | |
+ if (yychar <= YYEOF) | |
+ { | |
+ yychar = yytoken = YYEOF; | |
+ YYDPRINTF ((stderr, "Now at end of input.\n")); | |
+ } | |
+ else | |
+ { | |
+ yytoken = YYTRANSLATE (yychar); | |
+ YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); | |
+ } | |
+ | |
+ /* If the proper action on seeing token YYTOKEN is to reduce or to | |
+ detect an error, take that action. */ | |
+ yyn += yytoken; | |
+ if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) | |
+ goto yydefault; | |
+ yyn = yytable[yyn]; | |
+ if (yyn <= 0) | |
+ { | |
+ if (yytable_value_is_error (yyn)) | |
+ goto yyerrlab; | |
+ yyn = -yyn; | |
+ goto yyreduce; | |
+ } | |
+ | |
+ /* Count tokens shifted since error; after three, turn off error | |
+ status. */ | |
+ if (yyerrstatus) | |
+ yyerrstatus--; | |
+ | |
+ /* Shift the lookahead token. */ | |
+ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); | |
+ | |
+ /* Discard the shifted token. */ | |
+ yychar = YYEMPTY; | |
+ | |
+ yystate = yyn; | |
+ *++yyvsp = yylval; | |
+ | |
+ goto yynewstate; | |
+ | |
+ | |
+/*-----------------------------------------------------------. | |
+| yydefault -- do the default action for the current state. | | |
+`-----------------------------------------------------------*/ | |
+yydefault: | |
+ yyn = yydefact[yystate]; | |
+ if (yyn == 0) | |
+ goto yyerrlab; | |
+ goto yyreduce; | |
+ | |
+ | |
+/*-----------------------------. | |
+| yyreduce -- Do a reduction. | | |
+`-----------------------------*/ | |
+yyreduce: | |
+ /* yyn is the number of a rule to reduce with. */ | |
+ yylen = yyr2[yyn]; | |
+ | |
+ /* If YYLEN is nonzero, implement the default value of the action: | |
+ `$$ = $1'. | |
+ | |
+ Otherwise, the following line sets YYVAL to garbage. | |
+ This behavior is undocumented and Bison | |
+ users should not rely upon it. Assigning to YYVAL | |
+ unconditionally makes the parser a bit smaller, and it avoids a | |
+ GCC warning that YYVAL may be used uninitialized. */ | |
+ yyval = yyvsp[1-yylen]; | |
+ | |
+ | |
+ YY_REDUCE_PRINT (yyn); | |
+ switch (yyn) | |
+ { | |
+ case 2: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 119 "parse.y" | |
+ { /* add default rule */ | |
+ int def_rule; | |
+ | |
+ pat = cclinit(); | |
+ cclnegate( pat ); | |
+ | |
+ def_rule = mkstate( -pat ); | |
+ | |
+ /* Remember the number of the default rule so we | |
+ * don't generate "can't match" warnings for it. | |
+ */ | |
+ default_rule = num_rules; | |
+ | |
+ finish_rule( def_rule, false, 0, 0, 0); | |
+ | |
+ for ( i = 1; i <= lastsc; ++i ) | |
+ scset[i] = mkbranch( scset[i], def_rule ); | |
+ | |
+ if ( spprdflt ) | |
+ add_action( | |
+ "YY_FATAL_ERROR( \"flex scanner jammed\" )" ); | |
+ else | |
+ add_action( "ECHO" ); | |
+ | |
+ add_action( ";\n\tYY_BREAK\n" ); | |
+ } | |
+ break; | |
+ | |
+ case 3: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 148 "parse.y" | |
+ { /* initialize for processing rules */ | |
+ | |
+ /* Create default DFA start condition. */ | |
+ scinstal( "INITIAL", false ); | |
+ } | |
+ break; | |
+ | |
+ case 7: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 159 "parse.y" | |
+ { synerr( _("unknown error processing section 1") ); } | |
+ break; | |
+ | |
+ case 8: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 163 "parse.y" | |
+ { | |
+ check_options(); | |
+ scon_stk = allocate_integer_array( lastsc + 1 ); | |
+ scon_stk_ptr = 0; | |
+ } | |
+ break; | |
+ | |
+ case 9: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 171 "parse.y" | |
+ { xcluflg = false; } | |
+ break; | |
+ | |
+ case 10: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 174 "parse.y" | |
+ { xcluflg = true; } | |
+ break; | |
+ | |
+ case 11: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 178 "parse.y" | |
+ { scinstal( nmstr, xcluflg ); } | |
+ break; | |
+ | |
+ case 12: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 181 "parse.y" | |
+ { scinstal( nmstr, xcluflg ); } | |
+ break; | |
+ | |
+ case 13: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 184 "parse.y" | |
+ { synerr( _("bad start condition list") ); } | |
+ break; | |
+ | |
+ case 17: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 195 "parse.y" | |
+ { | |
+ outfilename = copy_string( nmstr ); | |
+ did_outfilename = 1; | |
+ } | |
+ break; | |
+ | |
+ case 18: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 200 "parse.y" | |
+ { extra_type = copy_string( nmstr ); } | |
+ break; | |
+ | |
+ case 19: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 202 "parse.y" | |
+ { prefix = copy_string( nmstr ); } | |
+ break; | |
+ | |
+ case 20: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 204 "parse.y" | |
+ { yyclass = copy_string( nmstr ); } | |
+ break; | |
+ | |
+ case 21: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 206 "parse.y" | |
+ { headerfilename = copy_string( nmstr ); } | |
+ break; | |
+ | |
+ case 22: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 208 "parse.y" | |
+ { tablesext = true; tablesfilename = copy_string( nmstr ); } | |
+ break; | |
+ | |
+ case 23: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 212 "parse.y" | |
+ { scon_stk_ptr = (yyvsp[(2) - (5)]); } | |
+ break; | |
+ | |
+ case 24: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 214 "parse.y" | |
+ { scon_stk_ptr = (yyvsp[(2) - (5)]); } | |
+ break; | |
+ | |
+ case 26: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 219 "parse.y" | |
+ { | |
+ /* Initialize for a parse of one rule. */ | |
+ trlcontxt = variable_trail_rule = varlength = false; | |
+ trailcnt = headcnt = rulelen = 0; | |
+ current_state_type = STATE_NORMAL; | |
+ previous_continued_action = continued_action; | |
+ in_rule = true; | |
+ | |
+ new_rule(); | |
+ } | |
+ break; | |
+ | |
+ case 27: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 232 "parse.y" | |
+ { | |
+ pat = (yyvsp[(2) - (2)]); | |
+ finish_rule( pat, variable_trail_rule, | |
+ headcnt, trailcnt , previous_continued_action); | |
+ | |
+ if ( scon_stk_ptr > 0 ) | |
+ { | |
+ for ( i = 1; i <= scon_stk_ptr; ++i ) | |
+ scbol[scon_stk[i]] = | |
+ mkbranch( scbol[scon_stk[i]], | |
+ pat ); | |
+ } | |
+ | |
+ else | |
+ { | |
+ /* Add to all non-exclusive start conditions, | |
+ * including the default (0) start condition. | |
+ */ | |
+ | |
+ for ( i = 1; i <= lastsc; ++i ) | |
+ if ( ! scxclu[i] ) | |
+ scbol[i] = mkbranch( scbol[i], | |
+ pat ); | |
+ } | |
+ | |
+ if ( ! bol_needed ) | |
+ { | |
+ bol_needed = true; | |
+ | |
+ if ( performance_report > 1 ) | |
+ pinpoint_message( | |
+ "'^' operator results in sub-optimal performance" ); | |
+ } | |
+ } | |
+ break; | |
+ | |
+ case 28: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 268 "parse.y" | |
+ { | |
+ pat = (yyvsp[(1) - (1)]); | |
+ finish_rule( pat, variable_trail_rule, | |
+ headcnt, trailcnt , previous_continued_action); | |
+ | |
+ if ( scon_stk_ptr > 0 ) | |
+ { | |
+ for ( i = 1; i <= scon_stk_ptr; ++i ) | |
+ scset[scon_stk[i]] = | |
+ mkbranch( scset[scon_stk[i]], | |
+ pat ); | |
+ } | |
+ | |
+ else | |
+ { | |
+ for ( i = 1; i <= lastsc; ++i ) | |
+ if ( ! scxclu[i] ) | |
+ scset[i] = | |
+ mkbranch( scset[i], | |
+ pat ); | |
+ } | |
+ } | |
+ break; | |
+ | |
+ case 29: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 292 "parse.y" | |
+ { | |
+ if ( scon_stk_ptr > 0 ) | |
+ build_eof_action(); | |
+ | |
+ else | |
+ { | |
+ /* This EOF applies to all start conditions | |
+ * which don't already have EOF actions. | |
+ */ | |
+ for ( i = 1; i <= lastsc; ++i ) | |
+ if ( ! sceof[i] ) | |
+ scon_stk[++scon_stk_ptr] = i; | |
+ | |
+ if ( scon_stk_ptr == 0 ) | |
+ warn( | |
+ "all start conditions already have <<EOF>> rules" ); | |
+ | |
+ else | |
+ build_eof_action(); | |
+ } | |
+ } | |
+ break; | |
+ | |
+ case 30: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 315 "parse.y" | |
+ { synerr( _("unrecognized rule") ); } | |
+ break; | |
+ | |
+ case 31: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 319 "parse.y" | |
+ { (yyval) = scon_stk_ptr; } | |
+ break; | |
+ | |
+ case 32: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 323 "parse.y" | |
+ { (yyval) = (yyvsp[(2) - (4)]); } | |
+ break; | |
+ | |
+ case 33: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 326 "parse.y" | |
+ { | |
+ (yyval) = scon_stk_ptr; | |
+ | |
+ for ( i = 1; i <= lastsc; ++i ) | |
+ { | |
+ int j; | |
+ | |
+ for ( j = 1; j <= scon_stk_ptr; ++j ) | |
+ if ( scon_stk[j] == i ) | |
+ break; | |
+ | |
+ if ( j > scon_stk_ptr ) | |
+ scon_stk[++scon_stk_ptr] = i; | |
+ } | |
+ } | |
+ break; | |
+ | |
+ case 34: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 343 "parse.y" | |
+ { (yyval) = scon_stk_ptr; } | |
+ break; | |
+ | |
+ case 37: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 351 "parse.y" | |
+ { synerr( _("bad start condition list") ); } | |
+ break; | |
+ | |
+ case 38: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 355 "parse.y" | |
+ { | |
+ if ( (scnum = sclookup( nmstr )) == 0 ) | |
+ format_pinpoint_message( | |
+ "undeclared start condition %s", | |
+ nmstr ); | |
+ else | |
+ { | |
+ for ( i = 1; i <= scon_stk_ptr; ++i ) | |
+ if ( scon_stk[i] == scnum ) | |
+ { | |
+ format_warn( | |
+ "<%s> specified twice", | |
+ scname[scnum] ); | |
+ break; | |
+ } | |
+ | |
+ if ( i > scon_stk_ptr ) | |
+ scon_stk[++scon_stk_ptr] = scnum; | |
+ } | |
+ } | |
+ break; | |
+ | |
+ case 39: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 378 "parse.y" | |
+ { | |
+ if ( transchar[lastst[(yyvsp[(2) - (2)])]] != SYM_EPSILON ) | |
+ /* Provide final transition \now/ so it | |
+ * will be marked as a trailing context | |
+ * state. | |
+ */ | |
+ (yyvsp[(2) - (2)]) = link_machines( (yyvsp[(2) - (2)]), | |
+ mkstate( SYM_EPSILON ) ); | |
+ | |
+ mark_beginning_as_normal( (yyvsp[(2) - (2)]) ); | |
+ current_state_type = STATE_NORMAL; | |
+ | |
+ if ( previous_continued_action ) | |
+ { | |
+ /* We need to treat this as variable trailing | |
+ * context so that the backup does not happen | |
+ * in the action but before the action switch | |
+ * statement. If the backup happens in the | |
+ * action, then the rules "falling into" this | |
+ * one's action will *also* do the backup, | |
+ * erroneously. | |
+ */ | |
+ if ( ! varlength || headcnt != 0 ) | |
+ warn( | |
+ "trailing context made variable due to preceding '|' action" ); | |
+ | |
+ /* Mark as variable. */ | |
+ varlength = true; | |
+ headcnt = 0; | |
+ | |
+ } | |
+ | |
+ if ( lex_compat || (varlength && headcnt == 0) ) | |
+ { /* variable trailing context rule */ | |
+ /* Mark the first part of the rule as the | |
+ * accepting "head" part of a trailing | |
+ * context rule. | |
+ * | |
+ * By the way, we didn't do this at the | |
+ * beginning of this production because back | |
+ * then current_state_type was set up for a | |
+ * trail rule, and add_accept() can create | |
+ * a new state ... | |
+ */ | |
+ add_accept( (yyvsp[(1) - (2)]), | |
+ num_rules | YY_TRAILING_HEAD_MASK ); | |
+ variable_trail_rule = true; | |
+ } | |
+ | |
+ else | |
+ trailcnt = rulelen; | |
+ | |
+ (yyval) = link_machines( (yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]) ); | |
+ } | |
+ break; | |
+ | |
+ case 40: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 434 "parse.y" | |
+ { synerr( _("trailing context used twice") ); } | |
+ break; | |
+ | |
+ case 41: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 437 "parse.y" | |
+ { | |
+ headcnt = 0; | |
+ trailcnt = 1; | |
+ rulelen = 1; | |
+ varlength = false; | |
+ | |
+ current_state_type = STATE_TRAILING_CONTEXT; | |
+ | |
+ if ( trlcontxt ) | |
+ { | |
+ synerr( _("trailing context used twice") ); | |
+ (yyval) = mkstate( SYM_EPSILON ); | |
+ } | |
+ | |
+ else if ( previous_continued_action ) | |
+ { | |
+ /* See the comment in the rule for "re2 re" | |
+ * above. | |
+ */ | |
+ warn( | |
+ "trailing context made variable due to preceding '|' action" ); | |
+ | |
+ varlength = true; | |
+ } | |
+ | |
+ if ( lex_compat || varlength ) | |
+ { | |
+ /* Again, see the comment in the rule for | |
+ * "re2 re" above. | |
+ */ | |
+ add_accept( (yyvsp[(1) - (2)]), | |
+ num_rules | YY_TRAILING_HEAD_MASK ); | |
+ variable_trail_rule = true; | |
+ } | |
+ | |
+ trlcontxt = true; | |
+ | |
+ eps = mkstate( SYM_EPSILON ); | |
+ (yyval) = link_machines( (yyvsp[(1) - (2)]), | |
+ link_machines( eps, mkstate( '\n' ) ) ); | |
+ } | |
+ break; | |
+ | |
+ case 42: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 480 "parse.y" | |
+ { | |
+ (yyval) = (yyvsp[(1) - (1)]); | |
+ | |
+ if ( trlcontxt ) | |
+ { | |
+ if ( lex_compat || (varlength && headcnt == 0) ) | |
+ /* Both head and trail are | |
+ * variable-length. | |
+ */ | |
+ variable_trail_rule = true; | |
+ else | |
+ trailcnt = rulelen; | |
+ } | |
+ } | |
+ break; | |
+ | |
+ case 43: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 498 "parse.y" | |
+ { | |
+ varlength = true; | |
+ (yyval) = mkor( (yyvsp[(1) - (3)]), (yyvsp[(3) - (3)]) ); | |
+ } | |
+ break; | |
+ | |
+ case 44: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 504 "parse.y" | |
+ { (yyval) = (yyvsp[(1) - (1)]); } | |
+ break; | |
+ | |
+ case 45: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 509 "parse.y" | |
+ { | |
+ /* This rule is written separately so the | |
+ * reduction will occur before the trailing | |
+ * series is parsed. | |
+ */ | |
+ | |
+ if ( trlcontxt ) | |
+ synerr( _("trailing context used twice") ); | |
+ else | |
+ trlcontxt = true; | |
+ | |
+ if ( varlength ) | |
+ /* We hope the trailing context is | |
+ * fixed-length. | |
+ */ | |
+ varlength = false; | |
+ else | |
+ headcnt = rulelen; | |
+ | |
+ rulelen = 0; | |
+ | |
+ current_state_type = STATE_TRAILING_CONTEXT; | |
+ (yyval) = (yyvsp[(1) - (2)]); | |
+ } | |
+ break; | |
+ | |
+ case 46: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 536 "parse.y" | |
+ { | |
+ /* This is where concatenation of adjacent patterns | |
+ * gets done. | |
+ */ | |
+ (yyval) = link_machines( (yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]) ); | |
+ } | |
+ break; | |
+ | |
+ case 47: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 544 "parse.y" | |
+ { (yyval) = (yyvsp[(1) - (1)]); } | |
+ break; | |
+ | |
+ case 48: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 547 "parse.y" | |
+ { | |
+ varlength = true; | |
+ | |
+ if ( (yyvsp[(3) - (6)]) > (yyvsp[(5) - (6)]) || (yyvsp[(3) - (6)]) < 0 ) | |
+ { | |
+ synerr( _("bad iteration values") ); | |
+ (yyval) = (yyvsp[(1) - (6)]); | |
+ } | |
+ else | |
+ { | |
+ if ( (yyvsp[(3) - (6)]) == 0 ) | |
+ { | |
+ if ( (yyvsp[(5) - (6)]) <= 0 ) | |
+ { | |
+ synerr( | |
+ _("bad iteration values") ); | |
+ (yyval) = (yyvsp[(1) - (6)]); | |
+ } | |
+ else | |
+ (yyval) = mkopt( | |
+ mkrep( (yyvsp[(1) - (6)]), 1, (yyvsp[(5) - (6)]) ) ); | |
+ } | |
+ else | |
+ (yyval) = mkrep( (yyvsp[(1) - (6)]), (yyvsp[(3) - (6)]), (yyvsp[(5) - (6)]) ); | |
+ } | |
+ } | |
+ break; | |
+ | |
+ case 49: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 575 "parse.y" | |
+ { | |
+ varlength = true; | |
+ | |
+ if ( (yyvsp[(3) - (5)]) <= 0 ) | |
+ { | |
+ synerr( _("iteration value must be positive") ); | |
+ (yyval) = (yyvsp[(1) - (5)]); | |
+ } | |
+ | |
+ else | |
+ (yyval) = mkrep( (yyvsp[(1) - (5)]), (yyvsp[(3) - (5)]), INFINITE_REPEAT ); | |
+ } | |
+ break; | |
+ | |
+ case 50: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 589 "parse.y" | |
+ { | |
+ /* The series could be something like "(foo)", | |
+ * in which case we have no idea what its length | |
+ * is, so we punt here. | |
+ */ | |
+ varlength = true; | |
+ | |
+ if ( (yyvsp[(3) - (4)]) <= 0 ) | |
+ { | |
+ synerr( _("iteration value must be positive") | |
+ ); | |
+ (yyval) = (yyvsp[(1) - (4)]); | |
+ } | |
+ | |
+ else | |
+ (yyval) = link_machines( (yyvsp[(1) - (4)]), | |
+ copysingl( (yyvsp[(1) - (4)]), (yyvsp[(3) - (4)]) - 1 ) ); | |
+ } | |
+ break; | |
+ | |
+ case 51: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 611 "parse.y" | |
+ { | |
+ varlength = true; | |
+ | |
+ (yyval) = mkclos( (yyvsp[(1) - (2)]) ); | |
+ } | |
+ break; | |
+ | |
+ case 52: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 618 "parse.y" | |
+ { | |
+ varlength = true; | |
+ (yyval) = mkposcl( (yyvsp[(1) - (2)]) ); | |
+ } | |
+ break; | |
+ | |
+ case 53: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 624 "parse.y" | |
+ { | |
+ varlength = true; | |
+ (yyval) = mkopt( (yyvsp[(1) - (2)]) ); | |
+ } | |
+ break; | |
+ | |
+ case 54: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 630 "parse.y" | |
+ { | |
+ varlength = true; | |
+ | |
+ if ( (yyvsp[(3) - (6)]) > (yyvsp[(5) - (6)]) || (yyvsp[(3) - (6)]) < 0 ) | |
+ { | |
+ synerr( _("bad iteration values") ); | |
+ (yyval) = (yyvsp[(1) - (6)]); | |
+ } | |
+ else | |
+ { | |
+ if ( (yyvsp[(3) - (6)]) == 0 ) | |
+ { | |
+ if ( (yyvsp[(5) - (6)]) <= 0 ) | |
+ { | |
+ synerr( | |
+ _("bad iteration values") ); | |
+ (yyval) = (yyvsp[(1) - (6)]); | |
+ } | |
+ else | |
+ (yyval) = mkopt( | |
+ mkrep( (yyvsp[(1) - (6)]), 1, (yyvsp[(5) - (6)]) ) ); | |
+ } | |
+ else | |
+ (yyval) = mkrep( (yyvsp[(1) - (6)]), (yyvsp[(3) - (6)]), (yyvsp[(5) - (6)]) ); | |
+ } | |
+ } | |
+ break; | |
+ | |
+ case 55: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 658 "parse.y" | |
+ { | |
+ varlength = true; | |
+ | |
+ if ( (yyvsp[(3) - (5)]) <= 0 ) | |
+ { | |
+ synerr( _("iteration value must be positive") ); | |
+ (yyval) = (yyvsp[(1) - (5)]); | |
+ } | |
+ | |
+ else | |
+ (yyval) = mkrep( (yyvsp[(1) - (5)]), (yyvsp[(3) - (5)]), INFINITE_REPEAT ); | |
+ } | |
+ break; | |
+ | |
+ case 56: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 672 "parse.y" | |
+ { | |
+ /* The singleton could be something like "(foo)", | |
+ * in which case we have no idea what its length | |
+ * is, so we punt here. | |
+ */ | |
+ varlength = true; | |
+ | |
+ if ( (yyvsp[(3) - (4)]) <= 0 ) | |
+ { | |
+ synerr( _("iteration value must be positive") ); | |
+ (yyval) = (yyvsp[(1) - (4)]); | |
+ } | |
+ | |
+ else | |
+ (yyval) = link_machines( (yyvsp[(1) - (4)]), | |
+ copysingl( (yyvsp[(1) - (4)]), (yyvsp[(3) - (4)]) - 1 ) ); | |
+ } | |
+ break; | |
+ | |
+ case 57: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 691 "parse.y" | |
+ { | |
+ if ( ! madeany ) | |
+ { | |
+ /* Create the '.' character class. */ | |
+ ccldot = cclinit(); | |
+ ccladd( ccldot, '\n' ); | |
+ cclnegate( ccldot ); | |
+ | |
+ if ( useecs ) | |
+ mkeccl( ccltbl + cclmap[ccldot], | |
+ ccllen[ccldot], nextecm, | |
+ ecgroup, csize, csize ); | |
+ | |
+ /* Create the (?s:'.') character class. */ | |
+ cclany = cclinit(); | |
+ cclnegate( cclany ); | |
+ | |
+ if ( useecs ) | |
+ mkeccl( ccltbl + cclmap[cclany], | |
+ ccllen[cclany], nextecm, | |
+ ecgroup, csize, csize ); | |
+ | |
+ madeany = true; | |
+ } | |
+ | |
+ ++rulelen; | |
+ | |
+ if (sf_dot_all()) | |
+ (yyval) = mkstate( -cclany ); | |
+ else | |
+ (yyval) = mkstate( -ccldot ); | |
+ } | |
+ break; | |
+ | |
+ case 58: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 725 "parse.y" | |
+ { | |
+ /* Sort characters for fast searching. | |
+ */ | |
+ qsort( ccltbl + cclmap[(yyvsp[(1) - (1)])], ccllen[(yyvsp[(1) - (1)])], sizeof (*ccltbl), cclcmp ); | |
+ | |
+ if ( useecs ) | |
+ mkeccl( ccltbl + cclmap[(yyvsp[(1) - (1)])], ccllen[(yyvsp[(1) - (1)])], | |
+ nextecm, ecgroup, csize, csize ); | |
+ | |
+ ++rulelen; | |
+ | |
+ if (ccl_has_nl[(yyvsp[(1) - (1)])]) | |
+ rule_has_nl[num_rules] = true; | |
+ | |
+ (yyval) = mkstate( -(yyvsp[(1) - (1)]) ); | |
+ } | |
+ break; | |
+ | |
+ case 59: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 743 "parse.y" | |
+ { | |
+ ++rulelen; | |
+ | |
+ if (ccl_has_nl[(yyvsp[(1) - (1)])]) | |
+ rule_has_nl[num_rules] = true; | |
+ | |
+ (yyval) = mkstate( -(yyvsp[(1) - (1)]) ); | |
+ } | |
+ break; | |
+ | |
+ case 60: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 753 "parse.y" | |
+ { (yyval) = (yyvsp[(2) - (3)]); } | |
+ break; | |
+ | |
+ case 61: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 756 "parse.y" | |
+ { (yyval) = (yyvsp[(2) - (3)]); } | |
+ break; | |
+ | |
+ case 62: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 759 "parse.y" | |
+ { | |
+ ++rulelen; | |
+ | |
+ if ((yyvsp[(1) - (1)]) == nlch) | |
+ rule_has_nl[num_rules] = true; | |
+ | |
+ if (sf_case_ins() && has_case((yyvsp[(1) - (1)]))) | |
+ /* create an alternation, as in (a|A) */ | |
+ (yyval) = mkor (mkstate((yyvsp[(1) - (1)])), mkstate(reverse_case((yyvsp[(1) - (1)])))); | |
+ else | |
+ (yyval) = mkstate( (yyvsp[(1) - (1)]) ); | |
+ } | |
+ break; | |
+ | |
+ case 63: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 773 "parse.y" | |
+ { (yyval) = ccl_set_diff ((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); } | |
+ break; | |
+ | |
+ case 64: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 774 "parse.y" | |
+ { (yyval) = ccl_set_union ((yyvsp[(1) - (3)]), (yyvsp[(3) - (3)])); } | |
+ break; | |
+ | |
+ case 66: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 780 "parse.y" | |
+ { (yyval) = (yyvsp[(2) - (3)]); } | |
+ break; | |
+ | |
+ case 67: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 783 "parse.y" | |
+ { | |
+ cclnegate( (yyvsp[(3) - (4)]) ); | |
+ (yyval) = (yyvsp[(3) - (4)]); | |
+ } | |
+ break; | |
+ | |
+ case 68: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 790 "parse.y" | |
+ { | |
+ | |
+ if (sf_case_ins()) | |
+ { | |
+ | |
+ /* If one end of the range has case and the other | |
+ * does not, or the cases are different, then we're not | |
+ * sure what range the user is trying to express. | |
+ * Examples: [@-z] or [S-t] | |
+ */ | |
+ if (has_case ((yyvsp[(2) - (4)])) != has_case ((yyvsp[(4) - (4)])) | |
+ || (has_case ((yyvsp[(2) - (4)])) && (b_islower ((yyvsp[(2) - (4)])) != b_islower ((yyvsp[(4) - (4)])))) | |
+ || (has_case ((yyvsp[(2) - (4)])) && (b_isupper ((yyvsp[(2) - (4)])) != b_isupper ((yyvsp[(4) - (4)]))))) | |
+ format_warn3 ( | |
+ _("the character range [%c-%c] is ambiguous in a case-insensitive scanner"), | |
+ (yyvsp[(2) - (4)]), (yyvsp[(4) - (4)])); | |
+ | |
+ /* If the range spans uppercase characters but not | |
+ * lowercase (or vice-versa), then should we automatically | |
+ * include lowercase characters in the range? | |
+ * Example: [@-_] spans [a-z] but not [A-Z] | |
+ */ | |
+ else if (!has_case ((yyvsp[(2) - (4)])) && !has_case ((yyvsp[(4) - (4)])) && !range_covers_case ((yyvsp[(2) - (4)]), (yyvsp[(4) - (4)]))) | |
+ format_warn3 ( | |
+ _("the character range [%c-%c] is ambiguous in a case-insensitive scanner"), | |
+ (yyvsp[(2) - (4)]), (yyvsp[(4) - (4)])); | |
+ } | |
+ | |
+ if ( (yyvsp[(2) - (4)]) > (yyvsp[(4) - (4)]) ) | |
+ synerr( _("negative range in character class") ); | |
+ | |
+ else | |
+ { | |
+ for ( i = (yyvsp[(2) - (4)]); i <= (yyvsp[(4) - (4)]); ++i ) | |
+ ccladd( (yyvsp[(1) - (4)]), i ); | |
+ | |
+ /* Keep track if this ccl is staying in | |
+ * alphabetical order. | |
+ */ | |
+ cclsorted = cclsorted && ((yyvsp[(2) - (4)]) > lastchar); | |
+ lastchar = (yyvsp[(4) - (4)]); | |
+ | |
+ /* Do it again for upper/lowercase */ | |
+ if (sf_case_ins() && has_case((yyvsp[(2) - (4)])) && has_case((yyvsp[(4) - (4)]))){ | |
+ (yyvsp[(2) - (4)]) = reverse_case ((yyvsp[(2) - (4)])); | |
+ (yyvsp[(4) - (4)]) = reverse_case ((yyvsp[(4) - (4)])); | |
+ | |
+ for ( i = (yyvsp[(2) - (4)]); i <= (yyvsp[(4) - (4)]); ++i ) | |
+ ccladd( (yyvsp[(1) - (4)]), i ); | |
+ | |
+ cclsorted = cclsorted && ((yyvsp[(2) - (4)]) > lastchar); | |
+ lastchar = (yyvsp[(4) - (4)]); | |
+ } | |
+ | |
+ } | |
+ | |
+ (yyval) = (yyvsp[(1) - (4)]); | |
+ } | |
+ break; | |
+ | |
+ case 69: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 850 "parse.y" | |
+ { | |
+ ccladd( (yyvsp[(1) - (2)]), (yyvsp[(2) - (2)]) ); | |
+ cclsorted = cclsorted && ((yyvsp[(2) - (2)]) > lastchar); | |
+ lastchar = (yyvsp[(2) - (2)]); | |
+ | |
+ /* Do it again for upper/lowercase */ | |
+ if (sf_case_ins() && has_case((yyvsp[(2) - (2)]))){ | |
+ (yyvsp[(2) - (2)]) = reverse_case ((yyvsp[(2) - (2)])); | |
+ ccladd ((yyvsp[(1) - (2)]), (yyvsp[(2) - (2)])); | |
+ | |
+ cclsorted = cclsorted && ((yyvsp[(2) - (2)]) > lastchar); | |
+ lastchar = (yyvsp[(2) - (2)]); | |
+ } | |
+ | |
+ (yyval) = (yyvsp[(1) - (2)]); | |
+ } | |
+ break; | |
+ | |
+ case 70: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 868 "parse.y" | |
+ { | |
+ /* Too hard to properly maintain cclsorted. */ | |
+ cclsorted = false; | |
+ (yyval) = (yyvsp[(1) - (2)]); | |
+ } | |
+ break; | |
+ | |
+ case 71: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 875 "parse.y" | |
+ { | |
+ cclsorted = true; | |
+ lastchar = 0; | |
+ currccl = (yyval) = cclinit(); | |
+ } | |
+ break; | |
+ | |
+ case 72: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 883 "parse.y" | |
+ { CCL_EXPR(isalnum); } | |
+ break; | |
+ | |
+ case 73: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 884 "parse.y" | |
+ { CCL_EXPR(isalpha); } | |
+ break; | |
+ | |
+ case 74: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 885 "parse.y" | |
+ { CCL_EXPR(IS_BLANK); } | |
+ break; | |
+ | |
+ case 75: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 886 "parse.y" | |
+ { CCL_EXPR(iscntrl); } | |
+ break; | |
+ | |
+ case 76: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 887 "parse.y" | |
+ { CCL_EXPR(isdigit); } | |
+ break; | |
+ | |
+ case 77: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 888 "parse.y" | |
+ { CCL_EXPR(isgraph); } | |
+ break; | |
+ | |
+ case 78: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 889 "parse.y" | |
+ { | |
+ CCL_EXPR(islower); | |
+ if (sf_case_ins()) | |
+ CCL_EXPR(isupper); | |
+ } | |
+ break; | |
+ | |
+ case 79: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 894 "parse.y" | |
+ { CCL_EXPR(isprint); } | |
+ break; | |
+ | |
+ case 80: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 895 "parse.y" | |
+ { CCL_EXPR(ispunct); } | |
+ break; | |
+ | |
+ case 81: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 896 "parse.y" | |
+ { CCL_EXPR(isspace); } | |
+ break; | |
+ | |
+ case 82: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 897 "parse.y" | |
+ { CCL_EXPR(isxdigit); } | |
+ break; | |
+ | |
+ case 83: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 898 "parse.y" | |
+ { | |
+ CCL_EXPR(isupper); | |
+ if (sf_case_ins()) | |
+ CCL_EXPR(islower); | |
+ } | |
+ break; | |
+ | |
+ case 84: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 904 "parse.y" | |
+ { CCL_NEG_EXPR(isalnum); } | |
+ break; | |
+ | |
+ case 85: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 905 "parse.y" | |
+ { CCL_NEG_EXPR(isalpha); } | |
+ break; | |
+ | |
+ case 86: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 906 "parse.y" | |
+ { CCL_NEG_EXPR(IS_BLANK); } | |
+ break; | |
+ | |
+ case 87: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 907 "parse.y" | |
+ { CCL_NEG_EXPR(iscntrl); } | |
+ break; | |
+ | |
+ case 88: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 908 "parse.y" | |
+ { CCL_NEG_EXPR(isdigit); } | |
+ break; | |
+ | |
+ case 89: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 909 "parse.y" | |
+ { CCL_NEG_EXPR(isgraph); } | |
+ break; | |
+ | |
+ case 90: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 910 "parse.y" | |
+ { CCL_NEG_EXPR(isprint); } | |
+ break; | |
+ | |
+ case 91: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 911 "parse.y" | |
+ { CCL_NEG_EXPR(ispunct); } | |
+ break; | |
+ | |
+ case 92: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 912 "parse.y" | |
+ { CCL_NEG_EXPR(isspace); } | |
+ break; | |
+ | |
+ case 93: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 913 "parse.y" | |
+ { CCL_NEG_EXPR(isxdigit); } | |
+ break; | |
+ | |
+ case 94: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 914 "parse.y" | |
+ { | |
+ if ( sf_case_ins() ) | |
+ warn(_("[:^lower:] is ambiguous in case insensitive scanner")); | |
+ else | |
+ CCL_NEG_EXPR(islower); | |
+ } | |
+ break; | |
+ | |
+ case 95: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 920 "parse.y" | |
+ { | |
+ if ( sf_case_ins() ) | |
+ warn(_("[:^upper:] ambiguous in case insensitive scanner")); | |
+ else | |
+ CCL_NEG_EXPR(isupper); | |
+ } | |
+ break; | |
+ | |
+ case 96: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 929 "parse.y" | |
+ { | |
+ if ( (yyvsp[(2) - (2)]) == nlch ) | |
+ rule_has_nl[num_rules] = true; | |
+ | |
+ ++rulelen; | |
+ | |
+ if (sf_case_ins() && has_case((yyvsp[(2) - (2)]))) | |
+ (yyval) = mkor (mkstate((yyvsp[(2) - (2)])), mkstate(reverse_case((yyvsp[(2) - (2)])))); | |
+ else | |
+ (yyval) = mkstate ((yyvsp[(2) - (2)])); | |
+ | |
+ (yyval) = link_machines( (yyvsp[(1) - (2)]), (yyval)); | |
+ } | |
+ break; | |
+ | |
+ case 97: | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 944 "parse.y" | |
+ { (yyval) = mkstate( SYM_EPSILON ); } | |
+ break; | |
+ | |
+ | |
+ | |
+/* Line 1806 of yacc.c */ | |
+#line 2847 "parse.c" | |
+ default: break; | |
+ } | |
+ /* User semantic actions sometimes alter yychar, and that requires | |
+ that yytoken be updated with the new translation. We take the | |
+ approach of translating immediately before every use of yytoken. | |
+ One alternative is translating here after every semantic action, | |
+ but that translation would be missed if the semantic action invokes | |
+ YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or | |
+ if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an | |
+ incorrect destructor might then be invoked immediately. In the | |
+ case of YYERROR or YYBACKUP, subsequent parser actions might lead | |
+ to an incorrect destructor call or verbose syntax error message | |
+ before the lookahead is translated. */ | |
+ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); | |
+ | |
+ YYPOPSTACK (yylen); | |
+ yylen = 0; | |
+ YY_STACK_PRINT (yyss, yyssp); | |
+ | |
+ *++yyvsp = yyval; | |
+ | |
+ /* Now `shift' the result of the reduction. Determine what state | |
+ that goes to, based on the state we popped back to and the rule | |
+ number reduced by. */ | |
+ | |
+ yyn = yyr1[yyn]; | |
+ | |
+ yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; | |
+ if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) | |
+ yystate = yytable[yystate]; | |
+ else | |
+ yystate = yydefgoto[yyn - YYNTOKENS]; | |
+ | |
+ goto yynewstate; | |
+ | |
+ | |
+/*------------------------------------. | |
+| yyerrlab -- here on detecting error | | |
+`------------------------------------*/ | |
+yyerrlab: | |
+ /* Make sure we have latest lookahead translation. See comments at | |
+ user semantic actions for why this is necessary. */ | |
+ yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); | |
+ | |
+ /* If not already recovering from an error, report this error. */ | |
+ if (!yyerrstatus) | |
+ { | |
+ ++yynerrs; | |
+#if ! YYERROR_VERBOSE | |
+ yyerror (YY_("syntax error")); | |
+#else | |
+# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ | |
+ yyssp, yytoken) | |
+ { | |
+ char const *yymsgp = YY_("syntax error"); | |
+ int yysyntax_error_status; | |
+ yysyntax_error_status = YYSYNTAX_ERROR; | |
+ if (yysyntax_error_status == 0) | |
+ yymsgp = yymsg; | |
+ else if (yysyntax_error_status == 1) | |
+ { | |
+ if (yymsg != yymsgbuf) | |
+ YYSTACK_FREE (yymsg); | |
+ yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); | |
+ if (!yymsg) | |
+ { | |
+ yymsg = yymsgbuf; | |
+ yymsg_alloc = sizeof yymsgbuf; | |
+ yysyntax_error_status = 2; | |
+ } | |
+ else | |
+ { | |
+ yysyntax_error_status = YYSYNTAX_ERROR; | |
+ yymsgp = yymsg; | |
+ } | |
+ } | |
+ yyerror (yymsgp); | |
+ if (yysyntax_error_status == 2) | |
+ goto yyexhaustedlab; | |
+ } | |
+# undef YYSYNTAX_ERROR | |
+#endif | |
+ } | |
+ | |
+ | |
+ | |
+ if (yyerrstatus == 3) | |
+ { | |
+ /* If just tried and failed to reuse lookahead token after an | |
+ error, discard it. */ | |
+ | |
+ if (yychar <= YYEOF) | |
+ { | |
+ /* Return failure if at end of input. */ | |
+ if (yychar == YYEOF) | |
+ YYABORT; | |
+ } | |
+ else | |
+ { | |
+ yydestruct ("Error: discarding", | |
+ yytoken, &yylval); | |
+ yychar = YYEMPTY; | |
+ } | |
+ } | |
+ | |
+ /* Else will try to reuse lookahead token after shifting the error | |
+ token. */ | |
+ goto yyerrlab1; | |
+ | |
+ | |
+/*---------------------------------------------------. | |
+| yyerrorlab -- error raised explicitly by YYERROR. | | |
+`---------------------------------------------------*/ | |
+yyerrorlab: | |
+ | |
+ /* Pacify compilers like GCC when the user code never invokes | |
+ YYERROR and the label yyerrorlab therefore never appears in user | |
+ code. */ | |
+ if (/*CONSTCOND*/ 0) | |
+ goto yyerrorlab; | |
+ | |
+ /* Do not reclaim the symbols of the rule which action triggered | |
+ this YYERROR. */ | |
+ YYPOPSTACK (yylen); | |
+ yylen = 0; | |
+ YY_STACK_PRINT (yyss, yyssp); | |
+ yystate = *yyssp; | |
+ goto yyerrlab1; | |
+ | |
+ | |
+/*-------------------------------------------------------------. | |
+| yyerrlab1 -- common code for both syntax error and YYERROR. | | |
+`-------------------------------------------------------------*/ | |
+yyerrlab1: | |
+ yyerrstatus = 3; /* Each real token shifted decrements this. */ | |
+ | |
+ for (;;) | |
+ { | |
+ yyn = yypact[yystate]; | |
+ if (!yypact_value_is_default (yyn)) | |
+ { | |
+ yyn += YYTERROR; | |
+ if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) | |
+ { | |
+ yyn = yytable[yyn]; | |
+ if (0 < yyn) | |
+ break; | |
+ } | |
+ } | |
+ | |
+ /* Pop the current state because it cannot handle the error token. */ | |
+ if (yyssp == yyss) | |
+ YYABORT; | |
+ | |
+ | |
+ yydestruct ("Error: popping", | |
+ yystos[yystate], yyvsp); | |
+ YYPOPSTACK (1); | |
+ yystate = *yyssp; | |
+ YY_STACK_PRINT (yyss, yyssp); | |
+ } | |
+ | |
+ *++yyvsp = yylval; | |
+ | |
+ | |
+ /* Shift the error token. */ | |
+ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); | |
+ | |
+ yystate = yyn; | |
+ goto yynewstate; | |
+ | |
+ | |
+/*-------------------------------------. | |
+| yyacceptlab -- YYACCEPT comes here. | | |
+`-------------------------------------*/ | |
+yyacceptlab: | |
+ yyresult = 0; | |
+ goto yyreturn; | |
+ | |
+/*-----------------------------------. | |
+| yyabortlab -- YYABORT comes here. | | |
+`-----------------------------------*/ | |
+yyabortlab: | |
+ yyresult = 1; | |
+ goto yyreturn; | |
+ | |
+#if !defined(yyoverflow) || YYERROR_VERBOSE | |
+/*-------------------------------------------------. | |
+| yyexhaustedlab -- memory exhaustion comes here. | | |
+`-------------------------------------------------*/ | |
+yyexhaustedlab: | |
+ yyerror (YY_("memory exhausted")); | |
+ yyresult = 2; | |
+ /* Fall through. */ | |
+#endif | |
+ | |
+yyreturn: | |
+ if (yychar != YYEMPTY) | |
+ { | |
+ /* Make sure we have latest lookahead translation. See comments at | |
+ user semantic actions for why this is necessary. */ | |
+ yytoken = YYTRANSLATE (yychar); | |
+ yydestruct ("Cleanup: discarding lookahead", | |
+ yytoken, &yylval); | |
+ } | |
+ /* Do not reclaim the symbols of the rule which action triggered | |
+ this YYABORT or YYACCEPT. */ | |
+ YYPOPSTACK (yylen); | |
+ YY_STACK_PRINT (yyss, yyssp); | |
+ while (yyssp != yyss) | |
+ { | |
+ yydestruct ("Cleanup: popping", | |
+ yystos[*yyssp], yyvsp); | |
+ YYPOPSTACK (1); | |
+ } | |
+#ifndef yyoverflow | |
+ if (yyss != yyssa) | |
+ YYSTACK_FREE (yyss); | |
+#endif | |
+#if YYERROR_VERBOSE | |
+ if (yymsg != yymsgbuf) | |
+ YYSTACK_FREE (yymsg); | |
+#endif | |
+ /* Make sure YYID is used. */ | |
+ return YYID (yyresult); | |
+} | |
+ | |
+ | |
+ | |
+/* Line 2067 of yacc.c */ | |
+#line 947 "parse.y" | |
+ | |
+ | |
+ | |
+/* build_eof_action - build the "<<EOF>>" action for the active start | |
+ * conditions | |
+ */ | |
+ | |
+void build_eof_action() | |
+ { | |
+ register int i; | |
+ char action_text[MAXLINE]; | |
+ | |
+ for ( i = 1; i <= scon_stk_ptr; ++i ) | |
+ { | |
+ if ( sceof[scon_stk[i]] ) | |
+ format_pinpoint_message( | |
+ "multiple <<EOF>> rules for start condition %s", | |
+ scname[scon_stk[i]] ); | |
+ | |
+ else | |
+ { | |
+ sceof[scon_stk[i]] = true; | |
+ | |
+ if (previous_continued_action /* && previous action was regular */) | |
+ add_action("YY_RULE_SETUP\n"); | |
+ | |
+ snprintf( action_text, sizeof(action_text), "case YY_STATE_EOF(%s):\n", | |
+ scname[scon_stk[i]] ); | |
+ add_action( action_text ); | |
+ } | |
+ } | |
+ | |
+ line_directive_out( (FILE *) 0, 1 ); | |
+ | |
+ /* This isn't a normal rule after all - don't count it as | |
+ * such, so we don't have any holes in the rule numbering | |
+ * (which make generating "rule can never match" warnings | |
+ * more difficult. | |
+ */ | |
+ --num_rules; | |
+ ++num_eof_rules; | |
+ } | |
+ | |
+ | |
+/* format_synerr - write out formatted syntax error */ | |
+ | |
+void format_synerr( msg, arg ) | |
+const char *msg, arg[]; | |
+ { | |
+ char errmsg[MAXLINE]; | |
+ | |
+ (void) snprintf( errmsg, sizeof(errmsg), msg, arg ); | |
+ synerr( errmsg ); | |
+ } | |
+ | |
+ | |
+/* synerr - report a syntax error */ | |
+ | |
+void synerr( str ) | |
+const char *str; | |
+ { | |
+ syntaxerror = true; | |
+ pinpoint_message( str ); | |
+ } | |
+ | |
+ | |
+/* format_warn - write out formatted warning */ | |
+ | |
+void format_warn( msg, arg ) | |
+const char *msg, arg[]; | |
+ { | |
+ char warn_msg[MAXLINE]; | |
+ | |
+ snprintf( warn_msg, sizeof(warn_msg), msg, arg ); | |
+ warn( warn_msg ); | |
+ } | |
+ | |
+ | |
+/* warn - report a warning, unless -w was given */ | |
+ | |
+void warn( str ) | |
+const char *str; | |
+ { | |
+ line_warning( str, linenum ); | |
+ } | |
+ | |
+/* format_pinpoint_message - write out a message formatted with one string, | |
+ * pinpointing its location | |
+ */ | |
+ | |
+void format_pinpoint_message( msg, arg ) | |
+const char *msg, arg[]; | |
+ { | |
+ char errmsg[MAXLINE]; | |
+ | |
+ snprintf( errmsg, sizeof(errmsg), msg, arg ); | |
+ pinpoint_message( errmsg ); | |
+ } | |
+ | |
+ | |
+/* pinpoint_message - write out a message, pinpointing its location */ | |
+ | |
+void pinpoint_message( str ) | |
+const char *str; | |
+ { | |
+ line_pinpoint( str, linenum ); | |
+ } | |
+ | |
+ | |
+/* line_warning - report a warning at a given line, unless -w was given */ | |
+ | |
+void line_warning( str, line ) | |
+const char *str; | |
+int line; | |
+ { | |
+ char warning[MAXLINE]; | |
+ | |
+ if ( ! nowarn ) | |
+ { | |
+ snprintf( warning, sizeof(warning), "warning, %s", str ); | |
+ line_pinpoint( warning, line ); | |
+ } | |
+ } | |
+ | |
+ | |
+/* line_pinpoint - write out a message, pinpointing it at the given line */ | |
+ | |
+void line_pinpoint( str, line ) | |
+const char *str; | |
+int line; | |
+ { | |
+ fprintf( stderr, "%s:%d: %s\n", infilename, line, str ); | |
+ } | |
+ | |
+ | |
+/* yyerror - eat up an error message from the parser; | |
+ * currently, messages are ignore | |
+ */ | |
+ | |
+void yyerror( msg ) | |
+const char *msg; | |
+ { | |
+ } | |
+ | |
diff -Pu flex-2.5.39/initparse.h openbsd-flex/initparse.h | |
--- flex-2.5.39/initparse.h Wed Dec 31 16:00:00 1969 | |
+++ openbsd-flex/initparse.h Mon Nov 2 05:38:51 2015 | |
@@ -0,0 +1,146 @@ | |
+/* A Bison parser, made by GNU Bison 2.5. */ | |
+ | |
+/* Bison interface for Yacc-like parsers in C | |
+ | |
+ Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. | |
+ | |
+ This program is free software: you can redistribute it and/or modify | |
+ it under the terms of the GNU General Public License as published by | |
+ the Free Software Foundation, either version 3 of the License, or | |
+ (at your option) any later version. | |
+ | |
+ This program is distributed in the hope that it will be useful, | |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of | |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
+ GNU General Public License for more details. | |
+ | |
+ You should have received a copy of the GNU General Public License | |
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */ | |
+ | |
+/* As a special exception, you may create a larger work that contains | |
+ part or all of the Bison parser skeleton and distribute that work | |
+ under terms of your choice, so long as that work isn't itself a | |
+ parser generator using the skeleton or a modified version thereof | |
+ as a parser skeleton. Alternatively, if you modify or redistribute | |
+ the parser skeleton itself, you may (at your option) remove this | |
+ special exception, which will cause the skeleton and the resulting | |
+ Bison output files to be licensed under the GNU General Public | |
+ License without this special exception. | |
+ | |
+ This special exception was added by the Free Software Foundation in | |
+ version 2.2 of Bison. */ | |
+ | |
+ | |
+/* Tokens. */ | |
+#ifndef YYTOKENTYPE | |
+# define YYTOKENTYPE | |
+ /* Put the tokens into the symbol table, so that GDB and other debuggers | |
+ know about them. */ | |
+ enum yytokentype { | |
+ CHAR = 258, | |
+ NUMBER = 259, | |
+ SECTEND = 260, | |
+ SCDECL = 261, | |
+ XSCDECL = 262, | |
+ NAME = 263, | |
+ PREVCCL = 264, | |
+ EOF_OP = 265, | |
+ OPTION_OP = 266, | |
+ OPT_OUTFILE = 267, | |
+ OPT_PREFIX = 268, | |
+ OPT_YYCLASS = 269, | |
+ OPT_HEADER = 270, | |
+ OPT_EXTRA_TYPE = 271, | |
+ OPT_TABLES = 272, | |
+ CCE_ALNUM = 273, | |
+ CCE_ALPHA = 274, | |
+ CCE_BLANK = 275, | |
+ CCE_CNTRL = 276, | |
+ CCE_DIGIT = 277, | |
+ CCE_GRAPH = 278, | |
+ CCE_LOWER = 279, | |
+ CCE_PRINT = 280, | |
+ CCE_PUNCT = 281, | |
+ CCE_SPACE = 282, | |
+ CCE_UPPER = 283, | |
+ CCE_XDIGIT = 284, | |
+ CCE_NEG_ALNUM = 285, | |
+ CCE_NEG_ALPHA = 286, | |
+ CCE_NEG_BLANK = 287, | |
+ CCE_NEG_CNTRL = 288, | |
+ CCE_NEG_DIGIT = 289, | |
+ CCE_NEG_GRAPH = 290, | |
+ CCE_NEG_LOWER = 291, | |
+ CCE_NEG_PRINT = 292, | |
+ CCE_NEG_PUNCT = 293, | |
+ CCE_NEG_SPACE = 294, | |
+ CCE_NEG_UPPER = 295, | |
+ CCE_NEG_XDIGIT = 296, | |
+ CCL_OP_UNION = 297, | |
+ CCL_OP_DIFF = 298, | |
+ BEGIN_REPEAT_POSIX = 299, | |
+ END_REPEAT_POSIX = 300, | |
+ BEGIN_REPEAT_FLEX = 301, | |
+ END_REPEAT_FLEX = 302 | |
+ }; | |
+#endif | |
+/* Tokens. */ | |
+#define CHAR 258 | |
+#define NUMBER 259 | |
+#define SECTEND 260 | |
+#define SCDECL 261 | |
+#define XSCDECL 262 | |
+#define NAME 263 | |
+#define PREVCCL 264 | |
+#define EOF_OP 265 | |
+#define OPTION_OP 266 | |
+#define OPT_OUTFILE 267 | |
+#define OPT_PREFIX 268 | |
+#define OPT_YYCLASS 269 | |
+#define OPT_HEADER 270 | |
+#define OPT_EXTRA_TYPE 271 | |
+#define OPT_TABLES 272 | |
+#define CCE_ALNUM 273 | |
+#define CCE_ALPHA 274 | |
+#define CCE_BLANK 275 | |
+#define CCE_CNTRL 276 | |
+#define CCE_DIGIT 277 | |
+#define CCE_GRAPH 278 | |
+#define CCE_LOWER 279 | |
+#define CCE_PRINT 280 | |
+#define CCE_PUNCT 281 | |
+#define CCE_SPACE 282 | |
+#define CCE_UPPER 283 | |
+#define CCE_XDIGIT 284 | |
+#define CCE_NEG_ALNUM 285 | |
+#define CCE_NEG_ALPHA 286 | |
+#define CCE_NEG_BLANK 287 | |
+#define CCE_NEG_CNTRL 288 | |
+#define CCE_NEG_DIGIT 289 | |
+#define CCE_NEG_GRAPH 290 | |
+#define CCE_NEG_LOWER 291 | |
+#define CCE_NEG_PRINT 292 | |
+#define CCE_NEG_PUNCT 293 | |
+#define CCE_NEG_SPACE 294 | |
+#define CCE_NEG_UPPER 295 | |
+#define CCE_NEG_XDIGIT 296 | |
+#define CCL_OP_UNION 297 | |
+#define CCL_OP_DIFF 298 | |
+#define BEGIN_REPEAT_POSIX 299 | |
+#define END_REPEAT_POSIX 300 | |
+#define BEGIN_REPEAT_FLEX 301 | |
+#define END_REPEAT_FLEX 302 | |
+ | |
+ | |
+ | |
+ | |
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED | |
+typedef int YYSTYPE; | |
+# define YYSTYPE_IS_TRIVIAL 1 | |
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */ | |
+# define YYSTYPE_IS_DECLARED 1 | |
+#endif | |
+ | |
+extern YYSTYPE yylval; | |
+ | |
+ | |
diff -Pu flex-2.5.39/initscan.c openbsd-flex/initscan.c | |
--- flex-2.5.39/initscan.c Wed Dec 31 16:00:00 1969 | |
+++ openbsd-flex/initscan.c Mon Nov 2 15:20:04 2015 | |
@@ -0,0 +1,5202 @@ | |
+ | |
+#line 3 "scan.c" | |
+ | |
+#define YY_INT_ALIGNED short int | |
+ | |
+/* A lexical scanner generated by flex */ | |
+ | |
+#define FLEX_SCANNER | |
+#define YY_FLEX_MAJOR_VERSION 2 | |
+#define YY_FLEX_MINOR_VERSION 5 | |
+#define YY_FLEX_SUBMINOR_VERSION 37 | |
+#if YY_FLEX_SUBMINOR_VERSION > 0 | |
+#define FLEX_BETA | |
+#endif | |
+ | |
+/* First, we deal with platform-specific or compiler-specific issues. */ | |
+ | |
+/* begin standard C headers. */ | |
+#include <stdio.h> | |
+#include <string.h> | |
+#include <errno.h> | |
+#include <stdlib.h> | |
+ | |
+/* end standard C headers. */ | |
+ | |
+/* flex integer type definitions */ | |
+ | |
+#ifndef FLEXINT_H | |
+#define FLEXINT_H | |
+ | |
+/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ | |
+ | |
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L | |
+ | |
+/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, | |
+ * if you want the limit (max/min) macros for int types. | |
+ */ | |
+#ifndef __STDC_LIMIT_MACROS | |
+#define __STDC_LIMIT_MACROS 1 | |
+#endif | |
+ | |
+#include <inttypes.h> | |
+typedef int8_t flex_int8_t; | |
+typedef uint8_t flex_uint8_t; | |
+typedef int16_t flex_int16_t; | |
+typedef uint16_t flex_uint16_t; | |
+typedef int32_t flex_int32_t; | |
+typedef uint32_t flex_uint32_t; | |
+#else | |
+typedef signed char flex_int8_t; | |
+typedef short int flex_int16_t; | |
+typedef int flex_int32_t; | |
+typedef unsigned char flex_uint8_t; | |
+typedef unsigned short int flex_uint16_t; | |
+typedef unsigned int flex_uint32_t; | |
+ | |
+/* Limits of integral types. */ | |
+#ifndef INT8_MIN | |
+#define INT8_MIN (-128) | |
+#endif | |
+#ifndef INT16_MIN | |
+#define INT16_MIN (-32767-1) | |
+#endif | |
+#ifndef INT32_MIN | |
+#define INT32_MIN (-2147483647-1) | |
+#endif | |
+#ifndef INT8_MAX | |
+#define INT8_MAX (127) | |
+#endif | |
+#ifndef INT16_MAX | |
+#define INT16_MAX (32767) | |
+#endif | |
+#ifndef INT32_MAX | |
+#define INT32_MAX (2147483647) | |
+#endif | |
+#ifndef UINT8_MAX | |
+#define UINT8_MAX (255U) | |
+#endif | |
+#ifndef UINT16_MAX | |
+#define UINT16_MAX (65535U) | |
+#endif | |
+#ifndef UINT32_MAX | |
+#define UINT32_MAX (4294967295U) | |
+#endif | |
+ | |
+#endif /* ! C99 */ | |
+ | |
+#endif /* ! FLEXINT_H */ | |
+ | |
+#ifdef __cplusplus | |
+ | |
+/* The "const" storage-class-modifier is valid. */ | |
+#define YY_USE_CONST | |
+ | |
+#else /* ! __cplusplus */ | |
+ | |
+/* C99 requires __STDC__ to be defined as 1. */ | |
+#if defined (__STDC__) | |
+ | |
+#define YY_USE_CONST | |
+ | |
+#endif /* defined (__STDC__) */ | |
+#endif /* ! __cplusplus */ | |
+ | |
+#ifdef YY_USE_CONST | |
+#define yyconst const | |
+#else | |
+#define yyconst | |
+#endif | |
+ | |
+/* Returned upon end-of-file. */ | |
+#define YY_NULL 0 | |
+ | |
+/* Promotes a possibly negative, possibly signed char to an unsigned | |
+ * integer for use as an array index. If the signed char is negative, | |
+ * we want to instead treat it as an 8-bit unsigned char, hence the | |
+ * double cast. | |
+ */ | |
+#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) | |
+ | |
+/* Enter a start condition. This macro really ought to take a parameter, | |
+ * but we do it the disgusting crufty way forced on us by the ()-less | |
+ * definition of BEGIN. | |
+ */ | |
+#define BEGIN (yy_start) = 1 + 2 * | |
+ | |
+/* Translate the current start state into a value that can be later handed | |
+ * to BEGIN to return to the state. The YYSTATE alias is for lex | |
+ * compatibility. | |
+ */ | |
+#define YY_START (((yy_start) - 1) / 2) | |
+#define YYSTATE YY_START | |
+ | |
+/* Action number for EOF rule of a given start state. */ | |
+#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) | |
+ | |
+/* Special action meaning "start processing a new file". */ | |
+#define YY_NEW_FILE yyrestart(yyin ) | |
+ | |
+#define YY_END_OF_BUFFER_CHAR 0 | |
+ | |
+/* Size of default input buffer. */ | |
+#ifndef YY_BUF_SIZE | |
+#define YY_BUF_SIZE 16384 | |
+#endif | |
+ | |
+/* The state buf must be large enough to hold one state per character in the main buffer. | |
+ */ | |
+#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) | |
+ | |
+#ifndef YY_TYPEDEF_YY_BUFFER_STATE | |
+#define YY_TYPEDEF_YY_BUFFER_STATE | |
+typedef struct yy_buffer_state *YY_BUFFER_STATE; | |
+#endif | |
+ | |
+#ifndef YY_TYPEDEF_YY_SIZE_T | |
+#define YY_TYPEDEF_YY_SIZE_T | |
+typedef size_t yy_size_t; | |
+#endif | |
+ | |
+extern yy_size_t yyleng; | |
+ | |
+extern FILE *yyin, *yyout; | |
+ | |
+#define EOB_ACT_CONTINUE_SCAN 0 | |
+#define EOB_ACT_END_OF_FILE 1 | |
+#define EOB_ACT_LAST_MATCH 2 | |
+ | |
+ #define YY_LESS_LINENO(n) | |
+ #define YY_LINENO_REWIND_TO(ptr) | |
+ | |
+/* Return all but the first "n" matched characters back to the input stream. */ | |
+#define yyless(n) \ | |
+ do \ | |
+ { \ | |
+ /* Undo effects of setting up yytext. */ \ | |
+ int yyless_macro_arg = (n); \ | |
+ YY_LESS_LINENO(yyless_macro_arg);\ | |
+ *yy_cp = (yy_hold_char); \ | |
+ YY_RESTORE_YY_MORE_OFFSET \ | |
+ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ | |
+ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ | |
+ } \ | |
+ while ( 0 ) | |
+ | |
+#define unput(c) yyunput( c, (yytext_ptr) ) | |
+ | |
+#ifndef YY_STRUCT_YY_BUFFER_STATE | |
+#define YY_STRUCT_YY_BUFFER_STATE | |
+struct yy_buffer_state | |
+ { | |
+ FILE *yy_input_file; | |
+ | |
+ char *yy_ch_buf; /* input buffer */ | |
+ char *yy_buf_pos; /* current position in input buffer */ | |
+ | |
+ /* Size of input buffer in bytes, not including room for EOB | |
+ * characters. | |
+ */ | |
+ yy_size_t yy_buf_size; | |
+ | |
+ /* Number of characters read into yy_ch_buf, not including EOB | |
+ * characters. | |
+ */ | |
+ yy_size_t yy_n_chars; | |
+ | |
+ /* Whether we "own" the buffer - i.e., we know we created it, | |
+ * and can realloc() it to grow it, and should free() it to | |
+ * delete it. | |
+ */ | |
+ int yy_is_our_buffer; | |
+ | |
+ /* Whether this is an "interactive" input source; if so, and | |
+ * if we're using stdio for input, then we want to use getc() | |
+ * instead of fread(), to make sure we stop fetching input after | |
+ * each newline. | |
+ */ | |
+ int yy_is_interactive; | |
+ | |
+ /* Whether we're considered to be at the beginning of a line. | |
+ * If so, '^' rules will be active on the next match, otherwise | |
+ * not. | |
+ */ | |
+ int yy_at_bol; | |
+ | |
+ int yy_bs_lineno; /**< The line count. */ | |
+ int yy_bs_column; /**< The column count. */ | |
+ | |
+ /* Whether to try to fill the input buffer when we reach the | |
+ * end of it. | |
+ */ | |
+ int yy_fill_buffer; | |
+ | |
+ int yy_buffer_status; | |
+ | |
+#define YY_BUFFER_NEW 0 | |
+#define YY_BUFFER_NORMAL 1 | |
+ /* When an EOF's been seen but there's still some text to process | |
+ * then we mark the buffer as YY_EOF_PENDING, to indicate that we | |
+ * shouldn't try reading from the input source any more. We might | |
+ * still have a bunch of tokens to match, though, because of | |
+ * possible backing-up. | |
+ * | |
+ * When we actually see the EOF, we change the status to "new" | |
+ * (via yyrestart()), so that the user can continue scanning by | |
+ * just pointing yyin at a new input file. | |
+ */ | |
+#define YY_BUFFER_EOF_PENDING 2 | |
+ | |
+ }; | |
+#endif /* !YY_STRUCT_YY_BUFFER_STATE */ | |
+ | |
+/* Stack of input buffers. */ | |
+static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ | |
+static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ | |
+static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ | |
+ | |
+/* We provide macros for accessing buffer states in case in the | |
+ * future we want to put the buffer states in a more general | |
+ * "scanner state". | |
+ * | |
+ * Returns the top of the stack, or NULL. | |
+ */ | |
+#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ | |
+ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ | |
+ : NULL) | |
+ | |
+/* Same as previous macro, but useful when we know that the buffer stack is not | |
+ * NULL or when we need an lvalue. For internal use only. | |
+ */ | |
+#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] | |
+ | |
+/* yy_hold_char holds the character lost when yytext is formed. */ | |
+static char yy_hold_char; | |
+static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ | |
+yy_size_t yyleng; | |
+ | |
+/* Points to current character in buffer. */ | |
+static char *yy_c_buf_p = (char *) 0; | |
+static int yy_init = 0; /* whether we need to initialize */ | |
+static int yy_start = 0; /* start state number */ | |
+ | |
+/* Flag which is used to allow yywrap()'s to do buffer switches | |
+ * instead of setting up a fresh yyin. A bit of a hack ... | |
+ */ | |
+static int yy_did_buffer_switch_on_eof; | |
+ | |
+void yyrestart (FILE *input_file ); | |
+void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); | |
+YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); | |
+void yy_delete_buffer (YY_BUFFER_STATE b ); | |
+void yy_flush_buffer (YY_BUFFER_STATE b ); | |
+void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); | |
+void yypop_buffer_state (void ); | |
+ | |
+static void yyensure_buffer_stack (void ); | |
+static void yy_load_buffer_state (void ); | |
+static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); | |
+ | |
+#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) | |
+ | |
+YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); | |
+YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); | |
+YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ); | |
+ | |
+void *yyalloc (yy_size_t ); | |
+void *yyrealloc (void *,yy_size_t ); | |
+void yyfree (void * ); | |
+ | |
+#define yy_new_buffer yy_create_buffer | |
+ | |
+#define yy_set_interactive(is_interactive) \ | |
+ { \ | |
+ if ( ! YY_CURRENT_BUFFER ){ \ | |
+ yyensure_buffer_stack (); \ | |
+ YY_CURRENT_BUFFER_LVALUE = \ | |
+ yy_create_buffer(yyin,YY_BUF_SIZE ); \ | |
+ } \ | |
+ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ | |
+ } | |
+ | |
+#define yy_set_bol(at_bol) \ | |
+ { \ | |
+ if ( ! YY_CURRENT_BUFFER ){\ | |
+ yyensure_buffer_stack (); \ | |
+ YY_CURRENT_BUFFER_LVALUE = \ | |
+ yy_create_buffer(yyin,YY_BUF_SIZE ); \ | |
+ } \ | |
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ | |
+ } | |
+ | |
+#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) | |
+ | |
+/* Begin user sect3 */ | |
+ | |
+typedef unsigned char YY_CHAR; | |
+ | |
+FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; | |
+ | |
+typedef int yy_state_type; | |
+ | |
+extern int yylineno; | |
+ | |
+int yylineno = 1; | |
+ | |
+extern char *yytext; | |
+#define yytext_ptr yytext | |
+ | |
+static yy_state_type yy_get_previous_state (void ); | |
+static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); | |
+static int yy_get_next_buffer (void ); | |
+static void yy_fatal_error (yyconst char msg[] ); | |
+ | |
+/* Done after the current pattern has been matched and before the | |
+ * corresponding action - sets up yytext. | |
+ */ | |
+#define YY_DO_BEFORE_ACTION \ | |
+ (yytext_ptr) = yy_bp; \ | |
+ (yytext_ptr) -= (yy_more_len); \ | |
+ yyleng = (size_t) (yy_cp - (yytext_ptr)); \ | |
+ (yy_hold_char) = *yy_cp; \ | |
+ *yy_cp = '\0'; \ | |
+ (yy_c_buf_p) = yy_cp; | |
+ | |
+#define YY_NUM_RULES 251 | |
+#define YY_END_OF_BUFFER 252 | |
+/* This struct is not used in this scanner, | |
+ but its presence is necessary. */ | |
+struct yy_trans_info | |
+ { | |
+ flex_int32_t yy_verify; | |
+ flex_int32_t yy_nxt; | |
+ }; | |
+static yyconst flex_int16_t yy_acclist[1223] = | |
+ { 0, | |
+ 248, 248, 252, 250, 251, 9, 250, 251, 20, 250, | |
+ 251, 250, 251, 18, 250, 251, 1, 9, 250, 251, | |
+ 19, 20, 250, 251, 250, 251, 250, 251, 250, 251, | |
+ 250, 251, 17, 18, 250, 251, 164, 250, 251, 149, | |
+ 164, 250, 251, 150, 250, 251, 164, 250, 251, 142, | |
+ 164, 250, 251, 164, 250, 251, 161, 163, 164, 250, | |
+ 251, 162, 163, 164, 250, 251, 163, 164, 250, 251, | |
+ 163, 164, 250, 251, 164, 250, 251, 164, 250, 251, | |
+ 164, 250, 251, 163, 164, 250, 251, 148, 149, 164, | |
+ 250, 251, 138, 150, 250, 251, 164, 250, 251, 164, | |
+ | |
+ 250, 251, 140, 164, 250, 251, 141, 164, 250, 251, | |
+ 136, 250, 251, 137, 250, 251, 136, 250, 251, 135, | |
+ 136, 250, 251, 134, 136, 250, 251, 135, 136, 250, | |
+ 251, 248, 249, 250, 251, 248, 249, 250, 251, 249, | |
+ 250, 251, 249, 250, 251, 41, 250, 251, 42, 250, | |
+ 251, 41, 250, 251, 41, 250, 251, 41, 250, 251, | |
+ 41, 250, 251, 41, 250, 251, 41, 250, 251, 50, | |
+ 250, 251, 49, 250, 251, 51, 250, 251, 250, 251, | |
+ 170, 250, 251, 170, 250, 251, 165, 250, 251, 170, | |
+ 250, 251, 166, 170, 250, 251, 167, 170, 250, 251, | |
+ | |
+ 169, 170, 250, 251, 171, 250, 251, 219, 250, 251, | |
+ 220, 250, 251, 219, 250, 251, 217, 219, 250, 251, | |
+ 216, 219, 250, 251, 218, 219, 250, 251, 172, 250, | |
+ 251, 174, 250, 251, 172, 250, 251, 173, 250, 251, | |
+ 172, 250, 251, 186, 250, 251, 186, 250, 251, 186, | |
+ 250, 251, 186, 250, 251, 188, 190, 250, 251, 190, | |
+ 250, 251, 188, 190, 250, 251, 188, 190, 250, 251, | |
+ 188, 190, 250, 251, 188, 190, 250, 251, 189, 190, | |
+ 250, 251, 233, 239, 250, 251, 238, 250, 251, 233, | |
+ 239, 250, 251, 237, 239, 250, 251, 239, 250, 251, | |
+ | |
+ 239, 250, 251, 235, 239, 250, 251, 235, 239, 250, | |
+ 251, 235, 239, 250, 251, 234, 239, 250, 251, 234, | |
+ 239, 250, 251, 229, 239, 250, 251, 230, 239, 250, | |
+ 251, 250, 251, 131, 250, 251, 250, 251, 25, 250, | |
+ 251, 26, 250, 251, 25, 250, 251, 22, 250, 251, | |
+ 25, 250, 251, 25, 250, 251, 240, 244, 250, 251, | |
+ 242, 250, 251, 240, 244, 250, 251, 243, 244, 250, | |
+ 251, 244, 250, 251, 227, 250, 251, 227, 250, 251, | |
+ 228, 250, 251, 227, 250, 251, 227, 250, 251, 227, | |
+ 250, 251, 227, 250, 251, 227, 250, 251, 227, 250, | |
+ | |
+ 251, 227, 250, 251, 130, 250, 251, 53, 130, 250, | |
+ 251, 52, 250, 251, 130, 250, 251, 130, 250, 251, | |
+ 130, 250, 251, 130, 250, 251, 54, 130, 250, 251, | |
+ 130, 250, 251, 130, 250, 251, 130, 250, 251, 130, | |
+ 250, 251, 130, 250, 251, 130, 250, 251, 130, 250, | |
+ 251, 130, 250, 251, 130, 250, 251, 130, 250, 251, | |
+ 130, 250, 251, 130, 250, 251, 130, 250, 251, 130, | |
+ 250, 251, 130, 250, 251, 130, 250, 251, 130, 250, | |
+ 251, 130, 250, 251, 130, 250, 251, 130, 250, 251, | |
+ 130, 250, 251, 37, 250, 251, 34, 250, 251, 37, | |
+ | |
+ 250, 251, 35, 37, 250, 251, 48, 250, 251, 45, | |
+ 250, 251, 250, 251, 48, 250, 251, 48, 250, 251, | |
+ 44, 250, 251, 43, 250, 251, 176, 250, 251, 175, | |
+ 250, 251, 177, 250, 251, 178, 250, 251, 179, 250, | |
+ 251, 180, 250, 251, 181, 250, 251, 182, 250, 251, | |
+ 183, 250, 251, 32, 250, 251, 33, 250, 251, 32, | |
+ 250, 251, 31, 250, 251, 29, 250, 251, 30, 250, | |
+ 251, 29, 250, 251, 28, 250, 251, 9, 20, 18, | |
+ 1, 9, 19, 20, 16, 10, 16, 4, 16, 5, | |
+ 2, 17, 18, 149, 150, 144, 160, 158, 154, 154, | |
+ | |
+ 245, 245, 245, 143, 148, 149, 138, 150, 140, 141, | |
+ 153, 139, 137, 135, 134, 134, 132, 135, 133, 135, | |
+ 248, 248, 246, 247, 42, 39, 40, 50, 49, 51, | |
+ 165, 165, 168, 169, 220, 216, 174, 184, 185, 190, | |
+ 187, 233, 238, 236, 222, 235, 235, 235, 231, 232, | |
+ 131, 26, 21, 23, 24, 240, 242, 241, 228, 221, | |
+ 225, 226, 53, 52, 129, 130, 130, 130, 130, 130, | |
+ 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, | |
+ 130, 130, 130, 130, 130, 55, 130, 130, 130, 130, | |
+ 130, 130, 130, 130, 130, 130, 130, 36, 35, 45, | |
+ | |
+ 46, 47, 32, 33, 30, 27, 16, 10, 16, 14, | |
+ 4, 16, 5, 6, 145, 146, 159, 154, 154, 154, | |
+ 154, 154, 245, 245, 156, 155, 157, 139, 145, 147, | |
+ 153, 132, 135, 133, 135, 38, 235, 235, 221, 130, | |
+ 130, 130, 130, 130, 130, 130, 67, 130, 130, 130, | |
+ 130, 72, 130, 130, 130, 130, 130, 130, 130, 130, | |
+ 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, | |
+ 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, | |
+ 130, 130, 130, 130, 130, 130, 130, 14, 15, 4, | |
+ 8, 16, 5, 154, 154, 154, 154, 154, 154, 154, | |
+ | |
+ 245, 157, 235, 235, 56, 57, 130, 130, 130, 130, | |
+ 130, 130, 130, 130, 130, 130, 130, 73, 130, 74, | |
+ 130, 130, 130, 130, 130, 79, 130, 130, 130, 130, | |
+ 130, 130, 130, 130, 84, 130, 130, 130, 130, 130, | |
+ 130, 130, 130, 130, 130, 93, 130, 130, 130, 130, | |
+ 130, 130, 130, 130, 130, 130, 15, 8, 16, 8, | |
+ 16, 8, 16, 154, 154, 154, 154, 154, 154, 154, | |
+ 215, 235, 235, 58, 130, 130, 130, 60, 130, 130, | |
+ 64, 130, 130, 130, 130, 130, 70, 130, 130, 130, | |
+ 130, 75, 130, 130, 130, 130, 130, 130, 130, 130, | |
+ | |
+ 130, 130, 130, 130, 87, 130, 130, 130, 130, 130, | |
+ 91, 130, 130, 130, 130, 130, 130, 130, 130, 130, | |
+ 130, 130, 3, 8, 16, 7, 8, 16, 154, 154, | |
+ 154, 223, 224, 223, 235, 224, 235, 130, 130, 130, | |
+ 63, 130, 130, 130, 130, 130, 130, 130, 130, 126, | |
+ 130, 130, 130, 130, 130, 130, 130, 130, 130, 124, | |
+ 130, 130, 86, 130, 130, 89, 130, 130, 90, 130, | |
+ 130, 130, 130, 105, 130, 130, 95, 130, 130, 96, | |
+ 130, 12, 13, 152, 151, 152, 130, 130, 130, 130, | |
+ 130, 130, 130, 68, 130, 130, 71, 130, 130, 130, | |
+ | |
+ 130, 130, 130, 130, 123, 130, 130, 83, 130, 130, | |
+ 130, 88, 130, 130, 92, 130, 103, 130, 125, 130, | |
+ 130, 130, 151, 130, 130, 130, 130, 130, 130, 130, | |
+ 69, 130, 130, 130, 130, 130, 80, 130, 130, 130, | |
+ 130, 130, 130, 130, 114, 94, 130, 130, 115, 11, | |
+ 191, 215, 192, 215, 193, 215, 194, 215, 195, 215, | |
+ 196, 215, 197, 215, 198, 215, 199, 215, 200, 215, | |
+ 201, 215, 130, 130, 130, 130, 130, 130, 130, 130, | |
+ 130, 130, 130, 130, 130, 130, 85, 130, 130, 130, | |
+ 116, 104, 130, 117, 202, 215, 203, 215, 204, 215, | |
+ | |
+ 205, 215, 206, 215, 207, 215, 208, 215, 209, 215, | |
+ 210, 215, 211, 215, 212, 215, 213, 215, 130, 130, | |
+ 130, 130, 130, 130, 130, 122, 130, 130, 130, 77, | |
+ 130, 130, 130, 130, 130, 130, 110, 120, 118, 111, | |
+ 121, 119, 214, 215, 130, 130, 130, 130, 130, 130, | |
+ 130, 126, 130, 76, 130, 130, 82, 130, 130, 127, | |
+ 130, 130, 106, 108, 107, 109, 130, 130, 130, 65, | |
+ 130, 130, 130, 130, 130, 78, 130, 130, 112, 113, | |
+ 98, 99, 130, 130, 130, 130, 130, 130, 130, 128, | |
+ 130, 97, 101, 130, 130, 130, 130, 130, 68, 130, | |
+ | |
+ 130, 100, 102, 130, 130, 62, 130, 66, 130, 130, | |
+ 130, 130, 61, 130, 69, 130, 130, 130, 81, 130, | |
+ 59, 130 | |
+ } ; | |
+ | |
+static yyconst flex_int16_t yy_accept[1108] = | |
+ { 0, | |
+ 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, | |
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, | |
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, | |
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, | |
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, | |
+ 6, 9, 12, 14, 17, 21, 25, 27, 29, 31, | |
+ 33, 37, 40, 44, 47, 50, 54, 57, 62, 67, | |
+ 71, 75, 78, 81, 84, 88, 93, 97, 100, 103, | |
+ 107, 111, 114, 117, 120, 124, 128, 132, 136, 140, | |
+ 143, 146, 149, 152, 155, 158, 161, 164, 167, 170, | |
+ | |
+ 173, 176, 179, 181, 184, 187, 190, 193, 197, 201, | |
+ 205, 208, 211, 214, 217, 221, 225, 229, 232, 235, | |
+ 238, 241, 244, 247, 250, 253, 256, 260, 263, 267, | |
+ 271, 275, 279, 283, 287, 290, 294, 298, 301, 304, | |
+ 308, 312, 316, 320, 324, 328, 332, 334, 337, 339, | |
+ 342, 345, 348, 351, 354, 357, 361, 364, 368, 372, | |
+ 375, 378, 381, 384, 387, 390, 393, 396, 399, 402, | |
+ 405, 408, 412, 415, 418, 421, 424, 427, 431, 434, | |
+ 437, 440, 443, 446, 449, 452, 455, 458, 461, 464, | |
+ 467, 470, 473, 476, 479, 482, 485, 488, 491, 494, | |
+ | |
+ 497, 500, 503, 507, 510, 513, 515, 518, 521, 524, | |
+ 527, 530, 533, 536, 539, 542, 545, 548, 551, 554, | |
+ 557, 560, 563, 566, 569, 572, 575, 578, 579, 580, | |
+ 580, 581, 583, 585, 585, 585, 585, 586, 588, 588, | |
+ 588, 588, 588, 589, 590, 591, 591, 592, 594, 595, | |
+ 596, 596, 596, 596, 597, 597, 598, 599, 599, 600, | |
+ 601, 601, 602, 603, 604, 604, 604, 605, 605, 607, | |
+ 609, 609, 609, 609, 610, 611, 612, 613, 613, 614, | |
+ 615, 616, 617, 619, 621, 622, 623, 624, 625, 626, | |
+ 626, 626, 627, 628, 628, 629, 630, 631, 631, 632, | |
+ | |
+ 632, 633, 634, 635, 636, 637, 638, 638, 639, 640, | |
+ 641, 642, 643, 644, 644, 645, 645, 646, 647, 648, | |
+ 649, 650, 651, 651, 652, 652, 653, 654, 655, 656, | |
+ 657, 658, 659, 659, 659, 660, 661, 662, 663, 664, | |
+ 665, 665, 666, 666, 666, 667, 668, 669, 670, 671, | |
+ 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, | |
+ 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, | |
+ 692, 693, 694, 695, 696, 697, 698, 698, 699, 700, | |
+ 701, 702, 703, 704, 705, 706, 707, 707, 708, 710, | |
+ 710, 711, 711, 711, 711, 711, 711, 712, 713, 714, | |
+ | |
+ 714, 715, 715, 716, 716, 717, 717, 718, 718, 719, | |
+ 720, 720, 721, 722, 723, 724, 725, 726, 727, 727, | |
+ 728, 730, 731, 731, 732, 732, 734, 736, 736, 736, | |
+ 736, 737, 737, 737, 737, 737, 737, 737, 737, 737, | |
+ 737, 737, 737, 737, 737, 738, 739, 740, 740, 740, | |
+ 741, 742, 743, 744, 745, 746, 747, 749, 750, 751, | |
+ 752, 754, 755, 756, 757, 758, 759, 760, 761, 762, | |
+ 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, | |
+ 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, | |
+ 783, 784, 785, 786, 787, 788, 788, 788, 788, 788, | |
+ | |
+ 790, 790, 790, 790, 790, 790, 790, 791, 793, 794, | |
+ 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, | |
+ 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, | |
+ 803, 803, 803, 803, 803, 803, 803, 803, 803, 803, | |
+ 803, 803, 803, 803, 803, 803, 804, 805, 806, 807, | |
+ 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, | |
+ 818, 820, 822, 823, 824, 825, 826, 828, 829, 830, | |
+ 831, 832, 833, 834, 835, 837, 838, 839, 840, 841, | |
+ 842, 843, 844, 845, 846, 848, 849, 850, 851, 852, | |
+ 853, 854, 855, 856, 857, 857, 857, 857, 857, 858, | |
+ | |
+ 858, 858, 858, 858, 858, 860, 862, 864, 864, 865, | |
+ 866, 867, 868, 869, 870, 871, 871, 871, 871, 871, | |
+ 872, 872, 872, 872, 872, 872, 872, 872, 872, 872, | |
+ 872, 872, 872, 872, 872, 872, 872, 872, 872, 872, | |
+ 872, 872, 872, 872, 873, 874, 876, 877, 878, 880, | |
+ 881, 883, 884, 885, 886, 887, 889, 890, 891, 892, | |
+ 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, | |
+ 904, 905, 907, 908, 909, 910, 911, 913, 914, 915, | |
+ 916, 917, 918, 919, 920, 921, 922, 923, 923, 923, | |
+ 923, 923, 924, 924, 924, 924, 926, 927, 929, 929, | |
+ | |
+ 930, 931, 932, 932, 932, 933, 934, 934, 934, 934, | |
+ 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, | |
+ 934, 934, 934, 934, 934, 934, 934, 934, 934, 934, | |
+ 934, 936, 938, 939, 940, 941, 943, 944, 945, 946, | |
+ 947, 948, 949, 950, 952, 953, 954, 955, 956, 957, | |
+ 958, 959, 960, 962, 963, 965, 966, 968, 969, 971, | |
+ 972, 973, 974, 976, 976, 977, 979, 980, 980, 982, | |
+ 982, 982, 982, 982, 982, 983, 983, 984, 984, 985, | |
+ 985, 987, 987, 987, 987, 987, 987, 987, 987, 987, | |
+ 987, 987, 987, 987, 987, 987, 987, 987, 987, 987, | |
+ | |
+ 987, 987, 987, 987, 987, 987, 988, 989, 990, 991, | |
+ 992, 993, 994, 996, 997, 999, 1000, 1001, 1002, 1003, | |
+ 1004, 1005, 1007, 1008, 1010, 1011, 1012, 1014, 1015, 1017, | |
+ 1019, 1021, 1021, 1021, 1021, 1021, 1021, 1021, 1022, 1023, | |
+ 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1023, | |
+ 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, | |
+ 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, | |
+ 1024, 1024, 1024, 1024, 1024, 1025, 1026, 1027, 1028, 1029, | |
+ 1030, 1031, 1033, 1034, 1035, 1036, 1037, 1039, 1040, 1041, | |
+ 1042, 1043, 1044, 1045, 1045, 1045, 1046, 1046, 1046, 1046, | |
+ | |
+ 1046, 1046, 1046, 1048, 1049, 1049, 1049, 1050, 1050, 1050, | |
+ 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1051, 1051, 1053, | |
+ 1055, 1057, 1059, 1061, 1063, 1065, 1067, 1069, 1071, 1073, | |
+ 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, | |
+ 1073, 1073, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, | |
+ 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1089, 1090, 1091, | |
+ 1091, 1091, 1091, 1091, 1091, 1091, 1092, 1092, 1094, 1094, | |
+ 1094, 1094, 1094, 1094, 1095, 1095, 1095, 1095, 1095, 1095, | |
+ 1097, 1099, 1101, 1103, 1105, 1107, 1109, 1111, 1113, 1115, | |
+ 1117, 1119, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, | |
+ | |
+ 1128, 1129, 1130, 1132, 1133, 1134, 1135, 1136, 1137, 1137, | |
+ 1137, 1138, 1138, 1139, 1140, 1141, 1141, 1141, 1141, 1142, | |
+ 1143, 1143, 1143, 1143, 1143, 1143, 1143, 1145, 1146, 1147, | |
+ 1148, 1149, 1150, 1151, 1152, 1154, 1156, 1157, 1159, 1160, | |
+ 1162, 1163, 1164, 1165, 1165, 1166, 1167, 1167, 1167, 1167, | |
+ 1167, 1167, 1167, 1167, 1168, 1169, 1170, 1172, 1173, 1174, | |
+ 1175, 1176, 1178, 1179, 1180, 1181, 1182, 1182, 1182, 1182, | |
+ 1182, 1183, 1184, 1185, 1186, 1187, 1188, 1189, 1190, 1192, | |
+ 1193, 1193, 1194, 1194, 1195, 1196, 1197, 1198, 1199, 1201, | |
+ 1202, 1203, 1204, 1205, 1206, 1208, 1210, 1211, 1212, 1213, | |
+ | |
+ 1215, 1217, 1218, 1219, 1221, 1223, 1223 | |
+ } ; | |
+ | |
+static yyconst flex_int32_t yy_ec[256] = | |
+ { 0, | |
+ 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, | |
+ 4, 4, 5, 1, 1, 1, 1, 1, 1, 1, | |
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
+ 1, 2, 1, 6, 7, 8, 9, 1, 10, 11, | |
+ 12, 13, 14, 15, 16, 17, 18, 19, 19, 19, | |
+ 19, 19, 19, 19, 20, 21, 22, 23, 1, 24, | |
+ 25, 26, 27, 1, 28, 29, 30, 31, 32, 33, | |
+ 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, | |
+ 44, 45, 46, 47, 48, 49, 50, 51, 52, 44, | |
+ 53, 54, 55, 56, 57, 1, 58, 59, 60, 61, | |
+ | |
+ 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, | |
+ 72, 73, 44, 74, 75, 76, 77, 78, 79, 80, | |
+ 81, 44, 82, 83, 84, 1, 1, 1, 1, 1, | |
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
+ | |
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
+ 1, 1, 1, 1, 1 | |
+ } ; | |
+ | |
+static yyconst flex_int32_t yy_meta[85] = | |
+ { 0, | |
+ 1, 1, 2, 1, 3, 4, 1, 1, 1, 5, | |
+ 1, 6, 1, 7, 1, 8, 1, 5, 9, 9, | |
+ 9, 9, 10, 1, 1, 1, 1, 11, 11, 11, | |
+ 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, | |
+ 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, | |
+ 12, 12, 13, 14, 15, 1, 16, 11, 11, 11, | |
+ 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, | |
+ 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, | |
+ 12, 5, 1, 17 | |
+ } ; | |
+ | |
+static yyconst flex_int16_t yy_base[1201] = | |
+ { 0, | |
+ 0, 84, 167, 250, 171, 184, 174, 179, 192, 233, | |
+ 196, 200, 334, 0, 3343, 3340, 203, 416, 206, 211, | |
+ 187, 216, 276, 417, 500, 0, 210, 223, 421, 427, | |
+ 436, 440, 583, 588, 669, 0, 277, 299, 584, 751, | |
+ 579, 580, 576, 732, 279, 305, 310, 444, 3378, 3975, | |
+ 228, 3975, 3371, 0, 322, 3975, 3358, 423, 827, 3328, | |
+ 0, 3975, 755, 3975, 3337, 3975, 448, 3312, 3975, 3975, | |
+ 3323, 3291, 222, 408, 444, 764, 3975, 3311, 230, 3289, | |
+ 3975, 3975, 3975, 3306, 0, 3306, 164, 3304, 3975, 3236, | |
+ 3217, 3975, 3975, 3266, 239, 119, 3215, 3212, 3180, 0, | |
+ | |
+ 3248, 3975, 3243, 3975, 476, 3227, 3222, 3975, 3168, 0, | |
+ 3975, 3975, 3975, 3203, 3975, 464, 3975, 3975, 3975, 3186, | |
+ 3975, 742, 3975, 3161, 751, 180, 3975, 3975, 3171, 0, | |
+ 3149, 757, 3975, 0, 3975, 3149, 3975, 200, 3138, 0, | |
+ 429, 241, 3097, 3092, 3975, 3975, 306, 3975, 323, 3975, | |
+ 3975, 3126, 3108, 3072, 3069, 0, 3975, 3115, 3975, 0, | |
+ 3975, 446, 3975, 3114, 3031, 3098, 435, 371, 3045, 3026, | |
+ 3975, 3076, 3975, 3074, 3070, 439, 440, 3975, 578, 751, | |
+ 586, 562, 735, 752, 0, 572, 577, 588, 786, 749, | |
+ 396, 809, 727, 582, 747, 753, 764, 769, 580, 3975, | |
+ | |
+ 3975, 3067, 588, 3975, 3975, 3053, 3002, 2996, 3975, 3975, | |
+ 3975, 3975, 3975, 3975, 3975, 3975, 3975, 3975, 3975, 0, | |
+ 3975, 3046, 3975, 3975, 3975, 3018, 2986, 837, 3975, 2998, | |
+ 0, 847, 3975, 2997, 817, 777, 0, 0, 891, 903, | |
+ 912, 924, 0, 774, 0, 451, 3975, 0, 858, 3975, | |
+ 2996, 2914, 472, 3975, 2974, 2953, 3975, 791, 236, 822, | |
+ 899, 3975, 275, 0, 2873, 2872, 3975, 2871, 949, 3975, | |
+ 2949, 2850, 2918, 2906, 3975, 0, 3975, 796, 3975, 0, | |
+ 0, 2925, 0, 0, 2597, 3975, 3975, 3975, 3975, 795, | |
+ 794, 3975, 3975, 484, 0, 2597, 3975, 877, 2596, 2594, | |
+ | |
+ 2594, 3975, 0, 3975, 918, 3975, 1005, 3975, 3975, 3975, | |
+ 3975, 0, 3975, 611, 3975, 0, 3975, 0, 853, 851, | |
+ 3975, 3975, 490, 3975, 608, 3975, 3975, 3975, 3975, 0, | |
+ 3975, 3975, 596, 2510, 3975, 0, 3975, 3975, 2588, 3975, | |
+ 2581, 3975, 894, 906, 0, 911, 717, 727, 923, 728, | |
+ 2571, 882, 930, 889, 902, 916, 917, 940, 928, 923, | |
+ 940, 933, 0, 932, 3975, 935, 939, 951, 956, 1059, | |
+ 964, 965, 1052, 955, 957, 1099, 2578, 3975, 1078, 3975, | |
+ 3975, 3975, 0, 3975, 3975, 3975, 987, 0, 0, 1087, | |
+ 3975, 2576, 1132, 985, 1046, 1058, 0, 1058, 0, 1009, | |
+ | |
+ 3975, 1016, 3975, 1057, 3975, 1099, 3975, 1068, 731, 1088, | |
+ 1095, 1178, 1244, 1280, 988, 0, 3975, 3975, 2492, 1162, | |
+ 3975, 3975, 1081, 0, 1086, 0, 0, 1098, 1105, 1100, | |
+ 3975, 1167, 1245, 1246, 1247, 1250, 2539, 1248, 1249, 1258, | |
+ 1244, 1251, 1259, 1321, 1233, 1224, 0, 1072, 1228, 1243, | |
+ 1261, 1287, 1298, 1289, 1298, 1287, 0, 1299, 1228, 1308, | |
+ 0, 1280, 1298, 1307, 1316, 1314, 1316, 2532, 1322, 1337, | |
+ 1338, 1340, 1342, 1342, 1348, 1353, 1356, 1347, 1357, 1362, | |
+ 1366, 1358, 1353, 1356, 1377, 1366, 1370, 1371, 1367, 1383, | |
+ 1384, 1379, 1391, 1392, 1381, 1388, 1397, 1275, 1455, 3975, | |
+ | |
+ 1439, 1463, 1444, 1415, 1412, 1415, 0, 1409, 0, 1429, | |
+ 1492, 1558, 1594, 1524, 2449, 1564, 1639, 3975, 3975, 1537, | |
+ 1556, 1560, 1407, 2427, 1558, 1563, 1559, 1564, 1572, 1584, | |
+ 1574, 1562, 1615, 1619, 1609, 1625, 1626, 1643, 1614, 1651, | |
+ 1662, 1658, 1664, 1665, 1616, 1616, 1637, 3975, 3975, 1638, | |
+ 1631, 2352, 1634, 1641, 1655, 1650, 1677, 1679, 1671, 1689, | |
+ 0, 0, 1690, 1677, 1681, 1697, 0, 2348, 1684, 1694, | |
+ 2274, 1686, 1685, 1695, 0, 1692, 1711, 1704, 1703, 1701, | |
+ 1713, 1703, 1704, 1712, 0, 1717, 1731, 1731, 1719, 1723, | |
+ 1722, 1741, 1726, 1742, 1734, 1747, 1741, 2241, 3975, 1464, | |
+ | |
+ 1485, 1729, 1743, 1740, 0, 1721, 1591, 2173, 1585, 2139, | |
+ 1771, 1807, 1417, 962, 1426, 1755, 2049, 1745, 1769, 3975, | |
+ 1774, 1782, 1789, 1775, 1796, 1791, 1810, 1800, 1820, 1822, | |
+ 1821, 1823, 1832, 1831, 1838, 1840, 1853, 1856, 1854, 1855, | |
+ 1863, 1865, 1861, 1846, 1862, 0, 1853, 1864, 0, 1857, | |
+ 0, 2008, 1866, 1862, 1869, 0, 1874, 1893, 1870, 0, | |
+ 1888, 1875, 1886, 1882, 1880, 1878, 1897, 1876, 1882, 1889, | |
+ 1889, 0, 1904, 1895, 1899, 1919, 0, 1907, 1909, 1908, | |
+ 1923, 1791, 1924, 1925, 1919, 1747, 1917, 1918, 1918, 1938, | |
+ 1924, 1726, 1599, 1927, 1937, 1970, 3975, 1702, 1652, 1923, | |
+ | |
+ 1755, 1941, 1625, 1618, 3975, 3975, 1961, 1977, 1966, 1969, | |
+ 1956, 1979, 1983, 1986, 1989, 1984, 1992, 1987, 1994, 1990, | |
+ 1988, 1995, 2007, 2004, 2016, 2022, 1996, 2028, 2018, 2026, | |
+ 0, 0, 1620, 1990, 2009, 0, 2035, 2020, 2035, 2029, | |
+ 2024, 2025, 2029, 1589, 2049, 2041, 2052, 2048, 2053, 2054, | |
+ 2044, 2057, 0, 2064, 0, 2048, 0, 1576, 0, 2064, | |
+ 2070, 2056, 0, 2096, 2062, 0, 2067, 2108, 0, 1531, | |
+ 2072, 2078, 1438, 1853, 3975, 2105, 3975, 2068, 3975, 1463, | |
+ 3975, 1407, 1402, 1348, 1345, 1314, 1307, 1269, 1260, 1256, | |
+ 1210, 1158, 2106, 2111, 2097, 2118, 2122, 2129, 2125, 2140, | |
+ | |
+ 2131, 2136, 2141, 2143, 2156, 2131, 2138, 2147, 2101, 2151, | |
+ 2138, 2153, 0, 2141, 0, 2144, 2165, 2153, 2159, 2158, | |
+ 2165, 0, 2165, 0, 2167, 2169, 0, 2178, 0, 0, | |
+ 0, 2183, 2167, 2179, 2210, 2178, 2189, 2188, 2189, 2202, | |
+ 2186, 2194, 2218, 2196, 2202, 1119, 1114, 2206, 2118, 3975, | |
+ 1106, 1100, 1081, 1068, 1065, 1061, 1057, 972, 968, 965, | |
+ 914, 925, 893, 881, 874, 869, 865, 861, 854, 843, | |
+ 807, 802, 776, 2235, 2212, 2226, 2221, 2227, 2239, 2238, | |
+ 2228, 0, 2228, 2239, 2242, 2252, 0, 2238, 2244, 2249, | |
+ 2244, 2258, 2263, 2269, 2255, 3975, 2263, 2265, 2265, 2281, | |
+ | |
+ 2265, 2262, 0, 2285, 2288, 2274, 3975, 2277, 2280, 2295, | |
+ 2279, 2280, 2283, 2303, 2283, 2330, 3975, 2335, 3975, 3975, | |
+ 3975, 3975, 3975, 3975, 3975, 3975, 3975, 3975, 3975, 735, | |
+ 612, 608, 598, 441, 374, 261, 245, 202, 152, 149, | |
+ 137, 165, 2296, 2303, 2304, 2320, 2326, 2316, 2324, 2329, | |
+ 2324, 2316, 2319, 2335, 2324, 2327, 0, 2332, 2328, 2327, | |
+ 2332, 2345, 2348, 2352, 2344, 3975, 2338, 0, 2338, 2343, | |
+ 2357, 2362, 2357, 3975, 2371, 2356, 2359, 2358, 2380, 3975, | |
+ 3975, 3975, 3975, 3975, 3975, 3975, 3975, 3975, 3975, 3975, | |
+ 3975, 128, 2384, 2382, 2373, 2387, 2376, 2378, 2378, 0, | |
+ | |
+ 2395, 2396, 0, 2385, 2384, 2405, 2403, 2401, 2405, 2413, | |
+ 3975, 2401, 3975, 3975, 3975, 2409, 2416, 2404, 3975, 3975, | |
+ 2400, 2422, 2422, 2414, 2417, 2417, 3975, 2421, 2421, 2418, | |
+ 2424, 2441, 2442, 2443, 0, 0, 2453, 0, 2436, 0, | |
+ 2451, 3975, 3975, 2445, 3975, 3975, 2446, 2457, 2445, 2461, | |
+ 2464, 2462, 2468, 2473, 2466, 2460, 0, 2462, 2459, 2461, | |
+ 2483, 0, 2463, 3975, 3975, 3975, 2484, 2488, 2476, 2482, | |
+ 3975, 2495, 2485, 2497, 2495, 2501, 2506, 2493, 0, 3975, | |
+ 2496, 3975, 2508, 2498, 2506, 2503, 2506, 2505, 0, 2520, | |
+ 3975, 3975, 2522, 2514, 0, 0, 2529, 2514, 2515, 0, | |
+ | |
+ 0, 2533, 2539, 0, 0, 3975, 2601, 2618, 2635, 2652, | |
+ 2669, 2686, 2703, 2720, 2737, 2754, 2771, 2788, 2805, 2822, | |
+ 2839, 2856, 2873, 2890, 2907, 2917, 2933, 2942, 2958, 2975, | |
+ 2986, 3002, 3019, 3036, 3053, 3063, 3079, 3096, 3113, 3127, | |
+ 3137, 3153, 3170, 3187, 3204, 3215, 2009, 3227, 3244, 3254, | |
+ 3270, 3287, 3294, 3300, 3316, 3326, 3342, 3359, 3376, 2564, | |
+ 3386, 3403, 3420, 3437, 3454, 3471, 3488, 3505, 3522, 3532, | |
+ 3548, 3562, 3572, 3588, 3605, 3622, 3639, 3650, 3662, 3679, | |
+ 3696, 3713, 3730, 3740, 3749, 3765, 3782, 3799, 2571, 3809, | |
+ 3826, 3843, 3860, 3877, 3885, 3890, 3906, 3923, 3940, 3957 | |
+ | |
+ } ; | |
+ | |
+static yyconst flex_int16_t yy_def[1201] = | |
+ { 0, | |
+ 1106, 1106, 1107, 1107, 1108, 1109, 1110, 1110, 1111, 1111, | |
+ 1112, 1112, 1106, 13, 1113, 1113, 1114, 1114, 1115, 1115, | |
+ 1116, 1116, 1117, 1117, 1106, 25, 1118, 1118, 1119, 1119, | |
+ 1120, 1120, 1121, 1121, 1106, 35, 1122, 1122, 1123, 1123, | |
+ 1113, 1113, 1113, 1113, 1124, 1124, 1125, 1125, 1106, 1106, | |
+ 1106, 1106, 1106, 1126, 1106, 1106, 1106, 1106, 1127, 1106, | |
+ 1128, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, | |
+ 1106, 1106, 1129, 1130, 1131, 1106, 1106, 1106, 1106, 1106, | |
+ 1106, 1106, 1106, 1106, 1132, 1133, 1132, 1134, 1106, 1106, | |
+ 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1135, | |
+ | |
+ 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1136, | |
+ 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, | |
+ 1106, 1130, 1106, 1106, 1130, 1137, 1106, 1106, 1106, 1138, | |
+ 1106, 1130, 1106, 1139, 1106, 1139, 1106, 1140, 1106, 1141, | |
+ 1141, 1141, 1106, 1106, 1106, 1106, 1142, 1106, 1142, 1106, | |
+ 1106, 1106, 1106, 1106, 1106, 1143, 1106, 1143, 1106, 1144, | |
+ 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, | |
+ 1106, 1106, 1106, 1106, 1145, 1106, 1106, 1106, 1146, 1146, | |
+ 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1147, | |
+ 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1106, | |
+ | |
+ 1106, 1148, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, | |
+ 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1149, | |
+ 1106, 1149, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, | |
+ 1150, 1106, 1106, 1106, 1106, 1106, 1151, 1152, 1106, 1106, | |
+ 1106, 1106, 1153, 1151, 1154, 1155, 1106, 1156, 1106, 1106, | |
+ 1106, 1106, 1157, 1106, 1106, 1106, 1106, 1106, 1158, 1158, | |
+ 1159, 1106, 1106, 1160, 1106, 1106, 1106, 1161, 1106, 1106, | |
+ 1106, 1106, 1106, 1106, 1106, 1162, 1106, 1106, 1106, 1163, | |
+ 1164, 1164, 1165, 1166, 1167, 1106, 1106, 1106, 1106, 1106, | |
+ 1106, 1106, 1106, 1168, 1169, 1106, 1106, 1106, 1106, 1106, | |
+ | |
+ 1106, 1106, 1170, 1106, 1106, 1106, 1106, 1106, 1106, 1106, | |
+ 1106, 1171, 1106, 1172, 1106, 1172, 1106, 1173, 1173, 1173, | |
+ 1106, 1106, 1174, 1106, 1174, 1106, 1106, 1106, 1106, 1175, | |
+ 1106, 1106, 1106, 1106, 1106, 1176, 1106, 1106, 1106, 1106, | |
+ 1177, 1106, 1106, 1106, 1178, 1178, 1178, 1178, 1178, 1178, | |
+ 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, | |
+ 1178, 1178, 1178, 1178, 1106, 1178, 1178, 1178, 1178, 1178, | |
+ 1178, 1178, 1178, 1178, 1178, 1178, 1179, 1106, 1106, 1106, | |
+ 1106, 1106, 1180, 1106, 1106, 1106, 1106, 1181, 1182, 1183, | |
+ 1106, 1106, 1106, 1106, 1106, 1106, 1184, 1181, 1185, 1186, | |
+ | |
+ 1106, 1186, 1106, 1187, 1106, 1187, 1106, 1106, 1188, 1188, | |
+ 1188, 1106, 1188, 1188, 1106, 1189, 1106, 1106, 1190, 1106, | |
+ 1106, 1106, 1106, 1191, 1106, 1192, 1193, 1106, 1106, 1194, | |
+ 1106, 1194, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, | |
+ 1195, 1195, 1195, 1195, 1196, 1196, 1197, 1106, 1106, 1178, | |
+ 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, | |
+ 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, | |
+ 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, | |
+ 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, | |
+ 1178, 1178, 1178, 1178, 1178, 1106, 1106, 1183, 1183, 1106, | |
+ | |
+ 1183, 1183, 1106, 1106, 1106, 1106, 1184, 1198, 1185, 1106, | |
+ 1106, 1188, 414, 412, 412, 1188, 414, 1106, 1106, 1106, | |
+ 1106, 1106, 1106, 1106, 1195, 1195, 1195, 1195, 1195, 1195, | |
+ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, | |
+ 1195, 1195, 1195, 1195, 1195, 1196, 1196, 1106, 1106, 1178, | |
+ 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, | |
+ 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, | |
+ 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, | |
+ 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, | |
+ 1178, 1178, 1178, 1178, 1106, 1106, 1106, 1106, 1106, 1183, | |
+ | |
+ 1183, 1106, 1106, 1106, 1198, 1198, 1198, 1106, 511, 511, | |
+ 1188, 414, 1188, 1188, 1188, 1106, 1106, 1106, 1106, 1106, | |
+ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, | |
+ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, | |
+ 1195, 1195, 1195, 1196, 1196, 1178, 1178, 1178, 1178, 1178, | |
+ 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, | |
+ 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, | |
+ 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, | |
+ 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1106, 1106, 1106, | |
+ 1106, 1106, 1199, 1106, 1106, 1198, 1106, 1198, 1106, 1188, | |
+ | |
+ 1188, 1188, 1106, 1106, 1106, 1106, 1195, 1195, 1195, 1195, | |
+ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, | |
+ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, | |
+ 1196, 1196, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, | |
+ 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, | |
+ 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, | |
+ 1178, 1178, 1178, 1106, 1178, 1178, 1178, 1106, 1178, 1106, | |
+ 1106, 1106, 1106, 1199, 1106, 1199, 1106, 1106, 1106, 1106, | |
+ 1106, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, | |
+ 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, | |
+ | |
+ 1195, 1195, 1195, 1195, 1195, 1178, 1178, 1178, 1178, 1178, | |
+ 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, | |
+ 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, | |
+ 1178, 1106, 1106, 1106, 1106, 1106, 1106, 1178, 1178, 1106, | |
+ 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1200, 1106, | |
+ 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, | |
+ 1106, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, | |
+ 1195, 1195, 1195, 1195, 1178, 1178, 1178, 1178, 1178, 1178, | |
+ 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, | |
+ 1178, 1178, 1178, 1106, 1106, 1106, 1106, 1106, 1106, 1106, | |
+ | |
+ 1106, 1106, 1178, 1178, 1106, 1106, 1106, 1106, 1106, 1106, | |
+ 1106, 1106, 1106, 1106, 1106, 1200, 1106, 1200, 1106, 1106, | |
+ 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, | |
+ 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, | |
+ 1106, 1195, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, | |
+ 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1106, | |
+ 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1178, 1106, 1106, | |
+ 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, | |
+ 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, | |
+ 1106, 1106, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, | |
+ | |
+ 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1106, 1106, | |
+ 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, | |
+ 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1178, 1178, 1178, | |
+ 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, | |
+ 1178, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, | |
+ 1106, 1106, 1106, 1178, 1178, 1178, 1178, 1178, 1178, 1178, | |
+ 1178, 1178, 1178, 1106, 1106, 1106, 1106, 1106, 1106, 1106, | |
+ 1106, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1106, | |
+ 1106, 1106, 1106, 1178, 1178, 1178, 1178, 1178, 1178, 1178, | |
+ 1106, 1106, 1178, 1178, 1178, 1178, 1178, 1178, 1178, 1178, | |
+ | |
+ 1178, 1178, 1178, 1178, 1178, 0, 1106, 1106, 1106, 1106, | |
+ 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, | |
+ 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, | |
+ 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, | |
+ 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, | |
+ 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, | |
+ 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, | |
+ 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, | |
+ 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, | |
+ 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106 | |
+ | |
+ } ; | |
+ | |
+static yyconst flex_int16_t yy_nxt[4060] = | |
+ { 0, | |
+ 50, 51, 52, 50, 53, 50, 50, 50, 50, 50, | |
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, | |
+ 50, 50, 50, 50, 50, 50, 50, 54, 54, 54, | |
+ 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, | |
+ 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, | |
+ 54, 54, 50, 50, 50, 50, 54, 54, 54, 54, | |
+ 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, | |
+ 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, | |
+ 54, 50, 50, 50, 50, 55, 56, 50, 57, 50, | |
+ 58, 50, 59, 50, 50, 50, 50, 50, 50, 50, | |
+ | |
+ 50, 60, 50, 50, 50, 50, 50, 50, 50, 50, | |
+ 50, 61, 61, 61, 61, 61, 61, 61, 61, 61, | |
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, | |
+ 61, 61, 61, 61, 61, 61, 50, 50, 50, 50, | |
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, | |
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, | |
+ 61, 61, 61, 61, 61, 50, 50, 50, 63, 64, | |
+ 291, 65, 66, 83, 67, 84, 89, 68, 69, 70, | |
+ 70, 89, 1027, 70, 71, 86, 83, 992, 84, 50, | |
+ 72, 991, 87, 70, 93, 309, 94, 101, 102, 291, | |
+ | |
+ 103, 101, 102, 990, 103, 113, 989, 114, 119, 315, | |
+ 120, 121, 148, 119, 149, 120, 121, 115, 50, 73, | |
+ 74, 116, 116, 116, 116, 148, 90, 149, 91, 228, | |
+ 229, 90, 230, 91, 309, 93, 95, 94, 276, 124, | |
+ 125, 99, 126, 96, 97, 283, 98, 284, 75, 70, | |
+ 70, 76, 77, 316, 78, 66, 988, 67, 79, 122, | |
+ 68, 69, 70, 70, 122, 95, 70, 71, 124, 125, | |
+ 290, 126, 96, 80, 260, 261, 70, 95, 128, 201, | |
+ 129, 221, 202, 222, 96, 97, 117, 98, 410, 411, | |
+ 223, 130, 320, 415, 415, 203, 203, 203, 203, 987, | |
+ | |
+ 290, 201, 73, 74, 202, 81, 95, 221, 324, 222, | |
+ 325, 277, 225, 96, 226, 986, 223, 203, 203, 203, | |
+ 203, 320, 227, 232, 233, 324, 234, 325, 131, 132, | |
+ 133, 75, 70, 70, 104, 105, 106, 104, 107, 104, | |
+ 104, 104, 104, 104, 104, 104, 108, 104, 108, 104, | |
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 109, | |
+ 104, 110, 110, 110, 110, 110, 110, 110, 110, 110, | |
+ 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, | |
+ 110, 110, 110, 110, 110, 110, 104, 104, 104, 104, | |
+ 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, | |
+ | |
+ 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, | |
+ 110, 110, 110, 110, 110, 104, 104, 104, 113, 128, | |
+ 114, 129, 291, 151, 235, 152, 263, 263, 985, 151, | |
+ 115, 152, 130, 153, 116, 116, 116, 116, 157, 153, | |
+ 158, 159, 157, 366, 158, 159, 225, 333, 226, 254, | |
+ 254, 291, 255, 401, 334, 402, 227, 265, 264, 266, | |
+ 319, 236, 267, 267, 267, 267, 290, 343, 344, 131, | |
+ 132, 133, 366, 154, 405, 155, 406, 298, 299, 154, | |
+ 300, 155, 305, 305, 305, 305, 431, 264, 432, 160, | |
+ 319, 236, 324, 160, 325, 984, 290, 343, 344, 117, | |
+ | |
+ 134, 134, 135, 134, 136, 137, 134, 134, 134, 138, | |
+ 134, 134, 134, 134, 134, 134, 134, 139, 134, 134, | |
+ 134, 134, 134, 134, 134, 134, 134, 140, 140, 140, | |
+ 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, | |
+ 140, 140, 140, 140, 141, 140, 140, 140, 140, 140, | |
+ 140, 142, 143, 134, 144, 134, 140, 140, 140, 140, | |
+ 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, | |
+ 140, 140, 140, 141, 140, 140, 140, 140, 140, 140, | |
+ 142, 145, 134, 146, 162, 163, 205, 164, 206, 162, | |
+ 163, 165, 164, 353, 211, 211, 165, 333, 216, 351, | |
+ | |
+ 166, 212, 212, 358, 334, 166, 379, 379, 379, 379, | |
+ 324, 217, 325, 352, 213, 213, 346, 359, 347, 360, | |
+ 315, 218, 348, 353, 214, 214, 219, 167, 371, 215, | |
+ 215, 376, 167, 358, 168, 169, 207, 170, 208, 168, | |
+ 169, 217, 170, 352, 213, 213, 346, 359, 347, 360, | |
+ 218, 348, 983, 214, 214, 219, 167, 371, 215, 215, | |
+ 376, 167, 982, 168, 316, 209, 981, 210, 168, 171, | |
+ 172, 173, 171, 174, 175, 171, 171, 171, 171, 171, | |
+ 171, 171, 171, 171, 171, 171, 171, 171, 176, 177, | |
+ 171, 171, 171, 178, 171, 171, 179, 180, 181, 182, | |
+ | |
+ 183, 184, 185, 186, 187, 185, 185, 188, 189, 190, | |
+ 191, 192, 185, 193, 194, 195, 196, 197, 198, 185, | |
+ 199, 171, 171, 171, 171, 171, 179, 180, 181, 182, | |
+ 183, 184, 185, 186, 187, 185, 185, 188, 189, 190, | |
+ 191, 192, 193, 194, 195, 196, 197, 198, 185, 199, | |
+ 171, 171, 171, 205, 216, 206, 249, 250, 370, 251, | |
+ 263, 263, 452, 252, 354, 269, 270, 217, 271, 263, | |
+ 263, 453, 272, 456, 372, 263, 263, 218, 349, 356, | |
+ 364, 273, 219, 410, 411, 355, 350, 274, 370, 980, | |
+ 365, 452, 264, 373, 354, 374, 375, 217, 941, 357, | |
+ | |
+ 453, 264, 456, 207, 372, 208, 218, 264, 349, 356, | |
+ 364, 219, 387, 361, 355, 398, 350, 362, 235, 275, | |
+ 365, 264, 408, 373, 940, 374, 375, 425, 357, 939, | |
+ 264, 428, 209, 429, 210, 238, 264, 253, 228, 229, | |
+ 367, 230, 387, 361, 412, 398, 253, 362, 232, 233, | |
+ 368, 234, 408, 369, 239, 236, 240, 425, 240, 249, | |
+ 250, 428, 251, 429, 240, 938, 252, 240, 241, 242, | |
+ 367, 240, 243, 244, 410, 411, 937, 245, 298, 299, | |
+ 368, 300, 369, 936, 239, 236, 240, 935, 240, 445, | |
+ 446, 934, 390, 391, 240, 392, 933, 240, 241, 242, | |
+ | |
+ 240, 243, 244, 932, 390, 391, 245, 392, 246, 393, | |
+ 393, 393, 393, 390, 391, 931, 392, 413, 413, 445, | |
+ 446, 393, 393, 393, 393, 390, 391, 458, 392, 448, | |
+ 393, 393, 393, 393, 461, 394, 305, 305, 305, 305, | |
+ 253, 449, 393, 393, 393, 393, 450, 930, 462, 414, | |
+ 269, 270, 454, 271, 395, 464, 458, 272, 459, 448, | |
+ 451, 463, 460, 461, 394, 396, 273, 465, 929, 455, | |
+ 466, 449, 274, 468, 467, 469, 450, 462, 414, 470, | |
+ 471, 472, 454, 473, 395, 464, 474, 476, 459, 451, | |
+ 463, 480, 460, 482, 481, 396, 475, 465, 455, 485, | |
+ | |
+ 466, 486, 468, 467, 275, 469, 262, 262, 470, 471, | |
+ 472, 401, 473, 402, 410, 411, 474, 476, 401, 928, | |
+ 402, 480, 927, 482, 481, 475, 926, 497, 485, 504, | |
+ 486, 253, 433, 434, 435, 436, 437, 437, 438, 437, | |
+ 437, 437, 437, 439, 437, 437, 437, 440, 437, 437, | |
+ 441, 437, 442, 437, 437, 443, 437, 497, 504, 405, | |
+ 444, 406, 433, 434, 435, 436, 437, 437, 438, 437, | |
+ 437, 437, 437, 439, 437, 437, 437, 440, 437, 441, | |
+ 437, 442, 437, 437, 443, 437, 477, 483, 499, 500, | |
+ 478, 501, 505, 506, 484, 479, 379, 379, 379, 379, | |
+ | |
+ 508, 405, 431, 406, 432, 502, 502, 502, 502, 510, | |
+ 511, 925, 520, 512, 512, 924, 477, 483, 548, 923, | |
+ 478, 505, 922, 506, 484, 479, 487, 521, 488, 522, | |
+ 508, 489, 490, 503, 391, 921, 392, 491, 492, 510, | |
+ 410, 411, 520, 493, 494, 513, 523, 548, 495, 409, | |
+ 393, 393, 393, 393, 920, 496, 487, 521, 488, 522, | |
+ 919, 489, 490, 519, 519, 519, 519, 491, 492, 431, | |
+ 914, 432, 493, 494, 513, 913, 523, 495, 409, 409, | |
+ 861, 409, 409, 409, 409, 409, 409, 409, 409, 409, | |
+ 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, | |
+ | |
+ 409, 409, 409, 409, 409, 514, 514, 514, 514, 514, | |
+ 514, 514, 514, 514, 514, 514, 514, 514, 514, 514, | |
+ 514, 514, 514, 514, 514, 514, 514, 514, 514, 514, | |
+ 410, 411, 860, 515, 409, 514, 514, 514, 514, 514, | |
+ 514, 514, 514, 514, 514, 514, 514, 514, 514, 514, | |
+ 514, 514, 514, 514, 514, 514, 514, 514, 514, 409, | |
+ 409, 409, 516, 516, 546, 547, 524, 524, 524, 524, | |
+ 524, 524, 524, 524, 549, 558, 550, 599, 859, 600, | |
+ 524, 524, 858, 525, 526, 528, 533, 527, 551, 535, | |
+ 530, 857, 529, 534, 546, 547, 410, 411, 517, 517, | |
+ | |
+ 517, 517, 531, 549, 558, 532, 550, 517, 517, 517, | |
+ 517, 517, 517, 525, 526, 528, 533, 527, 551, 535, | |
+ 530, 529, 552, 534, 560, 553, 554, 555, 556, 856, | |
+ 557, 531, 410, 411, 532, 559, 855, 517, 517, 517, | |
+ 517, 517, 517, 1106, 561, 562, 563, 565, 536, 537, | |
+ 538, 539, 552, 560, 540, 553, 554, 555, 556, 541, | |
+ 557, 564, 567, 542, 568, 559, 543, 854, 544, 569, | |
+ 853, 545, 570, 561, 571, 562, 563, 565, 536, 537, | |
+ 538, 539, 572, 573, 540, 574, 575, 576, 577, 541, | |
+ 564, 578, 567, 542, 568, 543, 581, 544, 582, 569, | |
+ | |
+ 545, 579, 570, 583, 571, 584, 585, 580, 586, 587, | |
+ 606, 588, 572, 573, 589, 574, 575, 576, 577, 590, | |
+ 591, 578, 592, 593, 852, 594, 581, 582, 598, 851, | |
+ 595, 579, 583, 596, 597, 584, 585, 580, 586, 587, | |
+ 588, 500, 602, 600, 589, 503, 391, 603, 392, 590, | |
+ 591, 619, 592, 593, 594, 604, 499, 500, 598, 501, | |
+ 595, 608, 596, 597, 601, 500, 599, 501, 600, 410, | |
+ 411, 259, 602, 502, 502, 502, 502, 603, 410, 411, | |
+ 619, 502, 502, 502, 502, 604, 601, 500, 850, 501, | |
+ 607, 608, 409, 409, 848, 409, 409, 409, 409, 409, | |
+ | |
+ 409, 409, 409, 409, 409, 409, 409, 409, 409, 409, | |
+ 409, 409, 409, 409, 409, 409, 409, 409, 409, 609, | |
+ 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, | |
+ 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, | |
+ 609, 609, 609, 609, 410, 411, 613, 610, 409, 609, | |
+ 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, | |
+ 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, | |
+ 609, 609, 609, 409, 409, 409, 611, 611, 616, 409, | |
+ 524, 524, 614, 614, 524, 524, 524, 845, 617, 618, | |
+ 623, 828, 696, 697, 524, 698, 524, 625, 621, 626, | |
+ | |
+ 622, 775, 629, 776, 817, 624, 524, 700, 616, 628, | |
+ 410, 411, 612, 612, 612, 612, 410, 411, 617, 618, | |
+ 623, 612, 612, 612, 612, 612, 612, 625, 621, 626, | |
+ 622, 524, 629, 627, 624, 806, 524, 524, 524, 628, | |
+ 409, 524, 630, 781, 632, 644, 643, 524, 524, 636, | |
+ 780, 612, 612, 612, 612, 612, 612, 615, 615, 615, | |
+ 615, 631, 627, 633, 634, 524, 615, 615, 615, 615, | |
+ 615, 615, 630, 524, 632, 644, 643, 779, 646, 636, | |
+ 524, 645, 647, 635, 524, 649, 524, 524, 650, 651, | |
+ 652, 631, 653, 633, 634, 637, 615, 615, 615, 615, | |
+ | |
+ 615, 615, 639, 638, 697, 640, 641, 642, 646, 654, | |
+ 645, 647, 656, 635, 649, 655, 658, 650, 657, 651, | |
+ 652, 659, 606, 660, 637, 661, 662, 692, 664, 665, | |
+ 669, 639, 667, 638, 640, 668, 641, 642, 670, 654, | |
+ 671, 672, 656, 673, 675, 655, 658, 657, 674, 676, | |
+ 677, 659, 660, 678, 661, 679, 662, 664, 680, 665, | |
+ 669, 667, 681, 683, 668, 682, 684, 670, 685, 687, | |
+ 671, 672, 686, 673, 675, 688, 690, 674, 676, 677, | |
+ 693, 689, 691, 678, 694, 679, 695, 703, 680, 701, | |
+ 701, 705, 681, 683, 682, 684, 524, 524, 685, 687, | |
+ | |
+ 706, 686, 607, 768, 524, 688, 690, 410, 411, 693, | |
+ 689, 524, 691, 524, 694, 695, 708, 703, 524, 710, | |
+ 705, 707, 524, 410, 411, 702, 702, 702, 702, 709, | |
+ 706, 711, 524, 712, 702, 702, 702, 702, 702, 702, | |
+ 714, 713, 524, 524, 524, 524, 708, 764, 710, 715, | |
+ 707, 716, 717, 524, 524, 775, 718, 776, 721, 709, | |
+ 524, 711, 524, 712, 702, 702, 702, 702, 702, 702, | |
+ 714, 713, 719, 723, 720, 524, 524, 524, 524, 715, | |
+ 724, 716, 717, 524, 722, 524, 718, 524, 721, 726, | |
+ 728, 752, 731, 732, 734, 727, 730, 748, 733, 736, | |
+ | |
+ 741, 738, 719, 723, 720, 725, 735, 729, 743, 740, | |
+ 724, 739, 742, 722, 744, 745, 746, 747, 749, 726, | |
+ 728, 731, 750, 732, 734, 727, 730, 733, 751, 736, | |
+ 741, 738, 753, 754, 725, 755, 735, 729, 740, 756, | |
+ 739, 757, 742, 744, 758, 745, 746, 747, 749, 759, | |
+ 761, 750, 760, 762, 763, 765, 766, 767, 751, 769, | |
+ 770, 753, 754, 771, 755, 772, 773, 777, 778, 756, | |
+ 757, 696, 697, 758, 698, 410, 411, 409, 524, 759, | |
+ 761, 760, 762, 524, 763, 765, 766, 767, 524, 769, | |
+ 770, 524, 771, 410, 411, 772, 773, 777, 778, 524, | |
+ | |
+ 782, 524, 786, 784, 783, 524, 524, 785, 524, 524, | |
+ 524, 524, 524, 787, 524, 791, 524, 524, 524, 363, | |
+ 363, 807, 793, 737, 795, 802, 524, 788, 796, 524, | |
+ 782, 786, 789, 784, 783, 790, 792, 785, 524, 797, | |
+ 524, 794, 798, 787, 524, 791, 799, 800, 524, 804, | |
+ 524, 807, 793, 808, 795, 802, 788, 803, 796, 805, | |
+ 811, 789, 801, 809, 790, 792, 812, 813, 797, 814, | |
+ 794, 815, 798, 810, 704, 816, 799, 800, 818, 804, | |
+ 819, 820, 808, 821, 822, 823, 825, 803, 824, 805, | |
+ 811, 826, 801, 809, 827, 829, 812, 813, 814, 830, | |
+ | |
+ 815, 831, 838, 810, 816, 839, 846, 775, 818, 776, | |
+ 819, 820, 849, 821, 822, 823, 825, 824, 847, 524, | |
+ 917, 826, 918, 827, 864, 829, 832, 833, 524, 830, | |
+ 831, 834, 838, 524, 835, 839, 846, 836, 840, 841, | |
+ 524, 849, 837, 842, 524, 878, 843, 524, 847, 844, | |
+ 863, 524, 862, 524, 864, 865, 832, 833, 524, 868, | |
+ 866, 834, 524, 524, 835, 524, 875, 836, 840, 841, | |
+ 876, 837, 872, 842, 878, 867, 843, 870, 524, 844, | |
+ 863, 862, 871, 880, 869, 865, 882, 873, 877, 868, | |
+ 866, 874, 879, 881, 409, 883, 875, 884, 699, 885, | |
+ | |
+ 876, 886, 872, 887, 867, 888, 870, 889, 890, 891, | |
+ 892, 871, 880, 869, 894, 882, 873, 895, 877, 896, | |
+ 902, 874, 879, 881, 883, 901, 893, 884, 885, 903, | |
+ 904, 886, 887, 905, 907, 888, 906, 889, 890, 891, | |
+ 892, 897, 692, 911, 894, 898, 895, 912, 899, 896, | |
+ 902, 915, 943, 908, 901, 893, 909, 524, 900, 903, | |
+ 904, 944, 946, 905, 907, 906, 910, 945, 947, 948, | |
+ 950, 897, 911, 949, 951, 898, 912, 952, 899, 953, | |
+ 915, 942, 943, 908, 954, 955, 909, 900, 956, 666, | |
+ 957, 944, 946, 958, 959, 910, 945, 960, 947, 948, | |
+ | |
+ 950, 961, 949, 962, 951, 963, 964, 952, 965, 953, | |
+ 942, 966, 967, 954, 968, 955, 969, 971, 956, 957, | |
+ 970, 972, 973, 958, 959, 974, 975, 960, 976, 979, | |
+ 961, 977, 917, 962, 918, 963, 964, 917, 965, 918, | |
+ 966, 967, 993, 994, 968, 995, 969, 971, 978, 970, | |
+ 996, 972, 973, 997, 974, 975, 998, 976, 979, 999, | |
+ 1000, 977, 1001, 663, 1002, 1003, 1004, 648, 1005, 1006, | |
+ 1007, 993, 1008, 994, 1009, 995, 1010, 978, 1011, 1012, | |
+ 996, 1013, 1014, 997, 1015, 1016, 998, 1017, 1018, 999, | |
+ 1000, 1019, 1001, 1002, 1003, 1020, 1004, 1005, 1021, 1006, | |
+ | |
+ 1007, 1008, 1022, 1009, 1025, 1010, 1023, 1026, 1011, 1012, | |
+ 1024, 1013, 1014, 1015, 1016, 1028, 1017, 1029, 1018, 1030, | |
+ 1031, 1019, 1032, 1033, 1034, 1020, 1035, 1036, 1021, 1037, | |
+ 1038, 1022, 1039, 1025, 1040, 1023, 1041, 1026, 1042, 1024, | |
+ 1043, 1044, 1045, 1046, 1047, 1028, 1048, 1029, 1030, 1049, | |
+ 1031, 1032, 1033, 1034, 1050, 1057, 1035, 1036, 1037, 1038, | |
+ 1051, 1052, 1039, 1053, 1040, 1054, 1041, 1055, 1042, 1056, | |
+ 1043, 1044, 1045, 1046, 1047, 1048, 1058, 1059, 1060, 1049, | |
+ 1061, 620, 1062, 1063, 1050, 1057, 1064, 1065, 1066, 1051, | |
+ 1052, 1067, 1053, 1068, 1054, 1069, 1055, 1070, 1056, 1071, | |
+ | |
+ 1072, 1073, 1074, 1075, 409, 1076, 1058, 1059, 1060, 1077, | |
+ 1061, 1062, 1078, 1063, 1079, 1080, 1064, 1065, 1066, 1081, | |
+ 1067, 1082, 1083, 1068, 1084, 1069, 1085, 1070, 1086, 1071, | |
+ 1072, 1073, 1074, 1075, 1076, 1087, 1088, 1089, 1077, 1090, | |
+ 1091, 1092, 1078, 1079, 1093, 1080, 1094, 566, 1095, 1081, | |
+ 1082, 1096, 1083, 1097, 1084, 1098, 1085, 1099, 1086, 1100, | |
+ 1101, 524, 1102, 1103, 1104, 1087, 1088, 1089, 1090, 1091, | |
+ 1105, 1092, 416, 1093, 416, 420, 1094, 1095, 391, 518, | |
+ 1096, 518, 1097, 378, 457, 1098, 342, 1099, 1100, 339, | |
+ 1101, 1102, 1103, 336, 1104, 301, 299, 301, 296, 286, | |
+ | |
+ 1105, 62, 62, 62, 62, 62, 62, 62, 62, 62, | |
+ 62, 62, 62, 62, 62, 62, 62, 62, 82, 82, | |
+ 82, 82, 82, 82, 82, 82, 82, 82, 82, 82, | |
+ 82, 82, 82, 82, 82, 85, 85, 85, 85, 85, | |
+ 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, | |
+ 85, 85, 88, 88, 88, 88, 88, 88, 88, 88, | |
+ 88, 88, 88, 88, 88, 88, 88, 88, 88, 92, | |
+ 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, | |
+ 92, 92, 92, 92, 92, 92, 100, 100, 100, 100, | |
+ 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, | |
+ | |
+ 100, 100, 100, 50, 50, 50, 50, 50, 50, 50, | |
+ 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, | |
+ 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, | |
+ 112, 112, 112, 112, 112, 112, 112, 118, 118, 118, | |
+ 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, | |
+ 118, 118, 118, 118, 123, 123, 123, 123, 123, 123, | |
+ 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, | |
+ 123, 127, 127, 127, 127, 127, 127, 127, 127, 127, | |
+ 127, 127, 127, 127, 127, 127, 127, 127, 147, 147, | |
+ 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, | |
+ | |
+ 147, 147, 147, 147, 147, 150, 150, 150, 150, 150, | |
+ 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, | |
+ 150, 150, 156, 156, 156, 156, 156, 156, 156, 156, | |
+ 156, 156, 156, 156, 156, 156, 156, 156, 156, 161, | |
+ 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, | |
+ 161, 161, 161, 161, 161, 161, 200, 200, 200, 200, | |
+ 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, | |
+ 200, 200, 200, 204, 204, 204, 204, 204, 204, 204, | |
+ 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, | |
+ 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, | |
+ | |
+ 220, 220, 220, 220, 220, 220, 220, 224, 224, 224, | |
+ 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, | |
+ 224, 224, 224, 224, 231, 231, 282, 231, 231, 423, | |
+ 422, 421, 231, 237, 237, 237, 237, 237, 237, 237, | |
+ 237, 237, 237, 237, 237, 237, 237, 237, 237, 248, | |
+ 248, 270, 248, 248, 420, 418, 417, 248, 259, 407, | |
+ 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, | |
+ 259, 259, 259, 259, 259, 262, 254, 262, 262, 262, | |
+ 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, | |
+ 262, 262, 268, 268, 268, 403, 268, 268, 250, 233, | |
+ | |
+ 229, 268, 280, 386, 280, 280, 280, 280, 280, 280, | |
+ 280, 280, 280, 280, 280, 280, 280, 280, 280, 281, | |
+ 385, 281, 281, 281, 281, 281, 281, 281, 281, 281, | |
+ 281, 281, 281, 281, 281, 281, 285, 285, 285, 285, | |
+ 285, 285, 285, 285, 285, 285, 285, 285, 384, 285, | |
+ 382, 285, 285, 295, 381, 380, 295, 295, 295, 295, | |
+ 295, 295, 295, 295, 295, 295, 295, 295, 295, 295, | |
+ 303, 303, 378, 303, 303, 342, 340, 339, 303, 308, | |
+ 338, 308, 308, 308, 308, 308, 308, 308, 308, 308, | |
+ 308, 308, 308, 308, 308, 308, 311, 337, 311, 311, | |
+ | |
+ 311, 311, 311, 311, 311, 311, 311, 311, 311, 311, | |
+ 317, 311, 311, 312, 336, 312, 335, 331, 312, 312, | |
+ 312, 312, 312, 329, 328, 327, 312, 314, 326, 314, | |
+ 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, | |
+ 314, 314, 314, 314, 318, 318, 322, 318, 318, 321, | |
+ 317, 313, 318, 323, 323, 323, 323, 323, 323, 323, | |
+ 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, | |
+ 330, 307, 330, 310, 330, 330, 330, 330, 330, 330, | |
+ 330, 330, 330, 307, 330, 330, 330, 332, 306, 332, | |
+ 332, 332, 332, 332, 332, 332, 332, 332, 332, 332, | |
+ | |
+ 332, 332, 332, 332, 341, 304, 341, 341, 341, 341, | |
+ 341, 341, 341, 341, 341, 341, 341, 341, 341, 341, | |
+ 341, 345, 345, 302, 299, 345, 345, 377, 301, 377, | |
+ 377, 377, 377, 377, 377, 377, 377, 377, 377, 377, | |
+ 377, 377, 377, 377, 383, 297, 383, 383, 383, 296, | |
+ 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, | |
+ 383, 231, 231, 294, 231, 231, 293, 292, 289, 231, | |
+ 388, 288, 388, 388, 388, 388, 388, 388, 388, 388, | |
+ 388, 388, 388, 388, 388, 388, 388, 389, 287, 389, | |
+ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, | |
+ | |
+ 389, 389, 389, 389, 397, 397, 286, 282, 279, 397, | |
+ 399, 399, 278, 270, 258, 399, 400, 400, 400, 400, | |
+ 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, | |
+ 400, 400, 400, 248, 248, 257, 248, 248, 256, 250, | |
+ 247, 248, 404, 404, 404, 404, 404, 404, 404, 404, | |
+ 404, 404, 404, 404, 404, 404, 404, 404, 404, 409, | |
+ 233, 409, 409, 409, 409, 409, 409, 409, 409, 409, | |
+ 409, 409, 409, 229, 409, 409, 259, 1106, 259, 259, | |
+ 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, | |
+ 259, 259, 259, 419, 419, 111, 419, 419, 111, 1106, | |
+ | |
+ 1106, 419, 419, 424, 1106, 424, 424, 424, 424, 424, | |
+ 424, 424, 424, 424, 424, 424, 424, 424, 424, 424, | |
+ 280, 1106, 280, 280, 280, 280, 280, 280, 280, 280, | |
+ 280, 280, 280, 280, 280, 280, 280, 281, 1106, 281, | |
+ 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, | |
+ 281, 281, 281, 281, 426, 1106, 426, 426, 426, 426, | |
+ 426, 426, 426, 426, 426, 426, 426, 426, 426, 426, | |
+ 426, 427, 1106, 427, 427, 427, 427, 427, 427, 427, | |
+ 427, 427, 427, 427, 427, 427, 427, 427, 285, 285, | |
+ 285, 285, 285, 285, 285, 285, 285, 285, 285, 285, | |
+ | |
+ 1106, 285, 1106, 285, 285, 430, 430, 430, 430, 430, | |
+ 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, | |
+ 430, 430, 295, 1106, 1106, 295, 295, 295, 295, 295, | |
+ 295, 295, 295, 295, 295, 295, 295, 295, 295, 303, | |
+ 303, 1106, 303, 303, 1106, 1106, 1106, 303, 312, 1106, | |
+ 312, 1106, 1106, 312, 312, 312, 312, 312, 1106, 1106, | |
+ 1106, 312, 314, 1106, 314, 314, 314, 314, 314, 314, | |
+ 314, 314, 314, 314, 314, 314, 314, 314, 314, 318, | |
+ 318, 1106, 318, 318, 1106, 1106, 1106, 318, 323, 323, | |
+ 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, | |
+ | |
+ 323, 323, 323, 323, 323, 330, 1106, 330, 1106, 330, | |
+ 330, 330, 330, 330, 330, 330, 330, 330, 1106, 330, | |
+ 330, 330, 447, 1106, 447, 447, 447, 447, 447, 447, | |
+ 447, 447, 447, 447, 447, 447, 447, 447, 447, 341, | |
+ 1106, 341, 341, 341, 341, 341, 341, 341, 341, 341, | |
+ 341, 341, 341, 341, 341, 341, 345, 345, 1106, 1106, | |
+ 345, 345, 377, 1106, 377, 377, 377, 377, 377, 377, | |
+ 377, 377, 377, 377, 377, 377, 377, 377, 377, 383, | |
+ 1106, 383, 383, 383, 1106, 383, 383, 383, 383, 383, | |
+ 383, 383, 383, 383, 383, 383, 388, 1106, 388, 388, | |
+ | |
+ 388, 388, 388, 388, 388, 388, 388, 388, 388, 388, | |
+ 388, 388, 388, 389, 1106, 389, 389, 389, 389, 389, | |
+ 389, 389, 389, 389, 389, 389, 389, 389, 389, 389, | |
+ 498, 498, 498, 498, 498, 498, 498, 498, 498, 498, | |
+ 498, 498, 498, 498, 498, 498, 498, 507, 507, 1106, | |
+ 507, 507, 1106, 1106, 1106, 507, 509, 509, 1106, 509, | |
+ 509, 1106, 1106, 1106, 509, 400, 400, 400, 400, 400, | |
+ 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, | |
+ 400, 400, 404, 404, 404, 404, 404, 404, 404, 404, | |
+ 404, 404, 404, 404, 404, 404, 404, 404, 404, 409, | |
+ | |
+ 1106, 409, 409, 409, 409, 409, 409, 409, 409, 409, | |
+ 409, 409, 409, 1106, 409, 409, 419, 419, 1106, 419, | |
+ 419, 1106, 1106, 1106, 419, 419, 424, 1106, 424, 424, | |
+ 424, 424, 424, 424, 424, 424, 424, 424, 424, 424, | |
+ 424, 424, 424, 426, 1106, 426, 426, 426, 426, 426, | |
+ 426, 426, 426, 426, 426, 426, 426, 426, 426, 426, | |
+ 427, 1106, 427, 427, 427, 427, 427, 427, 427, 427, | |
+ 427, 427, 427, 427, 427, 427, 427, 430, 430, 430, | |
+ 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, | |
+ 430, 430, 430, 430, 437, 437, 437, 318, 318, 1106, | |
+ | |
+ 318, 318, 1106, 1106, 1106, 318, 447, 1106, 447, 447, | |
+ 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, | |
+ 447, 447, 447, 605, 1106, 605, 605, 605, 605, 605, | |
+ 605, 605, 605, 605, 605, 605, 605, 605, 605, 605, | |
+ 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, | |
+ 774, 774, 774, 774, 774, 774, 774, 916, 916, 916, | |
+ 916, 916, 916, 916, 916, 916, 916, 916, 916, 916, | |
+ 916, 916, 916, 916, 49, 1106, 1106, 1106, 1106, 1106, | |
+ 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, | |
+ 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, | |
+ | |
+ 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, | |
+ 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, | |
+ 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, | |
+ 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, | |
+ 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, | |
+ 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106 | |
+ } ; | |
+ | |
+static yyconst flex_int16_t yy_chk[4060] = | |
+ { 0, | |
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
+ 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, | |
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
+ | |
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
+ 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, | |
+ 96, 3, 3, 5, 3, 5, 7, 3, 3, 3, | |
+ 3, 8, 992, 3, 3, 6, 6, 942, 6, 21, | |
+ 3, 941, 6, 3, 9, 126, 9, 11, 11, 96, | |
+ | |
+ 11, 12, 12, 940, 12, 17, 939, 17, 19, 138, | |
+ 19, 19, 27, 20, 27, 20, 20, 17, 22, 3, | |
+ 3, 17, 17, 17, 17, 28, 7, 28, 7, 51, | |
+ 51, 8, 51, 8, 126, 10, 9, 10, 79, 21, | |
+ 21, 10, 21, 9, 9, 87, 9, 87, 3, 3, | |
+ 3, 4, 4, 138, 4, 4, 938, 4, 4, 19, | |
+ 4, 4, 4, 4, 20, 9, 4, 4, 22, 22, | |
+ 95, 22, 9, 4, 73, 73, 4, 10, 23, 37, | |
+ 23, 45, 37, 45, 10, 10, 17, 10, 259, 259, | |
+ 45, 23, 142, 263, 263, 37, 37, 37, 37, 937, | |
+ | |
+ 95, 38, 4, 4, 38, 4, 10, 46, 147, 46, | |
+ 147, 79, 47, 10, 47, 936, 46, 38, 38, 38, | |
+ 38, 142, 47, 55, 55, 149, 55, 149, 23, 23, | |
+ 23, 4, 4, 4, 13, 13, 13, 13, 13, 13, | |
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, | |
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, | |
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, | |
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, | |
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, | |
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, | |
+ | |
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, | |
+ 13, 13, 13, 13, 13, 13, 13, 13, 18, 24, | |
+ 18, 24, 168, 29, 58, 29, 74, 74, 935, 30, | |
+ 18, 30, 24, 29, 18, 18, 18, 18, 31, 30, | |
+ 31, 31, 32, 191, 32, 32, 48, 162, 48, 67, | |
+ 67, 168, 67, 246, 162, 246, 48, 75, 74, 75, | |
+ 141, 58, 75, 75, 75, 75, 167, 176, 177, 24, | |
+ 24, 24, 191, 29, 253, 29, 253, 105, 105, 30, | |
+ 105, 30, 116, 116, 116, 116, 294, 74, 294, 31, | |
+ 141, 58, 323, 32, 323, 934, 167, 176, 177, 18, | |
+ | |
+ 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, | |
+ 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, | |
+ 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, | |
+ 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, | |
+ 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, | |
+ 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, | |
+ 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, | |
+ 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, | |
+ 25, 25, 25, 25, 33, 33, 39, 33, 39, 34, | |
+ 34, 33, 34, 182, 41, 42, 34, 333, 43, 181, | |
+ | |
+ 33, 41, 42, 186, 333, 34, 203, 203, 203, 203, | |
+ 325, 43, 325, 181, 41, 42, 179, 187, 179, 188, | |
+ 314, 43, 179, 182, 41, 42, 43, 33, 194, 41, | |
+ 42, 199, 34, 186, 33, 33, 39, 33, 39, 34, | |
+ 34, 43, 34, 181, 41, 42, 179, 187, 179, 188, | |
+ 43, 179, 933, 41, 42, 43, 33, 194, 41, 42, | |
+ 199, 34, 932, 33, 314, 39, 931, 39, 34, 35, | |
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, | |
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, | |
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, | |
+ | |
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, | |
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, | |
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, | |
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, | |
+ 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, | |
+ 35, 35, 35, 40, 44, 40, 63, 63, 193, 63, | |
+ 122, 122, 347, 63, 183, 76, 76, 44, 76, 125, | |
+ 125, 348, 76, 350, 195, 132, 132, 44, 180, 184, | |
+ 190, 76, 44, 409, 409, 183, 180, 76, 193, 930, | |
+ 190, 347, 122, 196, 183, 197, 198, 44, 873, 184, | |
+ | |
+ 348, 125, 350, 40, 195, 40, 44, 132, 180, 184, | |
+ 190, 44, 236, 189, 183, 244, 180, 189, 235, 76, | |
+ 190, 122, 258, 196, 872, 197, 198, 278, 184, 871, | |
+ 125, 290, 40, 291, 40, 59, 132, 63, 228, 228, | |
+ 192, 228, 236, 189, 260, 244, 76, 189, 232, 232, | |
+ 192, 232, 258, 192, 59, 235, 59, 278, 59, 249, | |
+ 249, 290, 249, 291, 59, 870, 249, 59, 59, 59, | |
+ 192, 59, 59, 59, 260, 260, 869, 59, 298, 298, | |
+ 192, 298, 192, 868, 59, 235, 59, 867, 59, 319, | |
+ 320, 866, 239, 239, 59, 239, 865, 59, 59, 59, | |
+ | |
+ 59, 59, 59, 864, 240, 240, 59, 240, 59, 239, | |
+ 239, 239, 239, 241, 241, 863, 241, 261, 261, 319, | |
+ 320, 240, 240, 240, 240, 242, 242, 352, 242, 343, | |
+ 241, 241, 241, 241, 354, 239, 305, 305, 305, 305, | |
+ 249, 344, 242, 242, 242, 242, 346, 862, 355, 261, | |
+ 269, 269, 349, 269, 241, 357, 352, 269, 353, 343, | |
+ 346, 356, 353, 354, 239, 242, 269, 358, 861, 349, | |
+ 359, 344, 269, 360, 359, 361, 346, 355, 261, 362, | |
+ 364, 366, 349, 367, 241, 357, 368, 369, 353, 346, | |
+ 356, 371, 353, 372, 371, 242, 368, 358, 349, 374, | |
+ | |
+ 359, 375, 360, 359, 269, 361, 415, 415, 362, 364, | |
+ 366, 400, 367, 400, 614, 614, 368, 369, 402, 860, | |
+ 402, 371, 859, 372, 371, 368, 858, 387, 374, 394, | |
+ 375, 269, 307, 307, 307, 307, 307, 307, 307, 307, | |
+ 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, | |
+ 307, 307, 307, 307, 307, 307, 307, 387, 394, 404, | |
+ 307, 404, 307, 307, 307, 307, 307, 307, 307, 307, | |
+ 307, 307, 307, 307, 307, 307, 307, 307, 307, 307, | |
+ 307, 307, 307, 307, 307, 307, 370, 373, 390, 390, | |
+ 370, 390, 395, 396, 373, 370, 379, 379, 379, 379, | |
+ | |
+ 398, 406, 430, 406, 430, 390, 390, 390, 390, 408, | |
+ 410, 857, 423, 411, 411, 856, 370, 373, 448, 855, | |
+ 370, 395, 854, 396, 373, 370, 376, 425, 376, 428, | |
+ 398, 376, 376, 393, 393, 853, 393, 376, 376, 408, | |
+ 410, 410, 423, 376, 376, 411, 429, 448, 376, 411, | |
+ 393, 393, 393, 393, 852, 376, 376, 425, 376, 428, | |
+ 851, 376, 376, 420, 420, 420, 420, 376, 376, 432, | |
+ 847, 432, 376, 376, 411, 846, 429, 376, 412, 412, | |
+ 792, 412, 412, 412, 412, 412, 412, 412, 412, 412, | |
+ 412, 412, 412, 412, 412, 412, 412, 412, 412, 412, | |
+ | |
+ 412, 412, 412, 412, 412, 412, 412, 412, 412, 412, | |
+ 412, 412, 412, 412, 412, 412, 412, 412, 412, 412, | |
+ 412, 412, 412, 412, 412, 412, 412, 412, 412, 412, | |
+ 412, 412, 791, 412, 412, 412, 412, 412, 412, 412, | |
+ 412, 412, 412, 412, 412, 412, 412, 412, 412, 412, | |
+ 412, 412, 412, 412, 412, 412, 412, 412, 412, 412, | |
+ 412, 412, 413, 413, 445, 446, 441, 433, 434, 435, | |
+ 438, 439, 436, 442, 449, 459, 450, 498, 790, 498, | |
+ 440, 443, 789, 433, 434, 436, 441, 435, 451, 443, | |
+ 439, 788, 438, 442, 445, 446, 413, 413, 414, 414, | |
+ | |
+ 414, 414, 440, 449, 459, 440, 450, 414, 414, 414, | |
+ 414, 414, 414, 433, 434, 436, 441, 435, 451, 443, | |
+ 439, 438, 452, 442, 462, 453, 454, 455, 456, 787, | |
+ 458, 440, 414, 414, 440, 460, 786, 414, 414, 414, | |
+ 414, 414, 414, 444, 463, 464, 465, 467, 444, 444, | |
+ 444, 444, 452, 462, 444, 453, 454, 455, 456, 444, | |
+ 458, 466, 469, 444, 470, 460, 444, 785, 444, 471, | |
+ 784, 444, 472, 463, 473, 464, 465, 467, 444, 444, | |
+ 444, 444, 474, 475, 444, 476, 477, 478, 479, 444, | |
+ 466, 480, 469, 444, 470, 444, 482, 444, 483, 471, | |
+ | |
+ 444, 481, 472, 484, 473, 485, 486, 481, 487, 488, | |
+ 508, 489, 474, 475, 490, 476, 477, 478, 479, 491, | |
+ 492, 480, 493, 494, 783, 495, 482, 483, 497, 782, | |
+ 496, 481, 484, 496, 496, 485, 486, 481, 487, 488, | |
+ 489, 501, 504, 501, 490, 503, 503, 505, 503, 491, | |
+ 492, 523, 493, 494, 495, 506, 499, 499, 497, 499, | |
+ 496, 510, 496, 496, 502, 502, 600, 502, 600, 613, | |
+ 613, 613, 504, 499, 499, 499, 499, 505, 615, 615, | |
+ 523, 502, 502, 502, 502, 506, 601, 601, 780, 601, | |
+ 508, 510, 511, 511, 773, 511, 511, 511, 511, 511, | |
+ | |
+ 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, | |
+ 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, | |
+ 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, | |
+ 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, | |
+ 511, 511, 511, 511, 511, 511, 514, 511, 511, 511, | |
+ 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, | |
+ 511, 511, 511, 511, 511, 511, 511, 511, 511, 511, | |
+ 511, 511, 511, 511, 511, 511, 512, 512, 520, 514, | |
+ 525, 527, 516, 516, 532, 526, 528, 770, 521, 522, | |
+ 526, 758, 607, 607, 529, 607, 531, 528, 525, 529, | |
+ | |
+ 525, 693, 532, 693, 744, 527, 530, 609, 520, 531, | |
+ 512, 512, 513, 513, 513, 513, 516, 516, 521, 522, | |
+ 526, 513, 513, 513, 513, 513, 513, 528, 525, 529, | |
+ 525, 535, 532, 530, 527, 733, 539, 533, 545, 531, | |
+ 609, 534, 533, 704, 535, 546, 545, 536, 537, 539, | |
+ 703, 513, 513, 513, 513, 513, 513, 517, 517, 517, | |
+ 517, 534, 530, 536, 537, 538, 517, 517, 517, 517, | |
+ 517, 517, 533, 540, 535, 546, 545, 699, 550, 539, | |
+ 542, 547, 551, 538, 541, 553, 543, 544, 554, 555, | |
+ 556, 534, 557, 536, 537, 540, 517, 517, 517, 517, | |
+ | |
+ 517, 517, 542, 541, 698, 542, 543, 544, 550, 557, | |
+ 547, 551, 558, 538, 553, 557, 560, 554, 559, 555, | |
+ 556, 563, 606, 564, 540, 565, 566, 692, 569, 570, | |
+ 574, 542, 572, 541, 542, 573, 543, 544, 576, 557, | |
+ 577, 578, 558, 579, 581, 557, 560, 559, 580, 582, | |
+ 583, 563, 564, 584, 565, 586, 566, 569, 587, 570, | |
+ 574, 572, 588, 590, 573, 589, 591, 576, 592, 594, | |
+ 577, 578, 593, 579, 581, 595, 596, 580, 582, 583, | |
+ 602, 595, 597, 584, 603, 586, 604, 616, 587, 611, | |
+ 611, 618, 588, 590, 589, 591, 621, 624, 592, 594, | |
+ | |
+ 619, 593, 606, 686, 622, 595, 596, 701, 701, 602, | |
+ 595, 623, 597, 626, 603, 604, 622, 616, 625, 624, | |
+ 618, 621, 628, 611, 611, 612, 612, 612, 612, 623, | |
+ 619, 625, 627, 626, 612, 612, 612, 612, 612, 612, | |
+ 628, 627, 629, 631, 630, 632, 622, 682, 624, 629, | |
+ 621, 630, 631, 634, 633, 774, 632, 774, 634, 623, | |
+ 635, 625, 636, 626, 612, 612, 612, 612, 612, 612, | |
+ 628, 627, 633, 636, 633, 637, 639, 640, 638, 629, | |
+ 637, 630, 631, 643, 635, 641, 632, 642, 634, 639, | |
+ 641, 668, 644, 645, 648, 640, 643, 664, 647, 650, | |
+ | |
+ 655, 653, 633, 636, 633, 638, 648, 642, 658, 654, | |
+ 637, 653, 657, 635, 659, 661, 662, 663, 665, 639, | |
+ 641, 644, 666, 645, 648, 640, 643, 647, 667, 650, | |
+ 655, 653, 669, 670, 638, 671, 648, 642, 654, 673, | |
+ 653, 674, 657, 659, 675, 661, 662, 663, 665, 676, | |
+ 679, 666, 678, 680, 681, 683, 684, 685, 667, 687, | |
+ 688, 669, 670, 689, 671, 690, 691, 694, 695, 673, | |
+ 674, 696, 696, 675, 696, 700, 700, 700, 711, 676, | |
+ 679, 678, 680, 707, 681, 683, 684, 685, 709, 687, | |
+ 688, 710, 689, 702, 702, 690, 691, 694, 695, 708, | |
+ | |
+ 707, 712, 711, 709, 708, 713, 716, 710, 714, 718, | |
+ 721, 715, 720, 712, 717, 716, 719, 722, 727, 1147, | |
+ 1147, 734, 718, 652, 720, 727, 724, 713, 721, 723, | |
+ 707, 711, 714, 709, 708, 715, 717, 710, 725, 722, | |
+ 729, 719, 723, 712, 726, 716, 724, 725, 730, 729, | |
+ 728, 734, 718, 735, 720, 727, 713, 728, 721, 730, | |
+ 738, 714, 726, 737, 715, 717, 739, 740, 722, 741, | |
+ 719, 742, 723, 737, 617, 743, 724, 725, 745, 729, | |
+ 746, 747, 735, 748, 749, 750, 752, 728, 751, 730, | |
+ 738, 754, 726, 737, 756, 760, 739, 740, 741, 761, | |
+ | |
+ 742, 762, 765, 737, 743, 767, 771, 776, 745, 776, | |
+ 746, 747, 778, 748, 749, 750, 752, 751, 772, 795, | |
+ 849, 754, 849, 756, 795, 760, 764, 764, 793, 761, | |
+ 762, 764, 765, 794, 764, 767, 771, 764, 768, 768, | |
+ 796, 778, 764, 768, 797, 809, 768, 799, 772, 768, | |
+ 794, 798, 793, 801, 795, 796, 764, 764, 802, 799, | |
+ 797, 764, 800, 803, 764, 804, 806, 764, 768, 768, | |
+ 807, 764, 803, 768, 809, 798, 768, 801, 805, 768, | |
+ 794, 793, 802, 811, 800, 796, 814, 804, 808, 799, | |
+ 797, 805, 810, 812, 610, 816, 806, 817, 608, 818, | |
+ | |
+ 807, 819, 803, 820, 798, 821, 801, 823, 825, 826, | |
+ 828, 802, 811, 800, 832, 814, 804, 833, 808, 834, | |
+ 837, 805, 810, 812, 816, 836, 828, 817, 818, 838, | |
+ 839, 819, 820, 840, 842, 821, 841, 823, 825, 826, | |
+ 828, 835, 598, 844, 832, 835, 833, 845, 835, 834, | |
+ 837, 848, 875, 843, 836, 828, 843, 874, 835, 838, | |
+ 839, 876, 878, 840, 842, 841, 843, 877, 879, 880, | |
+ 883, 835, 844, 881, 884, 835, 845, 885, 835, 886, | |
+ 848, 874, 875, 843, 888, 889, 843, 835, 890, 571, | |
+ 891, 876, 878, 892, 893, 843, 877, 894, 879, 880, | |
+ | |
+ 883, 895, 881, 897, 884, 898, 899, 885, 900, 886, | |
+ 874, 901, 902, 888, 904, 889, 905, 908, 890, 891, | |
+ 906, 909, 910, 892, 893, 911, 912, 894, 913, 915, | |
+ 895, 914, 916, 897, 916, 898, 899, 918, 900, 918, | |
+ 901, 902, 943, 944, 904, 945, 905, 908, 914, 906, | |
+ 946, 909, 910, 947, 911, 912, 948, 913, 915, 949, | |
+ 950, 914, 951, 568, 952, 953, 954, 552, 955, 956, | |
+ 958, 943, 959, 944, 960, 945, 961, 914, 962, 963, | |
+ 946, 964, 965, 947, 967, 969, 948, 970, 971, 949, | |
+ 950, 972, 951, 952, 953, 973, 954, 955, 975, 956, | |
+ | |
+ 958, 959, 976, 960, 978, 961, 977, 979, 962, 963, | |
+ 977, 964, 965, 967, 969, 993, 970, 994, 971, 995, | |
+ 996, 972, 997, 998, 999, 973, 1001, 1002, 975, 1004, | |
+ 1005, 976, 1006, 978, 1007, 977, 1008, 979, 1009, 977, | |
+ 1010, 1012, 1016, 1017, 1018, 993, 1021, 994, 995, 1022, | |
+ 996, 997, 998, 999, 1023, 1031, 1001, 1002, 1004, 1005, | |
+ 1024, 1025, 1006, 1026, 1007, 1028, 1008, 1029, 1009, 1030, | |
+ 1010, 1012, 1016, 1017, 1018, 1021, 1032, 1033, 1034, 1022, | |
+ 1037, 524, 1039, 1041, 1023, 1031, 1044, 1047, 1048, 1024, | |
+ 1025, 1049, 1026, 1050, 1028, 1051, 1029, 1052, 1030, 1053, | |
+ | |
+ 1054, 1055, 1056, 1058, 515, 1059, 1032, 1033, 1034, 1060, | |
+ 1037, 1039, 1061, 1041, 1063, 1067, 1044, 1047, 1048, 1068, | |
+ 1049, 1069, 1070, 1050, 1072, 1051, 1073, 1052, 1074, 1053, | |
+ 1054, 1055, 1056, 1058, 1059, 1075, 1076, 1077, 1060, 1078, | |
+ 1081, 1083, 1061, 1063, 1084, 1067, 1085, 468, 1086, 1068, | |
+ 1069, 1087, 1070, 1088, 1072, 1090, 1073, 1093, 1074, 1094, | |
+ 1097, 437, 1098, 1099, 1102, 1075, 1076, 1077, 1078, 1081, | |
+ 1103, 1083, 1160, 1084, 1160, 419, 1085, 1086, 392, 1189, | |
+ 1087, 1189, 1088, 377, 351, 1090, 341, 1093, 1094, 339, | |
+ 1097, 1098, 1099, 334, 1102, 301, 300, 299, 296, 285, | |
+ | |
+ 1103, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, | |
+ 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1108, 1108, | |
+ 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, | |
+ 1108, 1108, 1108, 1108, 1108, 1109, 1109, 1109, 1109, 1109, | |
+ 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, | |
+ 1109, 1109, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, | |
+ 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1111, | |
+ 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1111, | |
+ 1111, 1111, 1111, 1111, 1111, 1111, 1112, 1112, 1112, 1112, | |
+ 1112, 1112, 1112, 1112, 1112, 1112, 1112, 1112, 1112, 1112, | |
+ | |
+ 1112, 1112, 1112, 1113, 1113, 1113, 1113, 1113, 1113, 1113, | |
+ 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, 1113, | |
+ 1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114, 1114, | |
+ 1114, 1114, 1114, 1114, 1114, 1114, 1114, 1115, 1115, 1115, | |
+ 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, 1115, | |
+ 1115, 1115, 1115, 1115, 1116, 1116, 1116, 1116, 1116, 1116, | |
+ 1116, 1116, 1116, 1116, 1116, 1116, 1116, 1116, 1116, 1116, | |
+ 1116, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, | |
+ 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1118, 1118, | |
+ 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, 1118, | |
+ | |
+ 1118, 1118, 1118, 1118, 1118, 1119, 1119, 1119, 1119, 1119, | |
+ 1119, 1119, 1119, 1119, 1119, 1119, 1119, 1119, 1119, 1119, | |
+ 1119, 1119, 1120, 1120, 1120, 1120, 1120, 1120, 1120, 1120, | |
+ 1120, 1120, 1120, 1120, 1120, 1120, 1120, 1120, 1120, 1121, | |
+ 1121, 1121, 1121, 1121, 1121, 1121, 1121, 1121, 1121, 1121, | |
+ 1121, 1121, 1121, 1121, 1121, 1121, 1122, 1122, 1122, 1122, | |
+ 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, 1122, | |
+ 1122, 1122, 1122, 1123, 1123, 1123, 1123, 1123, 1123, 1123, | |
+ 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, | |
+ 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1124, | |
+ | |
+ 1124, 1124, 1124, 1124, 1124, 1124, 1124, 1125, 1125, 1125, | |
+ 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, | |
+ 1125, 1125, 1125, 1125, 1126, 1126, 282, 1126, 1126, 274, | |
+ 273, 272, 1126, 1127, 1127, 1127, 1127, 1127, 1127, 1127, | |
+ 1127, 1127, 1127, 1127, 1127, 1127, 1127, 1127, 1127, 1128, | |
+ 1128, 271, 1128, 1128, 268, 266, 265, 1128, 1129, 256, | |
+ 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, | |
+ 1129, 1129, 1129, 1129, 1129, 1130, 255, 1130, 1130, 1130, | |
+ 1130, 1130, 1130, 1130, 1130, 1130, 1130, 1130, 1130, 1130, | |
+ 1130, 1130, 1131, 1131, 1131, 252, 1131, 1131, 251, 234, | |
+ | |
+ 230, 1131, 1132, 227, 1132, 1132, 1132, 1132, 1132, 1132, | |
+ 1132, 1132, 1132, 1132, 1132, 1132, 1132, 1132, 1132, 1133, | |
+ 226, 1133, 1133, 1133, 1133, 1133, 1133, 1133, 1133, 1133, | |
+ 1133, 1133, 1133, 1133, 1133, 1133, 1134, 1134, 1134, 1134, | |
+ 1134, 1134, 1134, 1134, 1134, 1134, 1134, 1134, 222, 1134, | |
+ 208, 1134, 1134, 1135, 207, 206, 1135, 1135, 1135, 1135, | |
+ 1135, 1135, 1135, 1135, 1135, 1135, 1135, 1135, 1135, 1135, | |
+ 1136, 1136, 202, 1136, 1136, 175, 174, 172, 1136, 1137, | |
+ 170, 1137, 1137, 1137, 1137, 1137, 1137, 1137, 1137, 1137, | |
+ 1137, 1137, 1137, 1137, 1137, 1137, 1138, 169, 1138, 1138, | |
+ | |
+ 1138, 1138, 1138, 1138, 1138, 1138, 1138, 1138, 1138, 1138, | |
+ 166, 1138, 1138, 1139, 165, 1139, 164, 158, 1139, 1139, | |
+ 1139, 1139, 1139, 155, 154, 153, 1139, 1140, 152, 1140, | |
+ 1140, 1140, 1140, 1140, 1140, 1140, 1140, 1140, 1140, 1140, | |
+ 1140, 1140, 1140, 1140, 1141, 1141, 144, 1141, 1141, 143, | |
+ 139, 136, 1141, 1142, 1142, 1142, 1142, 1142, 1142, 1142, | |
+ 1142, 1142, 1142, 1142, 1142, 1142, 1142, 1142, 1142, 1142, | |
+ 1143, 131, 1143, 129, 1143, 1143, 1143, 1143, 1143, 1143, | |
+ 1143, 1143, 1143, 124, 1143, 1143, 1143, 1144, 120, 1144, | |
+ 1144, 1144, 1144, 1144, 1144, 1144, 1144, 1144, 1144, 1144, | |
+ | |
+ 1144, 1144, 1144, 1144, 1145, 114, 1145, 1145, 1145, 1145, | |
+ 1145, 1145, 1145, 1145, 1145, 1145, 1145, 1145, 1145, 1145, | |
+ 1145, 1146, 1146, 109, 107, 1146, 1146, 1148, 106, 1148, | |
+ 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, 1148, | |
+ 1148, 1148, 1148, 1148, 1149, 103, 1149, 1149, 1149, 101, | |
+ 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, | |
+ 1149, 1150, 1150, 99, 1150, 1150, 98, 97, 94, 1150, | |
+ 1151, 91, 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1151, | |
+ 1151, 1151, 1151, 1151, 1151, 1151, 1151, 1152, 90, 1152, | |
+ 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, 1152, | |
+ | |
+ 1152, 1152, 1152, 1152, 1153, 1153, 88, 86, 84, 1153, | |
+ 1154, 1154, 80, 78, 72, 1154, 1155, 1155, 1155, 1155, | |
+ 1155, 1155, 1155, 1155, 1155, 1155, 1155, 1155, 1155, 1155, | |
+ 1155, 1155, 1155, 1156, 1156, 71, 1156, 1156, 68, 65, | |
+ 60, 1156, 1157, 1157, 1157, 1157, 1157, 1157, 1157, 1157, | |
+ 1157, 1157, 1157, 1157, 1157, 1157, 1157, 1157, 1157, 1158, | |
+ 57, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, 1158, | |
+ 1158, 1158, 1158, 53, 1158, 1158, 1159, 49, 1159, 1159, | |
+ 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, 1159, | |
+ 1159, 1159, 1159, 1161, 1161, 16, 1161, 1161, 15, 0, | |
+ | |
+ 0, 1161, 1161, 1162, 0, 1162, 1162, 1162, 1162, 1162, | |
+ 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, 1162, | |
+ 1163, 0, 1163, 1163, 1163, 1163, 1163, 1163, 1163, 1163, | |
+ 1163, 1163, 1163, 1163, 1163, 1163, 1163, 1164, 0, 1164, | |
+ 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, | |
+ 1164, 1164, 1164, 1164, 1165, 0, 1165, 1165, 1165, 1165, | |
+ 1165, 1165, 1165, 1165, 1165, 1165, 1165, 1165, 1165, 1165, | |
+ 1165, 1166, 0, 1166, 1166, 1166, 1166, 1166, 1166, 1166, | |
+ 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1166, 1167, 1167, | |
+ 1167, 1167, 1167, 1167, 1167, 1167, 1167, 1167, 1167, 1167, | |
+ | |
+ 0, 1167, 0, 1167, 1167, 1168, 1168, 1168, 1168, 1168, | |
+ 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, 1168, | |
+ 1168, 1168, 1169, 0, 0, 1169, 1169, 1169, 1169, 1169, | |
+ 1169, 1169, 1169, 1169, 1169, 1169, 1169, 1169, 1169, 1170, | |
+ 1170, 0, 1170, 1170, 0, 0, 0, 1170, 1171, 0, | |
+ 1171, 0, 0, 1171, 1171, 1171, 1171, 1171, 0, 0, | |
+ 0, 1171, 1172, 0, 1172, 1172, 1172, 1172, 1172, 1172, | |
+ 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1172, 1173, | |
+ 1173, 0, 1173, 1173, 0, 0, 0, 1173, 1174, 1174, | |
+ 1174, 1174, 1174, 1174, 1174, 1174, 1174, 1174, 1174, 1174, | |
+ | |
+ 1174, 1174, 1174, 1174, 1174, 1175, 0, 1175, 0, 1175, | |
+ 1175, 1175, 1175, 1175, 1175, 1175, 1175, 1175, 0, 1175, | |
+ 1175, 1175, 1176, 0, 1176, 1176, 1176, 1176, 1176, 1176, | |
+ 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1176, 1177, | |
+ 0, 1177, 1177, 1177, 1177, 1177, 1177, 1177, 1177, 1177, | |
+ 1177, 1177, 1177, 1177, 1177, 1177, 1178, 1178, 0, 0, | |
+ 1178, 1178, 1179, 0, 1179, 1179, 1179, 1179, 1179, 1179, | |
+ 1179, 1179, 1179, 1179, 1179, 1179, 1179, 1179, 1179, 1180, | |
+ 0, 1180, 1180, 1180, 0, 1180, 1180, 1180, 1180, 1180, | |
+ 1180, 1180, 1180, 1180, 1180, 1180, 1181, 0, 1181, 1181, | |
+ | |
+ 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, 1181, | |
+ 1181, 1181, 1181, 1182, 0, 1182, 1182, 1182, 1182, 1182, | |
+ 1182, 1182, 1182, 1182, 1182, 1182, 1182, 1182, 1182, 1182, | |
+ 1183, 1183, 1183, 1183, 1183, 1183, 1183, 1183, 1183, 1183, | |
+ 1183, 1183, 1183, 1183, 1183, 1183, 1183, 1184, 1184, 0, | |
+ 1184, 1184, 0, 0, 0, 1184, 1185, 1185, 0, 1185, | |
+ 1185, 0, 0, 0, 1185, 1186, 1186, 1186, 1186, 1186, | |
+ 1186, 1186, 1186, 1186, 1186, 1186, 1186, 1186, 1186, 1186, | |
+ 1186, 1186, 1187, 1187, 1187, 1187, 1187, 1187, 1187, 1187, | |
+ 1187, 1187, 1187, 1187, 1187, 1187, 1187, 1187, 1187, 1188, | |
+ | |
+ 0, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, 1188, | |
+ 1188, 1188, 1188, 0, 1188, 1188, 1190, 1190, 0, 1190, | |
+ 1190, 0, 0, 0, 1190, 1190, 1191, 0, 1191, 1191, | |
+ 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, 1191, | |
+ 1191, 1191, 1191, 1192, 0, 1192, 1192, 1192, 1192, 1192, | |
+ 1192, 1192, 1192, 1192, 1192, 1192, 1192, 1192, 1192, 1192, | |
+ 1193, 0, 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1193, | |
+ 1193, 1193, 1193, 1193, 1193, 1193, 1193, 1194, 1194, 1194, | |
+ 1194, 1194, 1194, 1194, 1194, 1194, 1194, 1194, 1194, 1194, | |
+ 1194, 1194, 1194, 1194, 1195, 1195, 1195, 1196, 1196, 0, | |
+ | |
+ 1196, 1196, 0, 0, 0, 1196, 1197, 0, 1197, 1197, | |
+ 1197, 1197, 1197, 1197, 1197, 1197, 1197, 1197, 1197, 1197, | |
+ 1197, 1197, 1197, 1198, 0, 1198, 1198, 1198, 1198, 1198, | |
+ 1198, 1198, 1198, 1198, 1198, 1198, 1198, 1198, 1198, 1198, | |
+ 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1199, | |
+ 1199, 1199, 1199, 1199, 1199, 1199, 1199, 1200, 1200, 1200, | |
+ 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, 1200, | |
+ 1200, 1200, 1200, 1200, 1106, 1106, 1106, 1106, 1106, 1106, | |
+ 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, | |
+ 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, | |
+ | |
+ 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, | |
+ 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, | |
+ 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, | |
+ 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, | |
+ 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, | |
+ 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106, 1106 | |
+ } ; | |
+ | |
+extern int yy_flex_debug; | |
+int yy_flex_debug = 0; | |
+ | |
+static yy_state_type *yy_state_buf=0, *yy_state_ptr=0; | |
+static char *yy_full_match; | |
+static int yy_lp; | |
+#define REJECT \ | |
+{ \ | |
+*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ \ | |
+yy_cp = (yy_full_match); /* restore poss. backed-over text */ \ | |
+++(yy_lp); \ | |
+goto find_rule; \ | |
+} | |
+ | |
+static int yy_more_flag = 0; | |
+static int yy_more_len = 0; | |
+#define yymore() ((yy_more_flag) = 1) | |
+#define YY_MORE_ADJ (yy_more_len) | |
+#define YY_RESTORE_YY_MORE_OFFSET | |
+char *yytext; | |
+#line 1 "scan.l" | |
+/* scan.l - scanner for flex input -*-C-*- */ | |
+#line 4 "scan.l" | |
+/* Copyright (c) 1990 The Regents of the University of California. */ | |
+/* All rights reserved. */ | |
+ | |
+/* This code is derived from software contributed to Berkeley by */ | |
+/* Vern Paxson. */ | |
+ | |
+/* The United States Government has rights in this work pursuant */ | |
+/* to contract no. DE-AC03-76SF00098 between the United States */ | |
+/* Department of Energy and the University of California. */ | |
+ | |
+/* This file is part of flex. */ | |
+ | |
+/* Redistribution and use in source and binary forms, with or without */ | |
+/* modification, are permitted provided that the following conditions */ | |
+/* are met: */ | |
+ | |
+/* 1. Redistributions of source code must retain the above copyright */ | |
+/* notice, this list of conditions and the following disclaimer. */ | |
+/* 2. Redistributions in binary form must reproduce the above copyright */ | |
+/* notice, this list of conditions and the following disclaimer in the */ | |
+/* documentation and/or other materials provided with the distribution. */ | |
+ | |
+/* Neither the name of the University nor the names of its contributors */ | |
+/* may be used to endorse or promote products derived from this software */ | |
+/* without specific prior written permission. */ | |
+ | |
+/* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR */ | |
+/* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED */ | |
+/* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */ | |
+/* PURPOSE. */ | |
+ | |
+#include "flexdef.h" | |
+#include "parse.h" | |
+extern bool tablesverify, tablesext; | |
+extern int trlcontxt; /* Set in parse.y for each rule. */ | |
+extern const char *escaped_qstart, *escaped_qend; | |
+ | |
+#define ACTION_ECHO add_action( yytext ) | |
+#define ACTION_IFDEF(def, should_define) \ | |
+ { \ | |
+ if ( should_define ) \ | |
+ action_define( def, 1 ); \ | |
+ } | |
+ | |
+#define ACTION_ECHO_QSTART add_action (escaped_qstart) | |
+#define ACTION_ECHO_QEND add_action (escaped_qend) | |
+ | |
+#define ACTION_M4_IFDEF(def, should_define) \ | |
+ do{ \ | |
+ if ( should_define ) \ | |
+ buf_m4_define( &m4defs_buf, def, NULL);\ | |
+ else \ | |
+ buf_m4_undefine( &m4defs_buf, def);\ | |
+ } while(0) | |
+ | |
+#define MARK_END_OF_PROLOG mark_prolog(); | |
+ | |
+#define YY_DECL \ | |
+ int flexscan() | |
+ | |
+#define RETURNCHAR \ | |
+ yylval = (unsigned char) yytext[0]; \ | |
+ return CHAR; | |
+ | |
+#define RETURNNAME \ | |
+ if(yyleng < MAXLINE) \ | |
+ { \ | |
+ strlcpy( nmstr, yytext, sizeof nmstr ); \ | |
+ } \ | |
+ else \ | |
+ { \ | |
+ synerr(_("Input line too long\n")); \ | |
+ FLEX_EXIT(EXIT_FAILURE); \ | |
+ } \ | |
+ return NAME; | |
+ | |
+#define PUT_BACK_STRING(str, start) \ | |
+ for ( i = strlen( str ) - 1; i >= start; --i ) \ | |
+ unput((str)[i]) | |
+ | |
+#define CHECK_REJECT(str) \ | |
+ if ( all_upper( str ) ) \ | |
+ reject = true; | |
+ | |
+#define CHECK_YYMORE(str) \ | |
+ if ( all_lower( str ) ) \ | |
+ yymore_used = true; | |
+ | |
+#define YY_USER_INIT \ | |
+ if ( getenv("POSIXLY_CORRECT") ) \ | |
+ posix_compat = true; | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+ | |
+#line 1979 "scan.c" | |
+ | |
+#define INITIAL 0 | |
+#define SECT2 1 | |
+#define SECT2PROLOG 2 | |
+#define SECT3 3 | |
+#define CODEBLOCK 4 | |
+#define PICKUPDEF 5 | |
+#define SC 6 | |
+#define CARETISBOL 7 | |
+#define NUM 8 | |
+#define QUOTE 9 | |
+#define FIRSTCCL 10 | |
+#define CCL 11 | |
+#define ACTION 12 | |
+#define RECOVER 13 | |
+#define COMMENT 14 | |
+#define ACTION_STRING 15 | |
+#define PERCENT_BRACE_ACTION 16 | |
+#define OPTION 17 | |
+#define LINEDIR 18 | |
+#define CODEBLOCK_MATCH_BRACE 19 | |
+#define GROUP_WITH_PARAMS 20 | |
+#define GROUP_MINUS_PARAMS 21 | |
+#define EXTENDED_COMMENT 22 | |
+#define COMMENT_DISCARD 23 | |
+ | |
+#ifndef YY_NO_UNISTD_H | |
+/* Special case for "unistd.h", since it is non-ANSI. We include it way | |
+ * down here because we want the user's section 1 to have been scanned first. | |
+ * The user has a chance to override it with an option. | |
+ */ | |
+#include <unistd.h> | |
+#endif | |
+ | |
+#ifndef YY_EXTRA_TYPE | |
+#define YY_EXTRA_TYPE void * | |
+#endif | |
+ | |
+static int yy_init_globals (void ); | |
+ | |
+/* Accessor methods to globals. | |
+ These are made visible to non-reentrant scanners for convenience. */ | |
+ | |
+int yylex_destroy (void ); | |
+ | |
+int yyget_debug (void ); | |
+ | |
+void yyset_debug (int debug_flag ); | |
+ | |
+YY_EXTRA_TYPE yyget_extra (void ); | |
+ | |
+void yyset_extra (YY_EXTRA_TYPE user_defined ); | |
+ | |
+FILE *yyget_in (void ); | |
+ | |
+void yyset_in (FILE * in_str ); | |
+ | |
+FILE *yyget_out (void ); | |
+ | |
+void yyset_out (FILE * out_str ); | |
+ | |
+yy_size_t yyget_leng (void ); | |
+ | |
+char *yyget_text (void ); | |
+ | |
+int yyget_lineno (void ); | |
+ | |
+void yyset_lineno (int line_number ); | |
+ | |
+/* Macros after this point can all be overridden by user definitions in | |
+ * section 1. | |
+ */ | |
+ | |
+#ifndef YY_SKIP_YYWRAP | |
+#ifdef __cplusplus | |
+extern "C" int yywrap (void ); | |
+#else | |
+extern int yywrap (void ); | |
+#endif | |
+#endif | |
+ | |
+ static void yyunput (int c,char *buf_ptr ); | |
+ | |
+#ifndef yytext_ptr | |
+static void yy_flex_strncpy (char *,yyconst char *,int ); | |
+#endif | |
+ | |
+#ifdef YY_NEED_STRLEN | |
+static int yy_flex_strlen (yyconst char * ); | |
+#endif | |
+ | |
+#ifndef YY_NO_INPUT | |
+ | |
+#ifdef __cplusplus | |
+static int yyinput (void ); | |
+#else | |
+static int input (void ); | |
+#endif | |
+ | |
+#endif | |
+ | |
+ static int yy_start_stack_ptr = 0; | |
+ static int yy_start_stack_depth = 0; | |
+ static int *yy_start_stack = NULL; | |
+ | |
+ static void yy_push_state (int new_state ); | |
+ | |
+ static void yy_pop_state (void ); | |
+ | |
+/* Amount of stuff to slurp up with each read. */ | |
+#ifndef YY_READ_BUF_SIZE | |
+#define YY_READ_BUF_SIZE 8192 | |
+#endif | |
+ | |
+/* Copy whatever the last rule matched to the standard output. */ | |
+#ifndef ECHO | |
+/* This used to be an fputs(), but since the string might contain NUL's, | |
+ * we now use fwrite(). | |
+ */ | |
+#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) | |
+#endif | |
+ | |
+/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, | |
+ * is returned in "result". | |
+ */ | |
+#ifndef YY_INPUT | |
+#define YY_INPUT(buf,result,max_size) \ | |
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ | |
+ { \ | |
+ int c = '*'; \ | |
+ size_t n; \ | |
+ for ( n = 0; n < max_size && \ | |
+ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ | |
+ buf[n] = (char) c; \ | |
+ if ( c == '\n' ) \ | |
+ buf[n++] = (char) c; \ | |
+ if ( c == EOF && ferror( yyin ) ) \ | |
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \ | |
+ result = n; \ | |
+ } \ | |
+ else \ | |
+ { \ | |
+ errno=0; \ | |
+ while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ | |
+ { \ | |
+ if( errno != EINTR) \ | |
+ { \ | |
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \ | |
+ break; \ | |
+ } \ | |
+ errno=0; \ | |
+ clearerr(yyin); \ | |
+ } \ | |
+ }\ | |
+\ | |
+ | |
+#endif | |
+ | |
+/* No semi-colon after return; correct usage is to write "yyterminate();" - | |
+ * we don't want an extra ';' after the "return" because that will cause | |
+ * some compilers to complain about unreachable statements. | |
+ */ | |
+#ifndef yyterminate | |
+#define yyterminate() return YY_NULL | |
+#endif | |
+ | |
+/* Number of entries by which start-condition stack grows. */ | |
+#ifndef YY_START_STACK_INCR | |
+#define YY_START_STACK_INCR 25 | |
+#endif | |
+ | |
+/* Report a fatal error. */ | |
+#ifndef YY_FATAL_ERROR | |
+#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) | |
+#endif | |
+ | |
+/* end tables serialization structures and prototypes */ | |
+ | |
+/* Default declaration of generated scanner - a define so the user can | |
+ * easily add parameters. | |
+ */ | |
+#ifndef YY_DECL | |
+#define YY_DECL_IS_OURS 1 | |
+ | |
+extern int yylex (void); | |
+ | |
+#define YY_DECL int yylex (void) | |
+#endif /* !YY_DECL */ | |
+ | |
+/* Code executed at the beginning of each rule, after yytext and yyleng | |
+ * have been set up. | |
+ */ | |
+#ifndef YY_USER_ACTION | |
+#define YY_USER_ACTION | |
+#endif | |
+ | |
+/* Code executed at the end of each rule. */ | |
+#ifndef YY_BREAK | |
+#define YY_BREAK break; | |
+#endif | |
+ | |
+#define YY_RULE_SETUP \ | |
+ if ( yyleng > 0 ) \ | |
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ | |
+ (yytext[yyleng - 1] == '\n'); \ | |
+ YY_USER_ACTION | |
+ | |
+/** The main scanner function which does all the work. | |
+ */ | |
+YY_DECL | |
+{ | |
+ register yy_state_type yy_current_state; | |
+ register char *yy_cp, *yy_bp; | |
+ register int yy_act; | |
+ | |
+ if ( !(yy_init) ) | |
+ { | |
+ (yy_init) = 1; | |
+ | |
+#ifdef YY_USER_INIT | |
+ YY_USER_INIT; | |
+#endif | |
+ | |
+ /* Create the reject buffer large enough to save one state per allowed character. */ | |
+ if ( ! (yy_state_buf) ) | |
+ (yy_state_buf) = (yy_state_type *)yyalloc(YY_STATE_BUF_SIZE ); | |
+ if ( ! (yy_state_buf) ) | |
+ YY_FATAL_ERROR( "out of dynamic memory in yylex()" ); | |
+ | |
+ if ( ! (yy_start) ) | |
+ (yy_start) = 1; /* first start state */ | |
+ | |
+ if ( ! yyin ) | |
+ yyin = stdin; | |
+ | |
+ if ( ! yyout ) | |
+ yyout = stdout; | |
+ | |
+ if ( ! YY_CURRENT_BUFFER ) { | |
+ yyensure_buffer_stack (); | |
+ YY_CURRENT_BUFFER_LVALUE = | |
+ yy_create_buffer(yyin,YY_BUF_SIZE ); | |
+ } | |
+ | |
+ yy_load_buffer_state( ); | |
+ } | |
+ | |
+ { | |
+#line 131 "scan.l" | |
+ | |
+ static int bracelevel, didadef, indented_code; | |
+ static int doing_rule_action = false; | |
+ static int option_sense; | |
+ | |
+ int doing_codeblock = false; | |
+ int i, brace_depth=0, brace_start_line=0; | |
+ Char nmdef[MAXLINE]; | |
+ | |
+ | |
+#line 2239 "scan.c" | |
+ | |
+ while ( 1 ) /* loops until end-of-file is reached */ | |
+ { | |
+ (yy_more_len) = 0; | |
+ if ( (yy_more_flag) ) | |
+ { | |
+ (yy_more_len) = (yy_c_buf_p) - (yytext_ptr); | |
+ (yy_more_flag) = 0; | |
+ } | |
+ yy_cp = (yy_c_buf_p); | |
+ | |
+ /* Support of yytext. */ | |
+ *yy_cp = (yy_hold_char); | |
+ | |
+ /* yy_bp points to the position in yy_ch_buf of the start of | |
+ * the current run. | |
+ */ | |
+ yy_bp = yy_cp; | |
+ | |
+ yy_current_state = (yy_start); | |
+ yy_current_state += YY_AT_BOL(); | |
+ | |
+ (yy_state_ptr) = (yy_state_buf); | |
+ *(yy_state_ptr)++ = yy_current_state; | |
+ | |
+yy_match: | |
+ do | |
+ { | |
+ register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; | |
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) | |
+ { | |
+ yy_current_state = (int) yy_def[yy_current_state]; | |
+ if ( yy_current_state >= 1107 ) | |
+ yy_c = yy_meta[(unsigned int) yy_c]; | |
+ } | |
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; | |
+ *(yy_state_ptr)++ = yy_current_state; | |
+ ++yy_cp; | |
+ } | |
+ while ( yy_base[yy_current_state] != 3975 ); | |
+ | |
+yy_find_action: | |
+ yy_current_state = *--(yy_state_ptr); | |
+ (yy_lp) = yy_accept[yy_current_state]; | |
+find_rule: /* we branch to this label when backing up */ | |
+ for ( ; ; ) /* until we find what rule we matched */ | |
+ { | |
+ if ( (yy_lp) && (yy_lp) < yy_accept[yy_current_state + 1] ) | |
+ { | |
+ yy_act = yy_acclist[(yy_lp)]; | |
+ { | |
+ (yy_full_match) = yy_cp; | |
+ break; | |
+ } | |
+ } | |
+ --yy_cp; | |
+ yy_current_state = *--(yy_state_ptr); | |
+ (yy_lp) = yy_accept[yy_current_state]; | |
+ } | |
+ | |
+ YY_DO_BEFORE_ACTION; | |
+ | |
+do_action: /* This label is used only to access EOF actions. */ | |
+ | |
+ switch ( yy_act ) | |
+ { /* beginning of action switch */ | |
+ | |
+case 1: | |
+YY_RULE_SETUP | |
+#line 142 "scan.l" | |
+indented_code = true; BEGIN(CODEBLOCK); | |
+ YY_BREAK | |
+case 2: | |
+YY_RULE_SETUP | |
+#line 143 "scan.l" | |
+ACTION_ECHO; yy_push_state( COMMENT ); | |
+ YY_BREAK | |
+case 3: | |
+YY_RULE_SETUP | |
+#line 144 "scan.l" | |
+yy_push_state( LINEDIR ); | |
+ YY_BREAK | |
+case 4: | |
+YY_RULE_SETUP | |
+#line 145 "scan.l" | |
+return SCDECL; | |
+ YY_BREAK | |
+case 5: | |
+YY_RULE_SETUP | |
+#line 146 "scan.l" | |
+return XSCDECL; | |
+ YY_BREAK | |
+case 6: | |
+/* rule 6 can match eol */ | |
+YY_RULE_SETUP | |
+#line 147 "scan.l" | |
+{ | |
+ ++linenum; | |
+ line_directive_out( (FILE *) 0, 1 ); | |
+ indented_code = false; | |
+ BEGIN(CODEBLOCK); | |
+ } | |
+ YY_BREAK | |
+case 7: | |
+/* rule 7 can match eol */ | |
+YY_RULE_SETUP | |
+#line 153 "scan.l" | |
+{ | |
+ brace_start_line = linenum; | |
+ ++linenum; | |
+ buf_linedir( &top_buf, infilename?infilename:"<stdin>", linenum); | |
+ brace_depth = 1; | |
+ yy_push_state(CODEBLOCK_MATCH_BRACE); | |
+ } | |
+ YY_BREAK | |
+case 8: | |
+YY_RULE_SETUP | |
+#line 161 "scan.l" | |
+synerr( _("malformed '%top' directive") ); | |
+ YY_BREAK | |
+case 9: | |
+YY_RULE_SETUP | |
+#line 163 "scan.l" | |
+/* discard */ | |
+ YY_BREAK | |
+case 10: | |
+YY_RULE_SETUP | |
+#line 165 "scan.l" | |
+{ | |
+ sectnum = 2; | |
+ bracelevel = 0; | |
+ mark_defs1(); | |
+ line_directive_out( (FILE *) 0, 1 ); | |
+ BEGIN(SECT2PROLOG); | |
+ return SECTEND; | |
+ } | |
+ YY_BREAK | |
+case 11: | |
+/* rule 11 can match eol */ | |
+YY_RULE_SETUP | |
+#line 174 "scan.l" | |
+yytext_is_array = false; ++linenum; | |
+ YY_BREAK | |
+case 12: | |
+/* rule 12 can match eol */ | |
+YY_RULE_SETUP | |
+#line 175 "scan.l" | |
+yytext_is_array = true; ++linenum; | |
+ YY_BREAK | |
+case 13: | |
+YY_RULE_SETUP | |
+#line 177 "scan.l" | |
+BEGIN(OPTION); return OPTION_OP; | |
+ YY_BREAK | |
+case 14: | |
+/* rule 14 can match eol */ | |
+YY_RULE_SETUP | |
+#line 179 "scan.l" | |
+++linenum; /* ignore */ | |
+ YY_BREAK | |
+case 15: | |
+/* rule 15 can match eol */ | |
+YY_RULE_SETUP | |
+#line 180 "scan.l" | |
+++linenum; /* ignore */ | |
+ YY_BREAK | |
+/* xgettext: no-c-format */ | |
+case 16: | |
+/* rule 16 can match eol */ | |
+YY_RULE_SETUP | |
+#line 183 "scan.l" | |
+synerr( _( "unrecognized '%' directive" ) ); | |
+ YY_BREAK | |
+case 17: | |
+YY_RULE_SETUP | |
+#line 185 "scan.l" | |
+{ | |
+ if(yyleng < MAXLINE) | |
+ { | |
+ strlcpy( nmstr, yytext, sizeof nmstr ); | |
+ } | |
+ else | |
+ { | |
+ synerr( _("Definition name too long\n")); | |
+ FLEX_EXIT(EXIT_FAILURE); | |
+ } | |
+ | |
+ didadef = false; | |
+ BEGIN(PICKUPDEF); | |
+ } | |
+ YY_BREAK | |
+case 18: | |
+YY_RULE_SETUP | |
+#line 200 "scan.l" | |
+RETURNNAME; | |
+ YY_BREAK | |
+case 19: | |
+/* rule 19 can match eol */ | |
+YY_RULE_SETUP | |
+#line 201 "scan.l" | |
+++linenum; /* allows blank lines in section 1 */ | |
+ YY_BREAK | |
+case 20: | |
+/* rule 20 can match eol */ | |
+YY_RULE_SETUP | |
+#line 202 "scan.l" | |
+ACTION_ECHO; ++linenum; /* maybe end of comment line */ | |
+ YY_BREAK | |
+ | |
+ | |
+case 21: | |
+YY_RULE_SETUP | |
+#line 207 "scan.l" | |
+ACTION_ECHO; yy_pop_state(); | |
+ YY_BREAK | |
+case 22: | |
+YY_RULE_SETUP | |
+#line 208 "scan.l" | |
+ACTION_ECHO; | |
+ YY_BREAK | |
+case 23: | |
+YY_RULE_SETUP | |
+#line 209 "scan.l" | |
+ACTION_ECHO_QSTART; | |
+ YY_BREAK | |
+case 24: | |
+YY_RULE_SETUP | |
+#line 210 "scan.l" | |
+ACTION_ECHO_QEND; | |
+ YY_BREAK | |
+case 25: | |
+YY_RULE_SETUP | |
+#line 211 "scan.l" | |
+ACTION_ECHO; | |
+ YY_BREAK | |
+case 26: | |
+/* rule 26 can match eol */ | |
+YY_RULE_SETUP | |
+#line 212 "scan.l" | |
+++linenum; ACTION_ECHO; | |
+ YY_BREAK | |
+ | |
+ | |
+/* This is the same as COMMENT, but is discarded rather than output. */ | |
+case 27: | |
+YY_RULE_SETUP | |
+#line 217 "scan.l" | |
+yy_pop_state(); | |
+ YY_BREAK | |
+case 28: | |
+YY_RULE_SETUP | |
+#line 218 "scan.l" | |
+; | |
+ YY_BREAK | |
+case 29: | |
+YY_RULE_SETUP | |
+#line 219 "scan.l" | |
+; | |
+ YY_BREAK | |
+case 30: | |
+/* rule 30 can match eol */ | |
+YY_RULE_SETUP | |
+#line 220 "scan.l" | |
+++linenum; | |
+ YY_BREAK | |
+ | |
+ | |
+case 31: | |
+YY_RULE_SETUP | |
+#line 224 "scan.l" | |
+yy_pop_state(); | |
+ YY_BREAK | |
+case 32: | |
+YY_RULE_SETUP | |
+#line 225 "scan.l" | |
+; | |
+ YY_BREAK | |
+case 33: | |
+/* rule 33 can match eol */ | |
+YY_RULE_SETUP | |
+#line 226 "scan.l" | |
+++linenum; | |
+ YY_BREAK | |
+ | |
+ | |
+case 34: | |
+/* rule 34 can match eol */ | |
+YY_RULE_SETUP | |
+#line 230 "scan.l" | |
+yy_pop_state(); | |
+ YY_BREAK | |
+case 35: | |
+YY_RULE_SETUP | |
+#line 231 "scan.l" | |
+linenum = myctoi( yytext ); | |
+ YY_BREAK | |
+case 36: | |
+YY_RULE_SETUP | |
+#line 233 "scan.l" | |
+{ | |
+ flex_free( (void *) infilename ); | |
+ infilename = copy_string( yytext + 1 ); | |
+ infilename[strlen( infilename ) - 1] = '\0'; | |
+ } | |
+ YY_BREAK | |
+case 37: | |
+YY_RULE_SETUP | |
+#line 238 "scan.l" | |
+/* ignore spurious characters */ | |
+ YY_BREAK | |
+ | |
+ | |
+case 38: | |
+/* rule 38 can match eol */ | |
+YY_RULE_SETUP | |
+#line 242 "scan.l" | |
+++linenum; BEGIN(INITIAL); | |
+ YY_BREAK | |
+case 39: | |
+YY_RULE_SETUP | |
+#line 244 "scan.l" | |
+ACTION_ECHO_QSTART; | |
+ YY_BREAK | |
+case 40: | |
+YY_RULE_SETUP | |
+#line 245 "scan.l" | |
+ACTION_ECHO_QEND; | |
+ YY_BREAK | |
+case 41: | |
+YY_RULE_SETUP | |
+#line 246 "scan.l" | |
+ACTION_ECHO; | |
+ YY_BREAK | |
+case 42: | |
+/* rule 42 can match eol */ | |
+YY_RULE_SETUP | |
+#line 248 "scan.l" | |
+{ | |
+ ++linenum; | |
+ ACTION_ECHO; | |
+ if ( indented_code ) | |
+ BEGIN(INITIAL); | |
+ } | |
+ YY_BREAK | |
+ | |
+ | |
+case 43: | |
+YY_RULE_SETUP | |
+#line 257 "scan.l" | |
+{ | |
+ if( --brace_depth == 0){ | |
+ /* TODO: Matched. */ | |
+ yy_pop_state(); | |
+ }else | |
+ buf_strnappend(&top_buf, yytext, yyleng); | |
+ } | |
+ YY_BREAK | |
+case 44: | |
+YY_RULE_SETUP | |
+#line 265 "scan.l" | |
+{ | |
+ brace_depth++; | |
+ buf_strnappend(&top_buf, yytext, yyleng); | |
+ } | |
+ YY_BREAK | |
+case 45: | |
+/* rule 45 can match eol */ | |
+YY_RULE_SETUP | |
+#line 270 "scan.l" | |
+{ | |
+ ++linenum; | |
+ buf_strnappend(&top_buf, yytext, yyleng); | |
+ } | |
+ YY_BREAK | |
+case 46: | |
+YY_RULE_SETUP | |
+#line 275 "scan.l" | |
+buf_strnappend(&top_buf, escaped_qstart, strlen(escaped_qstart)); | |
+ YY_BREAK | |
+case 47: | |
+YY_RULE_SETUP | |
+#line 276 "scan.l" | |
+buf_strnappend(&top_buf, escaped_qend, strlen(escaped_qend)); | |
+ YY_BREAK | |
+case 48: | |
+YY_RULE_SETUP | |
+#line 278 "scan.l" | |
+{ | |
+ buf_strnappend(&top_buf, yytext, yyleng); | |
+ } | |
+ YY_BREAK | |
+case YY_STATE_EOF(CODEBLOCK_MATCH_BRACE): | |
+#line 282 "scan.l" | |
+{ | |
+ linenum = brace_start_line; | |
+ synerr(_("Unmatched '{'")); | |
+ yyterminate(); | |
+ } | |
+ YY_BREAK | |
+ | |
+ | |
+case 49: | |
+YY_RULE_SETUP | |
+#line 291 "scan.l" | |
+/* separates name and definition */ | |
+ YY_BREAK | |
+case 50: | |
+YY_RULE_SETUP | |
+#line 293 "scan.l" | |
+{ | |
+ if(yyleng < MAXLINE) | |
+ { | |
+ strlcpy( (char *) nmdef, yytext, sizeof nmdef ); | |
+ } | |
+ else | |
+ { | |
+ format_synerr( _("Definition value for {%s} too long\n"), nmstr); | |
+ FLEX_EXIT(EXIT_FAILURE); | |
+ } | |
+ /* Skip trailing whitespace. */ | |
+ for ( i = strlen( (char *) nmdef ) - 1; | |
+ i >= 0 && (nmdef[i] == ' ' || nmdef[i] == '\t'); | |
+ --i ) | |
+ ; | |
+ | |
+ nmdef[i + 1] = '\0'; | |
+ | |
+ ndinstal( nmstr, nmdef ); | |
+ didadef = true; | |
+ } | |
+ YY_BREAK | |
+case 51: | |
+/* rule 51 can match eol */ | |
+YY_RULE_SETUP | |
+#line 315 "scan.l" | |
+{ | |
+ if ( ! didadef ) | |
+ synerr( _( "incomplete name definition" ) ); | |
+ BEGIN(INITIAL); | |
+ ++linenum; | |
+ } | |
+ YY_BREAK | |
+ | |
+ | |
+case 52: | |
+/* rule 52 can match eol */ | |
+YY_RULE_SETUP | |
+#line 325 "scan.l" | |
+++linenum; BEGIN(INITIAL); | |
+ YY_BREAK | |
+case 53: | |
+YY_RULE_SETUP | |
+#line 326 "scan.l" | |
+option_sense = true; | |
+ YY_BREAK | |
+case 54: | |
+YY_RULE_SETUP | |
+#line 328 "scan.l" | |
+return '='; | |
+ YY_BREAK | |
+case 55: | |
+YY_RULE_SETUP | |
+#line 330 "scan.l" | |
+option_sense = ! option_sense; | |
+ YY_BREAK | |
+case 56: | |
+YY_RULE_SETUP | |
+#line 332 "scan.l" | |
+csize = option_sense ? 128 : 256; | |
+ YY_BREAK | |
+case 57: | |
+YY_RULE_SETUP | |
+#line 333 "scan.l" | |
+csize = option_sense ? 256 : 128; | |
+ YY_BREAK | |
+case 58: | |
+YY_RULE_SETUP | |
+#line 335 "scan.l" | |
+long_align = option_sense; | |
+ YY_BREAK | |
+case 59: | |
+YY_RULE_SETUP | |
+#line 336 "scan.l" | |
+{ | |
+ ACTION_M4_IFDEF( "M4""_YY_ALWAYS_INTERACTIVE", option_sense ); | |
+ interactive = option_sense; | |
+ } | |
+ YY_BREAK | |
+case 60: | |
+YY_RULE_SETUP | |
+#line 340 "scan.l" | |
+yytext_is_array = option_sense; | |
+ YY_BREAK | |
+case 61: | |
+YY_RULE_SETUP | |
+#line 341 "scan.l" | |
+ansi_func_defs = option_sense; | |
+ YY_BREAK | |
+case 62: | |
+YY_RULE_SETUP | |
+#line 342 "scan.l" | |
+ansi_func_protos = option_sense; | |
+ YY_BREAK | |
+case 63: | |
+YY_RULE_SETUP | |
+#line 343 "scan.l" | |
+backing_up_report = option_sense; | |
+ YY_BREAK | |
+case 64: | |
+YY_RULE_SETUP | |
+#line 344 "scan.l" | |
+interactive = ! option_sense; | |
+ YY_BREAK | |
+case 65: | |
+YY_RULE_SETUP | |
+#line 345 "scan.l" | |
+bison_bridge_lval = option_sense; | |
+ YY_BREAK | |
+case 66: | |
+YY_RULE_SETUP | |
+#line 346 "scan.l" | |
+{ if((bison_bridge_lloc = option_sense)) | |
+ bison_bridge_lval = true; | |
+ } | |
+ YY_BREAK | |
+case 67: | |
+YY_RULE_SETUP | |
+#line 349 "scan.l" | |
+C_plus_plus = option_sense; | |
+ YY_BREAK | |
+case 68: | |
+YY_RULE_SETUP | |
+#line 350 "scan.l" | |
+sf_set_case_ins(!option_sense); | |
+ YY_BREAK | |
+case 69: | |
+YY_RULE_SETUP | |
+#line 351 "scan.l" | |
+sf_set_case_ins(option_sense); | |
+ YY_BREAK | |
+case 70: | |
+YY_RULE_SETUP | |
+#line 352 "scan.l" | |
+ddebug = option_sense; | |
+ YY_BREAK | |
+case 71: | |
+YY_RULE_SETUP | |
+#line 353 "scan.l" | |
+spprdflt = ! option_sense; | |
+ YY_BREAK | |
+case 72: | |
+YY_RULE_SETUP | |
+#line 354 "scan.l" | |
+useecs = option_sense; | |
+ YY_BREAK | |
+case 73: | |
+YY_RULE_SETUP | |
+#line 355 "scan.l" | |
+{ | |
+ useecs = usemecs = false; | |
+ use_read = fullspd = true; | |
+ } | |
+ YY_BREAK | |
+case 74: | |
+YY_RULE_SETUP | |
+#line 359 "scan.l" | |
+{ | |
+ useecs = usemecs = false; | |
+ use_read = fulltbl = true; | |
+ } | |
+ YY_BREAK | |
+case 75: | |
+YY_RULE_SETUP | |
+#line 363 "scan.l" | |
+ACTION_IFDEF("YY_NO_INPUT", ! option_sense); | |
+ YY_BREAK | |
+case 76: | |
+YY_RULE_SETUP | |
+#line 364 "scan.l" | |
+interactive = option_sense; | |
+ YY_BREAK | |
+case 77: | |
+YY_RULE_SETUP | |
+#line 365 "scan.l" | |
+lex_compat = option_sense; | |
+ YY_BREAK | |
+case 78: | |
+YY_RULE_SETUP | |
+#line 366 "scan.l" | |
+posix_compat = option_sense; | |
+ YY_BREAK | |
+case 79: | |
+YY_RULE_SETUP | |
+#line 367 "scan.l" | |
+{ | |
+ ACTION_M4_IFDEF( "M4""_YY_MAIN", option_sense); | |
+ /* Override yywrap */ | |
+ if( option_sense == true ) | |
+ do_yywrap = false; | |
+ } | |
+ YY_BREAK | |
+case 80: | |
+YY_RULE_SETUP | |
+#line 373 "scan.l" | |
+usemecs = option_sense; | |
+ YY_BREAK | |
+case 81: | |
+YY_RULE_SETUP | |
+#line 374 "scan.l" | |
+{ | |
+ ACTION_M4_IFDEF( "M4""_YY_NEVER_INTERACTIVE", option_sense ); | |
+ interactive = !option_sense; | |
+ } | |
+ YY_BREAK | |
+case 82: | |
+YY_RULE_SETUP | |
+#line 378 "scan.l" | |
+performance_report += option_sense ? 1 : -1; | |
+ YY_BREAK | |
+case 83: | |
+YY_RULE_SETUP | |
+#line 379 "scan.l" | |
+yytext_is_array = ! option_sense; | |
+ YY_BREAK | |
+case 84: | |
+YY_RULE_SETUP | |
+#line 380 "scan.l" | |
+use_read = option_sense; | |
+ YY_BREAK | |
+case 85: | |
+YY_RULE_SETUP | |
+#line 381 "scan.l" | |
+reentrant = option_sense; | |
+ YY_BREAK | |
+case 86: | |
+YY_RULE_SETUP | |
+#line 382 "scan.l" | |
+reject_really_used = option_sense; | |
+ YY_BREAK | |
+case 87: | |
+YY_RULE_SETUP | |
+#line 383 "scan.l" | |
+ACTION_M4_IFDEF( "M4""_YY_STACK_USED", option_sense ); | |
+ YY_BREAK | |
+case 88: | |
+YY_RULE_SETUP | |
+#line 384 "scan.l" | |
+do_stdinit = option_sense; | |
+ YY_BREAK | |
+case 89: | |
+YY_RULE_SETUP | |
+#line 385 "scan.l" | |
+use_stdout = option_sense; | |
+ YY_BREAK | |
+case 90: | |
+YY_RULE_SETUP | |
+#line 386 "scan.l" | |
+ACTION_IFDEF("YY_NO_UNISTD_H", ! option_sense); | |
+ YY_BREAK | |
+case 91: | |
+YY_RULE_SETUP | |
+#line 387 "scan.l" | |
+ACTION_M4_IFDEF("M4""_YY_NO_UNPUT", ! option_sense); | |
+ YY_BREAK | |
+case 92: | |
+YY_RULE_SETUP | |
+#line 388 "scan.l" | |
+printstats = option_sense; | |
+ YY_BREAK | |
+case 93: | |
+YY_RULE_SETUP | |
+#line 389 "scan.l" | |
+nowarn = ! option_sense; | |
+ YY_BREAK | |
+case 94: | |
+YY_RULE_SETUP | |
+#line 390 "scan.l" | |
+do_yylineno = option_sense; ACTION_M4_IFDEF("M4""_YY_USE_LINENO", option_sense); | |
+ YY_BREAK | |
+case 95: | |
+YY_RULE_SETUP | |
+#line 391 "scan.l" | |
+yymore_really_used = option_sense; | |
+ YY_BREAK | |
+case 96: | |
+YY_RULE_SETUP | |
+#line 392 "scan.l" | |
+do_yywrap = option_sense; | |
+ YY_BREAK | |
+case 97: | |
+YY_RULE_SETUP | |
+#line 394 "scan.l" | |
+ACTION_M4_IFDEF("M4""_YY_NO_PUSH_STATE", ! option_sense); | |
+ YY_BREAK | |
+case 98: | |
+YY_RULE_SETUP | |
+#line 395 "scan.l" | |
+ACTION_M4_IFDEF("M4""_YY_NO_POP_STATE", ! option_sense); | |
+ YY_BREAK | |
+case 99: | |
+YY_RULE_SETUP | |
+#line 396 "scan.l" | |
+ACTION_M4_IFDEF("M4""_YY_NO_TOP_STATE", ! option_sense); | |
+ YY_BREAK | |
+case 100: | |
+YY_RULE_SETUP | |
+#line 398 "scan.l" | |
+ACTION_M4_IFDEF("M4""_YY_NO_SCAN_BUFFER", ! option_sense); | |
+ YY_BREAK | |
+case 101: | |
+YY_RULE_SETUP | |
+#line 399 "scan.l" | |
+ACTION_M4_IFDEF("M4""_YY_NO_SCAN_BYTES", ! option_sense); | |
+ YY_BREAK | |
+case 102: | |
+YY_RULE_SETUP | |
+#line 400 "scan.l" | |
+ACTION_M4_IFDEF("M4""_YY_NO_SCAN_STRING", ! option_sense); | |
+ YY_BREAK | |
+case 103: | |
+YY_RULE_SETUP | |
+#line 402 "scan.l" | |
+ACTION_M4_IFDEF("M4""_YY_NO_FLEX_ALLOC", ! option_sense); | |
+ YY_BREAK | |
+case 104: | |
+YY_RULE_SETUP | |
+#line 403 "scan.l" | |
+ACTION_M4_IFDEF("M4""_YY_NO_FLEX_REALLOC", ! option_sense); | |
+ YY_BREAK | |
+case 105: | |
+YY_RULE_SETUP | |
+#line 404 "scan.l" | |
+ACTION_M4_IFDEF("M4""_YY_NO_FLEX_FREE", ! option_sense); | |
+ YY_BREAK | |
+case 106: | |
+YY_RULE_SETUP | |
+#line 406 "scan.l" | |
+ACTION_M4_IFDEF("M4""_YY_NO_GET_DEBUG", ! option_sense); | |
+ YY_BREAK | |
+case 107: | |
+YY_RULE_SETUP | |
+#line 407 "scan.l" | |
+ACTION_M4_IFDEF("M4""_YY_NO_SET_DEBUG", ! option_sense); | |
+ YY_BREAK | |
+case 108: | |
+YY_RULE_SETUP | |
+#line 408 "scan.l" | |
+ACTION_M4_IFDEF("M4""_YY_NO_GET_EXTRA", ! option_sense); | |
+ YY_BREAK | |
+case 109: | |
+YY_RULE_SETUP | |
+#line 409 "scan.l" | |
+ACTION_M4_IFDEF("M4""_YY_NO_SET_EXTRA", ! option_sense); | |
+ YY_BREAK | |
+case 110: | |
+YY_RULE_SETUP | |
+#line 410 "scan.l" | |
+ACTION_M4_IFDEF("M4""_YY_NO_GET_LENG", ! option_sense); | |
+ YY_BREAK | |
+case 111: | |
+YY_RULE_SETUP | |
+#line 411 "scan.l" | |
+ACTION_M4_IFDEF("M4""_YY_NO_GET_TEXT", ! option_sense); | |
+ YY_BREAK | |
+case 112: | |
+YY_RULE_SETUP | |
+#line 412 "scan.l" | |
+ACTION_M4_IFDEF("M4""_YY_NO_GET_LINENO", ! option_sense); | |
+ YY_BREAK | |
+case 113: | |
+YY_RULE_SETUP | |
+#line 413 "scan.l" | |
+ACTION_M4_IFDEF("M4""_YY_NO_SET_LINENO", ! option_sense); | |
+ YY_BREAK | |
+case 114: | |
+YY_RULE_SETUP | |
+#line 414 "scan.l" | |
+ACTION_M4_IFDEF("M4""_YY_NO_GET_IN", ! option_sense); | |
+ YY_BREAK | |
+case 115: | |
+YY_RULE_SETUP | |
+#line 415 "scan.l" | |
+ACTION_M4_IFDEF("M4""_YY_NO_SET_IN", ! option_sense); | |
+ YY_BREAK | |
+case 116: | |
+YY_RULE_SETUP | |
+#line 416 "scan.l" | |
+ACTION_M4_IFDEF("M4""_YY_NO_GET_OUT", ! option_sense); | |
+ YY_BREAK | |
+case 117: | |
+YY_RULE_SETUP | |
+#line 417 "scan.l" | |
+ACTION_M4_IFDEF("M4""_YY_NO_SET_OUT", ! option_sense); | |
+ YY_BREAK | |
+case 118: | |
+YY_RULE_SETUP | |
+#line 418 "scan.l" | |
+ACTION_M4_IFDEF("M4""_YY_NO_GET_LVAL", ! option_sense); | |
+ YY_BREAK | |
+case 119: | |
+YY_RULE_SETUP | |
+#line 419 "scan.l" | |
+ACTION_M4_IFDEF("M4""_YY_NO_SET_LVAL", ! option_sense); | |
+ YY_BREAK | |
+case 120: | |
+YY_RULE_SETUP | |
+#line 420 "scan.l" | |
+ACTION_M4_IFDEF("M4""_YY_NO_GET_LLOC", ! option_sense); | |
+ YY_BREAK | |
+case 121: | |
+YY_RULE_SETUP | |
+#line 421 "scan.l" | |
+ACTION_M4_IFDEF("M4""_YY_NO_SET_LLOC", ! option_sense); | |
+ YY_BREAK | |
+case 122: | |
+YY_RULE_SETUP | |
+#line 423 "scan.l" | |
+return OPT_EXTRA_TYPE; | |
+ YY_BREAK | |
+case 123: | |
+YY_RULE_SETUP | |
+#line 424 "scan.l" | |
+return OPT_OUTFILE; | |
+ YY_BREAK | |
+case 124: | |
+YY_RULE_SETUP | |
+#line 425 "scan.l" | |
+return OPT_PREFIX; | |
+ YY_BREAK | |
+case 125: | |
+YY_RULE_SETUP | |
+#line 426 "scan.l" | |
+return OPT_YYCLASS; | |
+ YY_BREAK | |
+case 126: | |
+YY_RULE_SETUP | |
+#line 427 "scan.l" | |
+return OPT_HEADER; | |
+ YY_BREAK | |
+case 127: | |
+YY_RULE_SETUP | |
+#line 428 "scan.l" | |
+return OPT_TABLES; | |
+ YY_BREAK | |
+case 128: | |
+YY_RULE_SETUP | |
+#line 429 "scan.l" | |
+{ | |
+ tablesverify = option_sense; | |
+ if(!tablesext && option_sense) | |
+ tablesext = true; | |
+ } | |
+ YY_BREAK | |
+case 129: | |
+YY_RULE_SETUP | |
+#line 436 "scan.l" | |
+{ | |
+ if(yyleng-1 < MAXLINE) | |
+ { | |
+ strlcpy( nmstr, yytext + 1, sizeof nmstr ); | |
+ } | |
+ else | |
+ { | |
+ synerr( _("Option line too long\n")); | |
+ FLEX_EXIT(EXIT_FAILURE); | |
+ } | |
+ nmstr[strlen( nmstr ) - 1] = '\0'; | |
+ return NAME; | |
+ } | |
+ YY_BREAK | |
+case 130: | |
+YY_RULE_SETUP | |
+#line 450 "scan.l" | |
+{ | |
+ format_synerr( _( "unrecognized %%option: %s" ), | |
+ yytext ); | |
+ BEGIN(RECOVER); | |
+ } | |
+ YY_BREAK | |
+ | |
+case 131: | |
+/* rule 131 can match eol */ | |
+YY_RULE_SETUP | |
+#line 457 "scan.l" | |
+++linenum; BEGIN(INITIAL); | |
+ YY_BREAK | |
+ | |
+case 132: | |
+YY_RULE_SETUP | |
+#line 461 "scan.l" | |
+++bracelevel; yyless( 2 ); /* eat only %{ */ | |
+ YY_BREAK | |
+case 133: | |
+YY_RULE_SETUP | |
+#line 462 "scan.l" | |
+--bracelevel; yyless( 2 ); /* eat only %} */ | |
+ YY_BREAK | |
+case 134: | |
+YY_RULE_SETUP | |
+#line 464 "scan.l" | |
+ACTION_ECHO; /* indented code in prolog */ | |
+ YY_BREAK | |
+case 135: | |
+YY_RULE_SETUP | |
+#line 466 "scan.l" | |
+{ /* non-indented code */ | |
+ if ( bracelevel <= 0 ) | |
+ { /* not in %{ ... %} */ | |
+ yyless( 0 ); /* put it all back */ | |
+ yy_set_bol( 1 ); | |
+ mark_prolog(); | |
+ BEGIN(SECT2); | |
+ } | |
+ else | |
+ ACTION_ECHO; | |
+ } | |
+ YY_BREAK | |
+case 136: | |
+YY_RULE_SETUP | |
+#line 478 "scan.l" | |
+ACTION_ECHO; | |
+ YY_BREAK | |
+case 137: | |
+/* rule 137 can match eol */ | |
+YY_RULE_SETUP | |
+#line 479 "scan.l" | |
+++linenum; ACTION_ECHO; | |
+ YY_BREAK | |
+case YY_STATE_EOF(SECT2PROLOG): | |
+#line 481 "scan.l" | |
+{ | |
+ mark_prolog(); | |
+ sectnum = 0; | |
+ yyterminate(); /* to stop the parser */ | |
+ } | |
+ YY_BREAK | |
+ | |
+ | |
+case 138: | |
+/* rule 138 can match eol */ | |
+YY_RULE_SETUP | |
+#line 489 "scan.l" | |
+++linenum; /* allow blank lines in section 2 */ | |
+ YY_BREAK | |
+case 139: | |
+YY_RULE_SETUP | |
+#line 491 "scan.l" | |
+{ | |
+ indented_code = false; | |
+ doing_codeblock = true; | |
+ bracelevel = 1; | |
+ BEGIN(PERCENT_BRACE_ACTION); | |
+ } | |
+ YY_BREAK | |
+case 140: | |
+YY_RULE_SETUP | |
+#line 498 "scan.l" | |
+{ | |
+ /* Allow "<" to appear in (?x) patterns. */ | |
+ if (!sf_skip_ws()) | |
+ BEGIN(SC); | |
+ return '<'; | |
+ } | |
+ YY_BREAK | |
+case 141: | |
+YY_RULE_SETUP | |
+#line 504 "scan.l" | |
+return '^'; | |
+ YY_BREAK | |
+case 142: | |
+YY_RULE_SETUP | |
+#line 505 "scan.l" | |
+BEGIN(QUOTE); return '"'; | |
+ YY_BREAK | |
+case 143: | |
+*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ | |
+(yy_c_buf_p) = yy_cp = yy_bp + 1; | |
+YY_DO_BEFORE_ACTION; /* set up yytext again */ | |
+YY_RULE_SETUP | |
+#line 506 "scan.l" | |
+{ | |
+ BEGIN(NUM); | |
+ if ( lex_compat || posix_compat ) | |
+ return BEGIN_REPEAT_POSIX; | |
+ else | |
+ return BEGIN_REPEAT_FLEX; | |
+ } | |
+ YY_BREAK | |
+case 144: | |
+/* rule 144 can match eol */ | |
+*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ | |
+YY_LINENO_REWIND_TO(yy_bp + 1); | |
+(yy_c_buf_p) = yy_cp = yy_bp + 1; | |
+YY_DO_BEFORE_ACTION; /* set up yytext again */ | |
+YY_RULE_SETUP | |
+#line 513 "scan.l" | |
+return '$'; | |
+ YY_BREAK | |
+case 145: | |
+YY_RULE_SETUP | |
+#line 515 "scan.l" | |
+{ | |
+ bracelevel = 1; | |
+ BEGIN(PERCENT_BRACE_ACTION); | |
+ | |
+ if ( in_rule ) | |
+ { | |
+ doing_rule_action = true; | |
+ in_rule = false; | |
+ return '\n'; | |
+ } | |
+ } | |
+ YY_BREAK | |
+case 146: | |
+/* rule 146 can match eol */ | |
+YY_RULE_SETUP | |
+#line 526 "scan.l" | |
+{ | |
+ if (sf_skip_ws()){ | |
+ /* We're in the middle of a (?x: ) pattern. */ | |
+ /* Push back everything starting at the "|" */ | |
+ size_t amt; | |
+ amt = strchr (yytext, '|') - yytext; | |
+ yyless(amt); | |
+ } | |
+ else { | |
+ continued_action = true; | |
+ ++linenum; | |
+ return '\n'; | |
+ } | |
+ } | |
+ YY_BREAK | |
+case 147: | |
+YY_RULE_SETUP | |
+#line 541 "scan.l" | |
+{ | |
+ | |
+ if (sf_skip_ws()){ | |
+ /* We're in the middle of a (?x: ) pattern. */ | |
+ yy_push_state(COMMENT_DISCARD); | |
+ } | |
+ else{ | |
+ yyless( yyleng - 2 ); /* put back '/', '*' */ | |
+ bracelevel = 0; | |
+ continued_action = false; | |
+ BEGIN(ACTION); | |
+ } | |
+ } | |
+ YY_BREAK | |
+case 148: | |
+YY_RULE_SETUP | |
+#line 555 "scan.l" | |
+/* allow indented rules */ ; | |
+ YY_BREAK | |
+case 149: | |
+YY_RULE_SETUP | |
+#line 557 "scan.l" | |
+{ | |
+ if (sf_skip_ws()){ | |
+ /* We're in the middle of a (?x: ) pattern. */ | |
+ } | |
+ else{ | |
+ /* This rule is separate from the one below because | |
+ * otherwise we get variable trailing context, so | |
+ * we can't build the scanner using -{f,F}. | |
+ */ | |
+ bracelevel = 0; | |
+ continued_action = false; | |
+ BEGIN(ACTION); | |
+ | |
+ if ( in_rule ) | |
+ { | |
+ doing_rule_action = true; | |
+ in_rule = false; | |
+ return '\n'; | |
+ } | |
+ } | |
+ } | |
+ YY_BREAK | |
+case 150: | |
+/* rule 150 can match eol */ | |
+YY_RULE_SETUP | |
+#line 579 "scan.l" | |
+{ | |
+ if (sf_skip_ws()){ | |
+ /* We're in the middle of a (?x: ) pattern. */ | |
+ ++linenum; | |
+ } | |
+ else{ | |
+ bracelevel = 0; | |
+ continued_action = false; | |
+ BEGIN(ACTION); | |
+ unput( '\n' ); /* so <ACTION> sees it */ | |
+ | |
+ if ( in_rule ) | |
+ { | |
+ doing_rule_action = true; | |
+ in_rule = false; | |
+ return '\n'; | |
+ } | |
+ } | |
+ } | |
+ YY_BREAK | |
+case 151: | |
+#line 600 "scan.l" | |
+case 152: | |
+YY_RULE_SETUP | |
+#line 600 "scan.l" | |
+return EOF_OP; | |
+ YY_BREAK | |
+case 153: | |
+YY_RULE_SETUP | |
+#line 602 "scan.l" | |
+{ | |
+ sectnum = 3; | |
+ BEGIN(SECT3); | |
+ outn("/* Begin user sect3 */"); | |
+ yyterminate(); /* to stop the parser */ | |
+ } | |
+ YY_BREAK | |
+case 154: | |
+YY_RULE_SETUP | |
+#line 609 "scan.l" | |
+{ | |
+ int cclval; | |
+ | |
+ if(yyleng < MAXLINE) | |
+ { | |
+ strlcpy( nmstr, yytext, sizeof nmstr ); | |
+ } | |
+ else | |
+ { | |
+ synerr( _("Input line too long\n")); | |
+ FLEX_EXIT(EXIT_FAILURE); | |
+ } | |
+ | |
+ /* Check to see if we've already encountered this | |
+ * ccl. | |
+ */ | |
+ if (0 /* <--- This "0" effectively disables the reuse of a | |
+ * character class (purely based on its source text). | |
+ * The reason it was disabled is so yacc/bison can parse | |
+ * ccl operations, such as ccl difference and union. | |
+ */ | |
+ && (cclval = ccllookup( (Char *) nmstr )) != 0 ) | |
+ { | |
+ if ( input() != ']' ) | |
+ synerr( _( "bad character class" ) ); | |
+ | |
+ yylval = cclval; | |
+ ++cclreuse; | |
+ return PREVCCL; | |
+ } | |
+ else | |
+ { | |
+ /* We fudge a bit. We know that this ccl will | |
+ * soon be numbered as lastccl + 1 by cclinit. | |
+ */ | |
+ cclinstal( (Char *) nmstr, lastccl + 1 ); | |
+ | |
+ /* Push back everything but the leading bracket | |
+ * so the ccl can be rescanned. | |
+ */ | |
+ yyless( 1 ); | |
+ | |
+ BEGIN(FIRSTCCL); | |
+ return '['; | |
+ } | |
+ } | |
+ YY_BREAK | |
+case 155: | |
+YY_RULE_SETUP | |
+#line 655 "scan.l" | |
+return CCL_OP_DIFF; | |
+ YY_BREAK | |
+case 156: | |
+YY_RULE_SETUP | |
+#line 656 "scan.l" | |
+return CCL_OP_UNION; | |
+ YY_BREAK | |
+/* Check for :space: at the end of the rule so we don't | |
+ * wrap the expanded regex in '(' ')' -- breaking trailing | |
+ * context. | |
+ */ | |
+case 157: | |
+/* rule 157 can match eol */ | |
+YY_RULE_SETUP | |
+#line 663 "scan.l" | |
+{ | |
+ register Char *nmdefptr; | |
+ int end_is_ws, end_ch; | |
+ | |
+ end_ch = yytext[yyleng-1]; | |
+ end_is_ws = end_ch != '}' ? 1 : 0; | |
+ | |
+ if(yyleng-1 < MAXLINE) | |
+ { | |
+ strlcpy( nmstr, yytext + 1, sizeof nmstr ); | |
+ } | |
+ else | |
+ { | |
+ synerr( _("Input line too long\n")); | |
+ FLEX_EXIT(EXIT_FAILURE); | |
+ } | |
+nmstr[yyleng - 2 - end_is_ws] = '\0'; /* chop trailing brace */ | |
+ | |
+ if ( (nmdefptr = ndlookup( nmstr )) == 0 ) | |
+ format_synerr( | |
+ _( "undefined definition {%s}" ), | |
+ nmstr ); | |
+ | |
+ else | |
+ { /* push back name surrounded by ()'s */ | |
+ int len = strlen( (char *) nmdefptr ); | |
+ if (end_is_ws) | |
+ unput(end_ch); | |
+ | |
+ if ( lex_compat || nmdefptr[0] == '^' || | |
+ (len > 0 && nmdefptr[len - 1] == '$') | |
+ || (end_is_ws && trlcontxt && !sf_skip_ws())) | |
+ { /* don't use ()'s after all */ | |
+ PUT_BACK_STRING((char *) nmdefptr, 0); | |
+ | |
+ if ( nmdefptr[0] == '^' ) | |
+ BEGIN(CARETISBOL); | |
+ } | |
+ | |
+ else | |
+ { | |
+ unput(')'); | |
+ PUT_BACK_STRING((char *) nmdefptr, 0); | |
+ unput('('); | |
+ } | |
+ } | |
+ } | |
+ YY_BREAK | |
+case 158: | |
+YY_RULE_SETUP | |
+#line 711 "scan.l" | |
+{ | |
+ if (sf_skip_ws()) | |
+ yy_push_state(COMMENT_DISCARD); | |
+ else{ | |
+ /* Push back the "*" and return "/" as usual. */ | |
+ yyless(1); | |
+ return '/'; | |
+ } | |
+ } | |
+ YY_BREAK | |
+case 159: | |
+YY_RULE_SETUP | |
+#line 721 "scan.l" | |
+{ | |
+ if (lex_compat || posix_compat){ | |
+ /* Push back the "?#" and treat it like a normal parens. */ | |
+ yyless(1); | |
+ sf_push(); | |
+ return '('; | |
+ } | |
+ else | |
+ yy_push_state(EXTENDED_COMMENT); | |
+ } | |
+ YY_BREAK | |
+case 160: | |
+YY_RULE_SETUP | |
+#line 731 "scan.l" | |
+{ | |
+ sf_push(); | |
+ if (lex_compat || posix_compat) | |
+ /* Push back the "?" and treat it like a normal parens. */ | |
+ yyless(1); | |
+ else | |
+ BEGIN(GROUP_WITH_PARAMS); | |
+ return '('; | |
+ } | |
+ YY_BREAK | |
+case 161: | |
+YY_RULE_SETUP | |
+#line 740 "scan.l" | |
+sf_push(); return '('; | |
+ YY_BREAK | |
+case 162: | |
+YY_RULE_SETUP | |
+#line 741 "scan.l" | |
+sf_pop(); return ')'; | |
+ YY_BREAK | |
+case 163: | |
+YY_RULE_SETUP | |
+#line 743 "scan.l" | |
+return (unsigned char) yytext[0]; | |
+ YY_BREAK | |
+case 164: | |
+YY_RULE_SETUP | |
+#line 744 "scan.l" | |
+RETURNCHAR; | |
+ YY_BREAK | |
+ | |
+ | |
+case 165: | |
+/* rule 165 can match eol */ | |
+YY_RULE_SETUP | |
+#line 749 "scan.l" | |
+++linenum; /* Allow blank lines & continuations */ | |
+ YY_BREAK | |
+case 166: | |
+YY_RULE_SETUP | |
+#line 750 "scan.l" | |
+return (unsigned char) yytext[0]; | |
+ YY_BREAK | |
+case 167: | |
+YY_RULE_SETUP | |
+#line 751 "scan.l" | |
+BEGIN(SECT2); return '>'; | |
+ YY_BREAK | |
+case 168: | |
+*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ | |
+(yy_c_buf_p) = yy_cp = yy_bp + 1; | |
+YY_DO_BEFORE_ACTION; /* set up yytext again */ | |
+YY_RULE_SETUP | |
+#line 752 "scan.l" | |
+BEGIN(CARETISBOL); return '>'; | |
+ YY_BREAK | |
+case 169: | |
+YY_RULE_SETUP | |
+#line 753 "scan.l" | |
+RETURNNAME; | |
+ YY_BREAK | |
+case 170: | |
+YY_RULE_SETUP | |
+#line 754 "scan.l" | |
+{ | |
+ format_synerr( _( "bad <start condition>: %s" ), | |
+ yytext ); | |
+ } | |
+ YY_BREAK | |
+ | |
+case 171: | |
+YY_RULE_SETUP | |
+#line 760 "scan.l" | |
+BEGIN(SECT2); return '^'; | |
+ YY_BREAK | |
+ | |
+case 172: | |
+YY_RULE_SETUP | |
+#line 764 "scan.l" | |
+RETURNCHAR; | |
+ YY_BREAK | |
+case 173: | |
+YY_RULE_SETUP | |
+#line 765 "scan.l" | |
+BEGIN(SECT2); return '"'; | |
+ YY_BREAK | |
+case 174: | |
+/* rule 174 can match eol */ | |
+YY_RULE_SETUP | |
+#line 767 "scan.l" | |
+{ | |
+ synerr( _( "missing quote" ) ); | |
+ BEGIN(SECT2); | |
+ ++linenum; | |
+ return '"'; | |
+ } | |
+ YY_BREAK | |
+ | |
+ | |
+case 175: | |
+YY_RULE_SETUP | |
+#line 776 "scan.l" | |
+BEGIN(SECT2); | |
+ YY_BREAK | |
+case 176: | |
+YY_RULE_SETUP | |
+#line 777 "scan.l" | |
+BEGIN(GROUP_MINUS_PARAMS); | |
+ YY_BREAK | |
+case 177: | |
+YY_RULE_SETUP | |
+#line 778 "scan.l" | |
+sf_set_case_ins(1); | |
+ YY_BREAK | |
+case 178: | |
+YY_RULE_SETUP | |
+#line 779 "scan.l" | |
+sf_set_dot_all(1); | |
+ YY_BREAK | |
+case 179: | |
+YY_RULE_SETUP | |
+#line 780 "scan.l" | |
+sf_set_skip_ws(1); | |
+ YY_BREAK | |
+ | |
+ | |
+case 180: | |
+YY_RULE_SETUP | |
+#line 783 "scan.l" | |
+BEGIN(SECT2); | |
+ YY_BREAK | |
+case 181: | |
+YY_RULE_SETUP | |
+#line 784 "scan.l" | |
+sf_set_case_ins(0); | |
+ YY_BREAK | |
+case 182: | |
+YY_RULE_SETUP | |
+#line 785 "scan.l" | |
+sf_set_dot_all(0); | |
+ YY_BREAK | |
+case 183: | |
+YY_RULE_SETUP | |
+#line 786 "scan.l" | |
+sf_set_skip_ws(0); | |
+ YY_BREAK | |
+ | |
+ | |
+case 184: | |
+*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ | |
+(yy_c_buf_p) = yy_cp = yy_bp + 1; | |
+YY_DO_BEFORE_ACTION; /* set up yytext again */ | |
+YY_RULE_SETUP | |
+#line 790 "scan.l" | |
+BEGIN(CCL); return '^'; | |
+ YY_BREAK | |
+case 185: | |
+*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ | |
+(yy_c_buf_p) = yy_cp = yy_bp + 1; | |
+YY_DO_BEFORE_ACTION; /* set up yytext again */ | |
+YY_RULE_SETUP | |
+#line 791 "scan.l" | |
+return '^'; | |
+ YY_BREAK | |
+case 186: | |
+YY_RULE_SETUP | |
+#line 792 "scan.l" | |
+BEGIN(CCL); RETURNCHAR; | |
+ YY_BREAK | |
+ | |
+ | |
+case 187: | |
+*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ | |
+(yy_c_buf_p) = yy_cp = yy_bp + 1; | |
+YY_DO_BEFORE_ACTION; /* set up yytext again */ | |
+YY_RULE_SETUP | |
+#line 796 "scan.l" | |
+return '-'; | |
+ YY_BREAK | |
+case 188: | |
+YY_RULE_SETUP | |
+#line 797 "scan.l" | |
+RETURNCHAR; | |
+ YY_BREAK | |
+case 189: | |
+YY_RULE_SETUP | |
+#line 798 "scan.l" | |
+BEGIN(SECT2); return ']'; | |
+ YY_BREAK | |
+case 190: | |
+/* rule 190 can match eol */ | |
+YY_RULE_SETUP | |
+#line 799 "scan.l" | |
+{ | |
+ synerr( _( "bad character class" ) ); | |
+ BEGIN(SECT2); | |
+ return ']'; | |
+ } | |
+ YY_BREAK | |
+ | |
+ | |
+case 191: | |
+YY_RULE_SETUP | |
+#line 807 "scan.l" | |
+BEGIN(CCL); return CCE_ALNUM; | |
+ YY_BREAK | |
+case 192: | |
+YY_RULE_SETUP | |
+#line 808 "scan.l" | |
+BEGIN(CCL); return CCE_ALPHA; | |
+ YY_BREAK | |
+case 193: | |
+YY_RULE_SETUP | |
+#line 809 "scan.l" | |
+BEGIN(CCL); return CCE_BLANK; | |
+ YY_BREAK | |
+case 194: | |
+YY_RULE_SETUP | |
+#line 810 "scan.l" | |
+BEGIN(CCL); return CCE_CNTRL; | |
+ YY_BREAK | |
+case 195: | |
+YY_RULE_SETUP | |
+#line 811 "scan.l" | |
+BEGIN(CCL); return CCE_DIGIT; | |
+ YY_BREAK | |
+case 196: | |
+YY_RULE_SETUP | |
+#line 812 "scan.l" | |
+BEGIN(CCL); return CCE_GRAPH; | |
+ YY_BREAK | |
+case 197: | |
+YY_RULE_SETUP | |
+#line 813 "scan.l" | |
+BEGIN(CCL); return CCE_LOWER; | |
+ YY_BREAK | |
+case 198: | |
+YY_RULE_SETUP | |
+#line 814 "scan.l" | |
+BEGIN(CCL); return CCE_PRINT; | |
+ YY_BREAK | |
+case 199: | |
+YY_RULE_SETUP | |
+#line 815 "scan.l" | |
+BEGIN(CCL); return CCE_PUNCT; | |
+ YY_BREAK | |
+case 200: | |
+YY_RULE_SETUP | |
+#line 816 "scan.l" | |
+BEGIN(CCL); return CCE_SPACE; | |
+ YY_BREAK | |
+case 201: | |
+YY_RULE_SETUP | |
+#line 817 "scan.l" | |
+BEGIN(CCL); return CCE_UPPER; | |
+ YY_BREAK | |
+case 202: | |
+YY_RULE_SETUP | |
+#line 818 "scan.l" | |
+BEGIN(CCL); return CCE_XDIGIT; | |
+ YY_BREAK | |
+case 203: | |
+YY_RULE_SETUP | |
+#line 820 "scan.l" | |
+BEGIN(CCL); return CCE_NEG_ALNUM; | |
+ YY_BREAK | |
+case 204: | |
+YY_RULE_SETUP | |
+#line 821 "scan.l" | |
+BEGIN(CCL); return CCE_NEG_ALPHA; | |
+ YY_BREAK | |
+case 205: | |
+YY_RULE_SETUP | |
+#line 822 "scan.l" | |
+BEGIN(CCL); return CCE_NEG_BLANK; | |
+ YY_BREAK | |
+case 206: | |
+YY_RULE_SETUP | |
+#line 823 "scan.l" | |
+BEGIN(CCL); return CCE_NEG_CNTRL; | |
+ YY_BREAK | |
+case 207: | |
+YY_RULE_SETUP | |
+#line 824 "scan.l" | |
+BEGIN(CCL); return CCE_NEG_DIGIT; | |
+ YY_BREAK | |
+case 208: | |
+YY_RULE_SETUP | |
+#line 825 "scan.l" | |
+BEGIN(CCL); return CCE_NEG_GRAPH; | |
+ YY_BREAK | |
+case 209: | |
+YY_RULE_SETUP | |
+#line 826 "scan.l" | |
+BEGIN(CCL); return CCE_NEG_LOWER; | |
+ YY_BREAK | |
+case 210: | |
+YY_RULE_SETUP | |
+#line 827 "scan.l" | |
+BEGIN(CCL); return CCE_NEG_PRINT; | |
+ YY_BREAK | |
+case 211: | |
+YY_RULE_SETUP | |
+#line 828 "scan.l" | |
+BEGIN(CCL); return CCE_NEG_PUNCT; | |
+ YY_BREAK | |
+case 212: | |
+YY_RULE_SETUP | |
+#line 829 "scan.l" | |
+BEGIN(CCL); return CCE_NEG_SPACE; | |
+ YY_BREAK | |
+case 213: | |
+YY_RULE_SETUP | |
+#line 830 "scan.l" | |
+BEGIN(CCL); return CCE_NEG_UPPER; | |
+ YY_BREAK | |
+case 214: | |
+YY_RULE_SETUP | |
+#line 831 "scan.l" | |
+BEGIN(CCL); return CCE_NEG_XDIGIT; | |
+ YY_BREAK | |
+case 215: | |
+YY_RULE_SETUP | |
+#line 832 "scan.l" | |
+{ | |
+ format_synerr( | |
+ _( "bad character class expression: %s" ), | |
+ yytext ); | |
+ BEGIN(CCL); return CCE_ALNUM; | |
+ } | |
+ YY_BREAK | |
+ | |
+ | |
+case 216: | |
+YY_RULE_SETUP | |
+#line 841 "scan.l" | |
+{ | |
+ yylval = myctoi( yytext ); | |
+ return NUMBER; | |
+ } | |
+ YY_BREAK | |
+case 217: | |
+YY_RULE_SETUP | |
+#line 846 "scan.l" | |
+return ','; | |
+ YY_BREAK | |
+case 218: | |
+YY_RULE_SETUP | |
+#line 847 "scan.l" | |
+{ | |
+ BEGIN(SECT2); | |
+ if ( lex_compat || posix_compat ) | |
+ return END_REPEAT_POSIX; | |
+ else | |
+ return END_REPEAT_FLEX; | |
+ } | |
+ YY_BREAK | |
+case 219: | |
+YY_RULE_SETUP | |
+#line 855 "scan.l" | |
+{ | |
+ synerr( _( "bad character inside {}'s" ) ); | |
+ BEGIN(SECT2); | |
+ return '}'; | |
+ } | |
+ YY_BREAK | |
+case 220: | |
+/* rule 220 can match eol */ | |
+YY_RULE_SETUP | |
+#line 861 "scan.l" | |
+{ | |
+ synerr( _( "missing }" ) ); | |
+ BEGIN(SECT2); | |
+ ++linenum; | |
+ return '}'; | |
+ } | |
+ YY_BREAK | |
+ | |
+ | |
+case 221: | |
+YY_RULE_SETUP | |
+#line 871 "scan.l" | |
+bracelevel = 0; | |
+ YY_BREAK | |
+case 222: | |
+YY_RULE_SETUP | |
+#line 873 "scan.l" | |
+ACTION_ECHO; yy_push_state( COMMENT ); | |
+ YY_BREAK | |
+ | |
+case 223: | |
+YY_RULE_SETUP | |
+#line 876 "scan.l" | |
+{ | |
+ ACTION_ECHO; | |
+ CHECK_REJECT(yytext); | |
+ } | |
+ YY_BREAK | |
+case 224: | |
+YY_RULE_SETUP | |
+#line 880 "scan.l" | |
+{ | |
+ ACTION_ECHO; | |
+ CHECK_YYMORE(yytext); | |
+ } | |
+ YY_BREAK | |
+ | |
+case 225: | |
+YY_RULE_SETUP | |
+#line 886 "scan.l" | |
+ACTION_ECHO_QSTART; | |
+ YY_BREAK | |
+case 226: | |
+YY_RULE_SETUP | |
+#line 887 "scan.l" | |
+ACTION_ECHO_QEND; | |
+ YY_BREAK | |
+case 227: | |
+YY_RULE_SETUP | |
+#line 888 "scan.l" | |
+ACTION_ECHO; | |
+ YY_BREAK | |
+case 228: | |
+/* rule 228 can match eol */ | |
+YY_RULE_SETUP | |
+#line 889 "scan.l" | |
+{ | |
+ ++linenum; | |
+ ACTION_ECHO; | |
+ if ( bracelevel == 0 || | |
+ (doing_codeblock && indented_code) ) | |
+ { | |
+ if ( doing_rule_action ) | |
+ add_action( "\tYY_BREAK\n" ); | |
+ | |
+ doing_rule_action = doing_codeblock = false; | |
+ BEGIN(SECT2); | |
+ } | |
+ } | |
+ YY_BREAK | |
+ | |
+/* Reject and YYmore() are checked for above, in PERCENT_BRACE_ACTION */ | |
+ | |
+case 229: | |
+YY_RULE_SETUP | |
+#line 907 "scan.l" | |
+ACTION_ECHO; ++bracelevel; | |
+ YY_BREAK | |
+case 230: | |
+YY_RULE_SETUP | |
+#line 908 "scan.l" | |
+ACTION_ECHO; --bracelevel; | |
+ YY_BREAK | |
+case 231: | |
+YY_RULE_SETUP | |
+#line 909 "scan.l" | |
+ACTION_ECHO_QSTART; | |
+ YY_BREAK | |
+case 232: | |
+YY_RULE_SETUP | |
+#line 910 "scan.l" | |
+ACTION_ECHO_QEND; | |
+ YY_BREAK | |
+case 233: | |
+YY_RULE_SETUP | |
+#line 911 "scan.l" | |
+ACTION_ECHO; | |
+ YY_BREAK | |
+case 234: | |
+YY_RULE_SETUP | |
+#line 912 "scan.l" | |
+ACTION_ECHO; | |
+ YY_BREAK | |
+case 235: | |
+YY_RULE_SETUP | |
+#line 913 "scan.l" | |
+ACTION_ECHO; | |
+ YY_BREAK | |
+case 236: | |
+YY_RULE_SETUP | |
+#line 914 "scan.l" | |
+ACTION_ECHO; /* character constant */ | |
+ YY_BREAK | |
+case 237: | |
+YY_RULE_SETUP | |
+#line 915 "scan.l" | |
+ACTION_ECHO; BEGIN(ACTION_STRING); | |
+ YY_BREAK | |
+case 238: | |
+/* rule 238 can match eol */ | |
+YY_RULE_SETUP | |
+#line 916 "scan.l" | |
+{ | |
+ ++linenum; | |
+ ACTION_ECHO; | |
+ if ( bracelevel == 0 ) | |
+ { | |
+ if ( doing_rule_action ) | |
+ add_action( "\tYY_BREAK\n" ); | |
+ | |
+ doing_rule_action = false; | |
+ BEGIN(SECT2); | |
+ } | |
+ } | |
+ YY_BREAK | |
+case 239: | |
+YY_RULE_SETUP | |
+#line 928 "scan.l" | |
+ACTION_ECHO; | |
+ YY_BREAK | |
+ | |
+ | |
+case 240: | |
+YY_RULE_SETUP | |
+#line 932 "scan.l" | |
+ACTION_ECHO; | |
+ YY_BREAK | |
+case 241: | |
+YY_RULE_SETUP | |
+#line 933 "scan.l" | |
+ACTION_ECHO; | |
+ YY_BREAK | |
+case 242: | |
+/* rule 242 can match eol */ | |
+YY_RULE_SETUP | |
+#line 934 "scan.l" | |
+++linenum; ACTION_ECHO; BEGIN(ACTION); | |
+ YY_BREAK | |
+case 243: | |
+YY_RULE_SETUP | |
+#line 935 "scan.l" | |
+ACTION_ECHO; BEGIN(ACTION); | |
+ YY_BREAK | |
+case 244: | |
+YY_RULE_SETUP | |
+#line 936 "scan.l" | |
+ACTION_ECHO; | |
+ YY_BREAK | |
+ | |
+case YY_STATE_EOF(COMMENT): | |
+case YY_STATE_EOF(COMMENT_DISCARD): | |
+case YY_STATE_EOF(ACTION): | |
+case YY_STATE_EOF(ACTION_STRING): | |
+#line 939 "scan.l" | |
+{ | |
+ synerr( _( "EOF encountered inside an action" ) ); | |
+ yyterminate(); | |
+ } | |
+ YY_BREAK | |
+case YY_STATE_EOF(EXTENDED_COMMENT): | |
+case YY_STATE_EOF(GROUP_WITH_PARAMS): | |
+case YY_STATE_EOF(GROUP_MINUS_PARAMS): | |
+#line 944 "scan.l" | |
+{ | |
+ synerr( _( "EOF encountered inside pattern" ) ); | |
+ yyterminate(); | |
+ } | |
+ YY_BREAK | |
+case 245: | |
+YY_RULE_SETUP | |
+#line 949 "scan.l" | |
+{ | |
+ yylval = myesc( (Char *) yytext ); | |
+ | |
+ if ( YY_START == FIRSTCCL ) | |
+ BEGIN(CCL); | |
+ | |
+ return CHAR; | |
+ } | |
+ YY_BREAK | |
+ | |
+case 246: | |
+YY_RULE_SETUP | |
+#line 960 "scan.l" | |
+fwrite (escaped_qstart, 1, strlen(escaped_qstart), yyout); | |
+ YY_BREAK | |
+case 247: | |
+YY_RULE_SETUP | |
+#line 961 "scan.l" | |
+fwrite (escaped_qend, 1, strlen(escaped_qend), yyout); | |
+ YY_BREAK | |
+case 248: | |
+/* rule 248 can match eol */ | |
+YY_RULE_SETUP | |
+#line 962 "scan.l" | |
+ECHO; | |
+ YY_BREAK | |
+case 249: | |
+/* rule 249 can match eol */ | |
+YY_RULE_SETUP | |
+#line 963 "scan.l" | |
+ECHO; | |
+ YY_BREAK | |
+case YY_STATE_EOF(SECT3): | |
+#line 964 "scan.l" | |
+sectnum = 0; yyterminate(); | |
+ YY_BREAK | |
+ | |
+case 250: | |
+/* rule 250 can match eol */ | |
+YY_RULE_SETUP | |
+#line 967 "scan.l" | |
+format_synerr( _( "bad character: %s" ), yytext ); | |
+ YY_BREAK | |
+case 251: | |
+YY_RULE_SETUP | |
+#line 969 "scan.l" | |
+YY_FATAL_ERROR( "flex scanner jammed" ); | |
+ YY_BREAK | |
+#line 4115 "scan.c" | |
+ case YY_STATE_EOF(INITIAL): | |
+ case YY_STATE_EOF(SECT2): | |
+ case YY_STATE_EOF(CODEBLOCK): | |
+ case YY_STATE_EOF(PICKUPDEF): | |
+ case YY_STATE_EOF(SC): | |
+ case YY_STATE_EOF(CARETISBOL): | |
+ case YY_STATE_EOF(NUM): | |
+ case YY_STATE_EOF(QUOTE): | |
+ case YY_STATE_EOF(FIRSTCCL): | |
+ case YY_STATE_EOF(CCL): | |
+ case YY_STATE_EOF(RECOVER): | |
+ case YY_STATE_EOF(PERCENT_BRACE_ACTION): | |
+ case YY_STATE_EOF(OPTION): | |
+ case YY_STATE_EOF(LINEDIR): | |
+ yyterminate(); | |
+ | |
+ case YY_END_OF_BUFFER: | |
+ { | |
+ /* Amount of text matched not including the EOB char. */ | |
+ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; | |
+ | |
+ /* Undo the effects of YY_DO_BEFORE_ACTION. */ | |
+ *yy_cp = (yy_hold_char); | |
+ YY_RESTORE_YY_MORE_OFFSET | |
+ | |
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) | |
+ { | |
+ /* We're scanning a new file or input source. It's | |
+ * possible that this happened because the user | |
+ * just pointed yyin at a new source and called | |
+ * yylex(). If so, then we have to assure | |
+ * consistency between YY_CURRENT_BUFFER and our | |
+ * globals. Here is the right place to do so, because | |
+ * this is the first action (other than possibly a | |
+ * back-up) that will match for the new input source. | |
+ */ | |
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; | |
+ YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; | |
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; | |
+ } | |
+ | |
+ /* Note that here we test for yy_c_buf_p "<=" to the position | |
+ * of the first EOB in the buffer, since yy_c_buf_p will | |
+ * already have been incremented past the NUL character | |
+ * (since all states make transitions on EOB to the | |
+ * end-of-buffer state). Contrast this with the test | |
+ * in input(). | |
+ */ | |
+ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) | |
+ { /* This was really a NUL. */ | |
+ yy_state_type yy_next_state; | |
+ | |
+ (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; | |
+ | |
+ yy_current_state = yy_get_previous_state( ); | |
+ | |
+ /* Okay, we're now positioned to make the NUL | |
+ * transition. We couldn't have | |
+ * yy_get_previous_state() go ahead and do it | |
+ * for us because it doesn't know how to deal | |
+ * with the possibility of jamming (and we don't | |
+ * want to build jamming into it because then it | |
+ * will run more slowly). | |
+ */ | |
+ | |
+ yy_next_state = yy_try_NUL_trans( yy_current_state ); | |
+ | |
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ; | |
+ | |
+ if ( yy_next_state ) | |
+ { | |
+ /* Consume the NUL. */ | |
+ yy_cp = ++(yy_c_buf_p); | |
+ yy_current_state = yy_next_state; | |
+ goto yy_match; | |
+ } | |
+ | |
+ else | |
+ { | |
+ yy_cp = (yy_c_buf_p); | |
+ goto yy_find_action; | |
+ } | |
+ } | |
+ | |
+ else switch ( yy_get_next_buffer( ) ) | |
+ { | |
+ case EOB_ACT_END_OF_FILE: | |
+ { | |
+ (yy_did_buffer_switch_on_eof) = 0; | |
+ | |
+ if ( yywrap( ) ) | |
+ { | |
+ /* Note: because we've taken care in | |
+ * yy_get_next_buffer() to have set up | |
+ * yytext, we can now set up | |
+ * yy_c_buf_p so that if some total | |
+ * hoser (like flex itself) wants to | |
+ * call the scanner after we return the | |
+ * YY_NULL, it'll still work - another | |
+ * YY_NULL will get returned. | |
+ */ | |
+ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; | |
+ | |
+ yy_act = YY_STATE_EOF(YY_START); | |
+ goto do_action; | |
+ } | |
+ | |
+ else | |
+ { | |
+ if ( ! (yy_did_buffer_switch_on_eof) ) | |
+ YY_NEW_FILE; | |
+ } | |
+ break; | |
+ } | |
+ | |
+ case EOB_ACT_CONTINUE_SCAN: | |
+ (yy_c_buf_p) = | |
+ (yytext_ptr) + yy_amount_of_matched_text; | |
+ | |
+ yy_current_state = yy_get_previous_state( ); | |
+ | |
+ yy_cp = (yy_c_buf_p); | |
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ; | |
+ goto yy_match; | |
+ | |
+ case EOB_ACT_LAST_MATCH: | |
+ (yy_c_buf_p) = | |
+ &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; | |
+ | |
+ yy_current_state = yy_get_previous_state( ); | |
+ | |
+ yy_cp = (yy_c_buf_p); | |
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ; | |
+ goto yy_find_action; | |
+ } | |
+ break; | |
+ } | |
+ | |
+ default: | |
+ YY_FATAL_ERROR( | |
+ "fatal flex scanner internal error--no action found" ); | |
+ } /* end of action switch */ | |
+ } /* end of scanning one token */ | |
+ } /* end of user's declarations */ | |
+} /* end of yylex */ | |
+ | |
+/* yy_get_next_buffer - try to read in a new buffer | |
+ * | |
+ * Returns a code representing an action: | |
+ * EOB_ACT_LAST_MATCH - | |
+ * EOB_ACT_CONTINUE_SCAN - continue scanning from current position | |
+ * EOB_ACT_END_OF_FILE - end of file | |
+ */ | |
+static int yy_get_next_buffer (void) | |
+{ | |
+ register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; | |
+ register char *source = (yytext_ptr); | |
+ register int number_to_move, i; | |
+ int ret_val; | |
+ | |
+ if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) | |
+ YY_FATAL_ERROR( | |
+ "fatal flex scanner internal error--end of buffer missed" ); | |
+ | |
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) | |
+ { /* Don't try to fill the buffer, so this is an EOF. */ | |
+ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) | |
+ { | |
+ /* We matched a single character, the EOB, so | |
+ * treat this as a final EOF. | |
+ */ | |
+ return EOB_ACT_END_OF_FILE; | |
+ } | |
+ | |
+ else | |
+ { | |
+ /* We matched some text prior to the EOB, first | |
+ * process it. | |
+ */ | |
+ return EOB_ACT_LAST_MATCH; | |
+ } | |
+ } | |
+ | |
+ /* Try to read more data. */ | |
+ | |
+ /* First move last chars to start of buffer. */ | |
+ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; | |
+ | |
+ for ( i = 0; i < number_to_move; ++i ) | |
+ *(dest++) = *(source++); | |
+ | |
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) | |
+ /* don't do the read, it's not guaranteed to return an EOF, | |
+ * just force an EOF | |
+ */ | |
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; | |
+ | |
+ else | |
+ { | |
+ yy_size_t num_to_read = | |
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; | |
+ | |
+ while ( num_to_read <= 0 ) | |
+ { /* Not enough room in the buffer - grow it. */ | |
+ | |
+ YY_FATAL_ERROR( | |
+"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); | |
+ | |
+ } | |
+ | |
+ if ( num_to_read > YY_READ_BUF_SIZE ) | |
+ num_to_read = YY_READ_BUF_SIZE; | |
+ | |
+ /* Read in more data. */ | |
+ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), | |
+ (yy_n_chars), num_to_read ); | |
+ | |
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); | |
+ } | |
+ | |
+ if ( (yy_n_chars) == 0 ) | |
+ { | |
+ if ( number_to_move == YY_MORE_ADJ ) | |
+ { | |
+ ret_val = EOB_ACT_END_OF_FILE; | |
+ yyrestart(yyin ); | |
+ } | |
+ | |
+ else | |
+ { | |
+ ret_val = EOB_ACT_LAST_MATCH; | |
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = | |
+ YY_BUFFER_EOF_PENDING; | |
+ } | |
+ } | |
+ | |
+ else | |
+ ret_val = EOB_ACT_CONTINUE_SCAN; | |
+ | |
+ if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { | |
+ /* Extend the array by 50%, plus the number we really need. */ | |
+ yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); | |
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); | |
+ if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) | |
+ YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); | |
+ } | |
+ | |
+ (yy_n_chars) += number_to_move; | |
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; | |
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; | |
+ | |
+ (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; | |
+ | |
+ return ret_val; | |
+} | |
+ | |
+/* yy_get_previous_state - get the state just before the EOB char was reached */ | |
+ | |
+ static yy_state_type yy_get_previous_state (void) | |
+{ | |
+ register yy_state_type yy_current_state; | |
+ register char *yy_cp; | |
+ | |
+ yy_current_state = (yy_start); | |
+ yy_current_state += YY_AT_BOL(); | |
+ | |
+ (yy_state_ptr) = (yy_state_buf); | |
+ *(yy_state_ptr)++ = yy_current_state; | |
+ | |
+ for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) | |
+ { | |
+ register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); | |
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) | |
+ { | |
+ yy_current_state = (int) yy_def[yy_current_state]; | |
+ if ( yy_current_state >= 1107 ) | |
+ yy_c = yy_meta[(unsigned int) yy_c]; | |
+ } | |
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; | |
+ *(yy_state_ptr)++ = yy_current_state; | |
+ } | |
+ | |
+ return yy_current_state; | |
+} | |
+ | |
+/* yy_try_NUL_trans - try to make a transition on the NUL character | |
+ * | |
+ * synopsis | |
+ * next_state = yy_try_NUL_trans( current_state ); | |
+ */ | |
+ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) | |
+{ | |
+ register int yy_is_jam; | |
+ | |
+ register YY_CHAR yy_c = 1; | |
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) | |
+ { | |
+ yy_current_state = (int) yy_def[yy_current_state]; | |
+ if ( yy_current_state >= 1107 ) | |
+ yy_c = yy_meta[(unsigned int) yy_c]; | |
+ } | |
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; | |
+ yy_is_jam = (yy_current_state == 1106); | |
+ if ( ! yy_is_jam ) | |
+ *(yy_state_ptr)++ = yy_current_state; | |
+ | |
+ return yy_is_jam ? 0 : yy_current_state; | |
+} | |
+ | |
+ static void yyunput (int c, register char * yy_bp ) | |
+{ | |
+ register char *yy_cp; | |
+ | |
+ yy_cp = (yy_c_buf_p); | |
+ | |
+ /* undo effects of setting up yytext */ | |
+ *yy_cp = (yy_hold_char); | |
+ | |
+ if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) | |
+ { /* need to shift things up to make room */ | |
+ /* +2 for EOB chars. */ | |
+ register yy_size_t number_to_move = (yy_n_chars) + 2; | |
+ register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ | |
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; | |
+ register char *source = | |
+ &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; | |
+ | |
+ while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) | |
+ *--dest = *--source; | |
+ | |
+ yy_cp += (int) (dest - source); | |
+ yy_bp += (int) (dest - source); | |
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = | |
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; | |
+ | |
+ if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) | |
+ YY_FATAL_ERROR( "flex scanner push-back overflow" ); | |
+ } | |
+ | |
+ *--yy_cp = (char) c; | |
+ | |
+ (yytext_ptr) = yy_bp; | |
+ (yy_hold_char) = *yy_cp; | |
+ (yy_c_buf_p) = yy_cp; | |
+} | |
+ | |
+#ifndef YY_NO_INPUT | |
+#ifdef __cplusplus | |
+ static int yyinput (void) | |
+#else | |
+ static int input (void) | |
+#endif | |
+ | |
+{ | |
+ int c; | |
+ | |
+ *(yy_c_buf_p) = (yy_hold_char); | |
+ | |
+ if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) | |
+ { | |
+ /* yy_c_buf_p now points to the character we want to return. | |
+ * If this occurs *before* the EOB characters, then it's a | |
+ * valid NUL; if not, then we've hit the end of the buffer. | |
+ */ | |
+ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) | |
+ /* This was really a NUL. */ | |
+ *(yy_c_buf_p) = '\0'; | |
+ | |
+ else | |
+ { /* need more input */ | |
+ yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); | |
+ ++(yy_c_buf_p); | |
+ | |
+ switch ( yy_get_next_buffer( ) ) | |
+ { | |
+ case EOB_ACT_LAST_MATCH: | |
+ /* This happens because yy_g_n_b() | |
+ * sees that we've accumulated a | |
+ * token and flags that we need to | |
+ * try matching the token before | |
+ * proceeding. But for input(), | |
+ * there's no matching to consider. | |
+ * So convert the EOB_ACT_LAST_MATCH | |
+ * to EOB_ACT_END_OF_FILE. | |
+ */ | |
+ | |
+ /* Reset buffer status. */ | |
+ yyrestart(yyin ); | |
+ | |
+ /*FALLTHROUGH*/ | |
+ | |
+ case EOB_ACT_END_OF_FILE: | |
+ { | |
+ if ( yywrap( ) ) | |
+ return EOF; | |
+ | |
+ if ( ! (yy_did_buffer_switch_on_eof) ) | |
+ YY_NEW_FILE; | |
+#ifdef __cplusplus | |
+ return yyinput(); | |
+#else | |
+ return input(); | |
+#endif | |
+ } | |
+ | |
+ case EOB_ACT_CONTINUE_SCAN: | |
+ (yy_c_buf_p) = (yytext_ptr) + offset; | |
+ break; | |
+ } | |
+ } | |
+ } | |
+ | |
+ c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ | |
+ *(yy_c_buf_p) = '\0'; /* preserve yytext */ | |
+ (yy_hold_char) = *++(yy_c_buf_p); | |
+ | |
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); | |
+ | |
+ return c; | |
+} | |
+#endif /* ifndef YY_NO_INPUT */ | |
+ | |
+/** Immediately switch to a different input stream. | |
+ * @param input_file A readable stream. | |
+ * | |
+ * @note This function does not reset the start condition to @c INITIAL . | |
+ */ | |
+ void yyrestart (FILE * input_file ) | |
+{ | |
+ | |
+ if ( ! YY_CURRENT_BUFFER ){ | |
+ yyensure_buffer_stack (); | |
+ YY_CURRENT_BUFFER_LVALUE = | |
+ yy_create_buffer(yyin,YY_BUF_SIZE ); | |
+ } | |
+ | |
+ yy_init_buffer(YY_CURRENT_BUFFER,input_file ); | |
+ yy_load_buffer_state( ); | |
+} | |
+ | |
+/** Switch to a different input buffer. | |
+ * @param new_buffer The new input buffer. | |
+ * | |
+ */ | |
+ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) | |
+{ | |
+ | |
+ /* TODO. We should be able to replace this entire function body | |
+ * with | |
+ * yypop_buffer_state(); | |
+ * yypush_buffer_state(new_buffer); | |
+ */ | |
+ yyensure_buffer_stack (); | |
+ if ( YY_CURRENT_BUFFER == new_buffer ) | |
+ return; | |
+ | |
+ if ( YY_CURRENT_BUFFER ) | |
+ { | |
+ /* Flush out information for old buffer. */ | |
+ *(yy_c_buf_p) = (yy_hold_char); | |
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); | |
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); | |
+ } | |
+ | |
+ YY_CURRENT_BUFFER_LVALUE = new_buffer; | |
+ yy_load_buffer_state( ); | |
+ | |
+ /* We don't actually know whether we did this switch during | |
+ * EOF (yywrap()) processing, but the only time this flag | |
+ * is looked at is after yywrap() is called, so it's safe | |
+ * to go ahead and always set it. | |
+ */ | |
+ (yy_did_buffer_switch_on_eof) = 1; | |
+} | |
+ | |
+static void yy_load_buffer_state (void) | |
+{ | |
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; | |
+ (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; | |
+ yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; | |
+ (yy_hold_char) = *(yy_c_buf_p); | |
+} | |
+ | |
+/** Allocate and initialize an input buffer state. | |
+ * @param file A readable stream. | |
+ * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. | |
+ * | |
+ * @return the allocated buffer state. | |
+ */ | |
+ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) | |
+{ | |
+ YY_BUFFER_STATE b; | |
+ | |
+ b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); | |
+ if ( ! b ) | |
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); | |
+ | |
+ b->yy_buf_size = size; | |
+ | |
+ /* yy_ch_buf has to be 2 characters longer than the size given because | |
+ * we need to put in 2 end-of-buffer characters. | |
+ */ | |
+ b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); | |
+ if ( ! b->yy_ch_buf ) | |
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); | |
+ | |
+ b->yy_is_our_buffer = 1; | |
+ | |
+ yy_init_buffer(b,file ); | |
+ | |
+ return b; | |
+} | |
+ | |
+/** Destroy the buffer. | |
+ * @param b a buffer created with yy_create_buffer() | |
+ * | |
+ */ | |
+ void yy_delete_buffer (YY_BUFFER_STATE b ) | |
+{ | |
+ | |
+ if ( ! b ) | |
+ return; | |
+ | |
+ if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ | |
+ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; | |
+ | |
+ if ( b->yy_is_our_buffer ) | |
+ yyfree((void *) b->yy_ch_buf ); | |
+ | |
+ yyfree((void *) b ); | |
+} | |
+ | |
+/* Initializes or reinitializes a buffer. | |
+ * This function is sometimes called more than once on the same buffer, | |
+ * such as during a yyrestart() or at EOF. | |
+ */ | |
+ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) | |
+ | |
+{ | |
+ int oerrno = errno; | |
+ | |
+ yy_flush_buffer(b ); | |
+ | |
+ b->yy_input_file = file; | |
+ b->yy_fill_buffer = 1; | |
+ | |
+ /* If b is the current buffer, then yy_init_buffer was _probably_ | |
+ * called from yyrestart() or through yy_get_next_buffer. | |
+ * In that case, we don't want to reset the lineno or column. | |
+ */ | |
+ if (b != YY_CURRENT_BUFFER){ | |
+ b->yy_bs_lineno = 1; | |
+ b->yy_bs_column = 0; | |
+ } | |
+ | |
+ b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; | |
+ | |
+ errno = oerrno; | |
+} | |
+ | |
+/** Discard all buffered characters. On the next scan, YY_INPUT will be called. | |
+ * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. | |
+ * | |
+ */ | |
+ void yy_flush_buffer (YY_BUFFER_STATE b ) | |
+{ | |
+ if ( ! b ) | |
+ return; | |
+ | |
+ b->yy_n_chars = 0; | |
+ | |
+ /* We always need two end-of-buffer characters. The first causes | |
+ * a transition to the end-of-buffer state. The second causes | |
+ * a jam in that state. | |
+ */ | |
+ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; | |
+ b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; | |
+ | |
+ b->yy_buf_pos = &b->yy_ch_buf[0]; | |
+ | |
+ b->yy_at_bol = 1; | |
+ b->yy_buffer_status = YY_BUFFER_NEW; | |
+ | |
+ if ( b == YY_CURRENT_BUFFER ) | |
+ yy_load_buffer_state( ); | |
+} | |
+ | |
+/** Pushes the new state onto the stack. The new state becomes | |
+ * the current state. This function will allocate the stack | |
+ * if necessary. | |
+ * @param new_buffer The new state. | |
+ * | |
+ */ | |
+void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) | |
+{ | |
+ if (new_buffer == NULL) | |
+ return; | |
+ | |
+ yyensure_buffer_stack(); | |
+ | |
+ /* This block is copied from yy_switch_to_buffer. */ | |
+ if ( YY_CURRENT_BUFFER ) | |
+ { | |
+ /* Flush out information for old buffer. */ | |
+ *(yy_c_buf_p) = (yy_hold_char); | |
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); | |
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); | |
+ } | |
+ | |
+ /* Only push if top exists. Otherwise, replace top. */ | |
+ if (YY_CURRENT_BUFFER) | |
+ (yy_buffer_stack_top)++; | |
+ YY_CURRENT_BUFFER_LVALUE = new_buffer; | |
+ | |
+ /* copied from yy_switch_to_buffer. */ | |
+ yy_load_buffer_state( ); | |
+ (yy_did_buffer_switch_on_eof) = 1; | |
+} | |
+ | |
+/** Removes and deletes the top of the stack, if present. | |
+ * The next element becomes the new top. | |
+ * | |
+ */ | |
+void yypop_buffer_state (void) | |
+{ | |
+ if (!YY_CURRENT_BUFFER) | |
+ return; | |
+ | |
+ yy_delete_buffer(YY_CURRENT_BUFFER ); | |
+ YY_CURRENT_BUFFER_LVALUE = NULL; | |
+ if ((yy_buffer_stack_top) > 0) | |
+ --(yy_buffer_stack_top); | |
+ | |
+ if (YY_CURRENT_BUFFER) { | |
+ yy_load_buffer_state( ); | |
+ (yy_did_buffer_switch_on_eof) = 1; | |
+ } | |
+} | |
+ | |
+/* Allocates the stack if it does not exist. | |
+ * Guarantees space for at least one push. | |
+ */ | |
+static void yyensure_buffer_stack (void) | |
+{ | |
+ yy_size_t num_to_alloc; | |
+ | |
+ if (!(yy_buffer_stack)) { | |
+ | |
+ /* First allocation is just for 2 elements, since we don't know if this | |
+ * scanner will even need a stack. We use 2 instead of 1 to avoid an | |
+ * immediate realloc on the next call. | |
+ */ | |
+ num_to_alloc = 1; | |
+ (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc | |
+ (num_to_alloc * sizeof(struct yy_buffer_state*) | |
+ ); | |
+ if ( ! (yy_buffer_stack) ) | |
+ YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); | |
+ | |
+ memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); | |
+ | |
+ (yy_buffer_stack_max) = num_to_alloc; | |
+ (yy_buffer_stack_top) = 0; | |
+ return; | |
+ } | |
+ | |
+ if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ | |
+ | |
+ /* Increase the buffer to prepare for a possible push. */ | |
+ int grow_size = 8 /* arbitrary grow size */; | |
+ | |
+ num_to_alloc = (yy_buffer_stack_max) + grow_size; | |
+ (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc | |
+ ((yy_buffer_stack), | |
+ num_to_alloc * sizeof(struct yy_buffer_state*) | |
+ ); | |
+ if ( ! (yy_buffer_stack) ) | |
+ YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); | |
+ | |
+ /* zero only the new slots.*/ | |
+ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); | |
+ (yy_buffer_stack_max) = num_to_alloc; | |
+ } | |
+} | |
+ | |
+/** Setup the input buffer state to scan directly from a user-specified character buffer. | |
+ * @param base the character buffer | |
+ * @param size the size in bytes of the character buffer | |
+ * | |
+ * @return the newly allocated buffer state object. | |
+ */ | |
+YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) | |
+{ | |
+ YY_BUFFER_STATE b; | |
+ | |
+ if ( size < 2 || | |
+ base[size-2] != YY_END_OF_BUFFER_CHAR || | |
+ base[size-1] != YY_END_OF_BUFFER_CHAR ) | |
+ /* They forgot to leave room for the EOB's. */ | |
+ return 0; | |
+ | |
+ b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); | |
+ if ( ! b ) | |
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); | |
+ | |
+ b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ | |
+ b->yy_buf_pos = b->yy_ch_buf = base; | |
+ b->yy_is_our_buffer = 0; | |
+ b->yy_input_file = 0; | |
+ b->yy_n_chars = b->yy_buf_size; | |
+ b->yy_is_interactive = 0; | |
+ b->yy_at_bol = 1; | |
+ b->yy_fill_buffer = 0; | |
+ b->yy_buffer_status = YY_BUFFER_NEW; | |
+ | |
+ yy_switch_to_buffer(b ); | |
+ | |
+ return b; | |
+} | |
+ | |
+/** Setup the input buffer state to scan a string. The next call to yylex() will | |
+ * scan from a @e copy of @a str. | |
+ * @param yystr a NUL-terminated string to scan | |
+ * | |
+ * @return the newly allocated buffer state object. | |
+ * @note If you want to scan bytes that may contain NUL values, then use | |
+ * yy_scan_bytes() instead. | |
+ */ | |
+YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) | |
+{ | |
+ | |
+ return yy_scan_bytes(yystr,strlen(yystr) ); | |
+} | |
+ | |
+/** Setup the input buffer state to scan the given bytes. The next call to yylex() will | |
+ * scan from a @e copy of @a bytes. | |
+ * @param yybytes the byte buffer to scan | |
+ * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. | |
+ * | |
+ * @return the newly allocated buffer state object. | |
+ */ | |
+YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) | |
+{ | |
+ YY_BUFFER_STATE b; | |
+ char *buf; | |
+ yy_size_t n; | |
+ yy_size_t i; | |
+ | |
+ /* Get memory for full buffer, including space for trailing EOB's. */ | |
+ n = _yybytes_len + 2; | |
+ buf = (char *) yyalloc(n ); | |
+ if ( ! buf ) | |
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); | |
+ | |
+ for ( i = 0; i < _yybytes_len; ++i ) | |
+ buf[i] = yybytes[i]; | |
+ | |
+ buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; | |
+ | |
+ b = yy_scan_buffer(buf,n ); | |
+ if ( ! b ) | |
+ YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); | |
+ | |
+ /* It's okay to grow etc. this buffer, and we should throw it | |
+ * away when we're done. | |
+ */ | |
+ b->yy_is_our_buffer = 1; | |
+ | |
+ return b; | |
+} | |
+ | |
+ static void yy_push_state (int new_state ) | |
+{ | |
+ if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) ) | |
+ { | |
+ yy_size_t new_size; | |
+ | |
+ (yy_start_stack_depth) += YY_START_STACK_INCR; | |
+ new_size = (yy_start_stack_depth) * sizeof( int ); | |
+ | |
+ if ( ! (yy_start_stack) ) | |
+ (yy_start_stack) = (int *) yyalloc(new_size ); | |
+ | |
+ else | |
+ (yy_start_stack) = (int *) yyrealloc((void *) (yy_start_stack),new_size ); | |
+ | |
+ if ( ! (yy_start_stack) ) | |
+ YY_FATAL_ERROR( "out of memory expanding start-condition stack" ); | |
+ } | |
+ | |
+ (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START; | |
+ | |
+ BEGIN(new_state); | |
+} | |
+ | |
+ static void yy_pop_state (void) | |
+{ | |
+ if ( --(yy_start_stack_ptr) < 0 ) | |
+ YY_FATAL_ERROR( "start-condition stack underflow" ); | |
+ | |
+ BEGIN((yy_start_stack)[(yy_start_stack_ptr)]); | |
+} | |
+ | |
+#ifndef YY_EXIT_FAILURE | |
+#define YY_EXIT_FAILURE 2 | |
+#endif | |
+ | |
+static void yy_fatal_error (yyconst char* msg ) | |
+{ | |
+ (void) fprintf( stderr, "%s\n", msg ); | |
+ exit( YY_EXIT_FAILURE ); | |
+} | |
+ | |
+/* Redefine yyless() so it works in section 3 code. */ | |
+ | |
+#undef yyless | |
+#define yyless(n) \ | |
+ do \ | |
+ { \ | |
+ /* Undo effects of setting up yytext. */ \ | |
+ int yyless_macro_arg = (n); \ | |
+ YY_LESS_LINENO(yyless_macro_arg);\ | |
+ yytext[yyleng] = (yy_hold_char); \ | |
+ (yy_c_buf_p) = yytext + yyless_macro_arg; \ | |
+ (yy_hold_char) = *(yy_c_buf_p); \ | |
+ *(yy_c_buf_p) = '\0'; \ | |
+ yyleng = yyless_macro_arg; \ | |
+ } \ | |
+ while ( 0 ) | |
+ | |
+/* Accessor methods (get/set functions) to struct members. */ | |
+ | |
+/** Get the current line number. | |
+ * | |
+ */ | |
+int yyget_lineno (void) | |
+{ | |
+ | |
+ return yylineno; | |
+} | |
+ | |
+/** Get the input stream. | |
+ * | |
+ */ | |
+FILE *yyget_in (void) | |
+{ | |
+ return yyin; | |
+} | |
+ | |
+/** Get the output stream. | |
+ * | |
+ */ | |
+FILE *yyget_out (void) | |
+{ | |
+ return yyout; | |
+} | |
+ | |
+/** Get the length of the current token. | |
+ * | |
+ */ | |
+yy_size_t yyget_leng (void) | |
+{ | |
+ return yyleng; | |
+} | |
+ | |
+/** Get the current token. | |
+ * | |
+ */ | |
+ | |
+char *yyget_text (void) | |
+{ | |
+ return yytext; | |
+} | |
+ | |
+/** Set the current line number. | |
+ * @param line_number | |
+ * | |
+ */ | |
+void yyset_lineno (int line_number ) | |
+{ | |
+ | |
+ yylineno = line_number; | |
+} | |
+ | |
+/** Set the input stream. This does not discard the current | |
+ * input buffer. | |
+ * @param in_str A readable stream. | |
+ * | |
+ * @see yy_switch_to_buffer | |
+ */ | |
+void yyset_in (FILE * in_str ) | |
+{ | |
+ yyin = in_str ; | |
+} | |
+ | |
+void yyset_out (FILE * out_str ) | |
+{ | |
+ yyout = out_str ; | |
+} | |
+ | |
+int yyget_debug (void) | |
+{ | |
+ return yy_flex_debug; | |
+} | |
+ | |
+void yyset_debug (int bdebug ) | |
+{ | |
+ yy_flex_debug = bdebug ; | |
+} | |
+ | |
+static int yy_init_globals (void) | |
+{ | |
+ /* Initialization is the same as for the non-reentrant scanner. | |
+ * This function is called from yylex_destroy(), so don't allocate here. | |
+ */ | |
+ | |
+ (yy_buffer_stack) = 0; | |
+ (yy_buffer_stack_top) = 0; | |
+ (yy_buffer_stack_max) = 0; | |
+ (yy_c_buf_p) = (char *) 0; | |
+ (yy_init) = 0; | |
+ (yy_start) = 0; | |
+ | |
+ (yy_start_stack_ptr) = 0; | |
+ (yy_start_stack_depth) = 0; | |
+ (yy_start_stack) = NULL; | |
+ | |
+ (yy_state_buf) = 0; | |
+ (yy_state_ptr) = 0; | |
+ (yy_full_match) = 0; | |
+ (yy_lp) = 0; | |
+ | |
+/* Defined in main.c */ | |
+#ifdef YY_STDINIT | |
+ yyin = stdin; | |
+ yyout = stdout; | |
+#else | |
+ yyin = (FILE *) 0; | |
+ yyout = (FILE *) 0; | |
+#endif | |
+ | |
+ /* For future reference: Set errno on error, since we are called by | |
+ * yylex_init() | |
+ */ | |
+ return 0; | |
+} | |
+ | |
+/* yylex_destroy is for both reentrant and non-reentrant scanners. */ | |
+int yylex_destroy (void) | |
+{ | |
+ | |
+ /* Pop the buffer stack, destroying each element. */ | |
+ while(YY_CURRENT_BUFFER){ | |
+ yy_delete_buffer(YY_CURRENT_BUFFER ); | |
+ YY_CURRENT_BUFFER_LVALUE = NULL; | |
+ yypop_buffer_state(); | |
+ } | |
+ | |
+ /* Destroy the stack itself. */ | |
+ yyfree((yy_buffer_stack) ); | |
+ (yy_buffer_stack) = NULL; | |
+ | |
+ /* Destroy the start condition stack. */ | |
+ yyfree((yy_start_stack) ); | |
+ (yy_start_stack) = NULL; | |
+ | |
+ yyfree ( (yy_state_buf) ); | |
+ (yy_state_buf) = NULL; | |
+ | |
+ /* Reset the globals. This is important in a non-reentrant scanner so the next time | |
+ * yylex() is called, initialization will occur. */ | |
+ yy_init_globals( ); | |
+ | |
+ return 0; | |
+} | |
+ | |
+/* | |
+ * Internal utility routines. | |
+ */ | |
+ | |
+#ifndef yytext_ptr | |
+static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) | |
+{ | |
+ register int i; | |
+ for ( i = 0; i < n; ++i ) | |
+ s1[i] = s2[i]; | |
+} | |
+#endif | |
+ | |
+#ifdef YY_NEED_STRLEN | |
+static int yy_flex_strlen (yyconst char * s ) | |
+{ | |
+ register int n; | |
+ for ( n = 0; s[n]; ++n ) | |
+ ; | |
+ | |
+ return n; | |
+} | |
+#endif | |
+ | |
+void *yyalloc (yy_size_t size ) | |
+{ | |
+ return (void *) malloc( size ); | |
+} | |
+ | |
+void *yyrealloc (void * ptr, yy_size_t size ) | |
+{ | |
+ /* The cast to (char *) in the following accommodates both | |
+ * implementations that use char* generic pointers, and those | |
+ * that use void* generic pointers. It works with the latter | |
+ * because both ANSI C and C++ allow castless assignment from | |
+ * any pointer type to void*, and deal with argument conversions | |
+ * as though doing an assignment. | |
+ */ | |
+ return (void *) realloc( (char *) ptr, size ); | |
+} | |
+ | |
+void yyfree (void * ptr ) | |
+{ | |
+ free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ | |
+} | |
+ | |
+#define YYTABLES_NAME "yytables" | |
+ | |
+#line 969 "scan.l" | |
+ | |
+ | |
+ | |
+ | |
+int yywrap() | |
+ { | |
+ if ( --num_input_files > 0 ) | |
+ { | |
+ set_input_file( *++input_files ); | |
+ return 0; | |
+ } | |
+ | |
+ else | |
+ return 1; | |
+ } | |
+ | |
+ | |
+/* set_input_file - open the given file (if NULL, stdin) for scanning */ | |
+ | |
+void set_input_file( file ) | |
+char *file; | |
+ { | |
+ if ( file && strcmp( file, "-" ) ) | |
+ { | |
+ infilename = copy_string( file ); | |
+ yyin = fopen( infilename, "r" ); | |
+ | |
+ if ( yyin == NULL ) | |
+ lerrsf( _( "can't open %s" ), file ); | |
+ } | |
+ | |
+ else | |
+ { | |
+ yyin = stdin; | |
+ infilename = copy_string( "<stdin>" ); | |
+ } | |
+ | |
+ linenum = 1; | |
+ } | |
+ | |
+ | |
+/* Wrapper routines for accessing the scanner's malloc routines. */ | |
+ | |
+void *flex_alloc( size ) | |
+size_t size; | |
+ { | |
+ return (void *) malloc( size ); | |
+ } | |
+ | |
+void *flex_realloc( ptr, size ) | |
+void *ptr; | |
+size_t size; | |
+ { | |
+ return (void *) realloc( ptr, size ); | |
+ } | |
+ | |
+void flex_free( ptr ) | |
+void *ptr; | |
+ { | |
+ if ( ptr ) | |
+ free( ptr ); | |
+ } | |
+ | |
diff -Pu flex-2.5.39/initskel.c openbsd-flex/initskel.c | |
--- flex-2.5.39/initskel.c Wed Dec 31 16:00:00 1969 | |
+++ openbsd-flex/initskel.c Mon Nov 2 08:48:35 2015 | |
@@ -0,0 +1,3730 @@ | |
+/* File created from flex.skl via mkskel.sh */ | |
+ | |
+#include "flexdef.h" | |
+ | |
+const char *skel[] = { | |
+ "%# -*-C-*- vi: set ft=c:", | |
+ "%# This file is processed in several stages.", | |
+ "%# Here are the stages, as best as I can describe:", | |
+ "%#", | |
+ "%# 1. flex.skl is processed through GNU m4 during the", | |
+ "%# pre-compilation stage of flex. Only macros starting", | |
+ "%# with `m4_' are processed, and quoting is normal.", | |
+ "%#", | |
+ "%# 2. The preprocessed skeleton is translated verbatim into a", | |
+ "%# C array, saved as \"skel.c\" and compiled into the flex binary.", | |
+ "%#", | |
+ "%# 3. At runtime, the skeleton is generated and filtered (again)", | |
+ "%# through m4. Macros beginning with `m4_' will be processed.", | |
+ "%# The quoting is \"[[\" and \"]]\" so we don't interfere with", | |
+ "%# user code.", | |
+ "%# ", | |
+ "%# All generate macros for the m4 stage contain the text \"m4\" or \"M4\"", | |
+ "%# in them. This is to distinguish them from CPP macros.", | |
+ "%# The exception to this rule is YY_G, which is an m4 macro, ", | |
+ "%# but it needs to be remain short because it is used everywhere.", | |
+ "%#", | |
+ "/* A lexical scanner generated by flex */", | |
+ "", | |
+ "%# Macros for preproc stage.", | |
+ "", | |
+ "", | |
+ "%# Macros for runtime processing stage.", | |
+ "m4_changecom", | |
+ "m4_changequote", | |
+ "m4_changequote([[, ]])", | |
+ "", | |
+ "%# ", | |
+ "%# Lines in this skeleton starting with a \"%\" character are \"control lines\"", | |
+ "%# and affect the generation of the scanner. The possible control codes are", | |
+ "%# listed and processed in misc.c.", | |
+ "%#", | |
+ "%# %# - A comment. The current line is omitted from the generated scanner.", | |
+ "%# %if-c++-only - The following lines are printed for C++ scanners ONLY.", | |
+ "%# %if-c-only - The following lines are NOT printed for C++ scanners.", | |
+ "%# %if-c-or-c++ - The following lines are printed in BOTH C and C++ scanners.", | |
+ "%# %if-reentrant - Print for reentrant scanners.(push)", | |
+ "%# %if-not-reentrant - Print for non-reentrant scanners. (push)", | |
+ "%# %if-bison-bridge - Print for bison-bridge. (push)", | |
+ "%# %if-not-bison-bridge - Print for non-bison-bridge. (push)", | |
+ "%# %endif - pop from the previous if code.", | |
+ "%# %% - A stop-point, where code is inserted by flex.", | |
+ "%# Each stop-point is numbered here and also in the code generator.", | |
+ "%# (See gen.c, etc. for details.)", | |
+ "%# %not-for-header - Begin code that should NOT appear in a \".h\" file.", | |
+ "%# %ok-for-header - %c and %e are used for building a header file.", | |
+ "%# %if-tables-serialization", | |
+ "%#", | |
+ "%# All control-lines EXCEPT comment lines (\"%#\") will be inserted into", | |
+ "%# the generated scanner as a C-style comment. This is to aid those who", | |
+ "%# edit the skeleton.", | |
+ "%#", | |
+ "", | |
+ "%not-for-header", | |
+ "%if-c-only", | |
+ "%if-not-reentrant", | |
+ "m4_ifelse(M4_YY_PREFIX,yy,,", | |
+ "#define yy_create_buffer M4_YY_PREFIX[[_create_buffer]]", | |
+ "#define yy_delete_buffer M4_YY_PREFIX[[_delete_buffer]]", | |
+ "#define yy_flex_debug M4_YY_PREFIX[[_flex_debug]]", | |
+ "#define yy_init_buffer M4_YY_PREFIX[[_init_buffer]]", | |
+ "#define yy_flush_buffer M4_YY_PREFIX[[_flush_buffer]]", | |
+ "#define yy_load_buffer_state M4_YY_PREFIX[[_load_buffer_state]]", | |
+ "#define yy_switch_to_buffer M4_YY_PREFIX[[_switch_to_buffer]]", | |
+ "#define yyin M4_YY_PREFIX[[in]]", | |
+ "#define yyleng M4_YY_PREFIX[[leng]]", | |
+ "#define yylex M4_YY_PREFIX[[lex]]", | |
+ "#define yylineno M4_YY_PREFIX[[lineno]]", | |
+ "#define yyout M4_YY_PREFIX[[out]]", | |
+ "#define yyrestart M4_YY_PREFIX[[restart]]", | |
+ "#define yytext M4_YY_PREFIX[[text]]", | |
+ "#define yywrap M4_YY_PREFIX[[wrap]]", | |
+ "#define yyalloc M4_YY_PREFIX[[alloc]]", | |
+ "#define yyrealloc M4_YY_PREFIX[[realloc]]", | |
+ "#define yyfree M4_YY_PREFIX[[free]]", | |
+ ")", | |
+ "%endif", | |
+ "%endif", | |
+ "%ok-for-header", | |
+ "", | |
+ "#define FLEX_SCANNER", | |
+ "#define YY_FLEX_MAJOR_VERSION 2", | |
+ "#define YY_FLEX_MINOR_VERSION 5", | |
+ "#define YY_FLEX_SUBMINOR_VERSION 39", | |
+ "#if YY_FLEX_SUBMINOR_VERSION > 0", | |
+ "#define FLEX_BETA", | |
+ "#endif", | |
+ "", | |
+ "%# Some negated symbols", | |
+ "m4_ifdef( [[M4_YY_IN_HEADER]], , [[m4_define([[M4_YY_NOT_IN_HEADER]], [[]])]])", | |
+ "m4_ifdef( [[M4_YY_REENTRANT]], , [[m4_define([[M4_YY_NOT_REENTRANT]], [[]])]])", | |
+ "", | |
+ "%# This is the m4 way to say \"(stack_used || is_reentrant)", | |
+ "m4_ifdef( [[M4_YY_STACK_USED]], [[m4_define([[M4_YY_HAS_START_STACK_VARS]])]])", | |
+ "m4_ifdef( [[M4_YY_REENTRANT]], [[m4_define([[M4_YY_HAS_START_STACK_VARS]])]])", | |
+ "", | |
+ "%# Prefixes.", | |
+ "%# The complexity here is necessary so that m4 preserves", | |
+ "%# the argument lists to each C function.", | |
+ "", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_PREFIX]],, [[m4_define([[M4_YY_PREFIX]], [[yy]])]])", | |
+ "", | |
+ "", | |
+ "", | |
+ "%if-c++-only", | |
+ " /* The c++ scanner is a mess. The FlexLexer.h header file relies on the", | |
+ " * following macro. This is required in order to pass the c++-multiple-scanners", | |
+ " * test in the regression suite. We get reports that it breaks inheritance.", | |
+ " * We will address this in a future release of flex, or omit the C++ scanner", | |
+ " * altogether.", | |
+ " */", | |
+ " #define yyFlexLexer M4_YY_PREFIX[[FlexLexer]]", | |
+ "%endif", | |
+ "", | |
+ "%if-c-only", | |
+ " m4_define(yy[[_create_buffer]], [[M4_YY_PREFIX[[_create_buffer]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_define(yy[[_delete_buffer]], [[M4_YY_PREFIX[[_delete_buffer]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_define(yy[[_scan_buffer]], [[M4_YY_PREFIX[[_scan_buffer]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_define(yy[[_scan_string]], [[M4_YY_PREFIX[[_scan_string]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_define(yy[[_scan_bytes]], [[M4_YY_PREFIX[[_scan_bytes]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_define(yy[[_init_buffer]], [[M4_YY_PREFIX[[_init_buffer]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_define(yy[[_flush_buffer]], [[M4_YY_PREFIX[[_flush_buffer]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_define(yy[[_load_buffer_state]], [[M4_YY_PREFIX[[_load_buffer_state]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_define(yy[[_switch_to_buffer]], [[M4_YY_PREFIX[[_switch_to_buffer]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_define(yy[[push_buffer_state]], [[M4_YY_PREFIX[[push_buffer_state]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_define(yy[[pop_buffer_state]], [[M4_YY_PREFIX[[pop_buffer_state]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_define(yy[[ensure_buffer_stack]], [[M4_YY_PREFIX[[ensure_buffer_stack]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_define(yy[[lex]], [[M4_YY_PREFIX[[lex]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_define(yy[[restart]], [[M4_YY_PREFIX[[restart]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_define(yy[[lex_init]], [[M4_YY_PREFIX[[lex_init]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_define(yy[[lex_init_extra]], [[M4_YY_PREFIX[[lex_init_extra]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_define(yy[[lex_destroy]], [[M4_YY_PREFIX[[lex_destroy]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_define(yy[[get_debug]], [[M4_YY_PREFIX[[get_debug]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_define(yy[[set_debug]], [[M4_YY_PREFIX[[set_debug]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_define(yy[[get_extra]], [[M4_YY_PREFIX[[get_extra]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_define(yy[[set_extra]], [[M4_YY_PREFIX[[set_extra]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_define(yy[[get_in]], [[M4_YY_PREFIX[[get_in]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_define(yy[[set_in]], [[M4_YY_PREFIX[[set_in]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_define(yy[[get_out]], [[M4_YY_PREFIX[[get_out]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_define(yy[[set_out]], [[M4_YY_PREFIX[[set_out]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_define(yy[[get_leng]], [[M4_YY_PREFIX[[get_leng]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_define(yy[[get_text]], [[M4_YY_PREFIX[[get_text]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_define(yy[[get_lineno]], [[M4_YY_PREFIX[[get_lineno]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_define(yy[[set_lineno]], [[M4_YY_PREFIX[[set_lineno]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_ifdef( [[M4_YY_REENTRANT]],", | |
+ " [[", | |
+ " m4_define(yy[[get_column]], [[M4_YY_PREFIX[[get_column]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_define(yy[[set_column]], [[M4_YY_PREFIX[[set_column]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " ]])", | |
+ " m4_define(yy[[wrap]], [[M4_YY_PREFIX[[wrap]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ "%endif", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_BISON_LVAL]],", | |
+ "[[", | |
+ " m4_define(yy[[get_lval]], [[M4_YY_PREFIX[[get_lval]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_define(yy[[set_lval]], [[M4_YY_PREFIX[[set_lval]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[<M4_YY_BISON_LLOC>]],", | |
+ "[[", | |
+ " m4_define(yy[[get_lloc]], [[M4_YY_PREFIX[[get_lloc]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_define(yy[[set_lloc]], [[M4_YY_PREFIX[[set_lloc]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ "]])", | |
+ "", | |
+ "", | |
+ " m4_define(yy[[alloc]], [[M4_YY_PREFIX[[alloc]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_define(yy[[realloc]], [[M4_YY_PREFIX[[realloc]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_define(yy[[free]], [[M4_YY_PREFIX[[free]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ "", | |
+ "%if-c-only", | |
+ "m4_ifdef( [[M4_YY_NOT_REENTRANT]],", | |
+ "[[", | |
+ " m4_define(yy[[text]], [[M4_YY_PREFIX[[text]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_define(yy[[leng]], [[M4_YY_PREFIX[[leng]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_define(yy[[in]], [[M4_YY_PREFIX[[in]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_define(yy[[out]], [[M4_YY_PREFIX[[out]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_define(yy[[_flex_debug]], [[M4_YY_PREFIX[[_flex_debug]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_define(yy[[lineno]], [[M4_YY_PREFIX[[lineno]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ "]])", | |
+ "%endif", | |
+ "", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_TABLES_EXTERNAL]],", | |
+ "[[", | |
+ " m4_define(yy[[tables_fload]], [[M4_YY_PREFIX[[tables_fload]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_define(yy[[tables_destroy]], [[M4_YY_PREFIX[[tables_destroy]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ " m4_define(yy[[TABLES_NAME]], [[M4_YY_PREFIX[[TABLES_NAME]]m4_ifelse($#,0,,[[($@)]])]])", | |
+ "]])", | |
+ "", | |
+ "/* First, we deal with platform-specific or compiler-specific issues. */", | |
+ "", | |
+ "/* begin standard C headers. */", | |
+ "%if-c-only", | |
+ "#include <stdio.h>", | |
+ "#include <string.h>", | |
+ "#include <errno.h>", | |
+ "#include <stdlib.h>", | |
+ "%endif", | |
+ "", | |
+ "%if-tables-serialization", | |
+ "#include <sys/types.h>", | |
+ "#include <netinet/in.h>", | |
+ "%endif", | |
+ "/* end standard C headers. */", | |
+ "", | |
+ "%if-c-or-c++", | |
+ "/* flex integer type definitions */", | |
+ "", | |
+ "#ifndef FLEXINT_H", | |
+ "#define FLEXINT_H", | |
+ "", | |
+ "/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */", | |
+ "", | |
+ "#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L", | |
+ "", | |
+ "/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,", | |
+ " * if you want the limit (max/min) macros for int types. ", | |
+ " */", | |
+ "#ifndef __STDC_LIMIT_MACROS", | |
+ "#define __STDC_LIMIT_MACROS 1", | |
+ "#endif", | |
+ "", | |
+ "#include <inttypes.h>", | |
+ "typedef int8_t flex_int8_t;", | |
+ "typedef uint8_t flex_uint8_t;", | |
+ "typedef int16_t flex_int16_t;", | |
+ "typedef uint16_t flex_uint16_t;", | |
+ "typedef int32_t flex_int32_t;", | |
+ "typedef uint32_t flex_uint32_t;", | |
+ "#else", | |
+ "typedef signed char flex_int8_t;", | |
+ "typedef short int flex_int16_t;", | |
+ "typedef int flex_int32_t;", | |
+ "typedef unsigned char flex_uint8_t; ", | |
+ "typedef unsigned short int flex_uint16_t;", | |
+ "typedef unsigned int flex_uint32_t;", | |
+ "", | |
+ "/* Limits of integral types. */", | |
+ "#ifndef INT8_MIN", | |
+ "#define INT8_MIN (-128)", | |
+ "#endif", | |
+ "#ifndef INT16_MIN", | |
+ "#define INT16_MIN (-32767-1)", | |
+ "#endif", | |
+ "#ifndef INT32_MIN", | |
+ "#define INT32_MIN (-2147483647-1)", | |
+ "#endif", | |
+ "#ifndef INT8_MAX", | |
+ "#define INT8_MAX (127)", | |
+ "#endif", | |
+ "#ifndef INT16_MAX", | |
+ "#define INT16_MAX (32767)", | |
+ "#endif", | |
+ "#ifndef INT32_MAX", | |
+ "#define INT32_MAX (2147483647)", | |
+ "#endif", | |
+ "#ifndef UINT8_MAX", | |
+ "#define UINT8_MAX (255U)", | |
+ "#endif", | |
+ "#ifndef UINT16_MAX", | |
+ "#define UINT16_MAX (65535U)", | |
+ "#endif", | |
+ "#ifndef UINT32_MAX", | |
+ "#define UINT32_MAX (4294967295U)", | |
+ "#endif", | |
+ "", | |
+ "#endif /* ! C99 */", | |
+ "", | |
+ "#endif /* ! FLEXINT_H */", | |
+ "", | |
+ "%endif", | |
+ "", | |
+ "%if-c++-only", | |
+ "/* begin standard C++ headers. */", | |
+ "#include <iostream> ", | |
+ "#include <errno.h>", | |
+ "#include <cstdlib>", | |
+ "#include <cstdio>", | |
+ "#include <cstring>", | |
+ "/* end standard C++ headers. */", | |
+ "%endif", | |
+ "", | |
+ "#ifdef __cplusplus", | |
+ "", | |
+ "/* The \"const\" storage-class-modifier is valid. */", | |
+ "#define YY_USE_CONST", | |
+ "", | |
+ "#else /* ! __cplusplus */", | |
+ "", | |
+ "/* C99 requires __STDC__ to be defined as 1. */", | |
+ "#if defined (__STDC__)", | |
+ "", | |
+ "#define YY_USE_CONST", | |
+ "", | |
+ "#endif /* defined (__STDC__) */", | |
+ "#endif /* ! __cplusplus */", | |
+ "", | |
+ "#ifdef YY_USE_CONST", | |
+ "#define yyconst const", | |
+ "#else", | |
+ "#define yyconst", | |
+ "#endif", | |
+ "", | |
+ "%# For compilers that can not handle prototypes.", | |
+ "%# e.g.,", | |
+ "%# The function prototype", | |
+ "%# int foo(int x, char* y);", | |
+ "%# ", | |
+ "%# ...should be written as", | |
+ "%# int foo M4_YY_PARAMS(int x, char* y);", | |
+ "%# ", | |
+ "%# ...which could possibly generate", | |
+ "%# int foo ();", | |
+ "%# ", | |
+ "m4_ifdef( [[M4_YY_NO_ANSI_FUNC_PROTOS]],", | |
+ "[[", | |
+ " m4_define( [[M4_YY_PARAMS]], [[()]])", | |
+ "]],", | |
+ "[[", | |
+ " m4_define( [[M4_YY_PARAMS]], [[($*)]])", | |
+ "]])", | |
+ "", | |
+ "%not-for-header", | |
+ "/* Returned upon end-of-file. */", | |
+ "#define YY_NULL 0", | |
+ "%ok-for-header", | |
+ "", | |
+ "%not-for-header", | |
+ "/* Promotes a possibly negative, possibly signed char to an unsigned", | |
+ " * integer for use as an array index. If the signed char is negative,", | |
+ " * we want to instead treat it as an 8-bit unsigned char, hence the", | |
+ " * double cast.", | |
+ " */", | |
+ "#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)", | |
+ "%ok-for-header", | |
+ "", | |
+ "", | |
+ "", | |
+ "%if-reentrant", | |
+ "", | |
+ "/* An opaque pointer. */", | |
+ "#ifndef YY_TYPEDEF_YY_SCANNER_T", | |
+ "#define YY_TYPEDEF_YY_SCANNER_T", | |
+ "typedef void* yyscan_t;", | |
+ "#endif", | |
+ "", | |
+ "%# Declare yyguts variable", | |
+ "m4_define( [[M4_YY_DECL_GUTS_VAR]], [[struct yyguts_t * yyg = (struct yyguts_t*)yyscanner]])", | |
+ "%# Perform a noop access on yyguts to prevent unused variable complains", | |
+ "m4_define( [[M4_YY_NOOP_GUTS_VAR]], [[(void)yyg]])", | |
+ "%# For use wherever a Global is accessed or assigned.", | |
+ "m4_define( [[YY_G]], [[yyg->$1]])", | |
+ "", | |
+ "%# For use in function prototypes to append the additional argument.", | |
+ "m4_define( [[M4_YY_PROTO_LAST_ARG]], [[, yyscan_t yyscanner]])", | |
+ "m4_define( [[M4_YY_PROTO_ONLY_ARG]], [[yyscan_t yyscanner]])", | |
+ "", | |
+ "%# For use in function definitions to append the additional argument.", | |
+ "m4_ifdef( [[M4_YY_NO_ANSI_FUNC_DEFS]],", | |
+ "[[", | |
+ " m4_define( [[M4_YY_DEF_LAST_ARG]], [[, yyscanner]])", | |
+ " m4_define( [[M4_YY_DEF_ONLY_ARG]], [[yyscanner]])", | |
+ "]],", | |
+ "[[", | |
+ " m4_define( [[M4_YY_DEF_LAST_ARG]], [[, yyscan_t yyscanner]])", | |
+ " m4_define( [[M4_YY_DEF_ONLY_ARG]], [[yyscan_t yyscanner]])", | |
+ "]])", | |
+ "m4_define( [[M4_YY_DECL_LAST_ARG]], [[yyscan_t yyscanner;]])", | |
+ "", | |
+ "%# For use in function calls to pass the additional argument.", | |
+ "m4_define( [[M4_YY_CALL_LAST_ARG]], [[, yyscanner]])", | |
+ "m4_define( [[M4_YY_CALL_ONLY_ARG]], [[yyscanner]])", | |
+ "", | |
+ "%# For use in function documentation to adjust for additional argument.", | |
+ "m4_define( [[M4_YY_DOC_PARAM]], [[@param yyscanner The scanner object.]])", | |
+ "", | |
+ "/* For convenience, these vars (plus the bison vars far below)", | |
+ " are macros in the reentrant scanner. */", | |
+ "#define yyin YY_G(yyin_r)", | |
+ "#define yyout YY_G(yyout_r)", | |
+ "#define yyextra YY_G(yyextra_r)", | |
+ "#define yyleng YY_G(yyleng_r)", | |
+ "#define yytext YY_G(yytext_r)", | |
+ "#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)", | |
+ "#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)", | |
+ "#define yy_flex_debug YY_G(yy_flex_debug_r)", | |
+ "", | |
+ "m4_define( [[M4_YY_INCR_LINENO]],", | |
+ "[[ ", | |
+ " do{ yylineno++;", | |
+ " yycolumn=0;", | |
+ " }while(0)", | |
+ "]])", | |
+ "", | |
+ "%endif", | |
+ "", | |
+ "", | |
+ "", | |
+ "%if-not-reentrant", | |
+ "", | |
+ "m4_define( [[M4_YY_INCR_LINENO]],", | |
+ "[[ ", | |
+ " yylineno++;", | |
+ "]])", | |
+ "", | |
+ "%# Define these macros to be no-ops.", | |
+ "m4_define( [[M4_YY_DECL_GUTS_VAR]], [[m4_dnl]])", | |
+ "m4_define( [[M4_YY_NOOP_GUTS_VAR]], [[m4_dnl]])", | |
+ "m4_define( [[YY_G]], [[($1)]])", | |
+ "m4_define( [[M4_YY_PROTO_LAST_ARG]])", | |
+ "m4_define( [[M4_YY_PROTO_ONLY_ARG]], [[void]])", | |
+ "m4_define( [[M4_YY_DEF_LAST_ARG]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NO_ANSI_FUNC_DEFS]],", | |
+ "[[", | |
+ " m4_define( [[M4_YY_DEF_ONLY_ARG]])", | |
+ "]],", | |
+ "[[", | |
+ " m4_define( [[M4_YY_DEF_ONLY_ARG]], [[void]])", | |
+ "]])", | |
+ "m4_define([[M4_YY_DECL_LAST_ARG]])", | |
+ "m4_define([[M4_YY_CALL_LAST_ARG]])", | |
+ "m4_define([[M4_YY_CALL_ONLY_ARG]])", | |
+ "m4_define( [[M4_YY_DOC_PARAM]], [[]])", | |
+ "", | |
+ "%endif", | |
+ "", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NO_ANSI_FUNC_DEFS]],", | |
+ "[[", | |
+ "%# For compilers that need traditional function definitions.", | |
+ "%# e.g.,", | |
+ "%# The function prototype taking 2 arguments", | |
+ "%# int foo (int x, char* y)", | |
+ "%#", | |
+ "%# ...should be written as", | |
+ "%# int foo YYFARGS2(int,x, char*,y)", | |
+ "%#", | |
+ "%# ...which could possibly generate", | |
+ "%# int foo (x,y,yyscanner)", | |
+ "%# int x;", | |
+ "%# char * y;", | |
+ "%# yyscan_t yyscanner;", | |
+ "%#", | |
+ "%# Generate traditional function defs", | |
+ " m4_define( [[YYFARGS0]], [[(M4_YY_DEF_ONLY_ARG) [[\\]]", | |
+ " M4_YY_DECL_LAST_ARG]])", | |
+ " m4_define( [[YYFARGS1]], [[($2 M4_YY_DEF_LAST_ARG) [[\\]]", | |
+ " $1 $2; [[\\]]", | |
+ " M4_YY_DECL_LAST_ARG]])", | |
+ " m4_define( [[YYFARGS2]], [[($2,$4 M4_YY_DEF_LAST_ARG) [[\\]]", | |
+ " $1 $2; [[\\]]", | |
+ " $3 $4; [[\\]]", | |
+ " M4_YY_DECL_LAST_ARG]])", | |
+ " m4_define( [[YYFARGS3]], [[($2,$4,$6 M4_YY_DEF_LAST_ARG) [[\\]]", | |
+ " $1 $2; [[\\]]", | |
+ " $3 $4; [[\\]]", | |
+ " $5 $6; [[\\]]", | |
+ " M4_YY_DECL_LAST_ARG]])", | |
+ "]],", | |
+ "[[", | |
+ "%# Generate C99 function defs.", | |
+ " m4_define( [[YYFARGS0]], [[(M4_YY_DEF_ONLY_ARG)]])", | |
+ " m4_define( [[YYFARGS1]], [[($1 $2 M4_YY_DEF_LAST_ARG)]])", | |
+ " m4_define( [[YYFARGS2]], [[($1 $2, $3 $4 M4_YY_DEF_LAST_ARG)]])", | |
+ " m4_define( [[YYFARGS3]], [[($1 $2, $3 $4, $5 $6 M4_YY_DEF_LAST_ARG)]])", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],", | |
+ "[[", | |
+ "/* Enter a start condition. This macro really ought to take a parameter,", | |
+ " * but we do it the disgusting crufty way forced on us by the ()-less", | |
+ " * definition of BEGIN.", | |
+ " */", | |
+ "#define BEGIN YY_G(yy_start) = 1 + 2 *", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],", | |
+ "[[", | |
+ "/* Translate the current start state into a value that can be later handed", | |
+ " * to BEGIN to return to the state. The YYSTATE alias is for lex", | |
+ " * compatibility.", | |
+ " */", | |
+ "#define YY_START ((YY_G(yy_start) - 1) / 2)", | |
+ "#define YYSTATE YY_START", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],", | |
+ "[[", | |
+ "/* Action number for EOF rule of a given start state. */", | |
+ "#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],", | |
+ "[[", | |
+ "/* Special action meaning \"start processing a new file\". */", | |
+ "#define YY_NEW_FILE yyrestart( yyin M4_YY_CALL_LAST_ARG )", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],", | |
+ "[[", | |
+ "#define YY_END_OF_BUFFER_CHAR 0", | |
+ "]])", | |
+ "", | |
+ "/* Size of default input buffer. */", | |
+ "#ifndef YY_BUF_SIZE", | |
+ "#define YY_BUF_SIZE 16384", | |
+ "#endif", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],", | |
+ "[[", | |
+ "/* The state buf must be large enough to hold one state per character in the main buffer.", | |
+ " */", | |
+ "#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))", | |
+ "]])", | |
+ "", | |
+ "", | |
+ "#ifndef YY_TYPEDEF_YY_BUFFER_STATE", | |
+ "#define YY_TYPEDEF_YY_BUFFER_STATE", | |
+ "typedef struct yy_buffer_state *YY_BUFFER_STATE;", | |
+ "#endif", | |
+ "", | |
+ "#ifndef YY_TYPEDEF_YY_SIZE_T", | |
+ "#define YY_TYPEDEF_YY_SIZE_T", | |
+ "typedef size_t yy_size_t;", | |
+ "#endif", | |
+ "", | |
+ "%if-not-reentrant", | |
+ "extern yy_size_t yyleng;", | |
+ "%endif", | |
+ "", | |
+ "%if-c-only", | |
+ "%if-not-reentrant", | |
+ "extern FILE *yyin, *yyout;", | |
+ "%endif", | |
+ "%endif", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],", | |
+ "[[", | |
+ "#define EOB_ACT_CONTINUE_SCAN 0", | |
+ "#define EOB_ACT_END_OF_FILE 1", | |
+ "#define EOB_ACT_LAST_MATCH 2", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],", | |
+ "[[", | |
+ " m4_ifdef( [[M4_YY_USE_LINENO]],", | |
+ " [[", | |
+ " /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires", | |
+ " * access to the local variable yy_act. Since yyless() is a macro, it would break", | |
+ " * existing scanners that call yyless() from OUTSIDE yylex. ", | |
+ " * One obvious solution it to make yy_act a global. I tried that, and saw", | |
+ " * a 5% performance hit in a non-yylineno scanner, because yy_act is", | |
+ " * normally declared as a register variable-- so it is not worth it.", | |
+ " */", | |
+ " #define YY_LESS_LINENO(n) \\", | |
+ " do { \\", | |
+ " int yyl;\\", | |
+ " for ( yyl = n; yyl < yyleng; ++yyl )\\", | |
+ " if ( yytext[yyl] == '\\n' )\\", | |
+ " --yylineno;\\", | |
+ " }while(0)", | |
+ " #define YY_LINENO_REWIND_TO(dst) \\", | |
+ " do {\\", | |
+ " const char *p;\\", | |
+ " for ( p = yy_cp-1; p >= (dst); --p)\\", | |
+ " if ( *p == '\\n' )\\", | |
+ " --yylineno;\\", | |
+ " }while(0)", | |
+ " ]],", | |
+ " [[", | |
+ " #define YY_LESS_LINENO(n)", | |
+ " #define YY_LINENO_REWIND_TO(ptr)", | |
+ " ]])", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],", | |
+ "[[", | |
+ "/* Return all but the first \"n\" matched characters back to the input stream. */", | |
+ "#define yyless(n) \\", | |
+ " do \\", | |
+ " { \\", | |
+ " /* Undo effects of setting up yytext. */ \\", | |
+ " int yyless_macro_arg = (n); \\", | |
+ " YY_LESS_LINENO(yyless_macro_arg);\\", | |
+ " *yy_cp = YY_G(yy_hold_char); \\", | |
+ " YY_RESTORE_YY_MORE_OFFSET \\", | |
+ " YY_G(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \\", | |
+ " YY_DO_BEFORE_ACTION; /* set up yytext again */ \\", | |
+ " } \\", | |
+ " while ( 0 )", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],", | |
+ "[[", | |
+ "#define unput(c) yyunput( c, YY_G(yytext_ptr) M4_YY_CALL_LAST_ARG )", | |
+ "]])", | |
+ "", | |
+ "#ifndef YY_STRUCT_YY_BUFFER_STATE", | |
+ "#define YY_STRUCT_YY_BUFFER_STATE", | |
+ "struct yy_buffer_state", | |
+ " {", | |
+ "%if-c-only", | |
+ " FILE *yy_input_file;", | |
+ "%endif", | |
+ "", | |
+ "%if-c++-only", | |
+ " std::istream* yy_input_file;", | |
+ "%endif", | |
+ "", | |
+ "", | |
+ " char *yy_ch_buf; /* input buffer */", | |
+ " char *yy_buf_pos; /* current position in input buffer */", | |
+ "", | |
+ " /* Size of input buffer in bytes, not including room for EOB", | |
+ " * characters.", | |
+ " */", | |
+ " yy_size_t yy_buf_size;", | |
+ "", | |
+ " /* Number of characters read into yy_ch_buf, not including EOB", | |
+ " * characters.", | |
+ " */", | |
+ " yy_size_t yy_n_chars;", | |
+ "", | |
+ " /* Whether we \"own\" the buffer - i.e., we know we created it,", | |
+ " * and can realloc() it to grow it, and should free() it to", | |
+ " * delete it.", | |
+ " */", | |
+ " int yy_is_our_buffer;", | |
+ "", | |
+ " /* Whether this is an \"interactive\" input source; if so, and", | |
+ " * if we're using stdio for input, then we want to use getc()", | |
+ " * instead of fread(), to make sure we stop fetching input after", | |
+ " * each newline.", | |
+ " */", | |
+ " int yy_is_interactive;", | |
+ "", | |
+ " /* Whether we're considered to be at the beginning of a line.", | |
+ " * If so, '^' rules will be active on the next match, otherwise", | |
+ " * not.", | |
+ " */", | |
+ " int yy_at_bol;", | |
+ "", | |
+ " int yy_bs_lineno; /**< The line count. */", | |
+ " int yy_bs_column; /**< The column count. */", | |
+ " ", | |
+ "", | |
+ " /* Whether to try to fill the input buffer when we reach the", | |
+ " * end of it.", | |
+ " */", | |
+ " int yy_fill_buffer;", | |
+ "", | |
+ " int yy_buffer_status;", | |
+ "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],", | |
+ "[[", | |
+ "#define YY_BUFFER_NEW 0", | |
+ "#define YY_BUFFER_NORMAL 1", | |
+ " /* When an EOF's been seen but there's still some text to process", | |
+ " * then we mark the buffer as YY_EOF_PENDING, to indicate that we", | |
+ " * shouldn't try reading from the input source any more. We might", | |
+ " * still have a bunch of tokens to match, though, because of", | |
+ " * possible backing-up.", | |
+ " *", | |
+ " * When we actually see the EOF, we change the status to \"new\"", | |
+ " * (via yyrestart()), so that the user can continue scanning by", | |
+ " * just pointing yyin at a new input file.", | |
+ " */", | |
+ "#define YY_BUFFER_EOF_PENDING 2", | |
+ "]])", | |
+ " };", | |
+ "#endif /* !YY_STRUCT_YY_BUFFER_STATE */", | |
+ "", | |
+ "%if-c-only Standard (non-C++) definition", | |
+ "%not-for-header", | |
+ "%if-not-reentrant", | |
+ "", | |
+ "/* Stack of input buffers. */", | |
+ "static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */", | |
+ "static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */", | |
+ "static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */", | |
+ "%endif", | |
+ "%ok-for-header", | |
+ "%endif", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],", | |
+ "[[", | |
+ "/* We provide macros for accessing buffer states in case in the", | |
+ " * future we want to put the buffer states in a more general", | |
+ " * \"scanner state\".", | |
+ " *", | |
+ " * Returns the top of the stack, or NULL.", | |
+ " */", | |
+ "#define YY_CURRENT_BUFFER ( YY_G(yy_buffer_stack) \\", | |
+ " ? YY_G(yy_buffer_stack)[YY_G(yy_buffer_stack_top)] \\", | |
+ " : NULL)", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],", | |
+ "[[", | |
+ "/* Same as previous macro, but useful when we know that the buffer stack is not", | |
+ " * NULL or when we need an lvalue. For internal use only.", | |
+ " */", | |
+ "#define YY_CURRENT_BUFFER_LVALUE YY_G(yy_buffer_stack)[YY_G(yy_buffer_stack_top)]", | |
+ "]])", | |
+ "", | |
+ "%if-c-only Standard (non-C++) definition", | |
+ "", | |
+ "%if-not-reentrant", | |
+ "%not-for-header", | |
+ "/* yy_hold_char holds the character lost when yytext is formed. */", | |
+ "static char yy_hold_char;", | |
+ "static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */", | |
+ "yy_size_t yyleng;", | |
+ "", | |
+ "/* Points to current character in buffer. */", | |
+ "static char *yy_c_buf_p = (char *) 0;", | |
+ "static int yy_init = 0; /* whether we need to initialize */", | |
+ "static int yy_start = 0; /* start state number */", | |
+ "", | |
+ "/* Flag which is used to allow yywrap()'s to do buffer switches", | |
+ " * instead of setting up a fresh yyin. A bit of a hack ...", | |
+ " */", | |
+ "static int yy_did_buffer_switch_on_eof;", | |
+ "%ok-for-header", | |
+ "%endif", | |
+ "", | |
+ "void yyrestart M4_YY_PARAMS( FILE *input_file M4_YY_PROTO_LAST_ARG );", | |
+ "void yy_switch_to_buffer M4_YY_PARAMS( YY_BUFFER_STATE new_buffer M4_YY_PROTO_LAST_ARG );", | |
+ "YY_BUFFER_STATE yy_create_buffer M4_YY_PARAMS( FILE *file, int size M4_YY_PROTO_LAST_ARG );", | |
+ "void yy_delete_buffer M4_YY_PARAMS( YY_BUFFER_STATE b M4_YY_PROTO_LAST_ARG );", | |
+ "void yy_flush_buffer M4_YY_PARAMS( YY_BUFFER_STATE b M4_YY_PROTO_LAST_ARG );", | |
+ "void yypush_buffer_state M4_YY_PARAMS( YY_BUFFER_STATE new_buffer M4_YY_PROTO_LAST_ARG );", | |
+ "void yypop_buffer_state M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],", | |
+ "[[", | |
+ "static void yyensure_buffer_stack M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );", | |
+ "static void yy_load_buffer_state M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );", | |
+ "static void yy_init_buffer M4_YY_PARAMS( YY_BUFFER_STATE b, FILE *file M4_YY_PROTO_LAST_ARG );", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],", | |
+ "[[", | |
+ "#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER M4_YY_CALL_LAST_ARG)", | |
+ "]])", | |
+ "", | |
+ "YY_BUFFER_STATE yy_scan_buffer M4_YY_PARAMS( char *base, yy_size_t size M4_YY_PROTO_LAST_ARG );", | |
+ "YY_BUFFER_STATE yy_scan_string M4_YY_PARAMS( yyconst char *yy_str M4_YY_PROTO_LAST_ARG );", | |
+ "YY_BUFFER_STATE yy_scan_bytes M4_YY_PARAMS( yyconst char *bytes, yy_size_t len M4_YY_PROTO_LAST_ARG );", | |
+ "", | |
+ "%endif", | |
+ "", | |
+ "void *yyalloc M4_YY_PARAMS( yy_size_t M4_YY_PROTO_LAST_ARG );", | |
+ "void *yyrealloc M4_YY_PARAMS( void *, yy_size_t M4_YY_PROTO_LAST_ARG );", | |
+ "void yyfree M4_YY_PARAMS( void * M4_YY_PROTO_LAST_ARG );", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],", | |
+ "[[", | |
+ "#define yy_new_buffer yy_create_buffer", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],", | |
+ "[[", | |
+ "#define yy_set_interactive(is_interactive) \\", | |
+ " { \\", | |
+ " if ( ! YY_CURRENT_BUFFER ){ \\", | |
+ " yyensure_buffer_stack (M4_YY_CALL_ONLY_ARG); \\", | |
+ " YY_CURRENT_BUFFER_LVALUE = \\", | |
+ " yy_create_buffer( yyin, YY_BUF_SIZE M4_YY_CALL_LAST_ARG); \\", | |
+ " } \\", | |
+ " YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \\", | |
+ " }", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],", | |
+ "[[", | |
+ "#define yy_set_bol(at_bol) \\", | |
+ " { \\", | |
+ " if ( ! YY_CURRENT_BUFFER ){\\", | |
+ " yyensure_buffer_stack (M4_YY_CALL_ONLY_ARG); \\", | |
+ " YY_CURRENT_BUFFER_LVALUE = \\", | |
+ " yy_create_buffer( yyin, YY_BUF_SIZE M4_YY_CALL_LAST_ARG); \\", | |
+ " } \\", | |
+ " YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \\", | |
+ " }", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],", | |
+ "[[", | |
+ "#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)", | |
+ "]])", | |
+ "", | |
+ "%% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],", | |
+ "[[", | |
+ "%% [1.5] DFA", | |
+ "]])", | |
+ "", | |
+ "%if-c-only Standard (non-C++) definition", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],", | |
+ "[[", | |
+ "static yy_state_type yy_get_previous_state M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );", | |
+ "static yy_state_type yy_try_NUL_trans M4_YY_PARAMS( yy_state_type current_state M4_YY_PROTO_LAST_ARG);", | |
+ "static int yy_get_next_buffer M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );", | |
+ "static void yy_fatal_error M4_YY_PARAMS( yyconst char msg[] M4_YY_PROTO_LAST_ARG );", | |
+ "]])", | |
+ "", | |
+ "%endif", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],", | |
+ "[[", | |
+ "/* Done after the current pattern has been matched and before the", | |
+ " * corresponding action - sets up yytext.", | |
+ " */", | |
+ "#define YY_DO_BEFORE_ACTION \\", | |
+ " YY_G(yytext_ptr) = yy_bp; \\", | |
+ "%% [2.0] code to fiddle yytext and yyleng for yymore() goes here \\", | |
+ " YY_G(yy_hold_char) = *yy_cp; \\", | |
+ " *yy_cp = '\\0'; \\", | |
+ "%% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \\", | |
+ " YY_G(yy_c_buf_p) = yy_cp;", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],", | |
+ "[[", | |
+ "%% [4.0] data tables for the DFA and the user's section 1 definitions go here", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_IN_HEADER]], [[#ifdef YY_HEADER_EXPORT_START_CONDITIONS]])", | |
+ "M4_YY_SC_DEFS", | |
+ "m4_ifdef( [[M4_YY_IN_HEADER]], [[#endif]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NO_UNISTD_H]],,", | |
+ "[[", | |
+ "#ifndef YY_NO_UNISTD_H", | |
+ "/* Special case for \"unistd.h\", since it is non-ANSI. We include it way", | |
+ " * down here because we want the user's section 1 to have been scanned first.", | |
+ " * The user has a chance to override it with an option.", | |
+ " */", | |
+ "%if-c-only", | |
+ "#include <unistd.h>", | |
+ "%endif", | |
+ "%if-c++-only", | |
+ "#include <unistd.h>", | |
+ "%endif", | |
+ "#endif", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_EXTRA_TYPE_DEFS]],", | |
+ "[[", | |
+ "#define YY_EXTRA_TYPE M4_EXTRA_TYPE_DEFS", | |
+ "]],", | |
+ "[[", | |
+ "#ifndef YY_EXTRA_TYPE", | |
+ "#define YY_EXTRA_TYPE void *", | |
+ "#endif", | |
+ "]]", | |
+ ")", | |
+ "", | |
+ "%if-c-only Reentrant structure and macros (non-C++).", | |
+ "%if-reentrant", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],", | |
+ "[[", | |
+ "/* Holds the entire state of the reentrant scanner. */", | |
+ "struct yyguts_t", | |
+ " {", | |
+ "", | |
+ " /* User-defined. Not touched by flex. */", | |
+ " YY_EXTRA_TYPE yyextra_r;", | |
+ "", | |
+ " /* The rest are the same as the globals declared in the non-reentrant scanner. */", | |
+ " FILE *yyin_r, *yyout_r;", | |
+ " size_t yy_buffer_stack_top; /**< index of top of stack. */", | |
+ " size_t yy_buffer_stack_max; /**< capacity of stack. */", | |
+ " YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */", | |
+ " char yy_hold_char;", | |
+ " yy_size_t yy_n_chars;", | |
+ " yy_size_t yyleng_r;", | |
+ " char *yy_c_buf_p;", | |
+ " int yy_init;", | |
+ " int yy_start;", | |
+ " int yy_did_buffer_switch_on_eof;", | |
+ " int yy_start_stack_ptr;", | |
+ " int yy_start_stack_depth;", | |
+ " int *yy_start_stack;", | |
+ " yy_state_type yy_last_accepting_state;", | |
+ " char* yy_last_accepting_cpos;", | |
+ "", | |
+ " int yylineno_r;", | |
+ " int yy_flex_debug_r;", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_USES_REJECT]],", | |
+ "[[", | |
+ " yy_state_type *yy_state_buf;", | |
+ " yy_state_type *yy_state_ptr;", | |
+ " char *yy_full_match;", | |
+ " int yy_lp;", | |
+ "", | |
+ " /* These are only needed for trailing context rules,", | |
+ " * but there's no conditional variable for that yet. */", | |
+ " int yy_looking_for_trail_begin;", | |
+ " int yy_full_lp;", | |
+ " int *yy_full_state;", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_TEXT_IS_ARRAY]],", | |
+ "[[", | |
+ " char yytext_r[YYLMAX];", | |
+ " char *yytext_ptr;", | |
+ " int yy_more_offset;", | |
+ " int yy_prev_more_offset;", | |
+ "]],", | |
+ "[[", | |
+ " char *yytext_r;", | |
+ " int yy_more_flag;", | |
+ " int yy_more_len;", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_BISON_LVAL]],", | |
+ "[[", | |
+ " YYSTYPE * yylval_r;", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[<M4_YY_BISON_LLOC>]],", | |
+ "[[", | |
+ " YYLTYPE * yylloc_r;", | |
+ "]])", | |
+ "", | |
+ " }; /* end struct yyguts_t */", | |
+ "]])", | |
+ "", | |
+ "", | |
+ "%if-c-only", | |
+ "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],", | |
+ "[[", | |
+ "static int yy_init_globals M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );", | |
+ "]])", | |
+ "%endif", | |
+ "", | |
+ "%if-reentrant", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],", | |
+ "[[", | |
+ " m4_ifdef( [[M4_YY_BISON_LVAL]],", | |
+ " [[", | |
+ " /* This must go here because YYSTYPE and YYLTYPE are included", | |
+ " * from bison output in section 1.*/", | |
+ " # define yylval YY_G(yylval_r)", | |
+ " ]])", | |
+ "", | |
+ " m4_ifdef( [[<M4_YY_BISON_LLOC>]],", | |
+ " [[", | |
+ " # define yylloc YY_G(yylloc_r)", | |
+ " ]])", | |
+ "]])", | |
+ "", | |
+ "int yylex_init M4_YY_PARAMS(yyscan_t* scanner);", | |
+ "", | |
+ "int yylex_init_extra M4_YY_PARAMS( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);", | |
+ "", | |
+ "%endif", | |
+ "", | |
+ "%endif End reentrant structures and macros.", | |
+ "", | |
+ "/* Accessor methods to globals.", | |
+ " These are made visible to non-reentrant scanners for convenience. */", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NO_DESTROY]],,", | |
+ "[[", | |
+ "int yylex_destroy M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NO_GET_DEBUG]],,", | |
+ "[[", | |
+ "int yyget_debug M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NO_SET_DEBUG]],,", | |
+ "[[", | |
+ "void yyset_debug M4_YY_PARAMS( int debug_flag M4_YY_PROTO_LAST_ARG );", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NO_GET_EXTRA]],,", | |
+ "[[", | |
+ "YY_EXTRA_TYPE yyget_extra M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NO_SET_EXTRA]],,", | |
+ "[[", | |
+ "void yyset_extra M4_YY_PARAMS( YY_EXTRA_TYPE user_defined M4_YY_PROTO_LAST_ARG );", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NO_GET_IN]],,", | |
+ "[[", | |
+ "FILE *yyget_in M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NO_SET_IN]],,", | |
+ "[[", | |
+ "void yyset_in M4_YY_PARAMS( FILE * in_str M4_YY_PROTO_LAST_ARG );", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NO_GET_OUT]],,", | |
+ "[[", | |
+ "FILE *yyget_out M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NO_SET_OUT]],,", | |
+ "[[", | |
+ "void yyset_out M4_YY_PARAMS( FILE * out_str M4_YY_PROTO_LAST_ARG );", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NO_GET_LENG]],,", | |
+ "[[", | |
+ "yy_size_t yyget_leng M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NO_GET_TEXT]],,", | |
+ "[[", | |
+ "char *yyget_text M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NO_GET_LINENO]],,", | |
+ "[[", | |
+ "int yyget_lineno M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NO_SET_LINENO]],,", | |
+ "[[", | |
+ "void yyset_lineno M4_YY_PARAMS( int line_number M4_YY_PROTO_LAST_ARG );", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_REENTRANT]],", | |
+ "[[", | |
+ "m4_ifdef( [[M4_YY_NO_GET_COLUMN]],,", | |
+ "[[", | |
+ "int yyget_column M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );", | |
+ "]])", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_REENTRANT]],", | |
+ "[[", | |
+ "m4_ifdef( [[M4_YY_NO_SET_COLUMN]],,", | |
+ "[[", | |
+ "void yyset_column M4_YY_PARAMS( int column_no M4_YY_PROTO_LAST_ARG );", | |
+ "]])", | |
+ "]])", | |
+ "", | |
+ "%if-bison-bridge", | |
+ "m4_ifdef( [[M4_YY_NO_GET_LVAL]],,", | |
+ "[[", | |
+ "YYSTYPE * yyget_lval M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );", | |
+ "]])", | |
+ "", | |
+ "void yyset_lval M4_YY_PARAMS( YYSTYPE * yylval_param M4_YY_PROTO_LAST_ARG );", | |
+ "", | |
+ "m4_ifdef( [[<M4_YY_BISON_LLOC>]],", | |
+ "[[", | |
+ " m4_ifdef( [[M4_YY_NO_GET_LLOC]],,", | |
+ " [[", | |
+ " YYLTYPE *yyget_lloc M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );", | |
+ " ]])", | |
+ "", | |
+ " m4_ifdef( [[M4_YY_NO_SET_LLOC]],,", | |
+ " [[", | |
+ " void yyset_lloc M4_YY_PARAMS( YYLTYPE * yylloc_param M4_YY_PROTO_LAST_ARG );", | |
+ " ]])", | |
+ "]])", | |
+ "%endif", | |
+ "", | |
+ "/* Macros after this point can all be overridden by user definitions in", | |
+ " * section 1.", | |
+ " */", | |
+ "", | |
+ "#ifndef YY_SKIP_YYWRAP", | |
+ "#ifdef __cplusplus", | |
+ "extern \"C\" int yywrap M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );", | |
+ "#else", | |
+ "extern int yywrap M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );", | |
+ "#endif", | |
+ "#endif", | |
+ "", | |
+ "%not-for-header", | |
+ " m4_ifdef( [[M4_YY_NO_UNPUT]],,", | |
+ " [[", | |
+ " static void yyunput M4_YY_PARAMS( int c, char *buf_ptr M4_YY_PROTO_LAST_ARG);", | |
+ " ]])", | |
+ "%ok-for-header", | |
+ "%endif", | |
+ "", | |
+ "#ifndef yytext_ptr", | |
+ "static void yy_flex_strncpy M4_YY_PARAMS( char *, yyconst char *, int M4_YY_PROTO_LAST_ARG);", | |
+ "#endif", | |
+ "", | |
+ "#ifdef YY_NEED_STRLEN", | |
+ "static int yy_flex_strlen M4_YY_PARAMS( yyconst char * M4_YY_PROTO_LAST_ARG);", | |
+ "#endif", | |
+ "", | |
+ "#ifndef YY_NO_INPUT", | |
+ "%if-c-only Standard (non-C++) definition", | |
+ "%not-for-header", | |
+ "#ifdef __cplusplus", | |
+ "static int yyinput M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );", | |
+ "#else", | |
+ "static int input M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );", | |
+ "#endif", | |
+ "%ok-for-header", | |
+ "%endif", | |
+ "#endif", | |
+ "", | |
+ "", | |
+ "%if-c-only", | |
+ "%# TODO: This is messy.", | |
+ "m4_ifdef( [[M4_YY_STACK_USED]],", | |
+ "[[", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NOT_REENTRANT]],", | |
+ "[[", | |
+ " m4_ifdef( [[M4_YY_NOT_IN_HEADER]],", | |
+ " [[", | |
+ " static int yy_start_stack_ptr = 0;", | |
+ " static int yy_start_stack_depth = 0;", | |
+ " static int *yy_start_stack = NULL;", | |
+ " ]])", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],", | |
+ "[[", | |
+ " m4_ifdef( [[M4_YY_NO_PUSH_STATE]],,", | |
+ " [[", | |
+ " static void yy_push_state M4_YY_PARAMS( int new_state M4_YY_PROTO_LAST_ARG);", | |
+ " ]])", | |
+ " m4_ifdef( [[M4_YY_NO_POP_STATE]],,", | |
+ " [[", | |
+ " static void yy_pop_state M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );", | |
+ " ]])", | |
+ " m4_ifdef( [[M4_YY_NO_TOP_STATE]],,", | |
+ " [[", | |
+ " static int yy_top_state M4_YY_PARAMS( M4_YY_PROTO_ONLY_ARG );", | |
+ " ]])", | |
+ "]])", | |
+ "", | |
+ "]],", | |
+ "[[", | |
+ "m4_define( [[M4_YY_NO_PUSH_STATE]])", | |
+ "m4_define( [[M4_YY_NO_POP_STATE]])", | |
+ "m4_define( [[M4_YY_NO_TOP_STATE]])", | |
+ "]])", | |
+ "%endif", | |
+ "", | |
+ "/* Amount of stuff to slurp up with each read. */", | |
+ "#ifndef YY_READ_BUF_SIZE", | |
+ "#define YY_READ_BUF_SIZE 8192", | |
+ "#endif", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],", | |
+ "[[", | |
+ "/* Copy whatever the last rule matched to the standard output. */", | |
+ "#ifndef ECHO", | |
+ "%if-c-only Standard (non-C++) definition", | |
+ "/* This used to be an fputs(), but since the string might contain NUL's,", | |
+ " * we now use fwrite().", | |
+ " */", | |
+ "#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)", | |
+ "%endif", | |
+ "%if-c++-only C++ definition", | |
+ "#define ECHO LexerOutput( yytext, yyleng )", | |
+ "%endif", | |
+ "#endif", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],", | |
+ "[[", | |
+ "/* Gets input and stuffs it into \"buf\". number of characters read, or YY_NULL,", | |
+ " * is returned in \"result\".", | |
+ " */", | |
+ "#ifndef YY_INPUT", | |
+ "#define YY_INPUT(buf,result,max_size) \\", | |
+ "%% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \\", | |
+ "\\", | |
+ "%if-c++-only C++ definition \\", | |
+ " if ( (result = LexerInput( (char *) buf, max_size )) < 0 ) \\", | |
+ " YY_FATAL_ERROR( \"input in flex scanner failed\" );", | |
+ "%endif", | |
+ "", | |
+ "#endif", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],", | |
+ "[[", | |
+ "/* No semi-colon after return; correct usage is to write \"yyterminate();\" -", | |
+ " * we don't want an extra ';' after the \"return\" because that will cause", | |
+ " * some compilers to complain about unreachable statements.", | |
+ " */", | |
+ "#ifndef yyterminate", | |
+ "#define yyterminate() return YY_NULL", | |
+ "#endif", | |
+ "]])", | |
+ "", | |
+ "/* Number of entries by which start-condition stack grows. */", | |
+ "#ifndef YY_START_STACK_INCR", | |
+ "#define YY_START_STACK_INCR 25", | |
+ "#endif", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],", | |
+ "[[", | |
+ "/* Report a fatal error. */", | |
+ "#ifndef YY_FATAL_ERROR", | |
+ "%if-c-only", | |
+ "#define YY_FATAL_ERROR(msg) yy_fatal_error( msg M4_YY_CALL_LAST_ARG)", | |
+ "%endif", | |
+ "%if-c++-only", | |
+ "#define YY_FATAL_ERROR(msg) LexerError( msg )", | |
+ "%endif", | |
+ "#endif", | |
+ "]])", | |
+ "", | |
+ "%if-tables-serialization structures and prototypes", | |
+ "#ifdef FLEX_SCANNER", | |
+ "/*", | |
+ "dnl tables_shared.h - tables serialization header", | |
+ "dnl", | |
+ "dnl Copyright (c) 1990 The Regents of the University of California.", | |
+ "dnl All rights reserved.", | |
+ "dnl", | |
+ "dnl This code is derived from software contributed to Berkeley by", | |
+ "dnl Vern Paxson.", | |
+ "dnl", | |
+ "dnl The United States Government has rights in this work pursuant", | |
+ "dnl to contract no. DE-AC03-76SF00098 between the United States", | |
+ "dnl Department of Energy and the University of California.", | |
+ "dnl", | |
+ "dnl This file is part of flex.", | |
+ "dnl", | |
+ "dnl Redistribution and use in source and binary forms, with or without", | |
+ "dnl modification, are permitted provided that the following conditions", | |
+ "dnl are met:", | |
+ "dnl", | |
+ "dnl 1. Redistributions of source code must retain the above copyright", | |
+ "dnl notice, this list of conditions and the following disclaimer.", | |
+ "dnl 2. Redistributions in binary form must reproduce the above copyright", | |
+ "dnl notice, this list of conditions and the following disclaimer in the", | |
+ "dnl documentation and/or other materials provided with the distribution.", | |
+ "dnl", | |
+ "dnl Neither the name of the University nor the names of its contributors", | |
+ "dnl may be used to endorse or promote products derived from this software", | |
+ "dnl without specific prior written permission.", | |
+ "dnl", | |
+ "dnl THIS SOFTWARE IS PROVIDED `AS IS' AND WITHOUT ANY EXPRESS OR", | |
+ "dnl IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED", | |
+ "dnl WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR", | |
+ "dnl PURPOSE.", | |
+ "", | |
+ "dnl", | |
+ "dnl This file is meant to be included in both the skeleton and the actual", | |
+ "dnl flex code (hence the name \"_shared\").", | |
+ "*/", | |
+ "#ifndef yyskel_static", | |
+ "#define yyskel_static static", | |
+ "#endif", | |
+ "#else", | |
+ "#ifndef yyskel_static", | |
+ "#define yyskel_static", | |
+ "#endif", | |
+ "#endif", | |
+ "", | |
+ "/* Structures and prototypes for serializing flex tables. The", | |
+ " * binary format is documented in the manual.", | |
+ " *", | |
+ " * Design considerations:", | |
+ " *", | |
+ " * - The format allows many tables per file.", | |
+ " * - The tables can be streamed.", | |
+ " * - All data is stored in network byte order.", | |
+ " * - We do not hinder future unicode support.", | |
+ " * - We can lookup tables by name.", | |
+ " */", | |
+ "", | |
+ "/** Magic number for serialized format. */", | |
+ "#ifndef YYTBL_MAGIC", | |
+ "#define YYTBL_MAGIC 0xF13C57B1", | |
+ "#endif", | |
+ "", | |
+ "/** Calculate (0-7) = number bytes needed to pad n to next 64-bit boundary. */", | |
+ "#ifndef yypad64", | |
+ "#define yypad64(n) ((8-((n)%8))%8)", | |
+ "#endif", | |
+ "", | |
+ "", | |
+ "#ifndef YYTABLES_TYPES", | |
+ "#define YYTABLES_TYPES", | |
+ "/** Possible values for td_id field. Each one corresponds to a", | |
+ " * scanner table of the same name.", | |
+ " */", | |
+ "enum yytbl_id {", | |
+ " YYTD_ID_ACCEPT = 0x01, /**< 1-dim ints */", | |
+ " YYTD_ID_BASE = 0x02, /**< 1-dim ints */", | |
+ " YYTD_ID_CHK = 0x03, /**< 1-dim ints */", | |
+ " YYTD_ID_DEF = 0x04, /**< 1-dim ints */", | |
+ " YYTD_ID_EC = 0x05, /**< 1-dim ints */", | |
+ " YYTD_ID_META = 0x06, /**< 1-dim ints */", | |
+ " YYTD_ID_NUL_TRANS = 0x07, /**< 1-dim ints, maybe indices */", | |
+ " YYTD_ID_NXT = 0x08, /**< may be 2 dimensional ints */", | |
+ " YYTD_ID_RULE_CAN_MATCH_EOL = 0x09, /**< 1-dim ints */", | |
+ " YYTD_ID_START_STATE_LIST = 0x0A, /**< 1-dim indices into trans tbl */", | |
+ " YYTD_ID_TRANSITION = 0x0B, /**< structs */", | |
+ " YYTD_ID_ACCLIST = 0x0C /**< 1-dim ints */", | |
+ "};", | |
+ "", | |
+ "/** bit flags for t_flags field of struct yytbl_data */", | |
+ "enum yytbl_flags {", | |
+ " /* These first three are mutually exclusive */", | |
+ " YYTD_DATA8 = 0x01, /**< data is an array of type flex_int8_t */", | |
+ " YYTD_DATA16 = 0x02, /**< data is an array of type flex_int16_t */", | |
+ " YYTD_DATA32 = 0x04, /**< data is an array of type flex_int32_t */", | |
+ "", | |
+ " /* These two are mutually exclusive. */", | |
+ " YYTD_PTRANS = 0x08, /**< data is a list of indexes of entries", | |
+ " into the expanded yy_transition", | |
+ " array. See notes in manual. */", | |
+ " YYTD_STRUCT = 0x10 /**< data consists of yy_trans_info structs */", | |
+ "};", | |
+ "", | |
+ "/* The serialized tables header. */", | |
+ "struct yytbl_hdr {", | |
+ " flex_uint32_t th_magic; /**< Must be 0xF13C57B1 (comes from \"Flex Table\") */", | |
+ " flex_uint32_t th_hsize; /**< Size of this header in bytes. */", | |
+ " flex_uint32_t th_ssize; /**< Size of this dataset, in bytes, including header. */", | |
+ " flex_uint16_t th_flags; /**< Currently unused, must be 0 */", | |
+ " char *th_version; /**< Flex version string. NUL terminated. */", | |
+ " char *th_name; /**< The name of this table set. NUL terminated. */", | |
+ "};", | |
+ "", | |
+ "/** A single serialized table */", | |
+ "struct yytbl_data {", | |
+ " flex_uint16_t td_id; /**< enum yytbl_id table identifier */", | |
+ " flex_uint16_t td_flags; /**< how to interpret this data */", | |
+ " flex_uint32_t td_hilen; /**< num elements in highest dimension array */", | |
+ " flex_uint32_t td_lolen; /**< num elements in lowest dimension array */", | |
+ " void *td_data; /**< table data */", | |
+ "};", | |
+ "#endif", | |
+ "", | |
+ "/** Extract corresponding data size_t from td_flags */", | |
+ "#ifndef YYTDFLAGS2BYTES", | |
+ "#define YYTDFLAGS2BYTES(td_flags)\\", | |
+ " (((td_flags) & YYTD_DATA8)\\", | |
+ " ? sizeof(flex_int8_t)\\", | |
+ " :(((td_flags) & YYTD_DATA16)\\", | |
+ " ? sizeof(flex_int16_t)\\", | |
+ " :sizeof(flex_int32_t)))", | |
+ "#endif", | |
+ "", | |
+ "#ifdef FLEX_SCANNER", | |
+ "%not-for-header", | |
+ "#endif", | |
+ "yyskel_static flex_int32_t yytbl_calc_total_len (const struct yytbl_data *tbl);", | |
+ "#ifdef FLEX_SCANNER", | |
+ "%ok-for-header", | |
+ "#endif", | |
+ "", | |
+ "/* vim:set noexpandtab cindent tabstop=8 softtabstop=0 shiftwidth=8 textwidth=0: */", | |
+ "", | |
+ "", | |
+ "/* Load the DFA tables from the given stream. */", | |
+ "int yytables_fload M4_YY_PARAMS(FILE * fp M4_YY_PROTO_LAST_ARG);", | |
+ "", | |
+ "/* Unload the tables from memory. */", | |
+ "int yytables_destroy M4_YY_PARAMS(M4_YY_PROTO_ONLY_ARG);", | |
+ "%not-for-header", | |
+ "", | |
+ "/** Describes a mapping from a serialized table id to its deserialized state in", | |
+ " * this scanner. This is the bridge between our \"generic\" deserialization code", | |
+ " * and the specifics of this scanner. ", | |
+ " */", | |
+ "struct yytbl_dmap {", | |
+ " enum yytbl_id dm_id;/**< table identifier */", | |
+ " void **dm_arr; /**< address of pointer to store the deserialized table. */", | |
+ " size_t dm_sz; /**< local sizeof() each element in table. */", | |
+ "};", | |
+ "", | |
+ "/** A {0,0,0}-terminated list of structs, forming the map */", | |
+ "static struct yytbl_dmap yydmap[] =", | |
+ "{", | |
+ "%tables-yydmap generated elements", | |
+ " {0,0,0}", | |
+ "};", | |
+ "", | |
+ "/** A tables-reader object to maintain some state in the read. */", | |
+ "struct yytbl_reader {", | |
+ " FILE * fp; /**< input stream */", | |
+ " flex_uint32_t bread; /**< bytes read since beginning of current tableset */", | |
+ "};", | |
+ "", | |
+ "%endif", | |
+ "/* end tables serialization structures and prototypes */", | |
+ "", | |
+ "%ok-for-header", | |
+ "", | |
+ "/* Default declaration of generated scanner - a define so the user can", | |
+ " * easily add parameters.", | |
+ " */", | |
+ "#ifndef YY_DECL", | |
+ "#define YY_DECL_IS_OURS 1", | |
+ "%if-c-only Standard (non-C++) definition", | |
+ "", | |
+ "", | |
+ "m4_define( [[M4_YY_LEX_PROTO]], [[M4_YY_PARAMS(M4_YY_PROTO_ONLY_ARG)]])", | |
+ "m4_define( [[M4_YY_LEX_DECLARATION]], [[YYFARGS0(void)]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_BISON_LVAL]],", | |
+ "[[", | |
+ " m4_dnl The bison pure parser is used. Redefine yylex to", | |
+ " m4_dnl accept the lval parameter.", | |
+ "", | |
+ " m4_define( [[M4_YY_LEX_PROTO]], [[\\]]", | |
+ " [[M4_YY_PARAMS(YYSTYPE * yylval_param M4_YY_PROTO_LAST_ARG)]])", | |
+ " m4_define( [[M4_YY_LEX_DECLARATION]], [[\\]]", | |
+ " [[YYFARGS1(YYSTYPE *,yylval_param)]])", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[<M4_YY_BISON_LLOC>]],", | |
+ "[[", | |
+ " m4_dnl Locations are used. yylex should also accept the ylloc parameter.", | |
+ "", | |
+ " m4_define( [[M4_YY_LEX_PROTO]], [[\\]]", | |
+ " [[M4_YY_PARAMS(YYSTYPE * yylval_param, YYLTYPE * yylloc_param M4_YY_PROTO_LAST_ARG)]])", | |
+ " m4_define( [[M4_YY_LEX_DECLARATION]], [[\\]]", | |
+ " [[YYFARGS2(YYSTYPE *,yylval_param, YYLTYPE *,yylloc_param)]])", | |
+ "]])", | |
+ "", | |
+ "extern int yylex M4_YY_LEX_PROTO;", | |
+ "", | |
+ "#define YY_DECL int yylex M4_YY_LEX_DECLARATION", | |
+ "%endif", | |
+ "%if-c++-only C++ definition", | |
+ "#define YY_DECL int yyFlexLexer::yylex()", | |
+ "%endif", | |
+ "#endif /* !YY_DECL */", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],", | |
+ "[[", | |
+ "/* Code executed at the beginning of each rule, after yytext and yyleng", | |
+ " * have been set up.", | |
+ " */", | |
+ "#ifndef YY_USER_ACTION", | |
+ "#define YY_USER_ACTION", | |
+ "#endif", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],", | |
+ "[[", | |
+ "/* Code executed at the end of each rule. */", | |
+ "#ifndef YY_BREAK", | |
+ "#define YY_BREAK break;", | |
+ "#endif", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],", | |
+ "[[", | |
+ "%% [6.0] YY_RULE_SETUP definition goes here", | |
+ "]])", | |
+ "", | |
+ "%not-for-header", | |
+ "/** The main scanner function which does all the work.", | |
+ " */", | |
+ "YY_DECL", | |
+ "{", | |
+ " register yy_state_type yy_current_state;", | |
+ " register char *yy_cp, *yy_bp;", | |
+ " register int yy_act;", | |
+ " M4_YY_DECL_GUTS_VAR();", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NOT_REENTRANT]],", | |
+ "[[", | |
+ " m4_ifdef( [[M4_YY_BISON_LVAL]],", | |
+ " [[", | |
+ " YYSTYPE * yylval;", | |
+ " ]])", | |
+ " m4_ifdef( [[<M4_YY_BISON_LLOC>]],", | |
+ " [[", | |
+ " YYLTYPE * yylloc;", | |
+ " ]])", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_BISON_LVAL]],", | |
+ "[[", | |
+ " yylval = yylval_param;", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[<M4_YY_BISON_LLOC>]],", | |
+ "[[", | |
+ " yylloc = yylloc_param;", | |
+ "]])", | |
+ "", | |
+ " if ( !YY_G(yy_init) )", | |
+ " {", | |
+ " YY_G(yy_init) = 1;", | |
+ "", | |
+ "#ifdef YY_USER_INIT", | |
+ " YY_USER_INIT;", | |
+ "#endif", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_USES_REJECT]],", | |
+ "[[", | |
+ " /* Create the reject buffer large enough to save one state per allowed character. */", | |
+ " if ( ! YY_G(yy_state_buf) )", | |
+ " YY_G(yy_state_buf) = (yy_state_type *)yyalloc(YY_STATE_BUF_SIZE M4_YY_CALL_LAST_ARG);", | |
+ " if ( ! YY_G(yy_state_buf) )", | |
+ " YY_FATAL_ERROR( \"out of dynamic memory in yylex()\" );", | |
+ "]])", | |
+ "", | |
+ " if ( ! YY_G(yy_start) )", | |
+ " YY_G(yy_start) = 1; /* first start state */", | |
+ "", | |
+ " if ( ! yyin )", | |
+ "%if-c-only", | |
+ " yyin = stdin;", | |
+ "%endif", | |
+ "%if-c++-only", | |
+ " yyin = & std::cin;", | |
+ "%endif", | |
+ "", | |
+ " if ( ! yyout )", | |
+ "%if-c-only", | |
+ " yyout = stdout;", | |
+ "%endif", | |
+ "%if-c++-only", | |
+ " yyout = & std::cout;", | |
+ "%endif", | |
+ "", | |
+ " if ( ! YY_CURRENT_BUFFER ) {", | |
+ " yyensure_buffer_stack (M4_YY_CALL_ONLY_ARG);", | |
+ " YY_CURRENT_BUFFER_LVALUE =", | |
+ " yy_create_buffer( yyin, YY_BUF_SIZE M4_YY_CALL_LAST_ARG);", | |
+ " }", | |
+ "", | |
+ " yy_load_buffer_state( M4_YY_CALL_ONLY_ARG );", | |
+ " }", | |
+ "", | |
+ " {", | |
+ "%% [7.0] user's declarations go here", | |
+ "", | |
+ " while ( 1 ) /* loops until end-of-file is reached */", | |
+ " {", | |
+ "%% [8.0] yymore()-related code goes here", | |
+ " yy_cp = YY_G(yy_c_buf_p);", | |
+ "", | |
+ " /* Support of yytext. */", | |
+ " *yy_cp = YY_G(yy_hold_char);", | |
+ "", | |
+ " /* yy_bp points to the position in yy_ch_buf of the start of", | |
+ " * the current run.", | |
+ " */", | |
+ " yy_bp = yy_cp;", | |
+ "", | |
+ "%% [9.0] code to set up and find next match goes here", | |
+ "", | |
+ "yy_find_action:", | |
+ "%% [10.0] code to find the action number goes here", | |
+ "", | |
+ " YY_DO_BEFORE_ACTION;", | |
+ "", | |
+ "%% [11.0] code for yylineno update goes here", | |
+ "", | |
+ "do_action: /* This label is used only to access EOF actions. */", | |
+ "", | |
+ "%% [12.0] debug code goes here", | |
+ "", | |
+ " switch ( yy_act )", | |
+ " { /* beginning of action switch */", | |
+ "%% [13.0] actions go here", | |
+ "", | |
+ " case YY_END_OF_BUFFER:", | |
+ " {", | |
+ " /* Amount of text matched not including the EOB char. */", | |
+ " int yy_amount_of_matched_text = (int) (yy_cp - YY_G(yytext_ptr)) - 1;", | |
+ "", | |
+ " /* Undo the effects of YY_DO_BEFORE_ACTION. */", | |
+ " *yy_cp = YY_G(yy_hold_char);", | |
+ " YY_RESTORE_YY_MORE_OFFSET", | |
+ "", | |
+ " if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )", | |
+ " {", | |
+ " /* We're scanning a new file or input source. It's", | |
+ " * possible that this happened because the user", | |
+ " * just pointed yyin at a new source and called", | |
+ " * yylex(). If so, then we have to assure", | |
+ " * consistency between YY_CURRENT_BUFFER and our", | |
+ " * globals. Here is the right place to do so, because", | |
+ " * this is the first action (other than possibly a", | |
+ " * back-up) that will match for the new input source.", | |
+ " */", | |
+ " YY_G(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;", | |
+ " YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;", | |
+ " YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;", | |
+ " }", | |
+ "", | |
+ " /* Note that here we test for yy_c_buf_p \"<=\" to the position", | |
+ " * of the first EOB in the buffer, since yy_c_buf_p will", | |
+ " * already have been incremented past the NUL character", | |
+ " * (since all states make transitions on EOB to the", | |
+ " * end-of-buffer state). Contrast this with the test", | |
+ " * in input().", | |
+ " */", | |
+ " if ( YY_G(yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_G(yy_n_chars)] )", | |
+ " { /* This was really a NUL. */", | |
+ " yy_state_type yy_next_state;", | |
+ "", | |
+ " YY_G(yy_c_buf_p) = YY_G(yytext_ptr) + yy_amount_of_matched_text;", | |
+ "", | |
+ " yy_current_state = yy_get_previous_state( M4_YY_CALL_ONLY_ARG );", | |
+ "", | |
+ " /* Okay, we're now positioned to make the NUL", | |
+ " * transition. We couldn't have", | |
+ " * yy_get_previous_state() go ahead and do it", | |
+ " * for us because it doesn't know how to deal", | |
+ " * with the possibility of jamming (and we don't", | |
+ " * want to build jamming into it because then it", | |
+ " * will run more slowly).", | |
+ " */", | |
+ "", | |
+ " yy_next_state = yy_try_NUL_trans( yy_current_state M4_YY_CALL_LAST_ARG);", | |
+ "", | |
+ " yy_bp = YY_G(yytext_ptr) + YY_MORE_ADJ;", | |
+ "", | |
+ " if ( yy_next_state )", | |
+ " {", | |
+ " /* Consume the NUL. */", | |
+ " yy_cp = ++YY_G(yy_c_buf_p);", | |
+ " yy_current_state = yy_next_state;", | |
+ " goto yy_match;", | |
+ " }", | |
+ "", | |
+ " else", | |
+ " {", | |
+ "%% [14.0] code to do back-up for compressed tables and set up yy_cp goes here", | |
+ " goto yy_find_action;", | |
+ " }", | |
+ " }", | |
+ "", | |
+ " else switch ( yy_get_next_buffer( M4_YY_CALL_ONLY_ARG ) )", | |
+ " {", | |
+ " case EOB_ACT_END_OF_FILE:", | |
+ " {", | |
+ " YY_G(yy_did_buffer_switch_on_eof) = 0;", | |
+ "", | |
+ " if ( yywrap( M4_YY_CALL_ONLY_ARG ) )", | |
+ " {", | |
+ " /* Note: because we've taken care in", | |
+ " * yy_get_next_buffer() to have set up", | |
+ " * yytext, we can now set up", | |
+ " * yy_c_buf_p so that if some total", | |
+ " * hoser (like flex itself) wants to", | |
+ " * call the scanner after we return the", | |
+ " * YY_NULL, it'll still work - another", | |
+ " * YY_NULL will get returned.", | |
+ " */", | |
+ " YY_G(yy_c_buf_p) = YY_G(yytext_ptr) + YY_MORE_ADJ;", | |
+ "", | |
+ " yy_act = YY_STATE_EOF(YY_START);", | |
+ " goto do_action;", | |
+ " }", | |
+ "", | |
+ " else", | |
+ " {", | |
+ " if ( ! YY_G(yy_did_buffer_switch_on_eof) )", | |
+ " YY_NEW_FILE;", | |
+ " }", | |
+ " break;", | |
+ " }", | |
+ "", | |
+ " case EOB_ACT_CONTINUE_SCAN:", | |
+ " YY_G(yy_c_buf_p) =", | |
+ " YY_G(yytext_ptr) + yy_amount_of_matched_text;", | |
+ "", | |
+ " yy_current_state = yy_get_previous_state( M4_YY_CALL_ONLY_ARG );", | |
+ "", | |
+ " yy_cp = YY_G(yy_c_buf_p);", | |
+ " yy_bp = YY_G(yytext_ptr) + YY_MORE_ADJ;", | |
+ " goto yy_match;", | |
+ "", | |
+ " case EOB_ACT_LAST_MATCH:", | |
+ " YY_G(yy_c_buf_p) =", | |
+ " &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_G(yy_n_chars)];", | |
+ "", | |
+ " yy_current_state = yy_get_previous_state( M4_YY_CALL_ONLY_ARG );", | |
+ "", | |
+ " yy_cp = YY_G(yy_c_buf_p);", | |
+ " yy_bp = YY_G(yytext_ptr) + YY_MORE_ADJ;", | |
+ " goto yy_find_action;", | |
+ " }", | |
+ " break;", | |
+ " }", | |
+ "", | |
+ " default:", | |
+ " YY_FATAL_ERROR(", | |
+ " \"fatal flex scanner internal error--no action found\" );", | |
+ " } /* end of action switch */", | |
+ " } /* end of scanning one token */", | |
+ " } /* end of user's declarations */", | |
+ "} /* end of yylex */", | |
+ "%ok-for-header", | |
+ "", | |
+ "%if-c++-only", | |
+ "%not-for-header", | |
+ "/* The contents of this function are C++ specific, so the YY_G macro is not used.", | |
+ " */", | |
+ "yyFlexLexer::yyFlexLexer( std::istream* arg_yyin, std::ostream* arg_yyout )", | |
+ "{", | |
+ " yyin = arg_yyin;", | |
+ " yyout = arg_yyout;", | |
+ " yy_c_buf_p = 0;", | |
+ " yy_init = 0;", | |
+ " yy_start = 0;", | |
+ " yy_flex_debug = 0;", | |
+ " yylineno = 1; // this will only get updated if %option yylineno", | |
+ "", | |
+ " yy_did_buffer_switch_on_eof = 0;", | |
+ "", | |
+ " yy_looking_for_trail_begin = 0;", | |
+ " yy_more_flag = 0;", | |
+ " yy_more_len = 0;", | |
+ " yy_more_offset = yy_prev_more_offset = 0;", | |
+ "", | |
+ " yy_start_stack_ptr = yy_start_stack_depth = 0;", | |
+ " yy_start_stack = NULL;", | |
+ "", | |
+ " yy_buffer_stack = 0;", | |
+ " yy_buffer_stack_top = 0;", | |
+ " yy_buffer_stack_max = 0;", | |
+ "", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_USES_REJECT]],", | |
+ "[[", | |
+ " yy_state_buf = new yy_state_type[YY_STATE_BUF_SIZE];", | |
+ "]],", | |
+ "[[", | |
+ " yy_state_buf = 0;", | |
+ "]])", | |
+ "}", | |
+ "", | |
+ "/* The contents of this function are C++ specific, so the YY_G macro is not used.", | |
+ " */", | |
+ "yyFlexLexer::~yyFlexLexer()", | |
+ "{", | |
+ " delete [] yy_state_buf;", | |
+ " yyfree( yy_start_stack M4_YY_CALL_LAST_ARG );", | |
+ " yy_delete_buffer( YY_CURRENT_BUFFER M4_YY_CALL_LAST_ARG);", | |
+ " yyfree( yy_buffer_stack M4_YY_CALL_LAST_ARG );", | |
+ "}", | |
+ "", | |
+ "/* The contents of this function are C++ specific, so the YY_G macro is not used.", | |
+ " */", | |
+ "void yyFlexLexer::switch_streams( std::istream* new_in, std::ostream* new_out )", | |
+ "{", | |
+ " if ( new_in )", | |
+ " {", | |
+ " yy_delete_buffer( YY_CURRENT_BUFFER M4_YY_CALL_LAST_ARG);", | |
+ " yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE M4_YY_CALL_LAST_ARG) M4_YY_CALL_LAST_ARG);", | |
+ " }", | |
+ "", | |
+ " if ( new_out )", | |
+ " yyout = new_out;", | |
+ "}", | |
+ "", | |
+ "#ifdef YY_INTERACTIVE", | |
+ "int yyFlexLexer::LexerInput( char* buf, int /* max_size */ )", | |
+ "#else", | |
+ "int yyFlexLexer::LexerInput( char* buf, int max_size )", | |
+ "#endif", | |
+ "{", | |
+ " if ( yyin->eof() || yyin->fail() )", | |
+ " return 0;", | |
+ "", | |
+ "#ifdef YY_INTERACTIVE", | |
+ " yyin->get( buf[0] );", | |
+ "", | |
+ " if ( yyin->eof() )", | |
+ " return 0;", | |
+ "", | |
+ " if ( yyin->bad() )", | |
+ " return -1;", | |
+ "", | |
+ " return 1;", | |
+ "", | |
+ "#else", | |
+ " (void) yyin->read( buf, max_size );", | |
+ "", | |
+ " if ( yyin->bad() )", | |
+ " return -1;", | |
+ " else", | |
+ " return yyin->gcount();", | |
+ "#endif", | |
+ "}", | |
+ "", | |
+ "void yyFlexLexer::LexerOutput( const char* buf, int size )", | |
+ "{", | |
+ " (void) yyout->write( buf, size );", | |
+ "}", | |
+ "%ok-for-header", | |
+ "%endif", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],", | |
+ "[[", | |
+ "/* yy_get_next_buffer - try to read in a new buffer", | |
+ " *", | |
+ " * Returns a code representing an action:", | |
+ " * EOB_ACT_LAST_MATCH -", | |
+ " * EOB_ACT_CONTINUE_SCAN - continue scanning from current position", | |
+ " * EOB_ACT_END_OF_FILE - end of file", | |
+ " */", | |
+ "%if-c-only", | |
+ "static int yy_get_next_buffer YYFARGS0(void)", | |
+ "%endif", | |
+ "%if-c++-only", | |
+ "int yyFlexLexer::yy_get_next_buffer()", | |
+ "%endif", | |
+ "{", | |
+ " M4_YY_DECL_GUTS_VAR();", | |
+ " register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;", | |
+ " register char *source = YY_G(yytext_ptr);", | |
+ " register int number_to_move, i;", | |
+ " int ret_val;", | |
+ "", | |
+ " if ( YY_G(yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_G(yy_n_chars) + 1] )", | |
+ " YY_FATAL_ERROR(", | |
+ " \"fatal flex scanner internal error--end of buffer missed\" );", | |
+ "", | |
+ " if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )", | |
+ " { /* Don't try to fill the buffer, so this is an EOF. */", | |
+ " if ( YY_G(yy_c_buf_p) - YY_G(yytext_ptr) - YY_MORE_ADJ == 1 )", | |
+ " {", | |
+ " /* We matched a single character, the EOB, so", | |
+ " * treat this as a final EOF.", | |
+ " */", | |
+ " return EOB_ACT_END_OF_FILE;", | |
+ " }", | |
+ "", | |
+ " else", | |
+ " {", | |
+ " /* We matched some text prior to the EOB, first", | |
+ " * process it.", | |
+ " */", | |
+ " return EOB_ACT_LAST_MATCH;", | |
+ " }", | |
+ " }", | |
+ "", | |
+ " /* Try to read more data. */", | |
+ "", | |
+ " /* First move last chars to start of buffer. */", | |
+ " number_to_move = (int) (YY_G(yy_c_buf_p) - YY_G(yytext_ptr)) - 1;", | |
+ "", | |
+ " for ( i = 0; i < number_to_move; ++i )", | |
+ " *(dest++) = *(source++);", | |
+ "", | |
+ " if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )", | |
+ " /* don't do the read, it's not guaranteed to return an EOF,", | |
+ " * just force an EOF", | |
+ " */", | |
+ " YY_CURRENT_BUFFER_LVALUE->yy_n_chars = YY_G(yy_n_chars) = 0;", | |
+ "", | |
+ " else", | |
+ " {", | |
+ " yy_size_t num_to_read =", | |
+ " YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;", | |
+ "", | |
+ " while ( num_to_read <= 0 )", | |
+ " { /* Not enough room in the buffer - grow it. */", | |
+ "m4_ifdef( [[M4_YY_USES_REJECT]],", | |
+ "[[", | |
+ " YY_FATAL_ERROR(", | |
+ "\"input buffer overflow, can't enlarge buffer because scanner uses REJECT\" );", | |
+ "]],", | |
+ "[[", | |
+ " /* just a shorter name for the current buffer */", | |
+ " YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;", | |
+ "", | |
+ " int yy_c_buf_p_offset =", | |
+ " (int) (YY_G(yy_c_buf_p) - b->yy_ch_buf);", | |
+ "", | |
+ " if ( b->yy_is_our_buffer )", | |
+ " {", | |
+ " yy_size_t new_size = b->yy_buf_size * 2;", | |
+ "", | |
+ " if ( new_size <= 0 )", | |
+ " b->yy_buf_size += b->yy_buf_size / 8;", | |
+ " else", | |
+ " b->yy_buf_size *= 2;", | |
+ "", | |
+ " b->yy_ch_buf = (char *)", | |
+ " /* Include room in for 2 EOB chars. */", | |
+ " yyrealloc( (void *) b->yy_ch_buf,", | |
+ " b->yy_buf_size + 2 M4_YY_CALL_LAST_ARG );", | |
+ " }", | |
+ " else", | |
+ " /* Can't grow it, we don't own it. */", | |
+ " b->yy_ch_buf = 0;", | |
+ "", | |
+ " if ( ! b->yy_ch_buf )", | |
+ " YY_FATAL_ERROR(", | |
+ " \"fatal error - scanner input buffer overflow\" );", | |
+ "", | |
+ " YY_G(yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];", | |
+ "", | |
+ " num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -", | |
+ " number_to_move - 1;", | |
+ "]])", | |
+ " }", | |
+ "", | |
+ " if ( num_to_read > YY_READ_BUF_SIZE )", | |
+ " num_to_read = YY_READ_BUF_SIZE;", | |
+ "", | |
+ " /* Read in more data. */", | |
+ " YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),", | |
+ " YY_G(yy_n_chars), num_to_read );", | |
+ "", | |
+ " YY_CURRENT_BUFFER_LVALUE->yy_n_chars = YY_G(yy_n_chars);", | |
+ " }", | |
+ "", | |
+ " if ( YY_G(yy_n_chars) == 0 )", | |
+ " {", | |
+ " if ( number_to_move == YY_MORE_ADJ )", | |
+ " {", | |
+ " ret_val = EOB_ACT_END_OF_FILE;", | |
+ " yyrestart( yyin M4_YY_CALL_LAST_ARG);", | |
+ " }", | |
+ "", | |
+ " else", | |
+ " {", | |
+ " ret_val = EOB_ACT_LAST_MATCH;", | |
+ " YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =", | |
+ " YY_BUFFER_EOF_PENDING;", | |
+ " }", | |
+ " }", | |
+ "", | |
+ " else", | |
+ " ret_val = EOB_ACT_CONTINUE_SCAN;", | |
+ "", | |
+ " if ((yy_size_t) (YY_G(yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {", | |
+ " /* Extend the array by 50%, plus the number we really need. */", | |
+ " yy_size_t new_size = YY_G(yy_n_chars) + number_to_move + (YY_G(yy_n_chars) >> 1);", | |
+ " YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(", | |
+ " (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, new_size M4_YY_CALL_LAST_ARG );", | |
+ " if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )", | |
+ " YY_FATAL_ERROR( \"out of dynamic memory in yy_get_next_buffer()\" );", | |
+ " }", | |
+ "", | |
+ " YY_G(yy_n_chars) += number_to_move;", | |
+ " YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_G(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;", | |
+ " YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_G(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;", | |
+ "", | |
+ " YY_G(yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];", | |
+ "", | |
+ " return ret_val;", | |
+ "}", | |
+ "]])", | |
+ "", | |
+ "/* yy_get_previous_state - get the state just before the EOB char was reached */", | |
+ "", | |
+ "%if-c-only", | |
+ "%not-for-header", | |
+ " static yy_state_type yy_get_previous_state YYFARGS0(void)", | |
+ "%endif", | |
+ "%if-c++-only", | |
+ " yy_state_type yyFlexLexer::yy_get_previous_state()", | |
+ "%endif", | |
+ "{", | |
+ " register yy_state_type yy_current_state;", | |
+ " register char *yy_cp;", | |
+ " M4_YY_DECL_GUTS_VAR();", | |
+ "", | |
+ "%% [15.0] code to get the start state into yy_current_state goes here", | |
+ "", | |
+ " for ( yy_cp = YY_G(yytext_ptr) + YY_MORE_ADJ; yy_cp < YY_G(yy_c_buf_p); ++yy_cp )", | |
+ " {", | |
+ "%% [16.0] code to find the next state goes here", | |
+ " }", | |
+ "", | |
+ " return yy_current_state;", | |
+ "}", | |
+ "", | |
+ "", | |
+ "/* yy_try_NUL_trans - try to make a transition on the NUL character", | |
+ " *", | |
+ " * synopsis", | |
+ " * next_state = yy_try_NUL_trans( current_state );", | |
+ " */", | |
+ "%if-c-only", | |
+ " static yy_state_type yy_try_NUL_trans YYFARGS1( yy_state_type, yy_current_state)", | |
+ "%endif", | |
+ "%if-c++-only", | |
+ " yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state )", | |
+ "%endif", | |
+ "{", | |
+ " register int yy_is_jam;", | |
+ " M4_YY_DECL_GUTS_VAR(); /* This var may be unused depending upon options. */", | |
+ "%% [17.0] code to find the next state, and perhaps do backing up, goes here", | |
+ "", | |
+ " M4_YY_NOOP_GUTS_VAR();", | |
+ " return yy_is_jam ? 0 : yy_current_state;", | |
+ "}", | |
+ "", | |
+ "", | |
+ "%if-c-only", | |
+ "m4_ifdef( [[M4_YY_NO_UNPUT]],,", | |
+ "[[", | |
+ " static void yyunput YYFARGS2( int,c, register char *,yy_bp)", | |
+ "%endif", | |
+ "%if-c++-only", | |
+ " void yyFlexLexer::yyunput( int c, register char* yy_bp)", | |
+ "%endif", | |
+ "{", | |
+ " register char *yy_cp;", | |
+ " M4_YY_DECL_GUTS_VAR();", | |
+ "", | |
+ " yy_cp = YY_G(yy_c_buf_p);", | |
+ "", | |
+ " /* undo effects of setting up yytext */", | |
+ " *yy_cp = YY_G(yy_hold_char);", | |
+ "", | |
+ " if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )", | |
+ " { /* need to shift things up to make room */", | |
+ " /* +2 for EOB chars. */", | |
+ " register yy_size_t number_to_move = YY_G(yy_n_chars) + 2;", | |
+ " register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[", | |
+ " YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];", | |
+ " register char *source =", | |
+ " &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];", | |
+ "", | |
+ " while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )", | |
+ " *--dest = *--source;", | |
+ "", | |
+ " yy_cp += (int) (dest - source);", | |
+ " yy_bp += (int) (dest - source);", | |
+ " YY_CURRENT_BUFFER_LVALUE->yy_n_chars =", | |
+ " YY_G(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;", | |
+ "", | |
+ " if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )", | |
+ " YY_FATAL_ERROR( \"flex scanner push-back overflow\" );", | |
+ " }", | |
+ "", | |
+ " *--yy_cp = (char) c;", | |
+ "", | |
+ "%% [18.0] update yylineno here", | |
+ "m4_ifdef( [[M4_YY_USE_LINENO]],", | |
+ "[[", | |
+ " if ( c == '\\n' ){", | |
+ " --yylineno;", | |
+ " }", | |
+ "]])", | |
+ "", | |
+ " YY_G(yytext_ptr) = yy_bp;", | |
+ " YY_G(yy_hold_char) = *yy_cp;", | |
+ " YY_G(yy_c_buf_p) = yy_cp;", | |
+ "}", | |
+ "%if-c-only", | |
+ "]])", | |
+ "%endif", | |
+ "", | |
+ "%if-c-only", | |
+ "#ifndef YY_NO_INPUT", | |
+ "#ifdef __cplusplus", | |
+ " static int yyinput YYFARGS0(void)", | |
+ "#else", | |
+ " static int input YYFARGS0(void)", | |
+ "#endif", | |
+ "", | |
+ "%endif", | |
+ "%if-c++-only", | |
+ " int yyFlexLexer::yyinput()", | |
+ "%endif", | |
+ "{", | |
+ " int c;", | |
+ " M4_YY_DECL_GUTS_VAR();", | |
+ "", | |
+ " *YY_G(yy_c_buf_p) = YY_G(yy_hold_char);", | |
+ "", | |
+ " if ( *YY_G(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )", | |
+ " {", | |
+ " /* yy_c_buf_p now points to the character we want to return.", | |
+ " * If this occurs *before* the EOB characters, then it's a", | |
+ " * valid NUL; if not, then we've hit the end of the buffer.", | |
+ " */", | |
+ " if ( YY_G(yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[YY_G(yy_n_chars)] )", | |
+ " /* This was really a NUL. */", | |
+ " *YY_G(yy_c_buf_p) = '\\0';", | |
+ "", | |
+ " else", | |
+ " { /* need more input */", | |
+ " yy_size_t offset = YY_G(yy_c_buf_p) - YY_G(yytext_ptr);", | |
+ " ++YY_G(yy_c_buf_p);", | |
+ "", | |
+ " switch ( yy_get_next_buffer( M4_YY_CALL_ONLY_ARG ) )", | |
+ " {", | |
+ " case EOB_ACT_LAST_MATCH:", | |
+ " /* This happens because yy_g_n_b()", | |
+ " * sees that we've accumulated a", | |
+ " * token and flags that we need to", | |
+ " * try matching the token before", | |
+ " * proceeding. But for input(),", | |
+ " * there's no matching to consider.", | |
+ " * So convert the EOB_ACT_LAST_MATCH", | |
+ " * to EOB_ACT_END_OF_FILE.", | |
+ " */", | |
+ "", | |
+ " /* Reset buffer status. */", | |
+ " yyrestart( yyin M4_YY_CALL_LAST_ARG);", | |
+ "", | |
+ " /*FALLTHROUGH*/", | |
+ "", | |
+ " case EOB_ACT_END_OF_FILE:", | |
+ " {", | |
+ " if ( yywrap( M4_YY_CALL_ONLY_ARG ) )", | |
+ " return EOF;", | |
+ "", | |
+ " if ( ! YY_G(yy_did_buffer_switch_on_eof) )", | |
+ " YY_NEW_FILE;", | |
+ "#ifdef __cplusplus", | |
+ " return yyinput(M4_YY_CALL_ONLY_ARG);", | |
+ "#else", | |
+ " return input(M4_YY_CALL_ONLY_ARG);", | |
+ "#endif", | |
+ " }", | |
+ "", | |
+ " case EOB_ACT_CONTINUE_SCAN:", | |
+ " YY_G(yy_c_buf_p) = YY_G(yytext_ptr) + offset;", | |
+ " break;", | |
+ " }", | |
+ " }", | |
+ " }", | |
+ "", | |
+ " c = *(unsigned char *) YY_G(yy_c_buf_p); /* cast for 8-bit char's */", | |
+ " *YY_G(yy_c_buf_p) = '\\0'; /* preserve yytext */", | |
+ " YY_G(yy_hold_char) = *++YY_G(yy_c_buf_p);", | |
+ "", | |
+ "%% [19.0] update BOL and yylineno", | |
+ "", | |
+ " return c;", | |
+ "}", | |
+ "%if-c-only", | |
+ "#endif /* ifndef YY_NO_INPUT */", | |
+ "%endif", | |
+ "", | |
+ "/** Immediately switch to a different input stream.", | |
+ " * @param input_file A readable stream.", | |
+ " * M4_YY_DOC_PARAM", | |
+ " * @note This function does not reset the start condition to @c INITIAL .", | |
+ " */", | |
+ "%if-c-only", | |
+ " void yyrestart YYFARGS1( FILE *,input_file)", | |
+ "%endif", | |
+ "%if-c++-only", | |
+ " void yyFlexLexer::yyrestart( std::istream* input_file )", | |
+ "%endif", | |
+ "{", | |
+ " M4_YY_DECL_GUTS_VAR();", | |
+ "", | |
+ " if ( ! YY_CURRENT_BUFFER ){", | |
+ " yyensure_buffer_stack (M4_YY_CALL_ONLY_ARG);", | |
+ " YY_CURRENT_BUFFER_LVALUE =", | |
+ " yy_create_buffer( yyin, YY_BUF_SIZE M4_YY_CALL_LAST_ARG);", | |
+ " }", | |
+ "", | |
+ " yy_init_buffer( YY_CURRENT_BUFFER, input_file M4_YY_CALL_LAST_ARG);", | |
+ " yy_load_buffer_state( M4_YY_CALL_ONLY_ARG );", | |
+ "}", | |
+ "", | |
+ "/** Switch to a different input buffer.", | |
+ " * @param new_buffer The new input buffer.", | |
+ " * M4_YY_DOC_PARAM", | |
+ " */", | |
+ "%if-c-only", | |
+ " void yy_switch_to_buffer YYFARGS1( YY_BUFFER_STATE ,new_buffer)", | |
+ "%endif", | |
+ "%if-c++-only", | |
+ " void yyFlexLexer::yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )", | |
+ "%endif", | |
+ "{", | |
+ " M4_YY_DECL_GUTS_VAR();", | |
+ "", | |
+ " /* TODO. We should be able to replace this entire function body", | |
+ " * with", | |
+ " * yypop_buffer_state();", | |
+ " * yypush_buffer_state(new_buffer);", | |
+ " */", | |
+ " yyensure_buffer_stack (M4_YY_CALL_ONLY_ARG);", | |
+ " if ( YY_CURRENT_BUFFER == new_buffer )", | |
+ " return;", | |
+ "", | |
+ " if ( YY_CURRENT_BUFFER )", | |
+ " {", | |
+ " /* Flush out information for old buffer. */", | |
+ " *YY_G(yy_c_buf_p) = YY_G(yy_hold_char);", | |
+ " YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = YY_G(yy_c_buf_p);", | |
+ " YY_CURRENT_BUFFER_LVALUE->yy_n_chars = YY_G(yy_n_chars);", | |
+ " }", | |
+ "", | |
+ " YY_CURRENT_BUFFER_LVALUE = new_buffer;", | |
+ " yy_load_buffer_state( M4_YY_CALL_ONLY_ARG );", | |
+ "", | |
+ " /* We don't actually know whether we did this switch during", | |
+ " * EOF (yywrap()) processing, but the only time this flag", | |
+ " * is looked at is after yywrap() is called, so it's safe", | |
+ " * to go ahead and always set it.", | |
+ " */", | |
+ " YY_G(yy_did_buffer_switch_on_eof) = 1;", | |
+ "}", | |
+ "", | |
+ "", | |
+ "%if-c-only", | |
+ "static void yy_load_buffer_state YYFARGS0(void)", | |
+ "%endif", | |
+ "%if-c++-only", | |
+ " void yyFlexLexer::yy_load_buffer_state()", | |
+ "%endif", | |
+ "{", | |
+ " M4_YY_DECL_GUTS_VAR();", | |
+ " YY_G(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;", | |
+ " YY_G(yytext_ptr) = YY_G(yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;", | |
+ " yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;", | |
+ " YY_G(yy_hold_char) = *YY_G(yy_c_buf_p);", | |
+ "}", | |
+ "", | |
+ "/** Allocate and initialize an input buffer state.", | |
+ " * @param file A readable stream.", | |
+ " * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.", | |
+ " * M4_YY_DOC_PARAM", | |
+ " * @return the allocated buffer state.", | |
+ " */", | |
+ "%if-c-only", | |
+ " YY_BUFFER_STATE yy_create_buffer YYFARGS2( FILE *,file, int ,size)", | |
+ "%endif", | |
+ "%if-c++-only", | |
+ " YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( std::istream* file, int size )", | |
+ "%endif", | |
+ "{", | |
+ " YY_BUFFER_STATE b;", | |
+ " m4_dnl M4_YY_DECL_GUTS_VAR();", | |
+ "", | |
+ " b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) M4_YY_CALL_LAST_ARG );", | |
+ " if ( ! b )", | |
+ " YY_FATAL_ERROR( \"out of dynamic memory in yy_create_buffer()\" );", | |
+ "", | |
+ " b->yy_buf_size = size;", | |
+ "", | |
+ " /* yy_ch_buf has to be 2 characters longer than the size given because", | |
+ " * we need to put in 2 end-of-buffer characters.", | |
+ " */", | |
+ " b->yy_ch_buf = (char *) yyalloc( b->yy_buf_size + 2 M4_YY_CALL_LAST_ARG );", | |
+ " if ( ! b->yy_ch_buf )", | |
+ " YY_FATAL_ERROR( \"out of dynamic memory in yy_create_buffer()\" );", | |
+ "", | |
+ " b->yy_is_our_buffer = 1;", | |
+ "", | |
+ " yy_init_buffer( b, file M4_YY_CALL_LAST_ARG);", | |
+ "", | |
+ " return b;", | |
+ "}", | |
+ "", | |
+ "/** Destroy the buffer.", | |
+ " * @param b a buffer created with yy_create_buffer()", | |
+ " * M4_YY_DOC_PARAM", | |
+ " */", | |
+ "%if-c-only", | |
+ " void yy_delete_buffer YYFARGS1( YY_BUFFER_STATE ,b)", | |
+ "%endif", | |
+ "%if-c++-only", | |
+ " void yyFlexLexer::yy_delete_buffer( YY_BUFFER_STATE b )", | |
+ "%endif", | |
+ "{", | |
+ " M4_YY_DECL_GUTS_VAR();", | |
+ "", | |
+ " if ( ! b )", | |
+ " return;", | |
+ "", | |
+ " if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */", | |
+ " YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;", | |
+ "", | |
+ " if ( b->yy_is_our_buffer )", | |
+ " yyfree( (void *) b->yy_ch_buf M4_YY_CALL_LAST_ARG );", | |
+ "", | |
+ " yyfree( (void *) b M4_YY_CALL_LAST_ARG );", | |
+ "}", | |
+ "", | |
+ "", | |
+ "/* Initializes or reinitializes a buffer.", | |
+ " * This function is sometimes called more than once on the same buffer,", | |
+ " * such as during a yyrestart() or at EOF.", | |
+ " */", | |
+ "%if-c-only", | |
+ " static void yy_init_buffer YYFARGS2( YY_BUFFER_STATE ,b, FILE *,file)", | |
+ "%endif", | |
+ "%if-c++-only", | |
+ " void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, std::istream* file )", | |
+ "%endif", | |
+ "", | |
+ "{", | |
+ " int oerrno = errno;", | |
+ " M4_YY_DECL_GUTS_VAR();", | |
+ "", | |
+ " yy_flush_buffer( b M4_YY_CALL_LAST_ARG);", | |
+ "", | |
+ " b->yy_input_file = file;", | |
+ " b->yy_fill_buffer = 1;", | |
+ "", | |
+ " /* If b is the current buffer, then yy_init_buffer was _probably_", | |
+ " * called from yyrestart() or through yy_get_next_buffer.", | |
+ " * In that case, we don't want to reset the lineno or column.", | |
+ " */", | |
+ " if (b != YY_CURRENT_BUFFER){", | |
+ " b->yy_bs_lineno = 1;", | |
+ " b->yy_bs_column = 0;", | |
+ " }", | |
+ "", | |
+ "%if-c-only", | |
+ "m4_ifdef( [[M4_YY_ALWAYS_INTERACTIVE]],", | |
+ "[[", | |
+ " b->yy_is_interactive = 1;", | |
+ "]],", | |
+ "[[", | |
+ " m4_ifdef( [[M4_YY_NEVER_INTERACTIVE]],", | |
+ " [[", | |
+ " b->yy_is_interactive = 0;", | |
+ " ]],", | |
+ " [[", | |
+ " b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;", | |
+ " ]])", | |
+ "]])", | |
+ "%endif", | |
+ "%if-c++-only", | |
+ " b->yy_is_interactive = 0;", | |
+ "%endif", | |
+ " errno = oerrno;", | |
+ "}", | |
+ "", | |
+ "/** Discard all buffered characters. On the next scan, YY_INPUT will be called.", | |
+ " * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.", | |
+ " * M4_YY_DOC_PARAM", | |
+ " */", | |
+ "%if-c-only", | |
+ " void yy_flush_buffer YYFARGS1( YY_BUFFER_STATE ,b)", | |
+ "%endif", | |
+ "%if-c++-only", | |
+ " void yyFlexLexer::yy_flush_buffer( YY_BUFFER_STATE b )", | |
+ "%endif", | |
+ "{", | |
+ " M4_YY_DECL_GUTS_VAR();", | |
+ " if ( ! b )", | |
+ " return;", | |
+ "", | |
+ " b->yy_n_chars = 0;", | |
+ "", | |
+ " /* We always need two end-of-buffer characters. The first causes", | |
+ " * a transition to the end-of-buffer state. The second causes", | |
+ " * a jam in that state.", | |
+ " */", | |
+ " b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;", | |
+ " b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;", | |
+ "", | |
+ " b->yy_buf_pos = &b->yy_ch_buf[0];", | |
+ "", | |
+ " b->yy_at_bol = 1;", | |
+ " b->yy_buffer_status = YY_BUFFER_NEW;", | |
+ "", | |
+ " if ( b == YY_CURRENT_BUFFER )", | |
+ " yy_load_buffer_state( M4_YY_CALL_ONLY_ARG );", | |
+ "}", | |
+ "", | |
+ "%if-c-or-c++", | |
+ "/** Pushes the new state onto the stack. The new state becomes", | |
+ " * the current state. This function will allocate the stack", | |
+ " * if necessary.", | |
+ " * @param new_buffer The new state.", | |
+ " * M4_YY_DOC_PARAM", | |
+ " */", | |
+ "%if-c-only", | |
+ "void yypush_buffer_state YYFARGS1(YY_BUFFER_STATE,new_buffer)", | |
+ "%endif", | |
+ "%if-c++-only", | |
+ "void yyFlexLexer::yypush_buffer_state (YY_BUFFER_STATE new_buffer)", | |
+ "%endif", | |
+ "{", | |
+ " M4_YY_DECL_GUTS_VAR();", | |
+ " if (new_buffer == NULL)", | |
+ " return;", | |
+ "", | |
+ " yyensure_buffer_stack(M4_YY_CALL_ONLY_ARG);", | |
+ "", | |
+ " /* This block is copied from yy_switch_to_buffer. */", | |
+ " if ( YY_CURRENT_BUFFER )", | |
+ " {", | |
+ " /* Flush out information for old buffer. */", | |
+ " *YY_G(yy_c_buf_p) = YY_G(yy_hold_char);", | |
+ " YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = YY_G(yy_c_buf_p);", | |
+ " YY_CURRENT_BUFFER_LVALUE->yy_n_chars = YY_G(yy_n_chars);", | |
+ " }", | |
+ "", | |
+ " /* Only push if top exists. Otherwise, replace top. */", | |
+ " if (YY_CURRENT_BUFFER)", | |
+ " YY_G(yy_buffer_stack_top)++;", | |
+ " YY_CURRENT_BUFFER_LVALUE = new_buffer;", | |
+ "", | |
+ " /* copied from yy_switch_to_buffer. */", | |
+ " yy_load_buffer_state( M4_YY_CALL_ONLY_ARG );", | |
+ " YY_G(yy_did_buffer_switch_on_eof) = 1;", | |
+ "}", | |
+ "%endif", | |
+ "", | |
+ "", | |
+ "%if-c-or-c++", | |
+ "/** Removes and deletes the top of the stack, if present.", | |
+ " * The next element becomes the new top.", | |
+ " * M4_YY_DOC_PARAM", | |
+ " */", | |
+ "%if-c-only", | |
+ "void yypop_buffer_state YYFARGS0(void)", | |
+ "%endif", | |
+ "%if-c++-only", | |
+ "void yyFlexLexer::yypop_buffer_state (void)", | |
+ "%endif", | |
+ "{", | |
+ " M4_YY_DECL_GUTS_VAR();", | |
+ " if (!YY_CURRENT_BUFFER)", | |
+ " return;", | |
+ "", | |
+ " yy_delete_buffer(YY_CURRENT_BUFFER M4_YY_CALL_LAST_ARG);", | |
+ " YY_CURRENT_BUFFER_LVALUE = NULL;", | |
+ " if (YY_G(yy_buffer_stack_top) > 0)", | |
+ " --YY_G(yy_buffer_stack_top);", | |
+ "", | |
+ " if (YY_CURRENT_BUFFER) {", | |
+ " yy_load_buffer_state( M4_YY_CALL_ONLY_ARG );", | |
+ " YY_G(yy_did_buffer_switch_on_eof) = 1;", | |
+ " }", | |
+ "}", | |
+ "%endif", | |
+ "", | |
+ "", | |
+ "%if-c-or-c++", | |
+ "/* Allocates the stack if it does not exist.", | |
+ " * Guarantees space for at least one push.", | |
+ " */", | |
+ "%if-c-only", | |
+ "static void yyensure_buffer_stack YYFARGS0(void)", | |
+ "%endif", | |
+ "%if-c++-only", | |
+ "void yyFlexLexer::yyensure_buffer_stack(void)", | |
+ "%endif", | |
+ "{", | |
+ " yy_size_t num_to_alloc;", | |
+ " M4_YY_DECL_GUTS_VAR();", | |
+ "", | |
+ " if (!YY_G(yy_buffer_stack)) {", | |
+ "", | |
+ " /* First allocation is just for 2 elements, since we don't know if this", | |
+ " * scanner will even need a stack. We use 2 instead of 1 to avoid an", | |
+ " * immediate realloc on the next call.", | |
+ " */", | |
+ " num_to_alloc = 1;", | |
+ " YY_G(yy_buffer_stack) = (struct yy_buffer_state**)yyalloc", | |
+ " (num_to_alloc * sizeof(struct yy_buffer_state*)", | |
+ " M4_YY_CALL_LAST_ARG);", | |
+ " if ( ! YY_G(yy_buffer_stack) )", | |
+ " YY_FATAL_ERROR( \"out of dynamic memory in yyensure_buffer_stack()\" );", | |
+ " ", | |
+ " ", | |
+ " memset(YY_G(yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));", | |
+ " ", | |
+ " YY_G(yy_buffer_stack_max) = num_to_alloc;", | |
+ " YY_G(yy_buffer_stack_top) = 0;", | |
+ " return;", | |
+ " }", | |
+ "", | |
+ " if (YY_G(yy_buffer_stack_top) >= (YY_G(yy_buffer_stack_max)) - 1){", | |
+ "", | |
+ " /* Increase the buffer to prepare for a possible push. */", | |
+ " int grow_size = 8 /* arbitrary grow size */;", | |
+ "", | |
+ " num_to_alloc = YY_G(yy_buffer_stack_max) + grow_size;", | |
+ " YY_G(yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc", | |
+ " (YY_G(yy_buffer_stack),", | |
+ " num_to_alloc * sizeof(struct yy_buffer_state*)", | |
+ " M4_YY_CALL_LAST_ARG);", | |
+ " if ( ! YY_G(yy_buffer_stack) )", | |
+ " YY_FATAL_ERROR( \"out of dynamic memory in yyensure_buffer_stack()\" );", | |
+ "", | |
+ " /* zero only the new slots.*/", | |
+ " memset(YY_G(yy_buffer_stack) + YY_G(yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));", | |
+ " YY_G(yy_buffer_stack_max) = num_to_alloc;", | |
+ " }", | |
+ "}", | |
+ "%endif", | |
+ "", | |
+ "", | |
+ "", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NO_SCAN_BUFFER]],,", | |
+ "[[", | |
+ "%if-c-only", | |
+ "/** Setup the input buffer state to scan directly from a user-specified character buffer.", | |
+ " * @param base the character buffer", | |
+ " * @param size the size in bytes of the character buffer", | |
+ " * M4_YY_DOC_PARAM", | |
+ " * @return the newly allocated buffer state object. ", | |
+ " */", | |
+ "YY_BUFFER_STATE yy_scan_buffer YYFARGS2( char *,base, yy_size_t ,size)", | |
+ "{", | |
+ " YY_BUFFER_STATE b;", | |
+ " m4_dnl M4_YY_DECL_GUTS_VAR();", | |
+ "", | |
+ " if ( size < 2 ||", | |
+ " base[size-2] != YY_END_OF_BUFFER_CHAR ||", | |
+ " base[size-1] != YY_END_OF_BUFFER_CHAR )", | |
+ " /* They forgot to leave room for the EOB's. */", | |
+ " return 0;", | |
+ "", | |
+ " b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) M4_YY_CALL_LAST_ARG );", | |
+ " if ( ! b )", | |
+ " YY_FATAL_ERROR( \"out of dynamic memory in yy_scan_buffer()\" );", | |
+ "", | |
+ " b->yy_buf_size = size - 2; /* \"- 2\" to take care of EOB's */", | |
+ " b->yy_buf_pos = b->yy_ch_buf = base;", | |
+ " b->yy_is_our_buffer = 0;", | |
+ " b->yy_input_file = 0;", | |
+ " b->yy_n_chars = b->yy_buf_size;", | |
+ " b->yy_is_interactive = 0;", | |
+ " b->yy_at_bol = 1;", | |
+ " b->yy_fill_buffer = 0;", | |
+ " b->yy_buffer_status = YY_BUFFER_NEW;", | |
+ "", | |
+ " yy_switch_to_buffer( b M4_YY_CALL_LAST_ARG );", | |
+ "", | |
+ " return b;", | |
+ "}", | |
+ "%endif", | |
+ "]])", | |
+ "", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NO_SCAN_STRING]],,", | |
+ "[[", | |
+ "%if-c-only", | |
+ "/** Setup the input buffer state to scan a string. The next call to yylex() will", | |
+ " * scan from a @e copy of @a str.", | |
+ " * @param yystr a NUL-terminated string to scan", | |
+ " * M4_YY_DOC_PARAM", | |
+ " * @return the newly allocated buffer state object.", | |
+ " * @note If you want to scan bytes that may contain NUL values, then use", | |
+ " * yy_scan_bytes() instead.", | |
+ " */", | |
+ "YY_BUFFER_STATE yy_scan_string YYFARGS1( yyconst char *, yystr)", | |
+ "{", | |
+ " m4_dnl M4_YY_DECL_GUTS_VAR();", | |
+ "", | |
+ " return yy_scan_bytes( yystr, strlen(yystr) M4_YY_CALL_LAST_ARG);", | |
+ "}", | |
+ "%endif", | |
+ "]])", | |
+ "", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NO_SCAN_BYTES]],,", | |
+ "[[", | |
+ "%if-c-only", | |
+ "/** Setup the input buffer state to scan the given bytes. The next call to yylex() will", | |
+ " * scan from a @e copy of @a bytes.", | |
+ " * @param yybytes the byte buffer to scan", | |
+ " * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.", | |
+ " * M4_YY_DOC_PARAM", | |
+ " * @return the newly allocated buffer state object.", | |
+ " */", | |
+ "YY_BUFFER_STATE yy_scan_bytes YYFARGS2( yyconst char *,yybytes, yy_size_t ,_yybytes_len)", | |
+ "{", | |
+ " YY_BUFFER_STATE b;", | |
+ " char *buf;", | |
+ " yy_size_t n;", | |
+ " yy_size_t i;", | |
+ " m4_dnl M4_YY_DECL_GUTS_VAR();", | |
+ "", | |
+ " /* Get memory for full buffer, including space for trailing EOB's. */", | |
+ " n = _yybytes_len + 2;", | |
+ " buf = (char *) yyalloc( n M4_YY_CALL_LAST_ARG );", | |
+ " if ( ! buf )", | |
+ " YY_FATAL_ERROR( \"out of dynamic memory in yy_scan_bytes()\" );", | |
+ "", | |
+ " for ( i = 0; i < _yybytes_len; ++i )", | |
+ " buf[i] = yybytes[i];", | |
+ "", | |
+ " buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;", | |
+ "", | |
+ " b = yy_scan_buffer( buf, n M4_YY_CALL_LAST_ARG);", | |
+ " if ( ! b )", | |
+ " YY_FATAL_ERROR( \"bad buffer in yy_scan_bytes()\" );", | |
+ "", | |
+ " /* It's okay to grow etc. this buffer, and we should throw it", | |
+ " * away when we're done.", | |
+ " */", | |
+ " b->yy_is_our_buffer = 1;", | |
+ "", | |
+ " return b;", | |
+ "}", | |
+ "%endif", | |
+ "]])", | |
+ "", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NO_PUSH_STATE]],,", | |
+ "[[", | |
+ "%if-c-only", | |
+ " static void yy_push_state YYFARGS1( int ,new_state)", | |
+ "%endif", | |
+ "%if-c++-only", | |
+ " void yyFlexLexer::yy_push_state( int new_state )", | |
+ "%endif", | |
+ "{", | |
+ " M4_YY_DECL_GUTS_VAR();", | |
+ " if ( YY_G(yy_start_stack_ptr) >= YY_G(yy_start_stack_depth) )", | |
+ " {", | |
+ " yy_size_t new_size;", | |
+ "", | |
+ " YY_G(yy_start_stack_depth) += YY_START_STACK_INCR;", | |
+ " new_size = YY_G(yy_start_stack_depth) * sizeof( int );", | |
+ "", | |
+ " if ( ! YY_G(yy_start_stack) )", | |
+ " YY_G(yy_start_stack) = (int *) yyalloc( new_size M4_YY_CALL_LAST_ARG );", | |
+ "", | |
+ " else", | |
+ " YY_G(yy_start_stack) = (int *) yyrealloc(", | |
+ " (void *) YY_G(yy_start_stack), new_size M4_YY_CALL_LAST_ARG );", | |
+ "", | |
+ " if ( ! YY_G(yy_start_stack) )", | |
+ " YY_FATAL_ERROR( \"out of memory expanding start-condition stack\" );", | |
+ " }", | |
+ "", | |
+ " YY_G(yy_start_stack)[YY_G(yy_start_stack_ptr)++] = YY_START;", | |
+ "", | |
+ " BEGIN(new_state);", | |
+ "}", | |
+ "]])", | |
+ "", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NO_POP_STATE]],,", | |
+ "[[", | |
+ "%if-c-only", | |
+ " static void yy_pop_state YYFARGS0(void)", | |
+ "%endif", | |
+ "%if-c++-only", | |
+ " void yyFlexLexer::yy_pop_state()", | |
+ "%endif", | |
+ "{", | |
+ " M4_YY_DECL_GUTS_VAR();", | |
+ " if ( --YY_G(yy_start_stack_ptr) < 0 )", | |
+ " YY_FATAL_ERROR( \"start-condition stack underflow\" );", | |
+ "", | |
+ " BEGIN(YY_G(yy_start_stack)[YY_G(yy_start_stack_ptr)]);", | |
+ "}", | |
+ "]])", | |
+ "", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NO_TOP_STATE]],,", | |
+ "[[", | |
+ "%if-c-only", | |
+ " static int yy_top_state YYFARGS0(void)", | |
+ "%endif", | |
+ "%if-c++-only", | |
+ " int yyFlexLexer::yy_top_state()", | |
+ "%endif", | |
+ "{", | |
+ " M4_YY_DECL_GUTS_VAR();", | |
+ " return YY_G(yy_start_stack)[YY_G(yy_start_stack_ptr) - 1];", | |
+ "}", | |
+ "]])", | |
+ "", | |
+ "#ifndef YY_EXIT_FAILURE", | |
+ "#define YY_EXIT_FAILURE 2", | |
+ "#endif", | |
+ "", | |
+ "%if-c-only", | |
+ "static void yy_fatal_error YYFARGS1(yyconst char*, msg)", | |
+ "{", | |
+ " m4_dnl M4_YY_DECL_GUTS_VAR();", | |
+ " (void) fprintf( stderr, \"%s\\n\", msg );", | |
+ " exit( YY_EXIT_FAILURE );", | |
+ "}", | |
+ "%endif", | |
+ "%if-c++-only", | |
+ "void yyFlexLexer::LexerError( yyconst char msg[] )", | |
+ "{", | |
+ " M4_YY_DECL_GUTS_VAR();", | |
+ " std::cerr << msg << std::endl;", | |
+ " exit( YY_EXIT_FAILURE );", | |
+ "}", | |
+ "%endif", | |
+ "", | |
+ "/* Redefine yyless() so it works in section 3 code. */", | |
+ "", | |
+ "#undef yyless", | |
+ "#define yyless(n) \\", | |
+ " do \\", | |
+ " { \\", | |
+ " /* Undo effects of setting up yytext. */ \\", | |
+ " int yyless_macro_arg = (n); \\", | |
+ " YY_LESS_LINENO(yyless_macro_arg);\\", | |
+ " yytext[yyleng] = YY_G(yy_hold_char); \\", | |
+ " YY_G(yy_c_buf_p) = yytext + yyless_macro_arg; \\", | |
+ " YY_G(yy_hold_char) = *YY_G(yy_c_buf_p); \\", | |
+ " *YY_G(yy_c_buf_p) = '\\0'; \\", | |
+ " yyleng = yyless_macro_arg; \\", | |
+ " } \\", | |
+ " while ( 0 )", | |
+ "", | |
+ "", | |
+ "", | |
+ "/* Accessor methods (get/set functions) to struct members. */", | |
+ "", | |
+ "%if-c-only", | |
+ "%if-reentrant", | |
+ "m4_ifdef( [[M4_YY_NO_GET_EXTRA]],,", | |
+ "[[", | |
+ "/** Get the user-defined data for this scanner.", | |
+ " * M4_YY_DOC_PARAM", | |
+ " */", | |
+ "YY_EXTRA_TYPE yyget_extra YYFARGS0(void)", | |
+ "{", | |
+ " M4_YY_DECL_GUTS_VAR();", | |
+ " return yyextra;", | |
+ "}", | |
+ "]])", | |
+ "%endif", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NO_GET_LINENO]],,", | |
+ "[[", | |
+ "/** Get the current line number.", | |
+ " * M4_YY_DOC_PARAM", | |
+ " */", | |
+ "int yyget_lineno YYFARGS0(void)", | |
+ "{", | |
+ " M4_YY_DECL_GUTS_VAR();", | |
+ " ", | |
+ " m4_ifdef( [[M4_YY_REENTRANT]],", | |
+ " [[", | |
+ " if (! YY_CURRENT_BUFFER)", | |
+ " return 0;", | |
+ " ]])", | |
+ " return yylineno;", | |
+ "}", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_REENTRANT]],", | |
+ "[[", | |
+ "m4_ifdef( [[M4_YY_NO_GET_COLUMN]],,", | |
+ "[[", | |
+ "/** Get the current column number.", | |
+ " * M4_YY_DOC_PARAM", | |
+ " */", | |
+ "int yyget_column YYFARGS0(void)", | |
+ "{", | |
+ " M4_YY_DECL_GUTS_VAR();", | |
+ " ", | |
+ " m4_ifdef( [[M4_YY_REENTRANT]],", | |
+ " [[", | |
+ " if (! YY_CURRENT_BUFFER)", | |
+ " return 0;", | |
+ " ]])", | |
+ " return yycolumn;", | |
+ "}", | |
+ "]])", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NO_GET_IN]],,", | |
+ "[[", | |
+ "/** Get the input stream.", | |
+ " * M4_YY_DOC_PARAM", | |
+ " */", | |
+ "FILE *yyget_in YYFARGS0(void)", | |
+ "{", | |
+ " M4_YY_DECL_GUTS_VAR();", | |
+ " return yyin;", | |
+ "}", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NO_GET_OUT]],,", | |
+ "[[", | |
+ "/** Get the output stream.", | |
+ " * M4_YY_DOC_PARAM", | |
+ " */", | |
+ "FILE *yyget_out YYFARGS0(void)", | |
+ "{", | |
+ " M4_YY_DECL_GUTS_VAR();", | |
+ " return yyout;", | |
+ "}", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NO_GET_LENG]],,", | |
+ "[[", | |
+ "/** Get the length of the current token.", | |
+ " * M4_YY_DOC_PARAM", | |
+ " */", | |
+ "yy_size_t yyget_leng YYFARGS0(void)", | |
+ "{", | |
+ " M4_YY_DECL_GUTS_VAR();", | |
+ " return yyleng;", | |
+ "}", | |
+ "]])", | |
+ "", | |
+ "/** Get the current token.", | |
+ " * M4_YY_DOC_PARAM", | |
+ " */", | |
+ "m4_ifdef( [[M4_YY_NO_GET_TEXT]],,", | |
+ "[[", | |
+ "char *yyget_text YYFARGS0(void)", | |
+ "{", | |
+ " M4_YY_DECL_GUTS_VAR();", | |
+ " return yytext;", | |
+ "}", | |
+ "]])", | |
+ "", | |
+ "%if-reentrant", | |
+ "m4_ifdef( [[M4_YY_NO_SET_EXTRA]],,", | |
+ "[[", | |
+ "/** Set the user-defined data. This data is never touched by the scanner.", | |
+ " * @param user_defined The data to be associated with this scanner.", | |
+ " * M4_YY_DOC_PARAM", | |
+ " */", | |
+ "void yyset_extra YYFARGS1( YY_EXTRA_TYPE ,user_defined)", | |
+ "{", | |
+ " M4_YY_DECL_GUTS_VAR();", | |
+ " yyextra = user_defined ;", | |
+ "}", | |
+ "]])", | |
+ "%endif", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NO_SET_LINENO]],,", | |
+ "[[", | |
+ "/** Set the current line number.", | |
+ " * @param line_number", | |
+ " * M4_YY_DOC_PARAM", | |
+ " */", | |
+ "void yyset_lineno YYFARGS1( int ,line_number)", | |
+ "{", | |
+ " M4_YY_DECL_GUTS_VAR();", | |
+ "", | |
+ " m4_ifdef( [[M4_YY_REENTRANT]],", | |
+ " [[", | |
+ " /* lineno is only valid if an input buffer exists. */", | |
+ " if (! YY_CURRENT_BUFFER )", | |
+ " YY_FATAL_ERROR( \"yyset_lineno called with no buffer\" );", | |
+ " ]])", | |
+ " yylineno = line_number;", | |
+ "}", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_REENTRANT]],", | |
+ "[[", | |
+ "m4_ifdef( [[M4_YY_NO_SET_COLUMN]],,", | |
+ "[[", | |
+ "/** Set the current column.", | |
+ " * @param line_number", | |
+ " * M4_YY_DOC_PARAM", | |
+ " */", | |
+ "void yyset_column YYFARGS1( int , column_no)", | |
+ "{", | |
+ " M4_YY_DECL_GUTS_VAR();", | |
+ "", | |
+ " m4_ifdef( [[M4_YY_REENTRANT]],", | |
+ " [[", | |
+ " /* column is only valid if an input buffer exists. */", | |
+ " if (! YY_CURRENT_BUFFER )", | |
+ " YY_FATAL_ERROR( \"yyset_column called with no buffer\" );", | |
+ " ]])", | |
+ " yycolumn = column_no;", | |
+ "}", | |
+ "]])", | |
+ "]])", | |
+ "", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NO_SET_IN]],,", | |
+ "[[", | |
+ "/** Set the input stream. This does not discard the current", | |
+ " * input buffer.", | |
+ " * @param in_str A readable stream.", | |
+ " * M4_YY_DOC_PARAM", | |
+ " * @see yy_switch_to_buffer", | |
+ " */", | |
+ "void yyset_in YYFARGS1( FILE * ,in_str)", | |
+ "{", | |
+ " M4_YY_DECL_GUTS_VAR();", | |
+ " yyin = in_str ;", | |
+ "}", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NO_SET_OUT]],,", | |
+ "[[", | |
+ "void yyset_out YYFARGS1( FILE * ,out_str)", | |
+ "{", | |
+ " M4_YY_DECL_GUTS_VAR();", | |
+ " yyout = out_str ;", | |
+ "}", | |
+ "]])", | |
+ "", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NO_GET_DEBUG]],,", | |
+ "[[", | |
+ "int yyget_debug YYFARGS0(void)", | |
+ "{", | |
+ " M4_YY_DECL_GUTS_VAR();", | |
+ " return yy_flex_debug;", | |
+ "}", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NO_SET_DEBUG]],,", | |
+ "[[", | |
+ "void yyset_debug YYFARGS1( int ,bdebug)", | |
+ "{", | |
+ " M4_YY_DECL_GUTS_VAR();", | |
+ " yy_flex_debug = bdebug ;", | |
+ "}", | |
+ "]])", | |
+ "%endif", | |
+ "", | |
+ "%if-reentrant", | |
+ "/* Accessor methods for yylval and yylloc */", | |
+ "", | |
+ "%if-bison-bridge", | |
+ "m4_ifdef( [[M4_YY_NO_GET_LVAL]],,", | |
+ "[[", | |
+ "YYSTYPE * yyget_lval YYFARGS0(void)", | |
+ "{", | |
+ " M4_YY_DECL_GUTS_VAR();", | |
+ " return yylval;", | |
+ "}", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NO_SET_LVAL]],,", | |
+ "[[", | |
+ "void yyset_lval YYFARGS1( YYSTYPE * ,yylval_param)", | |
+ "{", | |
+ " M4_YY_DECL_GUTS_VAR();", | |
+ " yylval = yylval_param;", | |
+ "}", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[<M4_YY_BISON_LLOC>]],", | |
+ "[[", | |
+ " m4_ifdef( [[M4_YY_NO_GET_LLOC]],,", | |
+ " [[", | |
+ "YYLTYPE *yyget_lloc YYFARGS0(void)", | |
+ "{", | |
+ " M4_YY_DECL_GUTS_VAR();", | |
+ " return yylloc;", | |
+ "}", | |
+ " ]])", | |
+ "", | |
+ " m4_ifdef( [[M4_YY_NO_SET_LLOC]],,", | |
+ " [[", | |
+ "void yyset_lloc YYFARGS1( YYLTYPE * ,yylloc_param)", | |
+ "{", | |
+ " M4_YY_DECL_GUTS_VAR();", | |
+ " yylloc = yylloc_param;", | |
+ "}", | |
+ " ]])", | |
+ "]])", | |
+ "", | |
+ "%endif", | |
+ "", | |
+ "", | |
+ "/* User-visible API */", | |
+ "", | |
+ "/* yylex_init is special because it creates the scanner itself, so it is", | |
+ " * the ONLY reentrant function that doesn't take the scanner as the last argument.", | |
+ " * That's why we explicitly handle the declaration, instead of using our macros.", | |
+ " */", | |
+ "m4_ifdef( [[M4_YY_NO_ANSI_FUNC_DEFS]],", | |
+ "[[", | |
+ "int yylex_init( ptr_yy_globals )", | |
+ " yyscan_t* ptr_yy_globals;", | |
+ "]],", | |
+ "[[", | |
+ "int yylex_init(yyscan_t* ptr_yy_globals)", | |
+ "]])", | |
+ "{", | |
+ " if (ptr_yy_globals == NULL){", | |
+ " errno = EINVAL;", | |
+ " return 1;", | |
+ " }", | |
+ "", | |
+ " *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );", | |
+ "", | |
+ " if (*ptr_yy_globals == NULL){", | |
+ " errno = ENOMEM;", | |
+ " return 1;", | |
+ " }", | |
+ "", | |
+ " /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */", | |
+ " memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));", | |
+ "", | |
+ " return yy_init_globals ( *ptr_yy_globals );", | |
+ "}", | |
+ "", | |
+ "", | |
+ "/* yylex_init_extra has the same functionality as yylex_init, but follows the", | |
+ " * convention of taking the scanner as the last argument. Note however, that", | |
+ " * this is a *pointer* to a scanner, as it will be allocated by this call (and", | |
+ " * is the reason, too, why this function also must handle its own declaration).", | |
+ " * The user defined value in the first argument will be available to yyalloc in", | |
+ " * the yyextra field.", | |
+ " */", | |
+ "m4_ifdef( [[M4_YY_NO_ANSI_FUNC_DEFS]],", | |
+ "[[", | |
+ "int yylex_init_extra( yy_user_defined, ptr_yy_globals )", | |
+ " YY_EXTRA_TYPE yy_user_defined;", | |
+ " yyscan_t* ptr_yy_globals;", | |
+ "]],", | |
+ "[[", | |
+ "int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals )", | |
+ "]])", | |
+ "{", | |
+ " struct yyguts_t dummy_yyguts;", | |
+ "", | |
+ " yyset_extra (yy_user_defined, &dummy_yyguts);", | |
+ "", | |
+ " if (ptr_yy_globals == NULL){", | |
+ " errno = EINVAL;", | |
+ " return 1;", | |
+ " }", | |
+ " ", | |
+ " *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );", | |
+ " ", | |
+ " if (*ptr_yy_globals == NULL){", | |
+ " errno = ENOMEM;", | |
+ " return 1;", | |
+ " }", | |
+ " ", | |
+ " /* By setting to 0xAA, we expose bugs in", | |
+ " yy_init_globals. Leave at 0x00 for releases. */", | |
+ " memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));", | |
+ " ", | |
+ " yyset_extra (yy_user_defined, *ptr_yy_globals);", | |
+ " ", | |
+ " return yy_init_globals ( *ptr_yy_globals );", | |
+ "}", | |
+ "", | |
+ "%endif if-c-only", | |
+ "", | |
+ "", | |
+ "%if-c-only", | |
+ "static int yy_init_globals YYFARGS0(void)", | |
+ "{", | |
+ " M4_YY_DECL_GUTS_VAR();", | |
+ " /* Initialization is the same as for the non-reentrant scanner.", | |
+ " * This function is called from yylex_destroy(), so don't allocate here.", | |
+ " */", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_USE_LINENO]],", | |
+ "[[", | |
+ " m4_ifdef( [[M4_YY_NOT_REENTRANT]],", | |
+ " [[", | |
+ " /* We do not touch yylineno unless the option is enabled. */", | |
+ " yylineno = 1;", | |
+ " ]])", | |
+ "]])", | |
+ " YY_G(yy_buffer_stack) = 0;", | |
+ " YY_G(yy_buffer_stack_top) = 0;", | |
+ " YY_G(yy_buffer_stack_max) = 0;", | |
+ " YY_G(yy_c_buf_p) = (char *) 0;", | |
+ " YY_G(yy_init) = 0;", | |
+ " YY_G(yy_start) = 0;", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_HAS_START_STACK_VARS]],", | |
+ "[[", | |
+ " YY_G(yy_start_stack_ptr) = 0;", | |
+ " YY_G(yy_start_stack_depth) = 0;", | |
+ " YY_G(yy_start_stack) = NULL;", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_USES_REJECT]],", | |
+ "[[", | |
+ " YY_G(yy_state_buf) = 0;", | |
+ " YY_G(yy_state_ptr) = 0;", | |
+ " YY_G(yy_full_match) = 0;", | |
+ " YY_G(yy_lp) = 0;", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_TEXT_IS_ARRAY]],", | |
+ "[[", | |
+ " YY_G(yytext_ptr) = 0;", | |
+ " YY_G(yy_more_offset) = 0;", | |
+ " YY_G(yy_prev_more_offset) = 0;", | |
+ "]])", | |
+ "", | |
+ "/* Defined in main.c */", | |
+ "#ifdef YY_STDINIT", | |
+ " yyin = stdin;", | |
+ " yyout = stdout;", | |
+ "#else", | |
+ " yyin = (FILE *) 0;", | |
+ " yyout = (FILE *) 0;", | |
+ "#endif", | |
+ "", | |
+ " /* For future reference: Set errno on error, since we are called by", | |
+ " * yylex_init()", | |
+ " */", | |
+ " return 0;", | |
+ "}", | |
+ "%endif", | |
+ "", | |
+ "", | |
+ "%if-c-only SNIP! this currently causes conflicts with the c++ scanner", | |
+ "/* yylex_destroy is for both reentrant and non-reentrant scanners. */", | |
+ "int yylex_destroy YYFARGS0(void)", | |
+ "{", | |
+ " M4_YY_DECL_GUTS_VAR();", | |
+ "", | |
+ " /* Pop the buffer stack, destroying each element. */", | |
+ " while(YY_CURRENT_BUFFER){", | |
+ " yy_delete_buffer( YY_CURRENT_BUFFER M4_YY_CALL_LAST_ARG );", | |
+ " YY_CURRENT_BUFFER_LVALUE = NULL;", | |
+ " yypop_buffer_state(M4_YY_CALL_ONLY_ARG);", | |
+ " }", | |
+ "", | |
+ " /* Destroy the stack itself. */", | |
+ " yyfree(YY_G(yy_buffer_stack) M4_YY_CALL_LAST_ARG);", | |
+ " YY_G(yy_buffer_stack) = NULL;", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_HAS_START_STACK_VARS]],", | |
+ "[[", | |
+ " /* Destroy the start condition stack. */", | |
+ " yyfree( YY_G(yy_start_stack) M4_YY_CALL_LAST_ARG );", | |
+ " YY_G(yy_start_stack) = NULL;", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_USES_REJECT]],", | |
+ "[[", | |
+ " yyfree ( YY_G(yy_state_buf) M4_YY_CALL_LAST_ARG);", | |
+ " YY_G(yy_state_buf) = NULL;", | |
+ "]])", | |
+ "", | |
+ " /* Reset the globals. This is important in a non-reentrant scanner so the next time", | |
+ " * yylex() is called, initialization will occur. */", | |
+ " yy_init_globals( M4_YY_CALL_ONLY_ARG);", | |
+ "", | |
+ "%if-reentrant", | |
+ " /* Destroy the main struct (reentrant only). */", | |
+ " yyfree ( yyscanner M4_YY_CALL_LAST_ARG );", | |
+ " yyscanner = NULL;", | |
+ "%endif", | |
+ " return 0;", | |
+ "}", | |
+ "%endif", | |
+ "", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],", | |
+ "[[", | |
+ "/*", | |
+ " * Internal utility routines.", | |
+ " */", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],", | |
+ "[[", | |
+ "#ifndef yytext_ptr", | |
+ "static void yy_flex_strncpy YYFARGS3( char*,s1, yyconst char *,s2, int,n)", | |
+ "{", | |
+ " register int i;", | |
+ " for ( i = 0; i < n; ++i )", | |
+ " s1[i] = s2[i];", | |
+ "}", | |
+ "#endif", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NOT_IN_HEADER]],", | |
+ "[[", | |
+ "#ifdef YY_NEED_STRLEN", | |
+ "static int yy_flex_strlen YYFARGS1( yyconst char *,s)", | |
+ "{", | |
+ " register int n;", | |
+ " for ( n = 0; s[n]; ++n )", | |
+ " ;", | |
+ "", | |
+ " return n;", | |
+ "}", | |
+ "#endif", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NO_FLEX_ALLOC]],,", | |
+ "[[", | |
+ "void *yyalloc YYFARGS1( yy_size_t ,size)", | |
+ "{", | |
+ " return (void *) malloc( size );", | |
+ "}", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NO_FLEX_REALLOC]],,", | |
+ "[[", | |
+ "void *yyrealloc YYFARGS2( void *,ptr, yy_size_t ,size)", | |
+ "{", | |
+ " /* The cast to (char *) in the following accommodates both", | |
+ " * implementations that use char* generic pointers, and those", | |
+ " * that use void* generic pointers. It works with the latter", | |
+ " * because both ANSI C and C++ allow castless assignment from", | |
+ " * any pointer type to void*, and deal with argument conversions", | |
+ " * as though doing an assignment.", | |
+ " */", | |
+ " return (void *) realloc( (char *) ptr, size );", | |
+ "}", | |
+ "]])", | |
+ "", | |
+ "m4_ifdef( [[M4_YY_NO_FLEX_FREE]],,", | |
+ "[[", | |
+ "void yyfree YYFARGS1( void *,ptr)", | |
+ "{", | |
+ " free( (char *) ptr ); /* see yyrealloc() for (char *) cast */", | |
+ "}", | |
+ "]])", | |
+ "", | |
+ "%if-tables-serialization definitions", | |
+ "#ifdef FLEX_SCANNER", | |
+ "/*", | |
+ "dnl tables_shared.c - tables serialization code", | |
+ "dnl ", | |
+ "dnl Copyright (c) 1990 The Regents of the University of California.", | |
+ "dnl All rights reserved.", | |
+ "dnl ", | |
+ "dnl This code is derived from software contributed to Berkeley by", | |
+ "dnl Vern Paxson.", | |
+ "dnl ", | |
+ "dnl The United States Government has rights in this work pursuant", | |
+ "dnl to contract no. DE-AC03-76SF00098 between the United States", | |
+ "dnl Department of Energy and the University of California.", | |
+ "dnl ", | |
+ "dnl This file is part of flex.", | |
+ "dnl ", | |
+ "dnl Redistribution and use in source and binary forms, with or without", | |
+ "dnl modification, are permitted provided that the following conditions", | |
+ "dnl are met:", | |
+ "dnl ", | |
+ "dnl 1. Redistributions of source code must retain the above copyright", | |
+ "dnl notice, this list of conditions and the following disclaimer.", | |
+ "dnl 2. Redistributions in binary form must reproduce the above copyright", | |
+ "dnl notice, this list of conditions and the following disclaimer in the", | |
+ "dnl documentation and/or other materials provided with the distribution.", | |
+ "dnl ", | |
+ "dnl Neither the name of the University nor the names of its contributors", | |
+ "dnl may be used to endorse or promote products derived from this software", | |
+ "dnl without specific prior written permission.", | |
+ "dnl ", | |
+ "dnl THIS SOFTWARE IS PROVIDED `AS IS' AND WITHOUT ANY EXPRESS OR", | |
+ "dnl IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED", | |
+ "dnl WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR", | |
+ "dnl PURPOSE.", | |
+ "dnl ", | |
+ "*/", | |
+ "", | |
+ "/* This file is meant to be included in both the skeleton and the actual", | |
+ " * flex code (hence the name \"_shared\"). ", | |
+ " */", | |
+ "#ifndef yyskel_static", | |
+ "#define yyskel_static static", | |
+ "#endif", | |
+ "#else", | |
+ "#include \"flexdef.h\"", | |
+ "#include \"tables.h\"", | |
+ "#ifndef yyskel_static", | |
+ "#define yyskel_static", | |
+ "#endif", | |
+ "#endif", | |
+ "", | |
+ "", | |
+ "/** Get the number of integers in this table. This is NOT the", | |
+ " * same thing as the number of elements.", | |
+ " * @param td the table ", | |
+ " * @return the number of integers in the table", | |
+ " */", | |
+ "yyskel_static flex_int32_t yytbl_calc_total_len (const struct yytbl_data *tbl)", | |
+ "{", | |
+ " flex_int32_t n;", | |
+ "", | |
+ " /* total number of ints */", | |
+ " n = tbl->td_lolen;", | |
+ " if (tbl->td_hilen > 0)", | |
+ " n *= tbl->td_hilen;", | |
+ "", | |
+ " if (tbl->td_id == YYTD_ID_TRANSITION)", | |
+ " n *= 2;", | |
+ " return n;", | |
+ "}", | |
+ "", | |
+ "", | |
+ "static int yytbl_read8 (void *v, struct yytbl_reader * rd)", | |
+ "{", | |
+ " errno = 0;", | |
+ " if (fread (v, sizeof (flex_uint8_t), 1, rd->fp) != 1){", | |
+ " errno = EIO;", | |
+ " return -1;", | |
+ " }", | |
+ " rd->bread += sizeof(flex_uint8_t);", | |
+ " return 0;", | |
+ "}", | |
+ "", | |
+ "static int yytbl_read16 (void *v, struct yytbl_reader * rd)", | |
+ "{", | |
+ " errno = 0;", | |
+ " if (fread (v, sizeof (flex_uint16_t), 1, rd->fp) != 1){", | |
+ " errno = EIO;", | |
+ " return -1;", | |
+ " }", | |
+ " *((flex_uint16_t *) v) = ntohs (*((flex_uint16_t *) v));", | |
+ " rd->bread += sizeof(flex_uint16_t);", | |
+ " return 0;", | |
+ "}", | |
+ "", | |
+ "static int yytbl_read32 (void *v, struct yytbl_reader * rd)", | |
+ "{", | |
+ " errno = 0;", | |
+ " if (fread (v, sizeof (flex_uint32_t), 1, rd->fp) != 1){", | |
+ " errno = EIO;", | |
+ " return -1;", | |
+ " }", | |
+ " *((flex_uint32_t *) v) = ntohl (*((flex_uint32_t *) v));", | |
+ " rd->bread += sizeof(flex_uint32_t);", | |
+ " return 0;", | |
+ "}", | |
+ "", | |
+ "/** Read the header */", | |
+ "static int yytbl_hdr_read YYFARGS2(struct yytbl_hdr *, th, struct yytbl_reader *, rd)", | |
+ "{", | |
+ " int bytes;", | |
+ " memset (th, 0, sizeof (struct yytbl_hdr));", | |
+ "", | |
+ " if (yytbl_read32 (&(th->th_magic), rd) != 0)", | |
+ " return -1;", | |
+ "", | |
+ " if (th->th_magic != YYTBL_MAGIC){", | |
+ " YY_FATAL_ERROR( \"bad magic number\" ); /* TODO: not fatal. */", | |
+ " return -1;", | |
+ " }", | |
+ "", | |
+ " if (yytbl_read32 (&(th->th_hsize), rd) != 0", | |
+ " || yytbl_read32 (&(th->th_ssize), rd) != 0", | |
+ " || yytbl_read16 (&(th->th_flags), rd) != 0)", | |
+ " return -1;", | |
+ "", | |
+ " /* Sanity check on header size. Greater than 1k suggests some funny business. */", | |
+ " if (th->th_hsize < 16 || th->th_hsize > 1024){", | |
+ " YY_FATAL_ERROR( \"insane header size detected\" ); /* TODO: not fatal. */", | |
+ " return -1;", | |
+ " }", | |
+ "", | |
+ " /* Allocate enough space for the version and name fields */", | |
+ " bytes = th->th_hsize - 14;", | |
+ " th->th_version = (char *) yyalloc (bytes M4_YY_CALL_LAST_ARG);", | |
+ " if ( ! th->th_version )", | |
+ " YY_FATAL_ERROR( \"out of dynamic memory in yytbl_hdr_read()\" );", | |
+ "", | |
+ " /* we read it all into th_version, and point th_name into that data */", | |
+ " if (fread (th->th_version, 1, bytes, rd->fp) != bytes){", | |
+ " errno = EIO;", | |
+ " yyfree(th->th_version M4_YY_CALL_LAST_ARG);", | |
+ " th->th_version = NULL;", | |
+ " return -1;", | |
+ " }", | |
+ " else", | |
+ " rd->bread += bytes;", | |
+ "", | |
+ " th->th_name = th->th_version + strlen (th->th_version) + 1;", | |
+ " return 0;", | |
+ "}", | |
+ "", | |
+ "/** lookup id in the dmap list.", | |
+ " * @param dmap pointer to first element in list", | |
+ " * @return NULL if not found.", | |
+ " */", | |
+ "static struct yytbl_dmap *yytbl_dmap_lookup YYFARGS2(struct yytbl_dmap *, dmap,", | |
+ " int, id)", | |
+ "{", | |
+ " while (dmap->dm_id)", | |
+ " if (dmap->dm_id == id)", | |
+ " return dmap;", | |
+ " else", | |
+ " dmap++;", | |
+ " return NULL;", | |
+ "}", | |
+ "", | |
+ "/** Read a table while mapping its contents to the local array. ", | |
+ " * @param dmap used to performing mapping", | |
+ " * @return 0 on success", | |
+ " */", | |
+ "static int yytbl_data_load YYFARGS2(struct yytbl_dmap *, dmap, struct yytbl_reader*, rd)", | |
+ "{", | |
+ " struct yytbl_data td;", | |
+ " struct yytbl_dmap *transdmap=0;", | |
+ " int len, i, rv, inner_loop_count;", | |
+ " void *p=0;", | |
+ "", | |
+ " memset (&td, 0, sizeof (struct yytbl_data));", | |
+ "", | |
+ " if (yytbl_read16 (&td.td_id, rd) != 0", | |
+ " || yytbl_read16 (&td.td_flags, rd) != 0", | |
+ " || yytbl_read32 (&td.td_hilen, rd) != 0", | |
+ " || yytbl_read32 (&td.td_lolen, rd) != 0)", | |
+ " return -1;", | |
+ "", | |
+ " /* Lookup the map for the transition table so we have it in case we need it", | |
+ " * inside the loop below. This scanner might not even have a transition", | |
+ " * table, which is ok.", | |
+ " */", | |
+ " transdmap = yytbl_dmap_lookup (dmap, YYTD_ID_TRANSITION M4_YY_CALL_LAST_ARG);", | |
+ "", | |
+ " if ((dmap = yytbl_dmap_lookup (dmap, td.td_id M4_YY_CALL_LAST_ARG)) == NULL){", | |
+ " YY_FATAL_ERROR( \"table id not found in map.\" ); /* TODO: not fatal. */", | |
+ " return -1;", | |
+ " }", | |
+ "", | |
+ " /* Allocate space for table.", | |
+ " * The --full yy_transition table is a special case, since we", | |
+ " * need the dmap.dm_sz entry to tell us the sizeof the individual", | |
+ " * struct members.", | |
+ " */", | |
+ " {", | |
+ " size_t bytes;", | |
+ "", | |
+ " if ((td.td_flags & YYTD_STRUCT))", | |
+ " bytes = sizeof(struct yy_trans_info) * td.td_lolen * (td.td_hilen ? td.td_hilen : 1);", | |
+ " else", | |
+ " bytes = td.td_lolen * (td.td_hilen ? td.td_hilen : 1) * dmap->dm_sz;", | |
+ "", | |
+ " if(M4_YY_TABLES_VERIFY)", | |
+ " /* We point to the array itself */", | |
+ " p = dmap->dm_arr; ", | |
+ " else", | |
+ " /* We point to the address of a pointer. */", | |
+ " *dmap->dm_arr = p = (void *) yyalloc (bytes M4_YY_CALL_LAST_ARG);", | |
+ " if ( ! p )", | |
+ " YY_FATAL_ERROR( \"out of dynamic memory in yytbl_data_load()\" );", | |
+ " }", | |
+ "", | |
+ " /* If it's a struct, we read 2 integers to get one element */", | |
+ " if ((td.td_flags & YYTD_STRUCT) != 0)", | |
+ " inner_loop_count = 2;", | |
+ " else", | |
+ " inner_loop_count = 1;", | |
+ "", | |
+ " /* read and map each element.", | |
+ " * This loop iterates once for each element of the td_data array.", | |
+ " * Notice that we increment 'i' in the inner loop.", | |
+ " */", | |
+ " len = yytbl_calc_total_len (&td);", | |
+ " for (i = 0; i < len; ){", | |
+ " int j;", | |
+ "", | |
+ "", | |
+ " /* This loop really executes exactly 1 or 2 times.", | |
+ " * The second time is to handle the second member of the", | |
+ " * YYTD_STRUCT for the yy_transition array.", | |
+ " */", | |
+ " for (j = 0; j < inner_loop_count; j++, i++) {", | |
+ " flex_int32_t t32;", | |
+ "", | |
+ " /* read into t32 no matter what the real size is. */", | |
+ " {", | |
+ " flex_int16_t t16;", | |
+ " flex_int8_t t8;", | |
+ "", | |
+ " switch (YYTDFLAGS2BYTES (td.td_flags)) {", | |
+ " case sizeof (flex_int32_t):", | |
+ " rv = yytbl_read32 (&t32, rd);", | |
+ " break;", | |
+ " case sizeof (flex_int16_t):", | |
+ " rv = yytbl_read16 (&t16, rd);", | |
+ " t32 = t16;", | |
+ " break;", | |
+ " case sizeof (flex_int8_t):", | |
+ " rv = yytbl_read8 (&t8, rd);", | |
+ " t32 = t8;", | |
+ " break;", | |
+ " default: ", | |
+ " YY_FATAL_ERROR( \"invalid td_flags\" ); /* TODO: not fatal. */", | |
+ " return -1;", | |
+ " }", | |
+ " }", | |
+ " if (rv != 0)", | |
+ " return -1;", | |
+ "", | |
+ " /* copy into the deserialized array... */", | |
+ "", | |
+ " if ((td.td_flags & YYTD_STRUCT)) {", | |
+ " /* t32 is the j'th member of a two-element struct. */", | |
+ " void *v;", | |
+ "", | |
+ " v = j == 0 ? &(((struct yy_trans_info *) p)->yy_verify)", | |
+ " : &(((struct yy_trans_info *) p)->yy_nxt);", | |
+ "", | |
+ " switch (dmap->dm_sz) {", | |
+ " case sizeof (flex_int32_t):", | |
+ " if (M4_YY_TABLES_VERIFY){", | |
+ " if( ((flex_int32_t *) v)[0] != (flex_int32_t) t32)", | |
+ " YY_FATAL_ERROR( \"tables verification failed at YYTD_STRUCT flex_int32_t\" );", | |
+ " }else", | |
+ " ((flex_int32_t *) v)[0] = (flex_int32_t) t32;", | |
+ " break;", | |
+ " case sizeof (flex_int16_t):", | |
+ " if (M4_YY_TABLES_VERIFY ){", | |
+ " if(((flex_int16_t *) v)[0] != (flex_int16_t) t32)", | |
+ " YY_FATAL_ERROR( \"tables verification failed at YYTD_STRUCT flex_int16_t\" );", | |
+ " }else", | |
+ " ((flex_int16_t *) v)[0] = (flex_int16_t) t32;", | |
+ " break;", | |
+ " case sizeof(flex_int8_t):", | |
+ " if (M4_YY_TABLES_VERIFY ){", | |
+ " if( ((flex_int8_t *) v)[0] != (flex_int8_t) t32)", | |
+ " YY_FATAL_ERROR( \"tables verification failed at YYTD_STRUCT flex_int8_t\" );", | |
+ " }else", | |
+ " ((flex_int8_t *) v)[0] = (flex_int8_t) t32;", | |
+ " break;", | |
+ " default:", | |
+ " YY_FATAL_ERROR( \"invalid dmap->dm_sz for struct\" ); /* TODO: not fatal. */", | |
+ " return -1;", | |
+ " }", | |
+ "", | |
+ " /* if we're done with j, increment p */", | |
+ " if (j == 1)", | |
+ " p = (struct yy_trans_info *) p + 1;", | |
+ " }", | |
+ " else if ((td.td_flags & YYTD_PTRANS)) {", | |
+ " /* t32 is an index into the transition array. */", | |
+ " struct yy_trans_info *v;", | |
+ "", | |
+ "", | |
+ " if (!transdmap){", | |
+ " YY_FATAL_ERROR( \"transition table not found\" ); /* TODO: not fatal. */", | |
+ " return -1;", | |
+ " }", | |
+ " ", | |
+ " if( M4_YY_TABLES_VERIFY)", | |
+ " v = &(((struct yy_trans_info *) (transdmap->dm_arr))[t32]);", | |
+ " else", | |
+ " v = &((*((struct yy_trans_info **) (transdmap->dm_arr)))[t32]);", | |
+ "", | |
+ " if(M4_YY_TABLES_VERIFY ){", | |
+ " if( ((struct yy_trans_info **) p)[0] != v)", | |
+ " YY_FATAL_ERROR( \"tables verification failed at YYTD_PTRANS\" );", | |
+ " }else", | |
+ " ((struct yy_trans_info **) p)[0] = v;", | |
+ " ", | |
+ " /* increment p */", | |
+ " p = (struct yy_trans_info **) p + 1;", | |
+ " }", | |
+ " else {", | |
+ " /* t32 is a plain int. copy data, then incrememnt p. */", | |
+ " switch (dmap->dm_sz) {", | |
+ " case sizeof (flex_int32_t):", | |
+ " if(M4_YY_TABLES_VERIFY ){", | |
+ " if( ((flex_int32_t *) p)[0] != (flex_int32_t) t32)", | |
+ " YY_FATAL_ERROR( \"tables verification failed at flex_int32_t\" );", | |
+ " }else", | |
+ " ((flex_int32_t *) p)[0] = (flex_int32_t) t32;", | |
+ " p = ((flex_int32_t *) p) + 1;", | |
+ " break;", | |
+ " case sizeof (flex_int16_t):", | |
+ " if(M4_YY_TABLES_VERIFY ){", | |
+ " if( ((flex_int16_t *) p)[0] != (flex_int16_t) t32)", | |
+ " YY_FATAL_ERROR( \"tables verification failed at flex_int16_t\" );", | |
+ " }else", | |
+ " ((flex_int16_t *) p)[0] = (flex_int16_t) t32;", | |
+ " p = ((flex_int16_t *) p) + 1;", | |
+ " break;", | |
+ " case sizeof (flex_int8_t):", | |
+ " if(M4_YY_TABLES_VERIFY ){", | |
+ " if( ((flex_int8_t *) p)[0] != (flex_int8_t) t32)", | |
+ " YY_FATAL_ERROR( \"tables verification failed at flex_int8_t\" );", | |
+ " }else", | |
+ " ((flex_int8_t *) p)[0] = (flex_int8_t) t32;", | |
+ " p = ((flex_int8_t *) p) + 1;", | |
+ " break;", | |
+ " default:", | |
+ " YY_FATAL_ERROR( \"invalid dmap->dm_sz for plain int\" ); /* TODO: not fatal. */", | |
+ " return -1;", | |
+ " }", | |
+ " }", | |
+ " }", | |
+ "", | |
+ " }", | |
+ "", | |
+ " /* Now eat padding. */", | |
+ " {", | |
+ " int pad;", | |
+ " pad = yypad64(rd->bread);", | |
+ " while(--pad >= 0){", | |
+ " flex_int8_t t8;", | |
+ " if(yytbl_read8(&t8,rd) != 0)", | |
+ " return -1;", | |
+ " }", | |
+ " }", | |
+ "", | |
+ " return 0;", | |
+ "}", | |
+ "", | |
+ "%define-yytables The name for this specific scanner's tables.", | |
+ "", | |
+ "/* Find the key and load the DFA tables from the given stream. */", | |
+ "static int yytbl_fload YYFARGS2(FILE *, fp, const char *, key)", | |
+ "{", | |
+ " int rv=0;", | |
+ " struct yytbl_hdr th;", | |
+ " struct yytbl_reader rd;", | |
+ "", | |
+ " rd.fp = fp;", | |
+ " th.th_version = NULL;", | |
+ "", | |
+ " /* Keep trying until we find the right set of tables or end of file. */", | |
+ " while (!feof(rd.fp)) {", | |
+ " rd.bread = 0;", | |
+ " if (yytbl_hdr_read (&th, &rd M4_YY_CALL_LAST_ARG) != 0){", | |
+ " rv = -1;", | |
+ " goto return_rv;", | |
+ " }", | |
+ "", | |
+ " /* A NULL key means choose the first set of tables. */", | |
+ " if (key == NULL)", | |
+ " break;", | |
+ "", | |
+ " if (strcmp(th.th_name,key) != 0){", | |
+ " /* Skip ahead to next set */", | |
+ " fseek(rd.fp, th.th_ssize - th.th_hsize, SEEK_CUR);", | |
+ " yyfree(th.th_version M4_YY_CALL_LAST_ARG);", | |
+ " th.th_version = NULL;", | |
+ " }", | |
+ " else", | |
+ " break;", | |
+ " }", | |
+ "", | |
+ " while (rd.bread < th.th_ssize){", | |
+ " /* Load the data tables */", | |
+ " if(yytbl_data_load (yydmap,&rd M4_YY_CALL_LAST_ARG) != 0){", | |
+ " rv = -1;", | |
+ " goto return_rv;", | |
+ " }", | |
+ " }", | |
+ "", | |
+ "return_rv:", | |
+ " if(th.th_version){", | |
+ " yyfree(th.th_version M4_YY_CALL_LAST_ARG);", | |
+ " th.th_version = NULL;", | |
+ " }", | |
+ "", | |
+ " return rv;", | |
+ "}", | |
+ "", | |
+ "/** Load the DFA tables for this scanner from the given stream. */", | |
+ "int yytables_fload YYFARGS1(FILE *, fp)", | |
+ "{", | |
+ "", | |
+ " if( yytbl_fload(fp, YYTABLES_NAME M4_YY_CALL_LAST_ARG) != 0)", | |
+ " return -1;", | |
+ " return 0;", | |
+ "}", | |
+ "", | |
+ "/** Destroy the loaded tables, freeing memory, etc.. */", | |
+ "int yytables_destroy YYFARGS0(void)", | |
+ "{ ", | |
+ " struct yytbl_dmap *dmap=0;", | |
+ "", | |
+ " if(!M4_YY_TABLES_VERIFY){", | |
+ " /* Walk the dmap, freeing the pointers */", | |
+ " for(dmap=yydmap; dmap->dm_id; dmap++) {", | |
+ " void * v;", | |
+ " v = dmap->dm_arr;", | |
+ " if(v && *(char**)v){", | |
+ " yyfree(*(char**)v M4_YY_CALL_LAST_ARG);", | |
+ " *(char**)v = NULL;", | |
+ " }", | |
+ " }", | |
+ " }", | |
+ "", | |
+ " return 0;", | |
+ "}", | |
+ "", | |
+ "/* end table serialization code definitions */", | |
+ "%endif", | |
+ "", | |
+ "", | |
+ "m4_ifdef([[M4_YY_MAIN]], [[", | |
+ "int main M4_YY_PARAMS(void);", | |
+ "", | |
+ "int main ()", | |
+ "{", | |
+ "", | |
+ "%if-reentrant", | |
+ " yyscan_t lexer;", | |
+ " yylex_init(&lexer);", | |
+ " yylex( lexer );", | |
+ " yylex_destroy( lexer);", | |
+ "", | |
+ "%endif", | |
+ "%if-not-reentrant", | |
+ " yylex();", | |
+ "%endif", | |
+ "", | |
+ " return 0;", | |
+ "}", | |
+ "]])", | |
+ "", | |
+ "%ok-for-header", | |
+ "m4_ifdef( [[M4_YY_IN_HEADER]],", | |
+ "[[", | |
+ "#undef YY_NEW_FILE", | |
+ "#undef YY_FLUSH_BUFFER", | |
+ "#undef yy_set_bol", | |
+ "#undef yy_new_buffer", | |
+ "#undef yy_set_interactive", | |
+ "#undef YY_DO_BEFORE_ACTION", | |
+ "", | |
+ "#ifdef YY_DECL_IS_OURS", | |
+ "#undef YY_DECL_IS_OURS", | |
+ "#undef YY_DECL", | |
+ "#endif", | |
+ "]])", | |
+ 0 | |
+}; | |
Only in flex-2.5.39: install-sh | |
Only in flex-2.5.39: lib | |
Only in flex-2.5.39: ltmain.sh | |
Only in flex-2.5.39: m4 | |
diff -Pu flex-2.5.39/main.c openbsd-flex/main.c | |
--- flex-2.5.39/main.c Wed Mar 26 05:46:44 2014 | |
+++ openbsd-flex/main.c Tue Nov 3 03:46:10 2015 | |
@@ -221,6 +221,13 @@ | |
#endif | |
#endif | |
+ if (pledge("stdio rpath wpath cpath proc exec", NULL) == -1) | |
+ { | |
+ fprintf( stderr, _( "%s: pledge\n"), | |
+ program_name); | |
+ exit(1); | |
+ } | |
+ | |
return flex_main (argc, argv); | |
} | |
diff -Pu flex-2.5.39/misc.c openbsd-flex/misc.c | |
--- flex-2.5.39/misc.c Wed Mar 26 05:46:44 2014 | |
+++ openbsd-flex/misc.c Mon Nov 2 15:26:46 2015 | |
@@ -156,7 +156,8 @@ | |
action_size); | |
} | |
- strcpy (&action_array[action_index], new_text); | |
+ strlcpy ( &action_array[action_index], new_text, | |
+ action_size - action_index ); | |
action_index += len; | |
} | |
Only in flex-2.5.39: missing | |
Only in flex-2.5.39: parse.c | |
Only in flex-2.5.39: parse.h | |
Only in flex-2.5.39: po | |
Only in flex-2.5.39: scan.c | |
diff -Pu flex-2.5.39/scan.l openbsd-flex/scan.l | |
--- flex-2.5.39/scan.l Wed Mar 26 05:46:44 2014 | |
+++ openbsd-flex/scan.l Mon Nov 2 15:20:04 2015 | |
@@ -68,7 +68,7 @@ | |
#define RETURNNAME \ | |
if(yyleng < MAXLINE) \ | |
{ \ | |
- strcpy( nmstr, yytext ); \ | |
+ strlcpy( nmstr, yytext, sizeof nmstr ); \ | |
} \ | |
else \ | |
{ \ | |
@@ -185,7 +185,7 @@ | |
^{NAME} { | |
if(yyleng < MAXLINE) | |
{ | |
- strcpy( nmstr, yytext ); | |
+ strlcpy( nmstr, yytext, sizeof nmstr ); | |
} | |
else | |
{ | |
@@ -293,7 +293,7 @@ | |
{NOT_WS}[^\r\n]* { | |
if(yyleng < MAXLINE) | |
{ | |
- strcpy( (char *) nmdef, yytext ); | |
+ strlcpy( (char *) nmdef, yytext, sizeof nmdef ); | |
} | |
else | |
{ | |
@@ -436,7 +436,7 @@ | |
\"[^"\n]*\" { | |
if(yyleng-1 < MAXLINE) | |
{ | |
- strcpy( nmstr, yytext + 1 ); | |
+ strlcpy( nmstr, yytext + 1, sizeof nmstr ); | |
} | |
else | |
{ | |
@@ -611,7 +611,7 @@ | |
if(yyleng < MAXLINE) | |
{ | |
- strcpy( nmstr, yytext ); | |
+ strlcpy( nmstr, yytext, sizeof nmstr ); | |
} | |
else | |
{ | |
@@ -669,7 +669,7 @@ | |
if(yyleng-1 < MAXLINE) | |
{ | |
- strcpy( nmstr, yytext + 1 ); | |
+ strlcpy( nmstr, yytext + 1, sizeof nmstr ); | |
} | |
else | |
{ | |
diff -Pu flex-2.5.39/scanflags.c openbsd-flex/scanflags.c | |
--- flex-2.5.39/scanflags.c Wed Mar 26 05:46:44 2014 | |
+++ openbsd-flex/scanflags.c Mon Nov 2 22:43:41 2015 | |
@@ -62,7 +62,7 @@ | |
_sf_stk = (scanflags_t*) flex_alloc ( sizeof(scanflags_t) * (_sf_max = 32)); | |
if (!_sf_stk) | |
lerrsf_fatal(_("Unable to allocate %ld of stack"), | |
- (long)sizeof(scanflags_t)); | |
+ (void *)sizeof(scanflags_t)); | |
_sf_stk[_sf_top_ix] = 0; | |
} | |
Only in flex-2.5.39: skel.c | |
Only in flex-2.5.39: tests | |
Only in flex-2.5.39: ylwrap |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment