summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManoj Srivastava <srivasta@debian.org>2016-01-22 13:36:58 -0800
committerManoj Srivastava <srivasta@debian.org>2016-01-22 13:36:58 -0800
commit426e91fa66c2a2341d46f977ee351bd24ef3331c (patch)
treeb4d506125335b5e5d748ac284b7239e10df96d21
parent26bb2525c89ecda0b0bc7b597ec8d1b792fc8662 (diff)
parent83d5d1695a2ab1d69ea4d8e7df27146c644876fc (diff)
Merge tag 'v2.6.0' into upstream
flex v2.6.0 release Signed-off-by: Manoj Srivastava <srivasta@debian.org> # gpg: Signature made Sat 05 Dec 2015 11:42:31 AM PST using RSA key ID 4F8BC9A4 # gpg: requesting key 4F8BC9A4 from hkp server pool.sks-keyservers.net # gpg: no valid OpenPGP data found. # gpg: Total number processed: 0 # gpg: keyserver communications error: key not found # gpg: keyserver communications error: bad public key # gpg: Can't check signature: public key not found # Conflicts: # Makefile.am # NEWS # autogen.sh # configure.ac # doc/Makefile.am # doc/flex.texi # examples/fastwc/mywc.c # lib/Makefile.am # lib/malloc.c # lib/realloc.c # po/POTFILES.in # po/ca.po # po/da.po # po/de.po # po/eo.po # po/es.po # po/fi.po # po/fr.po # po/ga.po # po/hr.po # po/ko.po # po/nl.po # po/pl.po # po/pt_BR.po # po/ro.po # po/ru.po # po/sr.po # po/sv.po # po/tr.po # po/vi.po # po/zh_CN.po # po/zh_TW.po # tests/Makefile.am # tests/README
-rw-r--r--.gitignore23
-rw-r--r--BUGS107
-rw-r--r--Makefile.am154
-rw-r--r--NEWS42
-rwxr-xr-xautogen.sh3
-rw-r--r--configure.ac69
-rw-r--r--control.ac1
-rw-r--r--doc/.gitignore27
-rw-r--r--doc/Makefile.am4
-rw-r--r--doc/flex.texi676
-rw-r--r--examples/fastwc/mywc.c2
-rw-r--r--lib/.gitignore3
-rw-r--r--lib/Makefile.am3
-rwxr-xr-xlib/malloc.c34
-rw-r--r--lib/realloc.c2
-rw-r--r--po/.gitignore18
-rw-r--r--po/POTFILES.in36
-rw-r--r--po/Rules-getpo9
-rw-r--r--po/ca.po286
-rw-r--r--po/da.po55
-rw-r--r--po/de.po243
-rw-r--r--po/eo.po218
-rw-r--r--po/es.po580
-rw-r--r--po/fi.po258
-rw-r--r--po/fr.po280
-rw-r--r--po/ga.po310
-rw-r--r--po/hr.po195
-rw-r--r--po/ko.po1273
-rw-r--r--po/nl.po88
-rw-r--r--po/pl.po235
-rw-r--r--po/pt_BR.po234
-rw-r--r--po/ro.po428
-rw-r--r--po/ru.po76
-rw-r--r--po/sr.po239
-rw-r--r--po/sv.po430
-rw-r--r--po/tr.po402
-rw-r--r--po/vi.po107
-rw-r--r--po/zh_CN.po425
-rw-r--r--po/zh_TW.po194
-rw-r--r--src/.gitignore10
-rw-r--r--src/FlexLexer.h225
-rw-r--r--src/Makefile.am144
-rw-r--r--src/buf.c274
-rw-r--r--src/ccl.c310
-rw-r--r--src/dfa.c1096
-rw-r--r--src/ecs.c219
-rw-r--r--src/filter.c439
-rw-r--r--src/flex.skl3552
-rw-r--r--src/flexdef.h1232
-rw-r--r--src/flexint.h63
-rw-r--r--src/gen.c2195
-rw-r--r--src/gettext.h59
-rw-r--r--src/libmain.c34
-rw-r--r--src/libyywrap.c29
-rw-r--r--src/main.c1866
-rw-r--r--src/misc.c1015
-rwxr-xr-xsrc/mkskel.sh37
-rw-r--r--src/nfa.c719
-rw-r--r--src/options.c282
-rw-r--r--src/options.h135
-rw-r--r--src/parse.y1090
-rw-r--r--src/regex.c171
-rw-r--r--src/scan.l1029
-rw-r--r--src/scanflags.c68
-rw-r--r--src/scanopt.c866
-rw-r--r--src/scanopt.h132
-rw-r--r--src/sym.c272
-rw-r--r--src/tables.c502
-rw-r--r--src/tables.h85
-rw-r--r--src/tables_shared.c70
-rw-r--r--src/tables_shared.h144
-rw-r--r--src/tblcmp.c853
-rw-r--r--src/version.h1
-rw-r--r--src/yylex.c212
-rw-r--r--tests/.gitignore105
-rw-r--r--tests/Makefile.am581
-rw-r--r--tests/README74
-rw-r--r--tests/alloc_extra.l123
-rw-r--r--tests/alloc_extra.txt795
-rw-r--r--tests/array_nr.l55
-rw-r--r--tests/array_nr.txt2
-rw-r--r--tests/array_r.l62
-rw-r--r--tests/array_r.txt2
-rw-r--r--tests/basic_nr.l64
-rw-r--r--tests/basic_nr.txt5
-rw-r--r--tests/basic_r.l68
-rw-r--r--tests/basic_r.txt4
-rw-r--r--tests/bison_nr.txt4
-rw-r--r--tests/bison_nr_main.c42
-rw-r--r--tests/bison_nr_parser.y98
-rw-r--r--tests/bison_nr_scanner.l62
-rw-r--r--tests/bison_yylloc.txt4
-rw-r--r--tests/bison_yylloc_main.c44
-rw-r--r--tests/bison_yylloc_parser.y102
-rw-r--r--tests/bison_yylloc_scanner.l65
-rw-r--r--tests/bison_yylval.txt5
-rw-r--r--tests/bison_yylval_main.c43
-rw-r--r--tests/bison_yylval_parser.y84
-rw-r--r--tests/bison_yylval_scanner.l81
-rw-r--r--tests/c_cxx_nr.lll57
-rw-r--r--tests/c_cxx_nr.txt2
-rw-r--r--tests/c_cxx_r.lll61
-rw-r--r--tests/c_cxx_r.txt2
-rw-r--r--tests/ccl.l95
-rw-r--r--tests/ccl.txt27
-rw-r--r--tests/cxx_basic.ll50
-rw-r--r--tests/cxx_basic.txt2
-rw-r--r--tests/cxx_multiple_scanners.txt1
-rw-r--r--tests/cxx_multiple_scanners_1.ll44
-rw-r--r--tests/cxx_multiple_scanners_2.ll48
-rw-r--r--tests/cxx_multiple_scanners_main.cc56
-rw-r--r--tests/cxx_yywrap.ll70
-rw-r--r--tests/cxx_yywrap.txt2
-rw-r--r--tests/debug_nr.l52
-rw-r--r--tests/debug_nr.txt2
-rw-r--r--tests/debug_r.l59
-rw-r--r--tests/debug_r.txt2
-rw-r--r--tests/extended.l73
-rw-r--r--tests/extended.txt2
-rw-r--r--tests/header_nr.txt3
-rw-r--r--tests/header_nr_main.c40
-rw-r--r--tests/header_nr_scanner.l42
-rw-r--r--tests/header_r.txt3
-rw-r--r--tests/header_r_main.c67
-rw-r--r--tests/header_r_scanner.l46
-rw-r--r--tests/include_by_buffer.direct.l102
-rw-r--r--tests/include_by_buffer.direct.txt3
-rw-r--r--tests/include_by_buffer.direct_2.txt3
-rw-r--r--tests/include_by_buffer.direct_3.txt2
-rw-r--r--tests/include_by_push.direct.l92
-rw-r--r--tests/include_by_push.direct.txt3
-rw-r--r--tests/include_by_push.direct_2.txt3
-rw-r--r--tests/include_by_push.direct_3.txt2
-rw-r--r--tests/include_by_reentrant.direct.l101
-rw-r--r--tests/include_by_reentrant.direct.txt3
-rw-r--r--tests/include_by_reentrant.direct_2.txt3
-rw-r--r--tests/include_by_reentrant.direct_3.txt2
-rw-r--r--tests/lineno_nr.l96
-rw-r--r--tests/lineno_nr.one.txt19
-rw-r--r--tests/lineno_r.l99
-rw-r--r--tests/lineno_r.one.txt19
-rw-r--r--tests/lineno_trailing.l89
-rw-r--r--tests/lineno_trailing.one.txt13
-rw-r--r--tests/mem_nr.l179
-rw-r--r--tests/mem_nr.txt25
-rw-r--r--tests/mem_r.l187
-rw-r--r--tests/mem_r.txt25
-rw-r--r--tests/multiple_scanners_nr_1.l50
-rw-r--r--tests/multiple_scanners_nr_2.l49
-rw-r--r--tests/multiple_scanners_nr_main.c51
-rw-r--r--tests/multiple_scanners_r_1.l50
-rw-r--r--tests/multiple_scanners_r_2.l49
-rw-r--r--tests/multiple_scanners_r_main.c65
-rw-r--r--tests/noansi_nr.l67
-rw-r--r--tests/noansi_nr.txt5
-rw-r--r--tests/noansi_r.l69
-rw-r--r--tests/noansi_r.txt4
-rwxr-xr-xtests/options.cn5
-rw-r--r--tests/posix.l79
-rw-r--r--tests/posixly_correct.l79
-rw-r--r--tests/prefix_nr.l75
-rw-r--r--tests/prefix_nr.txt1
-rw-r--r--tests/prefix_r.l83
-rw-r--r--tests/prefix_r.txt1
-rw-r--r--tests/pthread.l210
-rw-r--r--tests/pthread_1.txt847
-rw-r--r--tests/pthread_2.txt847
-rw-r--r--tests/pthread_3.txt847
-rw-r--r--tests/pthread_4.txt847
-rw-r--r--tests/pthread_5.txt847
-rw-r--r--tests/quotes.l101
-rw-r--r--tests/quotes.txt2
-rw-r--r--tests/reject.l482
-rw-r--r--tests/reject.txt2
-rw-r--r--tests/rescan_nr.direct.l72
-rw-r--r--tests/rescan_nr.direct.txt2
-rw-r--r--tests/rescan_r.direct.l97
-rw-r--r--tests/rescan_r.direct.txt2
-rw-r--r--tests/string_nr.l96
-rw-r--r--tests/string_r.l103
-rw-r--r--tests/tableopts.am333
-rw-r--r--tests/tableopts.l484
-rwxr-xr-xtests/tableopts.sh44
-rw-r--r--tests/tableopts.txt2
-rwxr-xr-xtests/testwrapper.sh53
-rw-r--r--tests/top.l53
-rw-r--r--tests/top.txt3
-rw-r--r--tests/top_main.c67
-rw-r--r--tests/yyextra.l121
-rw-r--r--tests/yyextra.txt795
-rw-r--r--to.do/README46
-rw-r--r--to.do/Wilhelms.todo711
-rw-r--r--to.do/Wish-List277
-rw-r--r--to.do/flex.rmail4520
-rw-r--r--to.do/streams.mail194
-rw-r--r--to.do/unicode/FlexLexer.h195
-rw-r--r--to.do/unicode/ccl.c149
-rw-r--r--to.do/unicode/changes.txt102
-rw-r--r--to.do/unicode/ecs.c225
-rw-r--r--to.do/unicode/flex.14099
-rw-r--r--to.do/unicode/flex.skl1542
-rw-r--r--to.do/unicode/flexdef.h1062
-rw-r--r--to.do/unicode/gen.c1650
-rw-r--r--to.do/unicode/main.c1228
-rw-r--r--to.do/unicode/misc.c894
-rw-r--r--to.do/unicode/scan.l710
-rw-r--r--to.do/unicode/tblcmp.c887
-rw-r--r--tools/Makefile.am2
-rwxr-xr-xtools/git2cl372
209 files changed, 53506 insertions, 4451 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..f5461a3
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,23 @@
+*.orig
+*.rej
+*.tar.bz2
+*.tar.gz
+*.tar.xz
+*~
+.deps
+.libs
+ABOUT-NLS
+ChangeLog
+INSTALL
+Makefile
+Makefile.in
+aclocal.m4
+autom4te.cache
+config.log
+config.status
+configure
+flex-*/
+libtool
+stamp-*
+m4/
+build-aux/
diff --git a/BUGS b/BUGS
new file mode 100644
index 0000000..f456b69
--- /dev/null
+++ b/BUGS
@@ -0,0 +1,107 @@
+This is a list of bugs still in the queue at lex.sf.net at the time we closed
+out the project and moved it to flex.sf.net.
+
+-------------------------------------------------------------
+
+Some strict compilers warn about a few internal flex variables signedness. They
+are bogus warnings and can be ignored, but people send in reports nonethless.
+
+-------------------------------------------------------------
+
+The initializer of the yy_transition array in the
+generated scanner
+contains fewer entries than the declared size of the array.
+
+Examples include yy_transition[6504] with 6250 entries,
+yy_transition[13215] with 12961 entries. This looks
+like it
+is always 254 fewer entries than the declared size.
+
+This bug is present in flex 2.5.4a as well. It appears to be harmless.
+
+-------------------------------------------------------------
+The examples in the chapter "Generating C++ Scanners"
+contain suspicious code. Attached is a patch that
+corrects this, and after these
+modifications this example compiles and works.
+
+-------------------------------------------------------------
+
+C++ scanners derived from the yyFlexLexer base class
+will not compile with flex-2.5.31 because the
+&lt;FlexLexer.h&gt; automatically gets included into the
+scanner twice. Because yyFlexLexer is now defined by
+default even if no prefix is specified, including
+FlexLexer.h twice causes the class yyFlexLexer to be
+declared twice. In flex-2.5.4 because yyFlexLexer was
+not defined by flex in the scanner code, including
+FlexLexer.h more than once only declared yyFlexLexer
+once. I appreciate that this is because of the M4
+additions to flex, but I can not find a way to stop
+flex defining yyFlexLexer if it is not needed.
+
+Here is an example of a class that will not compile:
+
+derived_lexer.h:
+
+#ifndef __derived_lexer__
+#define __derived_lexer__
+
+#include &lt;FlexLexer.h&gt;
+
+class derived_lexer : public yyFlexLexer
+{
+public:
+derived_lexer(std::istream* arg_yyin = 0) :
+yyFlexLexer(arg_yyin){}
+int yylex();
+int x;
+};
+#endif
+
+derived_lexer.l:
+
+%{
+#include &quot;derived_lexer.h&quot;
+%}
+
+%option yyclass=&quot;derived_lexer&quot;
+
+%%
+[0-9]+ {
+x = atoi(yytext);
+}
+%%
+
+main.cpp:
+
+#include &quot;derived_lexer.h&quot;
+#include &lt;fstream&gt;
+
+int main()
+{
+std::ifstream input;
+input.open(&quot;input&quot;);
+derived_lexer lexer(&amp;input);
+lexer.yylex();
+}
+
+-------------------------------------------------------------
+
+Hi, the anomally is that if I generate a c++ parser it will not make
+yy_scan_buffer and friends.
+this is happenning on flex version 2.5.4.
+Is this the intent, if so how do I make a c++ parser read from my buffer?
+
+P.S. in c++ it will only generate:
+#ifndef YY_NO_SCAN_BUFFER
+#endif
+
+
+#ifndef YY_NO_SCAN_STRING
+#endif
+
+
+#ifndef YY_NO_SCAN_BYTES
+#endif
+-------------------------------------------------------------
diff --git a/Makefile.am b/Makefile.am
index fc51921..076ccad 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -33,128 +33,28 @@
# For MS-DOS, add "-DMS_DOS" to DEFS. See the directory MISC/MSDOS for
# additional info.
-AM_YFLAGS = -d
ACLOCAL_AMFLAGS = -I m4
-m4 = @M4@
indent = @INDENT@
-bin_PROGRAMS = flex
-lib_LTLIBRARIES = \
- libfl.la \
- libfl_pic.la
-
-flex_SOURCES = \
- ccl.c \
- dfa.c \
- ecs.c \
- scanflags.c \
- gen.c \
- main.c \
- misc.c \
- nfa.c \
- parse.y \
- scan.l \
- skel.c \
- sym.c \
- tblcmp.c \
- yylex.c \
- options.c \
- scanopt.c \
- buf.c \
- tables.c \
- tables_shared.c \
- filter.c \
- regex.c
-
-
-LDADD = lib/libcompat.la
-
-libfl_la_SOURCES = \
- libmain.c \
- libyywrap.c
-
-libfl_la_LDFLAGS = -no-undefined -version-info @SHARED_VERSION_INFO@
-
-libfl_pic_la_SOURCES = \
- libmain.c \
- libyywrap.c
-
-libfl_pic_la_LDFLAGS = -no-undefined -version-info @SHARED_VERSION_INFO@
-
-noinst_HEADERS = \
- flexdef.h \
- flexint.h \
- version.h \
- options.h \
- scanopt.h \
- tables.h \
- tables_shared.h
-
-include_HEADERS = \
- FlexLexer.h
-
dist_doc_DATA = \
AUTHORS \
COPYING \
NEWS \
ONEWS \
- README \
- TODO
+ README
EXTRA_DIST = \
.indent.pro \
- ABOUT-NLS \
- INSTALL \
- autogen.sh \
- flex.skl \
- mkskel.sh \
- config.rpath \
- gettext.h
-
-BUILT_SOURCES = \
- skel.c
+ autogen.sh
SUBDIRS = \
lib \
- . \
+ src \
doc \
examples \
po \
- tests
-
-localedir = $(datadir)/locale
-AM_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" -I$(top_srcdir)/intl
-LIBS = @LIBINTL@ @LIBS@
-
-skel.c: flex.skl mkskel.sh flexint.h tables_shared.h
- sed 's/m4_/m4postproc_/g; s/m4preproc_/m4_/g' $(srcdir)/flex.skl | $(m4) -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 's/m4postproc_/m4_/g' | $(SHELL) $(srcdir)/mkskel.sh >skel.c
-
-# Explicitly describe dependencies.
-# You can recreate this with `gcc -I. -MM *.c'
-buf.o: buf.c flexdef.h flexint.h
-ccl.o: ccl.c flexdef.h flexint.h
-dfa.o: dfa.c flexdef.h flexint.h tables.h tables_shared.h
-ecs.o: ecs.c flexdef.h flexint.h
-scanflags.o: scanflags.c flexdef.h flexint.h
-gen.o: gen.c flexdef.h flexint.h tables.h tables_shared.h
-libmain.o: libmain.c
-libyywrap.o: libyywrap.c
-main.o: main.c flexdef.h flexint.h version.h options.h scanopt.h \
- tables.h tables_shared.h
-misc.o: misc.c flexdef.h flexint.h tables.h tables_shared.h
-nfa.o: nfa.c flexdef.h flexint.h
-options.o: options.c options.h scanopt.h flexdef.h flexint.h
-parse.o: parse.c flexdef.h flexint.h tables.h tables_shared.h
-scan.o: scan.c flexdef.h flexint.h parse.h
-scanopt.o: scanopt.c flexdef.h flexint.h scanopt.h
-skel.o: skel.c flexdef.h flexint.h
-sym.o: sym.c flexdef.h flexint.h
-tables.o: tables.c flexdef.h flexint.h tables.h tables_shared.h
-tables_shared.o: tables_shared.c flexdef.h flexint.h tables.h \
- tables_shared.h
-tblcmp.o: tblcmp.c flexdef.h flexint.h
-yylex.o: yylex.c flexdef.h flexint.h parse.h
-filter.o: filter.c flexdef.h flexint.h
+ tests \
+ tools
# Create the ChangeLog, but only if we're inside a git working directory
@@ -163,50 +63,6 @@ ChangeLog: $(srcdir)/tools/git2cl
$(srcdir)/tools/git2cl > $@ \
; fi
-# Run GNU indent on sources. Don't run this unless all the sources compile cleanly.
-#
-# Whole idea:
-# 1. Check for .indent.pro, otherwise indent will use unknown
-# settings, or worse, the GNU defaults.)
-# 2. Check that this is GNU indent.
-# 3. Make sure to process only the NON-generated .c and .h files.
-# 4. Run indent twice per file. The first time is a test.
-# Otherwise, indent overwrites your file even if it fails!
-indentfiles = \
- buf.c \
- ccl.c \
- dfa.c \
- ecs.c \
- scanflags.c \
- filter.c \
- flexdef.h \
- gen.c \
- libmain.c \
- libyywrap.c \
- main.c \
- misc.c \
- nfa.c \
- options.c \
- options.h \
- regex.c \
- scanopt.c \
- scanopt.h \
- sym.c \
- tables.c \
- tables.h \
- tables_shared.c \
- tables_shared.h \
- tblcmp.c
-
-indent:
- if [ -f .indent.pro ] ; then \
- for f in $(indentfiles);\
- do\
- echo indenting $$f ;\
- $(indent) < $$f >/dev/null && indent $$f || echo $$f FAILED to indent ;\
- done \
- fi
-
install-exec-hook:
cd $(DESTDIR)$(bindir) && \
$(LN_S) -f flex$(EXEEXT) flex++$(EXEEXT)
diff --git a/NEWS b/NEWS
index aa30e43..cfb0c7a 100644
--- a/NEWS
+++ b/NEWS
@@ -3,7 +3,43 @@ changes between releases of flex.
See the file COPYING for copying conditions.
-* flex version 2.5.39
+* version 2.6.0 released 2015-11-17
+
+** User Visible Changes
+
+*** C++ scanners now use references instead of pointers. See the manual for details.
+
+*** A number of compiler warnings were addressed, so flex generated scanners should be quieter under compiler warning scenarios.
+
+*** Allow error reporting routines to accept varying number of arguments
+
+*** Removed deprecated 'register' storage class specifier
+
+*** Changeed output formats from octal to hexadecimal
+
+*** check limits before using array index cclp; resolves sf-166
+
+*** Suppress clang warning about empty @param paragraph; resolves sf#158
+
+*** Fixed malloc/realloc replacement, resolves sf bug#151.
+
+*** Adjusted buffer sizes on ia64.
+
+*** various documentation and code clean up fixes: resolves sf bugs #167, #168, among other patches.
+
+** Flex Internals
+
+*** flex is now organized into subdirectories. This keeps the tree neater at the top level and puts like things near each other and unlike things away from each other.
+
+*** The test suite has been reorganized and is now run with the parallel test suite harness from automake.
+
+*** Cleaned up the automake parts of the build system to better reflect what automake does on its own. Also added a call to libtoolize in autogen.sh because autoreconf gets confused without a prior run of libtoolize.
+
+*** po/Makefile now includes a rule to fetch the latest translations from the translation project. "make -f po/Makefile getpo" from the top level of the flex tree will fetch the files.
+
+*** New da translation from the translation project
+
+* flex version 2.5.39 released 2014-03-26
** no user visible changes in this release
@@ -475,7 +511,7 @@ options, see accompanying documentation
*** Updated the manual with the new reentrant API
-*** Two new options %option reentrant (-R) and
+*** Two new options %option reentrant (-R) and
%option reentrant-bison (-Rb)
*** All globals optionally placed into struct yyglobals_t
@@ -505,7 +541,7 @@ But the inverse is still true
** Developer test suite added
-*** TESTS/ directory has been added. Users can
+*** TESTS/ directory has been added. Users can
'make test' in the TESTS directory to execute the test suite
** Support for bison variables yylval and yylloc added
diff --git a/autogen.sh b/autogen.sh
index a298f07..627f92e 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -29,4 +29,5 @@
#Makefile first.)
touch ChangeLog
-autoreconf --install --verbose --force
+libtoolize --install --force
+autoreconf --install --force
diff --git a/configure.ac b/configure.ac
index 871082f..4c519dc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -24,27 +24,28 @@
# autoconf requirements and initialization
-AC_INIT([the fast lexical analyser generator], [2.5.39],
+AC_INIT([the fast lexical analyser generator], [2.6.0],
[flex-help@lists.sourceforge.net], [flex])
+AC_CONFIG_SRCDIR([src/scan.l])
+AC_CONFIG_AUX_DIR([build-aux])
+LT_INIT
+AM_INIT_AUTOMAKE([gnu check-news std-options dist-bzip2 dist-xz parallel-tests 1.14.1])
+AC_CONFIG_HEADER([src/config.h])
+AC_CONFIG_LIBOBJ_DIR([lib])
+AC_CONFIG_MACRO_DIR([m4])
SHARED_VERSION_INFO="2:0:0"
AC_SUBST(SHARED_VERSION_INFO)
-AC_CONFIG_SRCDIR([scan.l])
-AM_INIT_AUTOMAKE([gnu check-news std-options dist-bzip2 dist-xz 1.10])
-AC_CONFIG_HEADER([config.h:conf.in])
-AC_CONFIG_LIBOBJ_DIR([lib])
-
# checks for programs
AM_GNU_GETTEXT([external])
-AM_GNU_GETTEXT_VERSION([0.18.1])
+AM_GNU_GETTEXT_VERSION([0.19])
AC_PROG_YACC
AM_PROG_LEX
AC_PROG_CC
AC_PROG_CXX
AM_PROG_CC_C_O
AC_PROG_LN_S
-LT_INIT
AC_PROG_AWK
AC_PROG_INSTALL
@@ -93,6 +94,7 @@ AC_DEFINE([HAVE_LIBPTHREAD], 1, [pthread library] ),
AC_DEFINE([HAVE_LIBPTHREAD], 0, [pthread library] )
)
AC_CHECK_HEADERS([pthread.h])
+AM_CONDITIONAL([want_pthread], [test x$ac_cv_lib_pthread_pthread_mutex_lock = xyes])
AC_CHECK_LIB(m, log10)
@@ -118,56 +120,9 @@ examples/fastwc/Makefile
examples/manual/Makefile
lib/Makefile
po/Makefile.in
+src/Makefile
+tools/Makefile
tests/Makefile
-tests/TEMPLATE/Makefile
-tests/test-array-nr/Makefile
-tests/test-array-r/Makefile
-tests/test-basic-nr/Makefile
-tests/test-basic-r/Makefile
-tests/test-bison-yylloc/Makefile
-tests/test-bison-yylval/Makefile
-tests/test-c-cpp-nr/Makefile
-tests/test-c-cpp-r/Makefile
-tests/test-header-nr/Makefile
-tests/test-header-r/Makefile
-tests/test-include-by-buffer/Makefile
-tests/test-include-by-push/Makefile
-tests/test-include-by-reentrant/Makefile
-tests/test-multiple-scanners-nr/Makefile
-tests/test-multiple-scanners-r/Makefile
-tests/test-noansi-nr/Makefile
-tests/test-noansi-r/Makefile
-tests/test-prefix-nr/Makefile
-tests/test-prefix-r/Makefile
-tests/test-pthread/Makefile
-tests/test-string-nr/Makefile
-tests/test-string-r/Makefile
-tests/test-yyextra/Makefile
-tests/test-alloc-extra/Makefile
-tests/test-lineno-nr/Makefile
-tests/test-lineno-trailing/Makefile
-tests/test-lineno-r/Makefile
-tests/test-linedir-r/Makefile
-tests/test-debug-r/Makefile
-tests/test-debug-nr/Makefile
-tests/test-mem-nr/Makefile
-tests/test-mem-r/Makefile
-tests/test-posix/Makefile
-tests/test-posixly-correct/Makefile
-tests/test-table-opts/Makefile
-tests/test-c++-basic/Makefile
-tests/test-bison-nr/Makefile
-tests/test-reject/Makefile
-tests/test-c++-multiple-scanners/Makefile
-tests/test-top/Makefile
-tests/test-rescan-nr/Makefile
-tests/test-rescan-r/Makefile
-tests/test-quotes/Makefile
-tests/test-ccl/Makefile
-tests/test-extended/Makefile
-tests/test-c++-yywrap/Makefile
-tests/test-concatenated-options/Makefile
-dnl --new-test-here-- This line is processed by tests/create-test.
)
AC_OUTPUT
diff --git a/control.ac b/control.ac
new file mode 100644
index 0000000..30596cf
--- /dev/null
+++ b/control.ac
@@ -0,0 +1 @@
+XBS-Destinations: sourceforge
diff --git a/doc/.gitignore b/doc/.gitignore
new file mode 100644
index 0000000..83b0108
--- /dev/null
+++ b/doc/.gitignore
@@ -0,0 +1,27 @@
+flex.aux
+flex.cp
+flex.cps
+flex.dvi
+flex.fn
+flex.fns
+flex.hk
+flex.hks
+flex.info*
+flex.ky
+flex.log
+flex.op
+flex.ops
+flex.pg
+flex.toc
+flex.tp
+flex.tps
+flex.vr
+flex.vrs
+Makefile
+Makefile.in
+flex.1
+flex.pdf
+flex.ps
+version.texi
+flex.html
+flex.t2p
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 0e23dca..e776c18 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -23,9 +23,9 @@ CLEANFILES = \
flex.vr \
flex.vrs
-$(dist_man_MANS): $(top_srcdir)/main.c
+$(dist_man_MANS): $(top_srcdir)/configure.ac $(top_srcdir)/src/flex.skl $(top_srcdir)/src/options.c $(top_srcdir)/src/options.h
for i in $(dist_man_MANS) ; do \
$(help2man) --name='$(PACKAGE_NAME)' \
--section=`echo $$i | sed -e 's/.*\.\([^.]*\)$$/\1/'` \
- ../flex$(EXEEXT) > $$i || rm -f $$i ; \
+ $(top_srcdir)/src/flex$(EXEEXT) > $$i || rm -f $$i ; \
done
diff --git a/doc/flex.texi b/doc/flex.texi
index 07ce3ac..6bca1c8 100644
--- a/doc/flex.texi
+++ b/doc/flex.texi
@@ -80,204 +80,204 @@ This edition of @cite{The flex Manual} documents @code{flex} version
This manual was written by @value{authors}.
@menu
-* Copyright::
-* Reporting Bugs::
-* Introduction::
-* Simple Examples::
-* Format::
-* Patterns::
-* Matching::
-* Actions::
-* Generated Scanner::
-* Start Conditions::
-* Multiple Input Buffers::
-* EOF::
-* Misc Macros::
-* User Values::
-* Yacc::
-* Scanner Options::
-* Performance::
-* Cxx::
-* Reentrant::
-* Lex and Posix::
-* Memory Management::
-* Serialized Tables::
-* Diagnostics::
-* Limitations::
-* Bibliography::
-* FAQ::
-* Appendices::
-* Indices::
+* Copyright::
+* Reporting Bugs::
+* Introduction::
+* Simple Examples::
+* Format::
+* Patterns::
+* Matching::
+* Actions::
+* Generated Scanner::
+* Start Conditions::
+* Multiple Input Buffers::
+* EOF::
+* Misc Macros::
+* User Values::
+* Yacc::
+* Scanner Options::
+* Performance::
+* Cxx::
+* Reentrant::
+* Lex and Posix::
+* Memory Management::
+* Serialized Tables::
+* Diagnostics::
+* Limitations::
+* Bibliography::
+* FAQ::
+* Appendices::
+* Indices::
@detailmenu
--- The Detailed Node Listing ---
Format of the Input File
-* Definitions Section::
-* Rules Section::
-* User Code Section::
-* Comments in the Input::
+* Definitions Section::
+* Rules Section::
+* User Code Section::
+* Comments in the Input::
Scanner Options
-* Options for Specifying Filenames::
-* Options Affecting Scanner Behavior::
-* Code-Level And API Options::
-* Options for Scanner Speed and Size::
-* Debugging Options::
-* Miscellaneous Options::
+* Options for Specifying Filenames::
+* Options Affecting Scanner Behavior::
+* Code-Level And API Options::
+* Options for Scanner Speed and Size::
+* Debugging Options::
+* Miscellaneous Options::
Reentrant C Scanners
-* Reentrant Uses::
-* Reentrant Overview::
-* Reentrant Example::
-* Reentrant Detail::
-* Reentrant Functions::
+* Reentrant Uses::
+* Reentrant Overview::
+* Reentrant Example::
+* Reentrant Detail::
+* Reentrant Functions::
The Reentrant API in Detail
-* Specify Reentrant::
-* Extra Reentrant Argument::
-* Global Replacement::
-* Init and Destroy Functions::
-* Accessor Methods::
-* Extra Data::
-* About yyscan_t::
+* Specify Reentrant::
+* Extra Reentrant Argument::
+* Global Replacement::
+* Init and Destroy Functions::
+* Accessor Methods::
+* Extra Data::
+* About yyscan_t::
Memory Management
-* The Default Memory Management::
-* Overriding The Default Memory Management::
-* A Note About yytext And Memory::
+* The Default Memory Management::
+* Overriding The Default Memory Management::
+* A Note About yytext And Memory::
Serialized Tables
-* Creating Serialized Tables::
-* Loading and Unloading Serialized Tables::
-* Tables File Format::
+* Creating Serialized Tables::
+* Loading and Unloading Serialized Tables::
+* Tables File Format::
FAQ
-* When was flex born?::
-* How do I expand backslash-escape sequences in C-style quoted strings?::
-* Why do flex scanners call fileno if it is not ANSI compatible?::
-* Does flex support recursive pattern definitions?::
-* How do I skip huge chunks of input (tens of megabytes) while using flex?::
-* Flex is not matching my patterns in the same order that I defined them.::
-* My actions are executing out of order or sometimes not at all.::
-* How can I have multiple input sources feed into the same scanner at the same time?::
-* Can I build nested parsers that work with the same input file?::
-* How can I match text only at the end of a file?::
-* How can I make REJECT cascade across start condition boundaries?::
-* Why cant I use fast or full tables with interactive mode?::
-* How much faster is -F or -f than -C?::
-* If I have a simple grammar cant I just parse it with flex?::
-* Why doesn't yyrestart() set the start state back to INITIAL?::
-* How can I match C-style comments?::
-* The period isn't working the way I expected.::
-* Can I get the flex manual in another format?::
-* Does there exist a "faster" NDFA->DFA algorithm?::
-* How does flex compile the DFA so quickly?::
-* How can I use more than 8192 rules?::
-* How do I abandon a file in the middle of a scan and switch to a new file?::
-* How do I execute code only during initialization (only before the first scan)?::
-* How do I execute code at termination?::
-* Where else can I find help?::
-* Can I include comments in the "rules" section of the file?::
-* I get an error about undefined yywrap().::
-* How can I change the matching pattern at run time?::
-* How can I expand macros in the input?::
-* How can I build a two-pass scanner?::
-* How do I match any string not matched in the preceding rules?::
-* I am trying to port code from AT&T lex that uses yysptr and yysbuf.::
-* Is there a way to make flex treat NULL like a regular character?::
-* Whenever flex can not match the input it says "flex scanner jammed".::
-* Why doesn't flex have non-greedy operators like perl does?::
-* Memory leak - 16386 bytes allocated by malloc.::
-* How do I track the byte offset for lseek()?::
-* How do I use my own I/O classes in a C++ scanner?::
-* How do I skip as many chars as possible?::
-* deleteme00::
-* Are certain equivalent patterns faster than others?::
-* Is backing up a big deal?::
-* Can I fake multi-byte character support?::
-* deleteme01::
-* Can you discuss some flex internals?::
-* unput() messes up yy_at_bol::
-* The | operator is not doing what I want::
-* Why can't flex understand this variable trailing context pattern?::
-* The ^ operator isn't working::
-* Trailing context is getting confused with trailing optional patterns::
-* Is flex GNU or not?::
-* ERASEME53::
-* I need to scan if-then-else blocks and while loops::
-* ERASEME55::
-* ERASEME56::
-* ERASEME57::
-* Is there a repository for flex scanners?::
-* How can I conditionally compile or preprocess my flex input file?::
-* Where can I find grammars for lex and yacc?::
-* I get an end-of-buffer message for each character scanned.::
-* unnamed-faq-62::
-* unnamed-faq-63::
-* unnamed-faq-64::
-* unnamed-faq-65::
-* unnamed-faq-66::
-* unnamed-faq-67::
-* unnamed-faq-68::
-* unnamed-faq-69::
-* unnamed-faq-70::
-* unnamed-faq-71::
-* unnamed-faq-72::
-* unnamed-faq-73::
-* unnamed-faq-74::
-* unnamed-faq-75::
-* unnamed-faq-76::
-* unnamed-faq-77::
-* unnamed-faq-78::
-* unnamed-faq-79::
-* unnamed-faq-80::
-* unnamed-faq-81::
-* unnamed-faq-82::
-* unnamed-faq-83::
-* unnamed-faq-84::
-* unnamed-faq-85::
-* unnamed-faq-86::
-* unnamed-faq-87::
-* unnamed-faq-88::
-* unnamed-faq-90::
-* unnamed-faq-91::
-* unnamed-faq-92::
-* unnamed-faq-93::
-* unnamed-faq-94::
-* unnamed-faq-95::
-* unnamed-faq-96::
-* unnamed-faq-97::
-* unnamed-faq-98::
-* unnamed-faq-99::
-* unnamed-faq-100::
-* unnamed-faq-101::
+* When was flex born?::
+* How do I expand backslash-escape sequences in C-style quoted strings?::
+* Why do flex scanners call fileno if it is not ANSI compatible?::
+* Does flex support recursive pattern definitions?::
+* How do I skip huge chunks of input (tens of megabytes) while using flex?::
+* Flex is not matching my patterns in the same order that I defined them.::
+* My actions are executing out of order or sometimes not at all.::
+* How can I have multiple input sources feed into the same scanner at the same time?::
+* Can I build nested parsers that work with the same input file?::
+* How can I match text only at the end of a file?::
+* How can I make REJECT cascade across start condition boundaries?::
+* Why cant I use fast or full tables with interactive mode?::
+* How much faster is -F or -f than -C?::
+* If I have a simple grammar cant I just parse it with flex?::
+* Why doesn't yyrestart() set the start state back to INITIAL?::
+* How can I match C-style comments?::
+* The period isn't working the way I expected.::
+* Can I get the flex manual in another format?::
+* Does there exist a "faster" NDFA->DFA algorithm?::
+* How does flex compile the DFA so quickly?::
+* How can I use more than 8192 rules?::
+* How do I abandon a file in the middle of a scan and switch to a new file?::
+* How do I execute code only during initialization (only before the first scan)?::
+* How do I execute code at termination?::
+* Where else can I find help?::
+* Can I include comments in the "rules" section of the file?::
+* I get an error about undefined yywrap().::
+* How can I change the matching pattern at run time?::
+* How can I expand macros in the input?::
+* How can I build a two-pass scanner?::
+* How do I match any string not matched in the preceding rules?::
+* I am trying to port code from AT&T lex that uses yysptr and yysbuf.::
+* Is there a way to make flex treat NULL like a regular character?::
+* Whenever flex can not match the input it says "flex scanner jammed".::
+* Why doesn't flex have non-greedy operators like perl does?::
+* Memory leak - 16386 bytes allocated by malloc.::
+* How do I track the byte offset for lseek()?::
+* How do I use my own I/O classes in a C++ scanner?::
+* How do I skip as many chars as possible?::
+* deleteme00::
+* Are certain equivalent patterns faster than others?::
+* Is backing up a big deal?::
+* Can I fake multi-byte character support?::
+* deleteme01::
+* Can you discuss some flex internals?::
+* unput() messes up yy_at_bol::
+* The | operator is not doing what I want::
+* Why can't flex understand this variable trailing context pattern?::
+* The ^ operator isn't working::
+* Trailing context is getting confused with trailing optional patterns::
+* Is flex GNU or not?::
+* ERASEME53::
+* I need to scan if-then-else blocks and while loops::
+* ERASEME55::
+* ERASEME56::
+* ERASEME57::
+* Is there a repository for flex scanners?::
+* How can I conditionally compile or preprocess my flex input file?::
+* Where can I find grammars for lex and yacc?::
+* I get an end-of-buffer message for each character scanned.::
+* unnamed-faq-62::
+* unnamed-faq-63::
+* unnamed-faq-64::
+* unnamed-faq-65::
+* unnamed-faq-66::
+* unnamed-faq-67::
+* unnamed-faq-68::
+* unnamed-faq-69::
+* unnamed-faq-70::
+* unnamed-faq-71::
+* unnamed-faq-72::
+* unnamed-faq-73::
+* unnamed-faq-74::
+* unnamed-faq-75::
+* unnamed-faq-76::
+* unnamed-faq-77::
+* unnamed-faq-78::
+* unnamed-faq-79::
+* unnamed-faq-80::
+* unnamed-faq-81::
+* unnamed-faq-82::
+* unnamed-faq-83::
+* unnamed-faq-84::
+* unnamed-faq-85::
+* unnamed-faq-86::
+* unnamed-faq-87::
+* unnamed-faq-88::
+* unnamed-faq-90::
+* unnamed-faq-91::
+* unnamed-faq-92::
+* unnamed-faq-93::
+* unnamed-faq-94::
+* unnamed-faq-95::
+* unnamed-faq-96::
+* unnamed-faq-97::
+* unnamed-faq-98::
+* unnamed-faq-99::
+* unnamed-faq-100::
+* unnamed-faq-101::
* What is the difference between YYLEX_PARAM and YY_DECL?::
* Why do I get "conflicting types for yylex" error?::
* How do I access the values set in a Flex action from within a Bison action?::
Appendices
-* Makefiles and Flex::
-* Bison Bridge::
-* M4 Dependency::
-* Common Patterns::
+* Makefiles and Flex::
+* Bison Bridge::
+* M4 Dependency::
+* Common Patterns::
Indices
-* Concept Index::
-* Index of Functions and Macros::
-* Index of Variables::
-* Index of Data Types::
-* Index of Hooks::
-* Index of Scanner Options::
+* Concept Index::
+* Index of Functions and Macros::
+* Index of Variables::
+* Index of Data Types::
+* Index of Hooks::
+* Index of Scanner Options::
@end detailmenu
@end menu
@@ -461,10 +461,10 @@ line containing only @samp{%%}.
@end example
@menu
-* Definitions Section::
-* Rules Section::
-* User Code Section::
-* Comments in the Input::
+* Definitions Section::
+* Rules Section::
+* User Code Section::
+* Comments in the Input::
@end menu
@node Definitions Section, Rules Section, Format, Format
@@ -542,7 +542,7 @@ themselves.
A @code{%top} block is similar to a @samp{%@{} ... @samp{%@}} block, except
that the code in a @code{%top} block is relocated to the @emph{top} of the
generated file, before any flex definitions @footnote{Actually,
-@code{yyIN_HEADER} is defined before the @samp{%top} block.}.
+@code{yyIN_HEADER} is defined before the @samp{%top} block.}.
The @code{%top} block is useful when you want certain preprocessor macros to be
defined or certain files to be included before the generated code.
The single characters, @samp{@{} and @samp{@}} are used to delimit the
@@ -759,7 +759,7 @@ Options may be zero or more of the characters @samp{i}, @samp{s}, or @samp{x}.
@samp{-s} alters the meaning of @samp{.} to match any byte except @samp{\n}.
@samp{x} ignores comments and whitespace in patterns. Whitespace is ignored unless
-it is backslash-escaped, contained within @samp{""}s, or appears inside a
+it is backslash-escaped, contained within @samp{""}s, or appears inside a
character class.
The following are all valid:
@@ -895,7 +895,7 @@ And to match a sequence of zero or more repetitions of @samp{foo} and
@cindex character classes in patterns
In addition to characters and ranges of characters, character classes
can also contain @dfn{character class expressions}. These are
-expressions enclosed inside @samp{[}: and @samp{:]} delimiters (which
+expressions enclosed inside @samp{[:} and @samp{:]} delimiters (which
themselves must appear between the @samp{[} and @samp{]} of the
character class. Other elements may occur inside the character class,
too). The valid expressions are:
@@ -930,7 +930,7 @@ For example, the following character classes are all equivalent:
@end verbatim
@end example
-A word of caution. Character classes are expanded immediately when seen in the @code{flex} input.
+A word of caution. Character classes are expanded immediately when seen in the @code{flex} input.
This means the character classes are sensitive to the locale in which @code{flex}
is executed, and the resulting scanner will not be sensitive to the runtime locale.
This may or may not be desirable.
@@ -1404,7 +1404,7 @@ example, the following is one way to eat up C comments:
@verbatim
%%
"/*" {
- register int c;
+ int c;
for ( ; ; )
{
@@ -1499,7 +1499,7 @@ definitions prevent us from using any standard data types smaller than
int (such as short, char, or bool) as function arguments. For this
reason, future versions of @code{flex} may generate standard C99 code
only, leaving K&R-style functions to the historians. Currently, if you
-do @strong{not} want @samp{C99} definitions, then you must use
+do @strong{not} want @samp{C99} definitions, then you must use
@code{%option noansi-definitions}.
@cindex stdin, default for yyin
@@ -1601,7 +1601,6 @@ Any rule whose pattern is prefixed with @samp{<sc>} will only be active
when the scanner is in the @dfn{start condition} named @code{sc}. For
example,
-@c proofread edit stopped here
@example
@verbatim
<STRING>[^"]* { /* eat up the string body ... */
@@ -1934,9 +1933,9 @@ condition @dfn{scope}. A start condition scope is begun with:
@end verbatim
@end example
-where @code{SCs} is a list of one or more start conditions. Inside the
+where @code{<SCs>} is a list of one or more start conditions. Inside the
start condition scope, every rule automatically has the prefix
-@code{SCs>} applied to it, until a @samp{@}} which matches the initial
+@code{<SCs>} applied to it, until a @samp{@}} which matches the initial
@samp{@{}. So, for example,
@cindex extended scope of start conditions
@@ -2062,7 +2061,7 @@ This function pushes the new buffer state onto an internal stack. The pushed
state becomes the new current state. The stack is maintained by flex and will
grow as required. This function is intended to be used instead of
@code{yy_switch_to_buffer}, when you want to change states, but preserve the
-current state for later use.
+current state for later use.
@cindex popping an input buffer
@cindex stack, input buffer pop
@@ -2489,12 +2488,12 @@ The various @code{flex} options are categorized by function in the following
menu. If you want to lookup a particular option by name, @xref{Index of Scanner Options}.
@menu
-* Options for Specifying Filenames::
-* Options Affecting Scanner Behavior::
-* Code-Level And API Options::
-* Options for Scanner Speed and Size::
-* Debugging Options::
-* Miscellaneous Options::
+* Options for Specifying Filenames::
+* Options Affecting Scanner Behavior::
+* Code-Level And API Options::
+* Options for Scanner Speed and Size::
+* Debugging Options::
+* Miscellaneous Options::
@end menu
Even though there are many scanner options, a typical scanner might only
@@ -2624,7 +2623,7 @@ This option is for flex development. We document it here in case you stumble
upon it by accident or in case you suspect some inconsistency in the serialized
tables. Flex will serialize the scanner dfa tables but will also generate the
in-code tables as it normally does. At runtime, the scanner will verify that
-the serialized tables match the in-code tables, instead of loading them.
+the serialized tables match the in-code tables, instead of loading them.
@end table
@@ -2871,7 +2870,7 @@ is generated.
@opindex ---option-ansi-prototypes
@opindex ansi-prototypes
@item --ansi-prototypes, @code{%option ansi-prototypes}
-instructs flex to generate ANSI C99 prototypes for functions.
+instructs flex to generate ANSI C99 prototypes for functions.
This option is enabled by default.
If @code{noansi-prototypes} is specified, then
prototypes will have empty parameter lists.
@@ -2895,7 +2894,7 @@ is modified to take an additional parameter,
@opindex ---bison-locations
@opindex bison-locations
@item --bison-locations, @code{%option bison-locations}
-instruct flex that
+instruct flex that
@code{GNU bison} @code{%locations} are being used.
This means @code{yylex} will be passed
an additional parameter, @code{yylloc}. This option
@@ -3765,8 +3764,7 @@ defaults to generating the scanner to the file @file{lex.yy.cc} instead
of @file{lex.yy.c}. The generated scanner includes the header file
@file{FlexLexer.h}, which defines the interface to two C++ classes.
-The first class,
-@code{FlexLexer},
+The first class in @file{FlexLexer.h}, @code{FlexLexer},
provides an abstract base class defining the general scanner class
interface. It provides the following member functions:
@@ -3800,10 +3798,10 @@ returns the current setting of the debugging flag.
Also provided are member functions equivalent to
@code{yy_switch_to_buffer()}, @code{yy_create_buffer()} (though the
-first argument is an @code{istream*} object pointer and not a
+first argument is an @code{istream&} object reference and not a
@code{FILE*)}, @code{yy_flush_buffer()}, @code{yy_delete_buffer()}, and
-@code{yyrestart()} (again, the first argument is a @code{istream*}
-object pointer).
+@code{yyrestart()} (again, the first argument is a @code{istream&}
+object reference).
@tindex yyFlexLexer (C++ only)
@tindex FlexLexer (C++ only)
@@ -3814,9 +3812,12 @@ additional member functions:
@table @code
@findex yyFlexLexer constructor (C++ only)
@item yyFlexLexer( istream* arg_yyin = 0, ostream* arg_yyout = 0 )
+@item yyFlexLexer( istream& arg_yyin, ostream& arg_yyout )
constructs a @code{yyFlexLexer} object using the given streams for input
and output. If not specified, the streams default to @code{cin} and
-@code{cout}, respectively.
+@code{cout}, respectively. @code{yyFlexLexer} does not take ownership of
+its stream arguments. It's up to the user to ensure the streams pointed
+to remain alive at least as long as the @code{yyFlexLexer} instance.
@findex yylex (C++ version)
@item virtual int yylex()
@@ -3833,11 +3834,13 @@ instead of @code{yyFlexLexer}. In this case, rather than generating
@findex switch_streams (C++ only)
@item virtual void switch_streams(istream* new_in = 0, ostream* new_out = 0)
+@item virtual void switch_streams(istream& new_in, ostream& new_out)
reassigns @code{yyin} to @code{new_in} (if non-null) and @code{yyout} to
@code{new_out} (if non-null), deleting the previous input buffer if
@code{yyin} is reassigned.
@item int yylex( istream* new_in, ostream* new_out = 0 )
+@item int yylex( istream& new_in, ostream& new_out )
first switches the input streams via @code{switch_streams( new_in,
new_out )} and then returns the value of @code{yylex()}.
@end table
@@ -3894,7 +3897,7 @@ Here is an example of a simple C++ scanner:
int mylineno = 0;
%}
- %option noyywrap
+ %option noyywrap c++
string \"[^\n"]+\"
@@ -3939,6 +3942,9 @@ Here is an example of a simple C++ scanner:
%%
+ // This include is required if main() is an another source file.
+ //#include <FlexLexer.h>
+
int main( int /* argc */, char** /* argv */ )
{
FlexLexer* lexer = new yyFlexLexer;
@@ -3986,11 +3992,11 @@ multi-threaded applications. Any thread may create and execute a reentrant
@code{flex} scanner without the need for synchronization with other threads.
@menu
-* Reentrant Uses::
-* Reentrant Overview::
-* Reentrant Example::
-* Reentrant Detail::
-* Reentrant Functions::
+* Reentrant Uses::
+* Reentrant Overview::
+* Reentrant Example::
+* Reentrant Detail::
+* Reentrant Functions::
@end menu
@node Reentrant Uses, Reentrant Overview, Reentrant, Reentrant
@@ -4121,13 +4127,13 @@ Here are the things you need to do or know to use the reentrant C API of
@code{flex}.
@menu
-* Specify Reentrant::
-* Extra Reentrant Argument::
-* Global Replacement::
-* Init and Destroy Functions::
-* Accessor Methods::
-* Extra Data::
-* About yyscan_t::
+* Specify Reentrant::
+* Extra Reentrant Argument::
+* Global Replacement::
+* Init and Destroy Functions::
+* Accessor Methods::
+* Extra Data::
+* About yyscan_t::
@end menu
@node Specify Reentrant, Extra Reentrant Argument, Reentrant Detail, Reentrant Detail
@@ -4363,7 +4369,7 @@ be accessed from within the very first yyalloc, used to allocate
the scanner itself.
By default, @code{YY_EXTRA_TYPE} is defined as type @code{void *}. You
-may redefine this type using @code{%option extra-type="your_type"} in
+may redefine this type using @code{%option extra-type="your_type"} in
the scanner:
@cindex YY_EXTRA_TYPE, defining your own type
@@ -4778,9 +4784,9 @@ This chapter describes how flex handles dynamic memory, and how you can
override the default behavior.
@menu
-* The Default Memory Management::
-* Overriding The Default Memory Management::
-* A Note About yytext And Memory::
+* The Default Memory Management::
+* Overriding The Default Memory Management::
+* A Note About yytext And Memory::
@end menu
@node The Default Memory Management, Overriding The Default Memory Management, Memory Management, Memory Management
@@ -4794,7 +4800,7 @@ buffer. As of version 2.5.9 Flex will clean up all memory when you call @code{yy
Flex allocates dynamic memory for four purposes, listed below @footnote{The
quantities given here are approximate, and may vary due to host architecture,
-compiler configuration, or due to future enhancements to flex.}
+compiler configuration, or due to future enhancements to flex.}
@table @asis
@@ -4809,7 +4815,7 @@ buffer is the length of the longest token expected, in bytes, plus a little more
extra bytes for housekeeping. Currently, to override the size of the input buffer
you must @code{#define YY_BUF_SIZE} to whatever number of bytes you want. We don't plan
to change this in the near future, but we reserve the right to do so if we ever add a more robust memory management
-API.
+API.
@item 64kb for the REJECT state. This will only be allocated if you use REJECT.
The size is large enough to hold the same number of states as characters in the input buffer. If you override the size of the
@@ -4911,8 +4917,10 @@ custom allocator through @code{yyextra}.
%option reentrant
/* Initialize the allocator. */
+n%{
#define YY_EXTRA_TYPE struct allocator*
#define YY_USER_INIT yyextra = allocator_create();
+%}
%%
.|\n ;
@@ -4927,7 +4935,7 @@ void * yyrealloc (void * ptr, size_t bytes, void* yyscanner) {
return allocator_realloc (yyextra, bytes);
}
-void yyfree (void * ptr, void * yyscanner) {
+void yyfree (void * ptr, void * yyscanner) {
/* Do nothing -- we leave it to the garbage collector. */
}
@@ -4975,9 +4983,9 @@ The serialization feature allows the tables to be loaded at runtime, before
scanning begins. The tables may be discarded when scanning is finished.
@menu
-* Creating Serialized Tables::
-* Loading and Unloading Serialized Tables::
-* Tables File Format::
+* Creating Serialized Tables::
+* Loading and Unloading Serialized Tables::
+* Tables File Format::
@end menu
@node Creating Serialized Tables, Loading and Unloading Serialized Tables, Serialized Tables, Serialized Tables
@@ -4998,7 +5006,7 @@ or
These options instruct flex to save the DFA tables to the file @var{FILE}. The tables
will @emph{not} be embedded in the generated scanner. The scanner will not
function on its own. The scanner will be dependent upon the serialized tables. You must
-load the tables from this file at runtime before you can scan anything.
+load the tables from this file at runtime before you can scan anything.
If you do not specify a filename to @code{--tables-file}, the tables will be
saved to @file{lex.yy.tables}, where @samp{yy} is the appropriate prefix.
@@ -5115,7 +5123,7 @@ and tables sections are padded to 64-bit boundaries. Below we describe each
field in detail. This format does not specify how the scanner will expand the
given data, i.e., data may be serialized as int8, but expanded to an int32
array at runtime. This is to reduce the size of the serialized data where
-possible. Remember, @emph{all integer values are in network byte order}.
+possible. Remember, @emph{all integer values are in network byte order}.
@noindent
Fields of a table header:
@@ -5407,105 +5415,105 @@ questions. Rather than repeat answers to well-understood problems, we
publish them here.
@menu
-* When was flex born?::
-* How do I expand backslash-escape sequences in C-style quoted strings?::
-* Why do flex scanners call fileno if it is not ANSI compatible?::
-* Does flex support recursive pattern definitions?::
-* How do I skip huge chunks of input (tens of megabytes) while using flex?::
-* Flex is not matching my patterns in the same order that I defined them.::
-* My actions are executing out of order or sometimes not at all.::
-* How can I have multiple input sources feed into the same scanner at the same time?::
-* Can I build nested parsers that work with the same input file?::
-* How can I match text only at the end of a file?::
-* How can I make REJECT cascade across start condition boundaries?::
-* Why cant I use fast or full tables with interactive mode?::
-* How much faster is -F or -f than -C?::
-* If I have a simple grammar cant I just parse it with flex?::
-* Why doesn't yyrestart() set the start state back to INITIAL?::
-* How can I match C-style comments?::
-* The period isn't working the way I expected.::
-* Can I get the flex manual in another format?::
-* Does there exist a "faster" NDFA->DFA algorithm?::
-* How does flex compile the DFA so quickly?::
-* How can I use more than 8192 rules?::
-* How do I abandon a file in the middle of a scan and switch to a new file?::
-* How do I execute code only during initialization (only before the first scan)?::
-* How do I execute code at termination?::
-* Where else can I find help?::
-* Can I include comments in the "rules" section of the file?::
-* I get an error about undefined yywrap().::
-* How can I change the matching pattern at run time?::
-* How can I expand macros in the input?::
-* How can I build a two-pass scanner?::
-* How do I match any string not matched in the preceding rules?::
-* I am trying to port code from AT&T lex that uses yysptr and yysbuf.::
-* Is there a way to make flex treat NULL like a regular character?::
-* Whenever flex can not match the input it says "flex scanner jammed".::
-* Why doesn't flex have non-greedy operators like perl does?::
-* Memory leak - 16386 bytes allocated by malloc.::
-* How do I track the byte offset for lseek()?::
-* How do I use my own I/O classes in a C++ scanner?::
-* How do I skip as many chars as possible?::
-* deleteme00::
-* Are certain equivalent patterns faster than others?::
-* Is backing up a big deal?::
-* Can I fake multi-byte character support?::
-* deleteme01::
-* Can you discuss some flex internals?::
-* unput() messes up yy_at_bol::
-* The | operator is not doing what I want::
-* Why can't flex understand this variable trailing context pattern?::
-* The ^ operator isn't working::
-* Trailing context is getting confused with trailing optional patterns::
-* Is flex GNU or not?::
-* ERASEME53::
-* I need to scan if-then-else blocks and while loops::
-* ERASEME55::
-* ERASEME56::
-* ERASEME57::
-* Is there a repository for flex scanners?::
-* How can I conditionally compile or preprocess my flex input file?::
-* Where can I find grammars for lex and yacc?::
-* I get an end-of-buffer message for each character scanned.::
-* unnamed-faq-62::
-* unnamed-faq-63::
-* unnamed-faq-64::
-* unnamed-faq-65::
-* unnamed-faq-66::
-* unnamed-faq-67::
-* unnamed-faq-68::
-* unnamed-faq-69::
-* unnamed-faq-70::
-* unnamed-faq-71::
-* unnamed-faq-72::
-* unnamed-faq-73::
-* unnamed-faq-74::
-* unnamed-faq-75::
-* unnamed-faq-76::
-* unnamed-faq-77::
-* unnamed-faq-78::
-* unnamed-faq-79::
-* unnamed-faq-80::
-* unnamed-faq-81::
-* unnamed-faq-82::
-* unnamed-faq-83::
-* unnamed-faq-84::
-* unnamed-faq-85::
-* unnamed-faq-86::
-* unnamed-faq-87::
-* unnamed-faq-88::
-* unnamed-faq-90::
-* unnamed-faq-91::
-* unnamed-faq-92::
-* unnamed-faq-93::
-* unnamed-faq-94::
-* unnamed-faq-95::
-* unnamed-faq-96::
-* unnamed-faq-97::
-* unnamed-faq-98::
-* unnamed-faq-99::
-* unnamed-faq-100::
-* unnamed-faq-101::
+* When was flex born?::
+* How do I expand backslash-escape sequences in C-style quoted strings?::
+* Why do flex scanners call fileno if it is not ANSI compatible?::
+* Does flex support recursive pattern definitions?::
+* How do I skip huge chunks of input (tens of megabytes) while using flex?::
+* Flex is not matching my patterns in the same order that I defined them.::
+* My actions are executing out of order or sometimes not at all.::
+* How can I have multiple input sources feed into the same scanner at the same time?::
+* Can I build nested parsers that work with the same input file?::
+* How can I match text only at the end of a file?::
+* How can I make REJECT cascade across start condition boundaries?::
+* Why cant I use fast or full tables with interactive mode?::
+* How much faster is -F or -f than -C?::
+* If I have a simple grammar cant I just parse it with flex?::
+* Why doesn't yyrestart() set the start state back to INITIAL?::
+* How can I match C-style comments?::
+* The period isn't working the way I expected.::
+* Can I get the flex manual in another format?::
+* Does there exist a "faster" NDFA->DFA algorithm?::
+* How does flex compile the DFA so quickly?::
+* How can I use more than 8192 rules?::
+* How do I abandon a file in the middle of a scan and switch to a new file?::
+* How do I execute code only during initialization (only before the first scan)?::
+* How do I execute code at termination?::
+* Where else can I find help?::
+* Can I include comments in the "rules" section of the file?::
+* I get an error about undefined yywrap().::
+* How can I change the matching pattern at run time?::
+* How can I expand macros in the input?::
+* How can I build a two-pass scanner?::
+* How do I match any string not matched in the preceding rules?::
+* I am trying to port code from AT&T lex that uses yysptr and yysbuf.::
+* Is there a way to make flex treat NULL like a regular character?::
+* Whenever flex can not match the input it says "flex scanner jammed".::
+* Why doesn't flex have non-greedy operators like perl does?::
+* Memory leak - 16386 bytes allocated by malloc.::
+* How do I track the byte offset for lseek()?::
+* How do I use my own I/O classes in a C++ scanner?::
+* How do I skip as many chars as possible?::
+* deleteme00::
+* Are certain equivalent patterns faster than others?::
+* Is backing up a big deal?::
+* Can I fake multi-byte character support?::
+* deleteme01::
+* Can you discuss some flex internals?::
+* unput() messes up yy_at_bol::
+* The | operator is not doing what I want::
+* Why can't flex understand this variable trailing context pattern?::
+* The ^ operator isn't working::
+* Trailing context is getting confused with trailing optional patterns::
+* Is flex GNU or not?::
+* ERASEME53::
+* I need to scan if-then-else blocks and while loops::
+* ERASEME55::
+* ERASEME56::
+* ERASEME57::
+* Is there a repository for flex scanners?::
+* How can I conditionally compile or preprocess my flex input file?::
+* Where can I find grammars for lex and yacc?::
+* I get an end-of-buffer message for each character scanned.::
+* unnamed-faq-62::
+* unnamed-faq-63::
+* unnamed-faq-64::
+* unnamed-faq-65::
+* unnamed-faq-66::
+* unnamed-faq-67::
+* unnamed-faq-68::
+* unnamed-faq-69::
+* unnamed-faq-70::
+* unnamed-faq-71::
+* unnamed-faq-72::
+* unnamed-faq-73::
+* unnamed-faq-74::
+* unnamed-faq-75::
+* unnamed-faq-76::
+* unnamed-faq-77::
+* unnamed-faq-78::
+* unnamed-faq-79::
+* unnamed-faq-80::
+* unnamed-faq-81::
+* unnamed-faq-82::
+* unnamed-faq-83::
+* unnamed-faq-84::
+* unnamed-faq-85::
+* unnamed-faq-86::
+* unnamed-faq-87::
+* unnamed-faq-88::
+* unnamed-faq-90::
+* unnamed-faq-91::
+* unnamed-faq-92::
+* unnamed-faq-93::
+* unnamed-faq-94::
+* unnamed-faq-95::
+* unnamed-faq-96::
+* unnamed-faq-97::
+* unnamed-faq-98::
+* unnamed-faq-99::
+* unnamed-faq-100::
+* unnamed-faq-101::
* What is the difference between YYLEX_PARAM and YY_DECL?::
* Why do I get "conflicting types for yylex" error?::
* How do I access the values set in a Flex action from within a Bison action?::
@@ -8154,10 +8162,10 @@ See @ref{Top, , , bison, the GNU Bison Manual}.
@appendix Appendices
@menu
-* Makefiles and Flex::
-* Bison Bridge::
-* M4 Dependency::
-* Common Patterns::
+* Makefiles and Flex::
+* Bison Bridge::
+* M4 Dependency::
+* Common Patterns::
@end menu
@node Makefiles and Flex, Bison Bridge, Appendices, Appendices
@@ -8387,13 +8395,13 @@ code from unwanted @code{m4} processing.
@itemize
@item Do not use symbols that begin with, @samp{m4_}, such as, @samp{m4_define},
-or @samp{m4_include}, since those are reserved for @code{m4} macro names. If for
+or @samp{m4_include}, since those are reserved for @code{m4} macro names. If for
some reason you need m4_ as a prefix, use a preprocessor #define to get your
symbol past m4 unmangled.
@item Do not use the strings @samp{[[} or @samp{]]} anywhere in your code. The
former is not valid in C, except within comments and strings, but the latter is valid in
-code such as @code{x[y[z]]}. The solution is simple. To get the literal string
+code such as @code{x[y[z]]}. The solution is simple. To get the literal string
@code{"]]"}, use @code{"]""]"}. To get the array notation @code{x[y[z]]},
use @code{x[y[z] ]}. Flex will attempt to detect these sequences in user code, and
escape them. However, it's best to avoid this complexity where possible, by
@@ -8412,10 +8420,10 @@ This appendix provides examples of common regular expressions you might use
in your scanner.
@menu
-* Numbers::
-* Identifiers::
-* Quoted Constructs::
-* Addresses::
+* Numbers::
+* Identifiers::
+* Quoted Constructs::
+* Addresses::
@end menu
@@ -8556,12 +8564,12 @@ to appear in a URI, including spaces and control characters. See
@unnumbered Indices
@menu
-* Concept Index::
-* Index of Functions and Macros::
-* Index of Variables::
-* Index of Data Types::
-* Index of Hooks::
-* Index of Scanner Options::
+* Concept Index::
+* Index of Functions and Macros::
+* Index of Variables::
+* Index of Data Types::
+* Index of Hooks::
+* Index of Scanner Options::
@end menu
@node Concept Index, Index of Functions and Macros, Indices, Indices
diff --git a/examples/fastwc/mywc.c b/examples/fastwc/mywc.c
index 92e5a36..b07d5f0 100644
--- a/examples/fastwc/mywc.c
+++ b/examples/fastwc/mywc.c
@@ -5,7 +5,7 @@
main()
{
- register int c, cc = 0, wc = 0, lc = 0;
+ int c, cc = 0, wc = 0, lc = 0;
FILE *f = stdin;
while ((c = getc(f)) != EOF) {
diff --git a/lib/.gitignore b/lib/.gitignore
new file mode 100644
index 0000000..9e23bdd
--- /dev/null
+++ b/lib/.gitignore
@@ -0,0 +1,3 @@
+*.la
+*.lo
+*.o
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 391465f..f626423 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -1,4 +1,3 @@
noinst_LTLIBRARIES = libcompat.la
libcompat_la_SOURCES = lib.c
-libcompat_la_LIBADD = $(LIBOBJS)
-
+libcompat_la_LIBADD = $(LTLIBOBJS)
diff --git a/lib/malloc.c b/lib/malloc.c
index d4c605f..40bffea 100755
--- a/lib/malloc.c
+++ b/lib/malloc.c
@@ -1,17 +1,17 @@
- #include <config.h>
- #undef malloc
-
- #include <sys/types.h>
-
- void *malloc ();
-
- /* Allocate an N-byte block of memory from the heap.
- If N is zero, allocate a 1-byte block. */
-
- void *
- rpl_malloc (size_t n)
- {
- if (n == 0)
- n = 1;
- return malloc (n);
- }
+ #include <config.h>
+ #undef malloc
+
+ #include <sys/types.h>
+
+ void *malloc ();
+
+ /* Allocate an N-byte block of memory from the heap.
+ If N is zero, allocate a 1-byte block. */
+
+ void *
+ rpl_malloc (size_t n)
+ {
+ if (n == 0)
+ n = 1;
+ return malloc (n);
+ }
diff --git a/lib/realloc.c b/lib/realloc.c
index d7bb629..79bfd28 100644
--- a/lib/realloc.c
+++ b/lib/realloc.c
@@ -1,4 +1,6 @@
#include <config.h>
+#undef realloc
+#undef malloc
#include <stdlib.h>
diff --git a/po/.gitignore b/po/.gitignore
new file mode 100644
index 0000000..3c6f57d
--- /dev/null
+++ b/po/.gitignore
@@ -0,0 +1,18 @@
+*.gmo
+Makefile
+Makefile.in
+Makefile.in.in
+Makevars.template
+POTFILES
+Rules-quot
+boldquot.sed
+en@boldquot.*header
+en@boldquot.po
+en@quot.*header
+en@quot.po
+flex.pot
+insert-header.sin
+quot.sed
+remove-potcdate.sed
+remove-potcdate.sin
+stamp-*
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 4b03de7..1e820a2 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,18 +1,18 @@
-buf.c
-ccl.c
-dfa.c
-ecs.c
-gen.c
-libmain.c
-libyywrap.c
-main.c
-misc.c
-nfa.c
-options.c
-parse.y
-scan.l
-scanopt.c
-skel.c
-sym.c
-tblcmp.c
-yylex.c
+src/buf.c
+src/ccl.c
+src/dfa.c
+src/ecs.c
+src/gen.c
+src/libmain.c
+src/libyywrap.c
+src/main.c
+src/misc.c
+src/nfa.c
+src/options.c
+src/parse.y
+src/scan.l
+src/scanopt.c
+src/skel.c
+src/sym.c
+src/tblcmp.c
+src/yylex.c
diff --git a/po/Rules-getpo b/po/Rules-getpo
new file mode 100644
index 0000000..f0c4a11
--- /dev/null
+++ b/po/Rules-getpo
@@ -0,0 +1,9 @@
+# Rules to fetch the translation project's po files for a domain
+
+# Just rsync the *.po files for a particular textual domain into the
+# po/ subdirectory of the project's source tree
+
+getpo:
+ rsync -Ltvz translationproject.org::tp/latest/flex/*.po $(top_srcdir)/po
+
+.PHONY: getpo
diff --git a/po/ca.po b/po/ca.po
index 1f429a1..0ee0551 100644
--- a/po/ca.po
+++ b/po/ca.po
@@ -1,13 +1,28 @@
-# Catalan translation of flex message catalogs.
-# Copyright © 2002, 2003, 2006, 2008, 2012 The Flex Project (msgids)
-# This file is distributed under the same licence as the flex package.
-# Jordi Mallach <jordi@sindominio.net>, 2002, 2003, 2006, 2008, 2012.
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR Free Software Foundation, Inc.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
+#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: flex 2.5.37\n"
-"Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2014-03-26 15:00-0400\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"PO-Revision-Date: 2016-01-22 13:13-0800\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#~ # Catalan translation of flex message catalogs.
+#~ # Copyright © 2002, 2003, 2006, 2008, 2012 The Flex Project (msgids)
+#~ # This file is distributed under the same licence as the flex package.
+#~ # Jordi Mallach <jordi@sindominio.net>, 2002, 2003, 2006, 2008, 2012.
+#~ #
+#~ msgid ""
+#~ msgstr ""
+#~ "Project-Id-Version: flex 2.5.37\n"
+#~ "Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n"
+"POT-Creation-Date: 2012-07-22 20:48-0400\n"
"PO-Revision-Date: 2012-12-04 17:36+0100\n"
"Last-Translator: Jordi Mallach <jordi@sindominio.net>\n"
"Language-Team: Catalan <ca@dodds.net>\n"
@@ -173,253 +188,251 @@ msgstr "No s'ha pogut escriure eoltbl"
msgid "Could not write yynultrans_tbl"
msgstr "No s'ha pogut escriure yynultrans_tbl"
-#: main.c:191
+#: main.c:189
msgid "rule cannot be matched"
msgstr "no es pot satisfer la regla"
-#: main.c:196
+#: main.c:194
msgid "-s option given but default rule can be matched"
msgstr "S'ha especificat l'opció -s però es pot aplicar la regla per defecte"
-#: main.c:236
+#: main.c:234
msgid "Can't use -+ with -l option"
msgstr "No es pot fer servir -+ amb l'opció -l"
-#: main.c:239
+#: main.c:237
msgid "Can't use -f or -F with -l option"
msgstr "No es pot fer servir -f o -F amb l'opció -l"
-#: main.c:243
+#: main.c:241
msgid "Can't use --reentrant or --bison-bridge with -l option"
msgstr "No es pot fer servir --reentrant o --bison-bridge amb l'opció -l"
-#: main.c:275
+#: main.c:278
msgid "-Cf/-CF and -Cm don't make sense together"
msgstr "-Cf/-CF i -Cm no tenen sentit juntes"
-#: main.c:278
+#: main.c:281
msgid "-Cf/-CF and -I are incompatible"
msgstr "-Cf/-CF i -I són incompatibles"
-#: main.c:282
+#: main.c:285
msgid "-Cf/-CF are incompatible with lex-compatibility mode"
msgstr "-Cf/-CF són incompatibles amb el mode de compatibilitat amb lex"
-#: main.c:287
+#: main.c:290
msgid "-Cf and -CF are mutually exclusive"
msgstr "-Cf i -CF són mútuament excloents"
-#: main.c:291
+#: main.c:294
msgid "Can't use -+ with -CF option"
msgstr "No es pot fer servir -+ amb l'opció -CF"
-#: main.c:294
+#: main.c:297
#, c-format
msgid "%array incompatible with -+ option"
msgstr "%array és incompatible amb l'opció -+"
-#: main.c:299
+#: main.c:302
msgid "Options -+ and --reentrant are mutually exclusive."
msgstr "Les opcions -+ i --reentrant són mútuament excloents"
-#: main.c:302
+#: main.c:305
msgid "bison bridge not supported for the C++ scanner."
msgstr "No es suporta «bison bridge» per a l'analitzador de C++"
-#: main.c:357 main.c:403
+#: main.c:360 main.c:406
#, c-format
msgid "could not create %s"
msgstr "no s'ha pogut crear %s"
-#: main.c:416
+#: main.c:419
msgid "could not write tables header"
msgstr "no s'ha pogut crear la capçalera de les taules"
-#: main.c:420
+#: main.c:423
#, c-format
msgid "can't open skeleton file %s"
msgstr "No es pot obrir el fitxer d'esquema %s"
-#: main.c:456
+#: main.c:459
msgid "allocation of macro definition failed"
msgstr "Ha fallat l'assignació de la definició de la macro"
-#: main.c:504
+#: main.c:507
#, c-format
msgid "input error reading skeleton file %s"
msgstr "error d'entrada al llegir el fitxer d'esquema %s"
-#: main.c:508
+#: main.c:511
#, c-format
msgid "error closing skeleton file %s"
msgstr "s'ha produït un error en tancar el fitxer d'esquema %s"
-#: main.c:693
+#: main.c:696
#, c-format
msgid "error creating header file %s"
msgstr "s'ha produït un error en crear el fitxer de capçalera %s"
-#: main.c:701
+#: main.c:704
#, c-format
msgid "error writing output file %s"
msgstr "s'ha produït un error en escriure el fitxer d'eixida %s"
-#: main.c:705
+#: main.c:708
#, c-format
msgid "error closing output file %s"
msgstr "s'ha produït un error en tancar el fitxer d'eixida %s"
-#: main.c:709
+#: main.c:712
#, c-format
msgid "error deleting output file %s"
msgstr "s'ha produït un error en suprimir el fitxer d'eixida %s"
-#: main.c:716
+#: main.c:719
#, c-format
msgid "No backing up.\n"
msgstr "No hi ha retrocés.\n"
-#: main.c:720
+#: main.c:723
#, c-format
msgid "%d backing up (non-accepting) states.\n"
msgstr "%d estats de retrocés (no-acceptació).\n"
-#: main.c:724
+#: main.c:727
#, c-format
msgid "Compressed tables always back up.\n"
msgstr "Les taules comprimides sempre impliquen un retard.\n"
-#: main.c:727
+#: main.c:730
#, c-format
msgid "error writing backup file %s"
msgstr "s'ha produït un error en escriure el fitxer de còpia de seguretat %s"
-#: main.c:731
+#: main.c:734
#, c-format
msgid "error closing backup file %s"
msgstr "s'ha produït un error en tancar el fitxer de còpia de seguretat %s"
-#: main.c:736
+#: main.c:739
#, c-format
msgid "%s version %s usage statistics:\n"
msgstr "estadístiques d'ús de %s versió %s:\n"
-#: main.c:739
+#: main.c:742
#, c-format
msgid " scanner options: -"
msgstr " opcions de l'analitzador: -"
# NFA == Autómata finit no-determinista. jm
-#: main.c:818
+#: main.c:821
#, c-format
msgid " %d/%d NFA states\n"
msgstr " %d/%d estats AFN\n"
# DFA == Autómata finit deterministic. jm
-#: main.c:820
+#: main.c:823
#, c-format
msgid " %d/%d DFA states (%d words)\n"
msgstr " %d/%d estats AFD (%d paraules)\n"
-#: main.c:822
+#: main.c:825
#, c-format
msgid " %d rules\n"
msgstr " %d regles\n"
-#: main.c:827
+#: main.c:830
#, c-format
msgid " No backing up\n"
msgstr " Sense retrocés\n"
-#: main.c:831
+#: main.c:834
#, c-format
msgid " %d backing-up (non-accepting) states\n"
msgstr " %d estats de retrocés (no-acceptació)\n"
# Es refereix a còpia de seguretat, o retrocés? jm
-#: main.c:836
+#: main.c:839
#, c-format
msgid " Compressed tables always back-up\n"
msgstr " Sempre es realitza còpia de seguretat de les taules comprimides\n"
-#: main.c:840
+#: main.c:843
#, c-format
msgid " Beginning-of-line patterns used\n"
msgstr " Utilitzats patrons de principi-de-línia\n"
-#: main.c:842
+#: main.c:845
#, c-format
msgid " %d/%d start conditions\n"
msgstr " %d/%d condicions d'activació\n"
-#: main.c:846
+#: main.c:849
#, c-format
msgid " %d epsilon states, %d double epsilon states\n"
msgstr " %d estats èpsilon, %d estats doble èpsilon\n"
-#: main.c:850
+#: main.c:853
#, c-format
msgid " no character classes\n"
msgstr " sense classes de caràcter\n"
-#: main.c:854
+#: main.c:857
#, c-format
msgid " %d/%d character classes needed %d/%d words of storage, %d reused\n"
-msgstr ""
-" les classes de caràcters %d/%d necessitaren %d/%d paraules de magatzement, "
-"%d reutilitzades\n"
+msgstr " les classes de caràcters %d/%d necessitaren %d/%d paraules de magatzement, %d reutilitzades\n"
-#: main.c:859
+#: main.c:862
#, c-format
msgid " %d state/nextstate pairs created\n"
msgstr " %d parells estat/estat-següent creats\n"
-#: main.c:862
+#: main.c:865
#, c-format
msgid " %d/%d unique/duplicate transitions\n"
msgstr " %d/%d transicions úniques/duplicades\n"
-#: main.c:867
+#: main.c:870
#, c-format
msgid " %d table entries\n"
msgstr " %d entrades de la taula\n"
-#: main.c:875
+#: main.c:878
#, c-format
msgid " %d/%d base-def entries created\n"
msgstr " %d/%d entrades base-def creades\n"
-#: main.c:879
+#: main.c:882
#, c-format
msgid " %d/%d (peak %d) nxt-chk entries created\n"
msgstr " %d/%d (pic %d) entrades nxt-chk creades\n"
-#: main.c:883
+#: main.c:886
#, c-format
msgid " %d/%d (peak %d) template nxt-chk entries created\n"
msgstr " %d/%d (pic %d) entrades de plantilla nxt-chk creades\n"
-#: main.c:887
+#: main.c:890
#, c-format
msgid " %d empty table entries\n"
msgstr " %d entrades de la tabla buides\n"
-#: main.c:889
+#: main.c:892
#, c-format
msgid " %d protos created\n"
msgstr " %d prototips creats\n"
-#: main.c:892
+#: main.c:895
#, c-format
msgid " %d templates created, %d uses\n"
msgstr " %d plantilles creades, %d usos\n"
-#: main.c:900
+#: main.c:903
#, c-format
msgid " %d/%d equivalence classes created\n"
msgstr " %d/%d classes d'equivalència creades\n"
-#: main.c:908
+#: main.c:911
#, c-format
msgid " %d/%d meta-equivalence classes created\n"
msgstr " %d/%d classes de meta-equivalència creades\n"
@@ -428,115 +441,105 @@ msgstr " %d/%d classes de meta-equivalència creades\n"
# segons un company de treballa que estudia a la UOC, allí
# les "hashtables" s'anomenen "taules de DISPERSIÓ". En aquest context
# no sé que dir-te. ear
-#: main.c:914
+#: main.c:917
#, c-format
msgid " %d (%d saved) hash collisions, %d DFAs equal\n"
msgstr " %d (%d desades) col·lisions d'ubicació («hash»), %d AFD iguals\n"
-#: main.c:916
+#: main.c:919
#, c-format
msgid " %d sets of reallocations needed\n"
msgstr " es necessiten %d conjunts de relocalització\n"
-#: main.c:918
+#: main.c:921
#, c-format
msgid " %d total table entries needed\n"
msgstr " es necessiten %d entrades totals de la taula\n"
-#: main.c:995
+#: main.c:998
#, c-format
msgid "Internal error. flexopts are malformed.\n"
msgstr "Error intern. Els flexopts estan malformats.\n"
-#: main.c:1005
+#: main.c:1008
#, c-format
msgid "Try `%s --help' for more information.\n"
msgstr "Proveu «%s --help» per a obtindre més informació.\n"
-#: main.c:1062
+#: main.c:1065
#, c-format
msgid "unknown -C option '%c'"
msgstr "opció de -C desconeguda «%c»"
-#: main.c:1191
+#: main.c:1194
#, c-format
msgid "%s %s\n"
msgstr "%s %s\n"
# Hmm. No se si açò està be. jm
-#: main.c:1466
+#: main.c:1469
msgid "fatal parse error"
msgstr "s'ha produït un error fatal d'anàlisi sintàctic"
-#: main.c:1498
+#: main.c:1501
#, c-format
msgid "could not create backing-up info file %s"
msgstr "no s'ha pogut crear un fitxer d'informació del retrocés %s"
-#: main.c:1519
+#: main.c:1522
#, c-format
msgid "-l AT&T lex compatibility option entails a large performance penalty\n"
-msgstr ""
-"-l l'opció de compatibilitat amb AT&T lex implica una penalització del "
-"rendiment molt gran\n"
+msgstr "-l l'opció de compatibilitat amb AT&T lex implica una penalització del rendiment molt gran\n"
-#: main.c:1522
+#: main.c:1525
#, c-format
msgid " and may be the actual source of other reported performance penalties\n"
-msgstr ""
-" i pot ser l'origen real d'altres penalitzacions del rendiment notificades\n"
+msgstr " i pot ser l'origen real d'altres penalitzacions del rendiment notificades\n"
-#: main.c:1528
+#: main.c:1531
#, c-format
-msgid ""
-"%%option yylineno entails a performance penalty ONLY on rules that can match "
-"newline characters\n"
-msgstr ""
-"l'%%opció yylineno implica una penalització del rendiment NOMÉS en regles "
-"que poden fer coincidir caràcters de nova línia\n"
+msgid "%%option yylineno entails a performance penalty ONLY on rules that can match newline characters\n"
+msgstr "l'%%opció yylineno implica una penalització del rendiment NOMÉS en regles que poden fer coincidir caràcters de nova línia\n"
-#: main.c:1535
+#: main.c:1538
#, c-format
msgid "-I (interactive) entails a minor performance penalty\n"
msgstr "-I (interactiu) implica una xicoteta penalització del rendiment\n"
-#: main.c:1540
+#: main.c:1543
#, c-format
msgid "yymore() entails a minor performance penalty\n"
msgstr "yymore() implica una xicoteta penalització del rendiment\n"
-#: main.c:1546
+#: main.c:1549
#, c-format
msgid "REJECT entails a large performance penalty\n"
msgstr "REJECT implica una penalització del rendiment molt gran\n"
-#: main.c:1551
+#: main.c:1554
#, c-format
msgid "Variable trailing context rules entail a large performance penalty\n"
-msgstr ""
-"Les regles de context posterior variable implica una penalització del "
-"rendiment molt gran\n"
+msgstr "Les regles de context posterior variable implica una penalització del rendiment molt gran\n"
-#: main.c:1563
+#: main.c:1566
msgid "REJECT cannot be used with -f or -F"
msgstr "REJECT no es pot fer servir amb -f o -F"
-#: main.c:1566
+#: main.c:1569
#, c-format
msgid "%option yylineno cannot be used with REJECT"
msgstr "l'%opció yylineno no es pot fer servir amb REJECT"
-#: main.c:1569
+#: main.c:1572
msgid "variable trailing context rules cannot be used with -f or -F"
-msgstr ""
-"Les regles de context posterior variable no es poden utilitzar amb -f o -F"
+msgstr "Les regles de context posterior variable no es poden utilitzar amb -f o -F"
-#: main.c:1692
+#: main.c:1695
#, c-format
msgid "%option yyclass only meaningful for C++ scanners"
msgstr "l'%opció yyclass només té sentit per a analitzadors de C++"
-#: main.c:1799
+#: main.c:1802
#, c-format
msgid "Usage: %s [OPTIONS] [FILE]...\n"
msgstr "Forma d'ús: %s [OPCIONS] [FITXER]...\n"
@@ -545,7 +548,7 @@ msgstr "Forma d'ús: %s [OPCIONS] [FITXER]...\n"
# molt això de text emparellat.
# Encara que coincident tampoc no m'acaba de convéncer. ear
# I que faig amb "reentrant" i "parser"? jm
-#: main.c:1802
+#: main.c:1805
#, c-format
msgid ""
"Generates programs that perform pattern-matching on text.\n"
@@ -575,8 +578,7 @@ msgid ""
" -S, --skel=FILE specify skeleton file\n"
" -t, --stdout write scanner on stdout instead of %s\n"
" --yyclass=NAME name of C++ class\n"
-" --header-file=FILE create a C header file in addition to the "
-"scanner\n"
+" --header-file=FILE create a C header file in addition to the scanner\n"
" --tables-file[=FILE] write tables to FILE\n"
"\n"
"Scanner behavior:\n"
@@ -613,52 +615,41 @@ msgstr ""
"Genera programes que realitzen emparellaments de patrons en text.\n"
"\n"
"Compressió de taules:\n"
-" -Ca, --align renuncia a taules més grans a canvi de una millor "
-"alineació\n"
+" -Ca, --align renuncia a taules més grans a canvi de una millor alineació\n"
" -Ce, --ecs construeix classes d'equivalència\n"
-" -Cf no comprimeixes les taules; utilitza la representació -"
-"f\n"
-" -CF no comprimeixes les taules; utilitza la representació -"
-"F\n"
+" -Cf no comprimeixes les taules; utilitza la representació -f\n"
+" -CF no comprimeixes les taules; utilitza la representació -F\n"
" -Cm, --meta-ecs construeix classes de metaequivalència\n"
-" -Cr, --read utilitza read() en lloc de stdio com a entrada de "
-"l'analitzador\n"
+" -Cr, --read utilitza read() en lloc de stdio com a entrada de l'analitzador\n"
" -f, --full genera un analitzador ràpid i gran. El mateix que -Cfr\n"
-" -F, --fast usa una representació alternativa de taules. El mateix "
-"que -CFr\n"
+" -F, --fast usa una representació alternativa de taules. El mateix que -CFr\n"
" -Cem compressió per defecte (el mateix que --ecs --meta-ecs)\n"
"\n"
"Depuració:\n"
" -d, --debug activa el mode de depuració en l'analitzador\n"
" -b, --backup escriu l'informació dels retrocessos en %s\n"
" -p, --perf-report escriu l'informe de rendiment en stderr\n"
-" -s, --nodefault suprimeix la regla per defecte de visualitzar "
-"(ECHO) el text no emparellat\n"
+" -s, --nodefault suprimeix la regla per defecte de visualitzar (ECHO) el text no emparellat\n"
" -T, --trace %s hauria d'executar-se en mode traça\n"
" -w, --nowarn no generes avisos\n"
-" -v, --verbose escriu un resum de les estadístiques de "
-"l'analitzador en stdout\n"
+" -v, --verbose escriu un resum de les estadístiques de l'analitzador en stdout\n"
"\n"
"Fitxers:\n"
" -o, --outfile=FITXER especifica el fitxer d'eixida\n"
" -S, --skel=FITXER especifica el fitxer d'esquema\n"
" -t, --stdout escriu l'analitzador en stdout en lloc de %s\n"
" --yyclass=NOM nom de la classe C++\n"
-" --header-file=FITXER crea un fitxer de capçaleres de C a més de "
-"l'analitzador\n"
+" --header-file=FITXER crea un fitxer de capçaleres de C a més de l'analitzador\n"
" --tables-file=[FITXER] escriu les taules en FITXER\n"
"\n"
"Comportament de l'analitzador:\n"
" -7, --7bit genera un analitzador de 7 bits\n"
" -8, --8bit genera un analitzador de 8 bits\n"
-" -B, --batch genera un analitzador no interactiu (el contrari a "
-"-I)\n"
-" -i, --case-insensitive Ignora les diferències de majúscules i minúscules "
-"en els patrons\n"
+" -B, --batch genera un analitzador no interactiu (el contrari a -I)\n"
+" -i, --case-insensitive Ignora les diferències de majúscules i minúscules en els patrons\n"
" -l, --lex-compat compatibilitat màxima amb el lex original\n"
" -X, --posix-compat compatibilitat màxima amb el lex POSIX\n"
-" -I, --interactive genera un analitzador interactiu (el contrari a -"
-"B)\n"
+" -I, --interactive genera un analitzador interactiu (el contrari a -B)\n"
" --yylineno traça el compte de línies en yylineno\n"
"\n"
"Codi generat:\n"
@@ -756,20 +747,20 @@ msgstr "màquina buida en dupmachine()"
msgid "Variable trailing context rule at line %d\n"
msgstr "Regla de context posterior variable en la línia %d\n"
-#: nfa.c:364
+#: nfa.c:353
msgid "bad state type in mark_beginning_as_normal()"
msgstr "tipus d'estat incorrecte en mark_beginning_as_normal()"
-#: nfa.c:609
+#: nfa.c:598
#, c-format
msgid "input rules are too complicated (>= %d NFA states)"
msgstr "les regles d'entrada són massa complicades (>= %d estats AFN)"
-#: nfa.c:688
+#: nfa.c:677
msgid "found too many transitions in mkxtion()"
msgstr "s'han trobat massa transicions en mkxtion()"
-#: nfa.c:714
+#: nfa.c:703
#, c-format
msgid "too many rules (> %d)!"
msgstr "massa regles (> %d)!"
@@ -801,9 +792,7 @@ msgstr "el valor d'iteració ha de ser positiu"
#: parse.y:804 parse.y:814
#, c-format
msgid "the character range [%c-%c] is ambiguous in a case-insensitive scanner"
-msgstr ""
-"el rang de caràcters [%c-%c] és ambigu en un analitzador insensible a les "
-"majúscules i minúscules"
+msgstr "el rang de caràcters [%c-%c] és ambigu en un analitzador insensible a les majúscules i minúscules"
#: parse.y:819
msgid "negative range in character class"
@@ -811,15 +800,11 @@ msgstr "rang negatiu en classe de caràcter"
#: parse.y:916
msgid "[:^lower:] is ambiguous in case insensitive scanner"
-msgstr ""
-"[:^lower:] és ambigu en un analitzador insensible a les majúscules i "
-"minúscules"
+msgstr "[:^lower:] és ambigu en un analitzador insensible a les majúscules i minúscules"
#: parse.y:922
msgid "[:^upper:] ambiguous in case insensitive scanner"
-msgstr ""
-"[:^upper:] és ambigu en un analitzador insensible a les majúscules i "
-"minúscules"
+msgstr "[:^upper:] és ambigu en un analitzador insensible a les majúscules i minúscules"
#: scan.l:75 scan.l:618 scan.l:676
msgid "Input line too long\n"
@@ -998,10 +983,8 @@ msgstr "*Quelcom estrany* - terminal: %d val: %d\n"
#~ msgid "-C flag must be given separately"
#~ msgstr "l'opció -C s'ha de donar per separat"
-#~ msgid ""
-#~ "%s [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -ooutput -Pprefix -Sskeleton]\n"
-#~ msgstr ""
-#~ "%s [--bcdfhilnpstvwBFILTV78+? -C[aefFmr] -oeixida -Pprefix -Sesquema]\n"
+#~ msgid "%s [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -ooutput -Pprefix -Sskeleton]\n"
+#~ msgstr "%s [--bcdfhilnpstvwBFILTV78+? -C[aefFmr] -oeixida -Pprefix -Sesquema]\n"
#~ msgid "\t[--help --version] [file ...]\n"
#~ msgstr "\t[--help --version] [fitxer ...]\n"
@@ -1037,13 +1020,10 @@ msgstr "*Quelcom estrany* - terminal: %d val: %d\n"
# molt això de text emparellat.
# Encara que coincident tampoc no m'acaba de convéncer. ear
#~ msgid "\t-s suppress default rule to ECHO unmatched text\n"
-#~ msgstr ""
-#~ "\t-s suprimeix la regla per defecte de visualitzar (ECHO) el text no "
-#~ "emparellat\n"
+#~ msgstr "\t-s suprimeix la regla per defecte de visualitzar (ECHO) el text no emparellat\n"
#~ msgid "\t-t write generated scanner on stdout instead of %s\n"
-#~ msgstr ""
-#~ "\t-t escriu l'analitzador generat en l'eixida estàndard en lloc de %s\n"
+#~ msgstr "\t-t escriu l'analitzador generat en l'eixida estàndard en lloc de %s\n"
#~ msgid "\t-v write summary of scanner statistics to f\n"
#~ msgstr "\t-v escriu un resum de les estadístiques en f\n"
@@ -1082,8 +1062,7 @@ msgstr "*Quelcom estrany* - terminal: %d val: %d\n"
#~ msgstr "\t-? produeix aquest missatge d'ajuda\n"
#~ msgid "\t-C specify degree of table compression (default is -Cem):\n"
-#~ msgstr ""
-#~ "\t-C especifica el grau de compressió de la taula (per defecte -Cem):\n"
+#~ msgstr "\t-C especifica el grau de compressió de la taula (per defecte -Cem):\n"
#~ msgid "\t\t-Ca trade off larger tables for better memory alignment\n"
#~ msgstr ""
@@ -1094,21 +1073,16 @@ msgstr "*Quelcom estrany* - terminal: %d val: %d\n"
#~ msgstr "\t\t-Ce construeix classes d'equivalència\n"
#~ msgid "\t\t-Cf do not compress scanner tables; use -f representation\n"
-#~ msgstr ""
-#~ "\t\t-Cf no comprimeix les taules de l'analitzador; utilitza la "
-#~ "representació -f\n"
+#~ msgstr "\t\t-Cf no comprimeix les taules de l'analitzador; utilitza la representació -f\n"
#~ msgid "\t\t-CF do not compress scanner tables; use -F representation\n"
-#~ msgstr ""
-#~ "\t\t-CF no comprimeix les taules de l'analitzador; utilitza la "
-#~ "representació -F\n"
+#~ msgstr "\t\t-CF no comprimeix les taules de l'analitzador; utilitza la representació -F\n"
#~ msgid "\t\t-Cm construct meta-equivalence classes\n"
#~ msgstr "\t\t-Cm construeix classes de metaequivalència\n"
#~ msgid "\t\t-Cr use read() instead of stdio for scanner input\n"
-#~ msgstr ""
-#~ "\t\t-Cr utilitza read() en lloc de stdio com a entrada de l'analitzador\n"
+#~ msgstr "\t\t-Cr utilitza read() en lloc de stdio com a entrada de l'analitzador\n"
#~ msgid "\t-o specify output filename\n"
#~ msgstr "\t-o especifica el fitxer d'eixida\n"
diff --git a/po/da.po b/po/da.po
index 2e6c1e1..0697596 100644
--- a/po/da.po
+++ b/po/da.po
@@ -2,14 +2,14 @@
# Copyright (C) 2007 The Flex Project (msgids)
# This file is distributed under the same license as the flex package.
# Johan Linde <jl@theophys.kth.se>, 1996.
-# Keld Simonsen <keld@keldix.com>, 2000-2011.
+# Keld Simonsen <keld@keldix.com>, 2000-2011, 2015.
#
msgid ""
msgstr ""
-"Project-Id-Version: flex-2.5.35\n"
+"Project-Id-Version: flex-2.5.38\n"
"Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2014-03-26 15:00-0400\n"
-"PO-Revision-Date: 2011-01-11 09:12+0100\n"
+"POT-Creation-Date: 2014-02-11 16:15-0500\n"
+"PO-Revision-Date: 2016-01-22 13:14-0800\n"
"Last-Translator: Keld Simonsen <keld@keldix.com>\n"
"Language-Team: Danish <dansk@dansk-gruppen.dk>\n"
"Language: da\n"
@@ -19,19 +19,19 @@ msgstr ""
#: buf.c:78
msgid "Allocation of buffer to print string failed"
-msgstr ""
+msgstr "Tildeling af buffer til udskrivningsstreng mislykkedes"
#: buf.c:100
msgid "Allocation of buffer for line directive failed"
-msgstr ""
+msgstr "Tildeling af buffer til linjedirektiv mislykkedes"
#: buf.c:177
msgid "Allocation of buffer for m4 def failed"
-msgstr ""
+msgstr "Tildeling af buffer til m4 def mislykkedes"
#: buf.c:197
msgid "Allocation of buffer for m4 undef failed"
-msgstr ""
+msgstr "Tildeling af buffer til m4 undef mislykkedes"
#: dfa.c:61
#, c-format
@@ -245,7 +245,7 @@ msgstr "kan ikke åbne skabelonfilen %s"
#: main.c:456
msgid "allocation of macro definition failed"
-msgstr ""
+msgstr "tildeling af makro-definition mislykkedes"
#: main.c:504
#, c-format
@@ -469,8 +469,7 @@ msgstr "kunne ikke oprette sikkerhedskopi af info-fil %s"
#: main.c:1519
#, c-format
msgid "-l AT&T lex compatibility option entails a large performance penalty\n"
-msgstr ""
-"flaget -l for opførsel som AT&T's lex medfører et væsentligt præstationstab\n"
+msgstr "flaget -l for opførsel som AT&T's lex medfører et væsentligt præstationstab\n"
#: main.c:1522
#, c-format
@@ -479,12 +478,8 @@ msgstr " og kan være den egentlige årsag til andre rapporter om dette\n"
#: main.c:1528
#, c-format
-msgid ""
-"%%option yylineno entails a performance penalty ONLY on rules that can match "
-"newline characters\n"
-msgstr ""
-"%%option yylineno medfører et præstationstab KUN på regler der kan matche "
-"nylinje-tegn\n"
+msgid "%%option yylineno entails a performance penalty ONLY on rules that can match newline characters\n"
+msgstr "%%option yylineno medfører et præstationstab KUN på regler der kan matche nylinje-tegn\n"
#: main.c:1535
#, c-format
@@ -504,9 +499,7 @@ msgstr "REJECT medfører et væsentligt præstationstab\n"
#: main.c:1551
#, c-format
msgid "Variable trailing context rules entail a large performance penalty\n"
-msgstr ""
-"Regler for variabel efterfølgende kontekst medfører et væsentlig "
-"præstationstab\n"
+msgstr "Regler for variabel efterfølgende kontekst medfører et væsentlig præstationstab\n"
#: main.c:1563
msgid "REJECT cannot be used with -f or -F"
@@ -563,8 +556,7 @@ msgid ""
" -S, --skel=FILE specify skeleton file\n"
" -t, --stdout write scanner on stdout instead of %s\n"
" --yyclass=NAME name of C++ class\n"
-" --header-file=FILE create a C header file in addition to the "
-"scanner\n"
+" --header-file=FILE create a C header file in addition to the scanner\n"
" --tables-file[=FILE] write tables to FILE\n"
"\n"
"Scanner behavior:\n"
@@ -601,8 +593,7 @@ msgstr ""
"Genererer programmer som udfører mønstergenkendelse på tekst.\n"
"\n"
"Tabel-kompression: (normalt -Cem)\n"
-" -Ca, --align brug bedre hukommelses-tilpasning i stedet for mindre "
-"tabeller\n"
+" -Ca, --align brug bedre hukommelses-tilpasning i stedet for mindre tabeller\n"
" -Ce, --ecs konstruér ækvivalensklasser\n"
" -Cf komprimér ikke tabeller; brug -f repræsentation\n"
" -CF komprimér ikke tabeller; brug -F repræsentation\n"
@@ -616,8 +607,7 @@ msgstr ""
" -d, --debug aktivér fejlsøgnings-tilstand i skanneren\n"
" -b, --backup skriv sikkerhedskopi-information til %s\n"
" -p, --perf-report skriv ydelses-rapport på stdfejl\n"
-" -s, --nodefault undertryk normal regel om at udskrive tekst der "
-"ikke passede\n"
+" -s, --nodefault undertryk normal regel om at udskrive tekst der ikke passede\n"
" -T, --trace %s bør køre i sporings-tilstand\n"
" -w, --nowarn generér ikke advarsler\n"
" -v, --verbose skriv sammendrag af skanner-statistik til stdud\n"
@@ -634,8 +624,7 @@ msgstr ""
" -7, --7bit generér 7-bit-skanner\n"
" -8, --8bit generér 8-bit-skanner\n"
" -B, --batch generér batch-skanner (modsat -I)\n"
-" -i, --case-insensitive ignorér forskel på små og store bogstaver i "
-"mønstre\n"
+" -i, --case-insensitive ignorér forskel på små og store bogstaver i mønstre\n"
" -l, --lex-compat maksimal kompatibilitet med oprindelig lex\n"
" -X, --posix-compat maksimal kompatibilitet med POSIX lex\n"
" -I, --interactive generér interaktiv skanner (modsat -B)\n"
@@ -664,7 +653,7 @@ msgstr ""
#: misc.c:65
msgid "allocation of sko_stack failed"
-msgstr ""
+msgstr "tildeling af sko_stack mislykkedes"
#: misc.c:102 misc.c:128
#, c-format
@@ -810,9 +799,8 @@ msgid "unrecognized '%' directive"
msgstr "ukendt '%'-direktiv"
#: scan.l:192
-#, fuzzy
msgid "Definition name too long\n"
-msgstr "For lang inddatalinje\n"
+msgstr "For langt definitionsnavn\n"
#: scan.l:284
msgid "Unmatched '{'"
@@ -821,16 +809,15 @@ msgstr "Ensomt '{'"
#: scan.l:300
#, c-format
msgid "Definition value for {%s} too long\n"
-msgstr ""
+msgstr "Definitionsværdi for (%s) for langt\n"
#: scan.l:317
msgid "incomplete name definition"
msgstr "ufuldstændig navnedefinition"
#: scan.l:443
-#, fuzzy
msgid "Option line too long\n"
-msgstr "For lang inddatalinje\n"
+msgstr "For lang valgmulighedslinje\n"
#: scan.l:451
#, c-format
diff --git a/po/de.po b/po/de.po
index 48dbab7..75ee97e 100644
--- a/po/de.po
+++ b/po/de.po
@@ -1,13 +1,28 @@
-# German messages for flex
-# Copyright (C) 2007 The Flex Project (msgids)
-# This file is distributed under the same license as the flex package.
-# Michael Piefel <piefel@informatik.hu-berlin.de>, 2002, 2003, 2008, 2012
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR Free Software Foundation, Inc.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
+#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: flex 2.5.36\n"
-"Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2014-03-26 15:00-0400\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"PO-Revision-Date: 2016-01-22 13:34-0800\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#~ # German messages for flex
+#~ # Copyright (C) 2007 The Flex Project (msgids)
+#~ # This file is distributed under the same license as the flex package.
+#~ # Michael Piefel <piefel@informatik.hu-berlin.de>, 2002, 2003, 2008, 2012
+#~ #
+#~ msgid ""
+#~ msgstr ""
+#~ "Project-Id-Version: flex 2.5.36\n"
+#~ "Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n"
+"POT-Creation-Date: 2012-07-22 20:48-0400\n"
"PO-Revision-Date: 2012-08-03 13:42+0200\n"
"Last-Translator: Michael Piefel <piefel@informatik.hu-berlin.de>\n"
"Language-Team: German <translation-team-de@lists.sourceforge.net>\n"
@@ -173,367 +188,355 @@ msgstr "Konnte eoltbl nicht schreiben"
msgid "Could not write yynultrans_tbl"
msgstr "Konnte yynultrans_tbl nicht schreiben"
-#: main.c:191
+#: main.c:189
msgid "rule cannot be matched"
msgstr "Regel kann nicht passen"
-#: main.c:196
+#: main.c:194
msgid "-s option given but default rule can be matched"
msgstr "„-s“-Option gegeben, aber Vorgabe-Regel kann nicht passen"
-#: main.c:236
+#: main.c:234
msgid "Can't use -+ with -l option"
msgstr "Kann nicht „-+“ zusammen mit „-l“-Option verwenden"
-#: main.c:239
+#: main.c:237
msgid "Can't use -f or -F with -l option"
msgstr "Kann nicht „-f“ oder „-F“ zusammen mit „-l“-Option verwenden"
-#: main.c:243
+#: main.c:241
msgid "Can't use --reentrant or --bison-bridge with -l option"
-msgstr ""
-"Kann nicht „--reentrant“ oder „--bison-bridge“ mit „-l“-Option verwenden"
+msgstr "Kann nicht „--reentrant“ oder „--bison-bridge“ mit „-l“-Option verwenden"
-#: main.c:275
+#: main.c:278
msgid "-Cf/-CF and -Cm don't make sense together"
msgstr "„-Cf“/„-CF“ und „-Cm“ sind zusammen nicht sinnvoll"
-#: main.c:278
+#: main.c:281
msgid "-Cf/-CF and -I are incompatible"
msgstr "„-Cf“/„-CF“ und „-I“ sind inkompatibel"
-#: main.c:282
+#: main.c:285
msgid "-Cf/-CF are incompatible with lex-compatibility mode"
msgstr "„-Cf“/„-CF“ sind inkompatibel mit lex-Kompatibilitätsmodus"
-#: main.c:287
+#: main.c:290
msgid "-Cf and -CF are mutually exclusive"
msgstr "„-Cf“ und „-CF“ schließen sich gegenseitig aus"
-#: main.c:291
+#: main.c:294
msgid "Can't use -+ with -CF option"
msgstr "Kann nicht „-+“ zusammen mit „-CF“-Option verwenden"
-#: main.c:294
+#: main.c:297
#, c-format
msgid "%array incompatible with -+ option"
msgstr "„%array“ inkompatibel mit „-+“-Option"
-#: main.c:299
+#: main.c:302
msgid "Options -+ and --reentrant are mutually exclusive."
msgstr "Optionen „-+“ und „--reentrant“ schließen sich gegenseitig aus."
-#: main.c:302
+#: main.c:305
msgid "bison bridge not supported for the C++ scanner."
msgstr "Brücke zu Bison für den C++-Scanner nicht unterstützt."
-#: main.c:357 main.c:403
+#: main.c:360 main.c:406
#, c-format
msgid "could not create %s"
msgstr "konnte %s nicht erzeugen"
-#: main.c:416
+#: main.c:419
msgid "could not write tables header"
msgstr "konnte Tabellenköpfe nicht schreiben"
-#: main.c:420
+#: main.c:423
#, c-format
msgid "can't open skeleton file %s"
msgstr "kann Skelett-Datei %s nicht öffnen"
-#: main.c:456
+#: main.c:459
msgid "allocation of macro definition failed"
msgstr "Anlegen der Makrodefinition fehlgeschlagen"
-#: main.c:504
+#: main.c:507
#, c-format
msgid "input error reading skeleton file %s"
msgstr "Eingabefehler beim Lesen der Skelett-Datei %s"
-#: main.c:508
+#: main.c:511
#, c-format
msgid "error closing skeleton file %s"
msgstr "Fehler beim Schließen der Skelett-Datei %s"
-#: main.c:693
+#: main.c:696
#, c-format
msgid "error creating header file %s"
msgstr "Fehler beim Erstellen der Header-Datei %s"
-#: main.c:701
+#: main.c:704
#, c-format
msgid "error writing output file %s"
msgstr "Fehler beim Schreiben der Ausgabe-Datei %s"
-#: main.c:705
+#: main.c:708
#, c-format
msgid "error closing output file %s"
msgstr "Fehler beim Schließen der Ausgabe-Datei %s"
-#: main.c:709
+#: main.c:712
#, c-format
msgid "error deleting output file %s"
msgstr "Fehler beim Löschen der Ausgabe-Datei %s"
-#: main.c:716
+#: main.c:719
#, c-format
msgid "No backing up.\n"
msgstr "Kein Backing-up.\n"
-#: main.c:720
+#: main.c:723
#, c-format
msgid "%d backing up (non-accepting) states.\n"
msgstr "%d Zustände mit Backing-up (nicht akzeptierend).\n"
-#: main.c:724
+#: main.c:727
#, c-format
msgid "Compressed tables always back up.\n"
msgstr "Komprimierte Tabellen benutzen immer Backing-up.\n"
-#: main.c:727
+#: main.c:730
#, c-format
msgid "error writing backup file %s"
msgstr "Fehler beim Schreiben der Backup-Datei %s"
-#: main.c:731
+#: main.c:734
#, c-format
msgid "error closing backup file %s"
msgstr "Fehler beim Schließen der Backup-Datei %s"
-#: main.c:736
+#: main.c:739
#, c-format
msgid "%s version %s usage statistics:\n"
msgstr "%s Version %s Benutzungsstatistiken:\n"
-#: main.c:739
+#: main.c:742
#, c-format
msgid " scanner options: -"
msgstr " Scanner-Optionen: -"
-#: main.c:818
+#: main.c:821
#, c-format
msgid " %d/%d NFA states\n"
msgstr " %d/%d NFA-Zustände\n"
-#: main.c:820
+#: main.c:823
#, c-format
msgid " %d/%d DFA states (%d words)\n"
msgstr " %d/%d DFA-Zustände (%d Wörter)\n"
-#: main.c:822
+#: main.c:825
#, c-format
msgid " %d rules\n"
msgstr " %d Regeln\n"
-#: main.c:827
+#: main.c:830
#, c-format
msgid " No backing up\n"
msgstr " Kein Backing-up.\n"
-#: main.c:831
+#: main.c:834
#, c-format
msgid " %d backing-up (non-accepting) states\n"
msgstr " %d Zustände mit Backing-up (nicht akzeptierend).\n"
-#: main.c:836
+#: main.c:839
#, c-format
msgid " Compressed tables always back-up\n"
msgstr " Komprimierte Tabellen benutzen immer Backing-up.\n"
-#: main.c:840
+#: main.c:843
#, c-format
msgid " Beginning-of-line patterns used\n"
msgstr " Zeilenanfang-Muster benutzt\n"
-#: main.c:842
+#: main.c:845
#, c-format
msgid " %d/%d start conditions\n"
msgstr " %d/%d Startbedingungen\n"
-#: main.c:846
+#: main.c:849
#, c-format
msgid " %d epsilon states, %d double epsilon states\n"
msgstr " %d Epsilon-Zustände, %d Doppel-Epsilon-Zustände\n"
-#: main.c:850
+#: main.c:853
#, c-format
msgid " no character classes\n"
msgstr " keine Zeichenklassen\n"
-#: main.c:854
+#: main.c:857
#, c-format
msgid " %d/%d character classes needed %d/%d words of storage, %d reused\n"
-msgstr ""
-" %d/%d Zeichenklassen brauchten %d/%d Speicherwörter, %d wiederbenutzt\n"
+msgstr " %d/%d Zeichenklassen brauchten %d/%d Speicherwörter, %d wiederbenutzt\n"
-#: main.c:859
+#: main.c:862
#, c-format
msgid " %d state/nextstate pairs created\n"
msgstr " %d Zustand/Nächster-Zustand-Paare erzeugt\n"
-#: main.c:862
+#: main.c:865
#, c-format
msgid " %d/%d unique/duplicate transitions\n"
msgstr " %d/%d einzigartige/doppelte Übergänge\n"
-#: main.c:867
+#: main.c:870
#, c-format
msgid " %d table entries\n"
msgstr " %d Tabelleneinträge\n"
-#: main.c:875
+#: main.c:878
#, c-format
msgid " %d/%d base-def entries created\n"
msgstr " %d/%d Einträge „base-def“ erzeugt\n"
-#: main.c:879
+#: main.c:882
#, c-format
msgid " %d/%d (peak %d) nxt-chk entries created\n"
msgstr " %d/%d (max. %d) Einträge „nxt-chk“ erzeugt\n"
-#: main.c:883
+#: main.c:886
#, c-format
msgid " %d/%d (peak %d) template nxt-chk entries created\n"
msgstr " %d/%d (max. %d) Einträge „template nxt-chk“ erzeugt\n"
-#: main.c:887
+#: main.c:890
#, c-format
msgid " %d empty table entries\n"
msgstr " %d leere Tabelleneinträge\n"
-#: main.c:889
+#: main.c:892
#, c-format
msgid " %d protos created\n"
msgstr " %d Protos erzeugt\n"
-#: main.c:892
+#: main.c:895
#, c-format
msgid " %d templates created, %d uses\n"
msgstr " %d Schablonen erzeugt, %d Benutzungen\n"
-#: main.c:900
+#: main.c:903
#, c-format
msgid " %d/%d equivalence classes created\n"
msgstr " %d/%d Äquivalenz-Klassen erzeugt\n"
-#: main.c:908
+#: main.c:911
#, c-format
msgid " %d/%d meta-equivalence classes created\n"
msgstr " %d/%d Meta-Äquivalenz-Klassen erzeugt\n"
-#: main.c:914
+#: main.c:917
#, c-format
msgid " %d (%d saved) hash collisions, %d DFAs equal\n"
msgstr " %d (%d gespeichert) Hash-Kollisionen, %d DFAs gleich\n"
-#: main.c:916
+#: main.c:919
#, c-format
msgid " %d sets of reallocations needed\n"
msgstr " %d Sätze von Neuallozierungen benötigt\n"
-#: main.c:918
+#: main.c:921
#, c-format
msgid " %d total table entries needed\n"
msgstr " %d Tabelleneinträge insgesamt benötigt\n"
-#: main.c:995
+#: main.c:998
#, c-format
msgid "Internal error. flexopts are malformed.\n"
msgstr "Interner Fehler. flexopts sind missgestaltet.\n"
-#: main.c:1005
+#: main.c:1008
#, c-format
msgid "Try `%s --help' for more information.\n"
msgstr "Versuchen Sie es mit „%s --help“ für mehr Informationen.\n"
-#: main.c:1062
+#: main.c:1065
#, c-format
msgid "unknown -C option '%c'"
msgstr "unbekannte „-C“-Option „%c“"
-#: main.c:1191
+#: main.c:1194
#, c-format
msgid "%s %s\n"
msgstr "%s %s\n"
-#: main.c:1466
+#: main.c:1469
msgid "fatal parse error"
msgstr "fataler Parse-Fehler"
-#: main.c:1498
+#: main.c:1501
#, c-format
msgid "could not create backing-up info file %s"
msgstr "konnte Datei %s mit Informationen zum Backing-up nicht erzeugen"
-#: main.c:1519
+#: main.c:1522
#, c-format
msgid "-l AT&T lex compatibility option entails a large performance penalty\n"
-msgstr ""
-"-l AT&T-lex-Kompatibilitätsmodus führt zu großen Geschwindigkeitseinbußen\n"
+msgstr "-l AT&T-lex-Kompatibilitätsmodus führt zu großen Geschwindigkeitseinbußen\n"
-#: main.c:1522
+#: main.c:1525
#, c-format
msgid " and may be the actual source of other reported performance penalties\n"
-msgstr ""
-" und ist möglicherweise die wirkliche Quelle anderer gemeldeter Einbußen\n"
+msgstr " und ist möglicherweise die wirkliche Quelle anderer gemeldeter Einbußen\n"
-#: main.c:1528
+#: main.c:1531
#, c-format
-msgid ""
-"%%option yylineno entails a performance penalty ONLY on rules that can match "
-"newline characters\n"
-msgstr ""
-"%%option yylineno führt zu Geschwindigkeitseinbußen NUR für Regeln, die auf "
-"einen Zeilenvorschub passen können\n"
+msgid "%%option yylineno entails a performance penalty ONLY on rules that can match newline characters\n"
+msgstr "%%option yylineno führt zu Geschwindigkeitseinbußen NUR für Regeln, die auf einen Zeilenvorschub passen können\n"
-#: main.c:1535
+#: main.c:1538
#, c-format
msgid "-I (interactive) entails a minor performance penalty\n"
msgstr "-I (interaktiv) führt zu kleineren Geschwindigkeitseinbußen\n"
-#: main.c:1540
+#: main.c:1543
#, c-format
msgid "yymore() entails a minor performance penalty\n"
msgstr "yymore() führt zu kleineren Geschwindigkeitseinbußen\n"
-#: main.c:1546
+#: main.c:1549
#, c-format
msgid "REJECT entails a large performance penalty\n"
msgstr "REJECT führt zu großen Geschwindigkeitseinbußen\n"
-#: main.c:1551
+#: main.c:1554
#, c-format
msgid "Variable trailing context rules entail a large performance penalty\n"
-msgstr ""
-"Regeln mit variablem folgenden Kontext führen zu großen "
-"Geschwindigkeitseinbußen\n"
+msgstr "Regeln mit variablem folgenden Kontext führen zu großen Geschwindigkeitseinbußen\n"
-#: main.c:1563
+#: main.c:1566
msgid "REJECT cannot be used with -f or -F"
msgstr "REJECT kann nicht mit „-f“ oder „-F“ zusammen verwendet werden"
-#: main.c:1566
+#: main.c:1569
#, c-format
msgid "%option yylineno cannot be used with REJECT"
msgstr "%option yylineno kann nicht mit REJECT zusammen verwendet werden"
-#: main.c:1569
+#: main.c:1572
msgid "variable trailing context rules cannot be used with -f or -F"
-msgstr ""
-"Regeln mit variablem folgenden Kontext können nicht mit „-f“ oder „-F“ "
-"verwendet werden"
+msgstr "Regeln mit variablem folgenden Kontext können nicht mit „-f“ oder „-F“ verwendet werden"
-#: main.c:1692
+#: main.c:1695
#, c-format
msgid "%option yyclass only meaningful for C++ scanners"
msgstr "%option yyclass ist nur bei C++-Scannern sinnvoll"
-#: main.c:1799
+#: main.c:1802
#, c-format
msgid "Usage: %s [OPTIONS] [FILE]...\n"
msgstr "Aufruf: %s [OPTIONEN...] [DATEI...]\n"
-#: main.c:1802
+#: main.c:1805
#, c-format
msgid ""
"Generates programs that perform pattern-matching on text.\n"
@@ -563,8 +566,7 @@ msgid ""
" -S, --skel=FILE specify skeleton file\n"
" -t, --stdout write scanner on stdout instead of %s\n"
" --yyclass=NAME name of C++ class\n"
-" --header-file=FILE create a C header file in addition to the "
-"scanner\n"
+" --header-file=FILE create a C header file in addition to the scanner\n"
" --tables-file[=FILE] write tables to FILE\n"
"\n"
"Scanner behavior:\n"
@@ -601,36 +603,31 @@ msgstr ""
"Generiert Programme, die Mustererkennung in Texten durchführen.\n"
"\n"
"Tabellen-Komprimierung:\n"
-" -Ca, --align erzeuge größere Tabellen, aber bessere "
-"Speicherausrichtung\n"
+" -Ca, --align erzeuge größere Tabellen, aber bessere Speicherausrichtung\n"
" -Ce, --ecs konstruiere Äquivalenz-Klassen\n"
" -Cf komprimiere Tabellen nicht; benutze „-f“-Repräsentation\n"
" -CF komprimiere Tabellen nicht; benutze „-F“-Repräsentation\n"
" -Cm, --meta-ecs konstruiere Meta-Äquivalenz-Klassen\n"
" -Cr, --read benutze read() anstelle von stdio für Scannereingabe\n"
" -f, --full generiere schnellen, großen Scanner. Genau wie -Cfr\n"
-" -F, --fast benutze alternative Tabellenrepräsentation. Genau wie -"
-"CFr\n"
+" -F, --fast benutze alternative Tabellenrepräsentation. Genau wie -CFr\n"
" -Cem Voreinstellung (genau wie --ecs --meta-ecs)\n"
"\n"
"Fehlersuche:\n"
" -d, --debug Fehlersuch-(Debug-)Modus im Scanner aktivieren\n"
" -b, --backup schreibe Backing-up-Information in %s\n"
" -p, --perf-report schreibe Performanzbericht auf stderr\n"
-" -s, --nodefault unterdücke Standardregel ECHO für nicht passenden "
-"Text\n"
+" -s, --nodefault unterdücke Standardregel ECHO für nicht passenden Text\n"
" -T, --trace %s sollte im Trace-Modus laufen\n"
" -w, --nowarn generiere keine Warnungen\n"
-" -v, --verbose schreibe Zusammenfassung der Scannerstatistiken "
-"auf stdout\n"
+" -v, --verbose schreibe Zusammenfassung der Scannerstatistiken auf stdout\n"
"\n"
"Dateien:\n"
" -o, --outfile=DATEI Ausgabe-Dateiname\n"
" -S, --skel=DATEI Skelettdatei\n"
" -t, --stdout gib Scanner auf stdout anstelle von %s aus\n"
" --yyclass=NAME Name der C++-Klasse\n"
-" --header-file=DATEI erstelle eine C-Headerdatei zusätzlich zum "
-"Scanner\n"
+" --header-file=DATEI erstelle eine C-Headerdatei zusätzlich zum Scanner\n"
" --tables-file[=DATEI] schreibe Tabellen in DATEI\n"
"\n"
"Scannerverhalten:\n"
@@ -739,20 +736,20 @@ msgstr "leere Maschine in dupmachine()"
msgid "Variable trailing context rule at line %d\n"
msgstr "Regel mit veränderlichem folgenden Kontext in Zeile %d\n"
-#: nfa.c:364
+#: nfa.c:353
msgid "bad state type in mark_beginning_as_normal()"
msgstr "ungültiger Zustandstyp in mark_beginning_as_normal()"
-#: nfa.c:609
+#: nfa.c:598
#, c-format
msgid "input rules are too complicated (>= %d NFA states)"
msgstr "Eingaberegeln sind zu kompliziert (>= %d NFA-Zustände)"
-#: nfa.c:688
+#: nfa.c:677
msgid "found too many transitions in mkxtion()"
msgstr "zu viele Übergänge in mkxtion() gefunden"
-#: nfa.c:714
+#: nfa.c:703
#, c-format
msgid "too many rules (> %d)!"
msgstr "zu viele Regeln (> %d)!"
@@ -784,9 +781,7 @@ msgstr "Iterationswerte müssen positiv sein"
#: parse.y:804 parse.y:814
#, c-format
msgid "the character range [%c-%c] is ambiguous in a case-insensitive scanner"
-msgstr ""
-"der Zeichenbereich [%c-%c] ist in Scannern ohne Beachtung von Groß-/"
-"Kleinschreibung mehrdeutig"
+msgstr "der Zeichenbereich [%c-%c] ist in Scannern ohne Beachtung von Groß-/Kleinschreibung mehrdeutig"
#: parse.y:819
msgid "negative range in character class"
@@ -794,15 +789,11 @@ msgstr "negativer Bereich in Zeichenklasse"
#: parse.y:916
msgid "[:^lower:] is ambiguous in case insensitive scanner"
-msgstr ""
-"[:^lower:] ist in Scannern ohne Beachtung von Groß-/Kleinschreibung "
-"mehrdeutig"
+msgstr "[:^lower:] ist in Scannern ohne Beachtung von Groß-/Kleinschreibung mehrdeutig"
#: parse.y:922
msgid "[:^upper:] ambiguous in case insensitive scanner"
-msgstr ""
-"[:^upper:] ist in Scannern ohne Beachtung von Groß-/Kleinschreibung "
-"mehrdeutig"
+msgstr "[:^upper:] ist in Scannern ohne Beachtung von Groß-/Kleinschreibung mehrdeutig"
#: scan.l:75 scan.l:618 scan.l:676
msgid "Input line too long\n"
diff --git a/po/eo.po b/po/eo.po
index fe68f9b..67a9973 100644
--- a/po/eo.po
+++ b/po/eo.po
@@ -1,13 +1,28 @@
-# Esperanto translation
-# Copyright © 2008 The Flex Project (msgids)
-# This file is distributed under the same license as the flex package.
-# Felipe Castro <fefcas@gmail.com>, 2012.
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR Free Software Foundation, Inc.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
+#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: flex 2.5.37\n"
-"Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2014-03-26 15:00-0400\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"PO-Revision-Date: 2016-01-22 13:33-0800\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#~ # Esperanto translation
+#~ # Copyright © 2008 The Flex Project (msgids)
+#~ # This file is distributed under the same license as the flex package.
+#~ # Felipe Castro <fefcas@gmail.com>, 2012.
+#~ #
+#~ msgid ""
+#~ msgstr ""
+#~ "Project-Id-Version: flex 2.5.37\n"
+#~ "Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n"
+"POT-Creation-Date: 2012-07-22 20:48-0400\n"
"PO-Revision-Date: 2012-09-08 07:15-0300\n"
"Last-Translator: Felipe Castro <fefcas@gmail.com>\n"
"Language-Team: Esperanto <translation-team-eo@lists.sourceforge.net>\n"
@@ -173,363 +188,355 @@ msgstr "Ne eblis skribi eoltbl"
msgid "Could not write yynultrans_tbl"
msgstr "Ne eblis skribi yynultrans_tbl"
-#: main.c:191
+#: main.c:189
msgid "rule cannot be matched"
msgstr "regulo ne povas esti korespondata"
-#: main.c:196
+#: main.c:194
msgid "-s option given but default rule can be matched"
-msgstr ""
-"la modifilo -s estis indikata sed la apriora regulo povas esti korespondata"
+msgstr "la modifilo -s estis indikata sed la apriora regulo povas esti korespondata"
-#: main.c:236
+#: main.c:234
msgid "Can't use -+ with -l option"
msgstr "Ne eblas uzi -+ kun la modifilo -l"
-#: main.c:239
+#: main.c:237
msgid "Can't use -f or -F with -l option"
msgstr "Ne eblas uzi -f aŭ -F kun la modifilo -l"
-#: main.c:243
+#: main.c:241
msgid "Can't use --reentrant or --bison-bridge with -l option"
msgstr "Ne eblas uzi --reentrant aÅ­ --bison-bridge kun la modifilo -l"
-#: main.c:275
+#: main.c:278
msgid "-Cf/-CF and -Cm don't make sense together"
msgstr "Sensencas -Cf/-CF kaj -Cm kune"
-#: main.c:278
+#: main.c:281
msgid "-Cf/-CF and -I are incompatible"
msgstr "-Cf/-CF kaj -I malakordas"
-#: main.c:282
+#: main.c:285
msgid "-Cf/-CF are incompatible with lex-compatibility mode"
msgstr "-Cf/-CF malakordas kun lex-akorda reÄimo"
-#: main.c:287
+#: main.c:290
msgid "-Cf and -CF are mutually exclusive"
msgstr "-Cf kaj -CF estas reciproke ekskluzivaj"
-#: main.c:291
+#: main.c:294
msgid "Can't use -+ with -CF option"
msgstr "Ne eblas uzi -+ kun la modifilo -CF"
-#: main.c:294
+#: main.c:297
#, c-format
msgid "%array incompatible with -+ option"
msgstr "%array malakordas kun modifilo -+"
-#: main.c:299
+#: main.c:302
msgid "Options -+ and --reentrant are mutually exclusive."
msgstr "Modifiloj -+ kaj --reentrant estas reciproke ekskluzivaj."
-#: main.c:302
+#: main.c:305
msgid "bison bridge not supported for the C++ scanner."
msgstr "bison-ponto ne estas subtenata por la skanilo C++."
-#: main.c:357 main.c:403
+#: main.c:360 main.c:406
#, c-format
msgid "could not create %s"
msgstr "ne eblis krei %s"
-#: main.c:416
+#: main.c:419
msgid "could not write tables header"
msgstr "ne eblis skribi tabel-kapojn"
-#: main.c:420
+#: main.c:423
#, c-format
msgid "can't open skeleton file %s"
msgstr "ne eblas malfermi la skeletan dosieron %s"
-#: main.c:456
+#: main.c:459
msgid "allocation of macro definition failed"
msgstr "rezervo de makroa difino fiaskis"
-#: main.c:504
+#: main.c:507
#, c-format
msgid "input error reading skeleton file %s"
msgstr "eniga eraro dum lego de la skeleta dosiero %s"
-#: main.c:508
+#: main.c:511
#, c-format
msgid "error closing skeleton file %s"
msgstr "eraro dum fermo de la skeleta dosiero %s"
-#: main.c:693
+#: main.c:696
#, c-format
msgid "error creating header file %s"
msgstr "eraro dum kreo de la kap-dosiero %s"
-#: main.c:701
+#: main.c:704
#, c-format
msgid "error writing output file %s"
msgstr "eraro dum skribo de la eliga dosiero %s"
-#: main.c:705
+#: main.c:708
#, c-format
msgid "error closing output file %s"
msgstr "eraro dum fermo de la eliga dosiero %s"
-#: main.c:709
+#: main.c:712
#, c-format
msgid "error deleting output file %s"
msgstr "eraro dum forigo de eliga dosiero %s"
-#: main.c:716
+#: main.c:719
#, c-format
msgid "No backing up.\n"
msgstr "Sen savkopiado.\n"
-#: main.c:720
+#: main.c:723
#, c-format
msgid "%d backing up (non-accepting) states.\n"
msgstr "%d savkopiadas (ne-akceptantajn) statojn.\n"
-#: main.c:724
+#: main.c:727
#, c-format
msgid "Compressed tables always back up.\n"
msgstr "Densigitaj tabeloj ĉiam estas savkopiataj.\n"
-#: main.c:727
+#: main.c:730
#, c-format
msgid "error writing backup file %s"
msgstr "eraro dum skribo de la savkopia dosiero %s"
-#: main.c:731
+#: main.c:734
#, c-format
msgid "error closing backup file %s"
msgstr "eraro dum fermo de la savkopia dosiero %s"
-#: main.c:736
+#: main.c:739
#, c-format
msgid "%s version %s usage statistics:\n"
msgstr "%s versio %s statistikoj pri usado:\n"
-#: main.c:739
+#: main.c:742
#, c-format
msgid " scanner options: -"
msgstr " skanilaj modifiloj: -"
-#: main.c:818
+#: main.c:821
#, c-format
msgid " %d/%d NFA states\n"
msgstr " %d/%d statoj NFA\n"
-#: main.c:820
+#: main.c:823
#, c-format
msgid " %d/%d DFA states (%d words)\n"
msgstr " %d/%d statoj DFA (%d vortoj)\n"
-#: main.c:822
+#: main.c:825
#, c-format
msgid " %d rules\n"
msgstr " %d reguloj\n"
-#: main.c:827
+#: main.c:830
#, c-format
msgid " No backing up\n"
msgstr " Sen savkopiado\n"
-#: main.c:831
+#: main.c:834
#, c-format
msgid " %d backing-up (non-accepting) states\n"
msgstr " %d savkopianta (ne-akceptantajn) statojn\n"
-#: main.c:836
+#: main.c:839
#, c-format
msgid " Compressed tables always back-up\n"
msgstr " Densigitaj tabeloj ĉiam savkopiite\n"
-#: main.c:840
+#: main.c:843
#, c-format
msgid " Beginning-of-line patterns used\n"
msgstr " modeloj komenco-de-linio estas uzataj\n"
-#: main.c:842
+#: main.c:845
#, c-format
msgid " %d/%d start conditions\n"
msgstr " %d/%d komencaj kondiĉoj\n"
-#: main.c:846
+#: main.c:849
#, c-format
msgid " %d epsilon states, %d double epsilon states\n"
msgstr " %d epsilonaj statoj, %d duoblaj epsilonaj statoj\n"
-#: main.c:850
+#: main.c:853
#, c-format
msgid " no character classes\n"
msgstr " neniu signo-klaso\n"
-#: main.c:854
+#: main.c:857
#, c-format
msgid " %d/%d character classes needed %d/%d words of storage, %d reused\n"
msgstr " %d/%d signo-klasoj bezonis %d/%d vortojn da memoro, %d reuzitaj\n"
-#: main.c:859
+#: main.c:862
#, c-format
msgid " %d state/nextstate pairs created\n"
msgstr " %d stato/sekvstato-paroj estis kreataj\n"
-#: main.c:862
+#: main.c:865
#, c-format
msgid " %d/%d unique/duplicate transitions\n"
msgstr " %d/%d unikaj/duobligitaj transigoj\n"
-#: main.c:867
+#: main.c:870
#, c-format
msgid " %d table entries\n"
msgstr " %d tabel-enigoj\n"
-#: main.c:875
+#: main.c:878
#, c-format
msgid " %d/%d base-def entries created\n"
msgstr " %d/%d bazo-def enigoj estis kreataj\n"
-#: main.c:879
+#: main.c:882
#, c-format
msgid " %d/%d (peak %d) nxt-chk entries created\n"
msgstr " %d/%d (pinto %d) enigoj nxt-chk estis kreataj\n"
-#: main.c:883
+#: main.c:886
#, c-format
msgid " %d/%d (peak %d) template nxt-chk entries created\n"
msgstr " %d/%d (pinto %d) Åablonaj enigoj nxt-chk estis kreataj\n"
-#: main.c:887
+#: main.c:890
#, c-format
msgid " %d empty table entries\n"
msgstr " %d malplenaj tabel-enigoj\n"
-#: main.c:889
+#: main.c:892
#, c-format
msgid " %d protos created\n"
msgstr " %d protoj estis kreataj\n"
-#: main.c:892
+#: main.c:895
#, c-format
msgid " %d templates created, %d uses\n"
msgstr " %d Åablonoj estis kreataj, %d uzoj\n"
-#: main.c:900
+#: main.c:903
#, c-format
msgid " %d/%d equivalence classes created\n"
msgstr " %d/%d ekvivalento-klasoj estis kreataj\n"
-#: main.c:908
+#: main.c:911
#, c-format
msgid " %d/%d meta-equivalence classes created\n"
msgstr " %d/%d metaekvivalento-klasoj estis kreataj\n"
-#: main.c:914
+#: main.c:917
#, c-format
msgid " %d (%d saved) hash collisions, %d DFAs equal\n"
msgstr " %d (%d konservitaj) haketaj kolizioj, %d DFA egalaj\n"
-#: main.c:916
+#: main.c:919
#, c-format
msgid " %d sets of reallocations needed\n"
msgstr " %d aroj de relokigoj estas bezonataj\n"
-#: main.c:918
+#: main.c:921
#, c-format
msgid " %d total table entries needed\n"
msgstr " entute %d tabel-enigoj estas bezonataj\n"
-#: main.c:995
+#: main.c:998
#, c-format
msgid "Internal error. flexopts are malformed.\n"
msgstr "Interna eraro. 'flexopt' estas misformitaj.\n"
-#: main.c:1005
+#: main.c:1008
#, c-format
msgid "Try `%s --help' for more information.\n"
msgstr "Provu '%s --help' por pli da informo.\n"
-#: main.c:1062
+#: main.c:1065
#, c-format
msgid "unknown -C option '%c'"
msgstr "nekonata modifilo -C '%c'"
-#: main.c:1191
+#: main.c:1194
#, c-format
msgid "%s %s\n"
msgstr "%s %s\n"
-#: main.c:1466
+#: main.c:1469
msgid "fatal parse error"
msgstr "neriparebla analiz-eraro"
-#: main.c:1498
+#: main.c:1501
#, c-format
msgid "could not create backing-up info file %s"
msgstr "ne eblis krei savkopiad-informan dosieron %s"
-#: main.c:1519
+#: main.c:1522
#, c-format
msgid "-l AT&T lex compatibility option entails a large performance penalty\n"
-msgstr ""
-"La modifilo -l AT&T de akordigo al lex alportas grandan malaltigon de "
-"rendimento\n"
+msgstr "La modifilo -l AT&T de akordigo al lex alportas grandan malaltigon de rendimento\n"
-#: main.c:1522
+#: main.c:1525
#, c-format
msgid " and may be the actual source of other reported performance penalties\n"
-msgstr ""
-" kaj povas esti la vera fonto de aliaj raportitaj malaltigoj de rendimento\n"
+msgstr " kaj povas esti la vera fonto de aliaj raportitaj malaltigoj de rendimento\n"
-#: main.c:1528
+#: main.c:1531
#, c-format
-msgid ""
-"%%option yylineno entails a performance penalty ONLY on rules that can match "
-"newline characters\n"
-msgstr ""
-"%%option yylineno alportas malaltigon de rendimento NUR kun reguloj kiuj "
-"povas akordiÄi kun novliniaj signoj\n"
+msgid "%%option yylineno entails a performance penalty ONLY on rules that can match newline characters\n"
+msgstr "%%option yylineno alportas malaltigon de rendimento NUR kun reguloj kiuj povas akordiÄi kun novliniaj signoj\n"
-#: main.c:1535
+#: main.c:1538
#, c-format
msgid "-I (interactive) entails a minor performance penalty\n"
msgstr "-I (interage) alportas etan malaltigon de rendimento\n"
-#: main.c:1540
+#: main.c:1543
#, c-format
msgid "yymore() entails a minor performance penalty\n"
msgstr "yymore() alportas etan malaltigon de rendimento\n"
-#: main.c:1546
+#: main.c:1549
#, c-format
msgid "REJECT entails a large performance penalty\n"
msgstr "REJECT alportas grandan malaltigon de rendimento\n"
-#: main.c:1551
+#: main.c:1554
#, c-format
msgid "Variable trailing context rules entail a large performance penalty\n"
msgstr "Variabla vosta kunteksto alportas grandan malaltigon de rendimento\n"
-#: main.c:1563
+#: main.c:1566
msgid "REJECT cannot be used with -f or -F"
msgstr "REJECT ne povas esti uzata kun -f aÅ­ F"
-#: main.c:1566
+#: main.c:1569
#, c-format
msgid "%option yylineno cannot be used with REJECT"
msgstr "%option yylineno ne povas esti uzata kun REJECT"
-#: main.c:1569
+#: main.c:1572
msgid "variable trailing context rules cannot be used with -f or -F"
msgstr "variablaj vostaj kuntekstaj reguloj ne povas esti uzataj kun -f aÅ­ F"
-#: main.c:1692
+#: main.c:1695
#, c-format
msgid "%option yyclass only meaningful for C++ scanners"
msgstr "%option yyclass nur koheras por skaniloj C++"
-#: main.c:1799
+#: main.c:1802
#, c-format
msgid "Usage: %s [OPTIONS] [FILE]...\n"
msgstr "Uzado: %s [MODIFILOJ] [DOSIERO]...\n"
-#: main.c:1802
+#: main.c:1805
#, c-format
msgid ""
"Generates programs that perform pattern-matching on text.\n"
@@ -559,8 +566,7 @@ msgid ""
" -S, --skel=FILE specify skeleton file\n"
" -t, --stdout write scanner on stdout instead of %s\n"
" --yyclass=NAME name of C++ class\n"
-" --header-file=FILE create a C header file in addition to the "
-"scanner\n"
+" --header-file=FILE create a C header file in addition to the scanner\n"
" --tables-file[=FILE] write tables to FILE\n"
"\n"
"Scanner behavior:\n"
@@ -597,8 +603,7 @@ msgstr ""
"Generas programojn kiuj prilaboras modelo-kongruon en tekstoj.\n"
"\n"
"Tabela Densigo:\n"
-" -Ca, --align prilaboras pli grandajn tabelojn por pli bone organizi "
-"memoron\n"
+" -Ca, --align prilaboras pli grandajn tabelojn por pli bone organizi memoron\n"
" -Ce, --ecs konstrui ekvivalento-klasojn\n"
" -Cf ne densigi tabelojn; uzi reprezenton -f\n"
" -CF ne densigi tabelojn; uzi reprezenton -F\n"
@@ -612,12 +617,10 @@ msgstr ""
" -d, --debug ebligi rafinigan reÄimon en la skanilo\n"
" -b, --backup skribi savkopian informon al %s\n"
" -p, --perf-report skribi raporton pri rendimento al 'stderr'\n"
-" -s, --nodefault demeti aprioran regulon por EĤIGI nekongruan "
-"tekston\n"
+" -s, --nodefault demeti aprioran regulon por EĤIGI nekongruan tekston\n"
" -T, --trace %s devos funkcii sub spura reÄimo\n"
" -w, --nowarn ne generi avertojn\n"
-" -v, --verbose skribi resumon de la skanilaj statistikoj al "
-"'stdout'\n"
+" -v, --verbose skribi resumon de la skanilaj statistikoj al 'stdout'\n"
"\n"
"Dosieroj:\n"
" -o, --outfile=DOSIERO indiki eligan dosiernomon\n"
@@ -639,8 +642,7 @@ msgstr ""
"\n"
"Generata kodumaĵo:\n"
" -+, --c++ generi klason de skanilo C++\n"
-" -Dmacro[=defn] uzi #define por makroo defn (apriora defn estas "
-"'1')\n"
+" -Dmacro[=defn] uzi #define por makroo defn (apriora defn estas '1')\n"
" -L, --noline demeti instrukciojn #line en la skanilo\n"
" -P, --prefix=ĈENO uzi ĈENOn kiel prefikson anstataŭ \"yy\"\n"
" -R, --reentrant generi reenigan skanilon C\n"
@@ -733,20 +735,20 @@ msgstr "malplena maÅino en dupmachine()"
msgid "Variable trailing context rule at line %d\n"
msgstr "Variabla vosta kunteksta regulo ĉe linio %d\n"
-#: nfa.c:364
+#: nfa.c:353
msgid "bad state type in mark_beginning_as_normal()"
msgstr "malÄusta stat-tipo en mark_beginning_as_normal()"
-#: nfa.c:609
+#: nfa.c:598
#, c-format
msgid "input rules are too complicated (>= %d NFA states)"
msgstr "enigaj reguloj estas tro komplikaj (>= %d statoj NFA)"
-#: nfa.c:688
+#: nfa.c:677
msgid "found too many transitions in mkxtion()"
msgstr "tro multe da transigoj estis trovataj en mkxtion()"
-#: nfa.c:714
+#: nfa.c:703
#, c-format
msgid "too many rules (> %d)!"
msgstr "tro multe da reguoloj (> %d)!"
diff --git a/po/es.po b/po/es.po
index 872a5ee..eabb042 100644
--- a/po/es.po
+++ b/po/es.po
@@ -1,59 +1,53 @@
-# Mensajes en español para GNU flex.
-# Copyright (C) 2002 The Flex Project
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR Free Software Foundation, Inc.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
-# Nicolás García-Pedrajas <ngarcia-pedrajas@acm.org>, 1997.
-# Gracias a Nicolás Fernández García que me ha sugerido algunas ideas.
+#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: GNU flex 2.5.8\n"
-"Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2014-03-26 15:00-0400\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"PO-Revision-Date: 2016-01-22 13:32-0800\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#~ # Mensajes en español para GNU flex.
+#~ # Copyright (C) 2002 The Flex Project
+#~ #
+#~ # Nicolás García-Pedrajas <ngarcia-pedrajas@acm.org>, 1997.
+#~ # Gracias a Nicolás Fernández García que me ha sugerido algunas ideas.
+#~ msgid ""
+#~ msgstr ""
+#~ "Project-Id-Version: GNU flex 2.5.8\n"
+"POT-Creation-Date: 2002-06-19 09:43-0400\n"
"PO-Revision-Date: 2003-01-02 12:06+0100\n"
"Last-Translator: Nicolás García-Pedrajas <ngarcia-pedrajas@acm.org>\n"
"Language-Team: Spanish <es@li.org>\n"
-"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=ISO-8859-1\n"
"Content-Transfer-Encoding: 8-bit\n"
-#: buf.c:78
-msgid "Allocation of buffer to print string failed"
-msgstr ""
-
-#: buf.c:100
-msgid "Allocation of buffer for line directive failed"
-msgstr ""
-
-#: buf.c:177
-msgid "Allocation of buffer for m4 def failed"
-msgstr ""
-
-#: buf.c:197
-msgid "Allocation of buffer for m4 undef failed"
-msgstr ""
-
# El estado (?) sv
-#: dfa.c:61
+#: dfa.c:64
#, c-format
msgid "State #%d is non-accepting -\n"
msgstr "El estado #%d es no-aceptar -\n"
-#: dfa.c:124
+#: dfa.c:131
msgid "dangerous trailing context"
msgstr "contexto posterior peligroso"
-#: dfa.c:166
-#, c-format
+#: dfa.c:174
msgid " associated rule line numbers:"
msgstr " números de línea asociados a la regla:"
-#: dfa.c:202
-#, c-format
+#: dfa.c:212
msgid " out-transitions: "
msgstr " fin de transiciones: "
-#: dfa.c:210
-#, c-format
+#: dfa.c:220
msgid ""
"\n"
" jam-transitions: EOF "
@@ -72,13 +66,13 @@ msgstr ""
# pues el verbo es testar, ¿cómo te suena? ng+
#
# Sugiero usar prueba o comprobación. sv
-#: dfa.c:341
+#: dfa.c:357
msgid "consistency check failed in epsclosure()"
msgstr "el teste de consistencia falló en `epsclosure()'"
# ¿Qué tal volcado? em
# ok, a mí tampoco me gustaba descarga ng
-#: dfa.c:429
+#: dfa.c:443
msgid ""
"\n"
"\n"
@@ -90,24 +84,27 @@ msgstr ""
"Volcado AFD:\n"
"\n"
-#: dfa.c:604
+#: dfa.c:589
msgid "could not create unique end-of-buffer state"
msgstr "no se pudo crear un estado único de final-de-buffer"
-#: dfa.c:625
+#: dfa.c:610
#, c-format
msgid "state # %d:\n"
msgstr "estado # %d:\n"
-#: dfa.c:785
-msgid "Could not write yynxt_tbl[][]"
-msgstr ""
+# Te he corregido un error de tecleo, y puesto entre comillas
+# la llamada a la función em
+# ok, lo de las comillas no lo sabía ng
+#: dfa.c:994
+msgid "consistency check failed in symfollowset"
+msgstr "falló el test de consistencia en `symfollowset'"
-#: dfa.c:1049
+#: dfa.c:1047
msgid "bad transition character detected in sympartition()"
msgstr "carácter de transición erróneo detectado en sympartition()"
-#: gen.c:478
+#: gen.c:251
msgid ""
"\n"
"\n"
@@ -119,32 +116,19 @@ msgstr ""
"Clases de equivalencia:\n"
"\n"
-#: gen.c:662 gen.c:691 gen.c:1215
+#: gen.c:429 gen.c:913
#, c-format
msgid "state # %d accepts: [%d]\n"
msgstr "el estado # %d acepta: [%d]\n"
-#: gen.c:1110
+#: gen.c:834
#, c-format
msgid "state # %d accepts: "
msgstr "el estado # %d acepta: "
-#: gen.c:1157
-msgid "Could not write yyacclist_tbl"
-msgstr ""
-
-#: gen.c:1233
-msgid "Could not write yyacc_tbl"
-msgstr ""
-
-#: gen.c:1248 gen.c:1633 gen.c:1656
-#, fuzzy
-msgid "Could not write ecstbl"
-msgstr "no se pudo crear %s"
-
# ¿No sería mejor "MetaEquivalencia" o "Meta-Equivalencia"? sv
# yo prefiero como está, es el mismo caso de metafísica ng+
-#: gen.c:1271
+#: gen.c:936
msgid ""
"\n"
"\n"
@@ -154,46 +138,6 @@ msgstr ""
"\n"
"Clases de metaequivalencia:\n"
-#: gen.c:1293
-msgid "Could not write yymeta_tbl"
-msgstr ""
-
-#: gen.c:1354
-#, fuzzy
-msgid "Could not write yybase_tbl"
-msgstr "no se pudo crear %s"
-
-#: gen.c:1388
-msgid "Could not write yydef_tbl"
-msgstr ""
-
-#: gen.c:1428
-msgid "Could not write yynxt_tbl"
-msgstr ""
-
-#: gen.c:1464
-msgid "Could not write yychk_tbl"
-msgstr ""
-
-#: gen.c:1618 gen.c:1647
-#, fuzzy
-msgid "Could not write ftbl"
-msgstr "no se pudo crear %s"
-
-#: gen.c:1624
-#, fuzzy
-msgid "Could not write ssltbl"
-msgstr "no se pudo crear %s"
-
-#: gen.c:1675
-#, fuzzy
-msgid "Could not write eoltbl"
-msgstr "no se pudo crear %s"
-
-#: gen.c:1735
-msgid "Could not write yynultrans_tbl"
-msgstr ""
-
# ¿coincidencia?, es la traducción habitual em
# La traducción de match no me gusta pero no encuentro otra
# Sugerencia: satisface, encaja, es aplicable. sv
@@ -201,33 +145,35 @@ msgstr ""
# abierta con una cerrada, por ejemplo, pero no cuando se trata de ver
# si una regla "matches" o no "matches".
# creo que aplicar no qeuda mal ng+
-#: main.c:191
+#: main.c:163
msgid "rule cannot be matched"
msgstr "la regla no se puede aplicar"
# ## re-redacto el mensaje. sv
-#: main.c:196
+#: main.c:168
msgid "-s option given but default rule can be matched"
-msgstr ""
-"se ha especificado la opción -s pero se puede aplicar la regla por defecto"
+msgstr "se ha especificado la opción -s pero se puede aplicar la regla por defecto"
-#: main.c:236
+#: main.c:203
msgid "Can't use -+ with -l option"
msgstr "No se puede usar -+ con la opción -l"
-#: main.c:239
+#: main.c:206
msgid "Can't use -f or -F with -l option"
msgstr "No se pueden usar las opciones -f o -F con la opción -l"
-#: main.c:243
-#, fuzzy
-msgid "Can't use --reentrant or --bison-bridge with -l option"
+#: main.c:209
+msgid "Can't use -R or -Rb with -l option"
msgstr "No se pueden usar las opciones -R o -Rb con la opción -l"
+#: main.c:223
+msgid "Can't specify header option if writing to stdout."
+msgstr "No se puede especificar una opción de cabecera si se escribe en stdout"
+
# ¿juntos o juntas?
# Creo que está bien así em
# ok ng
-#: main.c:275
+#: main.c:249
msgid "-Cf/-CF and -Cm don't make sense together"
msgstr "-Cf/-CF y -Cm no tienen sentido juntos"
@@ -236,59 +182,50 @@ msgstr "-Cf/-CF y -Cm no tienen sentido juntos"
# entonces lo dejo ng
# Yo creo que en este caso no hace falta porque se leería así:
# "menos ce efe o menos ce efe mayúscula y menos I son incompatibles". sv
-#: main.c:278
+#: main.c:252
msgid "-Cf/-CF and -I are incompatible"
msgstr "-Cf/-CF e -I son incompatibles"
-#: main.c:282
+#: main.c:256
msgid "-Cf/-CF are incompatible with lex-compatibility mode"
msgstr "-Cf/-CF son incompatibles con el modo de compatibilidad con lex"
-#: main.c:287
+#: main.c:260
+#, c-format
+msgid "-Cf/-CF and %option yylineno are incompatible"
+msgstr "-Cf/-CF y la %opción yylineno son incompatibles"
+
+#: main.c:263
msgid "-Cf and -CF are mutually exclusive"
msgstr "-Cf y -CF son mutuamente excluyentes"
-#: main.c:291
+#: main.c:267
msgid "Can't use -+ with -CF option"
msgstr "No se puede usar -+ con la opción -CF"
-#: main.c:294
+#: main.c:271
#, c-format
msgid "%array incompatible with -+ option"
msgstr "%array incompatible con la opción -+"
-#: main.c:299
-#, fuzzy
-msgid "Options -+ and --reentrant are mutually exclusive."
+#: main.c:276
+msgid "Options -+ and -R are mutually exclusive."
msgstr "-+ y -R son mutuamente excluyentes"
-#: main.c:302
-msgid "bison bridge not supported for the C++ scanner."
-msgstr ""
-
-#: main.c:357 main.c:403
+#: main.c:328 main.c:524
#, c-format
msgid "could not create %s"
msgstr "no se pudo crear %s"
-#: main.c:416
-#, fuzzy
-msgid "could not write tables header"
-msgstr "no se pudo crear %s"
-
# Lo mismo con skeleton, máscara o modelo em
# lo mismo de antes ng
# Lo mismo que antes :) em
# idem ng+
-#: main.c:420
+#: main.c:334
#, c-format
msgid "can't open skeleton file %s"
msgstr "no se puede abrir el archivo de esquema %s"
-#: main.c:456
-msgid "allocation of macro definition failed"
-msgstr ""
-
# Skeleton se puede traducir por máscara, o por modelo em
# Sí, lo estuve considerando. Pero el eskeleton file es un fichero que
# le indica a flex la forma como tratar el fichero de entrada, y por eso me
@@ -305,46 +242,45 @@ msgstr ""
# que decida una tercera persona
#
# ## Cambio "leyendo" por "al leer", como en otras traducciones. sv
-#: main.c:504
+#: main.c:492
#, c-format
msgid "input error reading skeleton file %s"
msgstr "error de entrada al leer el archivo de esquema %s"
# Otra vez :) em
-#: main.c:508
+#: main.c:496
#, c-format
msgid "error closing skeleton file %s"
msgstr "error al cerrar el archivo de esquema %s"
# Lo mismo, archivo de seguridad? em
-#: main.c:693
+#: main.c:690
#, c-format
msgid "error creating header file %s"
msgstr "error al crear el archivo de cabecera %s"
-#: main.c:701
+#: main.c:698
#, c-format
msgid "error writing output file %s"
msgstr "error al escribir el archivo de salida %s"
-#: main.c:705
+#: main.c:702
#, c-format
msgid "error closing output file %s"
msgstr "error al cerrar el archivo de salida %s"
-#: main.c:709
+#: main.c:706
#, c-format
msgid "error deleting output file %s"
msgstr "error al borrar el archivo de salida %s"
# Copia de seguridad? em
# Sugerencia: No hay retroceso. sv
-#: main.c:716
-#, c-format
+#: main.c:714
msgid "No backing up.\n"
msgstr "Sin retroceso.\n"
-#: main.c:720
+#: main.c:717
#, c-format
msgid "%d backing up (non-accepting) states.\n"
msgstr "%d estados de retroceso (no-aceptación).\n"
@@ -354,13 +290,12 @@ msgstr "%d estados de retroceso (no-aceptación).\n"
# "Compressed tables are always back up"
# (supuesto que back es irregular y su pasado/participio es back y no backed,
# que ahora mismo no me acuerdo). sv
-#: main.c:724
-#, c-format
+#: main.c:721
msgid "Compressed tables always back up.\n"
msgstr "Las tablas comprimidas siempre implican un retraso.\n"
# Lo mismo, archivo de seguridad? em
-#: main.c:727
+#: main.c:724
#, c-format
msgid "error writing backup file %s"
msgstr "error al escribir el archivo de seguridad %s"
@@ -368,47 +303,45 @@ msgstr "error al escribir el archivo de seguridad %s"
# En todas las traducciones que ha aparecido
# he sugerido el uso de copia de seguridad em
# ok ng
-#: main.c:731
+#: main.c:728
#, c-format
msgid "error closing backup file %s"
msgstr "error al cerrar el archivo de copia de seguridad %s"
-#: main.c:736
+#: main.c:734
#, c-format
msgid "%s version %s usage statistics:\n"
msgstr "%s versión %s estadísticas de uso:\n"
-#: main.c:739
-#, c-format
+#: main.c:737
msgid " scanner options: -"
msgstr " opciones del analizador: -"
# NFA significa non-deterministic finite automata, así que lo he traducido
# por AFN
-#: main.c:818
+#: main.c:817
#, c-format
msgid " %d/%d NFA states\n"
msgstr " %d/%d estados AFN\n"
# DFA significa deterministic finite autómata, lo he traducido por AFD
-#: main.c:820
+#: main.c:819
#, c-format
msgid " %d/%d DFA states (%d words)\n"
msgstr " %d/%d estados AFD {%d palabras}\n"
-#: main.c:822
+#: main.c:821
#, c-format
msgid " %d rules\n"
msgstr " %d reglas\n"
# Otra vez ;) em
# modificado como en la anterior ng
-#: main.c:827
-#, c-format
+#: main.c:825
msgid " No backing up\n"
msgstr " Sin retroceso\n"
-#: main.c:831
+#: main.c:828
#, c-format
msgid " %d backing-up (non-accepting) states\n"
msgstr " %d estados de retroceso (no-aceptación)\n"
@@ -416,18 +349,16 @@ msgstr " %d estados de retroceso (no-aceptación)\n"
# FIXME.
# Informar al autor de que esta frase es casi idéntica a una anterior, para
# que sólo haya que traducirla una vez. sv
-#: main.c:836
-#, c-format
+#: main.c:832
msgid " Compressed tables always back-up\n"
msgstr " Siempre se realiza copia de seguridad de las tablas comprimidas\n"
# Lo mismo "se han usado patrones de comienzo de línea". sv
-#: main.c:840
-#, c-format
+#: main.c:836
msgid " Beginning-of-line patterns used\n"
msgstr " Usados patrones de comienzo-de-línea\n"
-#: main.c:842
+#: main.c:838
#, c-format
msgid " %d/%d start conditions\n"
msgstr " %d/%d condiciones de activación\n"
@@ -440,17 +371,16 @@ msgstr " %d/%d condiciones de activación\n"
# lo de doble épsilon no lo he oído nunca. Creo que hay que dejar el término
# técnico. ng
# Tu mandas, no tengo nada que decir a eso em
-#: main.c:846
+#: main.c:841
#, c-format
msgid " %d epsilon states, %d double epsilon states\n"
msgstr " %d estados épsilon, %d estados doble épsilon\n"
-#: main.c:850
-#, c-format
+#: main.c:845
msgid " no character classes\n"
msgstr " sin clases de caracteres\n"
-#: main.c:854
+#: main.c:848
#, c-format
msgid " %d/%d character classes needed %d/%d words of storage, %d reused\n"
msgstr ""
@@ -461,13 +391,13 @@ msgstr ""
# ¿Qué tal " se han creado %d pares estado/estado-siguiente"?
# Bueno, mejor no lo hagas hasta que no se sepa cómo queda al lado
# de las otras. sv
-#: main.c:859
+#: main.c:853
#, c-format
msgid " %d state/nextstate pairs created\n"
msgstr " %d pares estado/estado-siguiente creados\n"
# ## Añado sendas eses, ya que son transiciones. sv
-#: main.c:862
+#: main.c:855
#, c-format
msgid " %d/%d unique/duplicate transitions\n"
msgstr " %d/%d transiciones únicas/duplicadas\n"
@@ -476,50 +406,50 @@ msgstr " %d/%d transiciones únicas/duplicadas\n"
# sí, mejor ng
# ¿Que había antes? (¿entradas a la tabla?)
# (entradas *de* la tabla me suena mejor) sv.
-#: main.c:867
+#: main.c:861
#, c-format
msgid " %d table entries\n"
msgstr " %d entradas en la tabla\n"
# ## pongo `comillas' en el base-def. sv
-#: main.c:875
+#: main.c:869
#, c-format
msgid " %d/%d base-def entries created\n"
msgstr " %d/%d entradas `base-def' creadas\n"
-#: main.c:879
+#: main.c:872
#, c-format
msgid " %d/%d (peak %d) nxt-chk entries created\n"
msgstr " %d/%d (pico %d) entradas nxt-chk creadas\n"
-#: main.c:883
+#: main.c:875
#, c-format
msgid " %d/%d (peak %d) template nxt-chk entries created\n"
msgstr " %d/%d (pico %d) entradas de plantilla nxt-chk creadas\n"
# ¿entradas a la tabla o entradas de la tabla? sv
-#: main.c:887
+#: main.c:879
#, c-format
msgid " %d empty table entries\n"
msgstr " %d entradas en la tabla vacías\n"
-#: main.c:889
+#: main.c:881
#, c-format
msgid " %d protos created\n"
msgstr " %d prototipos creados\n"
-#: main.c:892
+#: main.c:884
#, c-format
msgid " %d templates created, %d uses\n"
msgstr " %d plantillas creadas, %d usos\n"
-#: main.c:900
+#: main.c:892
#, c-format
msgid " %d/%d equivalence classes created\n"
msgstr " %d/%d clases de equivalencia creadas\n"
# "se han creado..." sv
-#: main.c:908
+#: main.c:900
#, c-format
msgid " %d/%d meta-equivalence classes created\n"
msgstr " %d/%d clases de metaequivalencia creadas\n"
@@ -537,40 +467,43 @@ msgstr " %d/%d clases de metaequivalencia creadas\n"
# un lugar que se puede determinar mediante una transformación directa de su
# clave, por eso si hay dos claves iguales hay una colisión, porque dos
# registros van al mismo sitio ng+
-#: main.c:914
+#: main.c:905
#, c-format
msgid " %d (%d saved) hash collisions, %d DFAs equal\n"
-msgstr ""
-" %d (%d almacenadas) colisiones de localización ('hash'), %d AFDs iguales\n"
+msgstr " %d (%d almacenadas) colisiones de localización ('hash'), %d AFDs iguales\n"
-#: main.c:916
+#: main.c:907
#, c-format
msgid " %d sets of reallocations needed\n"
msgstr " se necesitan %d conjuntos de relocalización\n"
# Lo mismo que en otro sitio: ¿table entries son entradas a la tabla o
# de la tabla? sv
-#: main.c:918
+#: main.c:909
#, c-format
msgid " %d total table entries needed\n"
msgstr " se necesitan %d entradas totales en la tabla\n"
-#: main.c:995
-#, c-format
+#: main.c:966
msgid "Internal error. flexopts are malformed.\n"
msgstr "Error interno. flexopts mal formadas.\n"
-#: main.c:1005
+#: main.c:974
#, c-format
msgid "Try `%s --help' for more information.\n"
msgstr "Pruebe `%s --help' para más información.\n"
-#: main.c:1062
+#: main.c:1033
#, c-format
msgid "unknown -C option '%c'"
msgstr "opción -C desconocida '%c'"
-#: main.c:1191
+#: main.c:1116
+#, c-format
+msgid "unknown -R option '%c'"
+msgstr "opción -R desconocida '%c'"
+
+#: main.c:1153
#, c-format
msgid "%s %s\n"
msgstr "%s %s\n"
@@ -587,7 +520,7 @@ msgstr "%s %s\n"
# Sugerencia: error fatal. sv
# con comillas es un término medio. Lo de error grave fue una sugerencia
# de Enrique, y croe que queda mejor. ng+
-#: main.c:1466
+#: main.c:1395
msgid "fatal parse error"
msgstr "error muy grave en el analizador sintáctico"
@@ -610,83 +543,71 @@ msgstr "error muy grave en el analizador sintáctico"
# ##
# ## Eso no es válido ( solución, usa emacs po-mode :) ) em
# ## ok, ya estoy instalando linux otra vez ng+
-#: main.c:1498
+#: main.c:1407
#, c-format
msgid "could not create backing-up info file %s"
msgstr ""
"no se pudo crear el archivo de información de las reglas\n"
"que producen un retroceso del analizador %s"
-#: main.c:1519
-#, c-format
+#: main.c:1429
msgid "-l AT&T lex compatibility option entails a large performance penalty\n"
msgstr ""
"-l la opción de compatibilidad con AT&T lex implica una penalización del\n"
"rendimiento muy alta\n"
-#: main.c:1522
-#, c-format
+#: main.c:1431
msgid " and may be the actual source of other reported performance penalties\n"
-msgstr ""
-" y puede ser el origen real de otras penalizaciones del rendimiento "
-"notificadas\n"
-
-#: main.c:1528
-#, fuzzy, c-format
-msgid ""
-"%%option yylineno entails a performance penalty ONLY on rules that can match "
-"newline characters\n"
-msgstr ""
-"la %%opción yylineno implica una penalización del rendimiento muy alta\n"
+msgstr " y puede ser el origen real de otras penalizaciones del rendimiento notificadas\n"
-#: main.c:1535
+#: main.c:1437
#, c-format
+msgid "%%option yylineno entails a large performance penalty\n"
+msgstr "la %%opción yylineno implica una penalización del rendimiento muy alta\n"
+
+#: main.c:1444
msgid "-I (interactive) entails a minor performance penalty\n"
msgstr "-I (interactivo) implica una pequeña penalización del rendimiento\n"
-#: main.c:1540
-#, c-format
+#: main.c:1448
msgid "yymore() entails a minor performance penalty\n"
msgstr "yymore() implica un pequeña penalización del rendimiento\n"
-#: main.c:1546
-#, c-format
+#: main.c:1453
msgid "REJECT entails a large performance penalty\n"
msgstr "REJECT implica una penalización del rendimiento muy alta\n"
-#: main.c:1551
-#, c-format
+#: main.c:1457
msgid "Variable trailing context rules entail a large performance penalty\n"
msgstr ""
"La existencia de reglas de contexto posterior variable implica una\n"
"penalización del rendimiento muy alta\n"
-#: main.c:1563
+#: main.c:1470
msgid "REJECT cannot be used with -f or -F"
msgstr "REJECT no se puede usar con -f o -F"
-#: main.c:1566
-#, fuzzy, c-format
-msgid "%option yylineno cannot be used with REJECT"
+#: main.c:1473
+#, c-format
+msgid "%option yylineno cannot be used with -f or -F"
msgstr "la %opción yylineno no se puede usar con -f o -F"
-#: main.c:1569
+#: main.c:1476
msgid "variable trailing context rules cannot be used with -f or -F"
-msgstr ""
-"las reglas de contexto posterior variable no se pueden usar con -f o -F"
+msgstr "las reglas de contexto posterior variable no se pueden usar con -f o -F"
-#: main.c:1692
+#: main.c:1607
#, c-format
msgid "%option yyclass only meaningful for C++ scanners"
msgstr "la %option yyclass sólo tiene sentido para los analizadores en C++"
-#: main.c:1799
+#: main.c:1711
#, c-format
msgid "Usage: %s [OPTIONS] [FILE]...\n"
msgstr "Uso: %s [OPCIONES] [FICHERO]...\n"
-#: main.c:1802
-#, fuzzy, c-format
+#: main.c:1714
+#, c-format
msgid ""
"Generates programs that perform pattern-matching on text.\n"
"\n"
@@ -715,9 +636,7 @@ msgid ""
" -S, --skel=FILE specify skeleton file\n"
" -t, --stdout write scanner on stdout instead of %s\n"
" --yyclass=NAME name of C++ class\n"
-" --header-file=FILE create a C header file in addition to the "
-"scanner\n"
-" --tables-file[=FILE] write tables to FILE\n"
+" --header=FILE create a C header file in addition to the scanner\n"
"\n"
"Scanner behavior:\n"
" -7, --7bit generate 7-bit scanner\n"
@@ -735,11 +654,8 @@ msgid ""
" -L, --noline suppress #line directives in scanner\n"
" -P, --prefix=STRING use STRING as prefix instead of \"yy\"\n"
" -R, --reentrant generate a reentrant C scanner\n"
-" --bison-bridge scanner for bison pure parser.\n"
-" --bison-locations include yylloc support.\n"
+" -Rb, --reentrant-bison reentrant scanner for bison pure parser.\n"
" --stdinit initialize yyin/yyout to stdin/stdout\n"
-" --noansi-definitions old-style function definitions\n"
-" --noansi-prototypes empty parameter list in prototypes\n"
" --nounistd do not include <unistd.h>\n"
" --noFUNCTION do not generate a particular FUNCTION\n"
"\n"
@@ -753,37 +669,31 @@ msgstr ""
"Genera programas que realizan emparejado de patrones en texto.\n"
"\n"
"Compresión de tablas: (por defecto es -Cem)\n"
-" -Ca, --align Renuncia a tablas grandes para mejorar la alineación en "
-"memoria\n"
+" -Ca, --align Renuncia a tablas grandes para mejorar la alineación en memoria\n"
" -Ce, --ecs construye clases de equivalencia\n"
" -Cf no comprime las tablas; utiliza la representación -f\n"
" -CF no comprime las tablas; utiliza la representación -F\n"
" -Cm, --meta-ecs construye clases de metaequivalencia\n"
-" -Cr, --read utiliza read() en lugar de stdio para la entrada del "
-"analizador\n"
+" -Cr, --read utiliza read() en lugar de stdio para la entrada del analizador\n"
" -f, --full genera una analizar rápido y grande. Igual que -Cfr\n"
-" -F, --fast usa la representación de tablas alternativa. Igual que -"
-"CFr\n"
+" -F, --fast usa la representación de tablas alternativa. Igual que -CFr\n"
" -Cem compresión por defecto (igual que --ecs --meta-ecs)\n"
"\n"
"Depurado:\n"
" -d, --debug habilita el modo de depuración en el analizador\n"
" -b, --backup escribe información de seguridad en %s\n"
" -p, --perf-report escribe un informe de rendimiento en stderr\n"
-" -s, --nodefault suprime la regla por defecto consistente en un "
-"ECHO de cualquier carácter sin emparejar\n"
+" -s, --nodefault suprime la regla por defecto consistente en un ECHO de cualquier carácter sin emparejar\n"
" -T, --trace %s debería ejecutarse en modo traza\n"
" -w, --nowarn no genera avisos\n"
-" -v, --verbose escribe un resumen de estadísticas del analizador "
-"en stdout\n"
+" -v, --verbose escribe un resumen de estadísticas del analizador en stdout\n"
"\n"
"Ficheros:\n"
" -o, --outfile=FILE especifica el nombre del fichero de salida\n"
" -S, --skel=FILE especifica el fichero de esquema\n"
" -t, --stdout escribe el analizador en stdout en lugar de en %s\n"
" --yyclass=NAME nombre de la clase de C++\n"
-" --header=FILE crea un fichero de cabecera de C además del "
-"analizador\n"
+" --header=FILE crea un fichero de cabecera de C además del analizador\n"
"\n"
"Comportamiento del analizador:\n"
" -7, --7bit genera un analizador de 7 bits\n"
@@ -792,8 +702,7 @@ msgstr ""
" -i, --case-insensitive ignora mayúsculas y minúsculas en los patrones\n"
" -l, --lex-compat compatibilidad máxima con lex\n"
" -I, --interactive genera un analizador interactivo (opuesto a -B)\n"
-" --yylineno mantiene información del conteo de líneas en "
-"yylineno\n"
+" --yylineno mantiene información del conteo de líneas en yylineno\n"
"\n"
"Código generado:\n"
" -+, --c++ genera una clase C++ con el analizador\n"
@@ -801,8 +710,7 @@ msgstr ""
" -L, --noline suprime las directivas #line en el analizador\n"
" -P, --prefix=STRING usa STRING como prefijo en lugar de \"yy\"\n"
" -R, --reentrant generate un analizador C reentrante\n"
-" -Rb, --reentrant-bison analizador reentrante para un analizador léxico "
-"bison puro.\n"
+" -Rb, --reentrant-bison analizador reentrante para un analizador léxico bison puro.\n"
" --stdinit inicializa yyin/yyout a stdin/stdout\n"
" --noFUNCTION no genera la función FUNCTION\n"
"\n"
@@ -813,11 +721,7 @@ msgstr ""
" -h, --help produce este mensaje de ayuda\n"
" -V, --version informa de la versión %s\n"
-#: misc.c:65
-msgid "allocation of sko_stack failed"
-msgstr ""
-
-#: misc.c:102 misc.c:128
+#: misc.c:47
#, c-format
msgid "name \"%s\" ridiculously long"
msgstr "nombre \"%s\" ridículamente grande"
@@ -827,45 +731,45 @@ msgstr "nombre \"%s\" ridículamente grande"
# Sí, pero creo que sólo por mí. Normalmente esos mensajes
# los dá la biblioteca C antes em
# ok ng+
-#: misc.c:177
+#: misc.c:101
msgid "memory allocation failed in allocate_array()"
msgstr "falló la asignación de memoria en `allocate_array()'"
-#: misc.c:230
+#: misc.c:179
#, c-format
msgid "bad character '%s' detected in check_char()"
msgstr "carácter incorrecto '%s' detectado en `check_char()'"
# he añadido el `poder' em
# ok ng
-#: misc.c:235
+#: misc.c:184
#, c-format
msgid "scanner requires -8 flag to use the character %s"
msgstr "el analizador requiere la opción -8 para poder usar el carácter %s"
-#: misc.c:268
+#: misc.c:217
msgid "dynamic memory failure in copy_string()"
msgstr "fallo de la memoria dinámica en copy_string()"
# Sugerencia: error fatal. sv
-#: misc.c:367
+#: misc.c:349
#, c-format
msgid "%s: fatal internal error, %s\n"
msgstr "%s: error interno muy grave, %s\n"
-#: misc.c:803
+#: misc.c:775
msgid "attempt to increase array size failed"
msgstr "falló el intento de aumentar el tamaño de la matriz"
-#: misc.c:930
+#: misc.c:847
msgid "bad line in skeleton file"
msgstr "línea incorrecta en el archivo de esquema"
-#: misc.c:979
+#: misc.c:892
msgid "memory allocation failed in yy_flex_xmalloc()"
msgstr "la reserva de memoria falló en yy_flex_xmalloc()"
-#: nfa.c:104
+#: nfa.c:103
#, c-format
msgid ""
"\n"
@@ -884,139 +788,95 @@ msgstr "estado # %4d\t"
# Sugerencia: volcado. sv
# ok ng+
#: nfa.c:130
-#, c-format
msgid "********** end of dump\n"
msgstr "********** fin de volcado\n"
-#: nfa.c:174
+#: nfa.c:176
msgid "empty machine in dupmachine()"
msgstr "máquina vacía en `dupmachine()'"
-#: nfa.c:240
+#: nfa.c:228
#, c-format
msgid "Variable trailing context rule at line %d\n"
msgstr "Regla de contexto posterior variable en la línea %d\n"
-#: nfa.c:364
+#: nfa.c:350
msgid "bad state type in mark_beginning_as_normal()"
msgstr "tipo de estado incorrecto en mark_beginning_as_normal()"
-#: nfa.c:609
+#: nfa.c:603
#, c-format
msgid "input rules are too complicated (>= %d NFA states)"
msgstr "las reglas de entrada son demasiado complicadas (>= %d estados AFN)"
# Sugerencia: se han encontrado... sv
-#: nfa.c:688
+#: nfa.c:682
msgid "found too many transitions in mkxtion()"
msgstr "encontradas demasiadas transiciones en mkxtion()"
-#: nfa.c:714
+#: nfa.c:708
#, c-format
msgid "too many rules (> %d)!"
msgstr "demasiadas reglas (> %d)!"
-#: parse.y:159
+#: parse.y:174
msgid "unknown error processing section 1"
msgstr "error desconocido en el proceso de la sección 1"
-#: parse.y:184 parse.y:351
+#: parse.y:199 parse.y:362
msgid "bad start condition list"
msgstr "lista de condiciones de activación incorrecta"
-#: parse.y:315
+#: parse.y:326
msgid "unrecognized rule"
msgstr "regla no reconocida"
-#: parse.y:434 parse.y:447 parse.y:516
+#: parse.y:444 parse.y:457 parse.y:526
msgid "trailing context used twice"
msgstr "contexto posterior usado dos veces"
-#: parse.y:552 parse.y:562 parse.y:635 parse.y:645
+#: parse.y:562 parse.y:572 parse.y:645 parse.y:655
msgid "bad iteration values"
msgstr "valores incorrectos para iteración"
-#: parse.y:580 parse.y:598 parse.y:663 parse.y:681
+#: parse.y:590 parse.y:608 parse.y:673 parse.y:691
msgid "iteration value must be positive"
msgstr "los valores para iteración deben ser positivos"
-#: parse.y:804 parse.y:814
-#, c-format
-msgid "the character range [%c-%c] is ambiguous in a case-insensitive scanner"
-msgstr ""
-
-#: parse.y:819
+#: parse.y:785
msgid "negative range in character class"
msgstr "rango negativo en clase caracteres"
-#: parse.y:916
-#, fuzzy
-msgid "[:^lower:] is ambiguous in case insensitive scanner"
-msgstr ""
-"\t-i genera un analizador que no distingue entre mayúsculas y minúsculas\n"
-
-#: parse.y:922
-#, fuzzy
-msgid "[:^upper:] ambiguous in case insensitive scanner"
-msgstr ""
-"\t-i genera un analizador que no distingue entre mayúsculas y minúsculas\n"
-
-#: scan.l:75 scan.l:618 scan.l:676
-msgid "Input line too long\n"
-msgstr ""
-
-#: scan.l:161
-#, fuzzy, c-format
-msgid "malformed '%top' directive"
-msgstr "directiva '%' no reconocida"
-
-#: scan.l:183
+#: scan.l:140
#, no-c-format
msgid "unrecognized '%' directive"
msgstr "directiva '%' no reconocida"
-#: scan.l:192
-msgid "Definition name too long\n"
-msgstr ""
-
-#: scan.l:284
-msgid "Unmatched '{'"
-msgstr ""
-
-#: scan.l:300
-#, c-format
-msgid "Definition value for {%s} too long\n"
-msgstr ""
-
-#: scan.l:317
+#: scan.l:207
msgid "incomplete name definition"
msgstr "definición de nombre incompleta"
-#: scan.l:443
-msgid "Option line too long\n"
-msgstr ""
-
-#: scan.l:451
+#: scan.l:316
#, c-format
msgid "unrecognized %%option: %s"
msgstr "%%opción no reconocida: %s"
-#: scan.l:633 scan.l:800
+#: scan.l:449 scan.l:549
msgid "bad character class"
msgstr "clase de caracteres incorrecta"
-#: scan.l:683
+#: scan.l:481
#, c-format
msgid "undefined definition {%s}"
msgstr "definición no definida {%s}"
-#: scan.l:755
+#: scan.l:517
#, c-format
msgid "bad <start condition>: %s"
msgstr "<condición de activación> incorrecta: %s"
# Sugerencia: falta una comilla. sv
-#: scan.l:768
+#: scan.l:530
msgid "missing quote"
msgstr "falta comilla"
@@ -1024,65 +884,60 @@ msgstr "falta comilla"
# incorrecta la expresión ... em
# ok, de traducir al final ocurre que acabas hablando al revés,
# como en inglés ng
-#: scan.l:834
+#: scan.l:570
#, c-format
msgid "bad character class expression: %s"
msgstr "expresión de la clase de caracteres incorrecta: %s"
-#: scan.l:856
+#: scan.l:592
msgid "bad character inside {}'s"
msgstr "carácter incorrecto dentro de {}'s"
# Sugerencia: "falta una }". sv
-#: scan.l:862
+#: scan.l:598
msgid "missing }"
msgstr "falta }"
-#: scan.l:940
+#: scan.l:671
msgid "EOF encountered inside an action"
msgstr "Fin de archivo (EOF) encontrado dentro de una acción"
-#: scan.l:945
-#, fuzzy
-msgid "EOF encountered inside pattern"
-msgstr "Fin de archivo (EOF) encontrado dentro de una acción"
-
-#: scan.l:967
+#: scan.l:691
#, c-format
msgid "bad character: %s"
msgstr "carácter incorrecto: %s"
-#: scan.l:996
+#: scan.l:720
#, c-format
msgid "can't open %s"
msgstr "no se puede abrir %s"
-#: scanopt.c:291
+#: scanopt.c:267
#, c-format
msgid "Usage: %s [OPTIONS]...\n"
msgstr "Uso: %s [OPCIONES]...\n"
-#: scanopt.c:564
+#: scanopt.c:516
#, c-format
msgid "option `%s' doesn't allow an argument\n"
msgstr "la opción `%s' no permite un argumento\n"
-#: scanopt.c:569
+#: scanopt.c:519
#, c-format
msgid "option `%s' requires an argument\n"
msgstr "la opción `%s' requiere un argumento\n"
-#: scanopt.c:573
+#: scanopt.c:522
#, c-format
msgid "option `%s' is ambiguous\n"
msgstr "la opción `%s' es ambigua\n"
-#: scanopt.c:577
+#: scanopt.c:525
#, c-format
msgid "Unrecognized option `%s'\n"
msgstr "Opción no reconocida `%s'\n"
-#: scanopt.c:581
+#: scanopt.c:528
#, c-format
msgid "Unknown error=(%d)\n"
msgstr "Error desconocido=(%d)\n"
@@ -1095,48 +950,31 @@ msgstr "falló la reserva de memoria para la tabla de símbolos"
# hay que procurar evitar esto, siempre nos suena mejor
# el nombre ha sido definido dos veces, ¿qué te parece? em
# mucho mejor, ya lo había pensado, pero no sabía cual era el estilo usual. ng
-#: sym.c:202
+#: sym.c:210
msgid "name defined twice"
msgstr "el nombre ha sido definido dos veces"
# Aquí lo mismo 'la condición ... ha sido ..." em
-#: sym.c:253
+#: sym.c:265
#, c-format
msgid "start condition %s declared twice"
msgstr "la condición de activación %s ha sido declarada dos veces"
-#: yylex.c:56
+#: yylex.c:58
msgid "premature EOF"
msgstr "fin de archivo (EOF) prematuro"
-#: yylex.c:198
-#, c-format
+#: yylex.c:207
msgid "End Marker\n"
msgstr "Marcador de fin\n"
# sobre lo de tok, me parece que es abreviatura de token. ng
# en bison he traducido token por terminal, creo que es bueno unificar. ng
-#: yylex.c:204
+#: yylex.c:212
#, c-format
msgid "*Something Weird* - tok: %d val: %d\n"
msgstr "*Algo extraño* - terminal: %d val: %d\n"
-# Te he corregido un error de tecleo, y puesto entre comillas
-# la llamada a la función em
-# ok, lo de las comillas no lo sabía ng
-#~ msgid "consistency check failed in symfollowset"
-#~ msgstr "falló el test de consistencia en `symfollowset'"
-
-#~ msgid "Can't specify header option if writing to stdout."
-#~ msgstr ""
-#~ "No se puede especificar una opción de cabecera si se escribe en stdout"
-
-#~ msgid "-Cf/-CF and %option yylineno are incompatible"
-#~ msgstr "-Cf/-CF y la %opción yylineno son incompatibles"
-
-#~ msgid "unknown -R option '%c'"
-#~ msgstr "opción -R desconocida '%c'"
-
# Sugerencia: modificador '%c' desconocido -> opción '%c' desconocida. sv
# ## usage - modo de empleo
# ## pongo try - pruebe, como en otras traducciones. sv
@@ -1168,10 +1006,8 @@ msgstr "*Algo extraño* - terminal: %d val: %d\n"
#~ msgstr "la opción -C se debe especificar separadamente"
# Skeleton otra vez ( recuerdo máscara, o modelos ) em
-#~ msgid ""
-#~ "%s [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -ooutput -Pprefix -Sskeleton]\n"
-#~ msgstr ""
-#~ "%s [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -osalida -Pprefijo -Sesquema]\n"
+#~ msgid "%s [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -ooutput -Pprefix -Sskeleton]\n"
+#~ msgstr "%s [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -osalida -Pprefijo -Sesquema]\n"
#~ msgid "\t[--help --version] [file ...]\n"
#~ msgstr "\t[--help --version] [archivo ...]\n"
@@ -1198,6 +1034,9 @@ msgstr "*Algo extraño* - terminal: %d val: %d\n"
#~ msgid "\t-h produce this help message\n"
#~ msgstr "\t-h produce este mensaje de ayuda\n"
+#~ msgid "\t-i generate case-insensitive scanner\n"
+#~ msgstr "\t-i genera un analizador que no distingue entre mayúsculas y minúsculas\n"
+
#~ msgid "\t-l maximal compatibility with original lex\n"
#~ msgstr "\t-l compatibilidad máxima con el lex original\n"
@@ -1207,14 +1046,10 @@ msgstr "*Algo extraño* - terminal: %d val: %d\n"
# He cambiado el orden salida de error estándar, ponía em
#~ msgid "\t-p generate performance report to stderr\n"
-#~ msgstr ""
-#~ "\t-p genera el informe de rendimiento en la salida de error estándar "
-#~ "(stderr)\n"
+#~ msgstr "\t-p genera el informe de rendimiento en la salida de error estándar (stderr)\n"
#~ msgid "\t-s suppress default rule to ECHO unmatched text\n"
-#~ msgstr ""
-#~ "\t-s suprime la regla por defecto de visualizar (ECHO) el texto no "
-#~ "emparejado\n"
+#~ msgstr "\t-s suprime la regla por defecto de visualizar (ECHO) el texto no emparejado\n"
#~ msgid "\t-t write generated scanner on stdout instead of %s\n"
#~ msgstr ""
@@ -1276,8 +1111,7 @@ msgstr "*Algo extraño* - terminal: %d val: %d\n"
#~ msgstr "\t-? produce este mensaje de ayuda\n"
#~ msgid "\t-C specify degree of table compression (default is -Cem):\n"
-#~ msgstr ""
-#~ "\t-C especifica el grado de compresión de la tabla (por defecto -Cem):\n"
+#~ msgstr "\t-C especifica el grado de compresión de la tabla (por defecto -Cem):\n"
#~ msgid "\t\t-Ca trade off larger tables for better memory alignment\n"
#~ msgstr ""
@@ -1288,14 +1122,10 @@ msgstr "*Algo extraño* - terminal: %d val: %d\n"
#~ msgstr "\t\t-Ce construye clases de equivalencia\n"
#~ msgid "\t\t-Cf do not compress scanner tables; use -f representation\n"
-#~ msgstr ""
-#~ "\t\t-Cf no comprime las tablas del analizador, utiliza la representación "
-#~ "-f\n"
+#~ msgstr "\t\t-Cf no comprime las tablas del analizador, utiliza la representación -f\n"
#~ msgid "\t\t-CF do not compress scanner tables; use -F representation\n"
-#~ msgstr ""
-#~ "\t\t-CF no comprime las tablas del analizador, utiliza la representación "
-#~ "-F\n"
+#~ msgstr "\t\t-CF no comprime las tablas del analizador, utiliza la representación -F\n"
#~ msgid "\t\t-Cm construct meta-equivalence classes\n"
#~ msgstr "\t\t-cm construye clases de metaequivalencia\n"
diff --git a/po/fi.po b/po/fi.po
index d27ac51..5237f65 100644
--- a/po/fi.po
+++ b/po/fi.po
@@ -1,14 +1,29 @@
-# Finnish messages for flex.
-# Copyright © 2009, 2012 The Flex Project (msgids)
-# This file is put in the public domain.
-# This file is distributed under the same license as the flex package.
-# Jorma Karvonen <karvonen.jorma@gmail.com>, 2009, 2012.
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR Free Software Foundation, Inc.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
+#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: flex 2.5.36\n"
-"Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2014-03-26 15:00-0400\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"PO-Revision-Date: 2016-01-22 13:34-0800\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#~ # Finnish messages for flex.
+#~ # Copyright © 2009, 2012 The Flex Project (msgids)
+#~ # This file is put in the public domain.
+#~ # This file is distributed under the same license as the flex package.
+#~ # Jorma Karvonen <karvonen.jorma@gmail.com>, 2009, 2012.
+#~ #
+#~ msgid ""
+#~ msgstr ""
+#~ "Project-Id-Version: flex 2.5.36\n"
+#~ "Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n"
+"POT-Creation-Date: 2012-07-22 20:48-0400\n"
"PO-Revision-Date: 2012-08-02 21:16+0200\n"
"Last-Translator: Jorma Karvonen <karvonen.jorma@gmail.com>\n"
"Language-Team: Finnish <translation-team-fi@lists.sourceforge.net>\n"
@@ -177,368 +192,357 @@ msgstr "Ei voitu kirjoittaa: eoltbl"
msgid "Could not write yynultrans_tbl"
msgstr "Ei voitu kirjoittaa: yynultrans_tbl"
-#: main.c:191
+#: main.c:189
msgid "rule cannot be matched"
msgstr "sääntö ei voinut täsmätä"
-#: main.c:196
+#: main.c:194
msgid "-s option given but default rule can be matched"
msgstr "valitsin -s annettu mutta oletussääntö ei voinut täsmätä"
-#: main.c:236
+#: main.c:234
msgid "Can't use -+ with -l option"
msgstr "Ei voi käyttää -+ valitsimen -l kanssa"
-#: main.c:239
+#: main.c:237
msgid "Can't use -f or -F with -l option"
msgstr "Ei voi käyttää valitsinta -f tai -F valitsimen -l kanssa"
-#: main.c:243
+#: main.c:241
msgid "Can't use --reentrant or --bison-bridge with -l option"
-msgstr ""
-"Ei voi käyttää valitsinta --reentrant tai --bison-bridge valitsimen -l kanssa"
+msgstr "Ei voi käyttää valitsinta --reentrant tai --bison-bridge valitsimen -l kanssa"
-#: main.c:275
+#: main.c:278
msgid "-Cf/-CF and -Cm don't make sense together"
msgstr "-Cf/-CF ja -Cm eivät ole järkeviä yhdessä"
-#: main.c:278
+#: main.c:281
msgid "-Cf/-CF and -I are incompatible"
msgstr "-Cf/-CF ja -I ovat yhteensopimattomia"
-#: main.c:282
+#: main.c:285
msgid "-Cf/-CF are incompatible with lex-compatibility mode"
msgstr "-Cf/-CF ovat yhteensopimattomia lex-yhteensopivuustilassa"
-#: main.c:287
+#: main.c:290
msgid "-Cf and -CF are mutually exclusive"
msgstr "-Cf ja -CF ovat toisensa poissulkevia"
-#: main.c:291
+#: main.c:294
msgid "Can't use -+ with -CF option"
msgstr "Ei voi käyttää valitsinta -+ valitsimen -CF kanssa"
-#: main.c:294
+#: main.c:297
#, c-format
msgid "%array incompatible with -+ option"
msgstr "%array on yhteensopimaton valitsimen -+ kanssa"
-#: main.c:299
+#: main.c:302
msgid "Options -+ and --reentrant are mutually exclusive."
msgstr "Valitsimen -+ ja --reentrant ovat toisensa poissulkevia."
# bison bridge tarkoittaa, että flex käyttää bison-ohjelmaa analyysissä
-#: main.c:302
+#: main.c:305
msgid "bison bridge not supported for the C++ scanner."
msgstr "â€bison bridgeâ€-menettelyä ei tueta C++-skannerille."
-#: main.c:357 main.c:403
+#: main.c:360 main.c:406
#, c-format
msgid "could not create %s"
msgstr "ei voitu luoda %s"
-#: main.c:416
+#: main.c:419
msgid "could not write tables header"
msgstr "ei voitu kirjoittaa tauluotsaketta"
-#: main.c:420
+#: main.c:423
#, c-format
msgid "can't open skeleton file %s"
msgstr "ei voi avata kehystiedostoa %s"
-#: main.c:456
+#: main.c:459
msgid "allocation of macro definition failed"
msgstr "Makromäärityksen varaaminen epäonnistui"
-#: main.c:504
+#: main.c:507
#, c-format
msgid "input error reading skeleton file %s"
msgstr "syötevirhe luettaessa kehystiedostoa %s"
-#: main.c:508
+#: main.c:511
#, c-format
msgid "error closing skeleton file %s"
msgstr "virhe suljettaessa kehystiedostoa %s"
-#: main.c:693
+#: main.c:696
#, c-format
msgid "error creating header file %s"
msgstr "virhe luotaessa otsaketiedostoa %s"
-#: main.c:701
+#: main.c:704
#, c-format
msgid "error writing output file %s"
msgstr "virhe kirjoitettaessa tulostetiedostoa %s"
-#: main.c:705
+#: main.c:708
#, c-format
msgid "error closing output file %s"
msgstr "virhe suljettaessa tulostetiedostoa %s"
-#: main.c:709
+#: main.c:712
#, c-format
msgid "error deleting output file %s"
msgstr "virhe poistettaessa tulostetiedostoa %s"
-#: main.c:716
+#: main.c:719
#, c-format
msgid "No backing up.\n"
msgstr "Ei varmuuskopiointia.\n"
-#: main.c:720
+#: main.c:723
#, c-format
msgid "%d backing up (non-accepting) states.\n"
msgstr "%d (ei-hyväksyvää) varmuuskopiointitilaa.\n"
-#: main.c:724
+#: main.c:727
#, c-format
msgid "Compressed tables always back up.\n"
msgstr "Tiivistetyt taulut varmuuskopioidaan aina.\n"
-#: main.c:727
+#: main.c:730
#, c-format
msgid "error writing backup file %s"
msgstr "virhe kirjoitettaessa varmuuskopiotiedostoa %s"
-#: main.c:731
+#: main.c:734
#, c-format
msgid "error closing backup file %s"
msgstr "virhe suljettaessa varmuuskopiotiedostoa %s"
-#: main.c:736
+#: main.c:739
#, c-format
msgid "%s version %s usage statistics:\n"
msgstr "%s-version %s käyttötilastot:\n"
-#: main.c:739
+#: main.c:742
#, c-format
msgid " scanner options: -"
msgstr " skannerivalitsimet: -"
# Epädeterministinen äärellinen automaatti, lyh. NFA (engl. non-deterministic finite-state automaton)
-#: main.c:818
+#: main.c:821
#, c-format
msgid " %d/%d NFA states\n"
msgstr " %d/%d Epädeterministisen äärellisen automaatin tilaa\n"
-#: main.c:820
+#: main.c:823
#, c-format
msgid " %d/%d DFA states (%d words)\n"
msgstr " %d/%d Deterministisen äärellisen automaatin tilaa (%d sanaa)\n"
-#: main.c:822
+#: main.c:825
#, c-format
msgid " %d rules\n"
msgstr " %d sääntöä\n"
-#: main.c:827
+#: main.c:830
#, c-format
msgid " No backing up\n"
msgstr " Ei varmuuskopiointia\n"
-#: main.c:831
+#: main.c:834
#, c-format
msgid " %d backing-up (non-accepting) states\n"
msgstr " %d (ei-hyväksyvää) varmuuskopiotilaa\n"
-#: main.c:836
+#: main.c:839
#, c-format
msgid " Compressed tables always back-up\n"
msgstr " Tiivistetyt taulut varmuuskopioidaan aina\n"
-#: main.c:840
+#: main.c:843
#, c-format
msgid " Beginning-of-line patterns used\n"
msgstr " Rivin-alku-malleja käytetään\n"
-#: main.c:842
+#: main.c:845
#, c-format
msgid " %d/%d start conditions\n"
msgstr " %d/%d-käynnistysehtoja\n"
-#: main.c:846
+#: main.c:849
#, c-format
msgid " %d epsilon states, %d double epsilon states\n"
msgstr " %d epsilon-tilaa, %d double epsilon-tilaa\n"
-#: main.c:850
+#: main.c:853
#, c-format
msgid " no character classes\n"
msgstr " ei merkkiluokkia\n"
-#: main.c:854
+#: main.c:857
#, c-format
msgid " %d/%d character classes needed %d/%d words of storage, %d reused\n"
-msgstr ""
-" %d/%d merkkiluokkaa tarvittu %d/%d tallennussanaan, %d käytetty uudelleen\n"
+msgstr " %d/%d merkkiluokkaa tarvittu %d/%d tallennussanaan, %d käytetty uudelleen\n"
-#: main.c:859
+#: main.c:862
#, c-format
msgid " %d state/nextstate pairs created\n"
msgstr " %d tila/seuraavatila-paria luotu\n"
-#: main.c:862
+#: main.c:865
#, c-format
msgid " %d/%d unique/duplicate transitions\n"
msgstr " %d/%d uniikkia/kaksoiskappelsiirtymää\n"
-#: main.c:867
+#: main.c:870
#, c-format
msgid " %d table entries\n"
msgstr " %d-tauluriviä\n"
-#: main.c:875
+#: main.c:878
#, c-format
msgid " %d/%d base-def entries created\n"
msgstr " %d/%d base-def-alkiota luotu\n"
-#: main.c:879
+#: main.c:882
#, c-format
msgid " %d/%d (peak %d) nxt-chk entries created\n"
msgstr " %d/%d (huippu %d) nxt-chk-alkiota luotu\n"
-#: main.c:883
+#: main.c:886
#, c-format
msgid " %d/%d (peak %d) template nxt-chk entries created\n"
msgstr " %d/%d (huippu %d) malline nxt-chk-alkiota luotu\n"
-#: main.c:887
+#: main.c:890
#, c-format
msgid " %d empty table entries\n"
msgstr " %d tyhjää taulualkiota\n"
-#: main.c:889
+#: main.c:892
#, c-format
msgid " %d protos created\n"
msgstr " %d protoa luotu\n"
-#: main.c:892
+#: main.c:895
#, c-format
msgid " %d templates created, %d uses\n"
msgstr " %d mallinetta luotu, %d käytetään\n"
-#: main.c:900
+#: main.c:903
#, c-format
msgid " %d/%d equivalence classes created\n"
msgstr " %d/%d ekvivalenssiluokkaa luotu\n"
-#: main.c:908
+#: main.c:911
#, c-format
msgid " %d/%d meta-equivalence classes created\n"
msgstr " %d/%d meta-ekvivalenssiluokkaa luotu\n"
-#: main.c:914
+#: main.c:917
#, c-format
msgid " %d (%d saved) hash collisions, %d DFAs equal\n"
-msgstr ""
-" %d (%d tallennettu) hash-törmäykset, yhtäsuuri kuin %d Deterministisen "
-"äärellisen automaatin törmäystä\n"
+msgstr " %d (%d tallennettu) hash-törmäykset, yhtäsuuri kuin %d Deterministisen äärellisen automaatin törmäystä\n"
-#: main.c:916
+#: main.c:919
#, c-format
msgid " %d sets of reallocations needed\n"
msgstr " %d uudelleenvarausjoukkoa tarvittu\n"
-#: main.c:918
+#: main.c:921
#, c-format
msgid " %d total table entries needed\n"
msgstr " %d taulukkoalkiota tarvittu yhteensä\n"
-#: main.c:995
+#: main.c:998
#, c-format
msgid "Internal error. flexopts are malformed.\n"
msgstr "Sisäinen virhe. flex-valitsimet ovat vääränmuotoisia.\n"
-#: main.c:1005
+#: main.c:1008
#, c-format
msgid "Try `%s --help' for more information.\n"
msgstr "Lisätietoja käskyllä â€%s --helpâ€.\n"
-#: main.c:1062
+#: main.c:1065
#, c-format
msgid "unknown -C option '%c'"
msgstr "tuntematon valitsin -C â€%câ€"
-#: main.c:1191
+#: main.c:1194
#, c-format
msgid "%s %s\n"
msgstr "%s %s\n"
-#: main.c:1466
+#: main.c:1469
msgid "fatal parse error"
msgstr "vakava jäsennysvirhe"
-#: main.c:1498
+#: main.c:1501
#, c-format
msgid "could not create backing-up info file %s"
msgstr "ei voitu luoda varmuuskopiotietotiedostoa %s"
-#: main.c:1519
+#: main.c:1522
#, c-format
msgid "-l AT&T lex compatibility option entails a large performance penalty\n"
-msgstr ""
-"-l AT&T lex-yhteensopivuusvalitsin tuo mukanaan ison suorituskykysakon\n"
+msgstr "-l AT&T lex-yhteensopivuusvalitsin tuo mukanaan ison suorituskykysakon\n"
-#: main.c:1522
+#: main.c:1525
#, c-format
msgid " and may be the actual source of other reported performance penalties\n"
-msgstr ""
-" ja saattaa olla muiden ilmoitettujen suorituskykysakkojen todellinen lähde\n"
+msgstr " ja saattaa olla muiden ilmoitettujen suorituskykysakkojen todellinen lähde\n"
-#: main.c:1528
+#: main.c:1531
#, c-format
-msgid ""
-"%%option yylineno entails a performance penalty ONLY on rules that can match "
-"newline characters\n"
-msgstr ""
-"%%option yylineno tuo mukanaan suorituskykysakon VAIN säännöissä, jotka "
-"voivat täsmätä rivinvaihtomerkkeihin\n"
+msgid "%%option yylineno entails a performance penalty ONLY on rules that can match newline characters\n"
+msgstr "%%option yylineno tuo mukanaan suorituskykysakon VAIN säännöissä, jotka voivat täsmätä rivinvaihtomerkkeihin\n"
-#: main.c:1535
+#: main.c:1538
#, c-format
msgid "-I (interactive) entails a minor performance penalty\n"
msgstr "-I (interaktiivinen) tuo mukanaan pienemmän suorituskykysakon\n"
-#: main.c:1540
+#: main.c:1543
#, c-format
msgid "yymore() entails a minor performance penalty\n"
msgstr "yymore() tuo mukanaan pienemmän suorituskykysakon\n"
-#: main.c:1546
+#: main.c:1549
#, c-format
msgid "REJECT entails a large performance penalty\n"
msgstr "REJECT tuo mukanaan ison suorituskykyrangaistuksen\n"
-#: main.c:1551
+#: main.c:1554
#, c-format
msgid "Variable trailing context rules entail a large performance penalty\n"
msgstr "Muuttujajättökontekstisäännöt tuovat mukanaan ison suorityskykysakon\n"
-#: main.c:1563
+#: main.c:1566
msgid "REJECT cannot be used with -f or -F"
msgstr "REJECT ei voida käyttää valitsimen -f tai -F kanssa"
-#: main.c:1566
+#: main.c:1569
#, c-format
msgid "%option yylineno cannot be used with REJECT"
msgstr "%option yylineno ei voi käyttää REJECT:n kanssa"
-#: main.c:1569
+#: main.c:1572
msgid "variable trailing context rules cannot be used with -f or -F"
-msgstr ""
-"muuttujajättökontekstisääntöjä ei voida käyttää valitsimen -f tai -F kanssa"
+msgstr "muuttujajättökontekstisääntöjä ei voida käyttää valitsimen -f tai -F kanssa"
-#: main.c:1692
+#: main.c:1695
#, c-format
msgid "%option yyclass only meaningful for C++ scanners"
msgstr "%option yyclass on merkityksellinen vain C++-skannereille"
-#: main.c:1799
+#: main.c:1802
#, c-format
msgid "Usage: %s [OPTIONS] [FILE]...\n"
msgstr "Käyttö: %s [VALITSIMET] [TIEDOSTO]...\n"
-#: main.c:1802
+#: main.c:1805
#, c-format
msgid ""
"Generates programs that perform pattern-matching on text.\n"
@@ -568,8 +572,7 @@ msgid ""
" -S, --skel=FILE specify skeleton file\n"
" -t, --stdout write scanner on stdout instead of %s\n"
" --yyclass=NAME name of C++ class\n"
-" --header-file=FILE create a C header file in addition to the "
-"scanner\n"
+" --header-file=FILE create a C header file in addition to the scanner\n"
" --tables-file[=FILE] write tables to FILE\n"
"\n"
"Scanner behavior:\n"
@@ -606,14 +609,12 @@ msgstr ""
"Luo ohjelmia, jotka suorittavat tekstin mallintäsmäystä.\n"
"\n"
"Taulutiivistys:\n"
-" -Ca, --align kompromissi laajoissa taulukoissa parempaa "
-"muistitasausta varten\n"
+" -Ca, --align kompromissi laajoissa taulukoissa parempaa muistitasausta varten\n"
" -Ce, --ecs rakenna ekvivalenssiluokkia\n"
" -Cf älä tiivistä tauluja; käytä valitsinta -f esittelyyn\n"
" -CF älä tiivistä tauluja; käytä valitsinta -F esittelyyn\n"
" -Cm, --meta-ecs rakenna meta-ekvivalenssiluokkia\n"
-" -Cr, --read käytä funktiota read() eikä vakiosyötettä "
-"skannerisyötteenä\n"
+" -Cr, --read käytä funktiota read() eikä vakiosyötettä skannerisyötteenä\n"
" -f, --full tuota nopea, laaja skanneri. Sama kuin -Cfr\n"
" -F, --fast käytä vaihtoehtoista tauluesittelyä. Sama kuin -CFr\n"
" -Cem oletustiivistys (sama kuin --ecs --meta-ecs)\n"
@@ -622,18 +623,15 @@ msgstr ""
" -d, --debug ota käyttöön virheenjäljitystila skannerissa\n"
" -b, --backup kirjoita varmuuskopiotietoja osoitteeseen %s\n"
" -p, --perf-report kirjoita suorituskykyraportti vakiovirheeseen\n"
-" -s, --nodefault vaimenna oletussääntö ECHO-täsmäämättömään "
-"tekstiin\n"
+" -s, --nodefault vaimenna oletussääntö ECHO-täsmäämättömään tekstiin\n"
" -T, --trace %s pitäisi suorittaa jäljitystilassa\n"
" -w, --nowarn älä tuota varoituksia\n"
-" -v, --verbose kirjoita yhteenveto skanneritilastoista "
-"vakiotulosteeseen\n"
+" -v, --verbose kirjoita yhteenveto skanneritilastoista vakiotulosteeseen\n"
"\n"
"Tiedostot:\n"
" -o, --outfile=TIEDOSTO määritä tulostetiedostonimi\n"
" -S, --skel=TIEDOSTO määritä runkotiedosto\n"
-" -t, --stdout kirjoita skanneri vakiotulosteeseen eikä "
-"kohteeseen %s\n"
+" -t, --stdout kirjoita skanneri vakiotulosteeseen eikä kohteeseen %s\n"
" --yyclass=NIMI C++-luokan nimi\n"
" --header-file=TIEDOSTO tuota C-otsaketiedosto etsijän lisäksi\n"
" --tables-file[=TIEDOSTO] kirjoita taulut TIEDOSTOon\n"
@@ -643,11 +641,9 @@ msgstr ""
" -8, --8bit tuota 8-bittinen skanneri\n"
" -B, --batch tuota eräajoskanneri (päinvastoin kuin -I)\n"
" -i, --case-insensitive älä välitä kirjainkoosta malleissa\n"
-" -l, --lex-compat maksimiyhteensopivuus alkueräisen lex-ohjelman "
-"kanssa\n"
+" -l, --lex-compat maksimiyhteensopivuus alkueräisen lex-ohjelman kanssa\n"
" -X, --posix-compat maksimiyhteensopivuus POSIX lex-ohjelman kanssa\n"
-" -I, --interactive tuota interaktiivinen skanneri (päinvastoin kuin -"
-"B)\n"
+" -I, --interactive tuota interaktiivinen skanneri (päinvastoin kuin -B)\n"
" --yylineno jäljitä rivilukumäärä yylineno-ohjelmassa\n"
"\n"
"Generoitu koodi:\n"
@@ -658,8 +654,7 @@ msgstr ""
" -R, --reentrant tuota vapaakäyntinen C-skanneri\n"
" --bison-bridge skanneri â€bison pureâ€-jäsentimelle.\n"
" --bison-locations sisällytä yylloc-tuki.\n"
-" --stdinit alusta yyin/yyout vakiosyötteeseen/"
-"vakiotulosteeseen\n"
+" --stdinit alusta yyin/yyout vakiosyötteeseen/vakiotulosteeseen\n"
" --noansi-definitions vanhantyyliset funktiomäärittelyt\n"
" --noansi-prototypes tyhjä parametriluettelo prototyypeissä\n"
" --nounistd älä sisällytä <unistd.h>-tiedostoa\n"
@@ -725,8 +720,7 @@ msgid ""
msgstr ""
"\n"
"\n"
-"********** Epädeterministisen äärellisen automaatin vedoksen alku "
-"aloitustilassa %d\n"
+"********** Epädeterministisen äärellisen automaatin vedoksen alku aloitustilassa %d\n"
#: nfa.c:115
#, c-format
@@ -747,22 +741,20 @@ msgstr "tyhjä kone funktiossa dupmachine()"
msgid "Variable trailing context rule at line %d\n"
msgstr "Muuttujajättökontekstisääntö rivillä %d\n"
-#: nfa.c:364
+#: nfa.c:353
msgid "bad state type in mark_beginning_as_normal()"
msgstr "väärä tilatyyppi funktiossa mark_beginning_as_normal()"
-#: nfa.c:609
+#: nfa.c:598
#, c-format
msgid "input rules are too complicated (>= %d NFA states)"
-msgstr ""
-"syötesäännöt ovat liian mutkikkaita (>= %d Epädeterministisen äärellisen "
-"automaatin tilaa)"
+msgstr "syötesäännöt ovat liian mutkikkaita (>= %d Epädeterministisen äärellisen automaatin tilaa)"
-#: nfa.c:688
+#: nfa.c:677
msgid "found too many transitions in mkxtion()"
msgstr "löytyi liian monta siirtymää funktiossa mkxtion()"
-#: nfa.c:714
+#: nfa.c:703
#, c-format
msgid "too many rules (> %d)!"
msgstr "liian moni sääntöjä (> %d)!"
@@ -794,9 +786,7 @@ msgstr "iteraatioarvon on oltava positiivinen"
#: parse.y:804 parse.y:814
#, c-format
msgid "the character range [%c-%c] is ambiguous in a case-insensitive scanner"
-msgstr ""
-"merkkialue [%c-%c] ei ole yksiselitteinen skannerissa, joka ei välitä "
-"kirjainkoosta"
+msgstr "merkkialue [%c-%c] ei ole yksiselitteinen skannerissa, joka ei välitä kirjainkoosta"
#: parse.y:819
msgid "negative range in character class"
@@ -804,13 +794,11 @@ msgstr "negatiivinen lukualue merkkiluokassa"
#: parse.y:916
msgid "[:^lower:] is ambiguous in case insensitive scanner"
-msgstr ""
-"[:^lower:] ei ole yksiselitteinen skannerissa, joka ei välitä kirjainkoosta"
+msgstr "[:^lower:] ei ole yksiselitteinen skannerissa, joka ei välitä kirjainkoosta"
#: parse.y:922
msgid "[:^upper:] ambiguous in case insensitive scanner"
-msgstr ""
-"[:^upper:] ei ole yksiselitteinen skannerissa, joka ei välit kirjainkoosta"
+msgstr "[:^upper:] ei ole yksiselitteinen skannerissa, joka ei välit kirjainkoosta"
#: scan.l:75 scan.l:618 scan.l:676
msgid "Input line too long\n"
diff --git a/po/fr.po b/po/fr.po
index 9067fe7..819d59d 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -1,17 +1,32 @@
-# Messages français pour Flex.
-# Copyright © 2008, 2012 The Flex Project (msgids)
-# This file is distributed under the same license as the flex package.
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR Free Software Foundation, Inc.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
-# Dominique Boucher <boucherd@IRO.UMontreal.CA>, 1996.
-# Marc Baudoin <babafou@ensta.fr>, 1996-2002.
-# Michel Robitaille <robitail@IRO.UMontreal.CA>, 2002-2008.
-# François-Xavier Coudert <fxcoudert@gmail.com>, 2008.
-# David Prévot <david@tilapin.org>, 2012.
+#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: flex 2.5.37\n"
-"Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2014-03-26 15:00-0400\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"PO-Revision-Date: 2016-01-22 13:32-0800\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#~ # Messages français pour Flex.
+#~ # Copyright © 2008, 2012 The Flex Project (msgids)
+#~ # This file is distributed under the same license as the flex package.
+#~ #
+#~ # Dominique Boucher <boucherd@IRO.UMontreal.CA>, 1996.
+#~ # Marc Baudoin <babafou@ensta.fr>, 1996-2002.
+#~ # Michel Robitaille <robitail@IRO.UMontreal.CA>, 2002-2008.
+#~ # François-Xavier Coudert <fxcoudert@gmail.com>, 2008.
+#~ # David Prévot <david@tilapin.org>, 2012.
+#~ msgid ""
+#~ msgstr ""
+#~ "Project-Id-Version: flex 2.5.37\n"
+#~ "Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n"
+"POT-Creation-Date: 2012-07-22 20:48-0400\n"
"PO-Revision-Date: 2012-09-19 21:01-0400\n"
"Last-Translator: David Prévot <david@tilapin.org>\n"
"Language-Team: French <traduc@traduc.org>\n"
@@ -179,371 +194,363 @@ msgstr "Impossible d'écrire eoltbl"
msgid "Could not write yynultrans_tbl"
msgstr "Impossible d'écrire yynultrnas_tbl"
-#: main.c:191
+#: main.c:189
msgid "rule cannot be matched"
msgstr "la règle ne peut pas correspondre"
-#: main.c:196
+#: main.c:194
msgid "-s option given but default rule can be matched"
msgstr "l'option -s est donnée mais la règle par défaut peut correspondre"
-#: main.c:236
+#: main.c:234
msgid "Can't use -+ with -l option"
msgstr "L'option -+ ne peut pas être combinée à -l"
-#: main.c:239
+#: main.c:237
msgid "Can't use -f or -F with -l option"
msgstr "Les options -f et -F ne peuvent pas être combinées à -l"
-#: main.c:243
+#: main.c:241
msgid "Can't use --reentrant or --bison-bridge with -l option"
-msgstr ""
-"Les options --reentrant ou --bison-bridge ne peuvent pas être combinées à "
-"l'option -l"
+msgstr "Les options --reentrant ou --bison-bridge ne peuvent pas être combinées à l'option -l"
-#: main.c:275
+#: main.c:278
msgid "-Cf/-CF and -Cm don't make sense together"
msgstr "-Cf ou -CF et -Cm ne peuvent pas être indiquées ensemble"
-#: main.c:278
+#: main.c:281
msgid "-Cf/-CF and -I are incompatible"
msgstr "-Cf ou -CF et -I sont incompatibles"
-#: main.c:282
+#: main.c:285
msgid "-Cf/-CF are incompatible with lex-compatibility mode"
-msgstr ""
-"les options -Cf ou -CF ne sont pas compatibles avec le mode de compatibilité "
-"« lex »"
+msgstr "les options -Cf ou -CF ne sont pas compatibles avec le mode de compatibilité « lex »"
-#: main.c:287
+#: main.c:290
msgid "-Cf and -CF are mutually exclusive"
msgstr "-Cf et -CF sont mutuellement exclusifs"
-#: main.c:291
+#: main.c:294
msgid "Can't use -+ with -CF option"
msgstr "L'option -+ ne peut pas être combinée à -CF"
-#: main.c:294
+#: main.c:297
#, c-format
msgid "%array incompatible with -+ option"
msgstr "%array incompatible avec l'option -+"
-#: main.c:299
+#: main.c:302
msgid "Options -+ and --reentrant are mutually exclusive."
msgstr "Les options +- et --reentrant sont mutuellement exclusives."
-#: main.c:302
+#: main.c:305
msgid "bison bridge not supported for the C++ scanner."
msgstr "bridge bison n'est pas pris en charge pour l'analyseur C++"
-#: main.c:357 main.c:403
+#: main.c:360 main.c:406
#, c-format
msgid "could not create %s"
msgstr "impossible de créer %s"
-#: main.c:416
+#: main.c:419
msgid "could not write tables header"
msgstr "impossible d'écrire les tables d'en-tête"
-#: main.c:420
+#: main.c:423
#, c-format
msgid "can't open skeleton file %s"
msgstr "impossible d'ouvrir le fichier canevas %s"
-#: main.c:456
+#: main.c:459
msgid "allocation of macro definition failed"
msgstr "échec d'allocation de définition de macro"
-#: main.c:504
+#: main.c:507
#, c-format
msgid "input error reading skeleton file %s"
msgstr "erreur de lecture du fichier canevas %s"
-#: main.c:508
+#: main.c:511
#, c-format
msgid "error closing skeleton file %s"
msgstr "erreur de fermeture du fichier canevas %s"
-#: main.c:693
+#: main.c:696
#, c-format
msgid "error creating header file %s"
msgstr "erreur de création du fichier d'en-tête %s"
-#: main.c:701
+#: main.c:704
#, c-format
msgid "error writing output file %s"
msgstr "erreur d'écriture du fichier de sortie %s"
-#: main.c:705
+#: main.c:708
#, c-format
msgid "error closing output file %s"
msgstr "erreur de fermeture du fichier de sortie %s"
-#: main.c:709
+#: main.c:712
#, c-format
msgid "error deleting output file %s"
msgstr "erreur d'effacement du fichier de sortie %s"
-#: main.c:716
+#: main.c:719
#, c-format
msgid "No backing up.\n"
msgstr "Pas d'archivage.\n"
-#: main.c:720
+#: main.c:723
#, c-format
msgid "%d backing up (non-accepting) states.\n"
msgstr "%d états d'archivage (non acceptants).\n"
-#: main.c:724
+#: main.c:727
#, c-format
msgid "Compressed tables always back up.\n"
msgstr "Les tables comprimées sont toujours archivées.\n"
-#: main.c:727
+#: main.c:730
#, c-format
msgid "error writing backup file %s"
msgstr "erreur d'écriture du fichier de sauvegarde %s"
-#: main.c:731
+#: main.c:734
#, c-format
msgid "error closing backup file %s"
msgstr "erreur de fermeture du fichier de sauvegarde %s"
-#: main.c:736
+#: main.c:739
#, c-format
msgid "%s version %s usage statistics:\n"
msgstr "« %s » version %s, statistiques d'utilisation :\n"
-#: main.c:739
+#: main.c:742
#, c-format
msgid " scanner options: -"
msgstr " options de l'analyseur lexical : -"
-#: main.c:818
+#: main.c:821
#, c-format
msgid " %d/%d NFA states\n"
msgstr " %d/%d états NFA\n"
-#: main.c:820
+#: main.c:823
#, c-format
msgid " %d/%d DFA states (%d words)\n"
msgstr " %d/%d états AFD (%d mots)\n"
-#: main.c:822
+#: main.c:825
#, c-format
msgid " %d rules\n"
msgstr " %d règles\n"
-#: main.c:827
+#: main.c:830
#, c-format
msgid " No backing up\n"
msgstr " Pas d'archivage\n"
-#: main.c:831
+#: main.c:834
#, c-format
msgid " %d backing-up (non-accepting) states\n"
msgstr " %d états d'archivage (si non acceptants)\n"
-#: main.c:836
+#: main.c:839
#, c-format
msgid " Compressed tables always back-up\n"
msgstr " Les tables comprimées sont toujours archivées\n"
-#: main.c:840
+#: main.c:843
#, c-format
msgid " Beginning-of-line patterns used\n"
msgstr " Modèles utilisés en début de ligne\n"
-#: main.c:842
+#: main.c:845
#, c-format
msgid " %d/%d start conditions\n"
msgstr " %d/%d conditions de départ\n"
-#: main.c:846
+#: main.c:849
#, c-format
msgid " %d epsilon states, %d double epsilon states\n"
msgstr " %d états epsilon, %d états double epsilon\n"
-#: main.c:850
+#: main.c:853
#, c-format
msgid " no character classes\n"
msgstr " pas de classes de caractères\n"
-#: main.c:854
+#: main.c:857
#, c-format
msgid " %d/%d character classes needed %d/%d words of storage, %d reused\n"
-msgstr ""
-" %d/%d classes de caractères nécessaires %d/%d mots-mémoire, %d recyclés\n"
+msgstr " %d/%d classes de caractères nécessaires %d/%d mots-mémoire, %d recyclés\n"
-#: main.c:859
+#: main.c:862
#, c-format
msgid " %d state/nextstate pairs created\n"
msgstr " %d paires state/nextstate produites\n"
-#: main.c:862
+#: main.c:865
#, c-format
msgid " %d/%d unique/duplicate transitions\n"
msgstr " %d/%d transitions uniques/dupliquées\n"
-#: main.c:867
+#: main.c:870
#, c-format
msgid " %d table entries\n"
msgstr " %d entrées dans la table\n"
-#: main.c:875
+#: main.c:878
#, c-format
msgid " %d/%d base-def entries created\n"
msgstr " %d/%d entrées base-def produites\n"
-#: main.c:879
+#: main.c:882
#, c-format
msgid " %d/%d (peak %d) nxt-chk entries created\n"
msgstr " %d/%d (max. %d) entrées nxt-chk produites\n"
-#: main.c:883
+#: main.c:886
#, c-format
msgid " %d/%d (peak %d) template nxt-chk entries created\n"
msgstr " %d/%d (max. %d) entrées de modèle nxt-chk produites\n"
-#: main.c:887
+#: main.c:890
#, c-format
msgid " %d empty table entries\n"
msgstr " %d entrées vides dans la table\n"
-#: main.c:889
+#: main.c:892
#, c-format
msgid " %d protos created\n"
msgstr " %d prototypes produits\n"
-#: main.c:892
+#: main.c:895
#, c-format
msgid " %d templates created, %d uses\n"
msgstr " %d modèles produits, %d usages\n"
-#: main.c:900
+#: main.c:903
#, c-format
msgid " %d/%d equivalence classes created\n"
msgstr " %d/%d classes d'équivalence produites\n"
-#: main.c:908
+#: main.c:911
#, c-format
msgid " %d/%d meta-equivalence classes created\n"
msgstr " %d/%d classes de métaéquivalence produites\n"
-#: main.c:914
+#: main.c:917
#, c-format
msgid " %d (%d saved) hash collisions, %d DFAs equal\n"
msgstr " %d (%d sauvés) collisions durant dispersion, %d AFD égaux\n"
-#: main.c:916
+#: main.c:919
#, c-format
msgid " %d sets of reallocations needed\n"
msgstr " %d ensembles de réallocations nécessaires\n"
-#: main.c:918
+#: main.c:921
#, c-format
msgid " %d total table entries needed\n"
msgstr " %d entrées nécessaires dans la table, au total\n"
-#: main.c:995
+#: main.c:998
#, c-format
msgid "Internal error. flexopts are malformed.\n"
msgstr "Erreur interne. Les options « flexopts » sont mal composées.\n"
-#: main.c:1005
+#: main.c:1008
#, c-format
msgid "Try `%s --help' for more information.\n"
-msgstr ""
-"Exécutez « %s --help » pour obtenir des renseignements complémentaires.\n"
+msgstr "Exécutez « %s --help » pour obtenir des renseignements complémentaires.\n"
-#: main.c:1062
+#: main.c:1065
#, c-format
msgid "unknown -C option '%c'"
msgstr "l'option -C « %c » inconnue"
-#: main.c:1191
+#: main.c:1194
#, c-format
msgid "%s %s\n"
msgstr "%s %s\n"
-#: main.c:1466
+#: main.c:1469
msgid "fatal parse error"
msgstr "erreur de lecture fatale"
-#: main.c:1498
+#: main.c:1501
#, c-format
msgid "could not create backing-up info file %s"
msgstr "impossible de créer le fichier d'informations d'archivage %s"
-#: main.c:1519
+#: main.c:1522
#, c-format
msgid "-l AT&T lex compatibility option entails a large performance penalty\n"
msgstr ""
"L'option -l de compatibilité avec le « lex » d'AT&T entraîne une importante\n"
"perte de performance\n"
-#: main.c:1522
+#: main.c:1525
#, c-format
msgid " and may be the actual source of other reported performance penalties\n"
msgstr " et peuvent être cause d'autres vices de performance observés\n"
-#: main.c:1528
+#: main.c:1531
#, c-format
-msgid ""
-"%%option yylineno entails a performance penalty ONLY on rules that can match "
-"newline characters\n"
+msgid "%%option yylineno entails a performance penalty ONLY on rules that can match newline characters\n"
msgstr ""
"%%option yylineno n'entraîne une importante perte de performance QUE sur\n"
"les règles pouvant correspondre avec le caractère de changement de ligne\n"
-#: main.c:1535
+#: main.c:1538
#, c-format
msgid "-I (interactive) entails a minor performance penalty\n"
msgstr "l'option -I (interactif) entraîne une faible perte de performance\n"
-#: main.c:1540
+#: main.c:1543
#, c-format
msgid "yymore() entails a minor performance penalty\n"
msgstr "yymore() entraîne une faible baisse de performance\n"
-#: main.c:1546
+#: main.c:1549
#, c-format
msgid "REJECT entails a large performance penalty\n"
msgstr "REJECT entraîne une importante baisse de performance\n"
-#: main.c:1551
+#: main.c:1554
#, c-format
msgid "Variable trailing context rules entail a large performance penalty\n"
msgstr ""
"Les règles de contexte traîné variable entraînent une importante baisse de\n"
"performance\n"
-#: main.c:1563
+#: main.c:1566
msgid "REJECT cannot be used with -f or -F"
msgstr "REJECT ne peut pas être utilisé avec -f ou -F"
-#: main.c:1566
+#: main.c:1569
#, c-format
msgid "%option yylineno cannot be used with REJECT"
msgstr "%option yylineno ne peut être utilisé avec REJECT"
-#: main.c:1569
+#: main.c:1572
msgid "variable trailing context rules cannot be used with -f or -F"
msgstr ""
"les règles de contexte traîné variable ne peuvent pas être utilisées avec\n"
"-f ou -F"
-#: main.c:1692
+#: main.c:1695
#, c-format
msgid "%option yyclass only meaningful for C++ scanners"
msgstr "%option yyclass n'a de sens qu'avec les analyseurs C++"
-#: main.c:1799
+#: main.c:1802
#, c-format
msgid "Usage: %s [OPTIONS] [FILE]...\n"
msgstr "Utilisation : %s [OPTIONS] [FICHIER]...\n"
-#: main.c:1802
+#: main.c:1805
#, c-format
msgid ""
"Generates programs that perform pattern-matching on text.\n"
@@ -573,8 +580,7 @@ msgid ""
" -S, --skel=FILE specify skeleton file\n"
" -t, --stdout write scanner on stdout instead of %s\n"
" --yyclass=NAME name of C++ class\n"
-" --header-file=FILE create a C header file in addition to the "
-"scanner\n"
+" --header-file=FILE create a C header file in addition to the scanner\n"
" --tables-file[=FILE] write tables to FILE\n"
"\n"
"Scanner behavior:\n"
@@ -608,23 +614,17 @@ msgid ""
" -h, --help produce this help message\n"
" -V, --version report %s version\n"
msgstr ""
-"Génération de programmes qui réalisent des correspondances de motif de "
-"texte.\n"
+"Génération de programmes qui réalisent des correspondances de motif de texte.\n"
"\n"
"Compression de table :\n"
-" -Ca, --align négocier grandes tables pour un meilleur alignement "
-"mémoire\n"
+" -Ca, --align négocier grandes tables pour un meilleur alignement mémoire\n"
" -Ce, --ecs construire des équivalences de classes\n"
-" -Cf ne pas compresser les tables ; utiliser la "
-"représentation -f\n"
-" -CF ne pas compresser les tables ; utiliser la "
-"représentation -F\n"
+" -Cf ne pas compresser les tables ; utiliser la représentation -f\n"
+" -CF ne pas compresser les tables ; utiliser la représentation -F\n"
" -Cm, --meta-ecs construire des métaéquivalences de classes\n"
-" -Cr, --read utiliser read() au lieu de stdio pour le scanner "
-"d'entrée\n"
+" -Cr, --read utiliser read() au lieu de stdio pour le scanner d'entrée\n"
" -f, --full générer rapidement, un grand scanner. Identique à -Cfr\n"
-" -F, --fast utiliser une table alternative de représentation. Comme -"
-"CFr\n"
+" -F, --fast utiliser une table alternative de représentation. Comme -CFr\n"
" -Cem compression par défaut (identique à --ecs --meta-ecs)\n"
"\n"
"Mise au point (mode débogage) :\n"
@@ -635,16 +635,14 @@ msgstr ""
" le texte non correspondant par ECHO\n"
" -T, --trace %s devrait s'exécuter en mode trace\n"
" -w, --nowarn ne pas générer d'avertissements\n"
-" -v, --verbose produire des statistiques du scanner sur "
-"stdout\n"
+" -v, --verbose produire des statistiques du scanner sur stdout\n"
"\n"
"Fichiers :\n"
" -o, --outfile=FICHIER indiquer un nom de fichier de sortie\n"
" -S, --skel=FICHIER indiquer le fichier du squelette\n"
" -t, --stdout produire le scanner sur stdout au lieu de %s\n"
" --yyclass=NOM nom de la classe C++\n"
-" --header-file=FICHIER créer le fichier d'en-tête C en plus du "
-"scanner\n"
+" --header-file=FICHIER créer le fichier d'en-tête C en plus du scanner\n"
" --tables-file[=FICHIER] écrire les tables dans le FICHIER\n"
"\n"
"Comportement du scanner :\n"
@@ -652,10 +650,8 @@ msgstr ""
" -8, --8bit générer un scanner de 8 bits\n"
" -B, --batch générer un scanner par lot (contraire de -I)\n"
" -i, --case-insensitive ignorer la casse dans les patrons\n"
-" -l, --lex-compat établir une compatibilité maximale avec lex "
-"d'origine\n"
-" -X, --posix-compat établir une compatibilité maximale avec lex de "
-"POSIX\n"
+" -l, --lex-compat établir une compatibilité maximale avec lex d'origine\n"
+" -X, --posix-compat établir une compatibilité maximale avec lex de POSIX\n"
" -I, --interactive générer un scanner interactif (contraire de -B)\n"
" --yylineno suivre le compte de lignes dans yylineno\n"
"\n"
@@ -663,8 +659,7 @@ msgstr ""
" -+, --c++ générer la classe C++ du scanner\n"
" -Dmacro[=def] définition macro #define (« 1 » par défaut)\n"
" -L, --noline supprimer les directives #line dans le scanner\n"
-" -P, --prefix=CHAÎNE utiliser la CHAÎNE comme préfixe au lieu de "
-"« yy »\n"
+" -P, --prefix=CHAÎNE utiliser la CHAÎNE comme préfixe au lieu de « yy »\n"
" -R, --reentrant générer un scanner C en code rentrant\n"
" --bison-bridge scanner pour l'analyseur pur bison\n"
" --bison-locations inclure la prise en charge de yylloc.\n"
@@ -700,8 +695,7 @@ msgstr "mauvais caractère « %s » détecté dans check_char()"
#: misc.c:235
#, c-format
msgid "scanner requires -8 flag to use the character %s"
-msgstr ""
-"l'analyseur nécessite l'option -8 pour pouvoir utiliser le caractère %s"
+msgstr "l'analyseur nécessite l'option -8 pour pouvoir utiliser le caractère %s"
#: misc.c:268
msgid "dynamic memory failure in copy_string()"
@@ -754,20 +748,20 @@ msgstr "machine vide dans dupmachine()"
msgid "Variable trailing context rule at line %d\n"
msgstr "Règle de contexte traîné variable à la ligne %d\n"
-#: nfa.c:364
+#: nfa.c:353
msgid "bad state type in mark_beginning_as_normal()"
msgstr "mauvais type d'état dans mark_beginning_as_normal()"
-#: nfa.c:609
+#: nfa.c:598
#, c-format
msgid "input rules are too complicated (>= %d NFA states)"
msgstr "les règles d'entrée sont trop compliquées (>= %d états NFA)"
-#: nfa.c:688
+#: nfa.c:677
msgid "found too many transitions in mkxtion()"
msgstr "il y a trop de transitions dans mkxtion()"
-#: nfa.c:714
+#: nfa.c:703
#, c-format
msgid "too many rules (> %d)!"
msgstr "trop de règles (> %d)."
@@ -799,9 +793,7 @@ msgstr "la valeur d'itération doit être positive"
#: parse.y:804 parse.y:814
#, c-format
msgid "the character range [%c-%c] is ambiguous in a case-insensitive scanner"
-msgstr ""
-"l'étendue de caractères [%c-%c] est ambiguë pour un scanner insensible à la "
-"casse"
+msgstr "l'étendue de caractères [%c-%c] est ambiguë pour un scanner insensible à la casse"
#: parse.y:819
msgid "negative range in character class"
@@ -992,10 +984,8 @@ msgstr "*Très bizarre* — tok : %d val : %d\n"
#~ msgid "-C flag must be given separately"
#~ msgstr "L'option -C doit être utilisée séparément"
-#~ msgid ""
-#~ "%s [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -ooutput -Pprefix -Sskeleton]\n"
-#~ msgstr ""
-#~ "%s [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -osortie -Ppréfixe -Scanevas]\n"
+#~ msgid "%s [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -ooutput -Pprefix -Sskeleton]\n"
+#~ msgstr "%s [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -osortie -Ppréfixe -Scanevas]\n"
#~ msgid "\t[--help --version] [file ...]\n"
#~ msgstr "\t[--help --version] [fichier ...]\n"
@@ -1028,12 +1018,10 @@ msgstr "*Très bizarre* — tok : %d val : %d\n"
#~ msgstr "\t-p affiche un rapport de performance sur stderr\n"
#~ msgid "\t-s suppress default rule to ECHO unmatched text\n"
-#~ msgstr ""
-#~ "\t-s supprime la règle par défaut qui AFFICHE le texte non reconnu\n"
+#~ msgstr "\t-s supprime la règle par défaut qui AFFICHE le texte non reconnu\n"
#~ msgid "\t-t write generated scanner on stdout instead of %s\n"
-#~ msgstr ""
-#~ "\t-t écrit l'analyseur généré sur la sortie standard au lieu de %s\n"
+#~ msgstr "\t-t écrit l'analyseur généré sur la sortie standard au lieu de %s\n"
#~ msgid "\t-v write summary of scanner statistics to f\n"
#~ msgstr "\t-v écrit un résumé des statistiques de l'analyseur sur f\n"
@@ -1072,8 +1060,7 @@ msgstr "*Très bizarre* — tok : %d val : %d\n"
#~ msgstr "\t-? affiche ce message d'aide\n"
#~ msgid "\t-C specify degree of table compression (default is -Cem):\n"
-#~ msgstr ""
-#~ "\t-C spécifie le degré de compression des tables (-Cem par défaut) :\n"
+#~ msgstr "\t-C spécifie le degré de compression des tables (-Cem par défaut) :\n"
#~ msgid "\t\t-Ca trade off larger tables for better memory alignment\n"
#~ msgstr ""
@@ -1084,21 +1071,16 @@ msgstr "*Très bizarre* — tok : %d val : %d\n"
#~ msgstr "\t\t-Ce construit des classes d'équivalence\n"
#~ msgid "\t\t-Cf do not compress scanner tables; use -f representation\n"
-#~ msgstr ""
-#~ "\t\t-Cf ne comprime pas les tables de l'analyseur ; utilise la "
-#~ "représentation -f\n"
+#~ msgstr "\t\t-Cf ne comprime pas les tables de l'analyseur ; utilise la représentation -f\n"
#~ msgid "\t\t-CF do not compress scanner tables; use -F representation\n"
-#~ msgstr ""
-#~ "\t\t-CF ne comprime pas les tables de l'analyseur ; utilise la "
-#~ "représentation -F\n"
+#~ msgstr "\t\t-CF ne comprime pas les tables de l'analyseur ; utilise la représentation -F\n"
#~ msgid "\t\t-Cm construct meta-equivalence classes\n"
#~ msgstr "\t\t-Cm construit des classes de meta-équivalence\n"
#~ msgid "\t\t-Cr use read() instead of stdio for scanner input\n"
-#~ msgstr ""
-#~ "\t\t-Cr utilise read() au lieu de stdio pour l'entrée de l'analyseur\n"
+#~ msgstr "\t\t-Cr utilise read() au lieu de stdio pour l'entrée de l'analyseur\n"
#~ msgid "\t-o specify output filename\n"
#~ msgstr "\t-o spécifie le nom du fichier de sortie\n"
diff --git a/po/ga.po b/po/ga.po
index e3a0f3a..31b4b13 100644
--- a/po/ga.po
+++ b/po/ga.po
@@ -1,36 +1,34 @@
-# Irish translations for flex.
-# Copyright (C) 2008 The Flex Project (msgids)
-# This file is distributed under the same license as the flex package.
-# Kevin Patrick Scannell <scannell@SLU.EDU>, 2003, 2006, 2008.
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR Free Software Foundation, Inc.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: flex 2.5.34\n"
-"Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2014-03-26 15:00-0400\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"PO-Revision-Date: 2016-01-22 13:34-0800\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#~ # Irish translations for flex.
+#~ # Copyright (C) 2008 The Flex Project (msgids)
+#~ # This file is distributed under the same license as the flex package.
+#~ # Kevin Patrick Scannell <scannell@SLU.EDU>, 2003, 2006, 2008.
+#~ msgid ""
+#~ msgstr ""
+#~ "Project-Id-Version: flex 2.5.34\n"
+#~ "Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n"
+"POT-Creation-Date: 2007-12-12 16:05-0500\n"
"PO-Revision-Date: 2008-07-23 09:37-0500\n"
"Last-Translator: Kevin Scannell <kscanne@gmail.com>\n"
"Language-Team: Irish <gaeilge-gnulinux@lists.sourceforge.net>\n"
-"Language: ga\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-#: buf.c:78
-msgid "Allocation of buffer to print string failed"
-msgstr ""
-
-#: buf.c:100
-msgid "Allocation of buffer for line directive failed"
-msgstr ""
-
-#: buf.c:177
-msgid "Allocation of buffer for m4 def failed"
-msgstr ""
-
-#: buf.c:197
-msgid "Allocation of buffer for m4 undef failed"
-msgstr ""
-
#: dfa.c:61
#, c-format
msgid "State #%d is non-accepting -\n"
@@ -89,7 +87,7 @@ msgstr "staid # %d:\n"
msgid "Could not write yynxt_tbl[][]"
msgstr "Níorbh fhéidir yynxt_tbl[][] a scríobh"
-#: dfa.c:1049
+#: dfa.c:1052
msgid "bad transition character detected in sympartition()"
msgstr "carachtar trasdula neamhbhailí i sympartition()"
@@ -173,367 +171,352 @@ msgstr "Níorbh fhéidir eoltbl a scríobh"
msgid "Could not write yynultrans_tbl"
msgstr "Níorbh fhéidir yynultrans_tbl a scríobh"
-#: main.c:191
+#: main.c:189
msgid "rule cannot be matched"
msgstr "Ní féidir riail chomhoiriúnach a aimsiú"
-#: main.c:196
+#: main.c:194
msgid "-s option given but default rule can be matched"
-msgstr ""
-"bhí an rogha -s tugtha ach is féidir an riail réamhshocraithe a chur i "
-"gcomhoiriúnacht"
+msgstr "bhí an rogha -s tugtha ach is féidir an riail réamhshocraithe a chur i gcomhoiriúnacht"
-#: main.c:236
+#: main.c:234
msgid "Can't use -+ with -l option"
msgstr "Níl -+ ar fáil in éineacht leis an rogha -l"
-#: main.c:239
+#: main.c:237
msgid "Can't use -f or -F with -l option"
msgstr "Níl -f nó -F ar fáil in éineacht leis an rogha -l"
-#: main.c:243
+#: main.c:241
msgid "Can't use --reentrant or --bison-bridge with -l option"
msgstr "Níl --reentrant nó --bison-bridge ar fáil in éineacht leis an rogha -l"
-#: main.c:275
+#: main.c:278
msgid "-Cf/-CF and -Cm don't make sense together"
msgstr "Níl -Cf/-CF agus -Cm comhoiriúnach"
-#: main.c:278
+#: main.c:281
msgid "-Cf/-CF and -I are incompatible"
msgstr "Níl -Cf/-CF agus -I comhoiriúnach"
-#: main.c:282
+#: main.c:285
msgid "-Cf/-CF are incompatible with lex-compatibility mode"
msgstr "Níl -Cf/-CF ar fáil sa mhód comhoiriúnachta lex"
-#: main.c:287
+#: main.c:290
msgid "-Cf and -CF are mutually exclusive"
msgstr "Is comheisiatach iad na roghanna -Cf agus -CF"
-#: main.c:291
+#: main.c:294
msgid "Can't use -+ with -CF option"
msgstr "Níl -+ ar fáil in éineacht leis an rogha -CF"
-#: main.c:294
+#: main.c:297
#, c-format
msgid "%array incompatible with -+ option"
msgstr "níl %array comhoiriúnach leis an rogha -+"
-#: main.c:299
+#: main.c:302
msgid "Options -+ and --reentrant are mutually exclusive."
msgstr "Is comheisiatach iad na roghanna -+ agus --reentrant."
-#: main.c:302
+#: main.c:305
msgid "bison bridge not supported for the C++ scanner."
msgstr "níl bison bridge ar fáil don scanóir C++."
-#: main.c:357 main.c:403
+#: main.c:360 main.c:406
#, c-format
msgid "could not create %s"
msgstr "níorbh fhéidir %s a chruthú"
-#: main.c:416
+#: main.c:419
msgid "could not write tables header"
msgstr "níorbh fhéidir ceanntásc táblaí a scríobh"
-#: main.c:420
+#: main.c:423
#, c-format
msgid "can't open skeleton file %s"
msgstr "ní féidir creatchomhad %s a oscailt"
-#: main.c:456
-msgid "allocation of macro definition failed"
-msgstr ""
-
-#: main.c:504
+#: main.c:505
#, c-format
msgid "input error reading skeleton file %s"
msgstr "earráid agus creatchomhaid %s á léamh"
-#: main.c:508
+#: main.c:509
#, c-format
msgid "error closing skeleton file %s"
msgstr "earráid agus creatchomhaid %s á dhúnadh"
-#: main.c:693
+#: main.c:694
#, c-format
msgid "error creating header file %s"
msgstr "earráid agus comhad ceanntáisc %s á chruthú"
-#: main.c:701
+#: main.c:702
#, c-format
msgid "error writing output file %s"
msgstr "earráid agus aschomhaid %s á scríobh"
-#: main.c:705
+#: main.c:706
#, c-format
msgid "error closing output file %s"
msgstr "earráid agus aschomhad %s á dhúnadh"
-#: main.c:709
+#: main.c:710
#, c-format
msgid "error deleting output file %s"
msgstr "earráid agus aschomhaid %s á scriosadh"
-#: main.c:716
+#: main.c:717
#, c-format
msgid "No backing up.\n"
msgstr "Ná cúlaítear.\n"
-#: main.c:720
+#: main.c:721
#, c-format
msgid "%d backing up (non-accepting) states.\n"
msgstr "%d staid chúlaithe (níl ina staid ghlactha).\n"
-#: main.c:724
+#: main.c:725
#, c-format
msgid "Compressed tables always back up.\n"
msgstr "Cúlaíonn táblaí comhbhrúite i gcónaí.\n"
-#: main.c:727
+#: main.c:728
#, c-format
msgid "error writing backup file %s"
msgstr "earráid agus comhad cúltaca %s á scríobh"
-#: main.c:731
+#: main.c:732
#, c-format
msgid "error closing backup file %s"
msgstr "earráid agus comhad cúltaca %s á dhúnadh"
-#: main.c:736
+#: main.c:737
#, c-format
msgid "%s version %s usage statistics:\n"
msgstr "%s leagan %s staitistic d'úsáid:\n"
# fr uses "lexical analyzer"; scanóir seems fine though --KPS
-#: main.c:739
+#: main.c:740
#, c-format
msgid " scanner options: -"
msgstr " roghanna don scanóir: -"
-#: main.c:818
+#: main.c:819
#, c-format
msgid " %d/%d NFA states\n"
msgstr " %d/%d staid NFA\n"
-#: main.c:820
+#: main.c:821
#, c-format
msgid " %d/%d DFA states (%d words)\n"
msgstr " %d/%d staid DFA (%d focal)\n"
-#: main.c:822
+#: main.c:823
#, c-format
msgid " %d rules\n"
msgstr " %d riail\n"
-#: main.c:827
+#: main.c:828
#, c-format
msgid " No backing up\n"
msgstr " Ná cúlaítear\n"
-#: main.c:831
+#: main.c:832
#, c-format
msgid " %d backing-up (non-accepting) states\n"
msgstr " %d staid chúlaithe (níl ina staid ghlactha)\n"
-#: main.c:836
+#: main.c:837
#, c-format
msgid " Compressed tables always back-up\n"
msgstr " Cúlaíonn táblaí comhbhrúite i gcónaí\n"
-#: main.c:840
+#: main.c:841
#, c-format
msgid " Beginning-of-line patterns used\n"
msgstr " Patrúin úsáidte ag ceann líne\n"
-#: main.c:842
+#: main.c:843
#, c-format
msgid " %d/%d start conditions\n"
msgstr " %d/%d coinníoll tosaigh\n"
-#: main.c:846
+#: main.c:847
#, c-format
msgid " %d epsilon states, %d double epsilon states\n"
msgstr " %d staid eipsealóin, %d staid eipsealóin dúbailte\n"
-#: main.c:850
+#: main.c:851
#, c-format
msgid " no character classes\n"
msgstr " níl aon aicme charachtair\n"
-#: main.c:854
+#: main.c:855
#, c-format
msgid " %d/%d character classes needed %d/%d words of storage, %d reused\n"
-msgstr ""
-" tá gá le %d/%d aicme charachtair %d/%d focal stórála, %d athúsáidte\n"
+msgstr " tá gá le %d/%d aicme charachtair %d/%d focal stórála, %d athúsáidte\n"
-#: main.c:859
+#: main.c:860
#, c-format
msgid " %d state/nextstate pairs created\n"
msgstr " %d péire state/nextstate\n"
-#: main.c:862
+#: main.c:863
#, c-format
msgid " %d/%d unique/duplicate transitions\n"
msgstr " %d/%d athrú sainiúil/dúblach\n"
-#: main.c:867
+#: main.c:868
#, c-format
msgid " %d table entries\n"
msgstr " %d iontráil sa tábla\n"
-#: main.c:875
+#: main.c:876
#, c-format
msgid " %d/%d base-def entries created\n"
msgstr " %d/%d iontráil base-def\n"
-#: main.c:879
+#: main.c:880
#, c-format
msgid " %d/%d (peak %d) nxt-chk entries created\n"
msgstr " %d/%d (buaic %d) iontráil nxt-chk\n"
-#: main.c:883
+#: main.c:884
#, c-format
msgid " %d/%d (peak %d) template nxt-chk entries created\n"
msgstr " %d/%d (buaic %d) iontráil teimpléid nxt-chk\n"
-#: main.c:887
+#: main.c:888
#, c-format
msgid " %d empty table entries\n"
msgstr " %d iontráil tábla folamh\n"
-#: main.c:889
+#: main.c:890
#, c-format
msgid " %d protos created\n"
msgstr " %d fréamhshamhail\n"
-#: main.c:892
+#: main.c:893
#, c-format
msgid " %d templates created, %d uses\n"
msgstr " %d teimpléad, %d i bhfeidhm\n"
-#: main.c:900
+#: main.c:901
#, c-format
msgid " %d/%d equivalence classes created\n"
msgstr " %d/%d aicme choibhéise\n"
-#: main.c:908
+#: main.c:909
#, c-format
msgid " %d/%d meta-equivalence classes created\n"
msgstr " %d/%d aicme mheiteachoibhéise\n"
-#: main.c:914
+#: main.c:915
#, c-format
msgid " %d (%d saved) hash collisions, %d DFAs equal\n"
msgstr " %d (%d sábháilte) tuairt haiseála, %d DFA comhionann le chéile\n"
-#: main.c:916
+#: main.c:917
#, c-format
msgid " %d sets of reallocations needed\n"
msgstr " tá gá le %d sraith athdháilte\n"
-#: main.c:918
+#: main.c:919
#, c-format
msgid " %d total table entries needed\n"
msgstr " tá gá le %d iontráil tábla ar fad\n"
-#: main.c:995
+#: main.c:996
#, c-format
msgid "Internal error. flexopts are malformed.\n"
msgstr "Earráid inmheánach (flexopts míchumtha).\n"
-#: main.c:1005
+#: main.c:1006
#, c-format
msgid "Try `%s --help' for more information.\n"
msgstr "Bain triail as `%s --help' chun tuilleadh eolais a fháil.\n"
-#: main.c:1062
+#: main.c:1063
#, c-format
msgid "unknown -C option '%c'"
msgstr "rogha -C anaithnid '%c'"
-#: main.c:1191
+#: main.c:1192
#, c-format
msgid "%s %s\n"
msgstr "%s %s\n"
-#: main.c:1466
+#: main.c:1467
msgid "fatal parse error"
msgstr "earráid pharsála mharfach"
-#: main.c:1498
+#: main.c:1499
#, c-format
msgid "could not create backing-up info file %s"
msgstr "níorbh fhéidir comhad %s a chruthú don eolas faoin chúlú"
-#: main.c:1519
+#: main.c:1520
#, c-format
msgid "-l AT&T lex compatibility option entails a large performance penalty\n"
msgstr "is cúis le moilliú mór an rogha -l (comhoiriúnacht le AT&T lex)\n"
-#: main.c:1522
+#: main.c:1523
#, c-format
msgid " and may be the actual source of other reported performance penalties\n"
msgstr " agus is féidir gur cúis é le fadhbanna luais eile é\n"
-#: main.c:1528
+#: main.c:1529
#, c-format
-msgid ""
-"%%option yylineno entails a performance penalty ONLY on rules that can match "
-"newline characters\n"
-msgstr ""
-"is cúis le moilliú mór an %%rogha yylineno, Mà tá rialacha ann le línte nua "
-"iontu\n"
+msgid "%%option yylineno entails a performance penalty ONLY on rules that can match newline characters\n"
+msgstr "is cúis le moilliú mór an %%rogha yylineno, Mà tá rialacha ann le línte nua iontu\n"
-#: main.c:1535
+#: main.c:1536
#, c-format
msgid "-I (interactive) entails a minor performance penalty\n"
msgstr "is cúis le moilliú beag an rogha -I (idirghníomhach)\n"
-#: main.c:1540
+#: main.c:1541
#, c-format
msgid "yymore() entails a minor performance penalty\n"
msgstr "is cúis le moilliú beag an fheidhm yymore()\n"
-#: main.c:1546
+#: main.c:1547
#, c-format
msgid "REJECT entails a large performance penalty\n"
msgstr "is REJECT cúis le moilliú mór\n"
-#: main.c:1551
+#: main.c:1552
#, c-format
msgid "Variable trailing context rules entail a large performance penalty\n"
-msgstr ""
-"is cúis le moilliú na rialacha maidir le comhthéacs sraoilleach "
-"athraitheach\n"
+msgstr "is cúis le moilliú na rialacha maidir le comhthéacs sraoilleach athraitheach\n"
-#: main.c:1563
+#: main.c:1564
msgid "REJECT cannot be used with -f or -F"
msgstr "Níl REJECT ar fáil leis na roghanna -f nó -F"
-#: main.c:1566
+#: main.c:1567
#, c-format
msgid "%option yylineno cannot be used with REJECT"
msgstr "níl %option yylineno ar fáil le REJECT"
-#: main.c:1569
+#: main.c:1570
msgid "variable trailing context rules cannot be used with -f or -F"
-msgstr ""
-"níl rialacha maidir le comhthéacs sraoilleach athraitheach ar fáil le -f nó -"
-"F"
+msgstr "níl rialacha maidir le comhthéacs sraoilleach athraitheach ar fáil le -f nó -F"
-#: main.c:1692
+#: main.c:1691
#, c-format
msgid "%option yyclass only meaningful for C++ scanners"
msgstr "tá an %option yyclass gan bhrí ach amháin le scanóirí C++"
-#: main.c:1799
+#: main.c:1798
#, c-format
msgid "Usage: %s [OPTIONS] [FILE]...\n"
msgstr "Úsáid: %s [ROGHANNA] [COMHAD]...\n"
-#: main.c:1802
+#: main.c:1801
#, c-format
msgid ""
"Generates programs that perform pattern-matching on text.\n"
@@ -563,8 +546,7 @@ msgid ""
" -S, --skel=FILE specify skeleton file\n"
" -t, --stdout write scanner on stdout instead of %s\n"
" --yyclass=NAME name of C++ class\n"
-" --header-file=FILE create a C header file in addition to the "
-"scanner\n"
+" --header-file=FILE create a C header file in addition to the scanner\n"
" --tables-file[=FILE] write tables to FILE\n"
"\n"
"Scanner behavior:\n"
@@ -618,24 +600,21 @@ msgstr ""
" -s, --nodefault ná déan macalla de théacs neamh-chomhoiriúnach\n"
" -T, --trace ba chóir do %s a rith sa mhód loirg\n"
" -w, --nowarn ná taispeáin rabhaidh\n"
-" -v, --verbose taispeáin achoimre ar staitistic scanóra chuig "
-"stdout\n"
+" -v, --verbose taispeáin achoimre ar staitistic scanóra chuig stdout\n"
"\n"
"Comhaid:\n"
" -o, --outfile=COMHAD roghnaigh ainm comhaid le haghaidh aschuir\n"
" -S, --skel=COMHAD roghnaigh creatchomhad\n"
" -t, --stdout scríobh an scanóir chuig stdout in ionad %s\n"
" --yyclass=COMHAD ainm de `class' C++\n"
-" --header-file=COMHAD scríobh comhad ceanntáisc C i dteannta an "
-"scanóra\n"
+" --header-file=COMHAD scríobh comhad ceanntáisc C i dteannta an scanóra\n"
" --tables-file[=COMHAD] scríobh na táblaí chuig COMHAD\n"
"\n"
"Scanóir:\n"
" -7, --7bit gin scanóir 7-giotán\n"
" -8, --8bit gin scanóir 8-giotán\n"
" -B, --batch gin scanóir baisce (i gcodarsnacht le -I)\n"
-" -i, --case-insensitive déan neamhshuim ar cheannlitreacha/litreacha "
-"beaga\n"
+" -i, --case-insensitive déan neamhshuim ar cheannlitreacha/litreacha beaga\n"
" -l, --lex-compat comhoiriúnacht le lex bunúsach, a mhéad is féidir\n"
" -X, --posix-compat comhoiriúnacht le lex POSIX, a mhéad is féidir\n"
" -I, --interactive gin scanóir idirghníomhach (i gcodarsnacht le -B)\n"
@@ -662,47 +641,43 @@ msgstr ""
" -h, --help taispeáin an chabhair seo\n"
" -V, --version taispeáin leagan %s\n"
-#: misc.c:65
-msgid "allocation of sko_stack failed"
-msgstr ""
-
-#: misc.c:102 misc.c:128
+#: misc.c:100 misc.c:126
#, c-format
msgid "name \"%s\" ridiculously long"
msgstr "tá an t-ainm \"%s\" i bhfad Éireann rófhada"
-#: misc.c:177
+#: misc.c:175
msgid "memory allocation failed in allocate_array()"
msgstr "theip ar dháileadh na cuimhne i allocate_array()"
-#: misc.c:230
+#: misc.c:250
#, c-format
msgid "bad character '%s' detected in check_char()"
msgstr "aimsíodh carachtar neamhbhailí '%s' i check_char()"
-#: misc.c:235
+#: misc.c:255
#, c-format
msgid "scanner requires -8 flag to use the character %s"
msgstr "ní foláir an rogha -8 chun an charachtair %s a úsáid"
-#: misc.c:268
+#: misc.c:288
msgid "dynamic memory failure in copy_string()"
msgstr "theip ar dháileadh na cuimhne i copy_string()"
-#: misc.c:367
+#: misc.c:422
#, c-format
msgid "%s: fatal internal error, %s\n"
msgstr "%s: earráid inmheánach mharfach, %s\n"
-#: misc.c:803
+#: misc.c:875
msgid "attempt to increase array size failed"
msgstr "theip ar mhéadú an eagair"
-#: misc.c:930
+#: misc.c:1002
msgid "bad line in skeleton file"
msgstr "drochlíne i gcreatchomhad"
-#: misc.c:979
+#: misc.c:1051
msgid "memory allocation failed in yy_flex_xmalloc()"
msgstr "theip ar dháileadh na cuimhne i yy_flex_xmalloc()"
@@ -736,20 +711,20 @@ msgstr "meaisín folamh i dupmachine()"
msgid "Variable trailing context rule at line %d\n"
msgstr "riail maidir le comhthéacs sraoilleach athraitheach ag líne %d\n"
-#: nfa.c:364
+#: nfa.c:353
msgid "bad state type in mark_beginning_as_normal()"
msgstr "drochstaid i mark_beginning_as_normal()"
-#: nfa.c:609
+#: nfa.c:598
#, c-format
msgid "input rules are too complicated (>= %d NFA states)"
msgstr "is róchasta na rialacha ionchuir (>= %d staid NFA)"
-#: nfa.c:688
+#: nfa.c:677
msgid "found too many transitions in mkxtion()"
msgstr "an iomarca athruithe i mkxtion()"
-#: nfa.c:714
+#: nfa.c:703
#, c-format
msgid "too many rules (> %d)!"
msgstr "an iomarca rialacha (> %d)!"
@@ -778,30 +753,24 @@ msgstr "luachanna timthrialla neamhbhailí"
msgid "iteration value must be positive"
msgstr "ní foláir luach timthrialla deimhneach"
-#: parse.y:804 parse.y:814
+#: parse.y:806 parse.y:816
#, c-format
msgid "the character range [%c-%c] is ambiguous in a case-insensitive scanner"
-msgstr ""
-"tá an raon carachtair [%c-%c] débhríoch i scanóir a dhéanann neamhshuim ar "
-"cheannlitreacha agus litreacha beaga"
+msgstr "tá an raon carachtair [%c-%c] débhríoch i scanóir a dhéanann neamhshuim ar cheannlitreacha agus litreacha beaga"
-#: parse.y:819
+#: parse.y:821
msgid "negative range in character class"
msgstr "raon diúltach in aicme charachtair"
-#: parse.y:916
+#: parse.y:918
msgid "[:^lower:] is ambiguous in case insensitive scanner"
-msgstr ""
-"tá [:^lower:] débhríoch i scanóir a dhéanann neamhshuim ar cheannlitreacha "
-"agus litreacha beaga"
+msgstr "tá [:^lower:] débhríoch i scanóir a dhéanann neamhshuim ar cheannlitreacha agus litreacha beaga"
-#: parse.y:922
+#: parse.y:924
msgid "[:^upper:] ambiguous in case insensitive scanner"
-msgstr ""
-"tá [:^upper:] débhríoch i scanóir a dhéanann neamhshuim ar cheannlitreacha "
-"agus litreacha beaga"
+msgstr "tá [:^upper:] débhríoch i scanóir a dhéanann neamhshuim ar cheannlitreacha agus litreacha beaga"
-#: scan.l:75 scan.l:618 scan.l:676
+#: scan.l:75 scan.l:192 scan.l:300 scan.l:443 scan.l:618 scan.l:676
msgid "Input line too long\n"
msgstr "Tá líne an ionchuir rófhada\n"
@@ -815,29 +784,14 @@ msgstr "treoir '%top' míchumtha"
msgid "unrecognized '%' directive"
msgstr "treoir '%' anaithnid"
-#: scan.l:192
-#, fuzzy
-msgid "Definition name too long\n"
-msgstr "Tá líne an ionchuir rófhada\n"
-
#: scan.l:284
msgid "Unmatched '{'"
msgstr "'{' corr"
-#: scan.l:300
-#, c-format
-msgid "Definition value for {%s} too long\n"
-msgstr ""
-
#: scan.l:317
msgid "incomplete name definition"
msgstr "is neamhiomlán an sainmhíniú ainm"
-#: scan.l:443
-#, fuzzy
-msgid "Option line too long\n"
-msgstr "Tá líne an ionchuir rófhada\n"
-
#: scan.l:451
#, c-format
msgid "unrecognized %%option: %s"
@@ -897,27 +851,27 @@ msgstr "ní féidir %s a oscailt"
msgid "Usage: %s [OPTIONS]...\n"
msgstr "Úsáid: %s [ROGHANNA]...\n"
-#: scanopt.c:564
+#: scanopt.c:565
#, c-format
msgid "option `%s' doesn't allow an argument\n"
msgstr "ní cheadaítear argóint i ndiaidh na rogha `%s'\n"
-#: scanopt.c:569
+#: scanopt.c:570
#, c-format
msgid "option `%s' requires an argument\n"
msgstr "tá argóint de dhíth i ndiaidh na rogha `%s'\n"
-#: scanopt.c:573
+#: scanopt.c:574
#, c-format
msgid "option `%s' is ambiguous\n"
msgstr "tá an rogha `%s' débhríoch\n"
-#: scanopt.c:577
+#: scanopt.c:578
#, c-format
msgid "Unrecognized option `%s'\n"
msgstr "Rogha anaithnid `%s'\n"
-#: scanopt.c:581
+#: scanopt.c:582
#, c-format
msgid "Unknown error=(%d)\n"
msgstr "Earráid anaithnid=(%d)\n"
diff --git a/po/hr.po b/po/hr.po
index 80b1fb0..9ae76bc 100644
--- a/po/hr.po
+++ b/po/hr.po
@@ -1,13 +1,28 @@
-# Translation of flex to Croatian.
-# Copyright (C) 2012 The Flex Project (msgids)
-# This file is put in the public domain.
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR Free Software Foundation, Inc.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
-# Tomislav Krznar <tomislav.krznar@gmail.com>, 2012.
+#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: flex 2.5.37\n"
-"Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2014-03-26 15:00-0400\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"PO-Revision-Date: 2016-01-22 13:31-0800\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#~ # Translation of flex to Croatian.
+#~ # Copyright (C) 2012 The Flex Project (msgids)
+#~ # This file is put in the public domain.
+#~ #
+#~ # Tomislav Krznar <tomislav.krznar@gmail.com>, 2012.
+#~ msgid ""
+#~ msgstr ""
+#~ "Project-Id-Version: flex 2.5.37\n"
+#~ "Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n"
+"POT-Creation-Date: 2012-07-22 20:48-0400\n"
"PO-Revision-Date: 2012-10-05 16:48+0200\n"
"Last-Translator: Tomislav Krznar <tomislav.krznar@gmail.com>\n"
"Language-Team: Croatian <lokalizacija@linux.hr>\n"
@@ -15,8 +30,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
-"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: Lokalize 1.4\n"
#: buf.c:78
@@ -163,357 +177,355 @@ msgstr ""
msgid "Could not write yynultrans_tbl"
msgstr ""
-#: main.c:191
+#: main.c:189
msgid "rule cannot be matched"
msgstr ""
-#: main.c:196
+#: main.c:194
msgid "-s option given but default rule can be matched"
msgstr ""
-#: main.c:236
+#: main.c:234
msgid "Can't use -+ with -l option"
msgstr ""
-#: main.c:239
+#: main.c:237
msgid "Can't use -f or -F with -l option"
msgstr ""
-#: main.c:243
+#: main.c:241
msgid "Can't use --reentrant or --bison-bridge with -l option"
msgstr ""
-#: main.c:275
+#: main.c:278
msgid "-Cf/-CF and -Cm don't make sense together"
msgstr ""
-#: main.c:278
+#: main.c:281
msgid "-Cf/-CF and -I are incompatible"
msgstr ""
-#: main.c:282
+#: main.c:285
msgid "-Cf/-CF are incompatible with lex-compatibility mode"
msgstr ""
-#: main.c:287
+#: main.c:290
msgid "-Cf and -CF are mutually exclusive"
msgstr ""
-#: main.c:291
+#: main.c:294
msgid "Can't use -+ with -CF option"
msgstr ""
-#: main.c:294
+#: main.c:297
#, c-format
msgid "%array incompatible with -+ option"
msgstr ""
-#: main.c:299
+#: main.c:302
msgid "Options -+ and --reentrant are mutually exclusive."
msgstr ""
-#: main.c:302
+#: main.c:305
msgid "bison bridge not supported for the C++ scanner."
msgstr ""
-#: main.c:357 main.c:403
+#: main.c:360 main.c:406
#, c-format
msgid "could not create %s"
msgstr ""
-#: main.c:416
+#: main.c:419
msgid "could not write tables header"
msgstr ""
-#: main.c:420
+#: main.c:423
#, c-format
msgid "can't open skeleton file %s"
msgstr ""
-#: main.c:456
+#: main.c:459
msgid "allocation of macro definition failed"
msgstr ""
-#: main.c:504
+#: main.c:507
#, c-format
msgid "input error reading skeleton file %s"
msgstr ""
-#: main.c:508
+#: main.c:511
#, c-format
msgid "error closing skeleton file %s"
msgstr "greška pri zatvaranju datoteke predloška %s"
-#: main.c:693
+#: main.c:696
#, c-format
msgid "error creating header file %s"
msgstr "greška pri stvaranju datoteke zaglavlja %s"
-#: main.c:701
+#: main.c:704
#, c-format
msgid "error writing output file %s"
msgstr "greška pri pisanju izlazne datoteke %s"
-#: main.c:705
+#: main.c:708
#, c-format
msgid "error closing output file %s"
msgstr "greška pri zatvaranju izlazne datoteke %s"
-#: main.c:709
+#: main.c:712
#, c-format
msgid "error deleting output file %s"
msgstr "greška pri uklanjanju izlazne datoteke %s"
-#: main.c:716
+#: main.c:719
#, c-format
msgid "No backing up.\n"
msgstr ""
-#: main.c:720
+#: main.c:723
#, c-format
msgid "%d backing up (non-accepting) states.\n"
msgstr ""
-#: main.c:724
+#: main.c:727
#, c-format
msgid "Compressed tables always back up.\n"
msgstr ""
-#: main.c:727
+#: main.c:730
#, c-format
msgid "error writing backup file %s"
msgstr ""
-#: main.c:731
+#: main.c:734
#, c-format
msgid "error closing backup file %s"
msgstr ""
-#: main.c:736
+#: main.c:739
#, c-format
msgid "%s version %s usage statistics:\n"
msgstr ""
-#: main.c:739
+#: main.c:742
#, c-format
msgid " scanner options: -"
msgstr ""
-#: main.c:818
+#: main.c:821
#, c-format
msgid " %d/%d NFA states\n"
msgstr ""
-#: main.c:820
+#: main.c:823
#, c-format
msgid " %d/%d DFA states (%d words)\n"
msgstr ""
-#: main.c:822
+#: main.c:825
#, c-format
msgid " %d rules\n"
msgstr ""
-#: main.c:827
+#: main.c:830
#, c-format
msgid " No backing up\n"
msgstr ""
-#: main.c:831
+#: main.c:834
#, c-format
msgid " %d backing-up (non-accepting) states\n"
msgstr ""
-#: main.c:836
+#: main.c:839
#, c-format
msgid " Compressed tables always back-up\n"
msgstr ""
-#: main.c:840
+#: main.c:843
#, c-format
msgid " Beginning-of-line patterns used\n"
msgstr ""
-#: main.c:842
+#: main.c:845
#, c-format
msgid " %d/%d start conditions\n"
msgstr ""
-#: main.c:846
+#: main.c:849
#, c-format
msgid " %d epsilon states, %d double epsilon states\n"
msgstr ""
-#: main.c:850
+#: main.c:853
#, c-format
msgid " no character classes\n"
msgstr ""
-#: main.c:854
+#: main.c:857
#, c-format
msgid " %d/%d character classes needed %d/%d words of storage, %d reused\n"
msgstr ""
-#: main.c:859
+#: main.c:862
#, c-format
msgid " %d state/nextstate pairs created\n"
msgstr ""
-#: main.c:862
+#: main.c:865
#, c-format
msgid " %d/%d unique/duplicate transitions\n"
msgstr ""
-#: main.c:867
+#: main.c:870
#, c-format
msgid " %d table entries\n"
msgstr ""
-#: main.c:875
+#: main.c:878
#, c-format
msgid " %d/%d base-def entries created\n"
msgstr ""
-#: main.c:879
+#: main.c:882
#, c-format
msgid " %d/%d (peak %d) nxt-chk entries created\n"
msgstr ""
-#: main.c:883
+#: main.c:886
#, c-format
msgid " %d/%d (peak %d) template nxt-chk entries created\n"
msgstr ""
-#: main.c:887
+#: main.c:890
#, c-format
msgid " %d empty table entries\n"
msgstr ""
-#: main.c:889
+#: main.c:892
#, c-format
msgid " %d protos created\n"
msgstr ""
-#: main.c:892
+#: main.c:895
#, c-format
msgid " %d templates created, %d uses\n"
msgstr ""
-#: main.c:900
+#: main.c:903
#, c-format
msgid " %d/%d equivalence classes created\n"
msgstr ""
-#: main.c:908
+#: main.c:911
#, c-format
msgid " %d/%d meta-equivalence classes created\n"
msgstr ""
-#: main.c:914
+#: main.c:917
#, c-format
msgid " %d (%d saved) hash collisions, %d DFAs equal\n"
msgstr ""
-#: main.c:916
+#: main.c:919
#, c-format
msgid " %d sets of reallocations needed\n"
msgstr ""
-#: main.c:918
+#: main.c:921
#, c-format
msgid " %d total table entries needed\n"
msgstr ""
-#: main.c:995
+#: main.c:998
#, c-format
msgid "Internal error. flexopts are malformed.\n"
msgstr ""
-#: main.c:1005
+#: main.c:1008
#, c-format
msgid "Try `%s --help' for more information.\n"
msgstr "Pokušajte „%s --help†za više informacija.\n"
-#: main.c:1062
+#: main.c:1065
#, c-format
msgid "unknown -C option '%c'"
msgstr "nepoznata -C opcija „%câ€"
-#: main.c:1191
+#: main.c:1194
#, c-format
msgid "%s %s\n"
msgstr "%s %s\n"
-#: main.c:1466
+#: main.c:1469
msgid "fatal parse error"
msgstr "fatalna greška analize"
-#: main.c:1498
+#: main.c:1501
#, c-format
msgid "could not create backing-up info file %s"
msgstr ""
-#: main.c:1519
+#: main.c:1522
#, c-format
msgid "-l AT&T lex compatibility option entails a large performance penalty\n"
msgstr ""
-#: main.c:1522
+#: main.c:1525
#, c-format
msgid " and may be the actual source of other reported performance penalties\n"
msgstr ""
-#: main.c:1528
+#: main.c:1531
#, c-format
-msgid ""
-"%%option yylineno entails a performance penalty ONLY on rules that can match "
-"newline characters\n"
+msgid "%%option yylineno entails a performance penalty ONLY on rules that can match newline characters\n"
msgstr ""
-#: main.c:1535
+#: main.c:1538
#, c-format
msgid "-I (interactive) entails a minor performance penalty\n"
msgstr ""
-#: main.c:1540
+#: main.c:1543
#, c-format
msgid "yymore() entails a minor performance penalty\n"
msgstr ""
-#: main.c:1546
+#: main.c:1549
#, c-format
msgid "REJECT entails a large performance penalty\n"
msgstr ""
-#: main.c:1551
+#: main.c:1554
#, c-format
msgid "Variable trailing context rules entail a large performance penalty\n"
msgstr ""
-#: main.c:1563
+#: main.c:1566
msgid "REJECT cannot be used with -f or -F"
msgstr ""
-#: main.c:1566
+#: main.c:1569
#, c-format
msgid "%option yylineno cannot be used with REJECT"
msgstr ""
-#: main.c:1569
+#: main.c:1572
msgid "variable trailing context rules cannot be used with -f or -F"
msgstr ""
-#: main.c:1692
+#: main.c:1695
#, c-format
msgid "%option yyclass only meaningful for C++ scanners"
msgstr ""
-#: main.c:1799
+#: main.c:1802
#, c-format
msgid "Usage: %s [OPTIONS] [FILE]...\n"
msgstr "Uporaba: %s [OPCIJE] [DATOTEKA]...\n"
-#: main.c:1802
+#: main.c:1805
#, c-format
msgid ""
"Generates programs that perform pattern-matching on text.\n"
@@ -543,8 +555,7 @@ msgid ""
" -S, --skel=FILE specify skeleton file\n"
" -t, --stdout write scanner on stdout instead of %s\n"
" --yyclass=NAME name of C++ class\n"
-" --header-file=FILE create a C header file in addition to the "
-"scanner\n"
+" --header-file=FILE create a C header file in addition to the scanner\n"
" --tables-file[=FILE] write tables to FILE\n"
"\n"
"Scanner behavior:\n"
@@ -650,20 +661,20 @@ msgstr ""
msgid "Variable trailing context rule at line %d\n"
msgstr ""
-#: nfa.c:364
+#: nfa.c:353
msgid "bad state type in mark_beginning_as_normal()"
msgstr ""
-#: nfa.c:609
+#: nfa.c:598
#, c-format
msgid "input rules are too complicated (>= %d NFA states)"
msgstr ""
-#: nfa.c:688
+#: nfa.c:677
msgid "found too many transitions in mkxtion()"
msgstr ""
-#: nfa.c:714
+#: nfa.c:703
#, c-format
msgid "too many rules (> %d)!"
msgstr "previše pravila (> %d)!"
diff --git a/po/ko.po b/po/ko.po
index 1255643..98325aa 100644
--- a/po/ko.po
+++ b/po/ko.po
@@ -1,1021 +1,668 @@
-# flex-2.5.2 Korean po file
-# Copyright (C) 1996 The Flex Project
-# Choi Jun Ho <junker@jazz.snu.ac.kr>, 1997.
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR Free Software Foundation, Inc.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
+#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: flex 2.5.2\n"
-"Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2014-03-26 15:00-0400\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"PO-Revision-Date: 2016-01-22 13:20-0800\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#~ # flex-2.5.2 Korean po file
+#~ # Copyright (C) 1996 The Flex Project
+#~ # Choi Jun Ho <junker@jazz.snu.ac.kr>, 1997.
+#~ #
+#~ msgid ""
+#~ msgstr ""
+#~ "Project-Id-Version: flex 2.5.2\n"
"PO-Revision-Date: 1997-02-05 20:30\n"
"Last-Translator: Choi Jun Ho <junker@jazz.snu.ac.kr>\n"
"Language-Team: Korean <ko@li.org>\n"
-"Language: ko\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=EUC-KR\n"
"Content-Transfer-Encoding: 8-bit\n"
-#: buf.c:78
-msgid "Allocation of buffer to print string failed"
-msgstr ""
+#: main.c:361
+msgid "input error reading skeleton file %s"
+msgstr "½ºÄÌ·¹Åæ ÆÄÀÏ %s¸¦ Àд µµÁß ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù"
-#: buf.c:100
-msgid "Allocation of buffer for line directive failed"
-msgstr ""
+#: main.c:898
+msgid " and may be the actual source of other reported performance penalties\n"
+msgstr " ±×¸®°í ¾Æ¸¶µµ ´Ù¸¥ º¸°íµÈ ¼º´É ÀúÇÏÀÇ ½ÇÁ¦ ¿øÀÎÀÏ °ÍÀÔ´Ï´Ù\n"
-#: buf.c:177
-msgid "Allocation of buffer for m4 def failed"
+#: main.c:814
+msgid ""
+"%s: unknown flag '%c'. For usage, try\n"
+"\t%s --help\n"
msgstr ""
+"%s: ¾Ë ¼ö ¾ø´Â ¿É¼Ç '%c'. »ç¿ë¹ýÀ» º¸·Á¸é \n"
+"\t%s --help¶ó°í Çϼ¼¿ä.\n"
-#: buf.c:197
-msgid "Allocation of buffer for m4 undef failed"
-msgstr ""
+#: dfa.c:211
+msgid " out-transitions: "
+msgstr " ³ª°¡´Â ÂÊ ÀüÀÌ: "
-#: dfa.c:61
-#, c-format
-msgid "State #%d is non-accepting -\n"
-msgstr "»óŹøÈ£ %d´Â ¹Þ¾ÆµéÀÌÁö ¾Ê´Â -ÀÔ´Ï´Ù\n"
+#: main.c:394
+msgid "Compressed tables always back up.\n"
+msgstr " ¾ÐÃàµÈ Å×À̺íÀº Ç×»ó ¹é¾÷ÇÕ´Ï´Ù.\n"
+
+#: main.c:896
+msgid "-l AT&T lex compatibility option entails a large performance penalty\n"
+msgstr "-l AT&T lex ȣȯ ¿É¼ÇÀº Å« ¼º´É ÀúÇϸ¦ ÀÏÀ¸Åµ´Ï´Ù\n"
+
+#: scan.l:493
+msgid "missing quote"
+msgstr "Àοë±âÈ£ ºüÁü"
-#: dfa.c:124
+#: dfa.c:130
msgid "dangerous trailing context"
msgstr "À§ÇèÇÑ ÃßÀû ¹®¸Æ"
-#: dfa.c:166
-#, c-format
-msgid " associated rule line numbers:"
-msgstr " °ü·Ã ±ÔÄ¢ Çà¹øÈ£:"
+#: main.c:556
+msgid " %d/%d equivalence classes created\n"
+msgstr " %d/%d°³ÀÇ µ¿Ä¡·ù°¡ ¸¸µé¾îÁ³½À´Ï´Ù\n"
-#: dfa.c:202
-#, c-format
-msgid " out-transitions: "
-msgstr " ³ª°¡´Â ÂÊ ÀüÀÌ: "
+#: main.c:158
+msgid "-s option given but default rule can be matched"
+msgstr "-s ¿É¼ÇÀÌ ÁÖ¾îÁ³Áö¸¸ ±âº» ±ÔÄ¢ÀÌ Àû¿ëµÉ ¼ö ÀÖ½À´Ï´Ù"
-#: dfa.c:210
-#, c-format
-msgid ""
-"\n"
-" jam-transitions: EOF "
-msgstr ""
-"\n"
-" Àë-ÀüÀÌ: EOF "
+#: main.c:762
+msgid "-P flag must be given separately"
+msgstr "-P Ç÷¡±×´Â µû·Î ÁÖ¾î¾ß ÇÕ´Ï´Ù"
-#: dfa.c:341
-msgid "consistency check failed in epsclosure()"
-msgstr "epsclosure()¿¡¼­ ÀÏ°ü¼º °Ë»ç°¡ ½ÇÆÐÇß½À´Ï´Ù"
+#: gen.c:426 gen.c:902
+msgid "state # %d accepts: [%d]\n"
+msgstr "»óŹøÈ£ %d´Â [%d]¸¦ ¹Þ¾ÆµéÀÔ´Ï´Ù\n"
-#: dfa.c:429
-msgid ""
-"\n"
-"\n"
-"DFA Dump:\n"
-"\n"
-msgstr ""
-"\n"
-"\n"
-"DFA Ãâ·Â:\n"
-"\n"
+#: main.c:401
+msgid "error closing backup file %s"
+msgstr "¹é¾÷ ÆÄÀÏ %s¸¦ ´Ý´Âµ¥ ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù"
-#: dfa.c:604
-msgid "could not create unique end-of-buffer state"
-msgstr "À¯ÀÏÇÑ ¹öÆÛÀÇ ³¡(end-of-buffer)»óŸ¦ ¸¸µé ¼ö ¾ø¾ú½À´Ï´Ù"
+#: main.c:753
+msgid "-o flag must be given separately"
+msgstr "-o Ç÷¡±×´Â µû·Î ÁÖ¾î¾ß ÇÕ´Ï´Ù"
-#: dfa.c:625
-#, c-format
-msgid "state # %d:\n"
-msgstr "»óŹøÈ£ %d:\n"
+#: main.c:774
+msgid "-S flag must be given separately"
+msgstr "-S Ç÷¡±×´Â µû·Î ÁÖ¾î¾ß ÇÕ´Ï´Ù"
-#: dfa.c:785
-msgid "Could not write yynxt_tbl[][]"
-msgstr ""
+#: main.c:302
+msgid "can't open skeleton file %s"
+msgstr "½ºÄÌ·¹Åæ ÆÄÀÏ %s¸¦ ¿­ ¼ö ¾ø½À´Ï´Ù"
+
+#: main.c:545
+msgid " %d protos created\n"
+msgstr " %d°³ÀÇ ¿øÇüÀÌ ¸¸µé¾îÁ³½À´Ï´Ù\n"
-#: dfa.c:1049
+#: dfa.c:1043
msgid "bad transition character detected in sympartition()"
msgstr "sympartition()¿¡¼­ À߸øµÈ ÀüÀÌ ¹®ÀÚ¸¦ ã¾Ò½À´Ï´Ù"
-#: gen.c:478
-msgid ""
-"\n"
-"\n"
-"Equivalence Classes:\n"
-"\n"
-msgstr ""
-"\n"
-"\n"
-"µ¿Ä¡·ù:\n"
-"\n"
-
-#: gen.c:662 gen.c:691 gen.c:1215
-#, c-format
-msgid "state # %d accepts: [%d]\n"
-msgstr "»óŹøÈ£ %d´Â [%d]¸¦ ¹Þ¾ÆµéÀÔ´Ï´Ù\n"
-
-#: gen.c:1110
-#, c-format
-msgid "state # %d accepts: "
-msgstr "»óŹøÈ£ %d´Â ´ÙÀ½À» ¹Þ¾ÆµéÀÔ´Ï´Ù: "
-
-#: gen.c:1157
-msgid "Could not write yyacclist_tbl"
-msgstr ""
-
-#: gen.c:1233
-msgid "Could not write yyacc_tbl"
-msgstr ""
+#: dfa.c:606
+msgid "state # %d:\n"
+msgstr "»óŹøÈ£ %d:\n"
-#: gen.c:1248 gen.c:1633 gen.c:1656
-#, fuzzy
-msgid "Could not write ecstbl"
-msgstr "%s¸¦ ¸¸µé ¼ö ¾ø½À´Ï´Ù"
+#: main.c:662
+msgid "-C flag must be given separately"
+msgstr "-C Ç÷¡±×´Â µû·Î ÁÖ¾î¾ß ÇÕ´Ï´Ù"
-#: gen.c:1271
-msgid ""
-"\n"
-"\n"
-"Meta-Equivalence Classes:\n"
-msgstr ""
-"\n"
-"\n"
-"¸ÞŸ-µ¿Ä¡·ùµé:\n"
+#: main.c:390
+msgid "%d backing up (non-accepting) states.\n"
+msgstr "%d°³ÀÇ µÇµ¹¸²(¹Þ¾ÆµéÀÌÁö ¾Ê´Â) »óÅÂ.\n"
-#: gen.c:1293
-msgid "Could not write yymeta_tbl"
-msgstr ""
+#: scan.l:136
+msgid "unrecognized '%' directive"
+msgstr "¾Ë ¼ö ¾ø´Â '%' Áö½ÃÀÚ"
-#: gen.c:1354
-#, fuzzy
-msgid "Could not write yybase_tbl"
-msgstr "%s¸¦ ¸¸µé ¼ö ¾ø½À´Ï´Ù"
+#: main.c:543
+msgid " %d empty table entries\n"
+msgstr " %d°³ÀÇ ºó Å×ÀÌºí ¿£Æ®¸®\n"
-#: gen.c:1388
-msgid "Could not write yydef_tbl"
-msgstr ""
+#: main.c:539
+msgid " %d/%d (peak %d) template nxt-chk entries created\n"
+msgstr " %d/%d (ÃÖ´ë %d) ÅÛÇø®Æ® nxt-chk ¿£Æ®¸®°¡ ¸¸µé¾îÁ³½À´Ï´Ù\n"
-#: gen.c:1428
-msgid "Could not write yynxt_tbl"
-msgstr ""
+#: main.c:533
+msgid " %d/%d base-def entries created\n"
+msgstr " %d/%d base-def ¿£Æ®¸®°¡ ¸¸µé¾îÁ³½À´Ï´Ù\n"
-#: gen.c:1464
-msgid "Could not write yychk_tbl"
-msgstr ""
+#: dfa.c:173
+msgid " associated rule line numbers:"
+msgstr " °ü·Ã ±ÔÄ¢ Çà¹øÈ£:"
-#: gen.c:1618 gen.c:1647
-#, fuzzy
-msgid "Could not write ftbl"
-msgstr "%s¸¦ ¸¸µé ¼ö ¾ø½À´Ï´Ù"
+#: scan.l:286
+msgid "unrecognized %%option: %s"
+msgstr "¾Ë ¼ö ¾ø´Â %%option: %s"
-#: gen.c:1624
-#, fuzzy
-msgid "Could not write ssltbl"
-msgstr "%s¸¦ ¸¸µé ¼ö ¾ø½À´Ï´Ù"
+#: main.c:496
+msgid " Compressed tables always back-up\n"
+msgstr " ¾ÐÃàµÈ Å×À̺íÀº Ç×»ó ¹é¾÷ÇÕ´Ï´Ù\n"
-#: gen.c:1675
-#, fuzzy
-msgid "Could not write eoltbl"
-msgstr "%s¸¦ ¸¸µé ¼ö ¾ø½À´Ï´Ù"
+#: main.c:573
+msgid " %d total table entries needed\n"
+msgstr " ÃÑ %d°³ÀÇ Å×ÀÌºí ¿£Æ®¸®°¡ ÇÊ¿äÇÕ´Ï´Ù\n"
-#: gen.c:1735
-msgid "Could not write yynultrans_tbl"
-msgstr ""
+#: main.c:519
+msgid " %d/%d unique/duplicate transitions\n"
+msgstr " %d/%d°³ÀÇ À¯ÀÏÇÑ/Áߺ¹µÇ´Â ÀüÀÌ\n"
-#: main.c:191
-msgid "rule cannot be matched"
-msgstr "¸Â´Â ±ÔÄ¢À» ãÀ» ¼ö ¾ø½À´Ï´Ù"
+#: dfa.c:990
+msgid "consistency check failed in symfollowset"
+msgstr "symfollowset¿¡¼­ ÀÏ°ü¼º °Ë»ç°¡ ½ÇÆÐÇß½À´Ï´Ù"
-#: main.c:196
-msgid "-s option given but default rule can be matched"
-msgstr "-s ¿É¼ÇÀÌ ÁÖ¾îÁ³Áö¸¸ ±âº» ±ÔÄ¢ÀÌ Àû¿ëµÉ ¼ö ÀÖ½À´Ï´Ù"
+#: scan.l:533
+msgid "bad character class expression: %s"
+msgstr "À߸øµÈ ¹®ÀÚ ÁýÇÕ ½Ä: %s"
-#: main.c:236
-msgid "Can't use -+ with -l option"
-msgstr "-l¿É¼Ç¿¡´Â -+¿É¼ÇÀ» °°ÀÌ ¾µ ¼ö ¾ø½À´Ï´Ù"
+#: scan.l:444
+msgid "undefined definition {%s}"
+msgstr "Á¤ÀǵÇÁö ¾ÊÀº Á¤ÀÇ {%s}"
-#: main.c:239
-msgid "Can't use -f or -F with -l option"
-msgstr "-l¿É¼Ç¿¡ -f³ª -F¿É¼ÇÀ» ¾µ ¼ö ¾ø½À´Ï´Ù"
+#: main.c:397
+msgid "error writing backup file %s"
+msgstr "¹é¾÷ ÆÄÀÏ %s¸¦ ¾²´Âµ¥ ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù"
-#: main.c:243
-#, fuzzy
-msgid "Can't use --reentrant or --bison-bridge with -l option"
-msgstr "-l¿É¼Ç¿¡ -f³ª -F¿É¼ÇÀ» ¾µ ¼ö ¾ø½À´Ï´Ù"
+#: scan.l:628
+msgid "EOF encountered inside an action"
+msgstr "µ¿ÀÛ µµÁß¿¡ EOF¸¦ ¸¸³µ½À´Ï´Ù"
-#: main.c:275
-msgid "-Cf/-CF and -Cm don't make sense together"
-msgstr "-Cf/-CF´Â -Cm¿Í °°ÀÌ ¾²¸é Àǹ̰¡ ¾ø½À´Ï´Ù"
+#: main.c:874
+msgid "could not create backing-up info file %s"
+msgstr "µÇµ¹¸² Á¤º¸ ÆÄÀÏ %s¸¦ ¸¸µé ¼ö ¾ø¾ú½À´Ï´Ù"
-#: main.c:278
-msgid "-Cf/-CF and -I are incompatible"
-msgstr "-Cf/-CF¿Í -I´Â °°ÀÌ ¾µ ¼ö ¾ø½À´Ï´Ù"
+#: main.c:548
+msgid " %d templates created, %d uses\n"
+msgstr " %d°³ÀÇ ÅÛÇø®Æ®°¡ ¸¸µé¾îÁö°í, %d°³¸¦ ¾¹´Ï´Ù\n"
-#: main.c:282
+#: main.c:228
msgid "-Cf/-CF are incompatible with lex-compatibility mode"
msgstr "-Cf/-CF ´Â lexȣȯ ¸ðµå¿Í´Â °°ÀÌ ¾µ ¼ö ¾ø½À´Ï´Ù"
-#: main.c:287
-msgid "-Cf and -CF are mutually exclusive"
-msgstr "-Cf¿Í -CF´Â °°ÀÌ ¾µ ¼ö ¾ø½À´Ï´Ù"
+#: scan.l:677
+msgid "can't open %s"
+msgstr "%s¸¦ ¿­ ¼ö ¾ø½À´Ï´Ù"
-#: main.c:291
-msgid "Can't use -+ with -CF option"
-msgstr "-CF¿É¼Ç¿¡ -+¿É¼ÇÀ» °°ÀÌ ¾µ ¼ö ¾ø½À´Ï´Ù"
+#: main.c:489
+msgid " No backing up\n"
+msgstr " µÇµ¹¸²ÀÌ ¾ø½À´Ï´Ù\n"
-#: main.c:294
-#, c-format
-msgid "%array incompatible with -+ option"
-msgstr "%array´Â -+¿É¼Ç°ú °°ÀÌ ¾µ ¼ö ¾ø½À´Ï´Ù"
+#: scan.l:555
+msgid "missing }"
+msgstr "}ÀÌ ºüÁ³½À´Ï´Ù"
-#: main.c:299
-#, fuzzy
-msgid "Options -+ and --reentrant are mutually exclusive."
-msgstr "-Cf¿Í -CF´Â °°ÀÌ ¾µ ¼ö ¾ø½À´Ï´Ù"
+#: main.c:483
+msgid " %d/%d DFA states (%d words)\n"
+msgstr " %d/%d°³ÀÇ DFA »óÅ (%d ´Ü¾î)\n"
-#: main.c:302
-msgid "bison bridge not supported for the C++ scanner."
-msgstr ""
+#: scan.l:648
+msgid "bad character: %s"
+msgstr "À߸øµÈ ¹®ÀÚ: %s"
+
+#: gen.c:925
+msgid "\n\nMeta-Equivalence Classes:\n"
+msgstr "\n\n¸ÞŸ-µ¿Ä¡·ùµé:\n"
-#: main.c:357 main.c:403
-#, c-format
+#: main.c:232
+msgid "-Cf/-CF and %option yylineno are incompatible"
+msgstr "-Cf/-CF¿Í %option yylineno ´Â °°ÀÌ ¾µ ¼ö ¾ø½À´Ï´Ù"
+
+#: main.c:296
msgid "could not create %s"
msgstr "%s¸¦ ¸¸µé ¼ö ¾ø½À´Ï´Ù"
-#: main.c:416
-#, fuzzy
-msgid "could not write tables header"
-msgstr "%s¸¦ ¸¸µé ¼ö ¾ø½À´Ï´Ù"
+#: dfa.c:585
+msgid "could not create unique end-of-buffer state"
+msgstr "À¯ÀÏÇÑ ¹öÆÛÀÇ ³¡(end-of-buffer)»óŸ¦ ¸¸µé ¼ö ¾ø¾ú½À´Ï´Ù"
-#: main.c:420
-#, c-format
-msgid "can't open skeleton file %s"
-msgstr "½ºÄÌ·¹Åæ ÆÄÀÏ %s¸¦ ¿­ ¼ö ¾ø½À´Ï´Ù"
+#: main.c:365
+msgid "error closing skeleton file %s"
+msgstr "½ºÄÌ·¹Åæ ÆÄÀÏ %s¸¦ ´Ý´Âµ¥ ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù"
-#: main.c:456
-msgid "allocation of macro definition failed"
-msgstr ""
+#: main.c:911
+msgid "-I (interactive) entails a minor performance penalty\n"
+msgstr "-I (´ëÈ­Çü) Àº ¼Ò±Ô¸ðÀÇ ¼º´ÉÀúÇϸ¦ ÀÏÀ¸Åµ´Ï´Ù\n"
-#: main.c:504
-#, c-format
-msgid "input error reading skeleton file %s"
-msgstr "½ºÄÌ·¹Åæ ÆÄÀÏ %s¸¦ Àд µµÁß ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù"
+#: main.c:536
+msgid " %d/%d (peak %d) nxt-chk entries created\n"
+msgstr " %d/%d (ÃÖ´ë %d) nxt-chk ¿£Æ®¸®°¡ ¸¸µé¾îÁ³½À´Ï´Ù\n"
-#: main.c:508
-#, c-format
-msgid "error closing skeleton file %s"
-msgstr "½ºÄÌ·¹Åæ ÆÄÀÏ %s¸¦ ´Ý´Âµ¥ ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù"
+#: main.c:235
+msgid "-Cf and -CF are mutually exclusive"
+msgstr "-Cf¿Í -CF´Â °°ÀÌ ¾µ ¼ö ¾ø½À´Ï´Ù"
-#: main.c:693
-#, fuzzy, c-format
-msgid "error creating header file %s"
-msgstr "¹é¾÷ ÆÄÀÏ %s¸¦ ¾²´Âµ¥ ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù"
+#: main.c:407
+msgid "%s version %s usage statistics:\n"
+msgstr "%s ¹öÀü %s »ç¿ë Åë°è:\n"
-#: main.c:701
-#, c-format
-msgid "error writing output file %s"
-msgstr "Ãâ·ÂÆÄÀÏ %s¸¦ ¾²´Â µ¥ ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù"
+#: main.c:221
+msgid "-Cf/-CF and -Cm don't make sense together"
+msgstr "-Cf/-CF´Â -Cm¿Í °°ÀÌ ¾²¸é Àǹ̰¡ ¾ø½À´Ï´Ù"
-#: main.c:705
-#, c-format
-msgid "error closing output file %s"
-msgstr "Ãâ·ÂÆÄÀÏ %s¸¦ ´Ý´Âµ¥ ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù"
+#: main.c:512
+msgid " %d/%d character classes needed %d/%d words of storage, %d reused\n"
+msgstr " %d/%d ¹®ÀÚ ÁýÇÕ¿¡ %d/%d°³ÀÇ ÀúÀå¿ë ¹®ÀÚ°¡ ÇÊ¿äÇß°í, %d°³´Â Àç»ç¿ëµÇ¾ú½À´Ï´Ù.\n"
-#: main.c:709
-#, c-format
+#: main.c:380
msgid "error deleting output file %s"
msgstr "Ãâ·ÂÆÄÀÏ %s¸¦ Áö¿ì´Â µ¥ ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù"
-#: main.c:716
-#, c-format
-msgid "No backing up.\n"
-msgstr "µÇµ¹¸²ÀÌ ¾ø½À´Ï´Ù.\n"
+#: dfa.c:356
+msgid "consistency check failed in epsclosure()"
+msgstr "epsclosure()¿¡¼­ ÀÏ°ü¼º °Ë»ç°¡ ½ÇÆÐÇß½À´Ï´Ù"
-#: main.c:720
-#, c-format
-msgid "%d backing up (non-accepting) states.\n"
-msgstr "%d°³ÀÇ µÇµ¹¸²(¹Þ¾ÆµéÀÌÁö ¾Ê´Â) »óÅÂ.\n"
+#: main.c:481
+msgid " %d/%d NFA states\n"
+msgstr " %d/%d°³ÀÇ NFA »óÅÂ\n"
-#: main.c:724
-#, c-format
-msgid "Compressed tables always back up.\n"
-msgstr " ¾ÐÃàµÈ Å×À̺íÀº Ç×»ó ¹é¾÷ÇÕ´Ï´Ù.\n"
+#: main.c:509
+msgid " no character classes\n"
+msgstr " ¹®ÀÚ·ù°¡ ¾ø½À´Ï´Ù\n"
-#: main.c:727
-#, c-format
-msgid "error writing backup file %s"
-msgstr "¹é¾÷ ÆÄÀÏ %s¸¦ ¾²´Âµ¥ ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù"
+#: main.c:904
+msgid "%%option yylineno entails a large performance penalty\n"
+msgstr "%%option yylineno´Â Å« ¼º´ÉÀúÇϸ¦ ÀÏÀ¸Åµ´Ï´Ù\n"
-#: main.c:731
-#, c-format
-msgid "error closing backup file %s"
-msgstr "¹é¾÷ ÆÄÀÏ %s¸¦ ´Ý´Âµ¥ ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù"
+#: main.c:182
+msgid "Can't use -+ with -l option"
+msgstr "-l¿É¼Ç¿¡´Â -+¿É¼ÇÀ» °°ÀÌ ¾µ ¼ö ¾ø½À´Ï´Ù"
-#: main.c:736
-#, c-format
-msgid "%s version %s usage statistics:\n"
-msgstr "%s ¹öÀü %s »ç¿ë Åë°è:\n"
+#: dfa.c:439
+msgid "\n\nDFA Dump:\n\n"
+msgstr "\n\nDFA Ãâ·Â:\n\n"
-#: main.c:739
-#, c-format
+#: main.c:410
msgid " scanner options: -"
msgstr " ½ºÄ³³Ê ¿É¼Ç: -"
-#: main.c:818
-#, c-format
-msgid " %d/%d NFA states\n"
-msgstr " %d/%d°³ÀÇ NFA »óÅÂ\n"
-
-#: main.c:820
-#, c-format
-msgid " %d/%d DFA states (%d words)\n"
-msgstr " %d/%d°³ÀÇ DFA »óÅ (%d ´Ü¾î)\n"
+#: gen.c:823
+msgid "state # %d accepts: "
+msgstr "»óŹøÈ£ %d´Â ´ÙÀ½À» ¹Þ¾ÆµéÀÔ´Ï´Ù: "
-#: main.c:822
-#, c-format
-msgid " %d rules\n"
-msgstr " %d°³ÀÇ ±ÔÄ¢\n"
+#: main.c:224
+msgid "-Cf/-CF and -I are incompatible"
+msgstr "-Cf/-CF¿Í -I´Â °°ÀÌ ¾µ ¼ö ¾ø½À´Ï´Ù"
-#: main.c:827
-#, c-format
-msgid " No backing up\n"
-msgstr " µÇµ¹¸²ÀÌ ¾ø½À´Ï´Ù\n"
+#: scan.l:480
+msgid "bad <start condition>: %s"
+msgstr "À߸øµÈ <½ÃÀÛ Á¶°Ç>: %s"
-#: main.c:831
-#, c-format
+#: main.c:492
msgid " %d backing-up (non-accepting) states\n"
msgstr " %d°³ÀÇ µÇµ¹¸²(¹Þ¾ÆµéÀÌÁö ¾Ê´Â) »óÅÂ\n"
-#: main.c:836
-#, c-format
-msgid " Compressed tables always back-up\n"
-msgstr " ¾ÐÃàµÈ Å×À̺íÀº Ç×»ó ¹é¾÷ÇÕ´Ï´Ù\n"
-
-#: main.c:840
-#, c-format
-msgid " Beginning-of-line patterns used\n"
-msgstr " Çà ½ÃÀÛ(beginning-of-line) À¯ÇüÀ» »ç¿ëÇÏ¿´½À´Ï´Ù\n"
-
-#: main.c:842
-#, c-format
-msgid " %d/%d start conditions\n"
-msgstr " %d/%d°³ÀÇ ½ÃÀÛÁ¶°Ç\n"
-
-#: main.c:846
-#, c-format
+#: main.c:505
msgid " %d epsilon states, %d double epsilon states\n"
msgstr " %d°³ÀÇ ¿¦½Ç·Ð »óÅÂ, %d°³ÀÇ ÀÌÁß ¿¦½Ç·Ð »óÅÂ\n"
-#: main.c:850
-#, c-format
-msgid " no character classes\n"
-msgstr " ¹®ÀÚ·ù°¡ ¾ø½À´Ï´Ù\n"
-
-#: main.c:854
-#, c-format
-msgid " %d/%d character classes needed %d/%d words of storage, %d reused\n"
-msgstr ""
-" %d/%d ¹®ÀÚ ÁýÇÕ¿¡ %d/%d°³ÀÇ ÀúÀå¿ë ¹®ÀÚ°¡ ÇÊ¿äÇß°í, %d°³´Â Àç»ç¿ëµÇ¾ú½À´Ï"
-"´Ù.\n"
+#: main.c:239
+msgid "Can't use -+ with -CF option"
+msgstr "-CF¿É¼Ç¿¡ -+¿É¼ÇÀ» °°ÀÌ ¾µ ¼ö ¾ø½À´Ï´Ù"
-#: main.c:859
-#, c-format
-msgid " %d state/nextstate pairs created\n"
-msgstr " %d°³ÀÇ »óÅÂ/´ÙÀ½ »óÅ ½ÖÀÌ ¸¸µé¾îÁ³½À´Ï´Ù\n"
+#: main.c:153
+msgid "rule cannot be matched"
+msgstr "¸Â´Â ±ÔÄ¢À» ãÀ» ¼ö ¾ø½À´Ï´Ù"
-#: main.c:862
-#, c-format
-msgid " %d/%d unique/duplicate transitions\n"
-msgstr " %d/%d°³ÀÇ À¯ÀÏÇÑ/Áߺ¹µÇ´Â ÀüÀÌ\n"
+#: main.c:796
+msgid "%s version %s\n"
+msgstr "%s ¹öÀü %s\n"
-#: main.c:867
-#, c-format
+#: main.c:525
msgid " %d table entries\n"
msgstr " %d°³ÀÇ Å×ÀÌºí ¿£Æ®¸®\n"
-#: main.c:875
-#, c-format
-msgid " %d/%d base-def entries created\n"
-msgstr " %d/%d base-def ¿£Æ®¸®°¡ ¸¸µé¾îÁ³½À´Ï´Ù\n"
+#: main.c:702
+msgid "unknown -C option '%c'"
+msgstr "¾Ë ¼ö ¾ø´Â -C ¿É¼Ç '%c'"
-#: main.c:879
-#, c-format
-msgid " %d/%d (peak %d) nxt-chk entries created\n"
-msgstr " %d/%d (ÃÖ´ë %d) nxt-chk ¿£Æ®¸®°¡ ¸¸µé¾îÁ³½À´Ï´Ù\n"
+#: scan.l:412 scan.l:512
+msgid "bad character class"
+msgstr "À߸øµÈ ¹®ÀÚ·ù"
-#: main.c:883
-#, c-format
-msgid " %d/%d (peak %d) template nxt-chk entries created\n"
-msgstr " %d/%d (ÃÖ´ë %d) ÅÛÇø®Æ® nxt-chk ¿£Æ®¸®°¡ ¸¸µé¾îÁ³½À´Ï´Ù\n"
+#: main.c:185
+msgid "Can't use -f or -F with -l option"
+msgstr "-l¿É¼Ç¿¡ -f³ª -F¿É¼ÇÀ» ¾µ ¼ö ¾ø½À´Ï´Ù"
-#: main.c:887
-#, c-format
-msgid " %d empty table entries\n"
-msgstr " %d°³ÀÇ ºó Å×ÀÌºí ¿£Æ®¸®\n"
+#: main.c:571
+msgid " %d sets of reallocations needed\n"
+msgstr " %d°³ÀÇ ÀçÇÒ´ç ÁýÇÕÀÌ ÇÊ¿äÇÕ´Ï´Ù\n"
-#: main.c:889
-#, c-format
-msgid " %d protos created\n"
-msgstr " %d°³ÀÇ ¿øÇüÀÌ ¸¸µé¾îÁ³½À´Ï´Ù\n"
+#: main.c:387
+msgid "No backing up.\n"
+msgstr "µÇµ¹¸²ÀÌ ¾ø½À´Ï´Ù.\n"
-#: main.c:892
-#, c-format
-msgid " %d templates created, %d uses\n"
-msgstr " %d°³ÀÇ ÅÛÇø®Æ®°¡ ¸¸µé¾îÁö°í, %d°³¸¦ ¾¹´Ï´Ù\n"
+#: main.c:243
+msgid "%array incompatible with -+ option"
+msgstr "%array´Â -+¿É¼Ç°ú °°ÀÌ ¾µ ¼ö ¾ø½À´Ï´Ù"
-#: main.c:900
-#, c-format
-msgid " %d/%d equivalence classes created\n"
-msgstr " %d/%d°³ÀÇ µ¿Ä¡·ù°¡ ¸¸µé¾îÁ³½À´Ï´Ù\n"
+#: main.c:485
+msgid " %d rules\n"
+msgstr " %d°³ÀÇ ±ÔÄ¢\n"
-#: main.c:908
-#, c-format
-msgid " %d/%d meta-equivalence classes created\n"
-msgstr " %d/%d ¸ÞŸ µ¿Ä¡·ù°¡ ¸¸µé¾îÁ³½À´Ï´Ù\n"
+#: main.c:517
+msgid " %d state/nextstate pairs created\n"
+msgstr " %d°³ÀÇ »óÅÂ/´ÙÀ½ »óÅ ½ÖÀÌ ¸¸µé¾îÁ³½À´Ï´Ù\n"
-#: main.c:914
-#, c-format
-msgid " %d (%d saved) hash collisions, %d DFAs equal\n"
-msgstr " %d(%d ÀúÀåµÊ)°³ÀÇ ÇØ½Ì Ãæµ¹·Î %d°³ÀÇ DFA°¡ °°°Ô 󸮵˴ϴÙ\n"
+#: scan.l:549
+msgid "bad character inside {}'s"
+msgstr "{}¾ÈÀÇ À߸øµÈ ¹®ÀÚ"
-#: main.c:916
-#, c-format
-msgid " %d sets of reallocations needed\n"
-msgstr " %d°³ÀÇ ÀçÇÒ´ç ÁýÇÕÀÌ ÇÊ¿äÇÕ´Ï´Ù\n"
+#: dfa.c:63
+msgid "State #%d is non-accepting -\n"
+msgstr "»óŹøÈ£ %d´Â ¹Þ¾ÆµéÀÌÁö ¾Ê´Â -ÀÔ´Ï´Ù\n"
-#: main.c:918
-#, c-format
-msgid " %d total table entries needed\n"
-msgstr " ÃÑ %d°³ÀÇ Å×ÀÌºí ¿£Æ®¸®°¡ ÇÊ¿äÇÕ´Ï´Ù\n"
+#: dfa.c:219
+msgid "\n jam-transitions: EOF "
+msgstr "\n Àë-ÀüÀÌ: EOF "
-#: main.c:995
-#, c-format
-msgid "Internal error. flexopts are malformed.\n"
-msgstr ""
+#: main.c:500
+msgid " Beginning-of-line patterns used\n"
+msgstr " Çà ½ÃÀÛ(beginning-of-line) À¯ÇüÀ» »ç¿ëÇÏ¿´½À´Ï´Ù\n"
-#: main.c:1005
-#, c-format
-msgid "Try `%s --help' for more information.\n"
-msgstr ""
+#: main.c:564
+msgid " %d/%d meta-equivalence classes created\n"
+msgstr " %d/%d ¸ÞŸ µ¿Ä¡·ù°¡ ¸¸µé¾îÁ³½À´Ï´Ù\n"
-#: main.c:1062
-#, c-format
-msgid "unknown -C option '%c'"
-msgstr "¾Ë ¼ö ¾ø´Â -C ¿É¼Ç '%c'"
+#: main.c:372
+msgid "error writing output file %s"
+msgstr "Ãâ·ÂÆÄÀÏ %s¸¦ ¾²´Â µ¥ ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù"
-#: main.c:1191
-#, fuzzy, c-format
-msgid "%s %s\n"
-msgstr "%s ¹öÀü %s\n"
+#: gen.c:248
+msgid "\n\nEquivalence Classes:\n\n"
+msgstr "\n\nµ¿Ä¡·ù:\n\n"
-#: main.c:1466
+#: main.c:376
+msgid "error closing output file %s"
+msgstr "Ãâ·ÂÆÄÀÏ %s¸¦ ´Ý´Âµ¥ ¿À·ù°¡ ¹ß»ýÇß½À´Ï´Ù"
+
+#: main.c:862
msgid "fatal parse error"
msgstr "Ä¡¸íÀûÀÎ ÆÄ½Ì ¿¡·¯"
-#: main.c:1498
-#, c-format
-msgid "could not create backing-up info file %s"
-msgstr "µÇµ¹¸² Á¤º¸ ÆÄÀÏ %s¸¦ ¸¸µé ¼ö ¾ø¾ú½À´Ï´Ù"
-
-#: main.c:1519
-#, c-format
-msgid "-l AT&T lex compatibility option entails a large performance penalty\n"
-msgstr "-l AT&T lex ȣȯ ¿É¼ÇÀº Å« ¼º´É ÀúÇϸ¦ ÀÏÀ¸Åµ´Ï´Ù\n"
-
-#: main.c:1522
-#, c-format
-msgid " and may be the actual source of other reported performance penalties\n"
-msgstr " ±×¸®°í ¾Æ¸¶µµ ´Ù¸¥ º¸°íµÈ ¼º´É ÀúÇÏÀÇ ½ÇÁ¦ ¿øÀÎÀÏ °ÍÀÔ´Ï´Ù\n"
+#: main.c:502
+msgid " %d/%d start conditions\n"
+msgstr " %d/%d°³ÀÇ ½ÃÀÛÁ¶°Ç\n"
-#: main.c:1528
-#, fuzzy, c-format
-msgid ""
-"%%option yylineno entails a performance penalty ONLY on rules that can match "
-"newline characters\n"
-msgstr "%%option yylineno´Â Å« ¼º´ÉÀúÇϸ¦ ÀÏÀ¸Åµ´Ï´Ù\n"
+#: main.c:569
+msgid " %d (%d saved) hash collisions, %d DFAs equal\n"
+msgstr " %d(%d ÀúÀåµÊ)°³ÀÇ ÇØ½Ì Ãæµ¹·Î %d°³ÀÇ DFA°¡ °°°Ô 󸮵˴ϴÙ\n"
-#: main.c:1535
-#, c-format
-msgid "-I (interactive) entails a minor performance penalty\n"
-msgstr "-I (´ëÈ­Çü) Àº ¼Ò±Ô¸ðÀÇ ¼º´ÉÀúÇϸ¦ ÀÏÀ¸Åµ´Ï´Ù\n"
+#: scan.l:203
+msgid "incomplete name definition"
+msgstr "ºÒ¿ÏÀüÇÑ À̸§ Á¤ÀÇ"
-#: main.c:1540
-#, c-format
+#: main.c:915
msgid "yymore() entails a minor performance penalty\n"
msgstr "yymore()´Â ¼Ò±Ô¸ðÀÇ ¼º´ÉÀúÇϸ¦ ÀÏÀ¸Åµ´Ï´Ù\n"
-#: main.c:1546
-#, c-format
+#: main.c:920
msgid "REJECT entails a large performance penalty\n"
msgstr "REJECT´Â Å« ¼º´ÉÀúÇϸ¦ ÀÏÀ¸Åµ´Ï´Ù\n"
-#: main.c:1551
-#, c-format
+#: main.c:924
msgid "Variable trailing context rules entail a large performance penalty\n"
msgstr "°¡º¯ ÃßÀû ¹®¸Æ ±ÔÄ¢Àº Å« ¼º´ÉÀúÇϸ¦ ÀÏÀ¸Åµ´Ï´Ù\n"
-#: main.c:1563
+#: main.c:937
msgid "REJECT cannot be used with -f or -F"
msgstr "REJECT´Â -f³ª -F¿É¼Ç°ú °°ÀÌ ¾µ ¼ö ¾ø½À´Ï´Ù"
-#: main.c:1566
-#, fuzzy, c-format
-msgid "%option yylineno cannot be used with REJECT"
+#: main.c:940
+msgid "%option yylineno cannot be used with -f or -F"
msgstr "%option yylinenoÀº -f³ª -F¿É¼Ç°ú °°ÀÌ ¾µ ¼ö ¾ø½À´Ï´Ù"
-#: main.c:1569
+#: main.c:943
msgid "variable trailing context rules cannot be used with -f or -F"
msgstr "°¡º¯ ÃßÀû ¹®¸Æ ±ÔÄ¢Àº -f³ª -F¿É¼Ç°ú °°ÀÌ ¾µ ¼ö ¾ø½À´Ï´Ù"
-#: main.c:1692
-#, c-format
+#: main.c:1038
msgid "%option yyclass only meaningful for C++ scanners"
msgstr "%option yyclass´Â C++½ºÄ³³Ê¿¡°Ô¸¸ Àǹ̰¡ ÀÖ½À´Ï´Ù"
-#: main.c:1799
-#, c-format
-msgid "Usage: %s [OPTIONS] [FILE]...\n"
-msgstr ""
+#: main.c:1117
+msgid "%s [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -ooutput -Pprefix -Sskeleton]\n"
+msgstr "%s [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -oÃâ·ÂÆÄÀÏ -PÁ¢µÎ»ç -S½ºÄÌ·¹Åæ]\n"
-#: main.c:1802
-#, c-format
-msgid ""
-"Generates programs that perform pattern-matching on text.\n"
-"\n"
-"Table Compression:\n"
-" -Ca, --align trade off larger tables for better memory alignment\n"
-" -Ce, --ecs construct equivalence classes\n"
-" -Cf do not compress tables; use -f representation\n"
-" -CF do not compress tables; use -F representation\n"
-" -Cm, --meta-ecs construct meta-equivalence classes\n"
-" -Cr, --read use read() instead of stdio for scanner input\n"
-" -f, --full generate fast, large scanner. Same as -Cfr\n"
-" -F, --fast use alternate table representation. Same as -CFr\n"
-" -Cem default compression (same as --ecs --meta-ecs)\n"
-"\n"
-"Debugging:\n"
-" -d, --debug enable debug mode in scanner\n"
-" -b, --backup write backing-up information to %s\n"
-" -p, --perf-report write performance report to stderr\n"
-" -s, --nodefault suppress default rule to ECHO unmatched text\n"
-" -T, --trace %s should run in trace mode\n"
-" -w, --nowarn do not generate warnings\n"
-" -v, --verbose write summary of scanner statistics to stdout\n"
-"\n"
-"Files:\n"
-" -o, --outfile=FILE specify output filename\n"
-" -S, --skel=FILE specify skeleton file\n"
-" -t, --stdout write scanner on stdout instead of %s\n"
-" --yyclass=NAME name of C++ class\n"
-" --header-file=FILE create a C header file in addition to the "
-"scanner\n"
-" --tables-file[=FILE] write tables to FILE\n"
-"\n"
-"Scanner behavior:\n"
-" -7, --7bit generate 7-bit scanner\n"
-" -8, --8bit generate 8-bit scanner\n"
-" -B, --batch generate batch scanner (opposite of -I)\n"
-" -i, --case-insensitive ignore case in patterns\n"
-" -l, --lex-compat maximal compatibility with original lex\n"
-" -X, --posix-compat maximal compatibility with POSIX lex\n"
-" -I, --interactive generate interactive scanner (opposite of -B)\n"
-" --yylineno track line count in yylineno\n"
-"\n"
-"Generated code:\n"
-" -+, --c++ generate C++ scanner class\n"
-" -Dmacro[=defn] #define macro defn (default defn is '1')\n"
-" -L, --noline suppress #line directives in scanner\n"
-" -P, --prefix=STRING use STRING as prefix instead of \"yy\"\n"
-" -R, --reentrant generate a reentrant C scanner\n"
-" --bison-bridge scanner for bison pure parser.\n"
-" --bison-locations include yylloc support.\n"
-" --stdinit initialize yyin/yyout to stdin/stdout\n"
-" --noansi-definitions old-style function definitions\n"
-" --noansi-prototypes empty parameter list in prototypes\n"
-" --nounistd do not include <unistd.h>\n"
-" --noFUNCTION do not generate a particular FUNCTION\n"
-"\n"
-"Miscellaneous:\n"
-" -c do-nothing POSIX option\n"
-" -n do-nothing POSIX option\n"
-" -?\n"
-" -h, --help produce this help message\n"
-" -V, --version report %s version\n"
-msgstr ""
+#: main.c:1119
+msgid "\t[--help --version] [file ...]\n"
+msgstr "\t[--help --version] [ÆÄÀÏ ...]\n"
-#: misc.c:65
-msgid "allocation of sko_stack failed"
-msgstr ""
+#: main.c:1121
+msgid "\t-b generate backing-up information to %s\n"
+msgstr "\t-b %s¿¡ µÇµ¹¸² Á¤º¸¸¦ ¸¸µì´Ï´Ù.\n"
-#: misc.c:102 misc.c:128
-#, c-format
-msgid "name \"%s\" ridiculously long"
-msgstr "À̸§ \"%s\"´Â ºñÁ¤»óÀûÀ¸·Î ±é´Ï´Ù"
+#: main.c:1123
+msgid "\t-c do-nothing POSIX option\n"
+msgstr "\t-c ¾Æ¹« Àϵµ ÇÏÁö ¾Ê´Â POSIX¿É¼Ç\n"
-#: misc.c:177
-msgid "memory allocation failed in allocate_array()"
-msgstr "allocate_array()¿¡¼­ ¸Þ¸ð¸® ÇÒ´çÀÌ ½ÇÆÐÇß½À´Ï´Ù"
+#: main.c:1124
+msgid "\t-d turn on debug mode in generated scanner\n"
+msgstr "\t-d ¸¸µé¾îÁø ½ºÄ³³Ê¿¡¼­ µð¹ö±× ¸ðµå·Î ¹Ù²ß´Ï´Ù\n"
-#: misc.c:230
-#, c-format
-msgid "bad character '%s' detected in check_char()"
-msgstr "check_char()¿¡¼­ À߸øµÈ ¹®ÀÚ '%s'¸¦ ã¾Ò½À´Ï´Ù"
+#: main.c:1125
+msgid "\t-f generate fast, large scanner\n"
+msgstr "\t-f ºü¸£Áö¸¸ Å« ½ºÄ³³Ê¸¦ ¸¸µì´Ï´Ù\n"
-#: misc.c:235
-#, c-format
-msgid "scanner requires -8 flag to use the character %s"
-msgstr "½ºÄ³³Ê¿¡¼­ ¹®ÀÚ %s¸¦ ¾²±â À§Çؼ­´Â -8¿É¼ÇÀÌ ÇÊ¿äÇÕ´Ï´Ù"
+#: main.c:1126
+msgid "\t-h produce this help message\n"
+msgstr "\t-h ÀÌ µµ¿ò¸» ¸Þ½ÃÁö¸¦ Ãâ·ÂÇÕ´Ï´Ù\n"
-#: misc.c:268
-msgid "dynamic memory failure in copy_string()"
-msgstr "copy_string()¿¡¼­ µ¿Àû ¸Þ¸ð¸® ÇÒ´çÀÌ ½ÇÆÐÇß½À´Ï´Ù"
+#: main.c:1127
+msgid "\t-i generate case-insensitive scanner\n"
+msgstr "\t-i ´ë¼Ò¹®ÀÚ ±¸º°¾ø´Â ½ºÄ³³Ê¸¦ ¸¸µì´Ï´Ù\n"
-#: misc.c:367
-#, c-format
-msgid "%s: fatal internal error, %s\n"
-msgstr "%s: Ä¡¸íÀûÀÎ ³»ºÎ ¿¡·¯, %s\n"
+#: main.c:1128
+msgid "\t-l maximal compatibility with original lex\n"
+msgstr "\t-l ¿À¸®Áö³Î lex¿Í ÃÖ´ëÇÑÀÇ È£È¯¼ºÀ» Á¦°øÇÕ´Ï´Ù\n"
-#: misc.c:803
-msgid "attempt to increase array size failed"
-msgstr "¹è¿­ Å©±â¸¦ ´Ã¸®·Á´Â ½Ãµµ°¡ ½ÇÆÐÇß½À´Ï´Ù"
+#: main.c:1129
+msgid "\t-n do-nothing POSIX option\n"
+msgstr "\t-n ¾Æ¹« Àϵµ ÇÏÁö ¾Ê´Â POSIX¿É¼Ç\n"
-#: misc.c:930
-msgid "bad line in skeleton file"
-msgstr "½ºÄÌ·¹Åæ ÆÄÀÏ¿¡ À߸øµÈ Çà"
+#: main.c:1130
+msgid "\t-p generate performance report to stderr\n"
+msgstr "\t-p ¼º´É º¸°í¸¦ Ç¥ÁØ ¿¡·¯·Î Ãâ·ÂÇÕ´Ï´Ù\n"
-#: misc.c:979
-msgid "memory allocation failed in yy_flex_xmalloc()"
-msgstr "yy_flex_xmalloc()¿¡¼­ ¸Þ¸ð¸® ÇÒ´çÀÌ ½ÇÆÐÇß½À´Ï´Ù"
+#: main.c:1132
+msgid "\t-s suppress default rule to ECHO unmatched text\n"
+msgstr "\t-s ±âº» ±ÔÄ¢À» 'ECHO ãÁö¸øÇÑ ±Û'·Î Á¦ÇÑÇÕ´Ï´Ù\n"
-#: nfa.c:104
-#, c-format
-msgid ""
-"\n"
-"\n"
-"********** beginning dump of nfa with start state %d\n"
-msgstr ""
-"\n"
-"\n"
-"********** ½ÃÀÛ »óÅ %d¿¡¼­ nfaÃâ·Â ½ÃÀÛ\n"
+#: main.c:1142
+msgid "\t-t write generated scanner on stdout instead of %s\n"
+msgstr "\t-t %s ´ë½Å ¸¸µé¾îÁø ½ºÄ³³Ê¸¦ Ç¥ÁØ Ãâ·ÂÀ¸·Î ¾¹´Ï´Ù\n"
-#: nfa.c:115
-#, c-format
-msgid "state # %4d\t"
-msgstr "»óÅÂ ¹øÈ£ %4d\t"
+#: main.c:1146
+msgid "\t-v write summary of scanner statistics to f\n"
+msgstr "\t-v ½ºÄ³³Ê Åë°è ¿ä¾àÀ» f¿¡ ¾¹´Ï´Ù\n"
-#: nfa.c:130
-#, c-format
-msgid "********** end of dump\n"
-msgstr "********** Ãâ·Â ³¡\n"
+#: main.c:1147
+msgid "\t-w do not generate warnings\n"
+msgstr "\t-w °æ°í¸¦ ³»Áö ¾Ê½À´Ï´Ù\n"
-#: nfa.c:174
-msgid "empty machine in dupmachine()"
-msgstr "dupmachine()¿¡¼­ÀÇ ºó ¸Ó½Å"
+#: main.c:1148
+msgid "\t-B generate batch scanner (opposite of -I)\n"
+msgstr "\t-B ÀÏ°ýó¸® ½ºÄ³³Ê¸¦ ¸¸µì´Ï´Ù(-I¿Í ¹Ý´ë)\n"
-#: nfa.c:240
-#, c-format
-msgid "Variable trailing context rule at line %d\n"
-msgstr "%dÇà¿¡¼­ °¡º¯ ÃßÀû ¹®¸Æ ±ÔÄ¢\n"
+#: main.c:1150
+msgid "\t-F use alternative fast scanner representation\n"
+msgstr "\t-F ´Ù¸¥ ¹æ¹ýÀÇ ºü¸¥ ½ºÄ³³Ê Ç¥Çö¹ýÀ» »ç¿ëÇÕ´Ï´Ù\n"
-#: nfa.c:364
-msgid "bad state type in mark_beginning_as_normal()"
-msgstr "mark_beginning_as_normal()¿¡¼­ À߸øµÈ »óÅÂÇü"
+#: main.c:1152
+msgid "\t-I generate interactive scanner (opposite of -B)\n"
+msgstr "\t-I ´ëÈ­Çü ½ºÄ³³Ê¸¦ ¸¸µì´Ï´Ù(-B¿Í ¹Ý´ë)\n"
-#: nfa.c:609
-#, c-format
-msgid "input rules are too complicated (>= %d NFA states)"
-msgstr "ÀÔ·Â ±ÔÄ¢ÀÌ ³Ê¹« º¹ÀâÇÕ´Ï´Ù(>= NFA»óÅ %d°³)"
+#: main.c:1153
+msgid "\t-L suppress #line directives in scanner\n"
+msgstr "\t-L ½ºÄ³³Ê¿¡¼­ #lineÁö½ÃÀÚ¸¦ ³»Áö ¾Êµµ·Ï ÇÕ´Ï´Ù\n"
-#: nfa.c:688
-msgid "found too many transitions in mkxtion()"
-msgstr "mkxtion()¿¡ ÀüÀÌ°¡ ³Ê¹« ¸¹½À´Ï´Ù"
+#: main.c:1154
+msgid "\t-T %s should run in trace mode\n"
+msgstr "\t-T %s´Â ÃßÀû ¸ðµå¿¡¼­ ½ÇÇàµÇµµ·Ï ÇÕ´Ï´Ù\n"
-#: nfa.c:714
-#, c-format
-msgid "too many rules (> %d)!"
-msgstr "±ÔÄ¢ÀÌ ³Ê¹« ¸¹½À´Ï´Ù (> %d)!"
+#: main.c:1155
+msgid "\t-V report %s version\n"
+msgstr "\t-V %sÀÇ ¹öÀüÀ» Ãâ·ÂÇÕ´Ï´Ù\n"
-#: parse.y:159
-msgid "unknown error processing section 1"
-msgstr ""
+#: main.c:1156
+msgid "\t-7 generate 7-bit scanner\n"
+msgstr "\t-7 7ºñÆ® ½ºÄ³³Ê¸¦ ¸¸µì´Ï´Ù\n"
-#: parse.y:184 parse.y:351
-#, fuzzy
-msgid "bad start condition list"
-msgstr "À߸øµÈ <½ÃÀÛ Á¶°Ç>: %s"
+#: main.c:1157
+msgid "\t-8 generate 8-bit scanner\n"
+msgstr "\t-8 8ºñÆ® ½ºÄ³³Ê¸¦ ¸¸µì´Ï´Ù\n"
-#: parse.y:315
-#, fuzzy
-msgid "unrecognized rule"
-msgstr "¾Ë ¼ö ¾ø´Â '%' Áö½ÃÀÚ"
+#: main.c:1158
+msgid "\t-+ generate C++ scanner class\n"
+msgstr "\t-+ C++ ½ºÄ³³Ê Ŭ·¡½º¸¦ ¸¸µì´Ï´Ù\n"
-#: parse.y:434 parse.y:447 parse.y:516
-#, fuzzy
-msgid "trailing context used twice"
-msgstr "%dÇà¿¡¼­ °¡º¯ ÃßÀû ¹®¸Æ ±ÔÄ¢\n"
+#: main.c:1159
+msgid "\t-? produce this help message\n"
+msgstr "\t-? ÀÌ µµ¿ò¸»À» Ãâ·ÂÇÕ´Ï´Ù\n"
-#: parse.y:552 parse.y:562 parse.y:635 parse.y:645
-msgid "bad iteration values"
-msgstr ""
+#: main.c:1161
+msgid "\t-C specify degree of table compression (default is -Cem):\n"
+msgstr "\t-C Å×ÀÌºí ¾ÐÃàÁ¤µµ¸¦ ÁöÁ¤ÇÕ´Ï´Ù(±âº»°ªÀº -Cem):\n"
-#: parse.y:580 parse.y:598 parse.y:663 parse.y:681
-msgid "iteration value must be positive"
-msgstr ""
+#: main.c:1163
+msgid "\t\t-Ca trade off larger tables for better memory alignment\n"
+msgstr "\t\t-Ca ´õ ÁÁÀº ¸Þ¸ð¸® Á¤·ÄÀ» À§ÇØ Å« Å×À̺íÀ» ¸¸µì´Ï´Ù\n"
-#: parse.y:804 parse.y:814
-#, c-format
-msgid "the character range [%c-%c] is ambiguous in a case-insensitive scanner"
-msgstr ""
-
-#: parse.y:819
-#, fuzzy
-msgid "negative range in character class"
-msgstr " ¹®ÀÚ·ù°¡ ¾ø½À´Ï´Ù\n"
-
-#: parse.y:916
-#, fuzzy
-msgid "[:^lower:] is ambiguous in case insensitive scanner"
-msgstr "\t-i ´ë¼Ò¹®ÀÚ ±¸º°¾ø´Â ½ºÄ³³Ê¸¦ ¸¸µì´Ï´Ù\n"
+#: main.c:1164
+msgid "\t\t-Ce construct equivalence classes\n"
+msgstr "\t\t-Ce µ¿Ä¡·ù¸¦ ¸¸µì´Ï´Ù\n"
-#: parse.y:922
-#, fuzzy
-msgid "[:^upper:] ambiguous in case insensitive scanner"
-msgstr "\t-i ´ë¼Ò¹®ÀÚ ±¸º°¾ø´Â ½ºÄ³³Ê¸¦ ¸¸µì´Ï´Ù\n"
+#: main.c:1166
+msgid "\t\t-Cf do not compress scanner tables; use -f representation\n"
+msgstr "\t\t-Cf ½ºÄ³³Ê Å×À̺íÀ» ¾ÐÃàÇÏÁö ¾Ê½À´Ï´Ù. -fÇ¥Çö¹ýÀ» »ç¿ëÇÕ´Ï´Ù\n"
-#: scan.l:75 scan.l:618 scan.l:676
-msgid "Input line too long\n"
-msgstr ""
+#: main.c:1168
+msgid "\t\t-CF do not compress scanner tables; use -F representation\n"
+msgstr "\t\t-CF ½ºÄ³³Ê Å×À̺íÀ» ¾ÐÃàÇÏÁö ¾Ê½À´Ï´Ù. -FÇ¥Çö¹ýÀ» »ç¿ëÇÕ´Ï´Ù\n"
-#: scan.l:161
-#, fuzzy, c-format
-msgid "malformed '%top' directive"
-msgstr "¾Ë ¼ö ¾ø´Â '%' Áö½ÃÀÚ"
+#: main.c:1169
+msgid "\t\t-Cm construct meta-equivalence classes\n"
+msgstr "\t\t-Cm ¸ÞŸ µ¿Ä¡·ù¸¦ ¸¸µì´Ï´Ù\n"
-#: scan.l:183
-#, no-c-format
-msgid "unrecognized '%' directive"
-msgstr "¾Ë ¼ö ¾ø´Â '%' Áö½ÃÀÚ"
+#: main.c:1171
+msgid "\t\t-Cr use read() instead of stdio for scanner input\n"
+msgstr "\t\t-Cr ½ºÄ³³Ê ÀÔ·ÂÀ» stdio¶óÀ̺귯¸® ´ë½Å read()½Ã½ºÅÛ ÄÝÀ» »ç¿ëÇÕ´Ï´Ù\n"
-#: scan.l:192
-msgid "Definition name too long\n"
-msgstr ""
+#: main.c:1172
+msgid "\t-o specify output filename\n"
+msgstr "\t-o Ãâ·Â ÆÄÀÏÀ̸§À» ÁöÁ¤ÇÕ´Ï´Ù\n"
-#: scan.l:284
-msgid "Unmatched '{'"
-msgstr ""
+#: main.c:1173
+msgid "\t-P specify scanner prefix other than \"yy\"\n"
+msgstr "\t-P \"yy\"´ë½Å¿¡ ´Ù¸¥ ½ºÄ³³Ê Á¢µÎ»ç¸¦ ÁöÁ¤ÇÕ´Ï´Ù\n"
-#: scan.l:300
-#, c-format
-msgid "Definition value for {%s} too long\n"
-msgstr ""
+#: main.c:1174
+msgid "\t-S specify skeleton file\n"
+msgstr "\t-S ½ºÄÌ·¹Åæ ÆÄÀÏÀ» ÁöÁ¤ÇÕ´Ï´Ù\n"
-#: scan.l:317
-msgid "incomplete name definition"
-msgstr "ºÒ¿ÏÀüÇÑ À̸§ Á¤ÀÇ"
+#: main.c:1175
+msgid "\t--help produce this help message\n"
+msgstr "\t--help ÀÌ µµ¿ò¸»À» Ãâ·ÂÇÕ´Ï´Ù\n"
-#: scan.l:443
-msgid "Option line too long\n"
-msgstr ""
+#: main.c:1176
+msgid "\t--version report %s version\n"
+msgstr "\t--version %sÀÇ ¹öÀüÀ» Ãâ·ÂÇÕ´Ï´Ù\n"
-#: scan.l:451
-#, c-format
-msgid "unrecognized %%option: %s"
-msgstr "¾Ë ¼ö ¾ø´Â %%option: %s"
+#: misc.c:42
+msgid "name \"%s\" ridiculously long"
+msgstr "À̸§ \"%s\"´Â ºñÁ¤»óÀûÀ¸·Î ±é´Ï´Ù"
-#: scan.l:633 scan.l:800
-msgid "bad character class"
-msgstr "À߸øµÈ ¹®ÀÚ·ù"
+#: misc.c:91
+msgid "memory allocation failed in allocate_array()"
+msgstr "allocate_array()¿¡¼­ ¸Þ¸ð¸® ÇÒ´çÀÌ ½ÇÆÐÇß½À´Ï´Ù"
-#: scan.l:683
-#, c-format
-msgid "undefined definition {%s}"
-msgstr "Á¤ÀǵÇÁö ¾ÊÀº Á¤ÀÇ {%s}"
+#: misc.c:169
+msgid "bad character '%s' detected in check_char()"
+msgstr "check_char()¿¡¼­ À߸øµÈ ¹®ÀÚ '%s'¸¦ ã¾Ò½À´Ï´Ù"
-#: scan.l:755
-#, c-format
-msgid "bad <start condition>: %s"
-msgstr "À߸øµÈ <½ÃÀÛ Á¶°Ç>: %s"
+#: misc.c:174
+msgid "scanner requires -8 flag to use the character %s"
+msgstr "½ºÄ³³Ê¿¡¼­ ¹®ÀÚ %s¸¦ ¾²±â À§Çؼ­´Â -8¿É¼ÇÀÌ ÇÊ¿äÇÕ´Ï´Ù"
-#: scan.l:768
-msgid "missing quote"
-msgstr "Àοë±âÈ£ ºüÁü"
+#: misc.c:207
+msgid "dynamic memory failure in copy_string()"
+msgstr "copy_string()¿¡¼­ µ¿Àû ¸Þ¸ð¸® ÇÒ´çÀÌ ½ÇÆÐÇß½À´Ï´Ù"
-#: scan.l:834
-#, c-format
-msgid "bad character class expression: %s"
-msgstr "À߸øµÈ ¹®ÀÚ ÁýÇÕ ½Ä: %s"
+#: misc.c:339
+msgid "%s: fatal internal error, %s\n"
+msgstr "%s: Ä¡¸íÀûÀÎ ³»ºÎ ¿¡·¯, %s\n"
-#: scan.l:856
-msgid "bad character inside {}'s"
-msgstr "{}¾ÈÀÇ À߸øµÈ ¹®ÀÚ"
+#: misc.c:765
+msgid "attempt to increase array size failed"
+msgstr "¹è¿­ Å©±â¸¦ ´Ã¸®·Á´Â ½Ãµµ°¡ ½ÇÆÐÇß½À´Ï´Ù"
-#: scan.l:862
-msgid "missing }"
-msgstr "}ÀÌ ºüÁ³½À´Ï´Ù"
+#: misc.c:811
+msgid "bad line in skeleton file"
+msgstr "½ºÄÌ·¹Åæ ÆÄÀÏ¿¡ À߸øµÈ Çà"
-#: scan.l:940
-msgid "EOF encountered inside an action"
-msgstr "µ¿ÀÛ µµÁß¿¡ EOF¸¦ ¸¸³µ½À´Ï´Ù"
+#: misc.c:864
+msgid "memory allocation failed in yy_flex_xmalloc()"
+msgstr "yy_flex_xmalloc()¿¡¼­ ¸Þ¸ð¸® ÇÒ´çÀÌ ½ÇÆÐÇß½À´Ï´Ù"
-#: scan.l:945
-#, fuzzy
-msgid "EOF encountered inside pattern"
-msgstr "µ¿ÀÛ µµÁß¿¡ EOF¸¦ ¸¸³µ½À´Ï´Ù"
+#: nfa.c:100
+msgid "\n\n********** beginning dump of nfa with start state %d\n"
+msgstr "\n\n********** ½ÃÀÛ »óÅ %d¿¡¼­ nfaÃâ·Â ½ÃÀÛ\n"
-#: scan.l:967
-#, c-format
-msgid "bad character: %s"
-msgstr "À߸øµÈ ¹®ÀÚ: %s"
+#: nfa.c:112
+msgid "state # %4d\t"
+msgstr "»óÅÂ ¹øÈ£ %4d\t"
-#: scan.l:996
-#, c-format
-msgid "can't open %s"
-msgstr "%s¸¦ ¿­ ¼ö ¾ø½À´Ï´Ù"
+#: nfa.c:127
+msgid "********** end of dump\n"
+msgstr "********** Ãâ·Â ³¡\n"
-#: scanopt.c:291
-#, c-format
-msgid "Usage: %s [OPTIONS]...\n"
-msgstr ""
+#: nfa.c:173
+msgid "empty machine in dupmachine()"
+msgstr "dupmachine()¿¡¼­ÀÇ ºó ¸Ó½Å"
-#: scanopt.c:564
-#, c-format
-msgid "option `%s' doesn't allow an argument\n"
-msgstr ""
+#: nfa.c:225
+msgid "Variable trailing context rule at line %d\n"
+msgstr "%dÇà¿¡¼­ °¡º¯ ÃßÀû ¹®¸Æ ±ÔÄ¢\n"
-#: scanopt.c:569
-#, c-format
-msgid "option `%s' requires an argument\n"
-msgstr ""
+#: nfa.c:347
+msgid "bad state type in mark_beginning_as_normal()"
+msgstr "mark_beginning_as_normal()¿¡¼­ À߸øµÈ »óÅÂÇü"
-#: scanopt.c:573
-#, c-format
-msgid "option `%s' is ambiguous\n"
-msgstr ""
+#: nfa.c:600
+msgid "input rules are too complicated (>= %d NFA states)"
+msgstr "ÀÔ·Â ±ÔÄ¢ÀÌ ³Ê¹« º¹ÀâÇÕ´Ï´Ù(>= NFA»óÅ %d°³)"
-#: scanopt.c:577
-#, fuzzy, c-format
-msgid "Unrecognized option `%s'\n"
-msgstr "¾Ë ¼ö ¾ø´Â %%option: %s"
+#: nfa.c:679
+msgid "found too many transitions in mkxtion()"
+msgstr "mkxtion()¿¡ ÀüÀÌ°¡ ³Ê¹« ¸¹½À´Ï´Ù"
-#: scanopt.c:581
-#, c-format
-msgid "Unknown error=(%d)\n"
-msgstr ""
+#: nfa.c:705
+msgid "too many rules (> %d)!"
+msgstr "±ÔÄ¢ÀÌ ³Ê¹« ¸¹½À´Ï´Ù (> %d)!"
-#: sym.c:100
+#: sym.c:78
msgid "symbol table memory allocation failed"
msgstr "½Éº¼ Å×ÀÌºí ¸Þ¸ð¸® ÇÒ´çÀÌ ½ÇÆÐÇß½À´Ï´Ù"
-#: sym.c:202
+#: sym.c:188
msgid "name defined twice"
msgstr "À̸§À» µÎ¹ø Á¤ÀÇÇß½À´Ï´Ù"
-#: sym.c:253
-#, c-format
+#: sym.c:243
msgid "start condition %s declared twice"
msgstr "½ÃÀÛÁ¶°Ç %s¸¦ µÎ¹ø ¼±¾ðÇß½À´Ï´Ù"
-#: yylex.c:56
+#: yylex.c:55
msgid "premature EOF"
msgstr "°©ÀÛ½º·± EOF"
-#: yylex.c:198
-#, c-format
+#: yylex.c:204
msgid "End Marker\n"
msgstr "Á¾·á Ç¥½Ã\n"
-#: yylex.c:204
-#, c-format
+#: yylex.c:209
msgid "*Something Weird* - tok: %d val: %d\n"
msgstr "*¹«¾ð°¡ ÀÌ»óÇÕ´Ï´Ù* - tok: %d val: %d\n"
-
-#~ msgid ""
-#~ "%s: unknown flag '%c'. For usage, try\n"
-#~ "\t%s --help\n"
-#~ msgstr ""
-#~ "%s: ¾Ë ¼ö ¾ø´Â ¿É¼Ç '%c'. »ç¿ë¹ýÀ» º¸·Á¸é \n"
-#~ "\t%s --help¶ó°í Çϼ¼¿ä.\n"
-
-#~ msgid "-P flag must be given separately"
-#~ msgstr "-P Ç÷¡±×´Â µû·Î ÁÖ¾î¾ß ÇÕ´Ï´Ù"
-
-#~ msgid "-o flag must be given separately"
-#~ msgstr "-o Ç÷¡±×´Â µû·Î ÁÖ¾î¾ß ÇÕ´Ï´Ù"
-
-#~ msgid "-S flag must be given separately"
-#~ msgstr "-S Ç÷¡±×´Â µû·Î ÁÖ¾î¾ß ÇÕ´Ï´Ù"
-
-#~ msgid "-C flag must be given separately"
-#~ msgstr "-C Ç÷¡±×´Â µû·Î ÁÖ¾î¾ß ÇÕ´Ï´Ù"
-
-#~ msgid "consistency check failed in symfollowset"
-#~ msgstr "symfollowset¿¡¼­ ÀÏ°ü¼º °Ë»ç°¡ ½ÇÆÐÇß½À´Ï´Ù"
-
-#~ msgid "-Cf/-CF and %option yylineno are incompatible"
-#~ msgstr "-Cf/-CF¿Í %option yylineno ´Â °°ÀÌ ¾µ ¼ö ¾ø½À´Ï´Ù"
-
-#~ msgid ""
-#~ "%s [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -ooutput -Pprefix -Sskeleton]\n"
-#~ msgstr ""
-#~ "%s [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -oÃâ·ÂÆÄÀÏ -PÁ¢µÎ»ç -S½ºÄÌ·¹Åæ]\n"
-
-#~ msgid "\t[--help --version] [file ...]\n"
-#~ msgstr "\t[--help --version] [ÆÄÀÏ ...]\n"
-
-#~ msgid "\t-b generate backing-up information to %s\n"
-#~ msgstr "\t-b %s¿¡ µÇµ¹¸² Á¤º¸¸¦ ¸¸µì´Ï´Ù.\n"
-
-#~ msgid "\t-c do-nothing POSIX option\n"
-#~ msgstr "\t-c ¾Æ¹« Àϵµ ÇÏÁö ¾Ê´Â POSIX¿É¼Ç\n"
-
-#~ msgid "\t-d turn on debug mode in generated scanner\n"
-#~ msgstr "\t-d ¸¸µé¾îÁø ½ºÄ³³Ê¿¡¼­ µð¹ö±× ¸ðµå·Î ¹Ù²ß´Ï´Ù\n"
-
-#~ msgid "\t-f generate fast, large scanner\n"
-#~ msgstr "\t-f ºü¸£Áö¸¸ Å« ½ºÄ³³Ê¸¦ ¸¸µì´Ï´Ù\n"
-
-#~ msgid "\t-h produce this help message\n"
-#~ msgstr "\t-h ÀÌ µµ¿ò¸» ¸Þ½ÃÁö¸¦ Ãâ·ÂÇÕ´Ï´Ù\n"
-
-#~ msgid "\t-l maximal compatibility with original lex\n"
-#~ msgstr "\t-l ¿À¸®Áö³Î lex¿Í ÃÖ´ëÇÑÀÇ È£È¯¼ºÀ» Á¦°øÇÕ´Ï´Ù\n"
-
-#~ msgid "\t-n do-nothing POSIX option\n"
-#~ msgstr "\t-n ¾Æ¹« Àϵµ ÇÏÁö ¾Ê´Â POSIX¿É¼Ç\n"
-
-#~ msgid "\t-p generate performance report to stderr\n"
-#~ msgstr "\t-p ¼º´É º¸°í¸¦ Ç¥ÁØ ¿¡·¯·Î Ãâ·ÂÇÕ´Ï´Ù\n"
-
-#~ msgid "\t-s suppress default rule to ECHO unmatched text\n"
-#~ msgstr "\t-s ±âº» ±ÔÄ¢À» 'ECHO ãÁö¸øÇÑ ±Û'·Î Á¦ÇÑÇÕ´Ï´Ù\n"
-
-#~ msgid "\t-t write generated scanner on stdout instead of %s\n"
-#~ msgstr "\t-t %s ´ë½Å ¸¸µé¾îÁø ½ºÄ³³Ê¸¦ Ç¥ÁØ Ãâ·ÂÀ¸·Î ¾¹´Ï´Ù\n"
-
-#~ msgid "\t-v write summary of scanner statistics to f\n"
-#~ msgstr "\t-v ½ºÄ³³Ê Åë°è ¿ä¾àÀ» f¿¡ ¾¹´Ï´Ù\n"
-
-#~ msgid "\t-w do not generate warnings\n"
-#~ msgstr "\t-w °æ°í¸¦ ³»Áö ¾Ê½À´Ï´Ù\n"
-
-#~ msgid "\t-B generate batch scanner (opposite of -I)\n"
-#~ msgstr "\t-B ÀÏ°ýó¸® ½ºÄ³³Ê¸¦ ¸¸µì´Ï´Ù(-I¿Í ¹Ý´ë)\n"
-
-#~ msgid "\t-F use alternative fast scanner representation\n"
-#~ msgstr "\t-F ´Ù¸¥ ¹æ¹ýÀÇ ºü¸¥ ½ºÄ³³Ê Ç¥Çö¹ýÀ» »ç¿ëÇÕ´Ï´Ù\n"
-
-#~ msgid "\t-I generate interactive scanner (opposite of -B)\n"
-#~ msgstr "\t-I ´ëÈ­Çü ½ºÄ³³Ê¸¦ ¸¸µì´Ï´Ù(-B¿Í ¹Ý´ë)\n"
-
-#~ msgid "\t-L suppress #line directives in scanner\n"
-#~ msgstr "\t-L ½ºÄ³³Ê¿¡¼­ #lineÁö½ÃÀÚ¸¦ ³»Áö ¾Êµµ·Ï ÇÕ´Ï´Ù\n"
-
-#~ msgid "\t-T %s should run in trace mode\n"
-#~ msgstr "\t-T %s´Â ÃßÀû ¸ðµå¿¡¼­ ½ÇÇàµÇµµ·Ï ÇÕ´Ï´Ù\n"
-
-#~ msgid "\t-V report %s version\n"
-#~ msgstr "\t-V %sÀÇ ¹öÀüÀ» Ãâ·ÂÇÕ´Ï´Ù\n"
-
-#~ msgid "\t-7 generate 7-bit scanner\n"
-#~ msgstr "\t-7 7ºñÆ® ½ºÄ³³Ê¸¦ ¸¸µì´Ï´Ù\n"
-
-#~ msgid "\t-8 generate 8-bit scanner\n"
-#~ msgstr "\t-8 8ºñÆ® ½ºÄ³³Ê¸¦ ¸¸µì´Ï´Ù\n"
-
-#~ msgid "\t-+ generate C++ scanner class\n"
-#~ msgstr "\t-+ C++ ½ºÄ³³Ê Ŭ·¡½º¸¦ ¸¸µì´Ï´Ù\n"
-
-#~ msgid "\t-? produce this help message\n"
-#~ msgstr "\t-? ÀÌ µµ¿ò¸»À» Ãâ·ÂÇÕ´Ï´Ù\n"
-
-#~ msgid "\t-C specify degree of table compression (default is -Cem):\n"
-#~ msgstr "\t-C Å×ÀÌºí ¾ÐÃàÁ¤µµ¸¦ ÁöÁ¤ÇÕ´Ï´Ù(±âº»°ªÀº -Cem):\n"
-
-#~ msgid "\t\t-Ca trade off larger tables for better memory alignment\n"
-#~ msgstr "\t\t-Ca ´õ ÁÁÀº ¸Þ¸ð¸® Á¤·ÄÀ» À§ÇØ Å« Å×À̺íÀ» ¸¸µì´Ï´Ù\n"
-
-#~ msgid "\t\t-Ce construct equivalence classes\n"
-#~ msgstr "\t\t-Ce µ¿Ä¡·ù¸¦ ¸¸µì´Ï´Ù\n"
-
-#~ msgid "\t\t-Cf do not compress scanner tables; use -f representation\n"
-#~ msgstr "\t\t-Cf ½ºÄ³³Ê Å×À̺íÀ» ¾ÐÃàÇÏÁö ¾Ê½À´Ï´Ù. -fÇ¥Çö¹ýÀ» »ç¿ëÇÕ´Ï´Ù\n"
-
-#~ msgid "\t\t-CF do not compress scanner tables; use -F representation\n"
-#~ msgstr "\t\t-CF ½ºÄ³³Ê Å×À̺íÀ» ¾ÐÃàÇÏÁö ¾Ê½À´Ï´Ù. -FÇ¥Çö¹ýÀ» »ç¿ëÇÕ´Ï´Ù\n"
-
-#~ msgid "\t\t-Cm construct meta-equivalence classes\n"
-#~ msgstr "\t\t-Cm ¸ÞŸ µ¿Ä¡·ù¸¦ ¸¸µì´Ï´Ù\n"
-
-#~ msgid "\t\t-Cr use read() instead of stdio for scanner input\n"
-#~ msgstr ""
-#~ "\t\t-Cr ½ºÄ³³Ê ÀÔ·ÂÀ» stdio¶óÀ̺귯¸® ´ë½Å read()½Ã½ºÅÛ ÄÝÀ» »ç¿ëÇÕ´Ï´Ù\n"
-
-#~ msgid "\t-o specify output filename\n"
-#~ msgstr "\t-o Ãâ·Â ÆÄÀÏÀ̸§À» ÁöÁ¤ÇÕ´Ï´Ù\n"
-
-#~ msgid "\t-P specify scanner prefix other than \"yy\"\n"
-#~ msgstr "\t-P \"yy\"´ë½Å¿¡ ´Ù¸¥ ½ºÄ³³Ê Á¢µÎ»ç¸¦ ÁöÁ¤ÇÕ´Ï´Ù\n"
-
-#~ msgid "\t-S specify skeleton file\n"
-#~ msgstr "\t-S ½ºÄÌ·¹Åæ ÆÄÀÏÀ» ÁöÁ¤ÇÕ´Ï´Ù\n"
-
-#~ msgid "\t--help produce this help message\n"
-#~ msgstr "\t--help ÀÌ µµ¿ò¸»À» Ãâ·ÂÇÕ´Ï´Ù\n"
-
-#~ msgid "\t--version report %s version\n"
-#~ msgstr "\t--version %sÀÇ ¹öÀüÀ» Ãâ·ÂÇÕ´Ï´Ù\n"
diff --git a/po/nl.po b/po/nl.po
index f378820..a9819a8 100644
--- a/po/nl.po
+++ b/po/nl.po
@@ -1,15 +1,30 @@
-# Dutch translations for the fast parser Flex.
-# Copyright (C) 2014 The Flex Project (msgids)
-# This file is distributed under the same license as the flex package.
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR Free Software Foundation, Inc.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
-# Beim schwarzen Schaf...
-#
-# Benno Schulenberg <benno@vertaalt.nl>, 2005, 2006, 2007, 2008, 2012, 2014.
+#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: flex-2.5.38\n"
-"Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2014-03-26 15:00-0400\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"PO-Revision-Date: 2016-01-22 13:31-0800\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#~ # Dutch translations for the fast parser Flex.
+#~ # Copyright (C) 2014 The Flex Project (msgids)
+#~ # This file is distributed under the same license as the flex package.
+#~ #
+#~ # Beim schwarzen Schaf...
+#~ #
+#~ # Benno Schulenberg <benno@vertaalt.nl>, 2005, 2006, 2007, 2008, 2012, 2014.
+#~ msgid ""
+#~ msgstr ""
+#~ "Project-Id-Version: flex-2.5.38\n"
+#~ "Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n"
+"POT-Creation-Date: 2014-02-11 16:15-0500\n"
"PO-Revision-Date: 2014-02-13 22:25+0100\n"
"Last-Translator: Benno Schulenberg <benno@vertaalt.nl>\n"
"Language-Team: Dutch <vertaling@vrijschrift.org>\n"
@@ -183,8 +198,7 @@ msgstr "voorschrift geeft geen overeenkomsten"
#: main.c:196
msgid "-s option given but default rule can be matched"
-msgstr ""
-"optie '-s' is gegeven, maar het standaardvoorschrift geeft overeenkomsten"
+msgstr "optie '-s' is gegeven, maar het standaardvoorschrift geeft overeenkomsten"
#: main.c:236
msgid "Can't use -+ with -l option"
@@ -367,8 +381,7 @@ msgstr " geen tekenklassen\n"
#: main.c:854
#, c-format
msgid " %d/%d character classes needed %d/%d words of storage, %d reused\n"
-msgstr ""
-" %d/%d tekenklassen hadden %d/%d opslagwoorden nodig, %d hergebruikt\n"
+msgstr " %d/%d tekenklassen hadden %d/%d opslagwoorden nodig, %d hergebruikt\n"
#: main.c:859
#, c-format
@@ -472,25 +485,17 @@ msgstr "kon terugstapbestand %s niet aanmaken"
#: main.c:1519
#, c-format
msgid "-l AT&T lex compatibility option entails a large performance penalty\n"
-msgstr ""
-"de AT&T-lexcompatibiliteitsoptie '-l' betekent een grote "
-"prestatievermindering\n"
+msgstr "de AT&T-lexcompatibiliteitsoptie '-l' betekent een grote prestatievermindering\n"
#: main.c:1522
#, c-format
msgid " and may be the actual source of other reported performance penalties\n"
-msgstr ""
-" en zou de eigenlijke bron kunnen zijn van andere gemelde "
-"prestatieverminderingen\n"
+msgstr " en zou de eigenlijke bron kunnen zijn van andere gemelde prestatieverminderingen\n"
#: main.c:1528
#, c-format
-msgid ""
-"%%option yylineno entails a performance penalty ONLY on rules that can match "
-"newline characters\n"
-msgstr ""
-"de %%optie yylineno betekent een prestatievermindering, maar ALLEEN voor "
-"voorschriften die met het regeleindeteken overeen kunnen komen\n"
+msgid "%%option yylineno entails a performance penalty ONLY on rules that can match newline characters\n"
+msgstr "de %%optie yylineno betekent een prestatievermindering, maar ALLEEN voor voorschriften die met het regeleindeteken overeen kunnen komen\n"
#: main.c:1535
#, c-format
@@ -510,9 +515,7 @@ msgstr "REJECT betekent een grote prestatievermindering\n"
#: main.c:1551
#, c-format
msgid "Variable trailing context rules entail a large performance penalty\n"
-msgstr ""
-"Voorschriften met variabele nakomende context betekenen een grote "
-"prestatievermindering\n"
+msgstr "Voorschriften met variabele nakomende context betekenen een grote prestatievermindering\n"
#: main.c:1563
msgid "REJECT cannot be used with -f or -F"
@@ -525,9 +528,7 @@ msgstr "%optie yylineno gaat niet samen met REJECT"
#: main.c:1569
msgid "variable trailing context rules cannot be used with -f or -F"
-msgstr ""
-"voorschriften met variabele nakomende context gaan niet samen met '-f' of '-"
-"F'"
+msgstr "voorschriften met variabele nakomende context gaan niet samen met '-f' of '-F'"
#: main.c:1692
#, c-format
@@ -569,8 +570,7 @@ msgid ""
" -S, --skel=FILE specify skeleton file\n"
" -t, --stdout write scanner on stdout instead of %s\n"
" --yyclass=NAME name of C++ class\n"
-" --header-file=FILE create a C header file in addition to the "
-"scanner\n"
+" --header-file=FILE create a C header file in addition to the scanner\n"
" --tables-file[=FILE] write tables to FILE\n"
"\n"
"Scanner behavior:\n"
@@ -609,10 +609,8 @@ msgstr ""
"Tabelcompressie:\n"
" -Ca, --align meer geheugen gebruiken voor beter uitgelijnde tabellen\n"
" -Ce, --ecs equivalentieklassen construeren\n"
-" -Cf tabellen niet comprimeren; de -f-representatie "
-"gebruiken\n"
-" -CF tabellen niet comprimeren; de -F-representatie "
-"gebruiken\n"
+" -Cf tabellen niet comprimeren; de -f-representatie gebruiken\n"
+" -CF tabellen niet comprimeren; de -F-representatie gebruiken\n"
" -Cm, --meta-ecs meta-equivalentieklassen construeren\n"
" -Cr, --read read() gebruiken in plaats van stdio voor scannerinvoer\n"
" -f, --full een snelle, grote scanner genereren (zelfde als -Cfr)\n"
@@ -623,8 +621,7 @@ msgstr ""
" -d, --debug debugmodus in scanner aanzetten\n"
" -b, --backup terugstap-informatie naar %s schrijven\n"
" -p, --perf-report prestatierapport naar standaardfoutuitvoer schrijven\n"
-" -s, --nodefault standaardvoorschrift dat onherkende tekst ECHO-t "
-"uitzetten\n"
+" -s, --nodefault standaardvoorschrift dat onherkende tekst ECHO-t uitzetten\n"
" -T, --trace %s uitvoeren in tracemodus\n"
" -w, --nowarn geen waarschuwingen geven\n"
" -v, --verbose scannerstatistieken naar standaarduitvoer schrijven\n"
@@ -632,18 +629,15 @@ msgstr ""
"Bestanden:\n"
" -o, --outfile=BESTAND dit uitvoerbestand gebruiken\n"
" -S, --skel=BESTAND dit skeletbestand gebruiken\n"
-" -t, --stdout scanner naar standaarduitvoer schrijven, niet naar "
-"%s\n"
+" -t, --stdout scanner naar standaarduitvoer schrijven, niet naar %s\n"
" --yyclass=NAAM naam van de C++-klasse\n"
-" --header-file=BESTAND behalve de scanner ook een C-headerbestand "
-"maken\n"
+" --header-file=BESTAND behalve de scanner ook een C-headerbestand maken\n"
" --tables-file[=BESTAND] tabellen schrijven (naar dit BESTAND)\n"
"\n"
"Scannergedrag:\n"
" -7, --7bit een 7-bits-scanner genereren\n"
" -8, --8bit een 8-bits-scanner genereren\n"
-" -B, --batch een batch-scanner genereren (tegengestelde van -"
-"I)\n"
+" -B, --batch een batch-scanner genereren (tegengestelde van -I)\n"
" -i, --case-insensitive hoofd-/kleine letters in patronen negeren\n"
" -l, --lex-compat maximale compatibiliteit met de originele 'lex'\n"
" -X, --posix-compat maximale compatibiliteit met de POSIX 'lex'\n"
@@ -790,9 +784,7 @@ msgstr "iteratiewaarde moet positief zijn"
#: parse.y:804 parse.y:814
#, c-format
msgid "the character range [%c-%c] is ambiguous in a case-insensitive scanner"
-msgstr ""
-"het tekenbereik [%c-%c] is niet eenduidig in een hoofdletterongevoelige "
-"scanner"
+msgstr "het tekenbereik [%c-%c] is niet eenduidig in een hoofdletterongevoelige scanner"
#: parse.y:819
msgid "negative range in character class"
diff --git a/po/pl.po b/po/pl.po
index ca7c343..2318c1a 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -1,13 +1,28 @@
-# Polish translation for flex.
-# Copyright (C) 2007, 2012 The Flex Project (msgids)
-# This file is distributed under the same license as the flex package.
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR Free Software Foundation, Inc.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
-# Jakub Bogusz <qboosh@pld-linux.org>, 2003-2012.
+#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: flex 2.5.36\n"
-"Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2014-03-26 15:00-0400\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"PO-Revision-Date: 2016-01-22 13:31-0800\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#~ # Polish translation for flex.
+#~ # Copyright (C) 2007, 2012 The Flex Project (msgids)
+#~ # This file is distributed under the same license as the flex package.
+#~ #
+#~ # Jakub Bogusz <qboosh@pld-linux.org>, 2003-2012.
+#~ msgid ""
+#~ msgstr ""
+#~ "Project-Id-Version: flex 2.5.36\n"
+#~ "Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n"
+"POT-Creation-Date: 2012-07-22 20:48-0400\n"
"PO-Revision-Date: 2012-08-02 18:15+0200\n"
"Last-Translator: Jakub Bogusz <qboosh@pld-linux.org>\n"
"Language-Team: Polish <translation-team-pl@lists.sourceforge.net>\n"
@@ -173,361 +188,355 @@ msgstr "Nie mo¿na zapisaæ eoltbl"
msgid "Could not write yynultrans_tbl"
msgstr "Nie mo¿na zapisaæ yynultrans_tbl"
-#: main.c:191
+#: main.c:189
msgid "rule cannot be matched"
msgstr "nie mo¿na dopasowaæ regu³y"
-#: main.c:196
+#: main.c:194
msgid "-s option given but default rule can be matched"
msgstr "podano opcjê -s, ale domy¶lna regu³a mo¿e byæ dopasowana"
-#: main.c:236
+#: main.c:234
msgid "Can't use -+ with -l option"
msgstr "Nie mo¿na u¿yæ -+ z opcj± -l"
-#: main.c:239
+#: main.c:237
msgid "Can't use -f or -F with -l option"
msgstr "Nie mo¿na u¿yæ -f ani -F z opcj± -l"
-#: main.c:243
+#: main.c:241
msgid "Can't use --reentrant or --bison-bridge with -l option"
msgstr "Nie mo¿na u¿yæ --reentrant ani --bison-bridge z opcj± -l"
-#: main.c:275
+#: main.c:278
msgid "-Cf/-CF and -Cm don't make sense together"
msgstr "-Cf/-CF i -Cm razem nie maj± sensu"
-#: main.c:278
+#: main.c:281
msgid "-Cf/-CF and -I are incompatible"
msgstr "-Cf/-CF i -I s± niekompatybilne"
-#: main.c:282
+#: main.c:285
msgid "-Cf/-CF are incompatible with lex-compatibility mode"
msgstr "-Cf/-CF s± niekompatybilne z trybem kompatybilno¶ci z leksem"
-#: main.c:287
+#: main.c:290
msgid "-Cf and -CF are mutually exclusive"
msgstr "-Cf i -CF wykluczaj± siê wzajemnie"
-#: main.c:291
+#: main.c:294
msgid "Can't use -+ with -CF option"
msgstr "Nie mo¿na u¿yæ -+ z opcj± -CF"
-#: main.c:294
+#: main.c:297
#, c-format
msgid "%array incompatible with -+ option"
msgstr "%array jest niekompatybilne z opcj± -+"
-#: main.c:299
+#: main.c:302
msgid "Options -+ and --reentrant are mutually exclusive."
msgstr "Opcje -+ i --reentrant wykluczaj± siê wzajemnie."
-#: main.c:302
+#: main.c:305
msgid "bison bridge not supported for the C++ scanner."
msgstr "pomost dla bisona nie jest obs³ugiwany dla skanera C++."
-#: main.c:357 main.c:403
+#: main.c:360 main.c:406
#, c-format
msgid "could not create %s"
msgstr "nie mo¿na utworzyæ %s"
-#: main.c:416
+#: main.c:419
msgid "could not write tables header"
msgstr "nie mo¿na zapisaæ nag³ówka tablic"
-#: main.c:420
+#: main.c:423
#, c-format
msgid "can't open skeleton file %s"
msgstr "nie mo¿na otworzyæ pliku szablonu %s"
-#: main.c:456
+#: main.c:459
msgid "allocation of macro definition failed"
msgstr "przydzielenie pamiêci dla definicji makra nie powiod³o siê"
-#: main.c:504
+#: main.c:507
#, c-format
msgid "input error reading skeleton file %s"
msgstr "b³±d wej¶cia podczas odczytu pliku szablonu %s"
-#: main.c:508
+#: main.c:511
#, c-format
msgid "error closing skeleton file %s"
msgstr "b³±d podczas zamykania pliku szablonu %s"
-#: main.c:693
+#: main.c:696
#, c-format
msgid "error creating header file %s"
msgstr "b³±d podczas tworzenia pliku nag³ówkowego %s"
-#: main.c:701
+#: main.c:704
#, c-format
msgid "error writing output file %s"
msgstr "b³±d podczas zapisu pliku wyj¶ciowego %s"
-#: main.c:705
+#: main.c:708
#, c-format
msgid "error closing output file %s"
msgstr "b³±d podczas zamykania pliku wyj¶ciowego %s"
-#: main.c:709
+#: main.c:712
#, c-format
msgid "error deleting output file %s"
msgstr "b³±d podczas usuwania pliku wyj¶ciowego %s"
-#: main.c:716
+#: main.c:719
#, c-format
msgid "No backing up.\n"
msgstr "Bez zapamiêtywania.\n"
-#: main.c:720
+#: main.c:723
#, c-format
msgid "%d backing up (non-accepting) states.\n"
msgstr "%d zapamiêtywanych stanów (nie akceptuj±cych).\n"
-#: main.c:724
+#: main.c:727
#, c-format
msgid "Compressed tables always back up.\n"
msgstr "Skompresowane tablice zawsze zapamiêtuj±.\n"
-#: main.c:727
+#: main.c:730
#, c-format
msgid "error writing backup file %s"
msgstr "b³±d podczas zapisu pliku raportu z zapamiêtywania %s"
-#: main.c:731
+#: main.c:734
#, c-format
msgid "error closing backup file %s"
msgstr "b³±d podczas zamykania pliku raportu z zapamiêtywania %s"
-#: main.c:736
+#: main.c:739
#, c-format
msgid "%s version %s usage statistics:\n"
msgstr "%s w wersji %s - statystyka u¿ycia:\n"
-#: main.c:739
+#: main.c:742
#, c-format
msgid " scanner options: -"
msgstr " opcje skanera: -"
-#: main.c:818
+#: main.c:821
#, c-format
msgid " %d/%d NFA states\n"
msgstr " %d/%d stanów NFA\n"
-#: main.c:820
+#: main.c:823
#, c-format
msgid " %d/%d DFA states (%d words)\n"
msgstr " %d/%d stanów DFA (%d s³ów)\n"
-#: main.c:822
+#: main.c:825
#, c-format
msgid " %d rules\n"
msgstr " %d regu³\n"
-#: main.c:827
+#: main.c:830
#, c-format
msgid " No backing up\n"
msgstr " Bez zapamiêtywania\n"
-#: main.c:831
+#: main.c:834
#, c-format
msgid " %d backing-up (non-accepting) states\n"
msgstr " %d zapamiêtywanych stanów (nie akceptuj±cych)\n"
-#: main.c:836
+#: main.c:839
#, c-format
msgid " Compressed tables always back-up\n"
msgstr " Skompresowane tablice zawsze zapamiêtuj±\n"
-#: main.c:840
+#: main.c:843
#, c-format
msgid " Beginning-of-line patterns used\n"
msgstr " U¿ytych wzorców pocz±tek-linii\n"
-#: main.c:842
+#: main.c:845
#, c-format
msgid " %d/%d start conditions\n"
msgstr " %d/%d warunków pocz±tkowych\n"
-#: main.c:846
+#: main.c:849
#, c-format
msgid " %d epsilon states, %d double epsilon states\n"
msgstr " %d stanów epsilonowych, %d stanów podwójnie epsilonowych\n"
-#: main.c:850
+#: main.c:853
#, c-format
msgid " no character classes\n"
msgstr " bez klas znaków\n"
-#: main.c:854
+#: main.c:857
#, c-format
msgid " %d/%d character classes needed %d/%d words of storage, %d reused\n"
-msgstr ""
-" %d/%d klas znaków potrzebuje %d/%d s³ów pamiêci, %d ponownie u¿ytych\n"
+msgstr " %d/%d klas znaków potrzebuje %d/%d s³ów pamiêci, %d ponownie u¿ytych\n"
-#: main.c:859
+#: main.c:862
#, c-format
msgid " %d state/nextstate pairs created\n"
msgstr " %d utworzonych par stan/nastêpny-stan\n"
-#: main.c:862
+#: main.c:865
#, c-format
msgid " %d/%d unique/duplicate transitions\n"
msgstr " %d/%d przej¶æ unikalny/duplikat\n"
-#: main.c:867
+#: main.c:870
#, c-format
msgid " %d table entries\n"
msgstr " %d elementów tablicy\n"
-#: main.c:875
+#: main.c:878
#, c-format
msgid " %d/%d base-def entries created\n"
msgstr " %d/%d utworzonych elementów base-def\n"
-#: main.c:879
+#: main.c:882
#, c-format
msgid " %d/%d (peak %d) nxt-chk entries created\n"
msgstr " %d/%d (maksymalnie %d) utworzonych elementów nxt-chk\n"
-#: main.c:883
+#: main.c:886
#, c-format
msgid " %d/%d (peak %d) template nxt-chk entries created\n"
msgstr " %d/%d (maksymalnie %d) utworzonych szablonowych elementów nxt-chk\n"
-#: main.c:887
+#: main.c:890
#, c-format
msgid " %d empty table entries\n"
msgstr " %d pustych elementów tablicy\n"
-#: main.c:889
+#: main.c:892
#, c-format
msgid " %d protos created\n"
msgstr " %d utworzonych prototypów\n"
-#: main.c:892
+#: main.c:895
#, c-format
msgid " %d templates created, %d uses\n"
msgstr " %d utworzonych szablonów, %d u¿yæ\n"
-#: main.c:900
+#: main.c:903
#, c-format
msgid " %d/%d equivalence classes created\n"
msgstr " %d/%d utworzonych klas równowa¿no¶ci\n"
-#: main.c:908
+#: main.c:911
#, c-format
msgid " %d/%d meta-equivalence classes created\n"
msgstr " %d/%d utworzonych klas meta-równowa¿no¶ci\n"
-#: main.c:914
+#: main.c:917
#, c-format
msgid " %d (%d saved) hash collisions, %d DFAs equal\n"
msgstr " %d (%d zachowanych) kolizji haszy, %d jednakowych DFA\n"
-#: main.c:916
+#: main.c:919
#, c-format
msgid " %d sets of reallocations needed\n"
msgstr " %d potrzebnych zbiorów realokacji\n"
-#: main.c:918
+#: main.c:921
#, c-format
msgid " %d total table entries needed\n"
msgstr " %d potrzebnych ogó³em elementów tablicy\n"
-#: main.c:995
+#: main.c:998
#, c-format
msgid "Internal error. flexopts are malformed.\n"
msgstr "B³±d wewnêtrzny. ¬le sformu³owane flexopts.\n"
-#: main.c:1005
+#: main.c:1008
#, c-format
msgid "Try `%s --help' for more information.\n"
msgstr "`%s --help' poda wiêcej informacji.\n"
-#: main.c:1062
+#: main.c:1065
#, c-format
msgid "unknown -C option '%c'"
msgstr "nieznana opcja -C '%c'"
-#: main.c:1191
+#: main.c:1194
#, c-format
msgid "%s %s\n"
msgstr "%s %s\n"
-#: main.c:1466
+#: main.c:1469
msgid "fatal parse error"
msgstr "krytyczny b³±d analizy sk³adni"
-#: main.c:1498
+#: main.c:1501
#, c-format
msgid "could not create backing-up info file %s"
msgstr "nie mo¿na utworzyæ pliku informacji o zapamiêtywaniu %s"
-#: main.c:1519
+#: main.c:1522
#, c-format
msgid "-l AT&T lex compatibility option entails a large performance penalty\n"
msgstr "opcja -l zgodno¶ci z leksem AT&T powoduje du¿± stratê wydajno¶ci\n"
-#: main.c:1522
+#: main.c:1525
#, c-format
msgid " and may be the actual source of other reported performance penalties\n"
msgstr " i mo¿e byæ przyczyn± innych zg³aszanych strat wydajno¶ci\n"
-#: main.c:1528
+#: main.c:1531
#, c-format
-msgid ""
-"%%option yylineno entails a performance penalty ONLY on rules that can match "
-"newline characters\n"
-msgstr ""
-"%%option yylineno powoduje straty wydajno¶ci TYLKO dla regu³ dopasowuj±cych "
-"znak koñca linii\n"
+msgid "%%option yylineno entails a performance penalty ONLY on rules that can match newline characters\n"
+msgstr "%%option yylineno powoduje straty wydajno¶ci TYLKO dla regu³ dopasowuj±cych znak koñca linii\n"
-#: main.c:1535
+#: main.c:1538
#, c-format
msgid "-I (interactive) entails a minor performance penalty\n"
msgstr "-I (interaktywny) powoduje ma³± stratê wydajno¶ci\n"
-#: main.c:1540
+#: main.c:1543
#, c-format
msgid "yymore() entails a minor performance penalty\n"
msgstr "yymore() powoduje ma³± stratê wydajno¶ci\n"
-#: main.c:1546
+#: main.c:1549
#, c-format
msgid "REJECT entails a large performance penalty\n"
msgstr "REJECT powoduje du¿± stratê wydajno¶ci\n"
-#: main.c:1551
+#: main.c:1554
#, c-format
msgid "Variable trailing context rules entail a large performance penalty\n"
-msgstr ""
-"Regu³y ze zmiennym koñcowym kontekstem powoduj± du¿± stratê wydajno¶ci\n"
+msgstr "Regu³y ze zmiennym koñcowym kontekstem powoduj± du¿± stratê wydajno¶ci\n"
-#: main.c:1563
+#: main.c:1566
msgid "REJECT cannot be used with -f or -F"
msgstr "REJECT nie mo¿e byæ u¿yte z -f ani -F"
-#: main.c:1566
+#: main.c:1569
#, c-format
msgid "%option yylineno cannot be used with REJECT"
msgstr "%option yylineno nie mo¿e byæ u¿yte z REJECT"
-#: main.c:1569
+#: main.c:1572
msgid "variable trailing context rules cannot be used with -f or -F"
msgstr "regu³y ze zmiennym koñcowym kontekstem nie mog± byæ u¿yte z -f ani -F"
-#: main.c:1692
+#: main.c:1695
#, c-format
msgid "%option yyclass only meaningful for C++ scanners"
msgstr "%option yyclass ma znaczenie tylko dla skanerów C++"
-#: main.c:1799
+#: main.c:1802
#, c-format
msgid "Usage: %s [OPTIONS] [FILE]...\n"
msgstr "Sk³adnia: %s [OPCJE] [PLIK]...\n"
-#: main.c:1802
+#: main.c:1805
#, c-format
msgid ""
"Generates programs that perform pattern-matching on text.\n"
@@ -557,8 +566,7 @@ msgid ""
" -S, --skel=FILE specify skeleton file\n"
" -t, --stdout write scanner on stdout instead of %s\n"
" --yyclass=NAME name of C++ class\n"
-" --header-file=FILE create a C header file in addition to the "
-"scanner\n"
+" --header-file=FILE create a C header file in addition to the scanner\n"
" --tables-file[=FILE] write tables to FILE\n"
"\n"
"Scanner behavior:\n"
@@ -601,24 +609,19 @@ msgstr ""
" -CF nie kompresowanie tablic; u¿ycie reprezentacji -F\n"
" -Cm, --meta-ecs konstruowanie klas meta-równowa¿no¶ci\n"
" -Cr, --read u¿ycie read() zamiast stdio dla wej¶cia skanera\n"
-" -f, --full wygenerowanie szybkiego, wielkiego skanera. To samo co -"
-"Cfr\n"
-" -F, --fast u¿ycie alternatywnej reprezentacji tablic. To samo co -"
-"CFr\n"
+" -f, --full wygenerowanie szybkiego, wielkiego skanera. To samo co -Cfr\n"
+" -F, --fast u¿ycie alternatywnej reprezentacji tablic. To samo co -CFr\n"
" -Cem domy¶lne kompresowanie (to samo co --ecs --meta-ecs)\n"
"\n"
"Diagnostyka:\n"
-" -d, --debug w³±czenie trybu diagnostycznego (debug) w "
-"skanerze\n"
+" -d, --debug w³±czenie trybu diagnostycznego (debug) w skanerze\n"
" -b, --backup zapisanie informacji o zapamiêtywaniu do %s\n"
" -p, --perf-report wypisanie raportu o wydajno¶ci na stderr\n"
-" -s, --nodefault pominiêcie domy¶lnej regu³y ECHO dla "
-"niedopasowanego\n"
+" -s, --nodefault pominiêcie domy¶lnej regu³y ECHO dla niedopasowanego\n"
" tekstu\n"
" -T, --trace %s powinien dzia³aæ w trybie ¶ledzenia\n"
" -w, --nowarn nie generowanie ostrze¿eñ\n"
-" -v, --verbose wypisanie podsumowania statystyk skanera na "
-"stdout\n"
+" -v, --verbose wypisanie podsumowania statystyk skanera na stdout\n"
"\n"
"Pliki:\n"
" -o, --outfile=PLIK podanie nazwy pliku wyj¶ciowego\n"
@@ -631,13 +634,11 @@ msgstr ""
"Zachowanie skanera:\n"
" -7, --7bit wygenerowanie skanera 7-bitowego\n"
" -8, --8bit wygenerowanie skanera 8-bitowego\n"
-" -B, --batch wygenerowanie skanera wsadowego (przeciwieñstwo -"
-"I)\n"
+" -B, --batch wygenerowanie skanera wsadowego (przeciwieñstwo -I)\n"
" -i, --case-insensitive ignorowanie wielko¶ci liter we wzorcach\n"
" -l, --lex-compat maksymalna kompatybilno¶æ z oryginalnym leksem\n"
" -X, --posix-compat maksymalna kompatybilno¶æ z leksem POSIX\n"
-" -I, --interactive wygenerowanie skanera interaktywnego (przeciw. -"
-"B)\n"
+" -I, --interactive wygenerowanie skanera interaktywnego (przeciw. -B)\n"
" --yylineno ¶ledzenie liczby linii w yylineno\n"
"\n"
"Generowany kod:\n"
@@ -735,20 +736,20 @@ msgstr "pusty automat w dupmachine()"
msgid "Variable trailing context rule at line %d\n"
msgstr "Regu³a ze zmiennym koñcowym kontekstem w linii %d\n"
-#: nfa.c:364
+#: nfa.c:353
msgid "bad state type in mark_beginning_as_normal()"
msgstr "b³êdny typ stanu w mark_beginning_as_normal()"
-#: nfa.c:609
+#: nfa.c:598
#, c-format
msgid "input rules are too complicated (>= %d NFA states)"
msgstr "regu³y wej¶ciowe s± zbyt skomplikowane (>= %d stanów NFA)"
-#: nfa.c:688
+#: nfa.c:677
msgid "found too many transitions in mkxtion()"
msgstr "znaleziono zbyt du¿o przej¶æ w mkxtion()"
-#: nfa.c:714
+#: nfa.c:703
#, c-format
msgid "too many rules (> %d)!"
msgstr "zbyt du¿o regu³ (> %d)!"
@@ -780,9 +781,7 @@ msgstr "warto¶æ iteracji musi byæ dodatnia"
#: parse.y:804 parse.y:814
#, c-format
msgid "the character range [%c-%c] is ambiguous in a case-insensitive scanner"
-msgstr ""
-"przedzia³ znaków [%c-%c] jest niejednoznaczny w skanerze ignoruj±cym "
-"wielko¶æ liter"
+msgstr "przedzia³ znaków [%c-%c] jest niejednoznaczny w skanerze ignoruj±cym wielko¶æ liter"
#: parse.y:819
msgid "negative range in character class"
@@ -790,15 +789,11 @@ msgstr "ujemny przedzia³ w klasie znaków"
#: parse.y:916
msgid "[:^lower:] is ambiguous in case insensitive scanner"
-msgstr ""
-"[:^lower:] jest niejednoznaczne w przypadku skanera ignoruj±cego wielko¶æ "
-"liter"
+msgstr "[:^lower:] jest niejednoznaczne w przypadku skanera ignoruj±cego wielko¶æ liter"
#: parse.y:922
msgid "[:^upper:] ambiguous in case insensitive scanner"
-msgstr ""
-"[:^upper:] jest niejednoznaczne w przypadku skanera ignoruj±cego wielko¶æ "
-"liter"
+msgstr "[:^upper:] jest niejednoznaczne w przypadku skanera ignoruj±cego wielko¶æ liter"
#: scan.l:75 scan.l:618 scan.l:676
msgid "Input line too long\n"
diff --git a/po/pt_BR.po b/po/pt_BR.po
index b442365..9fbeddb 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -1,18 +1,32 @@
-# Translation to Brazilian Portuguese of flex.
-# Copyright (C) 2013 The Flex Project (msgids)
-# This file is distributed under the same license as the flex package.
-# Alexandre Folle de Menezes <afmenez@terra.com.br>, 2003, 2004.
-# Rafael Ferreira <rafael.f.f1@gmail.com>, 2013.
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR Free Software Foundation, Inc.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
+#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: flex 2.5.37\n"
-"Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2014-03-26 15:00-0400\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"PO-Revision-Date: 2016-01-22 13:35-0800\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#~ # Translation to Brazilian Portuguese of flex.
+#~ # Copyright (C) 2013 The Flex Project (msgids)
+#~ # This file is distributed under the same license as the flex package.
+#~ # Alexandre Folle de Menezes <afmenez@terra.com.br>, 2003, 2004.
+#~ # Rafael Ferreira <rafael.f.f1@gmail.com>, 2013.
+#~ #
+#~ msgid ""
+#~ msgstr ""
+#~ "Project-Id-Version: flex 2.5.37\n"
+#~ "Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n"
+"POT-Creation-Date: 2012-07-22 20:48-0400\n"
"PO-Revision-Date: 2013-11-27 08:09-0300\n"
"Last-Translator: Rafael Ferreira <rafael.f.f1@gmail.com>\n"
-"Language-Team: Brazilian Portuguese <ldpbr-translation@lists.sourceforge."
-"net>\n"
+"Language-Team: Brazilian Portuguese <ldpbr-translation@lists.sourceforge.net>\n"
"Language: pt_BR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -177,368 +191,355 @@ msgstr "Não foi possível escrever eoltbl"
msgid "Could not write yynultrans_tbl"
msgstr "Não foi possível escrever yynultrans_tbl"
-#: main.c:191
+#: main.c:189
msgid "rule cannot be matched"
msgstr "aplicação da regra não gerou nenhum resultado"
-#: main.c:196
+#: main.c:194
msgid "-s option given but default rule can be matched"
msgstr "a opção -s foi fornecida, mas a regra padrão pode ser aplicada"
-#: main.c:236
+#: main.c:234
msgid "Can't use -+ with -l option"
msgstr "Não é possível usar -+ com a opção -l"
-#: main.c:239
+#: main.c:237
msgid "Can't use -f or -F with -l option"
msgstr "Não é possível usar -f ou -F com a opção -l"
-#: main.c:243
+#: main.c:241
msgid "Can't use --reentrant or --bison-bridge with -l option"
msgstr "Não é possível usar --reentrant ou --bison-bridge com a opção -l"
-#: main.c:275
+#: main.c:278
msgid "-Cf/-CF and -Cm don't make sense together"
msgstr "-Cf/-CF e -Cm não fazem sentido juntos"
-#: main.c:278
+#: main.c:281
msgid "-Cf/-CF and -I are incompatible"
msgstr "-Cf/-CF e -I são incompatíveis"
-#: main.c:282
+#: main.c:285
msgid "-Cf/-CF are incompatible with lex-compatibility mode"
msgstr "-Cf/-CF são incompatíveis com o modo de compatibilidade lex"
-#: main.c:287
+#: main.c:290
msgid "-Cf and -CF are mutually exclusive"
msgstr "-Cf e -CF são mutuamente exclusivos"
-#: main.c:291
+#: main.c:294
msgid "Can't use -+ with -CF option"
msgstr "Não é possível usar -+ com a opção -CF"
-#: main.c:294
+#: main.c:297
#, c-format
msgid "%array incompatible with -+ option"
msgstr "%array é incompatível com a opção -+"
-#: main.c:299
+#: main.c:302
msgid "Options -+ and --reentrant are mutually exclusive."
msgstr "As opções -+ e --reentrant são mutuamente exclusivas."
-#: main.c:302
+#: main.c:305
msgid "bison bridge not supported for the C++ scanner."
msgstr "sem suporte à ponte bison pelo scanner de C++."
-#: main.c:357 main.c:403
+#: main.c:360 main.c:406
#, c-format
msgid "could not create %s"
msgstr "não foi possível criar %s"
-#: main.c:416
+#: main.c:419
msgid "could not write tables header"
msgstr "não foi possível escrever o cabeçalho das tabelas"
-#: main.c:420
+#: main.c:423
#, c-format
msgid "can't open skeleton file %s"
msgstr "não é possível abrir o arquivo esqueleto %s"
-#: main.c:456
+#: main.c:459
msgid "allocation of macro definition failed"
msgstr "a alocação de definição de macro falhou"
-#: main.c:504
+#: main.c:507
#, c-format
msgid "input error reading skeleton file %s"
msgstr "erro lendo o arquivo esqueleto %s"
-#: main.c:508
+#: main.c:511
#, c-format
msgid "error closing skeleton file %s"
msgstr "erro fechando o arquivo esqueleto %s"
-#: main.c:693
+#: main.c:696
#, c-format
msgid "error creating header file %s"
msgstr "erro ao criar o arquivo cabeçalho %s"
-#: main.c:701
+#: main.c:704
#, c-format
msgid "error writing output file %s"
msgstr "erro ao gravar o arquivo de saída %s"
-#: main.c:705
+#: main.c:708
#, c-format
msgid "error closing output file %s"
msgstr "erro ao fechar o arquivo de saída %s"
-#: main.c:709
+#: main.c:712
#, c-format
msgid "error deleting output file %s"
msgstr "erro ao remover o arquivo de saída %s"
-#: main.c:716
+#: main.c:719
#, c-format
msgid "No backing up.\n"
msgstr "Impossível restaurar.\n"
-#: main.c:720
+#: main.c:723
#, c-format
msgid "%d backing up (non-accepting) states.\n"
msgstr "%d fazendo cópia de segurança de estados (não-aceita).\n"
-#: main.c:724
+#: main.c:727
#, c-format
msgid "Compressed tables always back up.\n"
msgstr "Tabelas compactadas sempre têm cópias de segurança.\n"
-#: main.c:727
+#: main.c:730
#, c-format
msgid "error writing backup file %s"
msgstr "erro ao gravar a cópia de segurança %s"
-#: main.c:731
+#: main.c:734
#, c-format
msgid "error closing backup file %s"
msgstr "erro ao fechar a cópia de segurança %s"
-#: main.c:736
+#: main.c:739
#, c-format
msgid "%s version %s usage statistics:\n"
msgstr "%s versão %s estatísticas de uso:\n"
-#: main.c:739
+#: main.c:742
#, c-format
msgid " scanner options: -"
msgstr " opções de scanner: -"
-#: main.c:818
+#: main.c:821
#, c-format
msgid " %d/%d NFA states\n"
msgstr " %d/%d estados NFA\n"
-#: main.c:820
+#: main.c:823
#, c-format
msgid " %d/%d DFA states (%d words)\n"
msgstr " %d/%d estados DFA (%d palavras)\n"
-#: main.c:822
+#: main.c:825
#, c-format
msgid " %d rules\n"
msgstr " %d regras\n"
-#: main.c:827
+#: main.c:830
#, c-format
msgid " No backing up\n"
msgstr " Sem cópia de segurança\n"
-#: main.c:831
+#: main.c:834
#, c-format
msgid " %d backing-up (non-accepting) states\n"
msgstr " %d fazendo cópia de segurança de estados (não-aceita)\n"
-#: main.c:836
+#: main.c:839
#, c-format
msgid " Compressed tables always back-up\n"
msgstr " Tabelas compactadas sempre têm cópias de segurança\n"
-#: main.c:840
+#: main.c:843
#, c-format
msgid " Beginning-of-line patterns used\n"
msgstr " Padrões de início-de-linha usados\n"
-#: main.c:842
+#: main.c:845
#, c-format
msgid " %d/%d start conditions\n"
msgstr " %d/%d condições de início\n"
-#: main.c:846
+#: main.c:849
#, c-format
msgid " %d epsilon states, %d double epsilon states\n"
msgstr " %d estados epsilon, %d estados epsilon duplo\n"
-#: main.c:850
+#: main.c:853
#, c-format
msgid " no character classes\n"
msgstr " nenhuma classe de caracteres\n"
-#: main.c:854
+#: main.c:857
#, c-format
msgid " %d/%d character classes needed %d/%d words of storage, %d reused\n"
-msgstr ""
-" %d/%d classes de caracteres precisaram de %d/%d palavras de armazenamento, "
-"%d reusadas\n"
+msgstr " %d/%d classes de caracteres precisaram de %d/%d palavras de armazenamento, %d reusadas\n"
-#: main.c:859
+#: main.c:862
#, c-format
msgid " %d state/nextstate pairs created\n"
msgstr " %d pares estado/próximoestado criados\n"
-#: main.c:862
+#: main.c:865
#, c-format
msgid " %d/%d unique/duplicate transitions\n"
msgstr " %d/%d transições únicas/duplicadas\n"
-#: main.c:867
+#: main.c:870
#, c-format
msgid " %d table entries\n"
msgstr " %d entradas de tabela\n"
-#: main.c:875
+#: main.c:878
#, c-format
msgid " %d/%d base-def entries created\n"
msgstr " %d/%d entradas base-def criadas\n"
-#: main.c:879
+#: main.c:882
#, c-format
msgid " %d/%d (peak %d) nxt-chk entries created\n"
msgstr " %d/%d (pico %d) entradas nxt-chk criadas\n"
-#: main.c:883
+#: main.c:886
#, c-format
msgid " %d/%d (peak %d) template nxt-chk entries created\n"
msgstr " %d/%d (pico %d) modelos de entradas nxt-chk criadas\n"
-#: main.c:887
+#: main.c:890
#, c-format
msgid " %d empty table entries\n"
msgstr " %d entradas vazias na tabela\n"
-#: main.c:889
+#: main.c:892
#, c-format
msgid " %d protos created\n"
msgstr " %d protos criados\n"
-#: main.c:892
+#: main.c:895
#, c-format
msgid " %d templates created, %d uses\n"
msgstr " %d modelos criados, %d usos\n"
-#: main.c:900
+#: main.c:903
#, c-format
msgid " %d/%d equivalence classes created\n"
msgstr " %d/%d classes de equivalência criadas\n"
-#: main.c:908
+#: main.c:911
#, c-format
msgid " %d/%d meta-equivalence classes created\n"
msgstr " %d/%d classes de meta-equivalência criadas\n"
-#: main.c:914
+#: main.c:917
#, c-format
msgid " %d (%d saved) hash collisions, %d DFAs equal\n"
msgstr " %d (%d salvas) colisões de hash, %d DFAs iguais\n"
-#: main.c:916
+#: main.c:919
#, c-format
msgid " %d sets of reallocations needed\n"
msgstr " %d conjuntos de realocação necessários\n"
-#: main.c:918
+#: main.c:921
#, c-format
msgid " %d total table entries needed\n"
msgstr " %d total de entradas de tabela necessárias\n"
-#: main.c:995
+#: main.c:998
#, c-format
msgid "Internal error. flexopts are malformed.\n"
msgstr "Erro interno. flexopts estão malformados.\n"
-#: main.c:1005
+#: main.c:1008
#, c-format
msgid "Try `%s --help' for more information.\n"
msgstr "Tente \"%s --help\" para maiores informações.\n"
-#: main.c:1062
+#: main.c:1065
#, c-format
msgid "unknown -C option '%c'"
msgstr "opção -C \"%c\" desconhecida"
-#: main.c:1191
+#: main.c:1194
#, c-format
msgid "%s %s\n"
msgstr "%s %s\n"
-#: main.c:1466
+#: main.c:1469
msgid "fatal parse error"
msgstr "erro fatal de análise"
-#: main.c:1498
+#: main.c:1501
#, c-format
msgid "could not create backing-up info file %s"
-msgstr ""
-"não foi possível criar arquivo de cópia de segurança das informações %s"
+msgstr "não foi possível criar arquivo de cópia de segurança das informações %s"
-#: main.c:1519
+#: main.c:1522
#, c-format
msgid "-l AT&T lex compatibility option entails a large performance penalty\n"
-msgstr ""
-"a opção de compatibilidade com lex da AT&T \"-l\" acarreta em uma grande "
-"penalidade na performance\n"
+msgstr "a opção de compatibilidade com lex da AT&T \"-l\" acarreta em uma grande penalidade na performance\n"
-#: main.c:1522
+#: main.c:1525
#, c-format
msgid " and may be the actual source of other reported performance penalties\n"
-msgstr ""
-" e pode ser a fonte real de outras penalidades de performance reportadas\n"
+msgstr " e pode ser a fonte real de outras penalidades de performance reportadas\n"
-#: main.c:1528
+#: main.c:1531
#, c-format
-msgid ""
-"%%option yylineno entails a performance penalty ONLY on rules that can match "
-"newline characters\n"
-msgstr ""
-"%%option yylineno acarreta em uma penalidade na performance APENAS em regras "
-"que podem bater caracteres de nova linha\n"
+msgid "%%option yylineno entails a performance penalty ONLY on rules that can match newline characters\n"
+msgstr "%%option yylineno acarreta em uma penalidade na performance APENAS em regras que podem bater caracteres de nova linha\n"
-#: main.c:1535
+#: main.c:1538
#, c-format
msgid "-I (interactive) entails a minor performance penalty\n"
msgstr "-I (interativo) acarreta em uma pequena penalidade na performance\n"
-#: main.c:1540
+#: main.c:1543
#, c-format
msgid "yymore() entails a minor performance penalty\n"
msgstr "yymore() acarreta em uma pequena penalidade na performance\n"
-#: main.c:1546
+#: main.c:1549
#, c-format
msgid "REJECT entails a large performance penalty\n"
msgstr "REJECT acarreta em uma grande penalidade na performance\n"
-#: main.c:1551
+#: main.c:1554
#, c-format
msgid "Variable trailing context rules entail a large performance penalty\n"
-msgstr ""
-"Variável seguindo regras de contexto implicam em grande perda de "
-"performance\n"
+msgstr "Variável seguindo regras de contexto implicam em grande perda de performance\n"
-#: main.c:1563
+#: main.c:1566
msgid "REJECT cannot be used with -f or -F"
msgstr "REJECT não pode ser usado com -f ou -F"
-#: main.c:1566
+#: main.c:1569
#, c-format
msgid "%option yylineno cannot be used with REJECT"
msgstr "%option yylineno não pode ser usada com REJECT"
-#: main.c:1569
+#: main.c:1572
msgid "variable trailing context rules cannot be used with -f or -F"
-msgstr ""
-"variáveis seguindo regras de contexto não podem ser usadas com -f ou -F"
+msgstr "variáveis seguindo regras de contexto não podem ser usadas com -f ou -F"
-#: main.c:1692
+#: main.c:1695
#, c-format
msgid "%option yyclass only meaningful for C++ scanners"
msgstr "%option yyclass só tem sentido para scanners C++"
-#: main.c:1799
+#: main.c:1802
#, c-format
msgid "Usage: %s [OPTIONS] [FILE]...\n"
msgstr "Uso: %s [OPÇÕES] [ARQUIVO]...\n"
-#: main.c:1802
+#: main.c:1805
#, c-format
msgid ""
"Generates programs that perform pattern-matching on text.\n"
@@ -568,8 +569,7 @@ msgid ""
" -S, --skel=FILE specify skeleton file\n"
" -t, --stdout write scanner on stdout instead of %s\n"
" --yyclass=NAME name of C++ class\n"
-" --header-file=FILE create a C header file in addition to the "
-"scanner\n"
+" --header-file=FILE create a C header file in addition to the scanner\n"
" --tables-file[=FILE] write tables to FILE\n"
"\n"
"Scanner behavior:\n"
@@ -613,8 +613,7 @@ msgstr ""
" -Cm, --meta-ecs construct meta-equivalence classes\n"
" -Cr, --read use read() em vez da stdio para a entrada do scanner\n"
" -f, --full gera scanner grande e rápido. O mesmo que -Cfr\n"
-" -F, --fast usa representação de tabela alternativa. O mesmo que -"
-"CFr\n"
+" -F, --fast usa representação de tabela alternativa. O mesmo que -CFr\n"
" -Cem compressão padrão (mesmo que --ecs --meta-ecs)\n"
"\n"
"Depuração:\n"
@@ -625,8 +624,7 @@ msgstr ""
" correspondente\n"
" -T, --trace %s deveria executar em modo de ratro\n"
" -w, --nowarn não gera avisos\n"
-" -v, --verbose escreve um resumo das estatísticas do scanner "
-"para\n"
+" -v, --verbose escreve um resumo das estatísticas do scanner para\n"
" stdout\n"
"\n"
"Arquivos:\n"
@@ -744,20 +742,20 @@ msgstr "máquina vazia em dupmachine()"
msgid "Variable trailing context rule at line %d\n"
msgstr "Regra de final de contexto variável na linha %d\n"
-#: nfa.c:364
+#: nfa.c:353
msgid "bad state type in mark_beginning_as_normal()"
msgstr "estado de tipo inválido em mark_beginning_as_normal()"
-#: nfa.c:609
+#: nfa.c:598
#, c-format
msgid "input rules are too complicated (>= %d NFA states)"
msgstr "regras de entrada são muito complicadas (>= %d estados NFA)"
-#: nfa.c:688
+#: nfa.c:677
msgid "found too many transitions in mkxtion()"
msgstr "muitas transições em mkxtion()"
-#: nfa.c:714
+#: nfa.c:703
#, c-format
msgid "too many rules (> %d)!"
msgstr "muitas regras (> %d)!"
@@ -789,8 +787,7 @@ msgstr "valor de iteração deve ser positivo"
#: parse.y:804 parse.y:814
#, c-format
msgid "the character range [%c-%c] is ambiguous in a case-insensitive scanner"
-msgstr ""
-"a faixa de caracteres [%c-%c] é ambígua em um scanner \"case-insensitive\""
+msgstr "a faixa de caracteres [%c-%c] é ambígua em um scanner \"case-insensitive\""
#: parse.y:819
msgid "negative range in character class"
@@ -954,8 +951,7 @@ msgstr "*Algo Estranho* - tok: %d val: %d\n"
#~ msgstr "verificação de consistência falhou em symfollowset"
#~ msgid "Can't specify header option if writing to stdout."
-#~ msgstr ""
-#~ "Impossível especificar a opção de cabeçalho se escrevendo em stdout."
+#~ msgstr "Impossível especificar a opção de cabeçalho se escrevendo em stdout."
#~ msgid "unknown -R option '%c'"
#~ msgstr "opção -R '%c' desconecida"
diff --git a/po/ro.po b/po/ro.po
index 637c2b8..9c08b64 100644
--- a/po/ro.po
+++ b/po/ro.po
@@ -1,36 +1,33 @@
-# Mesajele în limba românã pentru pachetul flex.
-# Copyright (C) 2003 The Flex Project
-# Eugen Hoanca <eugenh@urban-grafx.ro>, 2003.
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR Free Software Foundation, Inc.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
+#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: flex 2.5.31\n"
-"Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2014-03-26 15:00-0400\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"PO-Revision-Date: 2016-01-22 13:23-0800\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#~ # Mesajele în limba românã pentru pachetul flex.
+#~ # Copyright (C) 2003 The Flex Project
+#~ # Eugen Hoanca <eugenh@urban-grafx.ro>, 2003.
+#~ #
+#~ msgid ""
+#~ msgstr ""
+#~ "Project-Id-Version: flex 2.5.31\n"
+"POT-Creation-Date: 2003-04-01 11:33-0500\n"
"PO-Revision-Date: 2003-11-22 11:07+0200\n"
"Last-Translator: Eugen Hoanca <eugenh@urban-grafx.ro>\n"
"Language-Team: Romanian <translation-team-ro@lists.sourceforge.net>\n"
-"Language: ro\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=ISO-8859-2\n"
"Content-Transfer-Encoding: 8bit\n"
-#: buf.c:78
-msgid "Allocation of buffer to print string failed"
-msgstr ""
-
-#: buf.c:100
-msgid "Allocation of buffer for line directive failed"
-msgstr ""
-
-#: buf.c:177
-msgid "Allocation of buffer for m4 def failed"
-msgstr ""
-
-#: buf.c:197
-msgid "Allocation of buffer for m4 undef failed"
-msgstr ""
-
#: dfa.c:61
#, c-format
msgid "State #%d is non-accepting -\n"
@@ -41,17 +38,14 @@ msgid "dangerous trailing context"
msgstr "context de sfârºit(trailing) periculos"
#: dfa.c:166
-#, c-format
msgid " associated rule line numbers:"
msgstr " numerele de linie asociate regulii:"
#: dfa.c:202
-#, c-format
msgid " out-transitions: "
msgstr " tranziþii exterioare(out): "
#: dfa.c:210
-#, c-format
msgid ""
"\n"
" jam-transitions: EOF "
@@ -84,15 +78,19 @@ msgstr "nu am putut crea sfârºit unic pentru starea buffer-ului"
msgid "state # %d:\n"
msgstr "stare # %d:\n"
-#: dfa.c:785
+#: dfa.c:800
msgid "Could not write yynxt_tbl[][]"
msgstr "Nu am putut scrie yynxt_tbl[][]"
-#: dfa.c:1049
+#: dfa.c:1023
+msgid "consistency check failed in symfollowset"
+msgstr "verificare de consistenþã eºuatã în symfollowset"
+
+#: dfa.c:1071
msgid "bad transition character detected in sympartition()"
msgstr "caracter greºit de tranziþie detectat în sympartition()"
-#: gen.c:478
+#: gen.c:484
msgid ""
"\n"
"\n"
@@ -104,29 +102,29 @@ msgstr ""
"Clase de Echivalenþã:\n"
"\n"
-#: gen.c:662 gen.c:691 gen.c:1215
+#: gen.c:668 gen.c:697 gen.c:1221
#, c-format
msgid "state # %d accepts: [%d]\n"
msgstr "starea # %d acceptã: [%d]\n"
-#: gen.c:1110
+#: gen.c:1116
#, c-format
msgid "state # %d accepts: "
msgstr "starea # %d acceptã: "
-#: gen.c:1157
+#: gen.c:1163
msgid "Could not write yyacclist_tbl"
msgstr "Nu am putut scrie yyacclist_tbl"
-#: gen.c:1233
+#: gen.c:1239
msgid "Could not write yyacc_tbl"
msgstr "Nu am putut scrie yyacc_tbl"
-#: gen.c:1248 gen.c:1633 gen.c:1656
+#: gen.c:1254 gen.c:1639 gen.c:1662
msgid "Could not write ecstbl"
msgstr "Nu am putut scrie ecstbl"
-#: gen.c:1271
+#: gen.c:1277
msgid ""
"\n"
"\n"
@@ -136,401 +134,373 @@ msgstr ""
"\n"
"Clase de Meta-Echivalenþã:\n"
-#: gen.c:1293
+#: gen.c:1299
msgid "Could not write yymeta_tbl"
msgstr "Nu am putut scrie yymeta_tbl"
-#: gen.c:1354
+#: gen.c:1360
msgid "Could not write yybase_tbl"
msgstr "Nu am putut scrie yybase_tbl"
-#: gen.c:1388
+#: gen.c:1394
msgid "Could not write yydef_tbl"
msgstr "Nu am putut scrie yydef_tbl"
-#: gen.c:1428
+#: gen.c:1434
msgid "Could not write yynxt_tbl"
msgstr "Nu am putut scrie yynxt_tbl"
-#: gen.c:1464
+#: gen.c:1470
msgid "Could not write yychk_tbl"
msgstr "Nu am putut scrie yychk_tbl"
-#: gen.c:1618 gen.c:1647
+#: gen.c:1624 gen.c:1653
msgid "Could not write ftbl"
msgstr "Nu am putut scrie ftbl"
-#: gen.c:1624
+#: gen.c:1630
msgid "Could not write ssltbl"
msgstr "Nu am putut scrie ssltbl"
-#: gen.c:1675
+#: gen.c:1681
msgid "Could not write eoltbl"
msgstr "Nu am putut scrie eoltbl"
-#: gen.c:1735
+#: gen.c:1741
msgid "Could not write yynultrans_tbl"
msgstr "Nu am putut scrie yynultrans_tbl"
-#: main.c:191
+#: main.c:176
msgid "rule cannot be matched"
msgstr "regula nu se potriveºte cu nimic"
-#: main.c:196
+#: main.c:181
msgid "-s option given but default rule can be matched"
msgstr "a fost datã opþiunea -s dar regula implicitã se poate potrivi"
-#: main.c:236
+#: main.c:217
msgid "Can't use -+ with -l option"
msgstr "Nu se poate folosi -+ cu opþiunea -l"
-#: main.c:239
+#: main.c:220
msgid "Can't use -f or -F with -l option"
msgstr "Nu se poate folosi -f sau -F cu opþiunea -l"
-#: main.c:243
+#: main.c:224
msgid "Can't use --reentrant or --bison-bridge with -l option"
msgstr "Nu se poate folosi --reentrant sau --bison-bridge cu opþiunea -l"
-#: main.c:275
+#: main.c:261
msgid "-Cf/-CF and -Cm don't make sense together"
msgstr "-Cf/-CF ºi -Cm nu au sens folosite împreunã"
-#: main.c:278
+#: main.c:264
msgid "-Cf/-CF and -I are incompatible"
msgstr "-Cf/-CF ºi -I sunt incompatibile"
-#: main.c:282
+#: main.c:268
msgid "-Cf/-CF are incompatible with lex-compatibility mode"
msgstr "-Cf/-CF sunt incompatibile cu module de compatibilitate lex"
-#: main.c:287
+#: main.c:273
msgid "-Cf and -CF are mutually exclusive"
msgstr "-Cf ºi -CF se exclud reciproc"
-#: main.c:291
+#: main.c:277
msgid "Can't use -+ with -CF option"
msgstr "Nu se poate folosi -+ cu opþiunea -CF"
-#: main.c:294
+#: main.c:280
#, c-format
msgid "%array incompatible with -+ option"
msgstr "%array incompatibil cu opþiunea -+"
-#: main.c:299
+#: main.c:285
msgid "Options -+ and --reentrant are mutually exclusive."
msgstr "Opþiunile -+ and --reentrant se exclud reciproc"
-#: main.c:302
+#: main.c:288
msgid "bison bridge not supported for the C++ scanner."
msgstr "bridge bison nu este suportat pentru scannerul C++."
-#: main.c:357 main.c:403
+#: main.c:340 main.c:385
#, c-format
msgid "could not create %s"
msgstr "nu am putut crea %s"
-#: main.c:416
+#: main.c:398
msgid "could not write tables header"
msgstr "Nu am putut scrie capul de tabel"
-#: main.c:420
+#: main.c:402
#, c-format
msgid "can't open skeleton file %s"
msgstr "nu am putut deschide fiºierul schelet %s"
-#: main.c:456
-msgid "allocation of macro definition failed"
-msgstr ""
-
-#: main.c:504
+#: main.c:483
#, c-format
msgid "input error reading skeleton file %s"
msgstr "eroare de intrare(input) în timpul citirii fiºierului schelet %s"
-#: main.c:508
+#: main.c:487
#, c-format
msgid "error closing skeleton file %s"
msgstr "eroare în închiderea fiºierului schelet %s"
-#: main.c:693
+#: main.c:671
#, c-format
msgid "error creating header file %s"
msgstr "eroare în crearea fiºierului de header %s"
-#: main.c:701
+#: main.c:679
#, c-format
msgid "error writing output file %s"
msgstr "eroare în scrierea fiºierului de output %s"
-#: main.c:705
+#: main.c:683
#, c-format
msgid "error closing output file %s"
msgstr "eroare în închiderea fiºierului de output %s"
-#: main.c:709
+#: main.c:687
#, c-format
msgid "error deleting output file %s"
msgstr "eroare în ºtergerea fiºierului de output %s"
-#: main.c:716
-#, c-format
+#: main.c:694
msgid "No backing up.\n"
msgstr "Nu se revine (backing-up).\n"
-#: main.c:720
+#: main.c:698
#, c-format
msgid "%d backing up (non-accepting) states.\n"
msgstr "%d salvare de (inacceptabile) stãri.\n"
-#: main.c:724
-#, c-format
+#: main.c:702
msgid "Compressed tables always back up.\n"
msgstr "Tabelele compresate întotdeauna au back-up.\n"
-#: main.c:727
+#: main.c:705
#, c-format
msgid "error writing backup file %s"
msgstr "eroare în scrierea fiºierului de backup %s"
-#: main.c:731
+#: main.c:709
#, c-format
msgid "error closing backup file %s"
msgstr "eroare în închiderea fiºierului de backup %s"
-#: main.c:736
+#: main.c:714
#, c-format
msgid "%s version %s usage statistics:\n"
msgstr "%s versiunea %s statistici de folosire:\n"
-#: main.c:739
-#, c-format
+#: main.c:717
msgid " scanner options: -"
msgstr " opþiuni de scanner: -"
-#: main.c:818
+#: main.c:796
#, c-format
msgid " %d/%d NFA states\n"
msgstr " %d/%d stãri NFA\n"
-#: main.c:820
+#: main.c:798
#, c-format
msgid " %d/%d DFA states (%d words)\n"
msgstr " %d/%d stãri DFA (%d cuvinte)\n"
-#: main.c:822
+#: main.c:800
#, c-format
msgid " %d rules\n"
msgstr " %d reguli\n"
-#: main.c:827
-#, c-format
+#: main.c:805
msgid " No backing up\n"
msgstr " Nu se face backup\n"
-#: main.c:831
+#: main.c:809
#, c-format
msgid " %d backing-up (non-accepting) states\n"
msgstr " %d salvare de (inacceptabile) stãri\n"
-#: main.c:836
-#, c-format
+#: main.c:814
msgid " Compressed tables always back-up\n"
msgstr " Tabelele compresate întotdeauna au back-up\n"
-#: main.c:840
-#, c-format
+#: main.c:818
msgid " Beginning-of-line patterns used\n"
msgstr " Tipare de începuturi de linie folosite\n"
-#: main.c:842
+#: main.c:820
#, c-format
msgid " %d/%d start conditions\n"
msgstr " %d/%d condiþii de start\n"
-#: main.c:846
+#: main.c:824
#, c-format
msgid " %d epsilon states, %d double epsilon states\n"
msgstr " %d stãri epsilon, %d stãri dublu epsilon\n"
-#: main.c:850
-#, c-format
+#: main.c:828
msgid " no character classes\n"
msgstr " nici o clasã de caractere\n"
-#: main.c:854
+#: main.c:832
#, c-format
msgid " %d/%d character classes needed %d/%d words of storage, %d reused\n"
-msgstr ""
-" %d/%d clase de caractere necesare %d/%d cuvinte de stocare, %d refolosite\n"
+msgstr " %d/%d clase de caractere necesare %d/%d cuvinte de stocare, %d refolosite\n"
-#: main.c:859
+#: main.c:837
#, c-format
msgid " %d state/nextstate pairs created\n"
msgstr " %d perechi de stare/stareurmãtoare create\n"
-#: main.c:862
+#: main.c:840
#, c-format
msgid " %d/%d unique/duplicate transitions\n"
msgstr " %d/%d tranziþii unice/duplicate\n"
-#: main.c:867
+#: main.c:845
#, c-format
msgid " %d table entries\n"
msgstr " %d intrãri în tabele\n"
-#: main.c:875
+#: main.c:853
#, c-format
msgid " %d/%d base-def entries created\n"
msgstr " %d/%d base-def intrãri create\n"
-#: main.c:879
+#: main.c:857
#, c-format
msgid " %d/%d (peak %d) nxt-chk entries created\n"
msgstr " %d/%d (maxim %d) nxt-chk intrãri create\n"
-#: main.c:883
+#: main.c:861
#, c-format
msgid " %d/%d (peak %d) template nxt-chk entries created\n"
msgstr " %d/%d (maxim %d) model nxt-chk intrãri create\n"
-#: main.c:887
+#: main.c:865
#, c-format
msgid " %d empty table entries\n"
msgstr " %d intrãri în tabel goale\n"
-#: main.c:889
+#: main.c:867
#, c-format
msgid " %d protos created\n"
msgstr " %d prototipuri create\n"
-#: main.c:892
+#: main.c:870
#, c-format
msgid " %d templates created, %d uses\n"
msgstr " %d modele create, %d folosiri\n"
-#: main.c:900
+#: main.c:878
#, c-format
msgid " %d/%d equivalence classes created\n"
msgstr " %d/%d clase de echivalenþã create\n"
-#: main.c:908
+#: main.c:886
#, c-format
msgid " %d/%d meta-equivalence classes created\n"
msgstr " %d/%d clase de meta-echivalenþã create\n"
-#: main.c:914
+#: main.c:892
#, c-format
msgid " %d (%d saved) hash collisions, %d DFAs equal\n"
msgstr " %d (%d salvate) coliziuni disipate(hash), %d egaluri de DFA-uril\n"
-#: main.c:916
+#: main.c:894
#, c-format
msgid " %d sets of reallocations needed\n"
msgstr " %d seturi de realocãri necesare\n"
-#: main.c:918
+#: main.c:896
#, c-format
msgid " %d total table entries needed\n"
msgstr " %d intrãri totale în tabel necesare\n"
-#: main.c:995
-#, c-format
+#: main.c:971
msgid "Internal error. flexopts are malformed.\n"
msgstr "Eroare internã. Opþiunile flex(flexopts) sunt malformate.\n"
-#: main.c:1005
+#: main.c:981
#, c-format
msgid "Try `%s --help' for more information.\n"
msgstr "Încercaþi `%s --help' pentru mai multe informaþii.\n"
-#: main.c:1062
+#: main.c:1038
#, c-format
msgid "unknown -C option '%c'"
msgstr "opþiune -C necunoscutã `%c'"
-#: main.c:1191
+#: main.c:1167
#, c-format
msgid "%s %s\n"
msgstr "%s %s\n"
-#: main.c:1466
+#: main.c:1442
msgid "fatal parse error"
msgstr "eroare fatalã de analizã(parse)"
-#: main.c:1498
+#: main.c:1474
#, c-format
msgid "could not create backing-up info file %s"
msgstr "nu s-a putut crea fiºierul de informaþii de back-up %s"
-#: main.c:1519
-#, c-format
+#: main.c:1495
msgid "-l AT&T lex compatibility option entails a large performance penalty\n"
-msgstr ""
-"-l opþiunea de compatibilitate AT&T lex determinã o scãdere drasticã a "
-"performanþei\n"
+msgstr "-l opþiunea de compatibilitate AT&T lex determinã o scãdere drasticã a performanþei\n"
-#: main.c:1522
-#, c-format
+#: main.c:1498
msgid " and may be the actual source of other reported performance penalties\n"
msgstr "ºi poate fi sursa realã a altor scãderi de performanþã raportate\n"
-#: main.c:1528
+#: main.c:1504
#, c-format
-msgid ""
-"%%option yylineno entails a performance penalty ONLY on rules that can match "
-"newline characters\n"
-msgstr ""
-"%%opþiunea yylineno determinã o scãdere drasticã a performanþei DOAR în "
-"regulile care se potrivesc caracterelor linie_nouã(newline)\n"
+msgid "%%option yylineno entails a performance penalty ONLY on rules that can match newline characters\n"
+msgstr "%%opþiunea yylineno determinã o scãdere drasticã a performanþei DOAR în regulile care se potrivesc caracterelor linie_nouã(newline)\n"
-#: main.c:1535
-#, c-format
+#: main.c:1511
msgid "-I (interactive) entails a minor performance penalty\n"
msgstr "-I (interactiãe) determinã o scãdere minorã a performanþei\n"
-#: main.c:1540
-#, c-format
+#: main.c:1516
msgid "yymore() entails a minor performance penalty\n"
msgstr "yymore() determinã o scãdere minorã a performanþei\n"
-#: main.c:1546
-#, c-format
+#: main.c:1522
msgid "REJECT entails a large performance penalty\n"
msgstr "REJECT determinã o scãdere drasticã a performanþei\n"
-#: main.c:1551
-#, c-format
+#: main.c:1527
msgid "Variable trailing context rules entail a large performance penalty\n"
-msgstr ""
-"Contextul de sfârºit(trailing) variabil determinã o scãdere drasticã a "
-"performanþei\n"
+msgstr "Contextul de sfârºit(trailing) variabil determinã o scãdere drasticã a performanþei\n"
-#: main.c:1563
+#: main.c:1539
msgid "REJECT cannot be used with -f or -F"
msgstr "REJECT nu poate fi folosit cu -f sau -F"
-#: main.c:1566
+#: main.c:1542
#, c-format
msgid "%option yylineno cannot be used with REJECT"
msgstr "%opþiunea yylineno nu poate fi folositã cu REJECT"
-#: main.c:1569
+#: main.c:1545
msgid "variable trailing context rules cannot be used with -f or -F"
-msgstr ""
-"contextul de sfârºit(trailing) variabil nu poate fi folosit cu -f sau -F"
+msgstr "contextul de sfârºit(trailing) variabil nu poate fi folosit cu -f sau -F"
-#: main.c:1692
+#: main.c:1661
#, c-format
msgid "%option yyclass only meaningful for C++ scanners"
msgstr "%opþunea yyclass este folositoare doar pentru scannerele C++"
-#: main.c:1799
+#: main.c:1768
#, c-format
msgid "Usage: %s [OPTIONS] [FILE]...\n"
msgstr "Folosire: %s [OPÞIUNI] [FIªIER]...\n"
-#: main.c:1802
+#: main.c:1771
#, c-format
msgid ""
"Generates programs that perform pattern-matching on text.\n"
@@ -560,8 +530,7 @@ msgid ""
" -S, --skel=FILE specify skeleton file\n"
" -t, --stdout write scanner on stdout instead of %s\n"
" --yyclass=NAME name of C++ class\n"
-" --header-file=FILE create a C header file in addition to the "
-"scanner\n"
+" --header-file=FILE create a C header file in addition to the scanner\n"
" --tables-file[=FILE] write tables to FILE\n"
"\n"
"Scanner behavior:\n"
@@ -598,16 +567,13 @@ msgstr ""
"Genereazã programe care cautã potriviri de tipare pe un text\n"
"\n"
"Compresie de tabele:\n"
-" -Ca, --align renunþã la tabelele mari în favoarea unui aliniament mai "
-"bun al memoriei\n"
+" -Ca, --align renunþã la tabelele mari în favoarea unui aliniament mai bun al memoriei\n"
" -Ce, --ecs construieºte clase de echivalenþã\n"
" -Cf nu compreseazã tabelele; foloseºte reprezentare -f \n"
" -CF nu compreseazã tabelele; foloseºte reprezentare -F\n"
" -Cm, --meta-ecs construieºte clase de meta-echivalenþã\n"
-" -Cr, --read foloseºte read() în loc de stdio pentru intrarea de "
-"scanner\n"
-" -F, --fast foloseºte reprezentare alternativã de tabele. Asemãnãtor "
-"lui -CFr\n"
+" -Cr, --read foloseºte read() în loc de stdio pentru intrarea de scanner\n"
+" -F, --fast foloseºte reprezentare alternativã de tabele. Asemãnãtor lui -CFr\n"
" -f, --full genereazã scannere rapide, mari. Asemãnãtor lui -Cfr\n"
" -Cem compresie implicitã (asemãnãtor lui --ecs --meta-ecs)\n"
"\n"
@@ -615,12 +581,10 @@ msgstr ""
" -d, --debug activeazã modul debug în scanner\n"
" -b, --backup scriere de informaþii de backup în %s\n"
" -p, --perf-report scrie raportul de performanþã la stderr\n"
-" -s, --nodefault eliminã regula implicitã de ECHO text care nu se "
-"potriveºte\n"
+" -s, --nodefault eliminã regula implicitã de ECHO text care nu se potriveºte\n"
" -T, --trace %s ar trebui sã ruleze în mod trace\n"
" -w, --nowarn nu genereazã avertismente\n"
-" -v, --verbose scrie cuprinsul statisticilor scanner-ului la "
-"stdout\n"
+" -v, --verbose scrie cuprinsul statisticilor scanner-ului la stdout\n"
"\n"
"Fiºiere:\n"
" -o, --outfile=FIªIER specificã numele de fiºier de ieºire\n"
@@ -633,8 +597,7 @@ msgstr ""
"Comportament scanner:\n"
" -7, --7bit genereazã scanner pe 7-biþi\n"
" -8, --8bit genereazã scanner pe 8-biþi\n"
-" -B, --batch genereazã scanner comandã(batch) (inversul lui -"
-"I)\n"
+" -B, --batch genereazã scanner comandã(batch) (inversul lui -I)\n"
" -i, --case-insensitive ignorã cazul în tipare\n"
" -l, --lex-compat compatibilitate maximã cu lex original\n"
" -X, --posix-compat compatibilitate maximã cu lex POSIX\n"
@@ -662,47 +625,43 @@ msgstr ""
" -h, --help produce acest mesaj de ajutor\n"
" -V, --version raporteazã versiunea %s\n"
-#: misc.c:65
-msgid "allocation of sko_stack failed"
-msgstr ""
-
-#: misc.c:102 misc.c:128
+#: misc.c:100 misc.c:126
#, c-format
msgid "name \"%s\" ridiculously long"
msgstr "numele \"%s\" este ridicol de lung"
-#: misc.c:177
+#: misc.c:175
msgid "memory allocation failed in allocate_array()"
msgstr "alocare de memorie eºuatã în allocate_array()"
-#: misc.c:230
+#: misc.c:250
#, c-format
msgid "bad character '%s' detected in check_char()"
msgstr "caracter greºit `%s' detectat în check_char()"
-#: misc.c:235
+#: misc.c:255
#, c-format
msgid "scanner requires -8 flag to use the character %s"
msgstr "scannerul necesitã parametrul(flag) -8 pentru a folosi caracterul %s"
-#: misc.c:268
+#: misc.c:288
msgid "dynamic memory failure in copy_string()"
msgstr "eroare de memorie dinamicã în copy_string()"
-#: misc.c:367
+#: misc.c:422
#, c-format
msgid "%s: fatal internal error, %s\n"
msgstr "%s: eroare internã fatalã, %s\n"
-#: misc.c:803
+#: misc.c:875
msgid "attempt to increase array size failed"
msgstr "încercare de a mãri dimensiunea domeniului eºuatã"
-#: misc.c:930
+#: misc.c:1002
msgid "bad line in skeleton file"
msgstr "linie greºitã în fiºierul schelet"
-#: misc.c:979
+#: misc.c:1051
msgid "memory allocation failed in yy_flex_xmalloc()"
msgstr "alocare de memorie eºuatã în yy_flex_xmalloc()"
@@ -723,7 +682,6 @@ msgid "state # %4d\t"
msgstr "stare # %4d\t"
#: nfa.c:130
-#, c-format
msgid "********** end of dump\n"
msgstr "********** sfârºit de aducere(dump)\n"
@@ -736,161 +694,125 @@ msgstr "maºinã vidã în dupmachine()"
msgid "Variable trailing context rule at line %d\n"
msgstr "Regulã de context de sfârºit variabil la linia %d\n"
-#: nfa.c:364
+#: nfa.c:353
msgid "bad state type in mark_beginning_as_normal()"
msgstr "tip de stare greºitã în mark_beginning_as_normal()"
-#: nfa.c:609
+#: nfa.c:598
#, c-format
msgid "input rules are too complicated (>= %d NFA states)"
msgstr "regulile de intrare(input) sunt prea complicate (>= %d stãri NFA)"
-#: nfa.c:688
+#: nfa.c:677
msgid "found too many transitions in mkxtion()"
msgstr "s-au gãsit prea multe tranziþii în mkxtion()"
-#: nfa.c:714
+#: nfa.c:703
#, c-format
msgid "too many rules (> %d)!"
msgstr "prea multe reguli (> %d)!"
-#: parse.y:159
+#: parse.y:183
msgid "unknown error processing section 1"
msgstr "eroare necunoscutã în procesarea secþiunii 1"
-#: parse.y:184 parse.y:351
+#: parse.y:208 parse.y:373
msgid "bad start condition list"
msgstr "listã de stãri în condiþie proastã"
-#: parse.y:315
+#: parse.y:337
msgid "unrecognized rule"
msgstr "regulã necunoscutã"
-#: parse.y:434 parse.y:447 parse.y:516
+#: parse.y:456 parse.y:469 parse.y:538
msgid "trailing context used twice"
msgstr "context de sfârºit(trailing) utilizat de douã ori"
-#: parse.y:552 parse.y:562 parse.y:635 parse.y:645
+#: parse.y:574 parse.y:584 parse.y:657 parse.y:667
msgid "bad iteration values"
msgstr "valori de iteraþie greºite"
-#: parse.y:580 parse.y:598 parse.y:663 parse.y:681
+#: parse.y:602 parse.y:620 parse.y:685 parse.y:703
msgid "iteration value must be positive"
msgstr "valoarea iteraþiei trebuie sã fie pozitivã"
-#: parse.y:804 parse.y:814
+#: parse.y:817 parse.y:827
#, c-format
msgid "the character range [%c-%c] is ambiguous in a case-insensitive scanner"
-msgstr ""
-"intervalul(range) de caracter [%c %c] este ambiguu într-un scanner caz-"
-"insenzitiv"
+msgstr "intervalul(range) de caracter [%c %c] este ambiguu într-un scanner caz-insenzitiv"
-#: parse.y:819
+#: parse.y:832
msgid "negative range in character class"
msgstr "domeniu negativ în clasa de caractere"
-#: parse.y:916
-#, fuzzy
-msgid "[:^lower:] is ambiguous in case insensitive scanner"
-msgstr ""
-"intervalul(range) de caracter [%c %c] este ambiguu într-un scanner caz-"
-"insenzitiv"
-
-#: parse.y:922
-#, fuzzy
-msgid "[:^upper:] ambiguous in case insensitive scanner"
-msgstr ""
-"intervalul(range) de caracter [%c %c] este ambiguu într-un scanner caz-"
-"insenzitiv"
-
-#: scan.l:75 scan.l:618 scan.l:676
+#: scan.l:70 scan.l:180 scan.l:267 scan.l:409 scan.l:548 scan.l:598
msgid "Input line too long\n"
msgstr "Linie de intrare(input) prea lungã\n"
-#: scan.l:161
+#: scan.l:149
#, c-format
msgid "malformed '%top' directive"
msgstr "directivã '%top' malformatã"
-#: scan.l:183
+#: scan.l:171
#, no-c-format
msgid "unrecognized '%' directive"
msgstr "directivã '%' necunoscutã"
-#: scan.l:192
-#, fuzzy
-msgid "Definition name too long\n"
-msgstr "Linie de intrare(input) prea lungã\n"
-
-#: scan.l:284
+#: scan.l:251
msgid "Unmatched '{'"
msgstr "'{' fãrã corespondent"
-#: scan.l:300
-#, c-format
-msgid "Definition value for {%s} too long\n"
-msgstr ""
-
-#: scan.l:317
+#: scan.l:284
msgid "incomplete name definition"
msgstr "definire de nume incompletã"
-#: scan.l:443
-#, fuzzy
-msgid "Option line too long\n"
-msgstr "Linie de intrare(input) prea lungã\n"
-
-#: scan.l:451
+#: scan.l:417
#, c-format
msgid "unrecognized %%option: %s"
msgstr "%%opþiune necunoscutã: %s"
-#: scan.l:633 scan.l:800
+#: scan.l:558 scan.l:677
msgid "bad character class"
msgstr "clasã de caractere greºitã"
-#: scan.l:683
+#: scan.l:605
#, c-format
msgid "undefined definition {%s}"
msgstr "definiþie nedefinitã {%s}"
-#: scan.l:755
+#: scan.l:645
#, c-format
msgid "bad <start condition>: %s"
msgstr "<condiþie de start> greºitã: %s"
-#: scan.l:768
+#: scan.l:658
msgid "missing quote"
msgstr "menþionare(quote) lipsã"
-#: scan.l:834
+#: scan.l:698
#, c-format
msgid "bad character class expression: %s"
msgstr "expresie clasã caracter greºitã: %s"
-#: scan.l:856
+#: scan.l:720
msgid "bad character inside {}'s"
msgstr "caracter eronat între {}"
-#: scan.l:862
+#: scan.l:726
msgid "missing }"
msgstr "lipseºte }"
-#: scan.l:940
+#: scan.l:799
msgid "EOF encountered inside an action"
msgstr "EOF întâlnit în mijlocul acþiunii"
-#: scan.l:945
-#, fuzzy
-msgid "EOF encountered inside pattern"
-msgstr "EOF întâlnit în mijlocul acþiunii"
-
-#: scan.l:967
+#: scan.l:819
#, c-format
msgid "bad character: %s"
msgstr "caracter eronat: %s"
-#: scan.l:996
+#: scan.l:848
#, c-format
msgid "can't open %s"
msgstr "nu pot deschide %s"
@@ -900,27 +822,27 @@ msgstr "nu pot deschide %s"
msgid "Usage: %s [OPTIONS]...\n"
msgstr "Folosire: %s [OPÞIUNI]...\n"
-#: scanopt.c:564
+#: scanopt.c:565
#, c-format
msgid "option `%s' doesn't allow an argument\n"
msgstr "opþiunea `%s' nu permite parametri\n"
-#: scanopt.c:569
+#: scanopt.c:570
#, c-format
msgid "option `%s' requires an argument\n"
msgstr "opþiunea `%s' necesitã un parametru\n"
-#: scanopt.c:573
+#: scanopt.c:574
#, c-format
msgid "option `%s' is ambiguous\n"
msgstr "opþiunea `%s' este ambiguã\n"
-#: scanopt.c:577
+#: scanopt.c:578
#, c-format
msgid "Unrecognized option `%s'\n"
msgstr "Opþiune necunoscutã `%s'\n"
-#: scanopt.c:581
+#: scanopt.c:582
#, c-format
msgid "Unknown error=(%d)\n"
msgstr "Eroare necunoscutã=(%d)\n"
@@ -929,11 +851,11 @@ msgstr "Eroare necunoscutã=(%d)\n"
msgid "symbol table memory allocation failed"
msgstr "alocare de memorie pentru tabela de simboluri eºuatã"
-#: sym.c:202
+#: sym.c:203
msgid "name defined twice"
msgstr "nume definit de douã ori"
-#: sym.c:253
+#: sym.c:254
#, c-format
msgid "start condition %s declared twice"
msgstr "condiþie de start %s definitã de douã ori"
@@ -943,7 +865,6 @@ msgid "premature EOF"
msgstr "EOF prematur"
#: yylex.c:198
-#, c-format
msgid "End Marker\n"
msgstr "Marcaj de sfârºit\n"
@@ -952,9 +873,6 @@ msgstr "Marcaj de sfârºit\n"
msgid "*Something Weird* - tok: %d val: %d\n"
msgstr "*Ceva Ciudat* - tok: %d val: %d\n"
-#~ msgid "consistency check failed in symfollowset"
-#~ msgstr "verificare de consistenþã eºuatã în symfollowset"
-
#~ msgid "Can't specify header option if writing to stdout."
#~ msgstr "Nu se poate specifica opþiunea de header dacã se scrie la stdout"
diff --git a/po/ru.po b/po/ru.po
index 3a7bc27..8b91432 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -1,14 +1,29 @@
-# Russian translation for flex.
-# Copyright (C) 2013 The Flex Project (msgids)
-# This file is distributed under the same license as the flex package.
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR Free Software Foundation, Inc.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
-# Dmitry S. Sivachenko <dima@Chg.RU>, 1999, 2000, 2001, 2002.
-# Yuri Kozlov <yuray@komyakino.ru>, 2014.
+#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: flex 2.5.38\n"
-"Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2014-03-26 15:00-0400\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"PO-Revision-Date: 2016-01-22 13:24-0800\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#~ # Russian translation for flex.
+#~ # Copyright (C) 2013 The Flex Project (msgids)
+#~ # This file is distributed under the same license as the flex package.
+#~ #
+#~ # Dmitry S. Sivachenko <dima@Chg.RU>, 1999, 2000, 2001, 2002.
+#~ # Yuri Kozlov <yuray@komyakino.ru>, 2014.
+#~ msgid ""
+#~ msgstr ""
+#~ "Project-Id-Version: flex 2.5.38\n"
+#~ "Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n"
+"POT-Creation-Date: 2014-02-11 16:15-0500\n"
"PO-Revision-Date: 2014-02-16 10:00+0400\n"
"Last-Translator: Yuri Kozlov <yuray@komyakino.ru>\n"
"Language-Team: Russian <gnu@mx.ru>\n"
@@ -16,8 +31,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8-bit\n"
-"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
-"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: Lokalize 1.4\n"
#: buf.c:78
@@ -366,9 +380,7 @@ msgstr " отÑутÑтвуют клаÑÑÑ‹ Ñимволов\n"
#: main.c:854
#, c-format
msgid " %d/%d character classes needed %d/%d words of storage, %d reused\n"
-msgstr ""
-" %d/%d клаÑÑов Ñимволов требуют %d/%d Ñлов Ð´Ð»Ñ Ñ…Ñ€Ð°Ð½ÐµÐ½Ð¸Ñ, %d повторно "
-"иÑпользовано\n"
+msgstr " %d/%d клаÑÑов Ñимволов требуют %d/%d Ñлов Ð´Ð»Ñ Ñ…Ñ€Ð°Ð½ÐµÐ½Ð¸Ñ, %d повторно иÑпользовано\n"
#: main.c:859
#, c-format
@@ -472,24 +484,17 @@ msgstr "невозможно Ñоздать резервную копию инф
#: main.c:1519
#, c-format
msgid "-l AT&T lex compatibility option entails a large performance penalty\n"
-msgstr ""
-"Параметр -l ÑовмеÑтимоÑти Ñ AT&T lex влечёт значительное Ñнижение "
-"производительноÑти\n"
+msgstr "Параметр -l ÑовмеÑтимоÑти Ñ AT&T lex влечёт значительное Ñнижение производительноÑти\n"
#: main.c:1522
#, c-format
msgid " and may be the actual source of other reported performance penalties\n"
-msgstr ""
-" и также может быть иÑтинным иÑточником проблем Ñ Ð¿Ñ€Ð¾Ð¸Ð·Ð²Ð¾Ð´Ð¸Ñ‚ÐµÐ»ÑŒÐ½Ð¾Ñтью\n"
+msgstr " и также может быть иÑтинным иÑточником проблем Ñ Ð¿Ñ€Ð¾Ð¸Ð·Ð²Ð¾Ð´Ð¸Ñ‚ÐµÐ»ÑŒÐ½Ð¾Ñтью\n"
#: main.c:1528
#, c-format
-msgid ""
-"%%option yylineno entails a performance penalty ONLY on rules that can match "
-"newline characters\n"
-msgstr ""
-"%%option yylineno влечёт значительное Ñнижение производительноÑти ТОЛЬКО Ð´Ð»Ñ "
-"правил, которые могут Ñовпадать Ñ Ñимволами новой Ñтроки\n"
+msgid "%%option yylineno entails a performance penalty ONLY on rules that can match newline characters\n"
+msgstr "%%option yylineno влечёт значительное Ñнижение производительноÑти ТОЛЬКО Ð´Ð»Ñ Ð¿Ñ€Ð°Ð²Ð¸Ð», которые могут Ñовпадать Ñ Ñимволами новой Ñтроки\n"
#: main.c:1535
#, c-format
@@ -509,9 +514,7 @@ msgstr "REJECT влечёт значительное Ñнижение произ
#: main.c:1551
#, c-format
msgid "Variable trailing context rules entail a large performance penalty\n"
-msgstr ""
-"Правила Ñ Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ñ‹Ð¼ замыкающим контекÑтом приводÑÑ‚ к значительному Ñнижению "
-"производительноÑти\n"
+msgstr "Правила Ñ Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ñ‹Ð¼ замыкающим контекÑтом приводÑÑ‚ к значительному Ñнижению производительноÑти\n"
#: main.c:1563
msgid "REJECT cannot be used with -f or -F"
@@ -524,9 +527,7 @@ msgstr "%option yylineno не может быть иÑпользован Ñ REJE
#: main.c:1569
msgid "variable trailing context rules cannot be used with -f or -F"
-msgstr ""
-"правила Ñ Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ñ‹Ð¼ замыкающим контекÑтом не могут быть иÑпользованы Ñ -f "
-"или -F"
+msgstr "правила Ñ Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ñ‹Ð¼ замыкающим контекÑтом не могут быть иÑпользованы Ñ -f или -F"
#: main.c:1692
#, c-format
@@ -568,8 +569,7 @@ msgid ""
" -S, --skel=FILE specify skeleton file\n"
" -t, --stdout write scanner on stdout instead of %s\n"
" --yyclass=NAME name of C++ class\n"
-" --header-file=FILE create a C header file in addition to the "
-"scanner\n"
+" --header-file=FILE create a C header file in addition to the scanner\n"
" --tables-file[=FILE] write tables to FILE\n"
"\n"
"Scanner behavior:\n"
@@ -791,9 +791,7 @@ msgstr "значение итераций должно быть положите
#: parse.y:804 parse.y:814
#, c-format
msgid "the character range [%c-%c] is ambiguous in a case-insensitive scanner"
-msgstr ""
-"иÑпользование Ñимвольного диапазона [%c-%c] Ñомнительно в Ñканере, не "
-"чувÑтвительном к региÑтру"
+msgstr "иÑпользование Ñимвольного диапазона [%c-%c] Ñомнительно в Ñканере, не чувÑтвительном к региÑтру"
#: parse.y:819
msgid "negative range in character class"
@@ -801,15 +799,11 @@ msgstr "отрицательный диапазон в клаÑÑе Ñимвол
#: parse.y:916
msgid "[:^lower:] is ambiguous in case insensitive scanner"
-msgstr ""
-"иÑпользование [:^lower:] Ñомнительно Ð´Ð»Ñ Ñканера, не чувÑтвительного к "
-"региÑтру"
+msgstr "иÑпользование [:^lower:] Ñомнительно Ð´Ð»Ñ Ñканера, не чувÑтвительного к региÑтру"
#: parse.y:922
msgid "[:^upper:] ambiguous in case insensitive scanner"
-msgstr ""
-"иÑпользование [:^upper:] Ñомнительно Ð´Ð»Ñ Ñканера, не чувÑтвительного к "
-"региÑтру"
+msgstr "иÑпользование [:^upper:] Ñомнительно Ð´Ð»Ñ Ñканера, не чувÑтвительного к региÑтру"
#: scan.l:75 scan.l:618 scan.l:676
msgid "Input line too long\n"
diff --git a/po/sr.po b/po/sr.po
index 5919865..60a31c8 100644
--- a/po/sr.po
+++ b/po/sr.po
@@ -1,12 +1,27 @@
-# Serbian translation for flex
-# Copyright (C) 2013 The Flex Project (msgids)
-# This file is distributed under the same license as the flex package.
-# МироÑлав Ðиколић <miroslavnikolic@rocketmail.com>, 2013.
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR Free Software Foundation, Inc.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: flex-2.5.37\n"
-"Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2014-03-26 15:00-0400\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"PO-Revision-Date: 2016-01-22 13:24-0800\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#~ # Serbian translation for flex
+#~ # Copyright (C) 2013 The Flex Project (msgids)
+#~ # This file is distributed under the same license as the flex package.
+#~ # МироÑлав Ðиколић <miroslavnikolic@rocketmail.com>, 2013.
+#~ msgid ""
+#~ msgstr ""
+#~ "Project-Id-Version: flex-2.5.37\n"
+#~ "Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n"
+"POT-Creation-Date: 2012-07-22 20:48-0400\n"
"PO-Revision-Date: 2013-10-30 18:20+0200\n"
"Last-Translator: МироÑлав Ðиколић <miroslavnikolic@rocketmail.com>\n"
"Language-Team: Serbian <(nothing)>\n"
@@ -14,8 +29,7 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
-"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
#: buf.c:78
msgid "Allocation of buffer to print string failed"
@@ -174,362 +188,355 @@ msgstr "Ðе могу да запишем „eoltbl“"
msgid "Could not write yynultrans_tbl"
msgstr "Ðе могу да запишем „yynultrans_tbl“"
-#: main.c:191
+#: main.c:189
msgid "rule cannot be matched"
msgstr "правило не може бити поклопљено"
-#: main.c:196
+#: main.c:194
msgid "-s option given but default rule can be matched"
msgstr "дата је опција „-s“ али оÑновно правило може бити поклопљено"
-#: main.c:236
+#: main.c:234
msgid "Can't use -+ with -l option"
msgstr "Ðе могу да кориÑтим -+ Ñа опцијом „-l“"
-#: main.c:239
+#: main.c:237
msgid "Can't use -f or -F with -l option"
msgstr "Ðе могу да кориÑтим „-f“ или „-F“ Ñа опцијом „-l“"
-#: main.c:243
+#: main.c:241
msgid "Can't use --reentrant or --bison-bridge with -l option"
msgstr "Ðе могу да кориÑтим „--reentrant“ или „--bison-bridge“ Ñа опцијом „-l“"
-#: main.c:275
+#: main.c:278
msgid "-Cf/-CF and -Cm don't make sense together"
msgstr "„-Cf/-CF“ и „-Cm“ немају ÑмиÑла заједно"
-#: main.c:278
+#: main.c:281
msgid "-Cf/-CF and -I are incompatible"
msgstr "„-Cf/-CF“ и „-I“ Ñу неÑаглаÑне"
-#: main.c:282
+#: main.c:285
msgid "-Cf/-CF are incompatible with lex-compatibility mode"
msgstr "„-Cf/-CF“ Ñу неÑаглаÑни Ñа режимом лекÑ-ÑаглаÑноÑти"
-#: main.c:287
+#: main.c:290
msgid "-Cf and -CF are mutually exclusive"
msgstr "„-Cf“ и „-CF“ Ñе међуÑобно иÑкључују"
-#: main.c:291
+#: main.c:294
msgid "Can't use -+ with -CF option"
msgstr "Ðе могу да кориÑтим -+ Ñа опцијом „-CF“"
-#: main.c:294
+#: main.c:297
#, c-format
msgid "%array incompatible with -+ option"
msgstr "%aниз није ÑаглаÑан Ñа опцијом -+"
-#: main.c:299
+#: main.c:302
msgid "Options -+ and --reentrant are mutually exclusive."
msgstr "Опције -+ и „--reentrant“ Ñе међуÑобно иÑкључују."
-#: main.c:302
+#: main.c:305
msgid "bison bridge not supported for the C++ scanner."
msgstr "бизонов моÑÑ‚ није подржан за Ц++ Ñкенер."
-#: main.c:357 main.c:403
+#: main.c:360 main.c:406
#, c-format
msgid "could not create %s"
msgstr "не могу да направим %s"
-#: main.c:416
+#: main.c:419
msgid "could not write tables header"
msgstr "не могу да запшем беÑтаблично заглавље"
-#: main.c:420
+#: main.c:423
#, c-format
msgid "can't open skeleton file %s"
msgstr "Ðе могу да отворим датотеку окоÑнице „%s“"
-#: main.c:456
+#: main.c:459
msgid "allocation of macro definition failed"
msgstr "није уÑпело додељивање одреднице макроа"
-#: main.c:504
+#: main.c:507
#, c-format
msgid "input error reading skeleton file %s"
msgstr "грешка улаза читања датотеке окоÑнице „%s“"
-#: main.c:508
+#: main.c:511
#, c-format
msgid "error closing skeleton file %s"
msgstr "грешка затварања датотеке окоÑнице „%s“"
-#: main.c:693
+#: main.c:696
#, c-format
msgid "error creating header file %s"
msgstr "грешка Ñтварања датотеке заглавља „%s“"
-#: main.c:701
+#: main.c:704
#, c-format
msgid "error writing output file %s"
msgstr "грешка запиÑивања излазне датотеке „%s“"
-#: main.c:705
+#: main.c:708
#, c-format
msgid "error closing output file %s"
msgstr "грешка затварања излазне датотеке „%s“"
-#: main.c:709
+#: main.c:712
#, c-format
msgid "error deleting output file %s"
msgstr "грешка бриÑања излазне датотеке „%s“"
-#: main.c:716
+#: main.c:719
#, c-format
msgid "No backing up.\n"
msgstr "Ðе правим резерву.\n"
-#: main.c:720
+#: main.c:723
#, c-format
msgid "%d backing up (non-accepting) states.\n"
msgstr "%d Ñтварам резерве (не-прихватам) Ñтања.\n"
-#: main.c:724
+#: main.c:727
#, c-format
msgid "Compressed tables always back up.\n"
msgstr "Сжете табеле увек Ñтварају резерву.\n"
-#: main.c:727
+#: main.c:730
#, c-format
msgid "error writing backup file %s"
msgstr "грешка запиÑивања датотеке резерве „%s“"
-#: main.c:731
+#: main.c:734
#, c-format
msgid "error closing backup file %s"
msgstr "грешка затварања датотеке резерве „%s“"
-#: main.c:736
+#: main.c:739
#, c-format
msgid "%s version %s usage statistics:\n"
msgstr "СтатиÑтика коришћења %s издања%s:\n"
-#: main.c:739
+#: main.c:742
#, c-format
msgid " scanner options: -"
msgstr " опције прегледача: -"
-#: main.c:818
+#: main.c:821
#, c-format
msgid " %d/%d NFA states\n"
msgstr " %d/%d ÐФРÑтања\n"
-#: main.c:820
+#: main.c:823
#, c-format
msgid " %d/%d DFA states (%d words)\n"
msgstr " %d/%d ДФРÑтања (%d речи)\n"
-#: main.c:822
+#: main.c:825
#, c-format
msgid " %d rules\n"
msgstr " %d правила\n"
-#: main.c:827
+#: main.c:830
#, c-format
msgid " No backing up\n"
msgstr " Ðе правим резерву\n"
-#: main.c:831
+#: main.c:834
#, c-format
msgid " %d backing-up (non-accepting) states\n"
msgstr " %d Ñтварам резерве (не-прихватам) Ñтања\n"
-#: main.c:836
+#: main.c:839
#, c-format
msgid " Compressed tables always back-up\n"
msgstr " Сжете табеле увек Ñтварају резерву\n"
-#: main.c:840
+#: main.c:843
#, c-format
msgid " Beginning-of-line patterns used\n"
msgstr " Коришћени Ñу шаблони почетка-реда\n"
-#: main.c:842
+#: main.c:845
#, c-format
msgid " %d/%d start conditions\n"
msgstr " %d/%d уÑлови покретања\n"
-#: main.c:846
+#: main.c:849
#, c-format
msgid " %d epsilon states, %d double epsilon states\n"
msgstr " %d Ñтања ипÑилона, %d Ñтања двоÑтруког ипÑилона\n"
-#: main.c:850
+#: main.c:853
#, c-format
msgid " no character classes\n"
msgstr " нема разреда знака\n"
-#: main.c:854
+#: main.c:857
#, c-format
msgid " %d/%d character classes needed %d/%d words of storage, %d reused\n"
-msgstr ""
-" %d/%d разредима знака беху потребне %d/%d речи Ñкладишта, %d поново "
-"коришћених\n"
+msgstr " %d/%d разредима знака беху потребне %d/%d речи Ñкладишта, %d поново коришћених\n"
-#: main.c:859
+#: main.c:862
#, c-format
msgid " %d state/nextstate pairs created\n"
msgstr " %d пара Ñтања/Ñледећег_Ñтања је направљено\n"
-#: main.c:862
+#: main.c:865
#, c-format
msgid " %d/%d unique/duplicate transitions\n"
msgstr " %d/%d јединÑтвена/удвоÑтручена прелаза\n"
-#: main.c:867
+#: main.c:870
#, c-format
msgid " %d table entries\n"
msgstr " %d уноÑа табеле\n"
-#: main.c:875
+#: main.c:878
#, c-format
msgid " %d/%d base-def entries created\n"
msgstr " направљено је %d/%d уноÑа оÑновне одреднице\n"
-#: main.c:879
+#: main.c:882
#, c-format
msgid " %d/%d (peak %d) nxt-chk entries created\n"
msgstr " направљено је %d/%d (врх %d) „nxt-chk“ уноÑа\n"
-#: main.c:883
+#: main.c:886
#, c-format
msgid " %d/%d (peak %d) template nxt-chk entries created\n"
msgstr " направљено је %d/%d (врх %d)шаблона „nxt-chk“ уноÑа\n"
-#: main.c:887
+#: main.c:890
#, c-format
msgid " %d empty table entries\n"
msgstr " %d празна уноÑа табеле\n"
-#: main.c:889
+#: main.c:892
#, c-format
msgid " %d protos created\n"
msgstr " направљених узорака — %d\n"
-#: main.c:892
+#: main.c:895
#, c-format
msgid " %d templates created, %d uses\n"
msgstr " направљених шаблона - %d, кориÑтим %d\n"
-#: main.c:900
+#: main.c:903
#, c-format
msgid " %d/%d equivalence classes created\n"
msgstr " направљено је %d/%d разреда једнакоÑти\n"
-#: main.c:908
+#: main.c:911
#, c-format
msgid " %d/%d meta-equivalence classes created\n"
msgstr " направљено је %d/%d разреда мета-једнакоÑти\n"
-#: main.c:914
+#: main.c:917
#, c-format
msgid " %d (%d saved) hash collisions, %d DFAs equal\n"
msgstr " %d (Ñачуваних %d) Ñукоба хеша, %d једнак ДФÐ-Ñу\n"
-#: main.c:916
+#: main.c:919
#, c-format
msgid " %d sets of reallocations needed\n"
msgstr " потребна Ñу %d Ñкупа поновног додељивања\n"
-#: main.c:918
+#: main.c:921
#, c-format
msgid " %d total table entries needed\n"
msgstr " потребна Ñу укупно %d уноÑа табеле\n"
-#: main.c:995
+#: main.c:998
#, c-format
msgid "Internal error. flexopts are malformed.\n"
msgstr "Унутрашња грешка. „flexopts“ је лоше обликован.\n"
-#: main.c:1005
+#: main.c:1008
#, c-format
msgid "Try `%s --help' for more information.\n"
msgstr "Пробајте „%s --help“ за више података.\n"
-#: main.c:1062
+#: main.c:1065
#, c-format
msgid "unknown -C option '%c'"
msgstr "непозната опција -C „%c“"
-#: main.c:1191
+#: main.c:1194
#, c-format
msgid "%s %s\n"
msgstr "%s %s\n"
-#: main.c:1466
+#: main.c:1469
msgid "fatal parse error"
msgstr "кобна грешка обраде"
-#: main.c:1498
+#: main.c:1501
#, c-format
msgid "could not create backing-up info file %s"
msgstr "не могу да направим резерву датотеке података „%s“"
-#: main.c:1519
+#: main.c:1522
#, c-format
msgid "-l AT&T lex compatibility option entails a large performance penalty\n"
msgstr "-l опција ÑаглаÑноÑти ÐТ&Т лекÑа изазива велико Ñмањење учинка\n"
-#: main.c:1522
+#: main.c:1525
#, c-format
msgid " and may be the actual source of other reported performance penalties\n"
msgstr " и може бити Ñтваран извор других извешених ограничења учинка\n"
-#: main.c:1528
+#: main.c:1531
#, c-format
-msgid ""
-"%%option yylineno entails a performance penalty ONLY on rules that can match "
-"newline characters\n"
-msgstr ""
-"%%опција „yylineno“ изазива Ñмањење учинка СÐМО на правилима која могу да "
-"поклопе знакове новог реда\n"
+msgid "%%option yylineno entails a performance penalty ONLY on rules that can match newline characters\n"
+msgstr "%%опција „yylineno“ изазива Ñмањење учинка СÐМО на правилима која могу да поклопе знакове новог реда\n"
-#: main.c:1535
+#: main.c:1538
#, c-format
msgid "-I (interactive) entails a minor performance penalty\n"
msgstr "-I (међудејÑтвено) изазива мање Ñмањење учинка\n"
-#: main.c:1540
+#: main.c:1543
#, c-format
msgid "yymore() entails a minor performance penalty\n"
msgstr "„yymore()“ изазива мање Ñмањење учинка\n"
-#: main.c:1546
+#: main.c:1549
#, c-format
msgid "REJECT entails a large performance penalty\n"
msgstr "„REJECT“ изазива веће Ñмањење учинка\n"
-#: main.c:1551
+#: main.c:1554
#, c-format
msgid "Variable trailing context rules entail a large performance penalty\n"
msgstr "Променљива правила пратећег контекÑа изазивају веће Ñмањење учинка\n"
-#: main.c:1563
+#: main.c:1566
msgid "REJECT cannot be used with -f or -F"
msgstr "„REJECT“ не може да Ñе кориÑти Ñа „-f“ или „-F“"
-#: main.c:1566
+#: main.c:1569
#, c-format
msgid "%option yylineno cannot be used with REJECT"
msgstr "%oпција „yylineno“ не може да Ñе кориÑти Ñа „REJECT“"
-#: main.c:1569
+#: main.c:1572
msgid "variable trailing context rules cannot be used with -f or -F"
-msgstr ""
-"променљива правила пратећег контекÑта не могу бити коришћена Ñа „-f“ или „-F“"
+msgstr "променљива правила пратећег контекÑта не могу бити коришћена Ñа „-f“ или „-F“"
-#: main.c:1692
+#: main.c:1695
#, c-format
msgid "%option yyclass only meaningful for C++ scanners"
msgstr "%oпција „yyclass“ има ÑмиÑла Ñамо за Ц++ Ñкенере"
-#: main.c:1799
+#: main.c:1802
#, c-format
msgid "Usage: %s [OPTIONS] [FILE]...\n"
msgstr "Употреба: %s [ОПЦИЈЕ] [ДÐТОТЕКÐ]...\n"
-#: main.c:1802
+#: main.c:1805
#, c-format
msgid ""
"Generates programs that perform pattern-matching on text.\n"
@@ -559,8 +566,7 @@ msgid ""
" -S, --skel=FILE specify skeleton file\n"
" -t, --stdout write scanner on stdout instead of %s\n"
" --yyclass=NAME name of C++ class\n"
-" --header-file=FILE create a C header file in addition to the "
-"scanner\n"
+" --header-file=FILE create a C header file in addition to the scanner\n"
" --tables-file[=FILE] write tables to FILE\n"
"\n"
"Scanner behavior:\n"
@@ -597,41 +603,31 @@ msgstr ""
"Стварајте програме који обављају поклапање према шаблону у текÑту.\n"
"\n"
"Сабијање табеле:\n"
-" -Ca, --align обрађује веће табеле зарад бољег поравнања "
-"меморије\n"
+" -Ca, --align обрађује веће табеле зарад бољег поравнања меморије\n"
" -Ce, --ecs изграђује разреде једнакоÑти\n"
-" -Cf не Ñажима табеле; кориÑти „-f“ "
-"representation†предÑтављање\n"
-" -CF не Ñажима табеле; кориÑти „-F“ "
-"representation†предÑтављање\n"
+" -Cf не Ñажима табеле; кориÑти „-f“ representation†предÑтављање\n"
+" -CF не Ñажима табеле; кориÑти „-F“ representation†предÑтављање\n"
" -Cm, --meta-ecs изграђује разреде мета-једнакоÑти\n"
-" -Cr, --read кориÑти „read()умеÑто Ñтндардног уи за улаз "
-"Ñкенера\n"
+" -Cr, --read кориÑти „read()умеÑто Ñтндардног уи за улаз Ñкенера\n"
" -f, --full Ñтвара брзи, велики Ñкенер. ИÑто као „-Cfr“\n"
-" -F, --fast кориÑти заменÑко предÑтављање табеле. ИÑто "
-"као „-CFr“\n"
-" -Cem задато Ñажимање (иÑто као „--ecs --meta-"
-"ecs“)\n"
+" -F, --fast кориÑти заменÑко предÑтављање табеле. ИÑто као „-CFr“\n"
+" -Cem задато Ñажимање (иÑто као „--ecs --meta-ecs“)\n"
"\n"
"Прочишћавање:\n"
" -d, --debug укључује режим прочишћавања у Ñкенеру\n"
" -b, --backup запиÑује податке о Ñтварању резерве у „%s“\n"
" -p, --perf-report запиÑује извештај о учинку Ñтандардну грешку\n"
-" -s, --nodefault потиÑкује задато правило у „ECHO“ "
-"непоклопљени текÑÑ‚\n"
+" -s, --nodefault потиÑкује задато правило у „ECHO“ непоклопљени текÑÑ‚\n"
" -T, --trace %s треба да ради у режиму праћења\n"
" -w, --nowarn не Ñтвара упозорења\n"
-" -v, --verbose запиÑује Ñажетак ÑтатиÑтике Ñкенера на "
-"Ñтандардни излаз\n"
+" -v, --verbose запиÑује Ñажетак ÑтатиÑтике Ñкенера на Ñтандардни излаз\n"
"\n"
"Датотеке:\n"
" -o, --outfile=ДÐТОТЕКРнаводи излазни назив датотеке\n"
" -S, --skel=ДÐТОТЕКРнаводи датотеку окоÑнице\n"
-" -t, --stdout запиÑује Ñкенер на Ñтандардни излазумеÑто на "
-"„%s“\n"
+" -t, --stdout запиÑује Ñкенер на Ñтандардни излазумеÑто на „%s“\n"
" --yyclass=ÐÐЗИВ назив Ц++ разреда\n"
-" --header-file=ДÐТОТЕКРÑтвара датотеку Ц заглавља као додатак "
-"Ñкенеру\n"
+" --header-file=ДÐТОТЕКРÑтвара датотеку Ц заглавља као додатак Ñкенеру\n"
" --tables-file[=ДÐТОТЕКÐ] запиÑује табеле у ДÐТОТЕКУ\n"
"\n"
"Понашање Ñкенера:\n"
@@ -641,8 +637,7 @@ msgstr ""
" -i, --case-insensitive занемарује величину Ñлова у шаблонима\n"
" -l, --lex-compat највећа ÑаглаÑноÑÑ‚ Ñа изворним лекÑом\n"
" -X, --posix-compat највећа ÑаглаÑноÑÑ‚ Ñа лекÑом ПОСИКС-а\n"
-" -I, --interactive Ñтвара међудејÑтвени Ñкенер (Ñупротно од „-"
-"B“)\n"
+" -I, --interactive Ñтвара међудејÑтвени Ñкенер (Ñупротно од „-B“)\n"
" --yylineno прати број реда у „yylineno“\n"
"\n"
"Створени код:\n"
@@ -740,20 +735,20 @@ msgstr "празна машина у „dupmachine()“"
msgid "Variable trailing context rule at line %d\n"
msgstr "Променљиво правило пратећег контекÑта на %d. реду\n"
-#: nfa.c:364
+#: nfa.c:353
msgid "bad state type in mark_beginning_as_normal()"
msgstr "лоша врÑта Ñтања у „mark_beginning_as_normal()“"
-#: nfa.c:609
+#: nfa.c:598
#, c-format
msgid "input rules are too complicated (>= %d NFA states)"
msgstr "улазна правила Ñу превише Ñложена (>= %d ÐФРÑтања)"
-#: nfa.c:688
+#: nfa.c:677
msgid "found too many transitions in mkxtion()"
msgstr "пронађох превише прелаза у „mkxtion()“"
-#: nfa.c:714
+#: nfa.c:703
#, c-format
msgid "too many rules (> %d)!"
msgstr "превише правила (> %d)!"
diff --git a/po/sv.po b/po/sv.po
index 401c53d..5cccf42 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -1,37 +1,34 @@
-# Swedish messages for flex.
-# Copyright (C) 2003 The Flex Project
-# Johan Linde <jl@theophys.kth.se>, 1996.
-# Christian Rose <menthos@menthos.com>, 2002, 2004.
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR Free Software Foundation, Inc.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
+#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: flex 2.5.31\n"
-"Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2014-03-26 15:00-0400\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"PO-Revision-Date: 2016-01-22 13:25-0800\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#~ # Swedish messages for flex.
+#~ # Copyright (C) 2003 The Flex Project
+#~ # Johan Linde <jl@theophys.kth.se>, 1996.
+#~ # Christian Rose <menthos@menthos.com>, 2002, 2004.
+#~ #
+#~ msgid ""
+#~ msgstr ""
+#~ "Project-Id-Version: flex 2.5.31\n"
+"POT-Creation-Date: 2003-04-01 11:33-0500\n"
"PO-Revision-Date: 2004-03-21 22:51+0100\n"
"Last-Translator: Christian Rose <menthos@menthos.com>\n"
"Language-Team: Swedish <sv@li.org>\n"
-"Language: sv\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
-#: buf.c:78
-msgid "Allocation of buffer to print string failed"
-msgstr ""
-
-#: buf.c:100
-msgid "Allocation of buffer for line directive failed"
-msgstr ""
-
-#: buf.c:177
-msgid "Allocation of buffer for m4 def failed"
-msgstr ""
-
-#: buf.c:197
-msgid "Allocation of buffer for m4 undef failed"
-msgstr ""
-
#: dfa.c:61
#, c-format
msgid "State #%d is non-accepting -\n"
@@ -42,17 +39,14 @@ msgid "dangerous trailing context"
msgstr "farligt efterföljande sammanhang"
#: dfa.c:166
-#, c-format
msgid " associated rule line numbers:"
msgstr " radnummer för associerad regel:"
#: dfa.c:202
-#, c-format
msgid " out-transitions: "
msgstr " utövergångar: "
#: dfa.c:210
-#, c-format
msgid ""
"\n"
" jam-transitions: EOF "
@@ -87,15 +81,19 @@ msgstr "tillstånd %d:\n"
# Det här är ju helt sjukt. Har buggrapporterat detta att det bör
# ersättas med %s
-#: dfa.c:785
+#: dfa.c:800
msgid "Could not write yynxt_tbl[][]"
msgstr "Kunde inte skriva yynxt_tbl[][]"
-#: dfa.c:1049
+#: dfa.c:1023
+msgid "consistency check failed in symfollowset"
+msgstr "konsekvenskontrollen misslyckades i symfollowset"
+
+#: dfa.c:1071
msgid "bad transition character detected in sympartition()"
msgstr "otillåtet övergångstecken funnet i sympartition()"
-#: gen.c:478
+#: gen.c:484
msgid ""
"\n"
"\n"
@@ -107,29 +105,29 @@ msgstr ""
"Ekvivalensklasser:\n"
"\n"
-#: gen.c:662 gen.c:691 gen.c:1215
+#: gen.c:668 gen.c:697 gen.c:1221
#, c-format
msgid "state # %d accepts: [%d]\n"
msgstr "tillstånd %d accepterar: [%d]\n"
-#: gen.c:1110
+#: gen.c:1116
#, c-format
msgid "state # %d accepts: "
msgstr "tillstånd %d accepterar: "
-#: gen.c:1157
+#: gen.c:1163
msgid "Could not write yyacclist_tbl"
msgstr "Kunde inte skriva yyacclist_tbl"
-#: gen.c:1233
+#: gen.c:1239
msgid "Could not write yyacc_tbl"
msgstr "Kunde inte skriva yyacc_tbl"
-#: gen.c:1248 gen.c:1633 gen.c:1656
+#: gen.c:1254 gen.c:1639 gen.c:1662
msgid "Could not write ecstbl"
msgstr "Kunde inte skriva ecstbl"
-#: gen.c:1271
+#: gen.c:1277
msgid ""
"\n"
"\n"
@@ -139,402 +137,376 @@ msgstr ""
"\n"
"Metaekvivalensklasser:\n"
-#: gen.c:1293
+#: gen.c:1299
msgid "Could not write yymeta_tbl"
msgstr "Kunde inte skriva yymeta_tbl"
-#: gen.c:1354
+#: gen.c:1360
msgid "Could not write yybase_tbl"
msgstr "Kunde inte skriva yybase_tbl"
-#: gen.c:1388
+#: gen.c:1394
msgid "Could not write yydef_tbl"
msgstr "Kunde inte skriva yydef_tbl"
-#: gen.c:1428
+#: gen.c:1434
msgid "Could not write yynxt_tbl"
msgstr "Kunde inte skriva yynxt_tbl"
-#: gen.c:1464
+#: gen.c:1470
msgid "Could not write yychk_tbl"
msgstr "Kunde inte skriva yychk_tbl"
-#: gen.c:1618 gen.c:1647
+#: gen.c:1624 gen.c:1653
msgid "Could not write ftbl"
msgstr "Kunde inte skriva ftbl"
-#: gen.c:1624
+#: gen.c:1630
msgid "Could not write ssltbl"
msgstr "Kunde inte skriva ssltbl"
-#: gen.c:1675
+#: gen.c:1681
msgid "Could not write eoltbl"
msgstr "Kunde inte skriva eoltbl"
-#: gen.c:1735
+#: gen.c:1741
msgid "Could not write yynultrans_tbl"
msgstr "Kunde inte skriva yynultrans_tbl"
-#: main.c:191
+#: main.c:176
msgid "rule cannot be matched"
msgstr "regeln kan inte matchas"
-#: main.c:196
+#: main.c:181
msgid "-s option given but default rule can be matched"
msgstr "flaggan -s angiven men standardregeln kan följas"
-#: main.c:236
+#: main.c:217
msgid "Can't use -+ with -l option"
msgstr "-+ kan inte användas tillsammans med flaggan -l"
-#: main.c:239
+#: main.c:220
msgid "Can't use -f or -F with -l option"
msgstr "-f eller -F kan inte användas tillsammans med flaggan -l"
-#: main.c:243
+#: main.c:224
msgid "Can't use --reentrant or --bison-bridge with -l option"
-msgstr ""
-"--reentrant eller --bison-bridge kan inte användas tillsammans med flaggan -l"
+msgstr "--reentrant eller --bison-bridge kan inte användas tillsammans med flaggan -l"
-#: main.c:275
+#: main.c:261
msgid "-Cf/-CF and -Cm don't make sense together"
msgstr "-Cf/-CF och -Cm kan inte användas tillsammans"
-#: main.c:278
+#: main.c:264
msgid "-Cf/-CF and -I are incompatible"
msgstr "-Cf/-CF och -I kan inte användas tillsammans"
-#: main.c:282
+#: main.c:268
msgid "-Cf/-CF are incompatible with lex-compatibility mode"
msgstr "-Cf/-CF kan inte användas i lex-kompatibilitetsläge"
-#: main.c:287
+#: main.c:273
msgid "-Cf and -CF are mutually exclusive"
msgstr "-Cf och -CF är ömsesidigt uteslutande"
-#: main.c:291
+#: main.c:277
msgid "Can't use -+ with -CF option"
msgstr "-+ kan inte användas tillsammans med flaggan -CF"
-#: main.c:294
+#: main.c:280
#, c-format
msgid "%array incompatible with -+ option"
msgstr "%array kan inte användas tillsammans med flaggan -+"
-#: main.c:299
+#: main.c:285
msgid "Options -+ and --reentrant are mutually exclusive."
msgstr "Flaggorna -+ och --reentrant är ömsesidigt uteslutande."
-#: main.c:302
+#: main.c:288
msgid "bison bridge not supported for the C++ scanner."
msgstr "bisonbrygga stöds inte för C++-inläsaren."
-#: main.c:357 main.c:403
+#: main.c:340 main.c:385
#, c-format
msgid "could not create %s"
msgstr "kunde inte skapa %s"
-#: main.c:416
+#: main.c:398
msgid "could not write tables header"
msgstr "kunde inte skriva tabellhuvud"
-#: main.c:420
+#: main.c:402
#, c-format
msgid "can't open skeleton file %s"
msgstr "kan inte öppna mallfilen %s"
-#: main.c:456
-msgid "allocation of macro definition failed"
-msgstr ""
-
-#: main.c:504
+#: main.c:483
#, c-format
msgid "input error reading skeleton file %s"
msgstr "indatafel vid läsande av mallfilen %s"
-#: main.c:508
+#: main.c:487
#, c-format
msgid "error closing skeleton file %s"
msgstr "fel vid stängande av mallfilen %s"
-#: main.c:693
+#: main.c:671
#, c-format
msgid "error creating header file %s"
msgstr "fel vid skapande av huvudfilen %s"
-#: main.c:701
+#: main.c:679
#, c-format
msgid "error writing output file %s"
msgstr "fel vid skrivande av utfilen %s"
-#: main.c:705
+#: main.c:683
#, c-format
msgid "error closing output file %s"
msgstr "fel vid stängande av utfilen %s"
-#: main.c:709
+#: main.c:687
#, c-format
msgid "error deleting output file %s"
msgstr "fel vid borttagning av utfilen %s"
# "Back up" i det här sammanhanget handlar om att flexmaskinen backar.
-#: main.c:716
-#, c-format
+#: main.c:694
msgid "No backing up.\n"
msgstr "Backar inte.\n"
-#: main.c:720
+#: main.c:698
#, c-format
msgid "%d backing up (non-accepting) states.\n"
msgstr "%d säkerhetskopierande (icke-accepterande) tillstånd.\n"
-#: main.c:724
-#, c-format
+#: main.c:702
msgid "Compressed tables always back up.\n"
msgstr "Komprimerade tabeller säkerhetskopierar alltid.\n"
-#: main.c:727
+#: main.c:705
#, c-format
msgid "error writing backup file %s"
msgstr "fel när säkerhetskopian %s skulle skrivas"
-#: main.c:731
+#: main.c:709
#, c-format
msgid "error closing backup file %s"
msgstr "fel när säkerhetskopian %s skulle stängas"
-#: main.c:736
+#: main.c:714
#, c-format
msgid "%s version %s usage statistics:\n"
msgstr "Statistik över användning av %s version %s:\n"
-#: main.c:739
-#, c-format
+#: main.c:717
msgid " scanner options: -"
msgstr " inläsarflaggor: -"
-#: main.c:818
+#: main.c:796
#, c-format
msgid " %d/%d NFA states\n"
msgstr " %d/%d NFA-tillstånd\n"
-#: main.c:820
+#: main.c:798
#, c-format
msgid " %d/%d DFA states (%d words)\n"
msgstr " %d/%d DFA-tillstånd (%d ord)\n"
-#: main.c:822
+#: main.c:800
#, c-format
msgid " %d rules\n"
msgstr " %d regler\n"
-#: main.c:827
-#, c-format
+#: main.c:805
msgid " No backing up\n"
msgstr " Inget säkerhetskopierande\n"
-#: main.c:831
+#: main.c:809
#, c-format
msgid " %d backing-up (non-accepting) states\n"
msgstr " %d (icke-accepterande) tillstånd för säkerhetskopiering\n"
-#: main.c:836
-#, c-format
+#: main.c:814
msgid " Compressed tables always back-up\n"
msgstr " Komprimerade tabeller säkerhetskopierar alltid\n"
-#: main.c:840
-#, c-format
+#: main.c:818
msgid " Beginning-of-line patterns used\n"
msgstr " Början-av-rad-mönster använda\n"
-#: main.c:842
+#: main.c:820
#, c-format
msgid " %d/%d start conditions\n"
msgstr " %d/%d startvillkor\n"
-#: main.c:846
+#: main.c:824
#, c-format
msgid " %d epsilon states, %d double epsilon states\n"
msgstr " %d epsilontillstånd, %d dubbla epsilontillstånd\n"
-#: main.c:850
-#, c-format
+#: main.c:828
msgid " no character classes\n"
msgstr " inga teckenklasser\n"
-#: main.c:854
+#: main.c:832
#, c-format
msgid " %d/%d character classes needed %d/%d words of storage, %d reused\n"
msgstr " %d/%d teckenklasser behövde %d/%d ord för lagring, %d återanvända\n"
-#: main.c:859
+#: main.c:837
#, c-format
msgid " %d state/nextstate pairs created\n"
msgstr " %d par med tillstånd/nästa-tillstånd skapade\n"
-#: main.c:862
+#: main.c:840
#, c-format
msgid " %d/%d unique/duplicate transitions\n"
msgstr " %d/%d unika/duplicerade övergångar\n"
-#: main.c:867
+#: main.c:845
#, c-format
msgid " %d table entries\n"
msgstr " %d tabellposter\n"
-#: main.c:875
+#: main.c:853
#, c-format
msgid " %d/%d base-def entries created\n"
msgstr " %d/%d basstandardposter skapade\n"
-#: main.c:879
+#: main.c:857
#, c-format
msgid " %d/%d (peak %d) nxt-chk entries created\n"
msgstr " %d/%d (max %d) poster för nästa kontroll skapade\n"
-#: main.c:883
+#: main.c:861
#, c-format
msgid " %d/%d (peak %d) template nxt-chk entries created\n"
msgstr " %d/%d (max %d) mallposter för nästa kontroll skapade\n"
-#: main.c:887
+#: main.c:865
#, c-format
msgid " %d empty table entries\n"
msgstr " %d tomma tabellposter\n"
-#: main.c:889
+#: main.c:867
#, c-format
msgid " %d protos created\n"
msgstr " %d prototyper skapade\n"
-#: main.c:892
+#: main.c:870
#, c-format
msgid " %d templates created, %d uses\n"
msgstr " %d mallar skapade, %d användningar\n"
-#: main.c:900
+#: main.c:878
#, c-format
msgid " %d/%d equivalence classes created\n"
msgstr " %d/%d ekvivalensklasser skapade\n"
-#: main.c:908
+#: main.c:886
#, c-format
msgid " %d/%d meta-equivalence classes created\n"
msgstr " %d/%d metaekvivalensklasser skapade\n"
-#: main.c:914
+#: main.c:892
#, c-format
msgid " %d (%d saved) hash collisions, %d DFAs equal\n"
msgstr " %d (%d sparade) hashkollisioner, %d DFA lika\n"
-#: main.c:916
+#: main.c:894
#, c-format
msgid " %d sets of reallocations needed\n"
msgstr " %d uppsättningar med omallokeringar krävdes\n"
-#: main.c:918
+#: main.c:896
#, c-format
msgid " %d total table entries needed\n"
msgstr " %d tabellposter krävs totalt\n"
-#: main.c:995
-#, c-format
+#: main.c:971
msgid "Internal error. flexopts are malformed.\n"
msgstr "Internt fel. flexopts är felaktiga.\n"
-#: main.c:1005
+#: main.c:981
#, c-format
msgid "Try `%s --help' for more information.\n"
msgstr "Prova \"%s --help\" för mer information.\n"
-#: main.c:1062
+#: main.c:1038
#, c-format
msgid "unknown -C option '%c'"
msgstr "okänd flagga till -C \"%c\""
-#: main.c:1191
+#: main.c:1167
#, c-format
msgid "%s %s\n"
msgstr "%s %s\n"
-#: main.c:1466
+#: main.c:1442
msgid "fatal parse error"
msgstr "allvarligt fel vid tolkningen"
-#: main.c:1498
+#: main.c:1474
#, c-format
msgid "could not create backing-up info file %s"
msgstr "kunde inte skapa filen %s med säkerhetskopieringsinformation"
-#: main.c:1519
-#, c-format
+#: main.c:1495
msgid "-l AT&T lex compatibility option entails a large performance penalty\n"
-msgstr ""
-"flaggan -l för beteende som AT&T:s lex medför en väsentlig prestandaförlust\n"
+msgstr "flaggan -l för beteende som AT&T:s lex medför en väsentlig prestandaförlust\n"
-#: main.c:1522
-#, c-format
+#: main.c:1498
msgid " and may be the actual source of other reported performance penalties\n"
msgstr " och kan vara den egentliga orsaken till andra rapporter om detta\n"
-#: main.c:1528
+#: main.c:1504
#, c-format
-msgid ""
-"%%option yylineno entails a performance penalty ONLY on rules that can match "
-"newline characters\n"
-msgstr ""
-"%%option yylineno medför en prestandaförlust ENDAST på regler som kan matcha "
-"nyradstecken\n"
+msgid "%%option yylineno entails a performance penalty ONLY on rules that can match newline characters\n"
+msgstr "%%option yylineno medför en prestandaförlust ENDAST på regler som kan matcha nyradstecken\n"
-#: main.c:1535
-#, c-format
+#: main.c:1511
msgid "-I (interactive) entails a minor performance penalty\n"
msgstr "-I (interaktiv) medför en mindre prestandaförlust\n"
-#: main.c:1540
-#, c-format
+#: main.c:1516
msgid "yymore() entails a minor performance penalty\n"
msgstr "yymore() medför en mindre prestandaförlust\n"
-#: main.c:1546
-#, c-format
+#: main.c:1522
msgid "REJECT entails a large performance penalty\n"
msgstr "REJECT medför en väsentlig prestandaförlust\n"
-#: main.c:1551
-#, c-format
+#: main.c:1527
msgid "Variable trailing context rules entail a large performance penalty\n"
-msgstr ""
-"Regler för varierbar efterföljande sammanhang medför en väsentlig "
-"prestandaförlust\n"
+msgstr "Regler för varierbar efterföljande sammanhang medför en väsentlig prestandaförlust\n"
-#: main.c:1563
+#: main.c:1539
msgid "REJECT cannot be used with -f or -F"
msgstr "REJECT kan inte användas tillsammans med -f eller -F"
-#: main.c:1566
+#: main.c:1542
#, c-format
msgid "%option yylineno cannot be used with REJECT"
msgstr "%option yylineno kan inte användas tillsammans med REJECT"
-#: main.c:1569
+#: main.c:1545
msgid "variable trailing context rules cannot be used with -f or -F"
msgstr ""
"regler för varierbar efterföljande kontext kan inte användas\n"
"tillsammans med -f eller -F"
-#: main.c:1692
+#: main.c:1661
#, c-format
msgid "%option yyclass only meaningful for C++ scanners"
msgstr "%option yyclass är bara meningsfull för C++-inläsare"
-#: main.c:1799
+#: main.c:1768
#, c-format
msgid "Usage: %s [OPTIONS] [FILE]...\n"
msgstr "Användning: %s [FLAGGOR] [FIL]...\n"
-#: main.c:1802
+#: main.c:1771
#, c-format
msgid ""
"Generates programs that perform pattern-matching on text.\n"
@@ -564,8 +536,7 @@ msgid ""
" -S, --skel=FILE specify skeleton file\n"
" -t, --stdout write scanner on stdout instead of %s\n"
" --yyclass=NAME name of C++ class\n"
-" --header-file=FILE create a C header file in addition to the "
-"scanner\n"
+" --header-file=FILE create a C header file in addition to the scanner\n"
" --tables-file[=FILE] write tables to FILE\n"
"\n"
"Scanner behavior:\n"
@@ -662,47 +633,43 @@ msgstr ""
" -h, --help visa detta hjälpmeddelande\n"
" -V, --version visa versionsinformation för %s\n"
-#: misc.c:65
-msgid "allocation of sko_stack failed"
-msgstr ""
-
-#: misc.c:102 misc.c:128
+#: misc.c:100 misc.c:126
#, c-format
msgid "name \"%s\" ridiculously long"
msgstr "namnet \"%s\" är löjligt långt"
-#: misc.c:177
+#: misc.c:175
msgid "memory allocation failed in allocate_array()"
msgstr "minnesallokeringen misslyckades i allocate_array()"
-#: misc.c:230
+#: misc.c:250
#, c-format
msgid "bad character '%s' detected in check_char()"
msgstr "otillåtet tecken \"%s\" funnet i check_char()"
-#: misc.c:235
+#: misc.c:255
#, c-format
msgid "scanner requires -8 flag to use the character %s"
msgstr "inläsaren kräver flaggan -8 för att kunna använda tecknet %s"
-#: misc.c:268
+#: misc.c:288
msgid "dynamic memory failure in copy_string()"
msgstr "dynamiskt minnesfel i copy_string()"
-#: misc.c:367
+#: misc.c:422
#, c-format
msgid "%s: fatal internal error, %s\n"
msgstr "%s: allvarligt internt fel, %s\n"
-#: misc.c:803
+#: misc.c:875
msgid "attempt to increase array size failed"
msgstr "försök att öka arraystorlek misslyckades"
-#: misc.c:930
+#: misc.c:1002
msgid "bad line in skeleton file"
msgstr "otillåten rad i mallfilen"
-#: misc.c:979
+#: misc.c:1051
msgid "memory allocation failed in yy_flex_xmalloc()"
msgstr "minnesallokeringen misslyckades i yy_flex_xmalloc()"
@@ -723,7 +690,6 @@ msgid "state # %4d\t"
msgstr "tillstånd %4d\t"
#: nfa.c:130
-#, c-format
msgid "********** end of dump\n"
msgstr "********** slut på utskrift\n"
@@ -736,158 +702,125 @@ msgstr "tom maskin i dupmachine()"
msgid "Variable trailing context rule at line %d\n"
msgstr "Regel för varierbar efterföljande kontext på rad %d\n"
-#: nfa.c:364
+#: nfa.c:353
msgid "bad state type in mark_beginning_as_normal()"
msgstr "otillåten tillståndstyp i mark_beginning_as_normal()"
-#: nfa.c:609
+#: nfa.c:598
#, c-format
msgid "input rules are too complicated (>= %d NFA states)"
msgstr "indatareglerna är för komplicerade (>= %d NFA-tillstånd)"
-#: nfa.c:688
+#: nfa.c:677
msgid "found too many transitions in mkxtion()"
msgstr "fann för många övergångar i mkxtion()"
-#: nfa.c:714
+#: nfa.c:703
#, c-format
msgid "too many rules (> %d)!"
msgstr "för många regler (> %d)!"
-#: parse.y:159
+#: parse.y:183
msgid "unknown error processing section 1"
msgstr "okänt fel vid tolkning av avsnitt 1"
-#: parse.y:184 parse.y:351
+#: parse.y:208 parse.y:373
msgid "bad start condition list"
msgstr "felaktig lista med startvillkor"
-#: parse.y:315
+#: parse.y:337
msgid "unrecognized rule"
msgstr "okänd regel"
-#: parse.y:434 parse.y:447 parse.y:516
+#: parse.y:456 parse.y:469 parse.y:538
msgid "trailing context used twice"
msgstr "efterföljande kontext används två gånger"
-#: parse.y:552 parse.y:562 parse.y:635 parse.y:645
+#: parse.y:574 parse.y:584 parse.y:657 parse.y:667
msgid "bad iteration values"
msgstr "felaktiga iterationsvärden"
-#: parse.y:580 parse.y:598 parse.y:663 parse.y:681
+#: parse.y:602 parse.y:620 parse.y:685 parse.y:703
msgid "iteration value must be positive"
msgstr "iterationsvärde måste vara positivt"
-#: parse.y:804 parse.y:814
+#: parse.y:817 parse.y:827
#, c-format
msgid "the character range [%c-%c] is ambiguous in a case-insensitive scanner"
-msgstr ""
-"teckenintervallet [%c-%c] är tvetydigt i en skiftlägesokänslig inläsare"
+msgstr "teckenintervallet [%c-%c] är tvetydigt i en skiftlägesokänslig inläsare"
-#: parse.y:819
+#: parse.y:832
msgid "negative range in character class"
msgstr "negativt intervall i teckenklass"
-#: parse.y:916
-#, fuzzy
-msgid "[:^lower:] is ambiguous in case insensitive scanner"
-msgstr ""
-"teckenintervallet [%c-%c] är tvetydigt i en skiftlägesokänslig inläsare"
-
-#: parse.y:922
-#, fuzzy
-msgid "[:^upper:] ambiguous in case insensitive scanner"
-msgstr ""
-"teckenintervallet [%c-%c] är tvetydigt i en skiftlägesokänslig inläsare"
-
-#: scan.l:75 scan.l:618 scan.l:676
+#: scan.l:70 scan.l:180 scan.l:267 scan.l:409 scan.l:548 scan.l:598
msgid "Input line too long\n"
msgstr "För lång indatarad\n"
-#: scan.l:161
+#: scan.l:149
#, c-format
msgid "malformed '%top' directive"
msgstr "felaktigt \"%top\"-direktiv"
-#: scan.l:183
+#: scan.l:171
#, no-c-format
msgid "unrecognized '%' directive"
msgstr "okänt \"%\"-direktiv"
-#: scan.l:192
-#, fuzzy
-msgid "Definition name too long\n"
-msgstr "För lång indatarad\n"
-
-#: scan.l:284
+#: scan.l:251
msgid "Unmatched '{'"
msgstr "Ensamt \"{\""
-#: scan.l:300
-#, c-format
-msgid "Definition value for {%s} too long\n"
-msgstr ""
-
-#: scan.l:317
+#: scan.l:284
msgid "incomplete name definition"
msgstr "ofullständig namndefinition"
-#: scan.l:443
-#, fuzzy
-msgid "Option line too long\n"
-msgstr "För lång indatarad\n"
-
-#: scan.l:451
+#: scan.l:417
#, c-format
msgid "unrecognized %%option: %s"
msgstr "okänd %%option: %s"
-#: scan.l:633 scan.l:800
+#: scan.l:558 scan.l:677
msgid "bad character class"
msgstr "otillåten teckenklass"
-#: scan.l:683
+#: scan.l:605
#, c-format
msgid "undefined definition {%s}"
msgstr "odefinierad definition {%s}"
-#: scan.l:755
+#: scan.l:645
#, c-format
msgid "bad <start condition>: %s"
msgstr "otillåtet <startvillkor>: %s"
-#: scan.l:768
+#: scan.l:658
msgid "missing quote"
msgstr "citationstecken saknas"
-#: scan.l:834
+#: scan.l:698
#, c-format
msgid "bad character class expression: %s"
msgstr "otillåtet uttryck för teckenklass: %s"
-#: scan.l:856
+#: scan.l:720
msgid "bad character inside {}'s"
msgstr "otillåtet tecken inom {}"
-#: scan.l:862
+#: scan.l:726
msgid "missing }"
msgstr "} saknas"
-#: scan.l:940
+#: scan.l:799
msgid "EOF encountered inside an action"
msgstr "filslut påträffat inuti en handling"
-#: scan.l:945
-#, fuzzy
-msgid "EOF encountered inside pattern"
-msgstr "filslut påträffat inuti en handling"
-
-#: scan.l:967
+#: scan.l:819
#, c-format
msgid "bad character: %s"
msgstr "otillåtet tecken: %s"
-#: scan.l:996
+#: scan.l:848
#, c-format
msgid "can't open %s"
msgstr "kan inte öppna %s"
@@ -897,27 +830,27 @@ msgstr "kan inte öppna %s"
msgid "Usage: %s [OPTIONS]...\n"
msgstr "Användning: %s [FLAGGOR]...\n"
-#: scanopt.c:564
+#: scanopt.c:565
#, c-format
msgid "option `%s' doesn't allow an argument\n"
msgstr "flaggan \"%s\" tar inget argument\n"
-#: scanopt.c:569
+#: scanopt.c:570
#, c-format
msgid "option `%s' requires an argument\n"
msgstr "flaggan \"%s\" kräver ett argument\n"
-#: scanopt.c:573
+#: scanopt.c:574
#, c-format
msgid "option `%s' is ambiguous\n"
msgstr "flaggan \"%s\" är tvetydig\n"
-#: scanopt.c:577
+#: scanopt.c:578
#, c-format
msgid "Unrecognized option `%s'\n"
msgstr "Okänd flagga \"%s\"\n"
-#: scanopt.c:581
+#: scanopt.c:582
#, c-format
msgid "Unknown error=(%d)\n"
msgstr "Okänt fel=(%d)\n"
@@ -926,11 +859,11 @@ msgstr "Okänt fel=(%d)\n"
msgid "symbol table memory allocation failed"
msgstr "minnesallokering för symboltabell misslyckades"
-#: sym.c:202
+#: sym.c:203
msgid "name defined twice"
msgstr "namnet definierat två gånger"
-#: sym.c:253
+#: sym.c:254
#, c-format
msgid "start condition %s declared twice"
msgstr "startvillkoret %s deklarerat två gånger"
@@ -940,7 +873,6 @@ msgid "premature EOF"
msgstr "för tidigt filslut"
#: yylex.c:198
-#, c-format
msgid "End Marker\n"
msgstr "Slutmarkering\n"
@@ -949,9 +881,6 @@ msgstr "Slutmarkering\n"
msgid "*Something Weird* - tok: %d val: %d\n"
msgstr "*Något märkligt* - tecken: %d värde: %d\n"
-#~ msgid "consistency check failed in symfollowset"
-#~ msgstr "konsekvenskontrollen misslyckades i symfollowset"
-
#~ msgid "Can't specify header option if writing to stdout."
#~ msgstr "Kan inte ange huvudflagga då utskrift sker till standard ut."
@@ -984,10 +913,8 @@ msgstr "*Något märkligt* - tecken: %d värde: %d\n"
#~ msgid "-C flag must be given separately"
#~ msgstr "flaggan -C måste anges separat"
-#~ msgid ""
-#~ "%s [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -ooutput -Pprefix -Sskeleton]\n"
-#~ msgstr ""
-#~ "%s [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -outfil -Pprefix -Smallfil]\n"
+#~ msgid "%s [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -ooutput -Pprefix -Sskeleton]\n"
+#~ msgstr "%s [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -outfil -Pprefix -Smallfil]\n"
#~ msgid "\t[--help --version] [file ...]\n"
#~ msgstr "\t[--help --version] [fil ...]\n"
@@ -1020,12 +947,10 @@ msgstr "*Något märkligt* - tecken: %d värde: %d\n"
#~ msgstr "\t-p skicka rapport om utförandet till standard fel\n"
#~ msgid "\t-s suppress default rule to ECHO unmatched text\n"
-#~ msgstr ""
-#~ "\t-s undertryck standardregeln att skriva ut text som ej kunde matchas\n"
+#~ msgstr "\t-s undertryck standardregeln att skriva ut text som ej kunde matchas\n"
#~ msgid "\t-t write generated scanner on stdout instead of %s\n"
-#~ msgstr ""
-#~ "\t-t skriv den skapade inläsaren till standard ut i stället för %s\n"
+#~ msgstr "\t-t skriv den skapade inläsaren till standard ut i stället för %s\n"
#~ msgid "\t-v write summary of scanner statistics to f\n"
#~ msgstr "\t-v skriv en sammanställning av inläsarstatistik till f\n"
@@ -1067,27 +992,22 @@ msgstr "*Något märkligt* - tecken: %d värde: %d\n"
#~ msgstr "\t-C ange graden av tabellkompression (standard -Cem):\n"
#~ msgid "\t\t-Ca trade off larger tables for better memory alignment\n"
-#~ msgstr ""
-#~ "\t\t-Ca byt ut stora tabeller för att förbättra minneshanteringen\n"
+#~ msgstr "\t\t-Ca byt ut stora tabeller för att förbättra minneshanteringen\n"
#~ msgid "\t\t-Ce construct equivalence classes\n"
#~ msgstr "\t\t-Ce skapa ekvivalensklasser\n"
#~ msgid "\t\t-Cf do not compress scanner tables; use -f representation\n"
-#~ msgstr ""
-#~ "\t\t-Cf komprimera inte inläsartabellerna; använd representationen -f\n"
+#~ msgstr "\t\t-Cf komprimera inte inläsartabellerna; använd representationen -f\n"
#~ msgid "\t\t-CF do not compress scanner tables; use -F representation\n"
-#~ msgstr ""
-#~ "\t\t-CF komprimera inte inläsartabellerna; använd representationen -F\n"
+#~ msgstr "\t\t-CF komprimera inte inläsartabellerna; använd representationen -F\n"
#~ msgid "\t\t-Cm construct meta-equivalence classes\n"
#~ msgstr "\t\t-Cm skapa meta-ekvivalensklasser\n"
#~ msgid "\t\t-Cr use read() instead of stdio for scanner input\n"
-#~ msgstr ""
-#~ "\t\t-Cr använd read() i stället för standard in som indata till "
-#~ "inläsaren\n"
+#~ msgstr "\t\t-Cr använd read() i stället för standard in som indata till inläsaren\n"
#~ msgid "\t-o specify output filename\n"
#~ msgstr "\t-o ange namnet på utfilen\n"
diff --git a/po/tr.po b/po/tr.po
index 8d3cc8f..2979c51 100644
--- a/po/tr.po
+++ b/po/tr.po
@@ -1,37 +1,34 @@
-# Translation of 'flex' messages to Turkish
-# Copyright (C) 2004 The Flex Project
-# Deniz Akkus Kanca <deniz@arayan.com>, 2004.
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR Free Software Foundation, Inc.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
+#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: flex 2.5.31\n"
-"Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2014-03-26 15:00-0400\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"PO-Revision-Date: 2016-01-22 13:26-0800\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#~ # Translation of 'flex' messages to Turkish
+#~ # Copyright (C) 2004 The Flex Project
+#~ # Deniz Akkus Kanca <deniz@arayan.com>, 2004.
+#~ #
+#~ msgid ""
+#~ msgstr ""
+#~ "Project-Id-Version: flex 2.5.31\n"
+"POT-Creation-Date: 2003-04-01 11:33-0500\n"
"PO-Revision-Date: 2004-05-16 18:36+0300\n"
"Last-Translator: Deniz Akkus Kanca <deniz@arayan.com>\n"
"Language-Team: Turkish <gnu-tr-u12a@lists.sourceforge.net>\n"
-"Language: tr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: KBabel 1.0.2\n"
-#: buf.c:78
-msgid "Allocation of buffer to print string failed"
-msgstr ""
-
-#: buf.c:100
-msgid "Allocation of buffer for line directive failed"
-msgstr ""
-
-#: buf.c:177
-msgid "Allocation of buffer for m4 def failed"
-msgstr ""
-
-#: buf.c:197
-msgid "Allocation of buffer for m4 undef failed"
-msgstr ""
-
#: dfa.c:61
#, c-format
msgid "State #%d is non-accepting -\n"
@@ -42,17 +39,14 @@ msgid "dangerous trailing context"
msgstr "izleyen baÄŸlam tehlikeli"
#: dfa.c:166
-#, c-format
msgid " associated rule line numbers:"
msgstr " alakalı kural satır numaraları:"
#: dfa.c:202
-#, c-format
msgid " out-transitions: "
msgstr " dış-geçişler: "
#: dfa.c:210
-#, c-format
msgid ""
"\n"
" jam-transitions: EOF "
@@ -85,15 +79,19 @@ msgstr "tekil tampon sonu durumu yaratılamadı"
msgid "state # %d:\n"
msgstr "durum # %d:\n"
-#: dfa.c:785
+#: dfa.c:800
msgid "Could not write yynxt_tbl[][]"
msgstr "yynxt_tbl[][] yazılamadı"
-#: dfa.c:1049
+#: dfa.c:1023
+msgid "consistency check failed in symfollowset"
+msgstr "symfollowset içindeki tutarlık kontrolü başarısız"
+
+#: dfa.c:1071
msgid "bad transition character detected in sympartition()"
msgstr "sympartition() içinde hatalı geçiş karakterleri saptandı"
-#: gen.c:478
+#: gen.c:484
msgid ""
"\n"
"\n"
@@ -105,29 +103,29 @@ msgstr ""
"Denklik Sınıfları:\n"
"\n"
-#: gen.c:662 gen.c:691 gen.c:1215
+#: gen.c:668 gen.c:697 gen.c:1221
#, c-format
msgid "state # %d accepts: [%d]\n"
msgstr "durum # %d kabul eder: [%d]\n"
-#: gen.c:1110
+#: gen.c:1116
#, c-format
msgid "state # %d accepts: "
msgstr "durum # %d kabul eder: "
-#: gen.c:1157
+#: gen.c:1163
msgid "Could not write yyacclist_tbl"
msgstr "yyacclist_tbl yazılamadı"
-#: gen.c:1233
+#: gen.c:1239
msgid "Could not write yyacc_tbl"
msgstr "yyacc_tbl yazılamadı"
-#: gen.c:1248 gen.c:1633 gen.c:1656
+#: gen.c:1254 gen.c:1639 gen.c:1662
msgid "Could not write ecstbl"
msgstr "ecstbl yazılamadı"
-#: gen.c:1271
+#: gen.c:1277
msgid ""
"\n"
"\n"
@@ -137,399 +135,373 @@ msgstr ""
"\n"
"Ara-Denklik Sınıfları:\n"
-#: gen.c:1293
+#: gen.c:1299
msgid "Could not write yymeta_tbl"
msgstr "yymeta_tbl yazılamadı"
-#: gen.c:1354
+#: gen.c:1360
msgid "Could not write yybase_tbl"
msgstr "yybase_tbl yazılamadı"
-#: gen.c:1388
+#: gen.c:1394
msgid "Could not write yydef_tbl"
msgstr "yydef_tbl yazılamadı"
-#: gen.c:1428
+#: gen.c:1434
msgid "Could not write yynxt_tbl"
msgstr "yynxt_tbl yazılamadı"
-#: gen.c:1464
+#: gen.c:1470
msgid "Could not write yychk_tbl"
msgstr "yychk_tbl yazılamadı"
-#: gen.c:1618 gen.c:1647
+#: gen.c:1624 gen.c:1653
msgid "Could not write ftbl"
msgstr "ftbl yazılamadı"
-#: gen.c:1624
+#: gen.c:1630
msgid "Could not write ssltbl"
msgstr "ssltbl yazılamadı"
-#: gen.c:1675
+#: gen.c:1681
msgid "Could not write eoltbl"
msgstr "eoltbl yazılamadı"
-#: gen.c:1735
+#: gen.c:1741
msgid "Could not write yynultrans_tbl"
msgstr "yynultrans_tbl yazılamadı"
-#: main.c:191
+#: main.c:176
msgid "rule cannot be matched"
msgstr "kural eÅŸlenemedi"
-#: main.c:196
+#: main.c:181
msgid "-s option given but default rule can be matched"
msgstr "-s seçeneği verilmiş fakat öntanımlı kural eşlenebiliyor"
-#: main.c:236
+#: main.c:217
msgid "Can't use -+ with -l option"
msgstr "-+'yi -l seçeneği ile kullanma"
-#: main.c:239
+#: main.c:220
msgid "Can't use -f or -F with -l option"
msgstr "-f veya -F'yi -l seçeneği ile kullanma"
-#: main.c:243
+#: main.c:224
msgid "Can't use --reentrant or --bison-bridge with -l option"
msgstr "-l seçeneği ile --reentrant veya --bison-bridge bir arada kullanılamaz"
-#: main.c:275
+#: main.c:261
msgid "-Cf/-CF and -Cm don't make sense together"
msgstr "-Cf/-CF ve -Cm birlikte anlam ifade etmiyor"
-#: main.c:278
+#: main.c:264
msgid "-Cf/-CF and -I are incompatible"
msgstr "-Cf/-CF ve -I uyumsuz"
-#: main.c:282
+#: main.c:268
msgid "-Cf/-CF are incompatible with lex-compatibility mode"
msgstr "-Cf/-CF lex-uyumluluk kipi ile uyumsuz"
-#: main.c:287
+#: main.c:273
msgid "-Cf and -CF are mutually exclusive"
msgstr "-Cf ve -CF bir arada kullanılamaz"
-#: main.c:291
+#: main.c:277
msgid "Can't use -+ with -CF option"
msgstr "-+, -CF seçeneği ile kullanılamaz"
-#: main.c:294
+#: main.c:280
#, c-format
msgid "%array incompatible with -+ option"
msgstr "%array, -+ seçeneği ile uyumsuz"
-#: main.c:299
+#: main.c:285
msgid "Options -+ and --reentrant are mutually exclusive."
msgstr "-+ ve --reentrant seçenekleri bir arada kullanılamaz"
-#: main.c:302
+#: main.c:288
msgid "bison bridge not supported for the C++ scanner."
msgstr "bison bridge, C++ tarayıcısı için desteklenmiyor."
-#: main.c:357 main.c:403
+#: main.c:340 main.c:385
#, c-format
msgid "could not create %s"
msgstr "%s oluşturulamadı"
-#: main.c:416
+#: main.c:398
msgid "could not write tables header"
msgstr "tablo başlığı yazılamadı"
-#: main.c:420
+#: main.c:402
#, c-format
msgid "can't open skeleton file %s"
msgstr "iskelet dosyası %s açılamadı"
-#: main.c:456
-msgid "allocation of macro definition failed"
-msgstr ""
-
-#: main.c:504
+#: main.c:483
#, c-format
msgid "input error reading skeleton file %s"
msgstr "iskelet dosyası %s okunurken girdi hatası"
-#: main.c:508
+#: main.c:487
#, c-format
msgid "error closing skeleton file %s"
msgstr "iskelet dosyası %s kapatılırken hata"
-#: main.c:693
+#: main.c:671
#, c-format
msgid "error creating header file %s"
msgstr "başlık dosyası %s oluşturulurken hata"
-#: main.c:701
+#: main.c:679
#, c-format
msgid "error writing output file %s"
msgstr "çıktı dosyası %s yazılırken hata"
-#: main.c:705
+#: main.c:683
#, c-format
msgid "error closing output file %s"
msgstr "çıktı dosyası %s kapatılırken hata"
-#: main.c:709
+#: main.c:687
#, c-format
msgid "error deleting output file %s"
msgstr "çıktı dosyası %s silinirken hata"
-#: main.c:716
-#, c-format
+#: main.c:694
msgid "No backing up.\n"
msgstr "Yedekleme yok.\n"
-#: main.c:720
+#: main.c:698
#, c-format
msgid "%d backing up (non-accepting) states.\n"
msgstr "%d yedeklenen (kabul-etmeyen) durumlar.\n"
-#: main.c:724
-#, c-format
+#: main.c:702
msgid "Compressed tables always back up.\n"
msgstr "Sıkıştırılmış tablolar daima yedeklidir.\n"
-#: main.c:727
+#: main.c:705
#, c-format
msgid "error writing backup file %s"
msgstr "yedek dosyası %s yazılırken hata"
-#: main.c:731
+#: main.c:709
#, c-format
msgid "error closing backup file %s"
msgstr "yedek dosyası %s kapatılırken hata"
-#: main.c:736
+#: main.c:714
#, c-format
msgid "%s version %s usage statistics:\n"
msgstr "%s sürüm %s kullanım istatistikleri:\n"
-#: main.c:739
-#, c-format
+#: main.c:717
msgid " scanner options: -"
msgstr " tarayıcı seçenekleri: -"
-#: main.c:818
+#: main.c:796
#, c-format
msgid " %d/%d NFA states\n"
msgstr " %d/%d NFA durumu\n"
-#: main.c:820
+#: main.c:798
#, c-format
msgid " %d/%d DFA states (%d words)\n"
msgstr " %d/%d DFA durumu (%d sözcük)\n"
-#: main.c:822
+#: main.c:800
#, c-format
msgid " %d rules\n"
msgstr " %d kural\n"
-#: main.c:827
-#, c-format
+#: main.c:805
msgid " No backing up\n"
msgstr " Yedekleme yok\n"
-#: main.c:831
+#: main.c:809
#, c-format
msgid " %d backing-up (non-accepting) states\n"
msgstr " %d yedeklenmiÅŸ (kabul-edilmeyen) durum\n"
-#: main.c:836
-#, c-format
+#: main.c:814
msgid " Compressed tables always back-up\n"
msgstr " Sıkıştırılmış tablolar daima yedeklenir\n"
-#: main.c:840
-#, c-format
+#: main.c:818
msgid " Beginning-of-line patterns used\n"
msgstr " Başlangıç-satırı kalıpları kullanıldı\n"
-#: main.c:842
+#: main.c:820
#, c-format
msgid " %d/%d start conditions\n"
msgstr " %d/%d başlangıç şartları\n"
-#: main.c:846
+#: main.c:824
#, c-format
msgid " %d epsilon states, %d double epsilon states\n"
msgstr " %d epsilon durumu, %d çift epsilon durumu\n"
-#: main.c:850
-#, c-format
+#: main.c:828
msgid " no character classes\n"
msgstr " karakter sınıfı yok\n"
-#: main.c:854
+#: main.c:832
#, c-format
msgid " %d/%d character classes needed %d/%d words of storage, %d reused\n"
-msgstr ""
-" %d/%d ihtiyaç duyulan karakter sınıfı %d/%d depolanan sözcük, %d yeniden "
-"kullanıldı\n"
+msgstr " %d/%d ihtiyaç duyulan karakter sınıfı %d/%d depolanan sözcük, %d yeniden kullanıldı\n"
-#: main.c:859
+#: main.c:837
#, c-format
msgid " %d state/nextstate pairs created\n"
msgstr " %d durumu/sonrakidurum çifti yaratıldı\n"
-#: main.c:862
+#: main.c:840
#, c-format
msgid " %d/%d unique/duplicate transitions\n"
msgstr " %d/%d tekil/çift geçişler\n"
-#: main.c:867
+#: main.c:845
#, c-format
msgid " %d table entries\n"
msgstr " %d tablo girdileri\n"
-#: main.c:875
+#: main.c:853
#, c-format
msgid " %d/%d base-def entries created\n"
msgstr " %d/%d temel-tanım girdileri yaratıldı\n"
-#: main.c:879
+#: main.c:857
#, c-format
msgid " %d/%d (peak %d) nxt-chk entries created\n"
msgstr " %d/%d (en yüksek %d) nxt-chk girdileri yaratıldı\n"
-#: main.c:883
+#: main.c:861
#, c-format
msgid " %d/%d (peak %d) template nxt-chk entries created\n"
msgstr " %d/%d (en yüksek %d) şablon nxt-chk girdileri yaratıldı\n"
-#: main.c:887
+#: main.c:865
#, c-format
msgid " %d empty table entries\n"
msgstr " %d boÅŸ tablo girdileri\n"
-#: main.c:889
+#: main.c:867
#, c-format
msgid " %d protos created\n"
msgstr " %d prototip yaratıldı\n"
-#: main.c:892
+#: main.c:870
#, c-format
msgid " %d templates created, %d uses\n"
msgstr " %d şablon yaratıldı, %d kullanıldı\n"
-#: main.c:900
+#: main.c:878
#, c-format
msgid " %d/%d equivalence classes created\n"
msgstr " %d/%d denklik sınıfı yaratıldı\n"
-#: main.c:908
+#: main.c:886
#, c-format
msgid " %d/%d meta-equivalence classes created\n"
msgstr " %d/%d ara-denklik sınıfı yaratıldı\n"
-#: main.c:914
+#: main.c:892
#, c-format
msgid " %d (%d saved) hash collisions, %d DFAs equal\n"
msgstr " %d (%d kaydedildi) saçılma çarpışması, %d DFA denk\n"
-#: main.c:916
+#: main.c:894
#, c-format
msgid " %d sets of reallocations needed\n"
msgstr " %d tekrar ayırım kümesine ihtiyaç var\n"
-#: main.c:918
+#: main.c:896
#, c-format
msgid " %d total table entries needed\n"
msgstr " %d toplam tablo girdisine ihtiyaç var\n"
-#: main.c:995
-#, c-format
+#: main.c:971
msgid "Internal error. flexopts are malformed.\n"
msgstr "İç hata. flexopt'lar bozuk.\n"
-#: main.c:1005
+#: main.c:981
#, c-format
msgid "Try `%s --help' for more information.\n"
msgstr "Daha fazla bilgi için `%s --help' yazın.\n"
-#: main.c:1062
+#: main.c:1038
#, c-format
msgid "unknown -C option '%c'"
msgstr "bilinmeyen -C seçeneği '%c'"
-#: main.c:1191
+#: main.c:1167
#, c-format
msgid "%s %s\n"
msgstr "%s %s\n"
-#: main.c:1466
+#: main.c:1442
msgid "fatal parse error"
msgstr "ölümcül ayrıştırma hatası"
-#: main.c:1498
+#: main.c:1474
#, c-format
msgid "could not create backing-up info file %s"
msgstr "yedekleme bilgi dosyası %s oluşturulamadı"
-#: main.c:1519
-#, c-format
+#: main.c:1495
msgid "-l AT&T lex compatibility option entails a large performance penalty\n"
msgstr "-l AT&T lex uyumluluğu seçeneği önemli ölçüde yavaşlamaya yol açar\n"
-#: main.c:1522
-#, c-format
+#: main.c:1498
msgid " and may be the actual source of other reported performance penalties\n"
-msgstr ""
-" ve belki bildirilen başka performans kayıplarının da kaynağı olabilir\n"
+msgstr " ve belki bildirilen başka performans kayıplarının da kaynağı olabilir\n"
-#: main.c:1528
+#: main.c:1504
#, c-format
-msgid ""
-"%%option yylineno entails a performance penalty ONLY on rules that can match "
-"newline characters\n"
-msgstr ""
-"yylineno %%seçeneği YALNIZCA yenisatır karakterlerini de eşleyen satırlarda "
-"yavaÅŸlar.\n"
+msgid "%%option yylineno entails a performance penalty ONLY on rules that can match newline characters\n"
+msgstr "yylineno %%seçeneği YALNIZCA yenisatır karakterlerini de eşleyen satırlarda yavaşlar.\n"
-#: main.c:1535
-#, c-format
+#: main.c:1511
msgid "-I (interactive) entails a minor performance penalty\n"
msgstr "-I (etkileşimli) küçük ölçekli bir yavaşlamaya neden olur\n"
-#: main.c:1540
-#, c-format
+#: main.c:1516
msgid "yymore() entails a minor performance penalty\n"
msgstr "yymore() küçük ölçekli bir yavaşlamaya neden olur\n"
-#: main.c:1546
-#, c-format
+#: main.c:1522
msgid "REJECT entails a large performance penalty\n"
msgstr "REJECT büyük ölçekli bir yavaşlamaya neden olur\n"
-#: main.c:1551
-#, c-format
+#: main.c:1527
msgid "Variable trailing context rules entail a large performance penalty\n"
-msgstr ""
-"Değişken izleyen bağlam kuralları, büyük ölçekli yavaşlamaya neden olur\n"
+msgstr "Değişken izleyen bağlam kuralları, büyük ölçekli yavaşlamaya neden olur\n"
-#: main.c:1563
+#: main.c:1539
msgid "REJECT cannot be used with -f or -F"
msgstr "REJECT, -f veya -F ile kullanılamaz"
-#: main.c:1566
+#: main.c:1542
#, c-format
msgid "%option yylineno cannot be used with REJECT"
msgstr "%option yylineno, REJECT ile birlikte kullanılamaz"
-#: main.c:1569
+#: main.c:1545
msgid "variable trailing context rules cannot be used with -f or -F"
msgstr "değişken izleme ortamı kuralları, -f veya -F ile birlikte kullanılamaz"
-#: main.c:1692
+#: main.c:1661
#, c-format
msgid "%option yyclass only meaningful for C++ scanners"
msgstr "%option yyclass, sadece C++ tarayıcıları için anlamlıdır"
-#: main.c:1799
+#: main.c:1768
#, c-format
msgid "Usage: %s [OPTIONS] [FILE]...\n"
msgstr "Kullanım: %s [SEÇENEKLER...] [DOSYA...]\n"
-#: main.c:1802
+#: main.c:1771
#, c-format
msgid ""
"Generates programs that perform pattern-matching on text.\n"
@@ -559,8 +531,7 @@ msgid ""
" -S, --skel=FILE specify skeleton file\n"
" -t, --stdout write scanner on stdout instead of %s\n"
" --yyclass=NAME name of C++ class\n"
-" --header-file=FILE create a C header file in addition to the "
-"scanner\n"
+" --header-file=FILE create a C header file in addition to the scanner\n"
" --tables-file[=FILE] write tables to FILE\n"
"\n"
"Scanner behavior:\n"
@@ -656,47 +627,43 @@ msgstr ""
" -h, --help bu yardım bilgisini gösterir\n"
" -V, --version %s sürümünü bildirir\n"
-#: misc.c:65
-msgid "allocation of sko_stack failed"
-msgstr ""
-
-#: misc.c:102 misc.c:128
+#: misc.c:100 misc.c:126
#, c-format
msgid "name \"%s\" ridiculously long"
msgstr "\"%s\" ismi gülünç derecede uzun"
-#: misc.c:177
+#: misc.c:175
msgid "memory allocation failed in allocate_array()"
msgstr "allocate_array() içinde bellek ayırımı başarısız"
-#: misc.c:230
+#: misc.c:250
#, c-format
msgid "bad character '%s' detected in check_char()"
msgstr "check_char() içinde hatalı karakter '%s' saptandı"
-#: misc.c:235
+#: misc.c:255
#, c-format
msgid "scanner requires -8 flag to use the character %s"
msgstr "tarayıcı %s karakterini kullanmak için -8 bayrağına ihtiyaç duyar"
-#: misc.c:268
+#: misc.c:288
msgid "dynamic memory failure in copy_string()"
msgstr "copy_string() içinde dinamik bellek hatası"
-#: misc.c:367
+#: misc.c:422
#, c-format
msgid "%s: fatal internal error, %s\n"
msgstr "%s: ölümcül iç hata, %s\n"
-#: misc.c:803
+#: misc.c:875
msgid "attempt to increase array size failed"
msgstr "dizi boyutunu artırma denemesi başarısız"
-#: misc.c:930
+#: misc.c:1002
msgid "bad line in skeleton file"
msgstr "iskelet dosya içinde hatalı satır"
-#: misc.c:979
+#: misc.c:1051
msgid "memory allocation failed in yy_flex_xmalloc()"
msgstr "yy_flex_xmalloc() içinde bellek ayırımı başarısız"
@@ -717,7 +684,6 @@ msgid "state # %4d\t"
msgstr "durum # %4d\t"
#: nfa.c:130
-#, c-format
msgid "********** end of dump\n"
msgstr "********** döküm sonu\n"
@@ -730,161 +696,127 @@ msgstr "dupmachine() içinde boş makine"
msgid "Variable trailing context rule at line %d\n"
msgstr "%d satırında değişken izleyen bağlam kuralı\n"
-#: nfa.c:364
+#: nfa.c:353
msgid "bad state type in mark_beginning_as_normal()"
msgstr "mark_beginning_as_normal() içinde hatalı durum türü"
-#: nfa.c:609
+#: nfa.c:598
#, c-format
msgid "input rules are too complicated (>= %d NFA states)"
msgstr "girdi kuralları fazla karışık (>= %d NFA durumu)"
-#: nfa.c:688
+#: nfa.c:677
msgid "found too many transitions in mkxtion()"
msgstr "mkxtion() içinde çok fazla geçiş bulundu"
-#: nfa.c:714
+#: nfa.c:703
#, c-format
msgid "too many rules (> %d)!"
msgstr "çok fazla kural (> %d)!"
-#: parse.y:159
+#: parse.y:183
msgid "unknown error processing section 1"
msgstr "1. bölüm işlenirken bilinmeyen hata oluştu"
-#: parse.y:184 parse.y:351
+#: parse.y:208 parse.y:373
msgid "bad start condition list"
msgstr "hatalı başlangıç şart listesi"
-#: parse.y:315
+#: parse.y:337
msgid "unrecognized rule"
msgstr "bilinmeyen kural"
-#: parse.y:434 parse.y:447 parse.y:516
+#: parse.y:456 parse.y:469 parse.y:538
msgid "trailing context used twice"
msgstr "izleyen bağlam iki defa kullanılmış"
-#: parse.y:552 parse.y:562 parse.y:635 parse.y:645
+#: parse.y:574 parse.y:584 parse.y:657 parse.y:667
msgid "bad iteration values"
msgstr "hatalı yineleme değerleri"
-#: parse.y:580 parse.y:598 parse.y:663 parse.y:681
+#: parse.y:602 parse.y:620 parse.y:685 parse.y:703
msgid "iteration value must be positive"
msgstr "yineleme değeri pozitif olmalı"
-#: parse.y:804 parse.y:814
+#: parse.y:817 parse.y:827
#, c-format
msgid "the character range [%c-%c] is ambiguous in a case-insensitive scanner"
msgstr ""
"[%c-%c] karakter aralığı, büyük/küçük harf farkı gözetmeyen bir tarayıcıda\n"
"belirsiz anlamlı"
-#: parse.y:819
+#: parse.y:832
msgid "negative range in character class"
msgstr "karakter sınıflarında negatif aralık"
-#: parse.y:916
-#, fuzzy
-msgid "[:^lower:] is ambiguous in case insensitive scanner"
-msgstr ""
-"[%c-%c] karakter aralığı, büyük/küçük harf farkı gözetmeyen bir tarayıcıda\n"
-"belirsiz anlamlı"
-
-#: parse.y:922
-#, fuzzy
-msgid "[:^upper:] ambiguous in case insensitive scanner"
-msgstr ""
-"[%c-%c] karakter aralığı, büyük/küçük harf farkı gözetmeyen bir tarayıcıda\n"
-"belirsiz anlamlı"
-
-#: scan.l:75 scan.l:618 scan.l:676
+#: scan.l:70 scan.l:180 scan.l:267 scan.l:409 scan.l:548 scan.l:598
msgid "Input line too long\n"
msgstr "Girdi satırı fazla uzun\n"
-#: scan.l:161
+#: scan.l:149
#, c-format
msgid "malformed '%top' directive"
msgstr "hatalı `%top' yönergesi"
-#: scan.l:183
+#: scan.l:171
#, no-c-format
msgid "unrecognized '%' directive"
msgstr "'%' yönergesi bilinmiyor"
-#: scan.l:192
-#, fuzzy
-msgid "Definition name too long\n"
-msgstr "Girdi satırı fazla uzun\n"
-
-#: scan.l:284
+#: scan.l:251
msgid "Unmatched '{'"
msgstr "'{' eÅŸleÅŸmiyor"
-#: scan.l:300
-#, c-format
-msgid "Definition value for {%s} too long\n"
-msgstr ""
-
-#: scan.l:317
+#: scan.l:284
msgid "incomplete name definition"
msgstr "eksik isim tanımlaması"
-#: scan.l:443
-#, fuzzy
-msgid "Option line too long\n"
-msgstr "Girdi satırı fazla uzun\n"
-
-#: scan.l:451
+#: scan.l:417
#, c-format
msgid "unrecognized %%option: %s"
msgstr "geçersiz %%seçenek: %s"
-#: scan.l:633 scan.l:800
+#: scan.l:558 scan.l:677
msgid "bad character class"
msgstr "hatalı karakter sınıfı"
-#: scan.l:683
+#: scan.l:605
#, c-format
msgid "undefined definition {%s}"
msgstr "belirsiz tanım {%s}"
-#: scan.l:755
+#: scan.l:645
#, c-format
msgid "bad <start condition>: %s"
msgstr "hatalı <başlangıç şartı>: %s"
-#: scan.l:768
+#: scan.l:658
msgid "missing quote"
msgstr "eksik çift tırnak"
-#: scan.l:834
+#: scan.l:698
#, c-format
msgid "bad character class expression: %s"
msgstr "bozuk karakter sınıfı ifadesi: %s"
-#: scan.l:856
+#: scan.l:720
msgid "bad character inside {}'s"
msgstr "{}'ler içinde hatalı karakter"
-#: scan.l:862
+#: scan.l:726
msgid "missing }"
msgstr "eksik }"
-#: scan.l:940
+#: scan.l:799
msgid "EOF encountered inside an action"
msgstr "bir eylem içinde EOF ile karşılaşıldı"
-#: scan.l:945
-#, fuzzy
-msgid "EOF encountered inside pattern"
-msgstr "bir eylem içinde EOF ile karşılaşıldı"
-
-#: scan.l:967
+#: scan.l:819
#, c-format
msgid "bad character: %s"
msgstr "hatalı karakter: %s"
-#: scan.l:996
+#: scan.l:848
#, c-format
msgid "can't open %s"
msgstr "%s açılamıyor"
@@ -894,27 +826,27 @@ msgstr "%s açılamıyor"
msgid "Usage: %s [OPTIONS]...\n"
msgstr "Kullanım: %s [SEÇENEKLER...]\n"
-#: scanopt.c:564
+#: scanopt.c:565
#, c-format
msgid "option `%s' doesn't allow an argument\n"
msgstr "`%s' seçeneği argüman kullanmaz\n"
-#: scanopt.c:569
+#: scanopt.c:570
#, c-format
msgid "option `%s' requires an argument\n"
msgstr "`%s' seçeneği için argüman zorunludur\n"
-#: scanopt.c:573
+#: scanopt.c:574
#, c-format
msgid "option `%s' is ambiguous\n"
msgstr "`%s' seçeneği belirsiz\n"
-#: scanopt.c:577
+#: scanopt.c:578
#, c-format
msgid "Unrecognized option `%s'\n"
msgstr "Bilinmeyen seçenek: `%s'\n"
-#: scanopt.c:581
+#: scanopt.c:582
#, c-format
msgid "Unknown error=(%d)\n"
msgstr "Bilinmeyen hata=(%d)\n"
@@ -923,11 +855,11 @@ msgstr "Bilinmeyen hata=(%d)\n"
msgid "symbol table memory allocation failed"
msgstr "simge tablosu bellek ayırımı başarısız"
-#: sym.c:202
+#: sym.c:203
msgid "name defined twice"
msgstr "isim iki defa tanımlandı"
-#: sym.c:253
+#: sym.c:254
#, c-format
msgid "start condition %s declared twice"
msgstr "başlangıç şartı %s iki defa bildirildi"
@@ -937,7 +869,6 @@ msgid "premature EOF"
msgstr "erken EOF"
#: yylex.c:198
-#, c-format
msgid "End Marker\n"
msgstr "Bitiş İşaretçisi\n"
@@ -945,6 +876,3 @@ msgstr "Bitiş İşaretçisi\n"
#, c-format
msgid "*Something Weird* - tok: %d val: %d\n"
msgstr "*Garip Bir Şey* -andaç: %d değer: %d\n"
-
-#~ msgid "consistency check failed in symfollowset"
-#~ msgstr "symfollowset içindeki tutarlık kontrolü başarısız"
diff --git a/po/vi.po b/po/vi.po
index 1d55597..cb6a1ea 100644
--- a/po/vi.po
+++ b/po/vi.po
@@ -1,16 +1,31 @@
-# Vietnamese translation for Flex.
-# Bản dịch tiếng Việt dành cho flex.
-# Copyright (C) 2014 The Flex Project (msgids)
-# Copyright (C) 2014 Free Software Foundation, Inc.
-# This file is distributed under the same license as the flex package.
-# Clytie Siddall <clytie@riverland.net.au>, 2005-2008.
-# Trần Ngá»c Quân <vnwildman@gmail.com>, 2012-2014.
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR Free Software Foundation, Inc.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
+#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: flex-2.5.38\n"
-"Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2014-03-26 15:00-0400\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"PO-Revision-Date: 2016-01-22 13:26-0800\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#~ # Vietnamese translation for Flex.
+#~ # Bản dịch tiếng Việt dành cho flex.
+#~ # Copyright (C) 2014 The Flex Project (msgids)
+#~ # Copyright (C) 2014 Free Software Foundation, Inc.
+#~ # This file is distributed under the same license as the flex package.
+#~ # Clytie Siddall <clytie@riverland.net.au>, 2005-2008.
+#~ # Trần Ngá»c Quân <vnwildman@gmail.com>, 2012-2014.
+#~ #
+#~ msgid ""
+#~ msgstr ""
+#~ "Project-Id-Version: flex-2.5.38\n"
+#~ "Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n"
+"POT-Creation-Date: 2014-02-11 16:15-0500\n"
"PO-Revision-Date: 2014-02-14 08:17+0700\n"
"Last-Translator: Trần Ngá»c Quân <vnwildman@gmail.com>\n"
"Language-Team: Vietnamese <translation-team-vi@lists.sourceforge.net>\n"
@@ -197,9 +212,7 @@ msgstr "Không thể dùng cá» \"-f\" hoặc \"-F\" vá»›i tùy chá»n \"-l\""
#: main.c:243
msgid "Can't use --reentrant or --bison-bridge with -l option"
-msgstr ""
-"Không thể dùng đối số \"--reentrant\" (Ä‘iá»u vào lại) hoặc \"--bison-bridge"
-"\" (chiếc cầu bison) vá»›i tùy chá»n \"-l\""
+msgstr "Không thể dùng đối số \"--reentrant\" (Ä‘iá»u vào lại) hoặc \"--bison-bridge\" (chiếc cầu bison) vá»›i tùy chá»n \"-l\""
#: main.c:275
msgid "-Cf/-CF and -Cm don't make sense together"
@@ -211,9 +224,7 @@ msgstr "Hai tùy chá»n \"-Cf/-CF\" và \"-I\" không tÆ°Æ¡ng thích vá»›i nhau"
#: main.c:282
msgid "-Cf/-CF are incompatible with lex-compatibility mode"
-msgstr ""
-"Tùy chá»n \"-Cf/-CF\" không tÆ°Æ¡ng thích vá»›i chế Ä‘á»™ \"lex-compatibility"
-"\" (tương thích với lex)"
+msgstr "Tùy chá»n \"-Cf/-CF\" không tÆ°Æ¡ng thích vá»›i chế Ä‘á»™ \"lex-compatibility\" (tÆ°Æ¡ng thích vá»›i lex)"
#: main.c:287
msgid "-Cf and -CF are mutually exclusive"
@@ -402,8 +413,7 @@ msgstr " %d/%d (tối Ä‘a %d) mục tin nxt-chk (kiểm tra kế tiếp) đã Ä
#: main.c:883
#, c-format
msgid " %d/%d (peak %d) template nxt-chk entries created\n"
-msgstr ""
-" %d/%d (tối đa %d) mục tin biểu mẫu nxt-chk (kiểm tra kế tiếp) đã được tạo\n"
+msgstr " %d/%d (tối đa %d) mục tin biểu mẫu nxt-chk (kiểm tra kế tiếp) đã được tạo\n"
#: main.c:887
#, c-format
@@ -477,8 +487,7 @@ msgstr "không thể tạo tập tin thông tin sao lưu %s"
#: main.c:1519
#, c-format
msgid "-l AT&T lex compatibility option entails a large performance penalty\n"
-msgstr ""
-"Tùy chá»n kiểu tÆ°Æ¡ng thích lex AT&T \"-l\" làm giảm hiệu suất rất nhiá»u\n"
+msgstr "Tùy chá»n kiểu tÆ°Æ¡ng thích lex AT&T \"-l\" làm giảm hiệu suất rất nhiá»u\n"
#: main.c:1522
#, c-format
@@ -487,12 +496,8 @@ msgstr " thì có lẽ thật gây ra trÆ°á»ng hợp giảm hiệu suất khác
#: main.c:1528
#, c-format
-msgid ""
-"%%option yylineno entails a performance penalty ONLY on rules that can match "
-"newline characters\n"
-msgstr ""
-"%%tùy chá»n \"yylineno\" giảm hiệu suất CHỈ vá»›i quy tắc khá»›p vá»›i ký tá»± dòng "
-"má»›i\n"
+msgid "%%option yylineno entails a performance penalty ONLY on rules that can match newline characters\n"
+msgstr "%%tùy chá»n \"yylineno\" giảm hiệu suất CHỈ vá»›i quy tắc khá»›p vá»›i ký tá»± dòng má»›i\n"
#: main.c:1535
#, c-format
@@ -521,14 +526,11 @@ msgstr "Không cho phép dùng REJECT (đẩy ra) vá»›i tùy chá»n \"-f\" hay \
#: main.c:1566
#, c-format
msgid "%option yylineno cannot be used with REJECT"
-msgstr ""
-"Không cho phép dùng %option (tùy chá»n) \"yylineno\" vá»›i REJECT (đẩy ra)"
+msgstr "Không cho phép dùng %option (tùy chá»n) \"yylineno\" vá»›i REJECT (đẩy ra)"
#: main.c:1569
msgid "variable trailing context rules cannot be used with -f or -F"
-msgstr ""
-"không cho phép dùng quy tắc ngữ cảnh theo sau biến vá»›i tùy chá»n \"-f\" hay "
-"\"-F\""
+msgstr "không cho phép dùng quy tắc ngữ cảnh theo sau biến vá»›i tùy chá»n \"-f\" hay \"-F\""
#: main.c:1692
#, c-format
@@ -570,8 +572,7 @@ msgid ""
" -S, --skel=FILE specify skeleton file\n"
" -t, --stdout write scanner on stdout instead of %s\n"
" --yyclass=NAME name of C++ class\n"
-" --header-file=FILE create a C header file in addition to the "
-"scanner\n"
+" --header-file=FILE create a C header file in addition to the scanner\n"
" --tables-file[=FILE] write tables to FILE\n"
"\n"
"Scanner behavior:\n"
@@ -608,35 +609,29 @@ msgstr ""
"Tạo ra chÆ°Æ¡ng trình để thá»±c hiện tiến trình khá»›p mẫu trên văn bản thÆ°á»ng.\n"
"\n"
"Cách nén bảng:\n"
-" -Ca, --align thoả hiệp giữa bảng lá»›n hÆ¡n và Ä‘á»™ _canh lá»_ bá»™ nhá»› khá "
-"hơn\n"
+" -Ca, --align thoả hiệp giữa bảng lá»›n hÆ¡n và Ä‘á»™ _canh lá»_ bá»™ nhá»› khá hÆ¡n\n"
" -Ce, --ecs cấu tạo lớp kiểu tương đương\n"
" -Cf không nén bảng; dùng sự tiêu biểu \"-f\"\n"
" -CF không nén bảng; dùng sự cách tiêu biểu \"-F\"\n"
" -Cm, --meta-ecs cấu tạo lớp kiểu meta tương đương\n"
-" -Cr, --read dùng chức năng read() thay thế thiết bị nhập/xuất chuẩn "
-"để nhập bộ quét\n"
+" -Cr, --read dùng chức năng read() thay thế thiết bị nhập/xuất chuẩn để nhập bộ quét\n"
" -f, --full tạo ra bộ quét nhanh và lớn; bằng -Cfr (_đầy đủ_)\n"
" -F, --fast dùng sự tiêu biểu bảng xen kẽ; bằng -CFr (_nhanh_)\n"
-" -Cem phương pháp nén mặc định; bằng \"--ecs\" \"--meta-ecs"
-"\")\n"
+" -Cem phương pháp nén mặc định; bằng \"--ecs\" \"--meta-ecs\")\n"
"\n"
"Gỡ lỗi:\n"
" -d, --debug bật chế độ _gỡ lỗi_ trong bộ quét\n"
" -b, --backup ghi thông tin _sao lưu_ vào %s\n"
" -p, --perf-report ghi _thông báo hiệu suất_ vào thiết bị lỗi chuẩn\n"
-" -s, --nodefault thu hồi quy tắc _mặc định_ để ECHO (vá»ng) Ä‘oạn "
-"chÆ°a khá»›p\n"
+" -s, --nodefault thu hồi quy tắc _mặc định_ để ECHO (vá»ng) Ä‘oạn chÆ°a khá»›p\n"
" -T, --trace %s nên chạy trong chế độ theo _dấu vết_\n"
" -w, --nowarn _không_ tạo ra lá»i _cảnh báo_\n"
-" -v, --verbose ghi tóm tắt các thống kê bộ quét vào thiết bị xuất "
-"chuẩn (_chi tiêt_)\n"
+" -v, --verbose ghi tóm tắt các thống kê bộ quét vào thiết bị xuất chuẩn (_chi tiêt_)\n"
"\n"
"Tập tin:\n"
" -o, --outfile=TẬP_TIN ghi rõ tên _tập tin xuất_\n"
" -S, --skel=TẬP_TIN ghi rõ tập tin _khung sÆ°á»n_\n"
-" -t, --stdout ghi bộ quét ra _thiết bị xuất chuẩn_ thay thế ra "
-"%s\n"
+" -t, --stdout ghi bộ quét ra _thiết bị xuất chuẩn_ thay thế ra %s\n"
" --yyclass=TÊN tên của _lớp_ C++\n"
" --header-file=TẬP_TIN tạo _tập tin phần đầu_ C thêm vào bộ quét\n"
" --tables-file[=TẬP_TIN] ghi các bảng vào TẬP_TIN này\n"
@@ -653,20 +648,15 @@ msgstr ""
"\n"
"Mã đã tạo ra :\n"
" -+, --c++ tạo ra hang bộ quét kiểu C++\n"
-" -Dmacro[=định_nghĩa] _định nghĩa_ cho lệnh #define (mặc định là "
-"\"1\")\n"
+" -Dmacro[=định_nghĩa] _định nghĩa_ cho lệnh #define (mặc định là \"1\")\n"
" -L, --noline thu hồi các chỉ thị #line trong bộ quét\n"
" -P, --prefix=CHUá»–I dùng CHUá»–I này là _tiá»n tố_ thay thế \"yy\"\n"
" -R, --reentrant tạo ra một bộ quét C kiểu _vào lại_\n"
-" --bison-bridge bộ quét cho trình phân tách thuần tuý kiểu "
-"bison.\n"
+" --bison-bridge bộ quét cho trình phân tách thuần tuý kiểu bison.\n"
" --bison-locations gồm khả năng hỗ trợ yylloc (_địa điểm_).\n"
-" --stdinit khởi động yyin/yyout vào thiết bị nhập/xuất "
-"chuẩn\n"
-" --noansi-definitions _lá»i định nghÄ©a_ chức năng kiểu cÅ© (_không "
-"ANSI_)\n"
-" --noansi-prototypes danh sách tham số trống trong _khai báo nghi "
-"thức_ (_không ANSI_)\n"
+" --stdinit khởi động yyin/yyout vào thiết bị nhập/xuất chuẩn\n"
+" --noansi-definitions _lá»i định nghÄ©a_ chức năng kiểu cÅ© (_không ANSI_)\n"
+" --noansi-prototypes danh sách tham số trống trong _khai báo nghi thức_ (_không ANSI_)\n"
" --nounistd _không_ bao gồm <unistd.h>\n"
" --noCHỨC_NĂNG không tạo ra một CHỨC NĂNG cá biệt\n"
"\n"
@@ -753,8 +743,7 @@ msgstr "Gặp quy tắc ngữ cảnh theo sau biến tại dòng %d\n"
#: nfa.c:364
msgid "bad state type in mark_beginning_as_normal()"
-msgstr ""
-"kiểu trạng thái sai trong mark_beginning_as_normal() (đánh dấu đầu là thÆ°á»ng)"
+msgstr "kiểu trạng thái sai trong mark_beginning_as_normal() (đánh dấu đầu là thÆ°á»ng)"
#: nfa.c:609
#, c-format
@@ -797,9 +786,7 @@ msgstr "giá trị lặp lại phải là số dương"
#: parse.y:804 parse.y:814
#, c-format
msgid "the character range [%c-%c] is ambiguous in a case-insensitive scanner"
-msgstr ""
-"phạm vi ký tá»± [%c-%c] là chÆ°a rõ ràng trong trÆ°á»ng hợp quét bá» qua chữ HOA/"
-"thÆ°á»ng"
+msgstr "phạm vi ký tá»± [%c-%c] là chÆ°a rõ ràng trong trÆ°á»ng hợp quét bá» qua chữ HOA/thÆ°á»ng"
#: parse.y:819
msgid "negative range in character class"
diff --git a/po/zh_CN.po b/po/zh_CN.po
index d20d313..318ed74 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -1,54 +1,57 @@
# Chinese translations for flex.
-# Copyright (C) 2002 The Flex Project
+# Copyright (C) 2014 The Flex Project (msgids)
+# This file is distributed under the same license as the flex package.
# Wang Li <charles@linux.net.cn>, 2002.
-#
+# Wei-Lun Chao <bluebat@member.fsf.org>, 2009, 2013.
+# Mingye Wang <arthur200126@gmail.com>, 2015.
msgid ""
msgstr ""
-"Project-Id-Version: flex 2.5.8\n"
+"Project-Id-Version: flex 2.5.38\n"
"Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2014-03-26 15:00-0400\n"
-"PO-Revision-Date: 2002-08-18 10:37+0800\n"
-"Last-Translator: Wang Li <charles@linux.net.cn>\n"
+"POT-Creation-Date: 2014-02-11 16:15-0500\n"
+"PO-Revision-Date: 2016-01-22 13:27-0800\n"
+"Last-Translator: Mingye Wang <arthur200126@gmail.com>\n"
"Language-Team: Chinese (simplified) <i18n-zh@googlegroups.com>\n"
"Language: zh_CN\n"
"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=gb2312\n"
+"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Poedit 1.8.4\n"
#: buf.c:78
msgid "Allocation of buffer to print string failed"
-msgstr ""
+msgstr "缙浜ˆç¼‚“å†æ’Œæ´ª…棰浠ユ‰“åæ¿­—涓剗跺ã‘ç’¥"
#: buf.c:100
msgid "Allocation of buffer for line directive failed"
-msgstr ""
+msgstr "缙浜ˆç¼‚“å†æ’Œæ´ª…棰ç”ㄤºŽåˆ—指浠ゆ—è·ºã‘ç’¥"
#: buf.c:177
msgid "Allocation of buffer for m4 def failed"
-msgstr ""
+msgstr "缙浜ˆç¼‚“å†æ’Œæ´ª…棰ç”ㄤºŽ m4 def æ—è·ºã‘ç’¥"
#: buf.c:197
msgid "Allocation of buffer for m4 undef failed"
-msgstr ""
+msgstr "缙浜ˆç¼‚“å†æ’Œæ´ª…棰ç”ㄤºŽ m4 undef æ—è·ºã‘ç’¥"
#: dfa.c:61
#, c-format
msgid "State #%d is non-accepting -\n"
-msgstr ""
+msgstr "#%d å§ï½…¤„浜Žéžç’å——ô”ŒŠèˆµ€ -\n"
#: dfa.c:124
msgid "dangerous trailing context"
-msgstr ""
+msgstr "涓瀹‰å…ㄧš„æœô²ôŽºæ¶“Šæ¶“‹æ–‡"
#: dfa.c:166
#, c-format
msgid " associated rule line numbers:"
-msgstr ""
+msgstr " å…å® ”çš„ç‘™„则列å凤¼š"
#: dfa.c:202
#, c-format
msgid " out-transitions: "
-msgstr ""
+msgstr " 澶–æžô‘ô‚¬¼š"
#: dfa.c:210
#, c-format
@@ -56,10 +59,12 @@ msgid ""
"\n"
" jam-transitions: EOF "
msgstr ""
+"\n"
+" åˆéªžæƒ°æµ†æô‚¬¼šæ–‡æµ å‰»“ç¾ "
#: dfa.c:341
msgid "consistency check failed in epsclosure()"
-msgstr "epsclosure() ÖеÄÒ»ÖÂÐÔ¼ì²éʧ°Ü"
+msgstr "epsclosure() 涓ô’®š„涓€è‡å­˜€Ñ„£€æŸãƒ¥ã‘ç’¥"
#: dfa.c:429
msgid ""
@@ -70,25 +75,25 @@ msgid ""
msgstr ""
"\n"
"\n"
-"DFA Êä³ö£º\n"
+"DFA æžô‘Ž‚ô‹ ¼š\n"
"\n"
#: dfa.c:604
msgid "could not create unique end-of-buffer state"
-msgstr "ÎÞ·¨´´½¨¶ÀÁ¢µÄ end-of-buffer ״̬"
+msgstr "无娉•åˆ›å¯¤è™¹‹ô‘«‹çš„ end-of-buffer çŠèˆµ€"
#: dfa.c:625
#, c-format
msgid "state # %d:\n"
-msgstr "״̬ # %d£º\n"
+msgstr "çŠèˆµ€ # %dé”›š\n"
#: dfa.c:785
msgid "Could not write yynxt_tbl[][]"
-msgstr ""
+msgstr "无娉•å†™å…¥ yynxt_tbl[][]"
#: dfa.c:1049
msgid "bad transition character detected in sympartition()"
-msgstr "ÔÚ sympartition() ¼ì²âµ½´íÎóµÄ±ä»»×Ö·û"
+msgstr "在 sympartition() 妫€å¨´‹åˆä¼´”™ç’‡ô•ªš„å˜æ㈠­—ç»—¦"
#: gen.c:478
msgid ""
@@ -99,31 +104,30 @@ msgid ""
msgstr ""
"\n"
"\n"
-"µÈ¼ÛÀࣺ\n"
+"ç»›‰æµ é£Žè¢«é”›š\n"
"\n"
#: gen.c:662 gen.c:691 gen.c:1215
#, c-format
msgid "state # %d accepts: [%d]\n"
-msgstr ""
+msgstr "çŠèˆµ€ # %d æŽãƒ¥—é”›š[%d]\n"
#: gen.c:1110
#, c-format
msgid "state # %d accepts: "
-msgstr ""
+msgstr "çŠèˆµ€ # %d æŽãƒ¥—é”›š"
#: gen.c:1157
msgid "Could not write yyacclist_tbl"
-msgstr ""
+msgstr "无娉•å†™å…¥ yyacclist_tbl"
#: gen.c:1233
msgid "Could not write yyacc_tbl"
-msgstr ""
+msgstr "无娉•å†™å…¥ yyacc_tbl"
#: gen.c:1248 gen.c:1633 gen.c:1656
-#, fuzzy
msgid "Could not write ecstbl"
-msgstr "ÎÞ·¨´´½¨ %s"
+msgstr "无娉•å†™å…¥ ecstbl"
#: gen.c:1271
msgid ""
@@ -131,323 +135,322 @@ msgid ""
"\n"
"Meta-Equivalence Classes:\n"
msgstr ""
+"\n"
+"\n"
+"元绛‰æµ é£Žè¢«é”›š\n"
#: gen.c:1293
msgid "Could not write yymeta_tbl"
-msgstr ""
+msgstr "无娉•å†™å…¥ yymeta_tbl"
#: gen.c:1354
-#, fuzzy
msgid "Could not write yybase_tbl"
-msgstr "ÎÞ·¨´´½¨ %s"
+msgstr "无娉•å†™å…¥ yybase_tbl"
#: gen.c:1388
msgid "Could not write yydef_tbl"
-msgstr ""
+msgstr "无娉•å†™å…¥ yydef_tbl"
#: gen.c:1428
msgid "Could not write yynxt_tbl"
-msgstr ""
+msgstr "无娉•å†™å…¥ yynxt_tbl"
#: gen.c:1464
msgid "Could not write yychk_tbl"
-msgstr ""
+msgstr "无娉•å†™å…¥ yychk_tbl"
#: gen.c:1618 gen.c:1647
-#, fuzzy
msgid "Could not write ftbl"
-msgstr "ÎÞ·¨´´½¨ %s"
+msgstr "无娉•å†™å…¥ ftbl"
#: gen.c:1624
-#, fuzzy
msgid "Could not write ssltbl"
-msgstr "ÎÞ·¨´´½¨ %s"
+msgstr "无娉•å†™å…¥ ssltbl"
#: gen.c:1675
-#, fuzzy
msgid "Could not write eoltbl"
-msgstr "ÎÞ·¨´´½¨ %s"
+msgstr "无娉•å†™å…¥ eoltbl"
#: gen.c:1735
msgid "Could not write yynultrans_tbl"
-msgstr ""
+msgstr "无娉•å†™å…¥ yynultrans_tbl"
#: main.c:191
msgid "rule cannot be matched"
-msgstr "ÎÞ·¨Æ¥Åä¹æÔò"
+msgstr "无娉•åŒå½’…ç‘™„则"
#: main.c:196
msgid "-s option given but default rule can be matched"
-msgstr ""
+msgstr "-s 选椤瑰凡缙瀹šæµ£†æ˜ô•¨ô•§äº’å诲ˆç¼‚虹œç‘™„则"
#: main.c:236
msgid "Can't use -+ with -l option"
-msgstr ""
+msgstr "无娉•ç† -+ 涓Ž -l 选椤瑰…垌浣跨”¨"
#: main.c:239
msgid "Can't use -f or -F with -l option"
-msgstr ""
+msgstr "无娉•ç† -f 或 -F 涓Ž -l 选椤瑰…垌浣跨”¨"
#: main.c:243
msgid "Can't use --reentrant or --bison-bridge with -l option"
-msgstr ""
+msgstr "无娉•ç† --reentrant 或 --bison-bridge 涓Ž -l 选椤瑰…垌浣跨”¨"
#: main.c:275
msgid "-Cf/-CF and -Cm don't make sense together"
-msgstr ""
+msgstr "-Cf/-CF å’Œ -Cm å…辩”ㄦ—朵¸å…蜂æ¢æµ£•æ„涔‰"
#: main.c:278
msgid "-Cf/-CF and -I are incompatible"
-msgstr ""
+msgstr "-Cf/-CF å’Œ -I æ˜ô•§¸å…ç…Žô“žçš„"
#: main.c:282
msgid "-Cf/-CF are incompatible with lex-compatibility mode"
-msgstr ""
+msgstr "-Cf/-CF 涓Ž lex å…ç…Žô“žå¦¯â€³¼æ˜ô•§¸å…ç…Žô“žçš„"
#: main.c:287
msgid "-Cf and -CF are mutually exclusive"
-msgstr ""
+msgstr "-Cf å’Œ -CF æ˜ô•§º’æ–ョš„"
#: main.c:291
msgid "Can't use -+ with -CF option"
-msgstr ""
+msgstr "无娉•ç† -+ 涓Ž -CF 选椤瑰…垌浣跨”¨"
#: main.c:294
#, c-format
msgid "%array incompatible with -+ option"
-msgstr ""
+msgstr "%array 涓Ž -+ 选椤逛¸å…ç…Žô“ž"
#: main.c:299
msgid "Options -+ and --reentrant are mutually exclusive."
-msgstr ""
+msgstr "选椤¹ -+ å’Œ --reentrant æ˜ô•§º’æ–ョš„。"
#: main.c:302
msgid "bison bridge not supported for the C++ scanner."
-msgstr ""
+msgstr "bison 妗ユŽãƒ¥™ã„¤¸å— C++ æ‰ô±ç»‹‹æ´æ”ô•©Œã€‚"
#: main.c:357 main.c:403
#, c-format
msgid "could not create %s"
-msgstr "ÎÞ·¨´´½¨ %s"
+msgstr "无娉•åˆ›å¯¤º %s"
#: main.c:416
-#, fuzzy
msgid "could not write tables header"
-msgstr "ÎÞ·¨´´½¨ %s"
+msgstr "无娉•å†™å…ヨ〃澶´"
#: main.c:420
#, c-format
msgid "can't open skeleton file %s"
-msgstr "ÎÞ·¨´ò¿ª¹Ç¼ÜÎļþ %s"
+msgstr "无娉•æ‰“寮€æ¥ ã„¦žèˆµ–‡æµ ¶ %s"
#: main.c:456
msgid "allocation of macro definition failed"
-msgstr ""
+msgstr "缙浜ˆç€¹ç€¹šæ¶”‰é…棰æ—è·ºã‘ç’¥"
#: main.c:504
#, c-format
msgid "input error reading skeleton file %s"
-msgstr "¶ÁÈ¡¹Ç¼ÜÎļþ %s ʱÊäÈë´íÎó"
+msgstr "璇诲–楠ㄦžèˆµ–‡æµ ¶ %s æ—惰¾“å…ラ”™ç’‡¯"
#: main.c:508
#, c-format
msgid "error closing skeleton file %s"
-msgstr "¹Ø±Õ¹Ç¼ÜÎļþ %s ³ö´í"
+msgstr "å…抽—ô’°ô•æžèˆµ–‡æµ ¶ %s å‡æ´ª”™"
#: main.c:693
#, c-format
msgid "error creating header file %s"
-msgstr "´´½¨Í·Îļþ %s ³ö´í"
+msgstr "创寤哄ã”文浠¶ %s å‡æ´ª”™"
#: main.c:701
#, c-format
msgid "error writing output file %s"
-msgstr "дÈëÊä³öÎļþ %s ³ö´í"
+msgstr "写å…ヨ¾“å‡çƒ˜–‡æµ ¶ %s å‡æ´ª”™"
#: main.c:705
#, c-format
msgid "error closing output file %s"
-msgstr "¹Ø±ÕÊä³öÎļþ %s ³ö´í"
+msgstr "å…抽—ô’¯¾“å‡çƒ˜–‡æµ ¶ %s å‡æ´ª”™"
#: main.c:709
#, c-format
msgid "error deleting output file %s"
-msgstr "ɾ³ýÊä³öÎļþ %s ³ö´í"
+msgstr "删é™ã‚ˆ¾“å‡çƒ˜–‡æµ ¶ %s å‡æ´ª”™"
+# See Concept Index. fr translation is wrong for that 'archive'.
#: main.c:716
#, c-format
msgid "No backing up.\n"
-msgstr ""
+msgstr "娌℃œ‰å›žå©§ô•¦€‚\n"
#: main.c:720
#, c-format
msgid "%d backing up (non-accepting) states.\n"
-msgstr ""
+msgstr "%d 回婧¯ (éžæŽãƒ¥—) çŠèˆµ€ã€‚\n"
#: main.c:724
#, c-format
msgid "Compressed tables always back up.\n"
-msgstr ""
+msgstr "压缂╄¿‡çš„ç›ã„¦ å…¼€è®³¼šè‡ôŽ’Šã„¥›žå©§ô•¦€‚\n"
#: main.c:727
#, c-format
msgid "error writing backup file %s"
-msgstr "дÈ뱸·ÝÎļþ %s ³ö´í"
+msgstr "写å…ュ›žå©§ô•©–‡æµ ¶ %s å‡æ´ª”™"
#: main.c:731
#, c-format
msgid "error closing backup file %s"
-msgstr "¹Ø±Õ±¸·ÝÎļþ %s ³ö´í"
+msgstr "å…抽—ô’¬›žå©§ô•©–‡æµ ¶ %s å‡æ´ª”™"
#: main.c:736
#, c-format
msgid "%s version %s usage statistics:\n"
-msgstr ""
+msgstr "%s 版本 %s ç”ㄦ³•ç¼Ÿç’★¼š\n"
#: main.c:739
#, c-format
msgid " scanner options: -"
-msgstr " ɨÃèÆ÷Ñ¡Ï-"
+msgstr " æ‰ô±å™ã„©€‰æ¤¤ç™¸¼š-"
#: main.c:818
#, c-format
msgid " %d/%d NFA states\n"
-msgstr ""
+msgstr " %d/%d NFA çŠèˆµ€\n"
#: main.c:820
#, c-format
msgid " %d/%d DFA states (%d words)\n"
-msgstr ""
+msgstr " %d/%d DFA çŠèˆµ€ (%d 涓ôŽ’­—ç’‡)\n"
#: main.c:822
#, c-format
msgid " %d rules\n"
-msgstr " %d Ìõ¹æÔò\n"
+msgstr " %d 椧„则\n"
#: main.c:827
#, c-format
msgid " No backing up\n"
-msgstr ""
+msgstr " 娌℃œ‰å›žå©§¯\n"
#: main.c:831
#, c-format
msgid " %d backing-up (non-accepting) states\n"
-msgstr ""
+msgstr " %d 回婧¯ (éžæŽãƒ¥—) çŠèˆµ€\n"
#: main.c:836
#, c-format
msgid " Compressed tables always back-up\n"
-msgstr ""
+msgstr " 压缂╄¿‡çš„ç›ã„¦ å…¼€è®³¼šè‡ôŽ’Šã„¥›žå©§¯\n"
#: main.c:840
#, c-format
msgid " Beginning-of-line patterns used\n"
-msgstr ""
+msgstr " 列棣–寮æ å³°å‡¡æµ£è·¨”¨\n"
#: main.c:842
#, c-format
msgid " %d/%d start conditions\n"
-msgstr ""
+msgstr " %d/%d 璧峰§‹æ′欢\n"
#: main.c:846
#, c-format
msgid " %d epsilon states, %d double epsilon states\n"
-msgstr ""
+msgstr " %d 蔚çŠèˆµ€é”›Œ%d åŒå€è”šçŠèˆµ€\n"
#: main.c:850
#, c-format
msgid " no character classes\n"
-msgstr ""
+msgstr " 无瀛—ç»—ôˆœè¢«åˆ«\n"
#: main.c:854
#, c-format
msgid " %d/%d character classes needed %d/%d words of storage, %d reused\n"
-msgstr ""
+msgstr " %d/%d 瀛—ç»—ôˆœè¢«åˆô±‰€éœ€ %d/%d 瀛—璇的淇瀛˜æµ£“é”›Œ%d é‡æ–é¢å¨‡ç”¨\n"
#: main.c:859
#, c-format
msgid " %d state/nextstate pairs created\n"
-msgstr ""
+msgstr " %d çŠèˆµ€/涓‹æ¶“€çŠèˆµ€ç€µç‘°å‡¡åˆ›å¯¤º\n"
#: main.c:862
#, c-format
msgid " %d/%d unique/duplicate transitions\n"
-msgstr ""
+msgstr " %d/%d ç‹ô‘¸€/é‡æ¾¶æžô‘¢\n"
#: main.c:867
#, c-format
msgid " %d table entries\n"
-msgstr ""
+msgstr " %d ç›ã„¦ å¥¸ã€ç›®\n"
#: main.c:875
#, c-format
msgid " %d/%d base-def entries created\n"
-msgstr ""
+msgstr " %d/%d base-def 椤圭›ô”Šå‡¡åˆ›å¯¤º\n"
#: main.c:879
#, c-format
msgid " %d/%d (peak %d) nxt-chk entries created\n"
-msgstr ""
+msgstr " %d/%d (宄激¼ %d) nxt-chk 椤圭›ô”Šå‡¡åˆ›å¯¤º\n"
#: main.c:883
#, c-format
msgid " %d/%d (peak %d) template nxt-chk entries created\n"
-msgstr ""
+msgstr " %d/%d (宄激¼ %d) 妯℃¿ nxt-chk 椤圭›ô”Šå‡¡åˆ›å¯¤º\n"
#: main.c:887
#, c-format
msgid " %d empty table entries\n"
-msgstr ""
+msgstr " %d 娓…绌鸿〃æ å¥¸ã€ç›®\n"
#: main.c:889
#, c-format
msgid " %d protos created\n"
-msgstr ""
+msgstr " %d 原型宸撈›å¯¤º\n"
#: main.c:892
#, c-format
msgid " %d templates created, %d uses\n"
-msgstr ""
+msgstr " %d 范æœô‘Žå‡¡åˆ›å¯¤çŒ´¼Œ%d 浣跨”¨\n"
#: main.c:900
#, c-format
msgid " %d/%d equivalence classes created\n"
-msgstr ""
+msgstr " %d/%d ç»›‰æµ é£Žè¢«åˆô°å‡¡åˆ›å¯¤º\n"
#: main.c:908
#, c-format
msgid " %d/%d meta-equivalence classes created\n"
-msgstr ""
+msgstr " %d/%d åŽç’剧­‰æµ é£Žè¢«åˆô°å‡¡åˆ›å¯¤º\n"
#: main.c:914
#, c-format
msgid " %d (%d saved) hash collisions, %d DFAs equal\n"
-msgstr ""
+msgstr " %d (%d 宸蹭¿ç€›˜) 哈甯Œçº°ç‰ˆ’žé”›Œ%d DFAs ç›å“¥­‰\n"
#: main.c:916
#, c-format
msgid " %d sets of reallocations needed\n"
-msgstr ""
+msgstr " 需瑕 %d 缄é‡æ–ä¼´…缃®\n"
#: main.c:918
#, c-format
msgid " %d total table entries needed\n"
-msgstr ""
+msgstr " æ€æ˜ô“†éœ€ç‘• %d ç›ã„¦ å¥¸ã€ç›®\n"
#: main.c:995
#, c-format
msgid "Internal error. flexopts are malformed.\n"
-msgstr ""
+msgstr "内éƒã„©”™ç’‡ô•¦€‚flexopts 功èƒè—‰¼‚甯枀‚\n"
#: main.c:1005
#, c-format
msgid "Try `%s --help' for more information.\n"
-msgstr ""
+msgstr "çç’‡•ã€Œ%s --helpã€æµ ãƒ¨Žå³°¾—æ›æ‘¤šæ·‡â„ƒô•¦€‚\n"
#: main.c:1062
#, c-format
msgid "unknown -C option '%c'"
-msgstr "δ֪µÄ -C Ñ¡Ïî¡°%c¡±"
+msgstr "æœôŽ”Ÿãƒ§š„ -C 选椤光€œ%câ€"
#: main.c:1191
#, c-format
@@ -456,72 +459,70 @@ msgstr "%s %s\n"
#: main.c:1466
msgid "fatal parse error"
-msgstr "ÖÂÃüµÄ½âÎö´íÎó"
+msgstr "è‡æ‘‘ç•Œš„瑙fžé”™ç’‡¯"
#: main.c:1498
#, c-format
msgid "could not create backing-up info file %s"
-msgstr ""
+msgstr "无娉•åˆ›å¯¤å“„›žå©§ô•§ä¿Šæô•©–‡æµ ¶ %s"
#: main.c:1519
#, c-format
msgid "-l AT&T lex compatibility option entails a large performance penalty\n"
-msgstr ""
+msgstr "-l AT&T lex å…ç…Žô“žæ€Ñ‡€‰æ¤¤é€›¼šç€µè‰°‡æ‘ã‡éªž…æ€Ñ†ƒè—‰‡é€€\n"
#: main.c:1522
#, c-format
msgid " and may be the actual source of other reported performance penalties\n"
-msgstr ""
+msgstr " åŒæ—朵¹Ÿç’å‘Š˜ô•¨…朵»–回æŠãƒ¦€Ñ†ƒè—‰‡é€€çš„瀹žé™…æユº\n"
#: main.c:1528
#, c-format
-msgid ""
-"%%option yylineno entails a performance penalty ONLY on rules that can match "
-"newline characters\n"
-msgstr ""
+msgid "%%option yylineno entails a performance penalty ONLY on rules that can match newline characters\n"
+msgstr "%%option yylineno 瀵艰‡å­˜€Ñ†ƒè—‰‡é€€é”›ŒåôŽ“œ‰è¤°“璇ヨ§„则璇ュ诲ˆæ–濈—瀛—ç»—ôˆ›—舵‰æµ¼š\n"
#: main.c:1535
#, c-format
msgid "-I (interactive) entails a minor performance penalty\n"
-msgstr ""
+msgstr "-I (浜やº’寮) 瀵艰‡æ‘°éªž…æ€Ñ†ƒè—‰‡é€€\n"
#: main.c:1540
#, c-format
msgid "yymore() entails a minor performance penalty\n"
-msgstr ""
+msgstr "yymore() 瀵艰‡æ‘°éªž…æ€Ñ†ƒè—‰‡é€€\n"
#: main.c:1546
#, c-format
msgid "REJECT entails a large performance penalty\n"
-msgstr ""
+msgstr "REJECT 瀵艰‡æ‘ã‡éªž…æ€Ñ†ƒè—‰‡é€€\n"
#: main.c:1551
#, c-format
msgid "Variable trailing context rules entail a large performance penalty\n"
-msgstr ""
+msgstr "å˜é‡æœô°ç†¬æ¶“Šæ¶“‹æ–‡ç‘™„则瀵艰‡æ‘ã‡éªž…æ€Ñ†ƒè—‰‡é€€\n"
#: main.c:1563
msgid "REJECT cannot be used with -f or -F"
-msgstr ""
+msgstr "REJECT 无娉•æ¶“Ž -f 或 -F å…垌浣跨”¨"
#: main.c:1566
#, c-format
msgid "%option yylineno cannot be used with REJECT"
-msgstr ""
+msgstr "%option yylineno 无娉•æ¶“Ž REJECT å…垌浣跨”¨"
#: main.c:1569
msgid "variable trailing context rules cannot be used with -f or -F"
-msgstr ""
+msgstr "å˜é‡æœô°ç†¬æ¶“Šæ¶“‹æ–‡ç‘™„则无娉•æ¶“Ž -f 或 -F å…垌浣跨”¨"
#: main.c:1692
#, c-format
msgid "%option yyclass only meaningful for C++ scanners"
-msgstr ""
+msgstr "%option yyclass åôŽ’ô”¼æµœŽ C++ æ‰ô±ç»‹‹æ´æœ‰æ„涔‰"
#: main.c:1799
#, c-format
msgid "Usage: %s [OPTIONS] [FILE]...\n"
-msgstr "Ó÷¨£º%s [Ñ¡Ïî] [Îļþ]...\n"
+msgstr "ç”ㄦ³•é”›š%s [选椤¹] [文浠¶]...\n"
#: main.c:1802
#, c-format
@@ -553,8 +554,7 @@ msgid ""
" -S, --skel=FILE specify skeleton file\n"
" -t, --stdout write scanner on stdout instead of %s\n"
" --yyclass=NAME name of C++ class\n"
-" --header-file=FILE create a C header file in addition to the "
-"scanner\n"
+" --header-file=FILE create a C header file in addition to the scanner\n"
" --tables-file[=FILE] write tables to FILE\n"
"\n"
"Scanner behavior:\n"
@@ -588,50 +588,110 @@ msgid ""
" -h, --help produce this help message\n"
" -V, --version report %s version\n"
msgstr ""
+"浜х”Ÿèƒè—‰¤Ÿæ è§„ô”‹–‡æœô‘‘¿›ç›Œå¯®æ å³°Œå½’…的绋‹æ´ã€‚\n"
+"\n"
+"ç›ã„¦ ç…ŽŽ‹ç¼‚â•‹¼š\n"
+" -Caé”›Œ--align æ㈡Ž‰æˆƒæ¾¶Ñ†ã€ƒæ é—´äº’èŽå³°–戃浣冲†…瀛˜ç€µé€›½\n"
+" -Ceé”›Œ--ecs 寤烘ž„ç»›‰æµ é£Žè¢«åˆ«\n"
+" -Cf 涓压缂╄〃æ ç¡·¼›æµ£è·¨”¨ -f ç›ã„§ãšå¨‰•\n"
+" -CF 涓压缂╄〃æ ç¡·¼›æµ£è·¨”¨ -F ç›ã„§ãšå¨‰•\n"
+" -Cmé”›Œ--meta-ecs 构造åŽç’剧­‰æµ é£Žè¢«åˆ«\n"
+" -Cré”›Œ--read 浣跨”¨ read() 浠ヤ唬替 stdio ç”ㄤºŽæ‰ô±ç»‹‹æ´çš„戓入\n"
+" -f, --full 浜х”Ÿè¹‡ô´€Ÿé”›Œæ¾¶Ñƒž‹æ‰ô±ç»‹‹æ´ã€‚æ¿¡‚åŒ -Cfr\n"
+" -F, --fast 浣跨”ㄤ氦æ›èƒ¯ã€ƒæ è‰°ã€ƒç»€çƒ˜³•ã€‚æ¿¡‚åŒ -CFr\n"
+" -Cem 缂虹œåŽ‹ç¼‚© (æ¿¡‚åŒ --ecs --meta-ecs)\n"
+"\n"
+"ç’‹ƒç’‡•é”›š\n"
+" -d, --debug åœã„¦‰ô±ç»‹‹æ´æ¶“ô’¬ô•ª”ã„©™ã‚‰”™å¦¯â€³¼\n"
+" -b, --backup 写å…ュ›žå©§ô•§ä¿Šæô•¨ˆ° %s\n"
+" -p, --perf-report ç†æ€Ñ†ƒèŠ¥Šãƒ¥‘Šå†™å…ユ ‡å‡†å‹˜ç’‡¯\n"
+" -s, --nodefault 抑åˆå‰å·±çœç‘™„则浠ュ›žæ´”涓绗ôˆšˆçš„文本\n"
+" -T, --trace %s 洔璇ュœã„¨æ‹·éŸªôŽ“Ä寮涓ô’¯¿ç›Œ\n"
+" -w, --nowarn 涓浜х”Ÿç’€ôˆš‘Š\n"
+" -v, --verbose ç†å§’‚ç‘•çš„æ‰ô±ç»‹‹æ´ç¼Ÿç’″†™å…ユ ‡å‡†æˆ“出\n"
+"\n"
+"文浠讹¼š\n"
+" -o, --outfile=文浠¶ 指瀹šæˆ“å‡çƒ˜–‡æµ è·º\n"
+" -S, --skel=文浠¶ 指瀹šæžèˆµž„文浠¶\n"
+" -t, --stdout ç†æ‰ô±ç»‹‹æ´å†™å…ユ ‡å‡†æˆ“å‡è½°äº’浠f›¿ %s\n"
+" --yyclass=å绉° C++ 绫诲ˆô²š„å绉°\n"
+" --header-file=文浠¶ æ‰ô±ç»‹‹æ´æ¶”‹æ¾¶–创寤º C 标澶存。\n"
+" --tables-file[=文浠¶] ç†ç›ã„¦ ç…Ž†™å…ユ–‡æµ ¶\n"
+"\n"
+"æ‰ô±ç»‹‹æ´ç›Œæ¶“猴¼š\n"
+" -7, --7bit 浜х”Ÿæ¶“ƒå§£”ç‰è§„‰ô±ç»‹‹æ´\n"
+" -8, --8bit 浜х”Ÿå…ô±¯”ç‰è§„‰ô±ç»‹‹æ´\n"
+" -B, --batch 浜х”Ÿæ‰è§„ôŠæ‰ô±ç»‹‹æ´ (ç›ç¨¿ô”¼æµœŽ -I)\n"
+" -i, --case-insensitive 蹇界•ãƒ¥¼æ èœ‚腑的澶у°å†™\n"
+" -l, --lex-compat 涓ŽåŽŸæ¿®‹ lex 最澶у…ç…Žô“ž\n"
+" -X, --posix-compat 涓Ž POSIX lex 最澶у…ç…Žô“ž\n"
+" -I, --interactive 浜х”Ÿæµœã‚„º’寮æ‰ô±ç»‹‹æ´ (ç›ç¨¿ô”¼æµœŽ -B)\n"
+" --yylineno 在 yylineno 涓ô’¯ô“†æ•æ‹Œå»ºåˆ—\n"
+"\n"
+"浜х”Ÿçš„缂–ç é”›š\n"
+" -+, --c++ 浜х”Ÿ C++ æ‰ô±ç»‹‹æ´ç»«è¯²ˆ«\n"
+" -Dmacro [=defn] #define 瀹 defn (缂虹œ defn 涓撀Œ1ã€)\n"
+" -L, --noline åœã„¦‰ô±ç»‹‹æ´æ¶“ô’­Š‘制 # 列指浠¤\n"
+" -P, --prefix=瀛—涓² 浣跨”ã„¥­—涓蹭½œæ¶“å“„‰ç¼‚€æµ ãƒ¤å”¬æ›è£¤€Œyyã€\n"
+" -R, --reentrant 浜х”Ÿé‡æ–æ‹Œ¿›å…¥ C æ‰ô±ç»‹‹æ´\n"
+" --bison-bridge æ‰ô±ç»‹‹æ´ç”ㄤºŽ bison pure 剖æžå™ã„£€‚\n"
+" --bison-locations åŒ…å« yylloc æ”ô•©Œã€‚\n"
+" --stdinit åˆæ¿®‹åŒ– yyin/yyout åˆç‰ˆ ‡å‡†æˆ“å…¥/标准戓出\n"
+" --noansi-definitions æ—у¼å‡èŠ¥•æ¿®šæ¶”‰\n"
+" --noansi-prototypes åœã„¥ŽŸåž‹æ¶“ô’­¸…绌哄‚æ•ç‰ˆ¸…å•\n"
+" --nounistd æ¶“åŒ…å« <unistd.h>\n"
+" --noFUNCTION 涓浜х”Ÿç‰ç‘°®šå‡èŠ¥•°\n"
+"\n"
+"æ‚椤癸¼š\n"
+" -c do-nothing POSIX 选椤¹\n"
+" -n do-nothing POSIX 选椤¹\n"
+" -?\n"
+" -h, --help 浜х”Ÿæ©™æ¶“ôŽ•ô”·æ˜Žå¨‘ˆæ¯\n"
+" -V, --version æŠãƒ¥‘Š %s 版本\n"
#: misc.c:65
msgid "allocation of sko_stack failed"
-msgstr ""
+msgstr "缙浜ˆ sko_stack é…棰æ—è·ºã‘ç’¥"
#: misc.c:102 misc.c:128
#, c-format
msgid "name \"%s\" ridiculously long"
-msgstr ""
+msgstr "å绉般€Œ%sã€æœ‰è’ç’‹ô‘š„é•åž®å®³"
#: misc.c:177
msgid "memory allocation failed in allocate_array()"
-msgstr ""
+msgstr "在 allocatearray() 涓ô’¬†…瀛˜é…缃ô”Šã‘ç’¥"
#: misc.c:230
#, c-format
msgid "bad character '%s' detected in check_char()"
-msgstr ""
+msgstr "在 checkchar() 涓ô’«ç›å¨´‹åˆé¢¸è¤°“的瀛—ç»—ôˆ˜€Œ%sã€"
#: misc.c:235
#, c-format
msgid "scanner requires -8 flag to use the character %s"
-msgstr ""
+msgstr "æ‰ô±ç»‹‹æ´éœ€ç‘• -8 旗标浠ヤ娇ç”ã„¥­—ç»—¦ %s"
#: misc.c:268
msgid "dynamic memory failure in copy_string()"
-msgstr ""
+msgstr "在 copystring() 涓ô’¬Šã„¦€å†…瀛˜æ¾¶è¾«è§¦"
#: misc.c:367
#, c-format
msgid "%s: fatal internal error, %s\n"
-msgstr ""
+msgstr "%sé”›šæ¶“ラ‡å†…éƒã„©”™ç’‡ô•²¼Œ%s\n"
#: misc.c:803
msgid "attempt to increase array size failed"
-msgstr "ÊÔͼÔö¼ÓÊý×é´óСʱʧ°Ü"
+msgstr "ç’‡•å›æƒ§¢žåŠ æ•æ‰®»„澶у°æ—è·ºã‘ç’¥"
#: misc.c:930
msgid "bad line in skeleton file"
-msgstr "¹Ç¼ÜÎļþÖдíÎóµÄÐÐ"
+msgstr "楠ㄦžèˆµ–‡æµ æœµè…‘错璇ô•ªš„盌"
#: misc.c:979
msgid "memory allocation failed in yy_flex_xmalloc()"
-msgstr "ÔÚ yy_flex_xmalloc() ÖеÄÄÚ´æ·ÖÅäʧ°Ü"
+msgstr "在 yy_flex_xmalloc() 涓ô’®š„内瀛˜åˆ†é…澶辫触"
#: nfa.c:104
#, c-format
@@ -642,235 +702,234 @@ msgid ""
msgstr ""
"\n"
"\n"
-"********** ¿ªÊ¼Êä³öÆðʼ״̬Ϊ %d µÄ NFA\n"
+"********** 寮€æ¿®‹æˆ“å‡é¸¿æ£æ¿®‹çŠèˆµ€æ¶“º %d çš„ NFA\n"
#: nfa.c:115
#, c-format
msgid "state # %4d\t"
-msgstr "״̬ # %4d\t"
+msgstr "çŠèˆµ€ # %4d\t"
#: nfa.c:130
#, c-format
msgid "********** end of dump\n"
-msgstr "********** Êä³ö½áÊø\n"
+msgstr "********** 戓å‡è™¹»“æŸ\n"
#: nfa.c:174
msgid "empty machine in dupmachine()"
-msgstr ""
+msgstr "在 dupmachine() 涓ô’­¸…绌烘œå“„™¨"
#: nfa.c:240
#, c-format
msgid "Variable trailing context rule at line %d\n"
-msgstr ""
+msgstr "å˜é‡æœô°ç†¬æ¶“Šæ¶“‹æ–‡ç‘™„则浜Žåˆ— %d\n"
#: nfa.c:364
msgid "bad state type in mark_beginning_as_normal()"
-msgstr ""
+msgstr "在 mark_beginning_as_normal() 涓ô’­œ‰æ¶“褰“çš„çŠèˆµ€æˆ“å…¥"
#: nfa.c:609
#, c-format
msgid "input rules are too complicated (>= %d NFA states)"
-msgstr ""
+msgstr "戓å…ヨ§„则澶ôŽ’¤æ‚ (>= %d NFA çŠèˆµ€)"
#: nfa.c:688
msgid "found too many transitions in mkxtion()"
-msgstr ""
+msgstr "在 mkxtion() 涓ô’­‰æƒ§ˆæ¿ãŠæ¾¶šæžô‘¢"
#: nfa.c:714
#, c-format
msgid "too many rules (> %d)!"
-msgstr "¹æÔò¹ý¶à (> %d)£¡"
+msgstr "ç‘™„则橇澶š (> %d)é”›"
#: parse.y:159
msgid "unknown error processing section 1"
-msgstr "δ֪µÄ´íÎó´¦Àí½Ú 1"
+msgstr "æœôŽ”Ÿãƒ§š„错璇ô•¨¤„ç†èŠ‚ 1"
#: parse.y:184 parse.y:351
msgid "bad start condition list"
-msgstr "´íÎóµÄÆðʼ״̬Áбí"
+msgstr "错璇ô•ªš„璧峰§‹çŠèˆµ€åˆ—盨"
#: parse.y:315
msgid "unrecognized rule"
-msgstr "²»ÄÜʶ±ðµÄ¹æÔò"
+msgstr "涓èƒå€Ÿ¯†åˆô²š„ç‘™„则"
#: parse.y:434 parse.y:447 parse.y:516
msgid "trailing context used twice"
-msgstr ""
+msgstr "æœô°ç†¬æ¶“Šæ¶“‹æ–‡å®¸è¹­å¨‡ç”ㄤ袱娆¡"
#: parse.y:552 parse.y:562 parse.y:635 parse.y:645
msgid "bad iteration values"
-msgstr ""
+msgstr "涓褰“çš„æ©ô’«å”¬å€¼"
#: parse.y:580 parse.y:598 parse.y:663 parse.y:681
msgid "iteration value must be positive"
-msgstr ""
+msgstr "æ©ô’«å”¬å€ç…Ž¿…椤绘˜ô•©ô‘ªå€¼"
#: parse.y:804 parse.y:814
#, c-format
msgid "the character range [%c-%c] is ambiguous in a case-insensitive scanner"
-msgstr ""
+msgstr "åœã„¥ã‡ç写涓椤褛哥ôçš„æ‰ô±ç»‹‹æ´æ¶“ô’¶¼Œç€›—ç»—ôˆŒƒå›´ [%c-%c] æ˜ô•©Ä妫å˜è¢±åô•ªš„"
#: parse.y:819
msgid "negative range in character class"
-msgstr ""
+msgstr "åœã„¥­—ç»—ôˆœè¢«åˆô¯è…‘有璟å€è‰°Œƒå›´"
#: parse.y:916
msgid "[:^lower:] is ambiguous in case insensitive scanner"
-msgstr ""
+msgstr "åœã„¥ã‡ç写涓椤褛哥ôçš„æ‰ô±ç»‹‹æ´æ¶“ô’¶¼Œ[:^lower:] æ˜ô•©Ä妫å˜è¢±åô•ªš„"
#: parse.y:922
msgid "[:^upper:] ambiguous in case insensitive scanner"
-msgstr ""
+msgstr "åœã„¥ã‡ç写涓椤褛哥ôçš„æ‰ô±ç»‹‹æ´æ¶“ô’¶¼Œ[:^upper:] æ˜ô•©Ä妫å˜è¢±åô•ªš„"
#: scan.l:75 scan.l:618 scan.l:676
msgid "Input line too long\n"
-msgstr ""
+msgstr "戓å…ュˆ—澶ôŽ–•¿\n"
#: scan.l:161
#, c-format
msgid "malformed '%top' directive"
-msgstr ""
+msgstr "寮‚甯哥š„「%topã€æŒ‡æµ ¤"
#: scan.l:183
#, no-c-format
msgid "unrecognized '%' directive"
-msgstr ""
+msgstr "无娉•æˆã„¨¯†çš„「%ã€æŒ‡æµ ¤"
#: scan.l:192
msgid "Definition name too long\n"
-msgstr ""
+msgstr "瀹šæ¶”‰å绉æ¿ãŠé•¿\n"
#: scan.l:284
msgid "Unmatched '{'"
-msgstr ""
+msgstr "涓æˆç€µåœ­š„「{ã€"
#: scan.l:300
#, c-format
msgid "Definition value for {%s} too long\n"
-msgstr ""
+msgstr "{%s} 的瀹šæ¶”‰å€ç…ŽãŠé•¿\n"
#: scan.l:317
msgid "incomplete name definition"
-msgstr "²»ÍêÕûµÄÃû³Æ¶¨Òå"
+msgstr "涓瀹Œæ•å¯¸š„å绉濮šæ¶”‰"
#: scan.l:443
msgid "Option line too long\n"
-msgstr ""
+msgstr "选椤瑰ˆ—澶ôŽ–•¿\n"
#: scan.l:451
#, c-format
msgid "unrecognized %%option: %s"
-msgstr "²»ÄÜʶ±ðµÄ %%Ñ¡Ï%s"
+msgstr "涓èƒå€Ÿ¯†åˆô²š„ %%选椤癸¼š%s"
#: scan.l:633 scan.l:800
msgid "bad character class"
-msgstr "´íÎóµÄ×Ö·ûÀà±ð"
+msgstr "错璇ô•ªš„瀛—ç»—ôˆœè¢«åˆ«"
#: scan.l:683
#, c-format
msgid "undefined definition {%s}"
-msgstr "䶨ÒåµÄ¶¨Òå {%s}"
+msgstr "æœôŽ’®šæ¶”‰çš„瀹šæ¶”‰ {%s}"
#: scan.l:755
#, c-format
msgid "bad <start condition>: %s"
-msgstr "´íÎó <ÆðʼÌõ¼þ>£º%s"
+msgstr "错璇¯ <璧峰§‹æ′欢>é”›š%s"
#: scan.l:768
msgid "missing quote"
-msgstr "ÒÅ©ÒýºÅ"
+msgstr "é—婕寮•å·"
#: scan.l:834
#, c-format
msgid "bad character class expression: %s"
-msgstr "´íÎóµÄ×Ö·ûÀà±ð±í´ïʽ£º%s"
+msgstr "错璇ô•ªš„瀛—ç»—ôˆœè¢«åˆô³ã€ƒæˆæƒ§¼é”›š%s"
#: scan.l:856
msgid "bad character inside {}'s"
-msgstr ""
+msgstr "涓褰“瀛—ç»—ôˆ™ºŽ {} 内部"
#: scan.l:862
msgid "missing }"
-msgstr "ÒÅ© }"
+msgstr "é—å©• }"
#: scan.l:940
msgid "EOF encountered inside an action"
-msgstr "ÔÚ¶¯×÷ÖÐÎļþ½áÊø"
+msgstr "åœã„¥Šã„¤½œæ¶“ô’­–‡æµ å‰»“æŸ"
#: scan.l:945
-#, fuzzy
msgid "EOF encountered inside pattern"
-msgstr "ÔÚ¶¯×÷ÖÐÎļþ½áÊø"
+msgstr "åœã„¥¼æ èœ‚¹‹å†…é‡åˆç‰ˆ–‡æµ å‰»“æŸ"
#: scan.l:967
#, c-format
msgid "bad character: %s"
-msgstr "´íÎóµÄ×Ö·û£º%s"
+msgstr "错璇ô•ªš„瀛—ç»—ôˆ¤¼š%s"
#: scan.l:996
#, c-format
msgid "can't open %s"
-msgstr "ÎÞ·¨´ò¿ª %s"
+msgstr "无娉•æ‰“寮€ %s"
#: scanopt.c:291
#, c-format
msgid "Usage: %s [OPTIONS]...\n"
-msgstr "Ó÷¨£º%s [Ñ¡Ïî]...\n"
+msgstr "ç”ㄦ³•é”›š%s [选椤¹]...\n"
#: scanopt.c:564
#, c-format
msgid "option `%s' doesn't allow an argument\n"
-msgstr "Ñ¡Ïî¡°%s¡±²»½ÓÊܲÎÊý\n"
+msgstr "选椤光€œ%sâ€æ¶“æŽãƒ¥—å‚æ•°\n"
#: scanopt.c:569
#, c-format
msgid "option `%s' requires an argument\n"
-msgstr "Ñ¡Ïî¡°%s¡±ÐèÒªÒ»¸ö²ÎÊý\n"
+msgstr "选椤光€œ%sâ€éœ€ç‘•æ¶“€æ¶“ôŽ’‚æ•°\n"
#: scanopt.c:573
#, c-format
msgid "option `%s' is ambiguous\n"
-msgstr ""
+msgstr "选椤广€Œ%sã€æ˜ô•©Ä妫å˜è¢±åô•ªš„\n"
#: scanopt.c:577
#, c-format
msgid "Unrecognized option `%s'\n"
-msgstr "δ֪µÄÑ¡Ïî¡°%s¡±\n"
+msgstr "æœôŽ”Ÿãƒ§š„选椤光€œ%sâ€\n"
#: scanopt.c:581
#, c-format
msgid "Unknown error=(%d)\n"
-msgstr "δ֪´íÎó=(%d)\n"
+msgstr "æœôŽ”Ÿãƒ©”™ç’‡¯=(%d)\n"
#: sym.c:100
msgid "symbol table memory allocation failed"
-msgstr "·ûºÅ±íÄÚ´æ·ÖÅäʧ°Ü"
+msgstr "ç»—ôˆšç–¯ã€ƒå†…瀛˜åˆ†é…澶辫触"
#: sym.c:202
msgid "name defined twice"
-msgstr "Ãû³Æ¶¨ÒåÁËÁ½´Î"
+msgstr "å绉濮šæ¶”‰æµœ†æ¶“ゆôŠ"
#: sym.c:253
#, c-format
msgid "start condition %s declared twice"
-msgstr "ÆðʼÌõ¼þ %s ÉùÃ÷ÁËÁ½´Î"
+msgstr "璧峰§‹æ′欢 %s 澹版˜Žæµœ†æ¶“ゆôŠ"
#: yylex.c:56
msgid "premature EOF"
-msgstr ""
+msgstr "橇æ—╇虹Žç‰ˆ–‡æµ å‰»“ç¾"
#: yylex.c:198
#, c-format
msgid "End Marker\n"
-msgstr ""
+msgstr "缓æŸæ ‡è¹‡—\n"
#: yylex.c:204
#, c-format
msgid "*Something Weird* - tok: %d val: %d\n"
-msgstr ""
+msgstr "*情å†é›¾ˆæ€ôŽ’¼‚* - toké”›š%d valé”›š%d\n"
#~ msgid "consistency check failed in symfollowset"
-#~ msgstr "symfollowset ÖеÄÒ»ÖÂÐÔ¼ì²éʧ°Ü"
+#~ msgstr "symfollowset 涓ô’®š„涓€è‡å­˜€Ñ„£€æŸãƒ¥ã‘ç’¥"
#~ msgid "unknown -R option '%c'"
-#~ msgstr "δ֪µÄ -R Ñ¡Ïî¡°%c¡±"
+#~ msgstr "æœôŽ”Ÿãƒ§š„ -R 选椤光€œ%câ€"
diff --git a/po/zh_TW.po b/po/zh_TW.po
index 78c842a..522372d 100644
--- a/po/zh_TW.po
+++ b/po/zh_TW.po
@@ -1,14 +1,29 @@
-# Traditional Chinese Messages for flex.
-# Copyright (C) 2002 The Flex Project (msgids)
-# This file is distributed under the same license as the flex package.
-# Wang Li <charles@linux.net.cn>, 2002.
-# Wei-Lun Chao <bluebat@member.fsf.org>, 2009, 2013.
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR Free Software Foundation, Inc.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
+#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: flex 2.5.37\n"
-"Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2014-03-26 15:00-0400\n"
+"Project-Id-Version: PACKAGE VERSION\n"
+"PO-Revision-Date: 2016-01-22 13:28-0800\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#~ # Traditional Chinese Messages for flex.
+#~ # Copyright (C) 2002 The Flex Project (msgids)
+#~ # This file is distributed under the same license as the flex package.
+#~ # Wang Li <charles@linux.net.cn>, 2002.
+#~ # Wei-Lun Chao <bluebat@member.fsf.org>, 2009, 2013.
+#~ #
+#~ msgid ""
+#~ msgstr ""
+#~ "Project-Id-Version: flex 2.5.37\n"
+#~ "Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n"
+"POT-Creation-Date: 2012-07-22 20:48-0400\n"
"PO-Revision-Date: 2013-02-12 23:23+0800\n"
"Last-Translator: Wei-Lun Chao <bluebat@member.fsf.org>\n"
"Language-Team: Chinese (traditional) <zh-l10n@linux.org.tw>\n"
@@ -175,357 +190,355 @@ msgstr "無法寫入 eoltbl"
msgid "Could not write yynultrans_tbl"
msgstr "無法寫入 yynultrans_tbl"
-#: main.c:191
+#: main.c:189
msgid "rule cannot be matched"
msgstr "è¦å‰‡ç„¡æ³•å»åˆ"
-#: main.c:196
+#: main.c:194
msgid "-s option given but default rule can be matched"
msgstr "-s é¸é …已給定但是å¯ä»¥å»åˆé è¨­è¦å‰‡"
-#: main.c:236
+#: main.c:234
msgid "Can't use -+ with -l option"
msgstr "無法將 -+ 與 -l é¸é …å…±åŒä½¿ç”¨"
-#: main.c:239
+#: main.c:237
msgid "Can't use -f or -F with -l option"
msgstr "無法將 -f 或 -F 與 -l é¸é …å…±åŒä½¿ç”¨"
-#: main.c:243
+#: main.c:241
msgid "Can't use --reentrant or --bison-bridge with -l option"
msgstr "無法將 --reentrant 或 --bison-bridge 與 -l é¸é …å…±åŒä½¿ç”¨"
-#: main.c:275
+#: main.c:278
msgid "-Cf/-CF and -Cm don't make sense together"
msgstr "-Cf/-CF å’Œ -Cm 共用時ä¸å…·ä»»ä½•æ„義"
-#: main.c:278
+#: main.c:281
msgid "-Cf/-CF and -I are incompatible"
msgstr "-Cf/-CF å’Œ -I 是ä¸ç›¸å®¹çš„"
-#: main.c:282
+#: main.c:285
msgid "-Cf/-CF are incompatible with lex-compatibility mode"
msgstr "-Cf/-CF 與 lex 相容模å¼æ˜¯ä¸ç›¸å®¹çš„"
-#: main.c:287
+#: main.c:290
msgid "-Cf and -CF are mutually exclusive"
msgstr "-Cf 和 -CF 是互斥的"
-#: main.c:291
+#: main.c:294
msgid "Can't use -+ with -CF option"
msgstr "無法將 -+ 與 -CF é¸é …å…±åŒä½¿ç”¨"
-#: main.c:294
+#: main.c:297
#, c-format
msgid "%array incompatible with -+ option"
msgstr "%array 與 -+ é¸é …ä¸ç›¸å®¹"
-#: main.c:299
+#: main.c:302
msgid "Options -+ and --reentrant are mutually exclusive."
msgstr "é¸é … -+ å’Œ --reentrant 是互斥的。"
-#: main.c:302
+#: main.c:305
msgid "bison bridge not supported for the C++ scanner."
msgstr "bison 橋接器ä¸å— C++ 掃æ程å¼æ”¯æ´ã€‚"
-#: main.c:357 main.c:403
+#: main.c:360 main.c:406
#, c-format
msgid "could not create %s"
msgstr "無法建立 %s"
-#: main.c:416
+#: main.c:419
msgid "could not write tables header"
msgstr "無法寫入表頭"
-#: main.c:420
+#: main.c:423
#, c-format
msgid "can't open skeleton file %s"
msgstr "無法開啟架構檔案 %s"
-#: main.c:456
+#: main.c:459
msgid "allocation of macro definition failed"
msgstr "給予巨集定義é…é¡æ™‚失敗"
-#: main.c:504
+#: main.c:507
#, c-format
msgid "input error reading skeleton file %s"
msgstr "讀å–架構檔案 %s 時輸入錯誤"
-#: main.c:508
+#: main.c:511
#, c-format
msgid "error closing skeleton file %s"
msgstr "關閉架構檔案 %s 時發生錯誤"
-#: main.c:693
+#: main.c:696
#, c-format
msgid "error creating header file %s"
msgstr "建立標頭檔案 %s 時發生錯誤"
-#: main.c:701
+#: main.c:704
#, c-format
msgid "error writing output file %s"
msgstr "寫入輸出檔案 %s 時發生錯誤"
-#: main.c:705
+#: main.c:708
#, c-format
msgid "error closing output file %s"
msgstr "關閉輸出檔案 %s 時發生錯誤"
-#: main.c:709
+#: main.c:712
#, c-format
msgid "error deleting output file %s"
msgstr "刪除輸出檔案 %s 時發生錯誤"
-#: main.c:716
+#: main.c:719
#, c-format
msgid "No backing up.\n"
msgstr "沒有備份。\n"
-#: main.c:720
+#: main.c:723
#, c-format
msgid "%d backing up (non-accepting) states.\n"
msgstr "%d 備份 (éžæŽ¥å—) 狀態。\n"
-#: main.c:724
+#: main.c:727
#, c-format
msgid "Compressed tables always back up.\n"
msgstr "壓縮éŽçš„表格自動備份。\n"
-#: main.c:727
+#: main.c:730
#, c-format
msgid "error writing backup file %s"
msgstr "寫入備份檔案 %s 時發生錯誤"
-#: main.c:731
+#: main.c:734
#, c-format
msgid "error closing backup file %s"
msgstr "關閉備份檔案 %s 時發生錯誤"
-#: main.c:736
+#: main.c:739
#, c-format
msgid "%s version %s usage statistics:\n"
msgstr "%s 版本 %s 用法統計:\n"
-#: main.c:739
+#: main.c:742
#, c-format
msgid " scanner options: -"
msgstr " 掃æ程å¼é¸é …:-"
-#: main.c:818
+#: main.c:821
#, c-format
msgid " %d/%d NFA states\n"
msgstr " %d/%d NFA 狀態\n"
-#: main.c:820
+#: main.c:823
#, c-format
msgid " %d/%d DFA states (%d words)\n"
msgstr " %d/%d DFA 狀態 (%d 個字詞)\n"
-#: main.c:822
+#: main.c:825
#, c-format
msgid " %d rules\n"
msgstr " %d æ¢è¦å‰‡\n"
-#: main.c:827
+#: main.c:830
#, c-format
msgid " No backing up\n"
msgstr " 沒有備份\n"
-#: main.c:831
+#: main.c:834
#, c-format
msgid " %d backing-up (non-accepting) states\n"
msgstr " %d 備份 (éžæŽ¥å—) 狀態\n"
-#: main.c:836
+#: main.c:839
#, c-format
msgid " Compressed tables always back-up\n"
msgstr " 壓縮éŽçš„表格自動備份\n"
-#: main.c:840
+#: main.c:843
#, c-format
msgid " Beginning-of-line patterns used\n"
msgstr " 列首å¼æ¨£å·²ä½¿ç”¨\n"
-#: main.c:842
+#: main.c:845
#, c-format
msgid " %d/%d start conditions\n"
msgstr " %d/%d 起始æ¢ä»¶\n"
-#: main.c:846
+#: main.c:849
#, c-format
msgid " %d epsilon states, %d double epsilon states\n"
msgstr " %d ε狀態,%d é›™å€Îµç‹€æ…‹\n"
-#: main.c:850
+#: main.c:853
#, c-format
msgid " no character classes\n"
msgstr " 無字元類別\n"
-#: main.c:854
+#: main.c:857
#, c-format
msgid " %d/%d character classes needed %d/%d words of storage, %d reused\n"
msgstr " %d/%d 字元類別所需 %d/%d 字詞的儲存體,%d é‡æ–°ä½¿ç”¨\n"
-#: main.c:859
+#: main.c:862
#, c-format
msgid " %d state/nextstate pairs created\n"
msgstr " %d 狀態/下一狀態å°å·²å»ºç«‹\n"
-#: main.c:862
+#: main.c:865
#, c-format
msgid " %d/%d unique/duplicate transitions\n"
msgstr " %d/%d ç¨ä¸€/é‡è¤‡è½‰æ›\n"
-#: main.c:867
+#: main.c:870
#, c-format
msgid " %d table entries\n"
msgstr " %d 表格項目\n"
-#: main.c:875
+#: main.c:878
#, c-format
msgid " %d/%d base-def entries created\n"
msgstr " %d/%d base-def 項目已建立\n"
-#: main.c:879
+#: main.c:882
#, c-format
msgid " %d/%d (peak %d) nxt-chk entries created\n"
msgstr " %d/%d (尖峰 %d) nxt-chk 項目已建立\n"
-#: main.c:883
+#: main.c:886
#, c-format
msgid " %d/%d (peak %d) template nxt-chk entries created\n"
msgstr " %d/%d (å°–å³° %d) æ¨¡æ¿ nxt-chk 項目已建立\n"
-#: main.c:887
+#: main.c:890
#, c-format
msgid " %d empty table entries\n"
msgstr " %d 清空表格項目\n"
-#: main.c:889
+#: main.c:892
#, c-format
msgid " %d protos created\n"
msgstr " %d 原型已建立\n"
-#: main.c:892
+#: main.c:895
#, c-format
msgid " %d templates created, %d uses\n"
msgstr " %d 範本已建立,%d 使用\n"
-#: main.c:900
+#: main.c:903
#, c-format
msgid " %d/%d equivalence classes created\n"
msgstr " %d/%d 等價類別已建立\n"
-#: main.c:908
+#: main.c:911
#, c-format
msgid " %d/%d meta-equivalence classes created\n"
msgstr " %d/%d 後設等價類別已建立\n"
-#: main.c:914
+#: main.c:917
#, c-format
msgid " %d (%d saved) hash collisions, %d DFAs equal\n"
msgstr " %d (%d 已儲存) 雜湊碰撞,%d DFAs 相等\n"
-#: main.c:916
+#: main.c:919
#, c-format
msgid " %d sets of reallocations needed\n"
msgstr " éœ€è¦ %d 組é‡æ–°é…ç½®\n"
-#: main.c:918
+#: main.c:921
#, c-format
msgid " %d total table entries needed\n"
msgstr " ç¸½è¨ˆéœ€è¦ %d 表格項目\n"
-#: main.c:995
+#: main.c:998
#, c-format
msgid "Internal error. flexopts are malformed.\n"
msgstr "內部錯誤。flexopts 功能異常。\n"
-#: main.c:1005
+#: main.c:1008
#, c-format
msgid "Try `%s --help' for more information.\n"
msgstr "嘗試「%s --helpã€ä»¥ç²å¾—更多資訊。\n"
-#: main.c:1062
+#: main.c:1065
#, c-format
msgid "unknown -C option '%c'"
msgstr "ä¸æ˜Ž -C é¸é …「%cã€"
-#: main.c:1191
+#: main.c:1194
#, c-format
msgid "%s %s\n"
msgstr "%s %s\n"
-#: main.c:1466
+#: main.c:1469
msgid "fatal parse error"
msgstr "åš´é‡çš„解æžéŒ¯èª¤"
-#: main.c:1498
+#: main.c:1501
#, c-format
msgid "could not create backing-up info file %s"
msgstr "無法建立備份資訊檔案 %s"
-#: main.c:1519
+#: main.c:1522
#, c-format
msgid "-l AT&T lex compatibility option entails a large performance penalty\n"
msgstr "-l AT&T lex 相容性é¸é …會導致大幅效能減退\n"
-#: main.c:1522
+#: main.c:1525
#, c-format
msgid " and may be the actual source of other reported performance penalties\n"
msgstr " åŒæ™‚也許是其他回報效能減退的實際來æº\n"
-#: main.c:1528
+#: main.c:1531
#, c-format
-msgid ""
-"%%option yylineno entails a performance penalty ONLY on rules that can match "
-"newline characters\n"
+msgid "%%option yylineno entails a performance penalty ONLY on rules that can match newline characters\n"
msgstr "%%option yylineno 導致效能減退,åªæœ‰ç•¶è©²è¦å‰‡è©²å»åˆæ–°åˆ—字元時æ‰æœƒ\n"
-#: main.c:1535
+#: main.c:1538
#, c-format
msgid "-I (interactive) entails a minor performance penalty\n"
msgstr "-I (互動å¼) 導致å°å¹…效能減退\n"
-#: main.c:1540
+#: main.c:1543
#, c-format
msgid "yymore() entails a minor performance penalty\n"
msgstr "yymore() 導致å°å¹…效能減退\n"
-#: main.c:1546
+#: main.c:1549
#, c-format
msgid "REJECT entails a large performance penalty\n"
msgstr "REJECT 導致大幅效能減退\n"
-#: main.c:1551
+#: main.c:1554
#, c-format
msgid "Variable trailing context rules entail a large performance penalty\n"
msgstr "變數末尾內文è¦å‰‡å°Žè‡´å¤§å¹…效能減退\n"
-#: main.c:1563
+#: main.c:1566
msgid "REJECT cannot be used with -f or -F"
msgstr "REJECT 無法與 -f 或 -F å…±åŒä½¿ç”¨"
-#: main.c:1566
+#: main.c:1569
#, c-format
msgid "%option yylineno cannot be used with REJECT"
msgstr "%option yylineno 無法與 REJECT å…±åŒä½¿ç”¨"
-#: main.c:1569
+#: main.c:1572
msgid "variable trailing context rules cannot be used with -f or -F"
msgstr "變數末尾內文è¦å‰‡ç„¡æ³•èˆ‡ -f 或 -F å…±åŒä½¿ç”¨"
-#: main.c:1692
+#: main.c:1695
#, c-format
msgid "%option yyclass only meaningful for C++ scanners"
msgstr "%option yyclass åªå°æ–¼ C++ 掃æ程å¼æœ‰æ„義"
-#: main.c:1799
+#: main.c:1802
#, c-format
msgid "Usage: %s [OPTIONS] [FILE]...\n"
msgstr "用法:%s [é¸é …] [檔案]…\n"
-#: main.c:1802
+#: main.c:1805
#, c-format
msgid ""
"Generates programs that perform pattern-matching on text.\n"
@@ -555,8 +568,7 @@ msgid ""
" -S, --skel=FILE specify skeleton file\n"
" -t, --stdout write scanner on stdout instead of %s\n"
" --yyclass=NAME name of C++ class\n"
-" --header-file=FILE create a C header file in addition to the "
-"scanner\n"
+" --header-file=FILE create a C header file in addition to the scanner\n"
" --tables-file[=FILE] write tables to FILE\n"
"\n"
"Scanner behavior:\n"
@@ -725,20 +737,20 @@ msgstr "在 dupmachine() 中清空機器"
msgid "Variable trailing context rule at line %d\n"
msgstr "變數末尾內文è¦å‰‡æ–¼åˆ— %d\n"
-#: nfa.c:364
+#: nfa.c:353
msgid "bad state type in mark_beginning_as_normal()"
msgstr "在 mark_beginning_as_normal() 中有ä¸ç•¶çš„狀態輸入"
-#: nfa.c:609
+#: nfa.c:598
#, c-format
msgid "input rules are too complicated (>= %d NFA states)"
msgstr "輸入è¦å‰‡å¤ªè¤‡é›œ (>= %d NFA 狀態)"
-#: nfa.c:688
+#: nfa.c:677
msgid "found too many transitions in mkxtion()"
msgstr "在 mkxtion() 中找到太多轉æ›"
-#: nfa.c:714
+#: nfa.c:703
#, c-format
msgid "too many rules (> %d)!"
msgstr "太多è¦å‰‡ (> %d)ï¼"
diff --git a/src/.gitignore b/src/.gitignore
new file mode 100644
index 0000000..f3a9234
--- /dev/null
+++ b/src/.gitignore
@@ -0,0 +1,10 @@
+*.la
+*.lo
+*.o
+config.h
+config.h.in
+flex
+parse.c
+parse.h
+scan.c
+skel.c
diff --git a/src/FlexLexer.h b/src/FlexLexer.h
new file mode 100644
index 0000000..b725b1f
--- /dev/null
+++ b/src/FlexLexer.h
@@ -0,0 +1,225 @@
+// -*-C++-*-
+// FlexLexer.h -- define interfaces for lexical analyzer classes generated
+// by flex
+
+// Copyright (c) 1993 The Regents of the University of California.
+// All rights reserved.
+//
+// This code is derived from software contributed to Berkeley by
+// Kent Williams and Tom Epperly.
+//
+// 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.
+
+// This file defines FlexLexer, an abstract class which specifies the
+// external interface provided to flex C++ lexer objects, and yyFlexLexer,
+// which defines a particular lexer class.
+//
+// If you want to create multiple lexer classes, you use the -P flag
+// to rename each yyFlexLexer to some other xxFlexLexer. You then
+// include <FlexLexer.h> in your other sources once per lexer class:
+//
+// #undef yyFlexLexer
+// #define yyFlexLexer xxFlexLexer
+// #include <FlexLexer.h>
+//
+// #undef yyFlexLexer
+// #define yyFlexLexer zzFlexLexer
+// #include <FlexLexer.h>
+// ...
+
+#ifndef __FLEX_LEXER_H
+// Never included before - need to define base class.
+#define __FLEX_LEXER_H
+
+#include <iostream>
+# ifndef FLEX_STD
+# define FLEX_STD std::
+# endif
+
+extern "C++" {
+
+struct yy_buffer_state;
+typedef int yy_state_type;
+
+class FlexLexer {
+public:
+ virtual ~FlexLexer() { }
+
+ const char* YYText() const { return yytext; }
+ int YYLeng() const { return yyleng; }
+
+ virtual void
+ yy_switch_to_buffer( struct yy_buffer_state* new_buffer ) = 0;
+ virtual struct yy_buffer_state*
+ yy_create_buffer( FLEX_STD istream* s, int size ) = 0;
+ virtual struct yy_buffer_state*
+ yy_create_buffer( FLEX_STD istream& s, int size ) = 0;
+ virtual void yy_delete_buffer( struct yy_buffer_state* b ) = 0;
+ virtual void yyrestart( FLEX_STD istream* s ) = 0;
+ virtual void yyrestart( FLEX_STD istream& s ) = 0;
+
+ virtual int yylex() = 0;
+
+ // Call yylex with new input/output sources.
+ int yylex( FLEX_STD istream& new_in, FLEX_STD ostream& new_out )
+ {
+ switch_streams( new_in, new_out );
+ return yylex();
+ }
+
+ int yylex( FLEX_STD istream* new_in, FLEX_STD ostream* new_out = 0)
+ {
+ switch_streams( new_in, new_out );
+ return yylex();
+ }
+
+ // Switch to new input/output streams. A nil stream pointer
+ // indicates "keep the current one".
+ virtual void switch_streams( FLEX_STD istream* new_in,
+ FLEX_STD ostream* new_out ) = 0;
+ virtual void switch_streams( FLEX_STD istream& new_in,
+ FLEX_STD ostream& new_out ) = 0;
+
+ int lineno() const { return yylineno; }
+
+ int debug() const { return yy_flex_debug; }
+ void set_debug( int flag ) { yy_flex_debug = flag; }
+
+protected:
+ char* yytext;
+ int yyleng;
+ int yylineno; // only maintained if you use %option yylineno
+ int yy_flex_debug; // only has effect with -d or "%option debug"
+};
+
+}
+#endif // FLEXLEXER_H
+
+#if defined(yyFlexLexer) || ! defined(yyFlexLexerOnce)
+// Either this is the first time through (yyFlexLexerOnce not defined),
+// or this is a repeated include to define a different flavor of
+// yyFlexLexer, as discussed in the flex manual.
+#define yyFlexLexerOnce
+
+extern "C++" {
+
+class yyFlexLexer : public FlexLexer {
+public:
+ // arg_yyin and arg_yyout default to the cin and cout, but we
+ // only make that assignment when initializing in yylex().
+ yyFlexLexer( FLEX_STD istream& arg_yyin, FLEX_STD ostream& arg_yyout );
+ yyFlexLexer( FLEX_STD istream* arg_yyin = 0, FLEX_STD ostream* arg_yyout = 0 );
+private:
+ void ctor_common();
+
+public:
+
+ virtual ~yyFlexLexer();
+
+ void yy_switch_to_buffer( struct yy_buffer_state* new_buffer );
+ struct yy_buffer_state* yy_create_buffer( FLEX_STD istream* s, int size );
+ struct yy_buffer_state* yy_create_buffer( FLEX_STD istream& s, int size );
+ void yy_delete_buffer( struct yy_buffer_state* b );
+ void yyrestart( FLEX_STD istream* s );
+ void yyrestart( FLEX_STD istream& s );
+
+ void yypush_buffer_state( struct yy_buffer_state* new_buffer );
+ void yypop_buffer_state();
+
+ virtual int yylex();
+ virtual void switch_streams( FLEX_STD istream& new_in, FLEX_STD ostream& new_out );
+ virtual void switch_streams( FLEX_STD istream* new_in = 0, FLEX_STD ostream* new_out = 0 );
+ virtual int yywrap();
+
+protected:
+ virtual int LexerInput( char* buf, int max_size );
+ virtual void LexerOutput( const char* buf, int size );
+ virtual void LexerError( const char* msg );
+
+ void yyunput( int c, char* buf_ptr );
+ int yyinput();
+
+ void yy_load_buffer_state();
+ void yy_init_buffer( struct yy_buffer_state* b, FLEX_STD istream& s );
+ void yy_flush_buffer( struct yy_buffer_state* b );
+
+ int yy_start_stack_ptr;
+ int yy_start_stack_depth;
+ int* yy_start_stack;
+
+ void yy_push_state( int new_state );
+ void yy_pop_state();
+ int yy_top_state();
+
+ yy_state_type yy_get_previous_state();
+ yy_state_type yy_try_NUL_trans( yy_state_type current_state );
+ int yy_get_next_buffer();
+
+ FLEX_STD istream yyin; // input source for default LexerInput
+ FLEX_STD ostream yyout; // output sink for default LexerOutput
+
+ // yy_hold_char holds the character lost when yytext is formed.
+ char yy_hold_char;
+
+ // Number of characters read into yy_ch_buf.
+ int yy_n_chars;
+
+ // Points to current character in buffer.
+ char* yy_c_buf_p;
+
+ int yy_init; // whether we need to initialize
+ int yy_start; // 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 ...
+ int yy_did_buffer_switch_on_eof;
+
+
+ size_t yy_buffer_stack_top; /**< index of top of stack. */
+ size_t yy_buffer_stack_max; /**< capacity of stack. */
+ struct yy_buffer_state ** yy_buffer_stack; /**< Stack as an array. */
+ void yyensure_buffer_stack(void);
+
+ // The following are not always needed, but may be depending
+ // on use of certain flex features (like REJECT or yymore()).
+
+ yy_state_type yy_last_accepting_state;
+ char* yy_last_accepting_cpos;
+
+ yy_state_type* yy_state_buf;
+ yy_state_type* yy_state_ptr;
+
+ char* yy_full_match;
+ int* yy_full_state;
+ int yy_full_lp;
+
+ int yy_lp;
+ int yy_looking_for_trail_begin;
+
+ int yy_more_flag;
+ int yy_more_len;
+ int yy_more_offset;
+ int yy_prev_more_offset;
+};
+
+}
+
+#endif // yyFlexLexer || ! yyFlexLexerOnce
+
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 0000000..e324854
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,144 @@
+AM_YFLAGS = -d
+localedir = $(datadir)/locale
+AM_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" -I$(top_srcdir)/intl
+LIBS = @LIBINTL@ @LIBS@
+
+m4 = @M4@
+
+bin_PROGRAMS = flex
+lib_LTLIBRARIES = \
+ libfl.la \
+ libfl_pic.la
+
+flex_SOURCES = \
+ ccl.c \
+ dfa.c \
+ ecs.c \
+ scanflags.c \
+ gen.c \
+ main.c \
+ misc.c \
+ nfa.c \
+ parse.y \
+ scan.l \
+ skel.c \
+ sym.c \
+ tblcmp.c \
+ yylex.c \
+ options.c \
+ scanopt.c \
+ buf.c \
+ tables.c \
+ tables_shared.c \
+ filter.c \
+ regex.c
+
+LDADD = ../lib/libcompat.la
+
+libfl_la_SOURCES = \
+ libmain.c \
+ libyywrap.c
+
+libfl_la_LDFLAGS = -version-info @SHARED_VERSION_INFO@
+
+libfl_pic_la_SOURCES = \
+ libmain.c \
+ libyywrap.c
+
+libfl_pic_la_LDFLAGS = -version-info @SHARED_VERSION_INFO@
+
+noinst_HEADERS = \
+ flexdef.h \
+ flexint.h \
+ version.h \
+ options.h \
+ scanopt.h \
+ tables.h \
+ tables_shared.h
+
+include_HEADERS = \
+ FlexLexer.h
+
+EXTRA_DIST = \
+ flex.skl \
+ mkskel.sh \
+ gettext.h
+
+BUILT_SOURCES = \
+ skel.c
+
+MAINTAINERCLEANFILES = skel.c
+
+skel.c: flex.skl mkskel.sh flexint.h tables_shared.h
+ sed 's/m4_/m4postproc_/g; s/m4preproc_/m4_/g' $(srcdir)/flex.skl | $(m4) -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 's/m4postproc_/m4_/g' | $(SHELL) $(srcdir)/mkskel.sh >skel.c
+
+# Explicitly describe dependencies.
+# You can recreate this with `gcc -I. -MM *.c'
+buf.o: buf.c flexdef.h flexint.h
+ccl.o: ccl.c flexdef.h flexint.h
+dfa.o: dfa.c flexdef.h flexint.h tables.h tables_shared.h
+ecs.o: ecs.c flexdef.h flexint.h
+scanflags.o: scanflags.c flexdef.h flexint.h
+gen.o: gen.c flexdef.h flexint.h tables.h tables_shared.h
+libmain.o: libmain.c
+libyywrap.o: libyywrap.c
+main.o: main.c flexdef.h flexint.h version.h options.h scanopt.h \
+ tables.h tables_shared.h
+misc.o: misc.c flexdef.h flexint.h tables.h tables_shared.h
+nfa.o: nfa.c flexdef.h flexint.h
+options.o: options.c options.h scanopt.h flexdef.h flexint.h
+parse.o: parse.c flexdef.h flexint.h tables.h tables_shared.h
+scan.o: scan.c flexdef.h flexint.h parse.h
+scanopt.o: scanopt.c flexdef.h flexint.h scanopt.h
+skel.o: skel.c flexdef.h flexint.h
+sym.o: sym.c flexdef.h flexint.h
+tables.o: tables.c flexdef.h flexint.h tables.h tables_shared.h
+tables_shared.o: tables_shared.c flexdef.h flexint.h tables.h \
+ tables_shared.h
+tblcmp.o: tblcmp.c flexdef.h flexint.h
+yylex.o: yylex.c flexdef.h flexint.h parse.h
+filter.o: filter.c flexdef.h flexint.h
+
+# Run GNU indent on sources. Don't run this unless all the sources compile cleanly.
+#
+# Whole idea:
+# 1. Check for .indent.pro, otherwise indent will use unknown
+# settings, or worse, the GNU defaults.)
+# 2. Check that this is GNU indent.
+# 3. Make sure to process only the NON-generated .c and .h files.
+# 4. Run indent twice per file. The first time is a test.
+# Otherwise, indent overwrites your file even if it fails!
+indentfiles = \
+ buf.c \
+ ccl.c \
+ dfa.c \
+ ecs.c \
+ scanflags.c \
+ filter.c \
+ flexdef.h \
+ gen.c \
+ libmain.c \
+ libyywrap.c \
+ main.c \
+ misc.c \
+ nfa.c \
+ options.c \
+ options.h \
+ regex.c \
+ scanopt.c \
+ scanopt.h \
+ sym.c \
+ tables.c \
+ tables.h \
+ tables_shared.c \
+ tables_shared.h \
+ tblcmp.c
+
+indent:
+ if [ -f .indent.pro ] ; then \
+ for f in $(indentfiles);\
+ do\
+ echo indenting $$f ;\
+ $(indent) < $$f >/dev/null && indent $$f || echo $$f FAILED to indent ;\
+ done \
+ fi
diff --git a/src/buf.c b/src/buf.c
new file mode 100644
index 0000000..fa713a6
--- /dev/null
+++ b/src/buf.c
@@ -0,0 +1,274 @@
+/* flex - tool to generate fast lexical analyzers */
+
+/* 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"
+
+/* Take note: The buffer object is sometimes used as a String buffer (one
+ * continuous string), and sometimes used as a list of strings, usually line by
+ * line.
+ *
+ * The type is specified in buf_init by the elt_size. If the elt_size is
+ * sizeof(char), then the buffer should be treated as string buffer. If the
+ * elt_size is sizeof(char*), then the buffer should be treated as a list of
+ * strings.
+ *
+ * Certain functions are only appropriate for one type or the other.
+ */
+
+/* global buffers. */
+struct Buf userdef_buf; /**< for user #definitions triggered by cmd-line. */
+struct Buf defs_buf; /**< for #define's autogenerated. List of strings. */
+struct Buf yydmap_buf; /**< string buffer to hold yydmap elements */
+struct Buf m4defs_buf; /**< m4 definitions. List of strings. */
+struct Buf top_buf; /**< contains %top code. String buffer. */
+
+struct Buf *buf_print_strings(struct Buf * buf, FILE* out)
+{
+ int i;
+
+ if(!buf || !out)
+ return buf;
+
+ for (i=0; i < buf->nelts; i++){
+ const char * s = ((char**)buf->elts)[i];
+ if(s)
+ fprintf(out, "%s", s);
+ }
+ return buf;
+}
+
+/* Append a "%s" formatted string to a string buffer */
+struct Buf *buf_prints (struct Buf *buf, const char *fmt, const char *s)
+{
+ char *t;
+ size_t tsz;
+
+ t = flex_alloc (tsz = strlen (fmt) + strlen (s) + 1);
+ if (!t)
+ flexfatal (_("Allocation of buffer to print string failed"));
+ snprintf (t, tsz, fmt, s);
+ buf = buf_strappend (buf, t);
+ flex_free (t);
+ return buf;
+}
+
+/** Append a line directive to the string buffer.
+ * @param buf A string buffer.
+ * @param filename file name
+ * @param lineno line number
+ * @return buf
+ */
+struct Buf *buf_linedir (struct Buf *buf, const char* filename, int lineno)
+{
+ char *dst, *t;
+ const char *src;
+
+ t = flex_alloc (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++)
+ if (*src == '\\') /* escape backslashes */
+ *dst++ = '\\';
+ *dst++ = '"';
+ *dst++ = '\n';
+ *dst = '\0';
+ buf = buf_strappend (buf, t);
+ flex_free (t);
+ return buf;
+}
+
+
+/** Append the contents of @a src to @a dest.
+ * @param @a dest the destination buffer
+ * @param @a dest the source buffer
+ * @return @a dest
+ */
+struct Buf *buf_concat(struct Buf* dest, const struct Buf* src)
+{
+ buf_append(dest, src->elts, src->nelts);
+ return dest;
+}
+
+
+/* Appends n characters in str to buf. */
+struct Buf *buf_strnappend (buf, str, n)
+ struct Buf *buf;
+ const char *str;
+ int n;
+{
+ buf_append (buf, str, n + 1);
+
+ /* "undo" the '\0' character that buf_append() already copied. */
+ buf->nelts--;
+
+ return buf;
+}
+
+/* Appends characters in str to buf. */
+struct Buf *buf_strappend (buf, str)
+ struct Buf *buf;
+ const char *str;
+{
+ return buf_strnappend (buf, str, strlen (str));
+}
+
+/* appends "#define str def\n" */
+struct Buf *buf_strdefine (buf, str, def)
+ struct Buf *buf;
+ const char *str;
+ const char *def;
+{
+ buf_strappend (buf, "#define ");
+ buf_strappend (buf, " ");
+ buf_strappend (buf, str);
+ buf_strappend (buf, " ");
+ buf_strappend (buf, def);
+ buf_strappend (buf, "\n");
+ return buf;
+}
+
+/** Pushes "m4_define( [[def]], [[val]])m4_dnl" to end of buffer.
+ * @param buf A buffer as a list of strings.
+ * @param def The m4 symbol to define.
+ * @param val The definition; may be NULL.
+ * @return buf
+ */
+struct Buf *buf_m4_define (struct Buf *buf, const char* def, const char* val)
+{
+ const char * fmt = "m4_define( [[%s]], [[%s]])m4_dnl\n";
+ char * str;
+ size_t strsz;
+
+ val = val?val:"";
+ str = (char*)flex_alloc(strsz = strlen(fmt) + strlen(def) + strlen(val) + 2);
+ if (!str)
+ flexfatal (_("Allocation of buffer for m4 def failed"));
+
+ snprintf(str, strsz, fmt, def, val);
+ buf_append(buf, &str, 1);
+ return buf;
+}
+
+/** Pushes "m4_undefine([[def]])m4_dnl" to end of buffer.
+ * @param buf A buffer as a list of strings.
+ * @param def The m4 symbol to undefine.
+ * @return buf
+ */
+struct Buf *buf_m4_undefine (struct Buf *buf, const char* def)
+{
+ const char * fmt = "m4_undefine( [[%s]])m4_dnl\n";
+ char * str;
+ size_t strsz;
+
+ str = (char*)flex_alloc(strsz = strlen(fmt) + strlen(def) + 2);
+ if (!str)
+ flexfatal (_("Allocation of buffer for m4 undef failed"));
+
+ snprintf(str, strsz, fmt, def);
+ buf_append(buf, &str, 1);
+ return buf;
+}
+
+/* create buf with 0 elements, each of size elem_size. */
+void buf_init (buf, elem_size)
+ struct Buf *buf;
+ size_t elem_size;
+{
+ buf->elts = (void *) 0;
+ buf->nelts = 0;
+ buf->elt_size = elem_size;
+ buf->nmax = 0;
+}
+
+/* frees memory */
+void buf_destroy (buf)
+ struct Buf *buf;
+{
+ if (buf && buf->elts)
+ flex_free (buf->elts);
+ buf->elts = (void *) 0;
+}
+
+
+/* appends ptr[] to buf, grow if necessary.
+ * n_elem is number of elements in ptr[], NOT bytes.
+ * returns buf.
+ * We grow by mod(512) boundaries.
+ */
+
+struct Buf *buf_append (buf, ptr, n_elem)
+ struct Buf *buf;
+ const void *ptr;
+ int n_elem;
+{
+ int n_alloc = 0;
+
+ if (!ptr || n_elem == 0)
+ return buf;
+
+ /* May need to alloc more. */
+ if (n_elem + buf->nelts > buf->nmax) {
+
+ /* exact amount needed... */
+ n_alloc = (n_elem + buf->nelts) * buf->elt_size;
+
+ /* ...plus some extra */
+ if (((n_alloc * buf->elt_size) % 512) != 0
+ && buf->elt_size < 512)
+ n_alloc +=
+ (512 -
+ ((n_alloc * buf->elt_size) % 512)) /
+ buf->elt_size;
+
+ if (!buf->elts)
+ buf->elts =
+ allocate_array (n_alloc, buf->elt_size);
+ else
+ buf->elts =
+ reallocate_array (buf->elts, n_alloc,
+ buf->elt_size);
+
+ buf->nmax = n_alloc;
+ }
+
+ memcpy ((char *) buf->elts + buf->nelts * buf->elt_size, ptr,
+ n_elem * buf->elt_size);
+ buf->nelts += n_elem;
+
+ return buf;
+}
+
+/* vim:set tabstop=8 softtabstop=4 shiftwidth=4: */
diff --git a/src/ccl.c b/src/ccl.c
new file mode 100644
index 0000000..7b134af
--- /dev/null
+++ b/src/ccl.c
@@ -0,0 +1,310 @@
+/* ccl - routines for character classes */
+
+/* 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"
+
+/* return true if the chr is in the ccl. Takes negation into account. */
+static bool
+ccl_contains (const int cclp, const int ch)
+{
+ int ind, len, i;
+
+ len = ccllen[cclp];
+ ind = cclmap[cclp];
+
+ for (i = 0; i < len; ++i)
+ if (ccltbl[ind + i] == ch)
+ return !cclng[cclp];
+
+ return cclng[cclp];
+}
+
+
+/* ccladd - add a single character to a ccl */
+
+void ccladd (cclp, ch)
+ int cclp;
+ int ch;
+{
+ int ind, len, newpos, i;
+
+ check_char (ch);
+
+ len = ccllen[cclp];
+ ind = cclmap[cclp];
+
+ /* check to see if the character is already in the ccl */
+
+ for (i = 0; i < len; ++i)
+ if (ccltbl[ind + i] == ch)
+ return;
+
+ /* mark newlines */
+ if (ch == nlch)
+ ccl_has_nl[cclp] = true;
+
+ newpos = ind + len;
+
+ if (newpos >= current_max_ccl_tbl_size) {
+ current_max_ccl_tbl_size += MAX_CCL_TBL_SIZE_INCREMENT;
+
+ ++num_reallocs;
+
+ ccltbl = reallocate_Character_array (ccltbl,
+ current_max_ccl_tbl_size);
+ }
+
+ ccllen[cclp] = len + 1;
+ ccltbl[newpos] = ch;
+}
+
+/* dump_cclp - same thing as list_character_set, but for cclps. */
+
+static void dump_cclp (FILE* file, int cclp)
+{
+ int i;
+
+ putc ('[', file);
+
+ for (i = 0; i < csize; ++i) {
+ if (ccl_contains(cclp, i)){
+ int start_char = i;
+
+ putc (' ', file);
+
+ fputs (readable_form (i), file);
+
+ while (++i < csize && ccl_contains(cclp,i)) ;
+
+ if (i - 1 > start_char)
+ /* this was a run */
+ fprintf (file, "-%s",
+ readable_form (i - 1));
+
+ putc (' ', file);
+ }
+ }
+
+ putc (']', file);
+}
+
+
+
+/* ccl_set_diff - create a new ccl as the set difference of the two given ccls. */
+int
+ccl_set_diff (int a, int b)
+{
+ int d, ch;
+
+ /* create new class */
+ d = cclinit();
+
+ /* In order to handle negation, we spin through all possible chars,
+ * addding each char in a that is not in b.
+ * (This could be O(n^2), but n is small and bounded.)
+ */
+ for ( ch = 0; ch < csize; ++ch )
+ if (ccl_contains (a, ch) && !ccl_contains(b, ch))
+ ccladd (d, ch);
+
+ /* debug */
+ if (0){
+ fprintf(stderr, "ccl_set_diff (");
+ fprintf(stderr, "\n ");
+ dump_cclp (stderr, a);
+ fprintf(stderr, "\n ");
+ dump_cclp (stderr, b);
+ fprintf(stderr, "\n ");
+ dump_cclp (stderr, d);
+ fprintf(stderr, "\n)\n");
+ }
+ return d;
+}
+
+/* ccl_set_union - create a new ccl as the set union of the two given ccls. */
+int
+ccl_set_union (int a, int b)
+{
+ int d, i;
+
+ /* create new class */
+ d = cclinit();
+
+ /* Add all of a */
+ for (i = 0; i < ccllen[a]; ++i)
+ ccladd (d, ccltbl[cclmap[a] + i]);
+
+ /* Add all of b */
+ for (i = 0; i < ccllen[b]; ++i)
+ ccladd (d, ccltbl[cclmap[b] + i]);
+
+ /* debug */
+ if (0){
+ fprintf(stderr, "ccl_set_union (%d + %d = %d", a, b, d);
+ fprintf(stderr, "\n ");
+ dump_cclp (stderr, a);
+ fprintf(stderr, "\n ");
+ dump_cclp (stderr, b);
+ fprintf(stderr, "\n ");
+ dump_cclp (stderr, d);
+ fprintf(stderr, "\n)\n");
+ }
+ return d;
+}
+
+
+/* cclinit - return an empty ccl */
+
+int cclinit ()
+{
+ if (++lastccl >= current_maxccls) {
+ current_maxccls += MAX_CCLS_INCREMENT;
+
+ ++num_reallocs;
+
+ cclmap =
+ reallocate_integer_array (cclmap, current_maxccls);
+ ccllen =
+ reallocate_integer_array (ccllen, current_maxccls);
+ cclng = reallocate_integer_array (cclng, current_maxccls);
+ ccl_has_nl =
+ reallocate_bool_array (ccl_has_nl,
+ current_maxccls);
+ }
+
+ if (lastccl == 1)
+ /* we're making the first ccl */
+ cclmap[lastccl] = 0;
+
+ else
+ /* The new pointer is just past the end of the last ccl.
+ * Since the cclmap points to the \first/ character of a
+ * ccl, adding the length of the ccl to the cclmap pointer
+ * will produce a cursor to the first free space.
+ */
+ cclmap[lastccl] =
+ cclmap[lastccl - 1] + ccllen[lastccl - 1];
+
+ ccllen[lastccl] = 0;
+ cclng[lastccl] = 0; /* ccl's start out life un-negated */
+ ccl_has_nl[lastccl] = false;
+
+ return lastccl;
+}
+
+
+/* cclnegate - negate the given ccl */
+
+void cclnegate (cclp)
+ int cclp;
+{
+ cclng[cclp] = 1;
+ ccl_has_nl[cclp] = !ccl_has_nl[cclp];
+}
+
+
+/* list_character_set - list the members of a set of characters in CCL form
+ *
+ * Writes to the given file a character-class representation of those
+ * characters present in the given CCL. A character is present if it
+ * has a non-zero value in the cset array.
+ */
+
+void list_character_set (file, cset)
+ FILE *file;
+ int cset[];
+{
+ int i;
+
+ putc ('[', file);
+
+ for (i = 0; i < csize; ++i) {
+ if (cset[i]) {
+ int start_char = i;
+
+ putc (' ', file);
+
+ fputs (readable_form (i), file);
+
+ while (++i < csize && cset[i]) ;
+
+ if (i - 1 > start_char)
+ /* this was a run */
+ fprintf (file, "-%s",
+ readable_form (i - 1));
+
+ putc (' ', file);
+ }
+ }
+
+ putc (']', file);
+}
+
+/** Determines if the range [c1-c2] is unambiguous in a case-insensitive
+ * scanner. Specifically, if a lowercase or uppercase character, x, is in the
+ * range [c1-c2], then we require that UPPERCASE(x) and LOWERCASE(x) must also
+ * be in the range. If not, then this range is ambiguous, and the function
+ * returns false. For example, [@-_] spans [a-z] but not [A-Z]. Beware that
+ * [a-z] will be labeled ambiguous because it does not include [A-Z].
+ *
+ * @param c1 the lower end of the range
+ * @param c2 the upper end of the range
+ * @return true if [c1-c2] is not ambiguous for a caseless scanner.
+ */
+bool range_covers_case (int c1, int c2)
+{
+ int i, o;
+
+ for (i = c1; i <= c2; i++) {
+ if (has_case (i)) {
+ o = reverse_case (i);
+ if (o < c1 || c2 < o)
+ return false;
+ }
+ }
+ return true;
+}
+
+/** Reverse the case of a character, if possible.
+ * @return c if case-reversal does not apply.
+ */
+int reverse_case (int c)
+{
+ return isupper (c) ? tolower (c) : (islower (c) ? toupper (c) : c);
+}
+
+/** Return true if c is uppercase or lowercase. */
+bool has_case (int c)
+{
+ return (isupper (c) || islower (c)) ? true : false;
+}
diff --git a/src/dfa.c b/src/dfa.c
new file mode 100644
index 0000000..0a68e3a
--- /dev/null
+++ b/src/dfa.c
@@ -0,0 +1,1096 @@
+/* dfa - DFA construction routines */
+
+/* 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. */
+
+#include "flexdef.h"
+#include "tables.h"
+
+/* declare functions that have forward references */
+
+void dump_associated_rules PROTO ((FILE *, int));
+void dump_transitions PROTO ((FILE *, int[]));
+void sympartition PROTO ((int[], int, int[], int[]));
+int symfollowset PROTO ((int[], int, int, int[]));
+
+
+/* check_for_backing_up - check a DFA state for backing up
+ *
+ * synopsis
+ * void check_for_backing_up( int ds, int state[numecs] );
+ *
+ * ds is the number of the state to check and state[] is its out-transitions,
+ * indexed by equivalence class.
+ */
+
+void check_for_backing_up (ds, state)
+ int ds;
+ int state[];
+{
+ if ((reject && !dfaacc[ds].dfaacc_set) || (!reject && !dfaacc[ds].dfaacc_state)) { /* state is non-accepting */
+ ++num_backing_up;
+
+ if (backing_up_report) {
+ fprintf (backing_up_file,
+ _("State #%d is non-accepting -\n"), ds);
+
+ /* identify the state */
+ dump_associated_rules (backing_up_file, ds);
+
+ /* Now identify it further using the out- and
+ * jam-transitions.
+ */
+ dump_transitions (backing_up_file, state);
+
+ putc ('\n', backing_up_file);
+ }
+ }
+}
+
+
+/* check_trailing_context - check to see if NFA state set constitutes
+ * "dangerous" trailing context
+ *
+ * synopsis
+ * void check_trailing_context( int nfa_states[num_states+1], int num_states,
+ * int accset[nacc+1], int nacc );
+ *
+ * NOTES
+ * Trailing context is "dangerous" if both the head and the trailing
+ * part are of variable size \and/ there's a DFA state which contains
+ * both an accepting state for the head part of the rule and NFA states
+ * which occur after the beginning of the trailing context.
+ *
+ * When such a rule is matched, it's impossible to tell if having been
+ * in the DFA state indicates the beginning of the trailing context or
+ * further-along scanning of the pattern. In these cases, a warning
+ * message is issued.
+ *
+ * nfa_states[1 .. num_states] is the list of NFA states in the DFA.
+ * accset[1 .. nacc] is the list of accepting numbers for the DFA state.
+ */
+
+void check_trailing_context (nfa_states, num_states, accset, nacc)
+ int *nfa_states, num_states;
+ int *accset;
+ int nacc;
+{
+ int i, j;
+
+ for (i = 1; i <= num_states; ++i) {
+ int ns = nfa_states[i];
+ int type = state_type[ns];
+ int ar = assoc_rule[ns];
+
+ if (type == STATE_NORMAL || rule_type[ar] != RULE_VARIABLE) { /* do nothing */
+ }
+
+ else if (type == STATE_TRAILING_CONTEXT) {
+ /* Potential trouble. Scan set of accepting numbers
+ * for the one marking the end of the "head". We
+ * assume that this looping will be fairly cheap
+ * since it's rare that an accepting number set
+ * is large.
+ */
+ for (j = 1; j <= nacc; ++j)
+ if (accset[j] & YY_TRAILING_HEAD_MASK) {
+ line_warning (_
+ ("dangerous trailing context"),
+ rule_linenum[ar]);
+ return;
+ }
+ }
+ }
+}
+
+
+/* dump_associated_rules - list the rules associated with a DFA state
+ *
+ * Goes through the set of NFA states associated with the DFA and
+ * extracts the first MAX_ASSOC_RULES unique rules, sorts them,
+ * and writes a report to the given file.
+ */
+
+void dump_associated_rules (file, ds)
+ FILE *file;
+ int ds;
+{
+ int i, j;
+ int num_associated_rules = 0;
+ int rule_set[MAX_ASSOC_RULES + 1];
+ int *dset = dss[ds];
+ int size = dfasiz[ds];
+
+ for (i = 1; i <= size; ++i) {
+ int rule_num = rule_linenum[assoc_rule[dset[i]]];
+
+ for (j = 1; j <= num_associated_rules; ++j)
+ if (rule_num == rule_set[j])
+ break;
+
+ if (j > num_associated_rules) { /* new rule */
+ if (num_associated_rules < MAX_ASSOC_RULES)
+ rule_set[++num_associated_rules] =
+ rule_num;
+ }
+ }
+
+ qsort (&rule_set [1], num_associated_rules, sizeof (rule_set [1]), intcmp);
+
+ fprintf (file, _(" associated rule line numbers:"));
+
+ for (i = 1; i <= num_associated_rules; ++i) {
+ if (i % 8 == 1)
+ putc ('\n', file);
+
+ fprintf (file, "\t%d", rule_set[i]);
+ }
+
+ putc ('\n', file);
+}
+
+
+/* dump_transitions - list the transitions associated with a DFA state
+ *
+ * synopsis
+ * dump_transitions( FILE *file, int state[numecs] );
+ *
+ * Goes through the set of out-transitions and lists them in human-readable
+ * form (i.e., not as equivalence classes); also lists jam transitions
+ * (i.e., all those which are not out-transitions, plus EOF). The dump
+ * is done to the given file.
+ */
+
+void dump_transitions (file, state)
+ FILE *file;
+ int state[];
+{
+ int i, ec;
+ int out_char_set[CSIZE];
+
+ for (i = 0; i < csize; ++i) {
+ ec = ABS (ecgroup[i]);
+ out_char_set[i] = state[ec];
+ }
+
+ fprintf (file, _(" out-transitions: "));
+
+ list_character_set (file, out_char_set);
+
+ /* now invert the members of the set to get the jam transitions */
+ for (i = 0; i < csize; ++i)
+ out_char_set[i] = !out_char_set[i];
+
+ fprintf (file, _("\n jam-transitions: EOF "));
+
+ list_character_set (file, out_char_set);
+
+ putc ('\n', file);
+}
+
+
+/* epsclosure - construct the epsilon closure of a set of ndfa states
+ *
+ * synopsis
+ * int *epsclosure( int t[num_states], int *numstates_addr,
+ * int accset[num_rules+1], int *nacc_addr,
+ * int *hashval_addr );
+ *
+ * NOTES
+ * The epsilon closure is the set of all states reachable by an arbitrary
+ * number of epsilon transitions, which themselves do not have epsilon
+ * transitions going out, unioned with the set of states which have non-null
+ * accepting numbers. t is an array of size numstates of nfa state numbers.
+ * Upon return, t holds the epsilon closure and *numstates_addr is updated.
+ * accset holds a list of the accepting numbers, and the size of accset is
+ * given by *nacc_addr. t may be subjected to reallocation if it is not
+ * large enough to hold the epsilon closure.
+ *
+ * hashval is the hash value for the dfa corresponding to the state set.
+ */
+
+int *epsclosure (t, ns_addr, accset, nacc_addr, hv_addr)
+ int *t, *ns_addr, accset[], *nacc_addr, *hv_addr;
+{
+ int stkpos, ns, tsp;
+ int numstates = *ns_addr, nacc, hashval, transsym, nfaccnum;
+ int stkend, nstate;
+ static int did_stk_init = false, *stk;
+
+#define MARK_STATE(state) \
+do{ trans1[state] = trans1[state] - MARKER_DIFFERENCE;} while(0)
+
+#define IS_MARKED(state) (trans1[state] < 0)
+
+#define UNMARK_STATE(state) \
+do{ trans1[state] = trans1[state] + MARKER_DIFFERENCE;} while(0)
+
+#define CHECK_ACCEPT(state) \
+do{ \
+nfaccnum = accptnum[state]; \
+if ( nfaccnum != NIL ) \
+accset[++nacc] = nfaccnum; \
+}while(0)
+
+#define DO_REALLOCATION() \
+do { \
+current_max_dfa_size += MAX_DFA_SIZE_INCREMENT; \
+++num_reallocs; \
+t = reallocate_integer_array( t, current_max_dfa_size ); \
+stk = reallocate_integer_array( stk, current_max_dfa_size ); \
+}while(0) \
+
+#define PUT_ON_STACK(state) \
+do { \
+if ( ++stkend >= current_max_dfa_size ) \
+DO_REALLOCATION(); \
+stk[stkend] = state; \
+MARK_STATE(state); \
+}while(0)
+
+#define ADD_STATE(state) \
+do { \
+if ( ++numstates >= current_max_dfa_size ) \
+DO_REALLOCATION(); \
+t[numstates] = state; \
+hashval += state; \
+}while(0)
+
+#define STACK_STATE(state) \
+do { \
+PUT_ON_STACK(state); \
+CHECK_ACCEPT(state); \
+if ( nfaccnum != NIL || transchar[state] != SYM_EPSILON ) \
+ADD_STATE(state); \
+}while(0)
+
+
+ if (!did_stk_init) {
+ stk = allocate_integer_array (current_max_dfa_size);
+ did_stk_init = true;
+ }
+
+ nacc = stkend = hashval = 0;
+
+ for (nstate = 1; nstate <= numstates; ++nstate) {
+ ns = t[nstate];
+
+ /* The state could be marked if we've already pushed it onto
+ * the stack.
+ */
+ if (!IS_MARKED (ns)) {
+ PUT_ON_STACK (ns);
+ CHECK_ACCEPT (ns);
+ hashval += ns;
+ }
+ }
+
+ for (stkpos = 1; stkpos <= stkend; ++stkpos) {
+ ns = stk[stkpos];
+ transsym = transchar[ns];
+
+ if (transsym == SYM_EPSILON) {
+ tsp = trans1[ns] + MARKER_DIFFERENCE;
+
+ if (tsp != NO_TRANSITION) {
+ if (!IS_MARKED (tsp))
+ STACK_STATE (tsp);
+
+ tsp = trans2[ns];
+
+ if (tsp != NO_TRANSITION
+ && !IS_MARKED (tsp))
+ STACK_STATE (tsp);
+ }
+ }
+ }
+
+ /* Clear out "visit" markers. */
+
+ for (stkpos = 1; stkpos <= stkend; ++stkpos) {
+ if (IS_MARKED (stk[stkpos]))
+ UNMARK_STATE (stk[stkpos]);
+ else
+ flexfatal (_
+ ("consistency check failed in epsclosure()"));
+ }
+
+ *ns_addr = numstates;
+ *hv_addr = hashval;
+ *nacc_addr = nacc;
+
+ return t;
+}
+
+
+/* increase_max_dfas - increase the maximum number of DFAs */
+
+void increase_max_dfas ()
+{
+ current_max_dfas += MAX_DFAS_INCREMENT;
+
+ ++num_reallocs;
+
+ base = reallocate_integer_array (base, current_max_dfas);
+ def = reallocate_integer_array (def, current_max_dfas);
+ dfasiz = reallocate_integer_array (dfasiz, current_max_dfas);
+ accsiz = reallocate_integer_array (accsiz, current_max_dfas);
+ dhash = reallocate_integer_array (dhash, current_max_dfas);
+ dss = reallocate_int_ptr_array (dss, current_max_dfas);
+ dfaacc = reallocate_dfaacc_union (dfaacc, current_max_dfas);
+
+ if (nultrans)
+ nultrans =
+ reallocate_integer_array (nultrans,
+ current_max_dfas);
+}
+
+
+/* ntod - convert an ndfa to a dfa
+ *
+ * Creates the dfa corresponding to the ndfa we've constructed. The
+ * dfa starts out in state #1.
+ */
+
+void ntod ()
+{
+ int *accset, ds, nacc, newds;
+ int sym, hashval, numstates, dsize;
+ int num_full_table_rows=0; /* used only for -f */
+ int *nset, *dset;
+ int targptr, totaltrans, i, comstate, comfreq, targ;
+ int symlist[CSIZE + 1];
+ int num_start_states;
+ int todo_head, todo_next;
+
+ struct yytbl_data *yynxt_tbl = 0;
+ flex_int32_t *yynxt_data = 0, yynxt_curr = 0;
+
+ /* Note that the following are indexed by *equivalence classes*
+ * and not by characters. Since equivalence classes are indexed
+ * beginning with 1, even if the scanner accepts NUL's, this
+ * means that (since every character is potentially in its own
+ * equivalence class) these arrays must have room for indices
+ * from 1 to CSIZE, so their size must be CSIZE + 1.
+ */
+ int duplist[CSIZE + 1], state[CSIZE + 1];
+ int targfreq[CSIZE + 1] = {0}, targstate[CSIZE + 1];
+
+ /* accset needs to be large enough to hold all of the rules present
+ * in the input, *plus* their YY_TRAILING_HEAD_MASK variants.
+ */
+ accset = allocate_integer_array ((num_rules + 1) * 2);
+ nset = allocate_integer_array (current_max_dfa_size);
+
+ /* The "todo" queue is represented by the head, which is the DFA
+ * state currently being processed, and the "next", which is the
+ * next DFA state number available (not in use). We depend on the
+ * fact that snstods() returns DFA's \in increasing order/, and thus
+ * need only know the bounds of the dfas to be processed.
+ */
+ todo_head = todo_next = 0;
+
+ for (i = 0; i <= csize; ++i) {
+ duplist[i] = NIL;
+ symlist[i] = false;
+ }
+
+ for (i = 0; i <= num_rules; ++i)
+ accset[i] = NIL;
+
+ if (trace) {
+ dumpnfa (scset[1]);
+ fputs (_("\n\nDFA Dump:\n\n"), stderr);
+ }
+
+ inittbl ();
+
+ /* Check to see whether we should build a separate table for
+ * transitions on NUL characters. We don't do this for full-speed
+ * (-F) scanners, since for them we don't have a simple state
+ * number lying around with which to index the table. We also
+ * don't bother doing it for scanners unless (1) NUL is in its own
+ * equivalence class (indicated by a positive value of
+ * ecgroup[NUL]), (2) NUL's equivalence class is the last
+ * equivalence class, and (3) the number of equivalence classes is
+ * the same as the number of characters. This latter case comes
+ * about when useecs is false or when it's true but every character
+ * still manages to land in its own class (unlikely, but it's
+ * cheap to check for). If all these things are true then the
+ * character code needed to represent NUL's equivalence class for
+ * indexing the tables is going to take one more bit than the
+ * number of characters, and therefore we won't be assured of
+ * being able to fit it into a YY_CHAR variable. This rules out
+ * storing the transitions in a compressed table, since the code
+ * for interpreting them uses a YY_CHAR variable (perhaps it
+ * should just use an integer, though; this is worth pondering ...
+ * ###).
+ *
+ * Finally, for full tables, we want the number of entries in the
+ * table to be a power of two so the array references go fast (it
+ * will just take a shift to compute the major index). If
+ * encoding NUL's transitions in the table will spoil this, we
+ * give it its own table (note that this will be the case if we're
+ * not using equivalence classes).
+ */
+
+ /* Note that the test for ecgroup[0] == numecs below accomplishes
+ * both (1) and (2) above
+ */
+ if (!fullspd && ecgroup[0] == numecs) {
+ /* NUL is alone in its equivalence class, which is the
+ * last one.
+ */
+ int use_NUL_table = (numecs == csize);
+
+ if (fulltbl && !use_NUL_table) {
+ /* We still may want to use the table if numecs
+ * is a power of 2.
+ */
+ int power_of_two;
+
+ for (power_of_two = 1; power_of_two <= csize;
+ power_of_two *= 2)
+ if (numecs == power_of_two) {
+ use_NUL_table = true;
+ break;
+ }
+ }
+
+ if (use_NUL_table)
+ nultrans =
+ allocate_integer_array (current_max_dfas);
+
+ /* From now on, nultrans != nil indicates that we're
+ * saving null transitions for later, separate encoding.
+ */
+ }
+
+
+ if (fullspd) {
+ for (i = 0; i <= numecs; ++i)
+ state[i] = 0;
+
+ place_state (state, 0, 0);
+ dfaacc[0].dfaacc_state = 0;
+ }
+
+ else if (fulltbl) {
+ if (nultrans)
+ /* We won't be including NUL's transitions in the
+ * table, so build it for entries from 0 .. numecs - 1.
+ */
+ num_full_table_rows = numecs;
+
+ else
+ /* Take into account the fact that we'll be including
+ * the NUL entries in the transition table. Build it
+ * from 0 .. numecs.
+ */
+ num_full_table_rows = numecs + 1;
+
+ /* Begin generating yy_nxt[][]
+ * This spans the entire LONG function.
+ * This table is tricky because we don't know how big it will be.
+ * So we'll have to realloc() on the way...
+ * we'll wait until we can calculate yynxt_tbl->td_hilen.
+ */
+ yynxt_tbl =
+ (struct yytbl_data *) calloc (1,
+ sizeof (struct
+ yytbl_data));
+ yytbl_data_init (yynxt_tbl, YYTD_ID_NXT);
+ yynxt_tbl->td_hilen = 1;
+ yynxt_tbl->td_lolen = num_full_table_rows;
+ yynxt_tbl->td_data = yynxt_data =
+ (flex_int32_t *) calloc (yynxt_tbl->td_lolen *
+ yynxt_tbl->td_hilen,
+ sizeof (flex_int32_t));
+ yynxt_curr = 0;
+
+ buf_prints (&yydmap_buf,
+ "\t{YYTD_ID_NXT, (void**)&yy_nxt, sizeof(%s)},\n",
+ long_align ? "flex_int32_t" : "flex_int16_t");
+
+ /* Unless -Ca, declare it "short" because it's a real
+ * long-shot that that won't be large enough.
+ */
+ if (gentables)
+ out_str_dec
+ ("static yyconst %s yy_nxt[][%d] =\n {\n",
+ long_align ? "flex_int32_t" : "flex_int16_t",
+ num_full_table_rows);
+ else {
+ out_dec ("#undef YY_NXT_LOLEN\n#define YY_NXT_LOLEN (%d)\n", num_full_table_rows);
+ out_str ("static yyconst %s *yy_nxt =0;\n",
+ long_align ? "flex_int32_t" : "flex_int16_t");
+ }
+
+
+ if (gentables)
+ outn (" {");
+
+ /* Generate 0 entries for state #0. */
+ for (i = 0; i < num_full_table_rows; ++i) {
+ mk2data (0);
+ yynxt_data[yynxt_curr++] = 0;
+ }
+
+ dataflush ();
+ if (gentables)
+ outn (" },\n");
+ }
+
+ /* Create the first states. */
+
+ num_start_states = lastsc * 2;
+
+ for (i = 1; i <= num_start_states; ++i) {
+ numstates = 1;
+
+ /* For each start condition, make one state for the case when
+ * we're at the beginning of the line (the '^' operator) and
+ * one for the case when we're not.
+ */
+ if (i % 2 == 1)
+ nset[numstates] = scset[(i / 2) + 1];
+ else
+ nset[numstates] =
+ mkbranch (scbol[i / 2], scset[i / 2]);
+
+ nset = epsclosure (nset, &numstates, accset, &nacc,
+ &hashval);
+
+ if (snstods (nset, numstates, accset, nacc, hashval, &ds)) {
+ numas += nacc;
+ totnst += numstates;
+ ++todo_next;
+
+ if (variable_trailing_context_rules && nacc > 0)
+ check_trailing_context (nset, numstates,
+ accset, nacc);
+ }
+ }
+
+ if (!fullspd) {
+ if (!snstods (nset, 0, accset, 0, 0, &end_of_buffer_state))
+ flexfatal (_
+ ("could not create unique end-of-buffer state"));
+
+ ++numas;
+ ++num_start_states;
+ ++todo_next;
+ }
+
+
+ while (todo_head < todo_next) {
+ targptr = 0;
+ totaltrans = 0;
+
+ for (i = 1; i <= numecs; ++i)
+ state[i] = 0;
+
+ ds = ++todo_head;
+
+ dset = dss[ds];
+ dsize = dfasiz[ds];
+
+ if (trace)
+ fprintf (stderr, _("state # %d:\n"), ds);
+
+ sympartition (dset, dsize, symlist, duplist);
+
+ for (sym = 1; sym <= numecs; ++sym) {
+ if (symlist[sym]) {
+ symlist[sym] = 0;
+
+ if (duplist[sym] == NIL) {
+ /* Symbol has unique out-transitions. */
+ numstates =
+ symfollowset (dset, dsize,
+ sym, nset);
+ nset = epsclosure (nset,
+ &numstates,
+ accset, &nacc,
+ &hashval);
+
+ if (snstods
+ (nset, numstates, accset, nacc,
+ hashval, &newds)) {
+ totnst = totnst +
+ numstates;
+ ++todo_next;
+ numas += nacc;
+
+ if (variable_trailing_context_rules && nacc > 0)
+ check_trailing_context
+ (nset,
+ numstates,
+ accset,
+ nacc);
+ }
+
+ state[sym] = newds;
+
+ if (trace)
+ fprintf (stderr,
+ "\t%d\t%d\n", sym,
+ newds);
+
+ targfreq[++targptr] = 1;
+ targstate[targptr] = newds;
+ ++numuniq;
+ }
+
+ else {
+ /* sym's equivalence class has the same
+ * transitions as duplist(sym)'s
+ * equivalence class.
+ */
+ targ = state[duplist[sym]];
+ state[sym] = targ;
+
+ if (trace)
+ fprintf (stderr,
+ "\t%d\t%d\n", sym,
+ targ);
+
+ /* Update frequency count for
+ * destination state.
+ */
+
+ i = 0;
+ while (targstate[++i] != targ) ;
+
+ ++targfreq[i];
+ ++numdup;
+ }
+
+ ++totaltrans;
+ duplist[sym] = NIL;
+ }
+ }
+
+
+ numsnpairs += totaltrans;
+
+ if (ds > num_start_states)
+ check_for_backing_up (ds, state);
+
+ if (nultrans) {
+ nultrans[ds] = state[NUL_ec];
+ state[NUL_ec] = 0; /* remove transition */
+ }
+
+ if (fulltbl) {
+
+ /* Each time we hit here, it's another td_hilen, so we realloc. */
+ yynxt_tbl->td_hilen++;
+ yynxt_tbl->td_data = yynxt_data =
+ (flex_int32_t *) realloc (yynxt_data,
+ yynxt_tbl->td_hilen *
+ yynxt_tbl->td_lolen *
+ sizeof (flex_int32_t));
+
+
+ if (gentables)
+ outn (" {");
+
+ /* Supply array's 0-element. */
+ if (ds == end_of_buffer_state) {
+ mk2data (-end_of_buffer_state);
+ yynxt_data[yynxt_curr++] =
+ -end_of_buffer_state;
+ }
+ else {
+ mk2data (end_of_buffer_state);
+ yynxt_data[yynxt_curr++] =
+ end_of_buffer_state;
+ }
+
+ for (i = 1; i < num_full_table_rows; ++i) {
+ /* Jams are marked by negative of state
+ * number.
+ */
+ mk2data (state[i] ? state[i] : -ds);
+ yynxt_data[yynxt_curr++] =
+ state[i] ? state[i] : -ds;
+ }
+
+ dataflush ();
+ if (gentables)
+ outn (" },\n");
+ }
+
+ else if (fullspd)
+ place_state (state, ds, totaltrans);
+
+ else if (ds == end_of_buffer_state)
+ /* Special case this state to make sure it does what
+ * it's supposed to, i.e., jam on end-of-buffer.
+ */
+ stack1 (ds, 0, 0, JAMSTATE);
+
+ else { /* normal, compressed state */
+
+ /* Determine which destination state is the most
+ * common, and how many transitions to it there are.
+ */
+
+ comfreq = 0;
+ comstate = 0;
+
+ for (i = 1; i <= targptr; ++i)
+ if (targfreq[i] > comfreq) {
+ comfreq = targfreq[i];
+ comstate = targstate[i];
+ }
+
+ bldtbl (state, ds, totaltrans, comstate, comfreq);
+ }
+ }
+
+ if (fulltbl) {
+ dataend ();
+ if (tablesext) {
+ yytbl_data_compress (yynxt_tbl);
+ if (yytbl_data_fwrite (&tableswr, yynxt_tbl) < 0)
+ flexerror (_
+ ("Could not write yynxt_tbl[][]"));
+ }
+ if (yynxt_tbl) {
+ yytbl_data_destroy (yynxt_tbl);
+ yynxt_tbl = 0;
+ }
+ }
+
+ else if (!fullspd) {
+ cmptmps (); /* create compressed template entries */
+
+ /* Create tables for all the states with only one
+ * out-transition.
+ */
+ while (onesp > 0) {
+ mk1tbl (onestate[onesp], onesym[onesp],
+ onenext[onesp], onedef[onesp]);
+ --onesp;
+ }
+
+ mkdeftbl ();
+ }
+
+ flex_free ((void *) accset);
+ flex_free ((void *) nset);
+}
+
+
+/* snstods - converts a set of ndfa states into a dfa state
+ *
+ * synopsis
+ * is_new_state = snstods( int sns[numstates], int numstates,
+ * int accset[num_rules+1], int nacc,
+ * int hashval, int *newds_addr );
+ *
+ * On return, the dfa state number is in newds.
+ */
+
+int snstods (sns, numstates, accset, nacc, hashval, newds_addr)
+ int sns[], numstates, accset[], nacc, hashval, *newds_addr;
+{
+ int didsort = 0;
+ int i, j;
+ int newds, *oldsns;
+
+ for (i = 1; i <= lastdfa; ++i)
+ if (hashval == dhash[i]) {
+ if (numstates == dfasiz[i]) {
+ oldsns = dss[i];
+
+ if (!didsort) {
+ /* We sort the states in sns so we
+ * can compare it to oldsns quickly.
+ */
+ qsort (&sns [1], numstates, sizeof (sns [1]), intcmp);
+ didsort = 1;
+ }
+
+ for (j = 1; j <= numstates; ++j)
+ if (sns[j] != oldsns[j])
+ break;
+
+ if (j > numstates) {
+ ++dfaeql;
+ *newds_addr = i;
+ return 0;
+ }
+
+ ++hshcol;
+ }
+
+ else
+ ++hshsave;
+ }
+
+ /* Make a new dfa. */
+
+ if (++lastdfa >= current_max_dfas)
+ increase_max_dfas ();
+
+ newds = lastdfa;
+
+ dss[newds] = allocate_integer_array (numstates + 1);
+
+ /* If we haven't already sorted the states in sns, we do so now,
+ * so that future comparisons with it can be made quickly.
+ */
+
+ if (!didsort)
+ qsort (&sns [1], numstates, sizeof (sns [1]), intcmp);
+
+ for (i = 1; i <= numstates; ++i)
+ dss[newds][i] = sns[i];
+
+ dfasiz[newds] = numstates;
+ dhash[newds] = hashval;
+
+ if (nacc == 0) {
+ if (reject)
+ dfaacc[newds].dfaacc_set = (int *) 0;
+ else
+ dfaacc[newds].dfaacc_state = 0;
+
+ accsiz[newds] = 0;
+ }
+
+ else if (reject) {
+ /* We sort the accepting set in increasing order so the
+ * disambiguating rule that the first rule listed is considered
+ * match in the event of ties will work.
+ */
+
+ qsort (&accset [1], nacc, sizeof (accset [1]), intcmp);
+
+ dfaacc[newds].dfaacc_set =
+ allocate_integer_array (nacc + 1);
+
+ /* Save the accepting set for later */
+ for (i = 1; i <= nacc; ++i) {
+ dfaacc[newds].dfaacc_set[i] = accset[i];
+
+ if (accset[i] <= num_rules)
+ /* Who knows, perhaps a REJECT can yield
+ * this rule.
+ */
+ rule_useful[accset[i]] = true;
+ }
+
+ accsiz[newds] = nacc;
+ }
+
+ else {
+ /* Find lowest numbered rule so the disambiguating rule
+ * will work.
+ */
+ j = num_rules + 1;
+
+ for (i = 1; i <= nacc; ++i)
+ if (accset[i] < j)
+ j = accset[i];
+
+ dfaacc[newds].dfaacc_state = j;
+
+ if (j <= num_rules)
+ rule_useful[j] = true;
+ }
+
+ *newds_addr = newds;
+
+ return 1;
+}
+
+
+/* symfollowset - follow the symbol transitions one step
+ *
+ * synopsis
+ * numstates = symfollowset( int ds[current_max_dfa_size], int dsize,
+ * int transsym, int nset[current_max_dfa_size] );
+ */
+
+int symfollowset (ds, dsize, transsym, nset)
+ int ds[], dsize, transsym, nset[];
+{
+ int ns, tsp, sym, i, j, lenccl, ch, numstates, ccllist;
+
+ numstates = 0;
+
+ for (i = 1; i <= dsize; ++i) { /* for each nfa state ns in the state set of ds */
+ ns = ds[i];
+ sym = transchar[ns];
+ tsp = trans1[ns];
+
+ if (sym < 0) { /* it's a character class */
+ sym = -sym;
+ ccllist = cclmap[sym];
+ lenccl = ccllen[sym];
+
+ if (cclng[sym]) {
+ for (j = 0; j < lenccl; ++j) {
+ /* Loop through negated character
+ * class.
+ */
+ ch = ccltbl[ccllist + j];
+
+ if (ch == 0)
+ ch = NUL_ec;
+
+ if (ch > transsym)
+ /* Transsym isn't in negated
+ * ccl.
+ */
+ break;
+
+ else if (ch == transsym)
+ /* next 2 */
+ goto bottom;
+ }
+
+ /* Didn't find transsym in ccl. */
+ nset[++numstates] = tsp;
+ }
+
+ else
+ for (j = 0; j < lenccl; ++j) {
+ ch = ccltbl[ccllist + j];
+
+ if (ch == 0)
+ ch = NUL_ec;
+
+ if (ch > transsym)
+ break;
+ else if (ch == transsym) {
+ nset[++numstates] = tsp;
+ break;
+ }
+ }
+ }
+
+ else if (sym == SYM_EPSILON) { /* do nothing */
+ }
+
+ else if (ABS (ecgroup[sym]) == transsym)
+ nset[++numstates] = tsp;
+
+ bottom:;
+ }
+
+ return numstates;
+}
+
+
+/* sympartition - partition characters with same out-transitions
+ *
+ * synopsis
+ * sympartition( int ds[current_max_dfa_size], int numstates,
+ * int symlist[numecs], int duplist[numecs] );
+ */
+
+void sympartition (ds, numstates, symlist, duplist)
+ int ds[], numstates;
+ int symlist[], duplist[];
+{
+ int tch, i, j, k, ns, dupfwd[CSIZE + 1], lenccl, cclp, ich;
+
+ /* Partitioning is done by creating equivalence classes for those
+ * characters which have out-transitions from the given state. Thus
+ * we are really creating equivalence classes of equivalence classes.
+ */
+
+ for (i = 1; i <= numecs; ++i) { /* initialize equivalence class list */
+ duplist[i] = i - 1;
+ dupfwd[i] = i + 1;
+ }
+
+ duplist[1] = NIL;
+ dupfwd[numecs] = NIL;
+
+ for (i = 1; i <= numstates; ++i) {
+ ns = ds[i];
+ tch = transchar[ns];
+
+ if (tch != SYM_EPSILON) {
+ if (tch < -lastccl || tch >= csize) {
+ flexfatal (_
+ ("bad transition character detected in sympartition()"));
+ }
+
+ if (tch >= 0) { /* character transition */
+ int ec = ecgroup[tch];
+
+ mkechar (ec, dupfwd, duplist);
+ symlist[ec] = 1;
+ }
+
+ else { /* character class */
+ tch = -tch;
+
+ lenccl = ccllen[tch];
+ cclp = cclmap[tch];
+ mkeccl (ccltbl + cclp, lenccl, dupfwd,
+ duplist, numecs, NUL_ec);
+
+ if (cclng[tch]) {
+ j = 0;
+
+ for (k = 0; k < lenccl; ++k) {
+ ich = ccltbl[cclp + k];
+
+ if (ich == 0)
+ ich = NUL_ec;
+
+ for (++j; j < ich; ++j)
+ symlist[j] = 1;
+ }
+
+ for (++j; j <= numecs; ++j)
+ symlist[j] = 1;
+ }
+
+ else
+ for (k = 0; k < lenccl; ++k) {
+ ich = ccltbl[cclp + k];
+
+ if (ich == 0)
+ ich = NUL_ec;
+
+ symlist[ich] = 1;
+ }
+ }
+ }
+ }
+}
diff --git a/src/ecs.c b/src/ecs.c
new file mode 100644
index 0000000..b206351
--- /dev/null
+++ b/src/ecs.c
@@ -0,0 +1,219 @@
+/* ecs - equivalence class routines */
+
+/* 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"
+
+/* ccl2ecl - convert character classes to set of equivalence classes */
+
+void ccl2ecl ()
+{
+ int i, ich, newlen, cclp, ccls, cclmec;
+
+ for (i = 1; i <= lastccl; ++i) {
+ /* We loop through each character class, and for each character
+ * in the class, add the character's equivalence class to the
+ * new "character" class we are creating. Thus when we are all
+ * done, character classes will really consist of collections
+ * of equivalence classes
+ */
+
+ newlen = 0;
+ cclp = cclmap[i];
+
+ for (ccls = 0; ccls < ccllen[i]; ++ccls) {
+ ich = ccltbl[cclp + ccls];
+ cclmec = ecgroup[ich];
+
+ if (cclmec > 0) {
+ ccltbl[cclp + newlen] = cclmec;
+ ++newlen;
+ }
+ }
+
+ ccllen[i] = newlen;
+ }
+}
+
+
+/* cre8ecs - associate equivalence class numbers with class members
+ *
+ * fwd is the forward linked-list of equivalence class members. bck
+ * is the backward linked-list, and num is the number of class members.
+ *
+ * Returned is the number of classes.
+ */
+
+int cre8ecs (fwd, bck, num)
+ int fwd[], bck[], num;
+{
+ int i, j, numcl;
+
+ numcl = 0;
+
+ /* Create equivalence class numbers. From now on, ABS( bck(x) )
+ * is the equivalence class number for object x. If bck(x)
+ * is positive, then x is the representative of its equivalence
+ * class.
+ */
+ for (i = 1; i <= num; ++i)
+ if (bck[i] == NIL) {
+ bck[i] = ++numcl;
+ for (j = fwd[i]; j != NIL; j = fwd[j])
+ bck[j] = -numcl;
+ }
+
+ return numcl;
+}
+
+
+/* mkeccl - update equivalence classes based on character class xtions
+ *
+ * synopsis
+ * Char ccls[];
+ * int lenccl, fwd[llsiz], bck[llsiz], llsiz, NUL_mapping;
+ * void mkeccl( Char ccls[], int lenccl, int fwd[llsiz], int bck[llsiz],
+ * int llsiz, int NUL_mapping );
+ *
+ * ccls contains the elements of the character class, lenccl is the
+ * number of elements in the ccl, fwd is the forward link-list of equivalent
+ * characters, bck is the backward link-list, and llsiz size of the link-list.
+ *
+ * NUL_mapping is the value which NUL (0) should be mapped to.
+ */
+
+void mkeccl (ccls, lenccl, fwd, bck, llsiz, NUL_mapping)
+ Char ccls[];
+ int lenccl, fwd[], bck[], llsiz, NUL_mapping;
+{
+ int cclp, oldec, newec;
+ int cclm, i, j;
+ static unsigned char cclflags[CSIZE]; /* initialized to all '\0' */
+
+ /* Note that it doesn't matter whether or not the character class is
+ * negated. The same results will be obtained in either case.
+ */
+
+ cclp = 0;
+
+ while (cclp < lenccl) {
+ cclm = ccls[cclp];
+
+ if (NUL_mapping && cclm == 0)
+ cclm = NUL_mapping;
+
+ oldec = bck[cclm];
+ newec = cclm;
+
+ j = cclp + 1;
+
+ for (i = fwd[cclm]; i != NIL && i <= llsiz; i = fwd[i]) { /* look for the symbol in the character class */
+ for (; j < lenccl; ++j) {
+ int ccl_char;
+
+ if (NUL_mapping && ccls[j] == 0)
+ ccl_char = NUL_mapping;
+ else
+ ccl_char = ccls[j];
+
+ if (ccl_char > i)
+ break;
+
+ if (ccl_char == i && !cclflags[j]) {
+ /* We found an old companion of cclm
+ * in the ccl. Link it into the new
+ * equivalence class and flag it as
+ * having been processed.
+ */
+
+ bck[i] = newec;
+ fwd[newec] = i;
+ newec = i;
+ /* Set flag so we don't reprocess. */
+ cclflags[j] = 1;
+
+ /* Get next equivalence class member. */
+ /* continue 2 */
+ goto next_pt;
+ }
+ }
+
+ /* Symbol isn't in character class. Put it in the old
+ * equivalence class.
+ */
+
+ bck[i] = oldec;
+
+ if (oldec != NIL)
+ fwd[oldec] = i;
+
+ oldec = i;
+
+ next_pt:;
+ }
+
+ if (bck[cclm] != NIL || oldec != bck[cclm]) {
+ bck[cclm] = NIL;
+ fwd[oldec] = NIL;
+ }
+
+ fwd[newec] = NIL;
+
+ /* Find next ccl member to process. */
+
+ for (++cclp; cclp < lenccl && cclflags[cclp]; ++cclp) {
+ /* Reset "doesn't need processing" flag. */
+ cclflags[cclp] = 0;
+ }
+ }
+}
+
+
+/* mkechar - create equivalence class for single character */
+
+void mkechar (tch, fwd, bck)
+ int tch, fwd[], bck[];
+{
+ /* If until now the character has been a proper subset of
+ * an equivalence class, break it away to create a new ec
+ */
+
+ if (fwd[tch] != NIL)
+ bck[fwd[tch]] = bck[tch];
+
+ if (bck[tch] != NIL)
+ fwd[bck[tch]] = fwd[tch];
+
+ fwd[tch] = NIL;
+ bck[tch] = NIL;
+}
diff --git a/src/filter.c b/src/filter.c
new file mode 100644
index 0000000..987366a
--- /dev/null
+++ b/src/filter.c
@@ -0,0 +1,439 @@
+/* filter - postprocessing of flex output through filters */
+
+/* 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"
+static const char * check_4_gnu_m4 =
+ "m4_dnl ifdef(`__gnu__', ,"
+ "`errprint(Flex requires GNU M4. Set the PATH or set the M4 environment variable to its path name.)"
+ " m4exit(2)')\n";
+
+
+/** global chain. */
+struct filter *output_chain = NULL;
+
+/* Allocate and initialize an external filter.
+ * @param chain the current chain or NULL for new chain
+ * @param cmd the command to execute.
+ * @param ... a NULL terminated list of (const char*) arguments to command,
+ * not including argv[0].
+ * @return newest filter in chain
+ */
+struct filter *filter_create_ext (struct filter *chain, const char *cmd,
+ ...)
+{
+ struct filter *f;
+ int max_args;
+ const char *s;
+ va_list ap;
+
+ /* allocate and initialize new filter */
+ f = (struct filter *) flex_alloc (sizeof (struct filter));
+ if (!f)
+ flexerror (_("flex_alloc failed (f) in filter_create_ext"));
+ memset (f, 0, sizeof (*f));
+ f->filter_func = NULL;
+ f->extra = NULL;
+ f->next = NULL;
+ f->argc = 0;
+
+ if (chain != NULL) {
+ /* append f to end of chain */
+ while (chain->next)
+ chain = chain->next;
+ chain->next = f;
+ }
+
+
+ /* allocate argv, and populate it with the argument list. */
+ max_args = 8;
+ f->argv =
+ (const char **) flex_alloc (sizeof (char *) *
+ (max_args + 1));
+ if (!f->argv)
+ flexerror (_("flex_alloc failed (f->argv) in filter_create_ext"));
+ f->argv[f->argc++] = cmd;
+
+ va_start (ap, cmd);
+ while ((s = va_arg (ap, const char *)) != NULL) {
+ if (f->argc >= max_args) {
+ max_args += 8;
+ f->argv =
+ (const char **) flex_realloc (f->argv,
+ sizeof (char
+ *) *
+ (max_args +
+ 1));
+ }
+ f->argv[f->argc++] = s;
+ }
+ f->argv[f->argc] = NULL;
+
+ va_end (ap);
+ return f;
+}
+
+/* Allocate and initialize an internal filter.
+ * @param chain the current chain or NULL for new chain
+ * @param filter_func The function that will perform the filtering.
+ * filter_func should return 0 if successful, and -1
+ * if an error occurs -- or it can simply exit().
+ * @param extra optional user-defined data to pass to the filter.
+ * @return newest filter in chain
+ */
+struct filter *filter_create_int (struct filter *chain,
+ int (*filter_func) (struct filter *),
+ void *extra)
+{
+ struct filter *f;
+
+ /* allocate and initialize new filter */
+ f = (struct filter *) flex_alloc (sizeof (struct filter));
+ if (!f)
+ flexerror (_("flex_alloc failed in filter_create_int"));
+ memset (f, 0, sizeof (*f));
+ f->next = NULL;
+ f->argc = 0;
+ f->argv = NULL;
+
+ f->filter_func = filter_func;
+ f->extra = extra;
+
+ if (chain != NULL) {
+ /* append f to end of chain */
+ while (chain->next)
+ chain = chain->next;
+ chain->next = f;
+ }
+
+ return f;
+}
+
+/** Fork and exec entire filter chain.
+ * @param chain The head of the chain.
+ * @return true on success.
+ */
+bool filter_apply_chain (struct filter * chain)
+{
+ int pid, pipes[2];
+
+
+ /* Tricky recursion, since we want to begin the chain
+ * at the END. Why? Because we need all the forked processes
+ * to be children of the main flex process.
+ */
+ if (chain)
+ filter_apply_chain (chain->next);
+ else
+ return true;
+
+ /* Now we are the right-most unprocessed link in the chain.
+ */
+
+ fflush (stdout);
+ fflush (stderr);
+
+
+ if (pipe (pipes) == -1)
+ flexerror (_("pipe failed"));
+
+ if ((pid = fork ()) == -1)
+ flexerror (_("fork failed"));
+
+ if (pid == 0) {
+ /* child */
+
+ /* We need stdin (the FILE* stdin) to connect to this new pipe.
+ * There is no portable way to set stdin to a new file descriptor,
+ * as stdin is not an lvalue on some systems (BSD).
+ * So we dup the new pipe onto the stdin descriptor and use a no-op fseek
+ * to sync the stream. This is a Hail Mary situation. It seems to work.
+ */
+ close (pipes[1]);
+clearerr(stdin);
+ if (dup2 (pipes[0], fileno (stdin)) == -1)
+ flexfatal (_("dup2(pipes[0],0)"));
+ close (pipes[0]);
+ fseek (stdin, 0, SEEK_CUR);
+
+ /* run as a filter, either internally or by exec */
+ if (chain->filter_func) {
+ int r;
+
+ if ((r = chain->filter_func (chain)) == -1)
+ flexfatal (_("filter_func failed"));
+ exit (0);
+ }
+ else {
+ execvp (chain->argv[0],
+ (char **const) (chain->argv));
+ lerr_fatal ( _("exec of %s failed"),
+ chain->argv[0]);
+ }
+
+ exit (1);
+ }
+
+ /* Parent */
+ close (pipes[0]);
+ if (dup2 (pipes[1], fileno (stdout)) == -1)
+ flexfatal (_("dup2(pipes[1],1)"));
+ close (pipes[1]);
+ fseek (stdout, 0, SEEK_CUR);
+
+ return true;
+}
+
+/** Truncate the chain to max_len number of filters.
+ * @param chain the current chain.
+ * @param max_len the maximum length of the chain.
+ * @return the resulting length of the chain.
+ */
+int filter_truncate (struct filter *chain, int max_len)
+{
+ int len = 1;
+
+ if (!chain)
+ return 0;
+
+ while (chain->next && len < max_len) {
+ chain = chain->next;
+ ++len;
+ }
+
+ chain->next = NULL;
+ return len;
+}
+
+/** Splits the chain in order to write to a header file.
+ * Similar in spirit to the 'tee' program.
+ * The header file name is in extra.
+ * @return 0 (zero) on success, and -1 on failure.
+ */
+int filter_tee_header (struct filter *chain)
+{
+ /* This function reads from stdin and writes to both the C file and the
+ * header file at the same time.
+ */
+
+ const int readsz = 512;
+ char *buf;
+ int to_cfd = -1;
+ FILE *to_c = NULL, *to_h = NULL;
+ bool write_header;
+
+ write_header = (chain->extra != NULL);
+
+ /* Store a copy of the stdout pipe, which is already piped to C file
+ * through the running chain. Then create a new pipe to the H file as
+ * stdout, and fork the rest of the chain again.
+ */
+
+ if ((to_cfd = dup (1)) == -1)
+ flexfatal (_("dup(1) failed"));
+ to_c = fdopen (to_cfd, "w");
+
+ if (write_header) {
+ if (freopen ((char *) chain->extra, "w", stdout) == NULL)
+ flexfatal (_("freopen(headerfilename) failed"));
+
+ filter_apply_chain (chain->next);
+ to_h = stdout;
+ }
+
+ /* Now to_c is a pipe to the C branch, and to_h is a pipe to the H branch.
+ */
+
+ if (write_header) {
+ fputs (check_4_gnu_m4, to_h);
+ fputs ("m4_changecom`'m4_dnl\n", to_h);
+ fputs ("m4_changequote`'m4_dnl\n", to_h);
+ fputs ("m4_changequote([[,]])[[]]m4_dnl\n", to_h);
+ fputs ("m4_define([[M4_YY_NOOP]])[[]]m4_dnl\n", to_h);
+ fputs ("m4_define( [[M4_YY_IN_HEADER]],[[]])m4_dnl\n",
+ to_h);
+ fprintf (to_h, "#ifndef %sHEADER_H\n", prefix);
+ fprintf (to_h, "#define %sHEADER_H 1\n", prefix);
+ fprintf (to_h, "#define %sIN_HEADER 1\n\n", prefix);
+ fprintf (to_h,
+ "m4_define( [[M4_YY_OUTFILE_NAME]],[[%s]])m4_dnl\n",
+ headerfilename ? headerfilename : "<stdout>");
+
+ }
+
+ fputs (check_4_gnu_m4, to_c);
+ fputs ("m4_changecom`'m4_dnl\n", to_c);
+ fputs ("m4_changequote`'m4_dnl\n", to_c);
+ fputs ("m4_changequote([[,]])[[]]m4_dnl\n", to_c);
+ fputs ("m4_define([[M4_YY_NOOP]])[[]]m4_dnl\n", to_c);
+ fprintf (to_c, "m4_define( [[M4_YY_OUTFILE_NAME]],[[%s]])m4_dnl\n",
+ outfilename ? outfilename : "<stdout>");
+
+ buf = (char *) flex_alloc (readsz);
+ if (!buf)
+ flexerror (_("flex_alloc failed in filter_tee_header"));
+ while (fgets (buf, readsz, stdin)) {
+ fputs (buf, to_c);
+ if (write_header)
+ fputs (buf, to_h);
+ }
+
+ if (write_header) {
+ fprintf (to_h, "\n");
+
+ /* write a fake line number. It will get fixed by the linedir filter. */
+ fprintf (to_h, "#line 4000 \"M4_YY_OUTFILE_NAME\"\n");
+
+ fprintf (to_h, "#undef %sIN_HEADER\n", prefix);
+ fprintf (to_h, "#endif /* %sHEADER_H */\n", prefix);
+ fputs ("m4_undefine( [[M4_YY_IN_HEADER]])m4_dnl\n", to_h);
+
+ fflush (to_h);
+ if (ferror (to_h))
+ lerr (_("error writing output file %s"),
+ (char *) chain->extra);
+
+ else if (fclose (to_h))
+ lerr (_("error closing output file %s"),
+ (char *) chain->extra);
+ }
+
+ fflush (to_c);
+ if (ferror (to_c))
+ lerr (_("error writing output file %s"),
+ outfilename ? outfilename : "<stdout>");
+
+ else if (fclose (to_c))
+ lerr (_("error closing output file %s"),
+ outfilename ? outfilename : "<stdout>");
+
+ while (wait (0) > 0) ;
+
+ exit (0);
+ return 0;
+}
+
+/** Adjust the line numbers in the #line directives of the generated scanner.
+ * After the m4 expansion, the line numbers are incorrect since the m4 macros
+ * can add or remove lines. This only adjusts line numbers for generated code,
+ * not user code. This also happens to be a good place to squeeze multiple
+ * blank lines into a single blank line.
+ */
+int filter_fix_linedirs (struct filter *chain)
+{
+ char *buf;
+ const int readsz = 512;
+ int lineno = 1;
+ bool in_gen = true; /* in generated code */
+ bool last_was_blank = false;
+
+ if (!chain)
+ return 0;
+
+ buf = (char *) flex_alloc (readsz);
+ if (!buf)
+ flexerror (_("flex_alloc failed in filter_fix_linedirs"));
+
+ while (fgets (buf, readsz, stdin)) {
+
+ regmatch_t m[10];
+
+ /* Check for #line directive. */
+ if (buf[0] == '#'
+ && regexec (&regex_linedir, buf, 3, m, 0) == 0) {
+
+ char *fname;
+
+ /* extract the line number and filename */
+ fname = regmatch_dup (&m[2], buf);
+
+ if (strcmp (fname,
+ outfilename ? outfilename : "<stdout>")
+ == 0
+ || strcmp (fname,
+ headerfilename ? headerfilename : "<stdout>")
+ == 0) {
+
+ char *s1, *s2;
+ char filename[MAXLINE];
+
+ s1 = fname;
+ s2 = filename;
+
+ while ((s2 - filename) < (MAXLINE - 1) && *s1) {
+ /* Escape the backslash */
+ if (*s1 == '\\')
+ *s2++ = '\\';
+ /* Escape the double quote */
+ if (*s1 == '\"')
+ *s2++ = '\\';
+ /* Copy the character as usual */
+ *s2++ = *s1++;
+ }
+
+ *s2 = '\0';
+
+ /* Adjust the line directives. */
+ in_gen = true;
+ snprintf (buf, readsz, "#line %d \"%s\"\n",
+ lineno + 1, filename);
+ }
+ else {
+ /* it's a #line directive for code we didn't write */
+ in_gen = false;
+ }
+
+ free (fname);
+ last_was_blank = false;
+ }
+
+ /* squeeze blank lines from generated code */
+ else if (in_gen
+ && regexec (&regex_blank_line, buf, 0, NULL,
+ 0) == 0) {
+ if (last_was_blank)
+ continue;
+ else
+ last_was_blank = true;
+ }
+
+ else {
+ /* it's a line of normal, non-empty code. */
+ last_was_blank = false;
+ }
+
+ fputs (buf, stdout);
+ lineno++;
+ }
+ fflush (stdout);
+ if (ferror (stdout))
+ lerr (_("error writing output file %s"),
+ outfilename ? outfilename : "<stdout>");
+
+ else if (fclose (stdout))
+ lerr (_("error closing output file %s"),
+ outfilename ? outfilename : "<stdout>");
+
+ return 0;
+}
+
+/* vim:set expandtab cindent tabstop=4 softtabstop=4 shiftwidth=4 textwidth=0: */
diff --git a/src/flex.skl b/src/flex.skl
new file mode 100644
index 0000000..73a0b9e
--- /dev/null
+++ b/src/flex.skl
@@ -0,0 +1,3552 @@
+%# -*-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 `m4preproc_' 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.
+m4preproc_changecom
+
+%# 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 FLEX_MAJOR_VERSION
+#define YY_FLEX_MINOR_VERSION FLEX_MINOR_VERSION
+#define YY_FLEX_SUBMINOR_VERSION FLEX_SUBMINOR_VERSION
+#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]])]])
+
+m4preproc_define(`M4_GEN_PREFIX',
+ ``m4_define(yy[[$1]], [[M4_YY_PREFIX[[$1]]m4_ifelse($'`#,0,,[[($'`@)]])]])'')
+
+%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_GEN_PREFIX(`_create_buffer')
+ M4_GEN_PREFIX(`_delete_buffer')
+ M4_GEN_PREFIX(`_scan_buffer')
+ M4_GEN_PREFIX(`_scan_string')
+ M4_GEN_PREFIX(`_scan_bytes')
+ M4_GEN_PREFIX(`_init_buffer')
+ M4_GEN_PREFIX(`_flush_buffer')
+ M4_GEN_PREFIX(`_load_buffer_state')
+ M4_GEN_PREFIX(`_switch_to_buffer')
+ M4_GEN_PREFIX(`push_buffer_state')
+ M4_GEN_PREFIX(`pop_buffer_state')
+ M4_GEN_PREFIX(`ensure_buffer_stack')
+ M4_GEN_PREFIX(`lex')
+ M4_GEN_PREFIX(`restart')
+ M4_GEN_PREFIX(`lex_init')
+ M4_GEN_PREFIX(`lex_init_extra')
+ M4_GEN_PREFIX(`lex_destroy')
+ M4_GEN_PREFIX(`get_debug')
+ M4_GEN_PREFIX(`set_debug')
+ M4_GEN_PREFIX(`get_extra')
+ M4_GEN_PREFIX(`set_extra')
+ M4_GEN_PREFIX(`get_in')
+ M4_GEN_PREFIX(`set_in')
+ M4_GEN_PREFIX(`get_out')
+ M4_GEN_PREFIX(`set_out')
+ M4_GEN_PREFIX(`get_leng')
+ M4_GEN_PREFIX(`get_text')
+ M4_GEN_PREFIX(`get_lineno')
+ M4_GEN_PREFIX(`set_lineno')
+ m4_ifdef( [[M4_YY_REENTRANT]],
+ [[
+ M4_GEN_PREFIX(`get_column')
+ M4_GEN_PREFIX(`set_column')
+ ]])
+ M4_GEN_PREFIX(`wrap')
+%endif
+
+m4_ifdef( [[M4_YY_BISON_LVAL]],
+[[
+ M4_GEN_PREFIX(`get_lval')
+ M4_GEN_PREFIX(`set_lval')
+]])
+
+m4_ifdef( [[<M4_YY_BISON_LLOC>]],
+[[
+ M4_GEN_PREFIX(`get_lloc')
+ M4_GEN_PREFIX(`set_lloc')
+]])
+
+
+ M4_GEN_PREFIX(`alloc')
+ M4_GEN_PREFIX(`realloc')
+ M4_GEN_PREFIX(`free')
+
+%if-c-only
+m4_ifdef( [[M4_YY_NOT_REENTRANT]],
+[[
+ M4_GEN_PREFIX(`text')
+ M4_GEN_PREFIX(`leng')
+ M4_GEN_PREFIX(`in')
+ M4_GEN_PREFIX(`out')
+ M4_GEN_PREFIX(`_flex_debug')
+ M4_GEN_PREFIX(`lineno')
+]])
+%endif
+
+
+m4_ifdef( [[M4_YY_TABLES_EXTERNAL]],
+[[
+ M4_GEN_PREFIX(`tables_fload')
+ M4_GEN_PREFIX(`tables_destroy')
+ M4_GEN_PREFIX(`TABLES_NAME')
+]])
+
+/* 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++
+m4preproc_include(`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
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k.
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
+ * Ditto for the __ia64__ case accordingly.
+ */
+#define YY_BUF_SIZE 32768
+#else
+#define YY_BUF_SIZE 16384
+#endif /* __ia64__ */
+#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::streambuf* 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 );
+#if defined(__GNUC__) && __GNUC__ >= 3
+__attribute__((__noreturn__))
+#endif
+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
+#ifndef YY_NO_UNPUT
+ m4_ifdef( [[M4_YY_NO_UNPUT]],,
+ [[
+ static void yyunput M4_YY_PARAMS( int c, char *buf_ptr M4_YY_PROTO_LAST_ARG);
+ ]])
+#endif
+%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
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k */
+#define YY_READ_BUF_SIZE 16384
+#else
+#define YY_READ_BUF_SIZE 8192
+#endif /* __ia64__ */
+#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 ( (int)(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
+m4preproc_include(`tables_shared.h')
+
+/* 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 /*LINTED*/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
+{
+ yy_state_type yy_current_state;
+ char *yy_cp, *yy_bp;
+ 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.rdbuf(std::cin.rdbuf());
+%endif
+
+ if ( ! yyout )
+%if-c-only
+ yyout = stdout;
+%endif
+%if-c++-only
+ yyout.rdbuf(std::cout.rdbuf());
+%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 ( /*CONSTCOND*/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;
+%if-c-only
+ YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
+%endif
+%if-c++-only
+ YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin.rdbuf();
+%endif
+ 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.
+ * This constructor simply maintains backward compatibility.
+ * DEPRECATED
+ */
+yyFlexLexer::yyFlexLexer( FLEX_STD istream* arg_yyin, FLEX_STD ostream* arg_yyout ):
+ yyin(arg_yyin ? arg_yyin->rdbuf() : std::cin.rdbuf()),
+ yyout(arg_yyout ? arg_yyout->rdbuf() : std::cout.rdbuf())
+{
+ ctor_common();
+}
+
+/* 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.rdbuf()),
+ yyout(arg_yyout.rdbuf())
+{
+ ctor_common();
+}
+
+/* The contents of this function are C++ specific, so the YY_G macro is not used.
+ */
+void yyFlexLexer::ctor_common()
+{
+ 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 )
+{
+ // was 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);
+
+ // was if( new_out )
+ yyout.rdbuf(new_out.rdbuf());
+}
+
+/* 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 ) {
+ new_in = &yyin;
+ }
+
+ if ( ! new_out ) {
+ new_out = &yyout;
+ }
+
+ switch_streams(*new_in, *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();
+ char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+ char *source = YY_G(yytext_ptr);
+ yy_size_t 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 = (yy_size_t) (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
+{
+ yy_state_type yy_current_state;
+ 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
+{
+ 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;
+}
+
+
+#ifndef YY_NO_UNPUT
+%if-c-only
+m4_ifdef( [[M4_YY_NO_UNPUT]],,
+[[
+ static void yyunput YYFARGS2( int,c, char *,yy_bp)
+%endif
+%if-c++-only
+ void yyFlexLexer::yyunput( int c, char* yy_bp)
+%endif
+{
+ 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. */
+ yy_size_t number_to_move = YY_G(yy_n_chars) + 2;
+ char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
+ 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
+#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 );
+}
+
+%if-c++-only
+/** Delegate to the new version that takes an istream reference.
+ * @param input_file A readable stream.
+ * M4_YY_DOC_PARAM
+ * @note This function does not reset the start condition to @c INITIAL .
+ */
+void yyFlexLexer::yyrestart( std::istream* input_file )
+{
+ yyrestart( *input_file );
+}
+%endif
+
+/** 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;
+%if-c-only
+ yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+%endif
+%if-c++-only
+ yyin.rdbuf(YY_CURRENT_BUFFER_LVALUE->yy_input_file);
+%endif
+ 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 = (yy_size_t)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;
+}
+
+%if-c++-only
+/** Delegate creation of buffers to the new version that takes an istream reference.
+ * @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.
+ */
+ YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( std::istream* file, int size )
+{
+ return yy_create_buffer( *file, size );
+}
+%endif
+
+/** 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);
+
+%if-c-only
+ b->yy_input_file = file;
+%endif
+%if-c++-only
+ b->yy_input_file = file.rdbuf();
+%endif
+ 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; // After all that talk, this was set to 1 anyways...
+ 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. */
+ yy_size_t 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_YY_DECL_GUTS_VAR();
+ M4_YY_NOOP_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 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 _column_no column 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
+%# Actually, that ended an if-rentrant section
+
+%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)
+{
+ M4_YY_DECL_GUTS_VAR();
+ M4_YY_NOOP_GUTS_VAR();
+
+ 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)
+{
+ 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)
+{
+ M4_YY_DECL_GUTS_VAR();
+ M4_YY_NOOP_GUTS_VAR();
+ return (void *) malloc( size );
+}
+]])
+
+m4_ifdef( [[M4_YY_NO_FLEX_REALLOC]],,
+[[
+void *yyrealloc YYFARGS2( void *,ptr, yy_size_t ,size)
+{
+ M4_YY_DECL_GUTS_VAR();
+ M4_YY_NOOP_GUTS_VAR();
+
+ /* 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)
+{
+ M4_YY_DECL_GUTS_VAR();
+ M4_YY_NOOP_GUTS_VAR();
+ free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
+}
+]])
+
+%if-tables-serialization definitions
+m4preproc_include(`tables_shared.c')
+
+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)
+{
+ size_t 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)
+{
+ M4_YY_DECL_GUTS_VAR();
+ M4_YY_NOOP_GUTS_VAR();
+
+ while (dmap->dm_id)
+ if ((int)(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
+]])
diff --git a/src/flexdef.h b/src/flexdef.h
new file mode 100644
index 0000000..496e34c
--- /dev/null
+++ b/src/flexdef.h
@@ -0,0 +1,1232 @@
+
+/* flexdef - definitions file for flex */
+
+/* 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. */
+
+#ifndef FLEXDEF_H
+#define FLEXDEF_H 1
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+/* AIX requires this to be the first thing in the file. */
+#if !defined(__GNUC__) && !defined(__lint__)
+# if HAVE_ALLOCA_H
+# include <alloca.h>
+# else
+# ifdef _AIX
+ #pragma alloca
+# else
+# ifndef alloca /* predefined by HP cc +Olibcalls */
+char *alloca ();
+# endif
+# endif
+# endif
+#endif
+
+#ifdef STDC_HEADERS
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <setjmp.h>
+#include <ctype.h>
+#include <string.h>
+#include <math.h>
+#endif
+#ifdef HAVE_ASSERT_H
+#include <assert.h>
+#else
+#define assert(Pred)
+#endif
+
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_SYS_PARAMS_H
+#include <sys/params.h>
+#endif
+#ifdef HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+#ifdef HAVE_STDBOOL_H
+#include <stdbool.h>
+#else
+#define bool int
+#define true 1
+#define false 0
+#endif
+#ifdef HAVE_REGEX_H
+#include <regex.h>
+#endif
+#include "flexint.h"
+
+/* We use gettext. So, when we write strings which should be translated, we mark them with _() */
+#ifdef ENABLE_NLS
+#ifdef HAVE_LOCALE_H
+#include <locale.h>
+#endif /* HAVE_LOCALE_H */
+#include "gettext.h"
+#define _(String) gettext (String)
+#else
+#define _(STRING) STRING
+#endif /* ENABLE_NLS */
+
+/* Always be prepared to generate an 8-bit scanner. */
+#define CSIZE 256
+#define Char unsigned char
+
+/* Size of input alphabet - should be size of ASCII set. */
+#ifndef DEFAULT_CSIZE
+#define DEFAULT_CSIZE 128
+#endif
+
+#ifndef PROTO
+#if defined(__STDC__)
+#define PROTO(proto) proto
+#else
+#define PROTO(proto) ()
+#endif
+#endif
+
+#ifdef VMS
+#ifndef __VMS_POSIX
+#define unlink remove
+#define SHORT_FILE_NAMES
+#endif
+#endif
+
+#ifdef MS_DOS
+#define SHORT_FILE_NAMES
+#endif
+
+
+/* Maximum line length we'll have to deal with. */
+#define MAXLINE 2048
+
+#ifndef MIN
+#define MIN(x,y) ((x) < (y) ? (x) : (y))
+#endif
+#ifndef MAX
+#define MAX(x,y) ((x) > (y) ? (x) : (y))
+#endif
+#ifndef ABS
+#define ABS(x) ((x) < 0 ? -(x) : (x))
+#endif
+
+
+/* ANSI C does not guarantee that isascii() is defined */
+#ifndef isascii
+#define isascii(c) ((c) <= 0177)
+#endif
+
+#define unspecified -1
+
+/* Special chk[] values marking the slots taking by end-of-buffer and action
+ * numbers.
+ */
+#define EOB_POSITION -1
+#define ACTION_POSITION -2
+
+/* Number of data items per line for -f output. */
+#define NUMDATAITEMS 10
+
+/* Number of lines of data in -f output before inserting a blank line for
+ * readability.
+ */
+#define NUMDATALINES 10
+
+/* transition_struct_out() definitions. */
+#define TRANS_STRUCT_PRINT_LENGTH 14
+
+/* Returns true if an nfa state has an epsilon out-transition slot
+ * that can be used. This definition is currently not used.
+ */
+#define FREE_EPSILON(state) \
+ (transchar[state] == SYM_EPSILON && \
+ trans2[state] == NO_TRANSITION && \
+ finalst[state] != state)
+
+/* Returns true if an nfa state has an epsilon out-transition character
+ * and both slots are free
+ */
+#define SUPER_FREE_EPSILON(state) \
+ (transchar[state] == SYM_EPSILON && \
+ trans1[state] == NO_TRANSITION) \
+
+/* Maximum number of NFA states that can comprise a DFA state. It's real
+ * big because if there's a lot of rules, the initial state will have a
+ * huge epsilon closure.
+ */
+#define INITIAL_MAX_DFA_SIZE 750
+#define MAX_DFA_SIZE_INCREMENT 750
+
+
+/* A note on the following masks. They are used to mark accepting numbers
+ * as being special. As such, they implicitly limit the number of accepting
+ * numbers (i.e., rules) because if there are too many rules the rule numbers
+ * will overload the mask bits. Fortunately, this limit is \large/ (0x2000 ==
+ * 8192) so unlikely to actually cause any problems. A check is made in
+ * new_rule() to ensure that this limit is not reached.
+ */
+
+/* Mask to mark a trailing context accepting number. */
+#define YY_TRAILING_MASK 0x2000
+
+/* Mask to mark the accepting number of the "head" of a trailing context
+ * rule.
+ */
+#define YY_TRAILING_HEAD_MASK 0x4000
+
+/* Maximum number of rules, as outlined in the above note. */
+#define MAX_RULE (YY_TRAILING_MASK - 1)
+
+
+/* NIL must be 0. If not, its special meaning when making equivalence classes
+ * (it marks the representative of a given e.c.) will be unidentifiable.
+ */
+#define NIL 0
+
+#define JAM -1 /* to mark a missing DFA transition */
+#define NO_TRANSITION NIL
+#define UNIQUE -1 /* marks a symbol as an e.c. representative */
+#define INFINITE_REPEAT -1 /* for x{5,} constructions */
+
+#define INITIAL_MAX_CCLS 100 /* max number of unique character classes */
+#define MAX_CCLS_INCREMENT 100
+
+/* Size of table holding members of character classes. */
+#define INITIAL_MAX_CCL_TBL_SIZE 500
+#define MAX_CCL_TBL_SIZE_INCREMENT 250
+
+#define INITIAL_MAX_RULES 100 /* default maximum number of rules */
+#define MAX_RULES_INCREMENT 100
+
+#define INITIAL_MNS 2000 /* default maximum number of nfa states */
+#define MNS_INCREMENT 1000 /* amount to bump above by if it's not enough */
+
+#define INITIAL_MAX_DFAS 1000 /* default maximum number of dfa states */
+#define MAX_DFAS_INCREMENT 1000
+
+#define JAMSTATE -32766 /* marks a reference to the state that always jams */
+
+/* Maximum number of NFA states. */
+#define MAXIMUM_MNS 31999
+#define MAXIMUM_MNS_LONG 1999999999
+
+/* Enough so that if it's subtracted from an NFA state number, the result
+ * is guaranteed to be negative.
+ */
+#define MARKER_DIFFERENCE (maximum_mns+2)
+
+/* Maximum number of nxt/chk pairs for non-templates. */
+#define INITIAL_MAX_XPAIRS 2000
+#define MAX_XPAIRS_INCREMENT 2000
+
+/* Maximum number of nxt/chk pairs needed for templates. */
+#define INITIAL_MAX_TEMPLATE_XPAIRS 2500
+#define MAX_TEMPLATE_XPAIRS_INCREMENT 2500
+
+#define SYM_EPSILON (CSIZE + 1) /* to mark transitions on the symbol epsilon */
+
+#define INITIAL_MAX_SCS 40 /* maximum number of start conditions */
+#define MAX_SCS_INCREMENT 40 /* amount to bump by if it's not enough */
+
+#define ONE_STACK_SIZE 500 /* stack of states with only one out-transition */
+#define SAME_TRANS -1 /* transition is the same as "default" entry for state */
+
+/* The following percentages are used to tune table compression:
+
+ * The percentage the number of out-transitions a state must be of the
+ * number of equivalence classes in order to be considered for table
+ * compaction by using protos.
+ */
+#define PROTO_SIZE_PERCENTAGE 15
+
+/* The percentage the number of homogeneous out-transitions of a state
+ * must be of the number of total out-transitions of the state in order
+ * that the state's transition table is first compared with a potential
+ * template of the most common out-transition instead of with the first
+ * proto in the proto queue.
+ */
+#define CHECK_COM_PERCENTAGE 50
+
+/* The percentage the number of differences between a state's transition
+ * table and the proto it was first compared with must be of the total
+ * number of out-transitions of the state in order to keep the first
+ * proto as a good match and not search any further.
+ */
+#define FIRST_MATCH_DIFF_PERCENTAGE 10
+
+/* The percentage the number of differences between a state's transition
+ * table and the most similar proto must be of the state's total number
+ * of out-transitions to use the proto as an acceptable close match.
+ */
+#define ACCEPTABLE_DIFF_PERCENTAGE 50
+
+/* The percentage the number of homogeneous out-transitions of a state
+ * must be of the number of total out-transitions of the state in order
+ * to consider making a template from the state.
+ */
+#define TEMPLATE_SAME_PERCENTAGE 60
+
+/* The percentage the number of differences between a state's transition
+ * table and the most similar proto must be of the state's total number
+ * of out-transitions to create a new proto from the state.
+ */
+#define NEW_PROTO_DIFF_PERCENTAGE 20
+
+/* The percentage the total number of out-transitions of a state must be
+ * of the number of equivalence classes in order to consider trying to
+ * fit the transition table into "holes" inside the nxt/chk table.
+ */
+#define INTERIOR_FIT_PERCENTAGE 15
+
+/* Size of region set aside to cache the complete transition table of
+ * protos on the proto queue to enable quick comparisons.
+ */
+#define PROT_SAVE_SIZE 2000
+
+#define MSP 50 /* maximum number of saved protos (protos on the proto queue) */
+
+/* Maximum number of out-transitions a state can have that we'll rummage
+ * around through the interior of the internal fast table looking for a
+ * spot for it.
+ */
+#define MAX_XTIONS_FULL_INTERIOR_FIT 4
+
+/* Maximum number of rules which will be reported as being associated
+ * with a DFA state.
+ */
+#define MAX_ASSOC_RULES 100
+
+/* Number that, if used to subscript an array, has a good chance of producing
+ * an error; should be small enough to fit into a short.
+ */
+#define BAD_SUBSCRIPT -32767
+
+/* Absolute value of largest number that can be stored in a short, with a
+ * bit of slop thrown in for general paranoia.
+ */
+#define MAX_SHORT 32700
+
+
+/* Declarations for global variables. */
+
+
+/* Variables for flags:
+ * printstats - if true (-v), dump statistics
+ * syntaxerror - true if a syntax error has been found
+ * eofseen - true if we've seen an eof in the input file
+ * ddebug - if true (-d), make a "debug" scanner
+ * trace - if true (-T), trace processing
+ * nowarn - if true (-w), do not generate warnings
+ * spprdflt - if true (-s), suppress the default rule
+ * interactive - if true (-I), generate an interactive scanner
+ * lex_compat - if true (-l), maximize compatibility with AT&T lex
+ * posix_compat - if true (-X), maximize compatibility with POSIX lex
+ * do_yylineno - if true, generate code to maintain yylineno
+ * useecs - if true (-Ce flag), use equivalence classes
+ * fulltbl - if true (-Cf flag), don't compress the DFA state table
+ * usemecs - if true (-Cm flag), use meta-equivalence classes
+ * fullspd - if true (-F flag), use Jacobson method of table representation
+ * gen_line_dirs - if true (i.e., no -L flag), generate #line directives
+ * performance_report - if > 0 (i.e., -p flag), generate a report relating
+ * to scanner performance; if > 1 (-p -p), report on minor performance
+ * problems, too
+ * backing_up_report - if true (i.e., -b flag), generate "lex.backup" file
+ * listing backing-up states
+ * C_plus_plus - if true (i.e., -+ flag), generate a C++ scanner class;
+ * otherwise, a standard C scanner
+ * reentrant - if true (-R), generate a reentrant C scanner.
+ * bison_bridge_lval - if true (--bison-bridge), bison pure calling convention.
+ * bison_bridge_lloc - if true (--bison-locations), bison yylloc.
+ * long_align - if true (-Ca flag), favor long-word alignment.
+ * use_read - if true (-f, -F, or -Cr) then use read() for scanner input;
+ * otherwise, use fread().
+ * yytext_is_array - if true (i.e., %array directive), then declare
+ * yytext as a array instead of a character pointer. Nice and inefficient.
+ * do_yywrap - do yywrap() processing on EOF. If false, EOF treated as
+ * "no more files".
+ * csize - size of character set for the scanner we're generating;
+ * 128 for 7-bit chars and 256 for 8-bit
+ * yymore_used - if true, yymore() is used in input rules
+ * reject - if true, generate back-up tables for REJECT macro
+ * real_reject - if true, scanner really uses REJECT (as opposed to just
+ * having "reject" set for variable trailing context)
+ * continued_action - true if this rule's action is to "fall through" to
+ * the next rule's action (i.e., the '|' action)
+ * in_rule - true if we're inside an individual rule, false if not.
+ * yymore_really_used - whether to treat yymore() as really used, regardless
+ * of what we think based on references to it in the user's actions.
+ * reject_really_used - same for REJECT
+ * trace_hex - use hexadecimal numbers in trace/debug outputs instead of octals
+ */
+
+extern int printstats, syntaxerror, eofseen, ddebug, trace, nowarn,
+ spprdflt;
+extern int interactive, lex_compat, posix_compat, do_yylineno;
+extern int useecs, fulltbl, usemecs, fullspd;
+extern int gen_line_dirs, performance_report, backing_up_report;
+extern int reentrant, bison_bridge_lval, bison_bridge_lloc;
+extern bool ansi_func_defs, ansi_func_protos;
+extern int C_plus_plus, long_align, use_read, yytext_is_array, do_yywrap;
+extern int csize;
+extern int yymore_used, reject, real_reject, continued_action, in_rule;
+
+extern int yymore_really_used, reject_really_used;
+extern int trace_hex;
+
+/* Variables used in the flex input routines:
+ * datapos - characters on current output line
+ * dataline - number of contiguous lines of data in current data
+ * statement. Used to generate readable -f output
+ * linenum - current input line number
+ * skelfile - the skeleton file
+ * skel - compiled-in skeleton array
+ * skel_ind - index into "skel" array, if skelfile is nil
+ * yyin - input file
+ * backing_up_file - file to summarize backing-up states to
+ * infilename - name of input file
+ * outfilename - name of output file
+ * headerfilename - name of the .h file to generate
+ * did_outfilename - whether outfilename was explicitly set
+ * prefix - the prefix used for externally visible names ("yy" by default)
+ * yyclass - yyFlexLexer subclass to use for YY_DECL
+ * do_stdinit - whether to initialize yyin/yyout to stdin/stdout
+ * use_stdout - the -t flag
+ * input_files - array holding names of input files
+ * num_input_files - size of input_files array
+ * program_name - name with which program was invoked
+ *
+ * action_array - array to hold the rule actions
+ * action_size - size of action_array
+ * defs1_offset - index where the user's section 1 definitions start
+ * in action_array
+ * prolog_offset - index where the prolog starts in action_array
+ * action_offset - index where the non-prolog starts in action_array
+ * action_index - index where the next action should go, with respect
+ * to "action_array"
+ */
+
+extern int datapos, dataline, linenum;
+extern FILE *skelfile, *yyin, *backing_up_file;
+extern const char *skel[];
+extern int skel_ind;
+extern char *infilename, *outfilename, *headerfilename;
+extern int did_outfilename;
+extern char *prefix, *yyclass, *extra_type;
+extern int do_stdinit, use_stdout;
+extern char **input_files;
+extern int num_input_files;
+extern char *program_name;
+
+extern char *action_array;
+extern int action_size;
+extern int defs1_offset, prolog_offset, action_offset, action_index;
+
+
+/* Variables for stack of states having only one out-transition:
+ * onestate - state number
+ * onesym - transition symbol
+ * onenext - target state
+ * onedef - default base entry
+ * onesp - stack pointer
+ */
+
+extern int onestate[ONE_STACK_SIZE], onesym[ONE_STACK_SIZE];
+extern int onenext[ONE_STACK_SIZE], onedef[ONE_STACK_SIZE], onesp;
+
+
+/* Variables for nfa machine data:
+ * maximum_mns - maximal number of NFA states supported by tables
+ * current_mns - current maximum on number of NFA states
+ * num_rules - number of the last accepting state; also is number of
+ * rules created so far
+ * num_eof_rules - number of <<EOF>> rules
+ * default_rule - number of the default rule
+ * current_max_rules - current maximum number of rules
+ * lastnfa - last nfa state number created
+ * firstst - physically the first state of a fragment
+ * lastst - last physical state of fragment
+ * finalst - last logical state of fragment
+ * transchar - transition character
+ * trans1 - transition state
+ * trans2 - 2nd transition state for epsilons
+ * accptnum - accepting number
+ * assoc_rule - rule associated with this NFA state (or 0 if none)
+ * state_type - a STATE_xxx type identifying whether the state is part
+ * of a normal rule, the leading state in a trailing context
+ * rule (i.e., the state which marks the transition from
+ * recognizing the text-to-be-matched to the beginning of
+ * the trailing context), or a subsequent state in a trailing
+ * context rule
+ * rule_type - a RULE_xxx type identifying whether this a ho-hum
+ * normal rule or one which has variable head & trailing
+ * context
+ * rule_linenum - line number associated with rule
+ * rule_useful - true if we've determined that the rule can be matched
+ * rule_has_nl - true if rule could possibly match a newline
+ * ccl_has_nl - true if current ccl could match a newline
+ * nlch - default eol char
+ */
+
+extern int maximum_mns, current_mns, current_max_rules;
+extern int num_rules, num_eof_rules, default_rule, lastnfa;
+extern int *firstst, *lastst, *finalst, *transchar, *trans1, *trans2;
+extern int *accptnum, *assoc_rule, *state_type;
+extern int *rule_type, *rule_linenum, *rule_useful;
+extern bool *rule_has_nl, *ccl_has_nl;
+extern int nlch;
+
+/* Different types of states; values are useful as masks, as well, for
+ * routines like check_trailing_context().
+ */
+#define STATE_NORMAL 0x1
+#define STATE_TRAILING_CONTEXT 0x2
+
+/* Global holding current type of state we're making. */
+
+extern int current_state_type;
+
+/* Different types of rules. */
+#define RULE_NORMAL 0
+#define RULE_VARIABLE 1
+
+/* True if the input rules include a rule with both variable-length head
+ * and trailing context, false otherwise.
+ */
+extern int variable_trailing_context_rules;
+
+
+/* Variables for protos:
+ * numtemps - number of templates created
+ * numprots - number of protos created
+ * protprev - backlink to a more-recently used proto
+ * protnext - forward link to a less-recently used proto
+ * prottbl - base/def table entry for proto
+ * protcomst - common state of proto
+ * firstprot - number of the most recently used proto
+ * lastprot - number of the least recently used proto
+ * protsave contains the entire state array for protos
+ */
+
+extern int numtemps, numprots, protprev[MSP], protnext[MSP], prottbl[MSP];
+extern int protcomst[MSP], firstprot, lastprot, protsave[PROT_SAVE_SIZE];
+
+
+/* Variables for managing equivalence classes:
+ * numecs - number of equivalence classes
+ * nextecm - forward link of Equivalence Class members
+ * ecgroup - class number or backward link of EC members
+ * nummecs - number of meta-equivalence classes (used to compress
+ * templates)
+ * tecfwd - forward link of meta-equivalence classes members
+ * tecbck - backward link of MEC's
+ */
+
+/* Reserve enough room in the equivalence class arrays so that we
+ * can use the CSIZE'th element to hold equivalence class information
+ * for the NUL character. Later we'll move this information into
+ * the 0th element.
+ */
+extern int numecs, nextecm[CSIZE + 1], ecgroup[CSIZE + 1], nummecs;
+
+/* Meta-equivalence classes are indexed starting at 1, so it's possible
+ * that they will require positions from 1 .. CSIZE, i.e., CSIZE + 1
+ * slots total (since the arrays are 0-based). nextecm[] and ecgroup[]
+ * don't require the extra position since they're indexed from 1 .. CSIZE - 1.
+ */
+extern int tecfwd[CSIZE + 1], tecbck[CSIZE + 1];
+
+
+/* Variables for start conditions:
+ * lastsc - last start condition created
+ * current_max_scs - current limit on number of start conditions
+ * scset - set of rules active in start condition
+ * scbol - set of rules active only at the beginning of line in a s.c.
+ * scxclu - true if start condition is exclusive
+ * sceof - true if start condition has EOF rule
+ * scname - start condition name
+ */
+
+extern int lastsc, *scset, *scbol, *scxclu, *sceof;
+extern int current_max_scs;
+extern char **scname;
+
+
+/* Variables for dfa machine data:
+ * current_max_dfa_size - current maximum number of NFA states in DFA
+ * current_max_xpairs - current maximum number of non-template xtion pairs
+ * current_max_template_xpairs - current maximum number of template pairs
+ * current_max_dfas - current maximum number DFA states
+ * lastdfa - last dfa state number created
+ * nxt - state to enter upon reading character
+ * chk - check value to see if "nxt" applies
+ * tnxt - internal nxt table for templates
+ * base - offset into "nxt" for given state
+ * def - where to go if "chk" disallows "nxt" entry
+ * nultrans - NUL transition for each state
+ * NUL_ec - equivalence class of the NUL character
+ * tblend - last "nxt/chk" table entry being used
+ * firstfree - first empty entry in "nxt/chk" table
+ * dss - nfa state set for each dfa
+ * dfasiz - size of nfa state set for each dfa
+ * dfaacc - accepting set for each dfa state (if using REJECT), or accepting
+ * number, if not
+ * accsiz - size of accepting set for each dfa state
+ * dhash - dfa state hash value
+ * numas - number of DFA accepting states created; note that this
+ * is not necessarily the same value as num_rules, which is the analogous
+ * value for the NFA
+ * numsnpairs - number of state/nextstate transition pairs
+ * jambase - position in base/def where the default jam table starts
+ * jamstate - state number corresponding to "jam" state
+ * end_of_buffer_state - end-of-buffer dfa state number
+ */
+
+extern int current_max_dfa_size, current_max_xpairs;
+extern int current_max_template_xpairs, current_max_dfas;
+extern int lastdfa, *nxt, *chk, *tnxt;
+extern int *base, *def, *nultrans, NUL_ec, tblend, firstfree, **dss,
+ *dfasiz;
+extern union dfaacc_union {
+ int *dfaacc_set;
+ int dfaacc_state;
+} *dfaacc;
+extern int *accsiz, *dhash, numas;
+extern int numsnpairs, jambase, jamstate;
+extern int end_of_buffer_state;
+
+/* Variables for ccl information:
+ * lastccl - ccl index of the last created ccl
+ * current_maxccls - current limit on the maximum number of unique ccl's
+ * cclmap - maps a ccl index to its set pointer
+ * ccllen - gives the length of a ccl
+ * cclng - true for a given ccl if the ccl is negated
+ * cclreuse - counts how many times a ccl is re-used
+ * current_max_ccl_tbl_size - current limit on number of characters needed
+ * to represent the unique ccl's
+ * ccltbl - holds the characters in each ccl - indexed by cclmap
+ */
+
+extern int lastccl, *cclmap, *ccllen, *cclng, cclreuse;
+extern int current_maxccls, current_max_ccl_tbl_size;
+extern Char *ccltbl;
+
+
+/* Variables for miscellaneous information:
+ * nmstr - last NAME scanned by the scanner
+ * sectnum - section number currently being parsed
+ * nummt - number of empty nxt/chk table entries
+ * hshcol - number of hash collisions detected by snstods
+ * dfaeql - number of times a newly created dfa was equal to an old one
+ * numeps - number of epsilon NFA states created
+ * eps2 - number of epsilon states which have 2 out-transitions
+ * num_reallocs - number of times it was necessary to realloc() a group
+ * of arrays
+ * tmpuses - number of DFA states that chain to templates
+ * totnst - total number of NFA states used to make DFA states
+ * peakpairs - peak number of transition pairs we had to store internally
+ * numuniq - number of unique transitions
+ * numdup - number of duplicate transitions
+ * hshsave - number of hash collisions saved by checking number of states
+ * num_backing_up - number of DFA states requiring backing up
+ * bol_needed - whether scanner needs beginning-of-line recognition
+ */
+
+extern char nmstr[MAXLINE];
+extern int sectnum, nummt, hshcol, dfaeql, numeps, eps2, num_reallocs;
+extern int tmpuses, totnst, peakpairs, numuniq, numdup, hshsave;
+extern int num_backing_up, bol_needed;
+
+void *allocate_array PROTO ((int, size_t));
+void *reallocate_array PROTO ((void *, int, size_t));
+
+void *flex_alloc PROTO ((size_t));
+void *flex_realloc PROTO ((void *, size_t));
+void flex_free PROTO ((void *));
+
+#define allocate_integer_array(size) \
+ (int *) allocate_array( size, sizeof( int ) )
+
+#define reallocate_integer_array(array,size) \
+ (int *) reallocate_array( (void *) array, size, sizeof( int ) )
+
+#define allocate_bool_array(size) \
+ (bool *) allocate_array( size, sizeof( bool ) )
+
+#define reallocate_bool_array(array,size) \
+ (bool *) reallocate_array( (void *) array, size, sizeof( bool ) )
+
+#define allocate_int_ptr_array(size) \
+ (int **) allocate_array( size, sizeof( int * ) )
+
+#define allocate_char_ptr_array(size) \
+ (char **) allocate_array( size, sizeof( char * ) )
+
+#define allocate_dfaacc_union(size) \
+ (union dfaacc_union *) \
+ allocate_array( size, sizeof( union dfaacc_union ) )
+
+#define reallocate_int_ptr_array(array,size) \
+ (int **) reallocate_array( (void *) array, size, sizeof( int * ) )
+
+#define reallocate_char_ptr_array(array,size) \
+ (char **) reallocate_array( (void *) array, size, sizeof( char * ) )
+
+#define reallocate_dfaacc_union(array, size) \
+ (union dfaacc_union *) \
+ reallocate_array( (void *) array, size, sizeof( union dfaacc_union ) )
+
+#define allocate_character_array(size) \
+ (char *) allocate_array( size, sizeof( char ) )
+
+#define reallocate_character_array(array,size) \
+ (char *) reallocate_array( (void *) array, size, sizeof( char ) )
+
+#define allocate_Character_array(size) \
+ (Char *) allocate_array( size, sizeof( Char ) )
+
+#define reallocate_Character_array(array,size) \
+ (Char *) reallocate_array( (void *) array, size, sizeof( Char ) )
+
+
+/* Used to communicate between scanner and parser. The type should really
+ * be YYSTYPE, but we can't easily get our hands on it.
+ */
+extern int yylval;
+
+
+/* External functions that are cross-referenced among the flex source files. */
+
+
+/* from file ccl.c */
+
+extern void ccladd PROTO ((int, int)); /* add a single character to a ccl */
+extern int cclinit PROTO ((void)); /* make an empty ccl */
+extern void cclnegate PROTO ((int)); /* negate a ccl */
+extern int ccl_set_diff (int a, int b); /* set difference of two ccls. */
+extern int ccl_set_union (int a, int b); /* set union of two ccls. */
+
+/* List the members of a set of characters in CCL form. */
+extern void list_character_set PROTO ((FILE *, int[]));
+
+
+/* from file dfa.c */
+
+/* Check a DFA state for backing up. */
+extern void check_for_backing_up PROTO ((int, int[]));
+
+/* Check to see if NFA state set constitutes "dangerous" trailing context. */
+extern void check_trailing_context PROTO ((int *, int, int *, int));
+
+/* Construct the epsilon closure of a set of ndfa states. */
+extern int *epsclosure PROTO ((int *, int *, int[], int *, int *));
+
+/* Increase the maximum number of dfas. */
+extern void increase_max_dfas PROTO ((void));
+
+extern void ntod PROTO ((void)); /* convert a ndfa to a dfa */
+
+/* Converts a set of ndfa states into a dfa state. */
+extern int snstods PROTO ((int[], int, int[], int, int, int *));
+
+
+/* from file ecs.c */
+
+/* Convert character classes to set of equivalence classes. */
+extern void ccl2ecl PROTO ((void));
+
+/* Associate equivalence class numbers with class members. */
+extern int cre8ecs PROTO ((int[], int[], int));
+
+/* Update equivalence classes based on character class transitions. */
+extern void mkeccl PROTO ((Char[], int, int[], int[], int, int));
+
+/* Create equivalence class for single character. */
+extern void mkechar PROTO ((int, int[], int[]));
+
+
+/* from file gen.c */
+
+extern void do_indent PROTO ((void)); /* indent to the current level */
+
+/* Generate the code to keep backing-up information. */
+extern void gen_backing_up PROTO ((void));
+
+/* Generate the code to perform the backing up. */
+extern void gen_bu_action PROTO ((void));
+
+/* Generate full speed compressed transition table. */
+extern void genctbl PROTO ((void));
+
+/* Generate the code to find the action number. */
+extern void gen_find_action PROTO ((void));
+
+extern void genftbl PROTO ((void)); /* generate full transition table */
+
+/* Generate the code to find the next compressed-table state. */
+extern void gen_next_compressed_state PROTO ((char *));
+
+/* Generate the code to find the next match. */
+extern void gen_next_match PROTO ((void));
+
+/* Generate the code to find the next state. */
+extern void gen_next_state PROTO ((int));
+
+/* Generate the code to make a NUL transition. */
+extern void gen_NUL_trans PROTO ((void));
+
+/* Generate the code to find the start state. */
+extern void gen_start_state PROTO ((void));
+
+/* Generate data statements for the transition tables. */
+extern void gentabs PROTO ((void));
+
+/* Write out a formatted string at the current indentation level. */
+extern void indent_put2s PROTO ((const char *, const char *));
+
+/* Write out a string + newline at the current indentation level. */
+extern void indent_puts PROTO ((const char *));
+
+extern void make_tables PROTO ((void)); /* generate transition tables */
+
+
+/* from file main.c */
+
+extern void check_options PROTO ((void));
+extern void flexend PROTO ((int));
+extern void usage PROTO ((void));
+
+
+/* from file misc.c */
+
+/* Add a #define to the action file. */
+extern void action_define PROTO ((const char *defname, int value));
+
+/* Add the given text to the stored actions. */
+extern void add_action PROTO ((const char *new_text));
+
+/* True if a string is all lower case. */
+extern int all_lower PROTO ((char *));
+
+/* True if a string is all upper case. */
+extern int all_upper PROTO ((char *));
+
+/* Compare two integers for use by qsort. */
+extern int intcmp PROTO ((const void *, const void *));
+
+/* Check a character to make sure it's in the expected range. */
+extern void check_char PROTO ((int c));
+
+/* Replace upper-case letter to lower-case. */
+extern Char clower PROTO ((int));
+
+/* Returns a dynamically allocated copy of a string. */
+extern char *copy_string PROTO ((const char *));
+
+/* Returns a dynamically allocated copy of a (potentially) unsigned string. */
+extern Char *copy_unsigned_string PROTO ((Char *));
+
+/* Compare two characters for use by qsort with '\0' sorting last. */
+extern int cclcmp PROTO ((const void *, const void *));
+
+/* Finish up a block of data declarations. */
+extern void dataend PROTO ((void));
+
+/* Flush generated data statements. */
+extern void dataflush PROTO ((void));
+
+/* Report an error message and terminate. */
+extern void flexerror PROTO ((const char *));
+
+/* Report a fatal error message and terminate. */
+extern void flexfatal PROTO ((const char *));
+
+/* Report a fatal error with a pinpoint, and terminate */
+#if HAVE_DECL___FUNC__
+#define flex_die(msg) \
+ do{ \
+ fprintf (stderr,\
+ _("%s: fatal internal error at %s:%d (%s): %s\n"),\
+ program_name, __FILE__, (int)__LINE__,\
+ __func__,msg);\
+ FLEX_EXIT(1);\
+ }while(0)
+#else /* ! HAVE_DECL___FUNC__ */
+#define flex_die(msg) \
+ do{ \
+ fprintf (stderr,\
+ _("%s: fatal internal error at %s:%d %s\n"),\
+ program_name, __FILE__, (int)__LINE__,\
+ msg);\
+ FLEX_EXIT(1);\
+ }while(0)
+#endif /* ! HAVE_DECL___func__ */
+
+/* Convert a hexadecimal digit string to an integer value. */
+extern int htoi PROTO ((Char[]));
+
+/* Report an error message formatted */
+extern void lerr PROTO ((const char *, ...))
+#if defined(__GNUC__) && __GNUC__ >= 3
+ __attribute__((__format__(__printf__, 1, 2)))
+#endif
+;
+
+/* Like lerr, but also exit after displaying message. */
+extern void lerr_fatal PROTO ((const char *, ...))
+#if defined(__GNUC__) && __GNUC__ >= 3
+ __attribute__((__format__(__printf__, 1, 2)))
+#endif
+;
+
+/* Spit out a "#line" statement. */
+extern void line_directive_out PROTO ((FILE *, int));
+
+/* Mark the current position in the action array as the end of the section 1
+ * user defs.
+ */
+extern void mark_defs1 PROTO ((void));
+
+/* Mark the current position in the action array as the end of the prolog. */
+extern void mark_prolog PROTO ((void));
+
+/* Generate a data statment for a two-dimensional array. */
+extern void mk2data PROTO ((int));
+
+extern void mkdata PROTO ((int)); /* generate a data statement */
+
+/* Return the integer represented by a string of digits. */
+extern int myctoi PROTO ((const char *));
+
+/* Return character corresponding to escape sequence. */
+extern Char myesc PROTO ((Char[]));
+
+/* Convert an octal digit string to an integer value. */
+extern int otoi PROTO ((Char[]));
+
+/* Output a (possibly-formatted) string to the generated scanner. */
+extern void out PROTO ((const char *));
+extern void out_dec PROTO ((const char *, int));
+extern void out_dec2 PROTO ((const char *, int, int));
+extern void out_hex PROTO ((const char *, unsigned int));
+extern void out_str PROTO ((const char *, const char *));
+extern void out_str3
+PROTO ((const char *, const char *, const char *, const char *));
+extern void out_str_dec PROTO ((const char *, const char *, int));
+extern void outc PROTO ((int));
+extern void outn PROTO ((const char *));
+extern void out_m4_define (const char* def, const char* val);
+
+/* Return a printable version of the given character, which might be
+ * 8-bit.
+ */
+extern char *readable_form PROTO ((int));
+
+/* Write out one section of the skeleton file. */
+extern void skelout PROTO ((void));
+
+/* Output a yy_trans_info structure. */
+extern void transition_struct_out PROTO ((int, int));
+
+/* Only needed when using certain broken versions of bison to build parse.c. */
+extern void *yy_flex_xmalloc PROTO ((int));
+
+/* Set a region of memory to 0. */
+extern void zero_out PROTO ((char *, size_t));
+
+
+/* from file nfa.c */
+
+/* Add an accepting state to a machine. */
+extern void add_accept PROTO ((int, int));
+
+/* Make a given number of copies of a singleton machine. */
+extern int copysingl PROTO ((int, int));
+
+/* Debugging routine to write out an nfa. */
+extern void dumpnfa PROTO ((int));
+
+/* Finish up the processing for a rule. */
+extern void finish_rule PROTO ((int, int, int, int, int));
+
+/* Connect two machines together. */
+extern int link_machines PROTO ((int, int));
+
+/* Mark each "beginning" state in a machine as being a "normal" (i.e.,
+ * not trailing context associated) state.
+ */
+extern void mark_beginning_as_normal PROTO ((int));
+
+/* Make a machine that branches to two machines. */
+extern int mkbranch PROTO ((int, int));
+
+extern int mkclos PROTO ((int)); /* convert a machine into a closure */
+extern int mkopt PROTO ((int)); /* make a machine optional */
+
+/* Make a machine that matches either one of two machines. */
+extern int mkor PROTO ((int, int));
+
+/* Convert a machine into a positive closure. */
+extern int mkposcl PROTO ((int));
+
+extern int mkrep PROTO ((int, int, int)); /* make a replicated machine */
+
+/* Create a state with a transition on a given symbol. */
+extern int mkstate PROTO ((int));
+
+extern void new_rule PROTO ((void)); /* initialize for a new rule */
+
+
+/* from file parse.y */
+
+/* Build the "<<EOF>>" action for the active start conditions. */
+extern void build_eof_action PROTO ((void));
+
+/* Write out a message formatted with one string, pinpointing its location. */
+extern void format_pinpoint_message PROTO ((const char *, const char *));
+
+/* Write out a message, pinpointing its location. */
+extern void pinpoint_message PROTO ((const char *));
+
+/* Write out a warning, pinpointing it at the given line. */
+extern void line_warning PROTO ((const char *, int));
+
+/* Write out a message, pinpointing it at the given line. */
+extern void line_pinpoint PROTO ((const char *, int));
+
+/* Report a formatted syntax error. */
+extern void format_synerr PROTO ((const char *, const char *));
+extern void synerr PROTO ((const char *)); /* report a syntax error */
+extern void format_warn PROTO ((const char *, const char *));
+extern void warn PROTO ((const char *)); /* report a warning */
+extern void yyerror PROTO ((const char *)); /* report a parse error */
+extern int yyparse PROTO ((void)); /* the YACC parser */
+
+
+/* from file scan.l */
+
+/* The Flex-generated scanner for flex. */
+extern int flexscan PROTO ((void));
+
+/* Open the given file (if NULL, stdin) for scanning. */
+extern void set_input_file PROTO ((char *));
+
+/* Wrapup a file in the lexical analyzer. */
+extern int yywrap PROTO ((void));
+
+
+/* from file sym.c */
+
+/* Save the text of a character class. */
+extern void cclinstal PROTO ((Char[], int));
+
+/* Lookup the number associated with character class. */
+extern int ccllookup PROTO ((Char[]));
+
+extern void ndinstal PROTO ((const char *, Char[])); /* install a name definition */
+extern Char *ndlookup PROTO ((const char *)); /* lookup a name definition */
+
+/* Increase maximum number of SC's. */
+extern void scextend PROTO ((void));
+extern void scinstal PROTO ((const char *, int)); /* make a start condition */
+
+/* Lookup the number associated with a start condition. */
+extern int sclookup PROTO ((const char *));
+
+
+/* from file tblcmp.c */
+
+/* Build table entries for dfa state. */
+extern void bldtbl PROTO ((int[], int, int, int, int));
+
+extern void cmptmps PROTO ((void)); /* compress template table entries */
+extern void expand_nxt_chk PROTO ((void)); /* increase nxt/chk arrays */
+
+/* Finds a space in the table for a state to be placed. */
+extern int find_table_space PROTO ((int *, int));
+extern void inittbl PROTO ((void)); /* initialize transition tables */
+
+/* Make the default, "jam" table entries. */
+extern void mkdeftbl PROTO ((void));
+
+/* Create table entries for a state (or state fragment) which has
+ * only one out-transition.
+ */
+extern void mk1tbl PROTO ((int, int, int, int));
+
+/* Place a state into full speed transition table. */
+extern void place_state PROTO ((int *, int, int));
+
+/* Save states with only one out-transition to be processed later. */
+extern void stack1 PROTO ((int, int, int, int));
+
+
+/* from file yylex.c */
+
+extern int yylex PROTO ((void));
+
+/* A growable array. See buf.c. */
+struct Buf {
+ void *elts; /* elements. */
+ int nelts; /* number of elements. */
+ size_t elt_size; /* in bytes. */
+ int nmax; /* max capacity of elements. */
+};
+
+extern void buf_init PROTO ((struct Buf * buf, size_t elem_size));
+extern void buf_destroy PROTO ((struct Buf * buf));
+extern struct Buf *buf_append
+PROTO ((struct Buf * buf, const void *ptr, int n_elem));
+extern struct Buf *buf_concat PROTO((struct Buf* dest, const struct Buf* src));
+extern struct Buf *buf_strappend PROTO ((struct Buf *, const char *str));
+extern struct Buf *buf_strnappend
+PROTO ((struct Buf *, const char *str, int nchars));
+extern struct Buf *buf_strdefine
+PROTO ((struct Buf * buf, const char *str, const char *def));
+extern struct Buf *buf_prints PROTO((struct Buf *buf, const char *fmt, const char* s));
+extern struct Buf *buf_m4_define PROTO((struct Buf *buf, const char* def, const char* val));
+extern struct Buf *buf_m4_undefine PROTO((struct Buf *buf, const char* def));
+extern struct Buf *buf_print_strings PROTO((struct Buf * buf, FILE* out));
+extern struct Buf *buf_linedir PROTO((struct Buf *buf, const char* filename, int lineno));
+
+extern struct Buf userdef_buf; /* a string buffer for #define's generated by user-options on cmd line. */
+extern struct Buf defs_buf; /* a char* buffer to save #define'd some symbols generated by flex. */
+extern struct Buf yydmap_buf; /* a string buffer to hold yydmap elements */
+extern struct Buf m4defs_buf; /* Holds m4 definitions. */
+extern struct Buf top_buf; /* contains %top code. String buffer. */
+
+/* For blocking out code from the header file. */
+#define OUT_BEGIN_CODE() outn("m4_ifdef( [[M4_YY_IN_HEADER]],,[[")
+#define OUT_END_CODE() outn("]])")
+
+/* For setjmp/longjmp (instead of calling exit(2)). Linkage in main.c */
+extern jmp_buf flex_main_jmp_buf;
+
+#define FLEX_EXIT(status) longjmp(flex_main_jmp_buf,(status)+1)
+
+/* Removes all \n and \r chars from tail of str. returns str. */
+extern char *chomp (char *str);
+
+/* ctype functions forced to return boolean */
+#define b_isalnum(c) (isalnum(c)?true:false)
+#define b_isalpha(c) (isalpha(c)?true:false)
+#define b_isascii(c) (isascii(c)?true:false)
+#define b_isblank(c) (isblank(c)?true:false)
+#define b_iscntrl(c) (iscntrl(c)?true:false)
+#define b_isdigit(c) (isdigit(c)?true:false)
+#define b_isgraph(c) (isgraph(c)?true:false)
+#define b_islower(c) (islower(c)?true:false)
+#define b_isprint(c) (isprint(c)?true:false)
+#define b_ispunct(c) (ispunct(c)?true:false)
+#define b_isspace(c) (isspace(c)?true:false)
+#define b_isupper(c) (isupper(c)?true:false)
+#define b_isxdigit(c) (isxdigit(c)?true:false)
+
+/* return true if char is uppercase or lowercase. */
+bool has_case(int c);
+
+/* Change case of character if possible. */
+int reverse_case(int c);
+
+/* return false if [c1-c2] is ambiguous for a caseless scanner. */
+bool range_covers_case (int c1, int c2);
+
+/*
+ * From "filter.c"
+ */
+
+/** A single stdio filter to execute.
+ * The filter may be external, such as "sed", or it
+ * may be internal, as a function call.
+ */
+struct filter {
+ int (*filter_func)(struct filter*); /**< internal filter function */
+ void * extra; /**< extra data passed to filter_func */
+ int argc; /**< arg count */
+ const char ** argv; /**< arg vector, \0-terminated */
+ struct filter * next; /**< next filter or NULL */
+};
+
+/* output filter chain */
+extern struct filter * output_chain;
+extern struct filter *filter_create_ext PROTO((struct filter * chain, const char *cmd, ...));
+struct filter *filter_create_int PROTO((struct filter *chain,
+ int (*filter_func) (struct filter *),
+ void *extra));
+extern bool filter_apply_chain PROTO((struct filter * chain));
+extern int filter_truncate (struct filter * chain, int max_len);
+extern int filter_tee_header PROTO((struct filter *chain));
+extern int filter_fix_linedirs PROTO((struct filter *chain));
+
+
+/*
+ * From "regex.c"
+ */
+
+extern regex_t regex_linedir, regex_blank_line;
+bool flex_init_regex(void);
+void flex_regcomp(regex_t *preg, const char *regex, int cflags);
+char *regmatch_dup (regmatch_t * m, const char *src);
+char *regmatch_cpy (regmatch_t * m, char *dest, const char *src);
+int regmatch_len (regmatch_t * m);
+int regmatch_strtol (regmatch_t * m, const char *src, char **endptr, int base);
+bool regmatch_empty (regmatch_t * m);
+
+/* From "scanflags.h" */
+typedef unsigned int scanflags_t;
+extern scanflags_t* _sf_stk;
+extern size_t _sf_top_ix, _sf_max; /**< stack of scanner flags. */
+#define _SF_CASE_INS 0x0001
+#define _SF_DOT_ALL 0x0002
+#define _SF_SKIP_WS 0x0004
+#define sf_top() (_sf_stk[_sf_top_ix])
+#define sf_case_ins() (sf_top() & _SF_CASE_INS)
+#define sf_dot_all() (sf_top() & _SF_DOT_ALL)
+#define sf_skip_ws() (sf_top() & _SF_SKIP_WS)
+#define sf_set_case_ins(X) ((X) ? (sf_top() |= _SF_CASE_INS) : (sf_top() &= ~_SF_CASE_INS))
+#define sf_set_dot_all(X) ((X) ? (sf_top() |= _SF_DOT_ALL) : (sf_top() &= ~_SF_DOT_ALL))
+#define sf_set_skip_ws(X) ((X) ? (sf_top() |= _SF_SKIP_WS) : (sf_top() &= ~_SF_SKIP_WS))
+extern void sf_init(void);
+extern void sf_push(void);
+extern void sf_pop(void);
+
+
+#endif /* not defined FLEXDEF_H */
diff --git a/src/flexint.h b/src/flexint.h
new file mode 100644
index 0000000..f9fa80c
--- /dev/null
+++ b/src/flexint.h
@@ -0,0 +1,63 @@
+/* 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 */
diff --git a/src/gen.c b/src/gen.c
new file mode 100644
index 0000000..81e7c27
--- /dev/null
+++ b/src/gen.c
@@ -0,0 +1,2195 @@
+/* gen - actual generation (writing) of flex scanners */
+
+/* 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"
+
+
+/* declare functions that have forward references */
+
+void gen_next_state PROTO ((int));
+void genecs PROTO ((void));
+void indent_put2s PROTO ((const char *, const char *));
+void indent_puts PROTO ((const char *));
+
+
+static int indent_level = 0; /* each level is 8 spaces */
+
+#define indent_up() (++indent_level)
+#define indent_down() (--indent_level)
+#define set_indent(indent_val) indent_level = indent_val
+
+/* Almost everything is done in terms of arrays starting at 1, so provide
+ * a null entry for the zero element of all C arrays. (The exception
+ * to this is that the fast table representation generally uses the
+ * 0 elements of its arrays, too.)
+ */
+
+static const char *get_int16_decl (void)
+{
+ return (gentables)
+ ? "static yyconst flex_int16_t %s[%d] =\n { 0,\n"
+ : "static yyconst flex_int16_t * %s = 0;\n";
+}
+
+
+static const char *get_int32_decl (void)
+{
+ return (gentables)
+ ? "static yyconst flex_int32_t %s[%d] =\n { 0,\n"
+ : "static yyconst flex_int32_t * %s = 0;\n";
+}
+
+static const char *get_state_decl (void)
+{
+ return (gentables)
+ ? "static yyconst yy_state_type %s[%d] =\n { 0,\n"
+ : "static yyconst yy_state_type * %s = 0;\n";
+}
+
+static const char *get_uint16_decl (void)
+{
+ return (gentables)
+ ? "static yyconst flex_uint16_t %s[%d] =\n { 0,\n"
+ : "static yyconst flex_uint16_t * %s = 0;\n";
+}
+
+static const char *get_uint32_decl (void)
+{
+ return (gentables)
+ ? "static yyconst flex_uint32_t %s[%d] =\n { 0,\n"
+ : "static yyconst flex_uint32_t * %s = 0;\n";
+}
+
+static const char *get_yy_char_decl (void)
+{
+ return (gentables)
+ ? "static yyconst YY_CHAR %s[%d] =\n { 0,\n"
+ : "static yyconst YY_CHAR * %s = 0;\n";
+}
+
+/* Indent to the current level. */
+
+void do_indent (void)
+{
+ int i = indent_level * 8;
+
+ while (i >= 8) {
+ outc ('\t');
+ i -= 8;
+ }
+
+ while (i > 0) {
+ outc (' ');
+ --i;
+ }
+}
+
+
+/** Make the table for possible eol matches.
+ * @return the newly allocated rule_can_match_eol table
+ */
+static struct yytbl_data *mkeoltbl (void)
+{
+ int i;
+ flex_int8_t *tdata = 0;
+ struct yytbl_data *tbl;
+
+ tbl = (struct yytbl_data *) calloc (1, sizeof (struct yytbl_data));
+ yytbl_data_init (tbl, YYTD_ID_RULE_CAN_MATCH_EOL);
+ tbl->td_flags = YYTD_DATA8;
+ tbl->td_lolen = num_rules + 1;
+ tbl->td_data = tdata =
+ (flex_int8_t *) calloc (tbl->td_lolen, sizeof (flex_int8_t));
+
+ for (i = 1; i <= num_rules; i++)
+ tdata[i] = rule_has_nl[i] ? 1 : 0;
+
+ buf_prints (&yydmap_buf,
+ "\t{YYTD_ID_RULE_CAN_MATCH_EOL, (void**)&yy_rule_can_match_eol, sizeof(%s)},\n",
+ "flex_int32_t");
+ return tbl;
+}
+
+/* Generate the table for possible eol matches. */
+static void geneoltbl (void)
+{
+ int i;
+
+ outn ("m4_ifdef( [[M4_YY_USE_LINENO]],[[");
+ outn ("/* Table of booleans, true if rule could match eol. */");
+ out_str_dec (get_int32_decl (), "yy_rule_can_match_eol",
+ num_rules + 1);
+
+ if (gentables) {
+ for (i = 1; i <= num_rules; i++) {
+ out_dec ("%d, ", rule_has_nl[i] ? 1 : 0);
+ /* format nicely, 20 numbers per line. */
+ if ((i % 20) == 19)
+ out ("\n ");
+ }
+ out (" };\n");
+ }
+ outn ("]])");
+}
+
+
+/* Generate the code to keep backing-up information. */
+
+void gen_backing_up (void)
+{
+ if (reject || num_backing_up == 0)
+ return;
+
+ if (fullspd)
+ indent_puts ("if ( yy_current_state[-1].yy_nxt )");
+ else
+ indent_puts ("if ( yy_accept[yy_current_state] )");
+
+ indent_up ();
+ indent_puts ("{");
+ indent_puts ("YY_G(yy_last_accepting_state) = yy_current_state;");
+ indent_puts ("YY_G(yy_last_accepting_cpos) = yy_cp;");
+ indent_puts ("}");
+ indent_down ();
+}
+
+
+/* Generate the code to perform the backing up. */
+
+void gen_bu_action (void)
+{
+ if (reject || num_backing_up == 0)
+ return;
+
+ set_indent (3);
+
+ indent_puts ("case 0: /* must back up */");
+ indent_puts ("/* undo the effects of YY_DO_BEFORE_ACTION */");
+ indent_puts ("*yy_cp = YY_G(yy_hold_char);");
+
+ if (fullspd || fulltbl)
+ indent_puts ("yy_cp = YY_G(yy_last_accepting_cpos) + 1;");
+ else
+ /* Backing-up info for compressed tables is taken \after/
+ * yy_cp has been incremented for the next state.
+ */
+ indent_puts ("yy_cp = YY_G(yy_last_accepting_cpos);");
+
+ indent_puts ("yy_current_state = YY_G(yy_last_accepting_state);");
+ indent_puts ("goto yy_find_action;");
+ outc ('\n');
+
+ set_indent (0);
+}
+
+/** mkctbl - make full speed compressed transition table
+ * This is an array of structs; each struct a pair of integers.
+ * You should call mkssltbl() immediately after this.
+ * Then, I think, mkecstbl(). Arrrg.
+ * @return the newly allocated trans table
+ */
+
+static struct yytbl_data *mkctbl (void)
+{
+ int i;
+ struct yytbl_data *tbl = 0;
+ flex_int32_t *tdata = 0, curr = 0;
+ int end_of_buffer_action = num_rules + 1;
+
+ buf_prints (&yydmap_buf,
+ "\t{YYTD_ID_TRANSITION, (void**)&yy_transition, sizeof(%s)},\n",
+ ((tblend + numecs + 1) >= INT16_MAX
+ || long_align) ? "flex_int32_t" : "flex_int16_t");
+
+ tbl = (struct yytbl_data *) calloc (1, sizeof (struct yytbl_data));
+ yytbl_data_init (tbl, YYTD_ID_TRANSITION);
+ tbl->td_flags = YYTD_DATA32 | YYTD_STRUCT;
+ tbl->td_hilen = 0;
+ tbl->td_lolen = tblend + numecs + 1; /* number of structs */
+
+ tbl->td_data = tdata =
+ (flex_int32_t *) calloc (tbl->td_lolen * 2, sizeof (flex_int32_t));
+
+ /* We want the transition to be represented as the offset to the
+ * next state, not the actual state number, which is what it currently
+ * is. The offset is base[nxt[i]] - (base of current state)]. That's
+ * just the difference between the starting points of the two involved
+ * states (to - from).
+ *
+ * First, though, we need to find some way to put in our end-of-buffer
+ * flags and states. We do this by making a state with absolutely no
+ * transitions. We put it at the end of the table.
+ */
+
+ /* We need to have room in nxt/chk for two more slots: One for the
+ * action and one for the end-of-buffer transition. We now *assume*
+ * that we're guaranteed the only character we'll try to index this
+ * nxt/chk pair with is EOB, i.e., 0, so we don't have to make sure
+ * there's room for jam entries for other characters.
+ */
+
+ while (tblend + 2 >= current_max_xpairs)
+ expand_nxt_chk ();
+
+ while (lastdfa + 1 >= current_max_dfas)
+ increase_max_dfas ();
+
+ base[lastdfa + 1] = tblend + 2;
+ nxt[tblend + 1] = end_of_buffer_action;
+ chk[tblend + 1] = numecs + 1;
+ chk[tblend + 2] = 1; /* anything but EOB */
+
+ /* So that "make test" won't show arb. differences. */
+ nxt[tblend + 2] = 0;
+
+ /* Make sure every state has an end-of-buffer transition and an
+ * action #.
+ */
+ for (i = 0; i <= lastdfa; ++i) {
+ int anum = dfaacc[i].dfaacc_state;
+ int offset = base[i];
+
+ chk[offset] = EOB_POSITION;
+ chk[offset - 1] = ACTION_POSITION;
+ nxt[offset - 1] = anum; /* action number */
+ }
+
+ for (i = 0; i <= tblend; ++i) {
+ if (chk[i] == EOB_POSITION) {
+ tdata[curr++] = 0;
+ tdata[curr++] = base[lastdfa + 1] - i;
+ }
+
+ else if (chk[i] == ACTION_POSITION) {
+ tdata[curr++] = 0;
+ tdata[curr++] = nxt[i];
+ }
+
+ else if (chk[i] > numecs || chk[i] == 0) {
+ tdata[curr++] = 0;
+ tdata[curr++] = 0;
+ }
+ else { /* verify, transition */
+
+ tdata[curr++] = chk[i];
+ tdata[curr++] = base[nxt[i]] - (i - chk[i]);
+ }
+ }
+
+
+ /* Here's the final, end-of-buffer state. */
+ tdata[curr++] = chk[tblend + 1];
+ tdata[curr++] = nxt[tblend + 1];
+
+ tdata[curr++] = chk[tblend + 2];
+ tdata[curr++] = nxt[tblend + 2];
+
+ return tbl;
+}
+
+
+/** Make start_state_list table.
+ * @return the newly allocated start_state_list table
+ */
+static struct yytbl_data *mkssltbl (void)
+{
+ struct yytbl_data *tbl = 0;
+ flex_int32_t *tdata = 0;
+ flex_int32_t i;
+
+ tbl = (struct yytbl_data *) calloc (1, sizeof (struct yytbl_data));
+ yytbl_data_init (tbl, YYTD_ID_START_STATE_LIST);
+ tbl->td_flags = YYTD_DATA32 | YYTD_PTRANS;
+ tbl->td_hilen = 0;
+ tbl->td_lolen = lastsc * 2 + 1;
+
+ tbl->td_data = tdata =
+ (flex_int32_t *) calloc (tbl->td_lolen, sizeof (flex_int32_t));
+
+ for (i = 0; i <= lastsc * 2; ++i)
+ tdata[i] = base[i];
+
+ buf_prints (&yydmap_buf,
+ "\t{YYTD_ID_START_STATE_LIST, (void**)&yy_start_state_list, sizeof(%s)},\n",
+ "struct yy_trans_info*");
+
+ return tbl;
+}
+
+
+
+/* genctbl - generates full speed compressed transition table */
+
+void genctbl (void)
+{
+ int i;
+ int end_of_buffer_action = num_rules + 1;
+
+ /* Table of verify for transition and offset to next state. */
+ if (gentables)
+ out_dec ("static yyconst struct yy_trans_info yy_transition[%d] =\n {\n", tblend + numecs + 1);
+ else
+ outn ("static yyconst struct yy_trans_info *yy_transition = 0;");
+
+ /* We want the transition to be represented as the offset to the
+ * next state, not the actual state number, which is what it currently
+ * is. The offset is base[nxt[i]] - (base of current state)]. That's
+ * just the difference between the starting points of the two involved
+ * states (to - from).
+ *
+ * First, though, we need to find some way to put in our end-of-buffer
+ * flags and states. We do this by making a state with absolutely no
+ * transitions. We put it at the end of the table.
+ */
+
+ /* We need to have room in nxt/chk for two more slots: One for the
+ * action and one for the end-of-buffer transition. We now *assume*
+ * that we're guaranteed the only character we'll try to index this
+ * nxt/chk pair with is EOB, i.e., 0, so we don't have to make sure
+ * there's room for jam entries for other characters.
+ */
+
+ while (tblend + 2 >= current_max_xpairs)
+ expand_nxt_chk ();
+
+ while (lastdfa + 1 >= current_max_dfas)
+ increase_max_dfas ();
+
+ base[lastdfa + 1] = tblend + 2;
+ nxt[tblend + 1] = end_of_buffer_action;
+ chk[tblend + 1] = numecs + 1;
+ chk[tblend + 2] = 1; /* anything but EOB */
+
+ /* So that "make test" won't show arb. differences. */
+ nxt[tblend + 2] = 0;
+
+ /* Make sure every state has an end-of-buffer transition and an
+ * action #.
+ */
+ for (i = 0; i <= lastdfa; ++i) {
+ int anum = dfaacc[i].dfaacc_state;
+ int offset = base[i];
+
+ chk[offset] = EOB_POSITION;
+ chk[offset - 1] = ACTION_POSITION;
+ nxt[offset - 1] = anum; /* action number */
+ }
+
+ for (i = 0; i <= tblend; ++i) {
+ if (chk[i] == EOB_POSITION)
+ transition_struct_out (0, base[lastdfa + 1] - i);
+
+ else if (chk[i] == ACTION_POSITION)
+ transition_struct_out (0, nxt[i]);
+
+ else if (chk[i] > numecs || chk[i] == 0)
+ transition_struct_out (0, 0); /* unused slot */
+
+ else /* verify, transition */
+ transition_struct_out (chk[i],
+ base[nxt[i]] - (i -
+ chk[i]));
+ }
+
+
+ /* Here's the final, end-of-buffer state. */
+ transition_struct_out (chk[tblend + 1], nxt[tblend + 1]);
+ transition_struct_out (chk[tblend + 2], nxt[tblend + 2]);
+
+ if (gentables)
+ outn (" };\n");
+
+ /* Table of pointers to start states. */
+ if (gentables)
+ out_dec ("static yyconst struct yy_trans_info *yy_start_state_list[%d] =\n", lastsc * 2 + 1);
+ else
+ outn ("static yyconst struct yy_trans_info **yy_start_state_list =0;");
+
+ if (gentables) {
+ outn (" {");
+
+ for (i = 0; i <= lastsc * 2; ++i)
+ out_dec (" &yy_transition[%d],\n", base[i]);
+
+ dataend ();
+ }
+
+ if (useecs)
+ genecs ();
+}
+
+
+/* mkecstbl - Make equivalence-class tables. */
+
+struct yytbl_data *mkecstbl (void)
+{
+ int i;
+ struct yytbl_data *tbl = 0;
+ flex_int32_t *tdata = 0;
+
+ tbl = (struct yytbl_data *) calloc (1, sizeof (struct yytbl_data));
+ yytbl_data_init (tbl, YYTD_ID_EC);
+ tbl->td_flags |= YYTD_DATA32;
+ tbl->td_hilen = 0;
+ tbl->td_lolen = csize;
+
+ tbl->td_data = tdata =
+ (flex_int32_t *) calloc (tbl->td_lolen, sizeof (flex_int32_t));
+
+ for (i = 1; i < csize; ++i) {
+ ecgroup[i] = ABS (ecgroup[i]);
+ tdata[i] = ecgroup[i];
+ }
+
+ buf_prints (&yydmap_buf,
+ "\t{YYTD_ID_EC, (void**)&yy_ec, sizeof(%s)},\n",
+ "YY_CHAR");
+
+ return tbl;
+}
+
+/* Generate equivalence-class tables. */
+
+void genecs (void)
+{
+ int i, j;
+ int numrows;
+
+ out_str_dec (get_yy_char_decl (), "yy_ec", csize);
+
+ for (i = 1; i < csize; ++i) {
+ ecgroup[i] = ABS (ecgroup[i]);
+ mkdata (ecgroup[i]);
+ }
+
+ dataend ();
+
+ if (trace) {
+ fputs (_("\n\nEquivalence Classes:\n\n"), stderr);
+
+ numrows = csize / 8;
+
+ for (j = 0; j < numrows; ++j) {
+ for (i = j; i < csize; i = i + numrows) {
+ fprintf (stderr, "%4s = %-2d",
+ readable_form (i), ecgroup[i]);
+
+ putc (' ', stderr);
+ }
+
+ putc ('\n', stderr);
+ }
+ }
+}
+
+
+/* Generate the code to find the action number. */
+
+void gen_find_action (void)
+{
+ if (fullspd)
+ indent_puts ("yy_act = yy_current_state[-1].yy_nxt;");
+
+ else if (fulltbl)
+ indent_puts ("yy_act = yy_accept[yy_current_state];");
+
+ else if (reject) {
+ indent_puts ("yy_current_state = *--YY_G(yy_state_ptr);");
+ indent_puts ("YY_G(yy_lp) = yy_accept[yy_current_state];");
+
+ if(reject_really_used)
+ outn ("find_rule: /* we branch to this label when backing up */");
+
+ indent_puts
+ ("for ( ; ; ) /* until we find what rule we matched */");
+
+ indent_up ();
+
+ indent_puts ("{");
+
+ indent_puts
+ ("if ( YY_G(yy_lp) && YY_G(yy_lp) < yy_accept[yy_current_state + 1] )");
+ indent_up ();
+ indent_puts ("{");
+ indent_puts ("yy_act = yy_acclist[YY_G(yy_lp)];");
+
+ if (variable_trailing_context_rules) {
+ indent_puts
+ ("if ( yy_act & YY_TRAILING_HEAD_MASK ||");
+ indent_puts (" YY_G(yy_looking_for_trail_begin) )");
+ indent_up ();
+ indent_puts ("{");
+
+ indent_puts
+ ("if ( yy_act == YY_G(yy_looking_for_trail_begin) )");
+ indent_up ();
+ indent_puts ("{");
+ indent_puts ("YY_G(yy_looking_for_trail_begin) = 0;");
+ indent_puts ("yy_act &= ~YY_TRAILING_HEAD_MASK;");
+ indent_puts ("break;");
+ indent_puts ("}");
+ indent_down ();
+
+ indent_puts ("}");
+ indent_down ();
+
+ indent_puts
+ ("else if ( yy_act & YY_TRAILING_MASK )");
+ indent_up ();
+ indent_puts ("{");
+ indent_puts
+ ("YY_G(yy_looking_for_trail_begin) = yy_act & ~YY_TRAILING_MASK;");
+ indent_puts
+ ("YY_G(yy_looking_for_trail_begin) |= YY_TRAILING_HEAD_MASK;");
+
+ if (real_reject) {
+ /* Remember matched text in case we back up
+ * due to REJECT.
+ */
+ indent_puts
+ ("YY_G(yy_full_match) = yy_cp;");
+ indent_puts
+ ("YY_G(yy_full_state) = YY_G(yy_state_ptr);");
+ indent_puts ("YY_G(yy_full_lp) = YY_G(yy_lp);");
+ }
+
+ indent_puts ("}");
+ indent_down ();
+
+ indent_puts ("else");
+ indent_up ();
+ indent_puts ("{");
+ indent_puts ("YY_G(yy_full_match) = yy_cp;");
+ indent_puts
+ ("YY_G(yy_full_state) = YY_G(yy_state_ptr);");
+ indent_puts ("YY_G(yy_full_lp) = YY_G(yy_lp);");
+ indent_puts ("break;");
+ indent_puts ("}");
+ indent_down ();
+
+ indent_puts ("++YY_G(yy_lp);");
+ indent_puts ("goto find_rule;");
+ }
+
+ else {
+ /* Remember matched text in case we back up due to
+ * trailing context plus REJECT.
+ */
+ indent_up ();
+ indent_puts ("{");
+ indent_puts ("YY_G(yy_full_match) = yy_cp;");
+ indent_puts ("break;");
+ indent_puts ("}");
+ indent_down ();
+ }
+
+ indent_puts ("}");
+ indent_down ();
+
+ indent_puts ("--yy_cp;");
+
+ /* We could consolidate the following two lines with those at
+ * the beginning, but at the cost of complaints that we're
+ * branching inside a loop.
+ */
+ indent_puts ("yy_current_state = *--YY_G(yy_state_ptr);");
+ indent_puts ("YY_G(yy_lp) = yy_accept[yy_current_state];");
+
+ indent_puts ("}");
+
+ indent_down ();
+ }
+
+ else { /* compressed */
+ indent_puts ("yy_act = yy_accept[yy_current_state];");
+
+ if (interactive && !reject) {
+ /* Do the guaranteed-needed backing up to figure out
+ * the match.
+ */
+ indent_puts ("if ( yy_act == 0 )");
+ indent_up ();
+ indent_puts ("{ /* have to back up */");
+ indent_puts
+ ("yy_cp = YY_G(yy_last_accepting_cpos);");
+ indent_puts
+ ("yy_current_state = YY_G(yy_last_accepting_state);");
+ indent_puts
+ ("yy_act = yy_accept[yy_current_state];");
+ indent_puts ("}");
+ indent_down ();
+ }
+ }
+}
+
+/* mkftbl - make the full table and return the struct .
+ * you should call mkecstbl() after this.
+ */
+
+struct yytbl_data *mkftbl (void)
+{
+ int i;
+ int end_of_buffer_action = num_rules + 1;
+ struct yytbl_data *tbl;
+ flex_int32_t *tdata = 0;
+
+ tbl = (struct yytbl_data *) calloc (1, sizeof (struct yytbl_data));
+ yytbl_data_init (tbl, YYTD_ID_ACCEPT);
+ tbl->td_flags |= YYTD_DATA32;
+ tbl->td_hilen = 0; /* it's a one-dimensional array */
+ tbl->td_lolen = lastdfa + 1;
+
+ tbl->td_data = tdata =
+ (flex_int32_t *) calloc (tbl->td_lolen, sizeof (flex_int32_t));
+
+ dfaacc[end_of_buffer_state].dfaacc_state = end_of_buffer_action;
+
+ for (i = 1; i <= lastdfa; ++i) {
+ int anum = dfaacc[i].dfaacc_state;
+
+ tdata[i] = anum;
+
+ if (trace && anum)
+ fprintf (stderr, _("state # %d accepts: [%d]\n"),
+ i, anum);
+ }
+
+ buf_prints (&yydmap_buf,
+ "\t{YYTD_ID_ACCEPT, (void**)&yy_accept, sizeof(%s)},\n",
+ long_align ? "flex_int32_t" : "flex_int16_t");
+ return tbl;
+}
+
+
+/* genftbl - generate full transition table */
+
+void genftbl (void)
+{
+ int i;
+ int end_of_buffer_action = num_rules + 1;
+
+ out_str_dec (long_align ? get_int32_decl () : get_int16_decl (),
+ "yy_accept", lastdfa + 1);
+
+ dfaacc[end_of_buffer_state].dfaacc_state = end_of_buffer_action;
+
+ for (i = 1; i <= lastdfa; ++i) {
+ int anum = dfaacc[i].dfaacc_state;
+
+ mkdata (anum);
+
+ if (trace && anum)
+ fprintf (stderr, _("state # %d accepts: [%d]\n"),
+ i, anum);
+ }
+
+ dataend ();
+
+ if (useecs)
+ genecs ();
+
+ /* Don't have to dump the actual full table entries - they were
+ * created on-the-fly.
+ */
+}
+
+
+/* Generate the code to find the next compressed-table state. */
+
+void gen_next_compressed_state (char_map)
+ char *char_map;
+{
+ indent_put2s ("YY_CHAR yy_c = %s;", char_map);
+
+ /* Save the backing-up info \before/ computing the next state
+ * because we always compute one more state than needed - we
+ * always proceed until we reach a jam state
+ */
+ gen_backing_up ();
+
+ indent_puts
+ ("while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )");
+ indent_up ();
+ indent_puts ("{");
+ indent_puts ("yy_current_state = (int) yy_def[yy_current_state];");
+
+ if (usemecs) {
+ /* We've arrange it so that templates are never chained
+ * to one another. This means we can afford to make a
+ * very simple test to see if we need to convert to
+ * yy_c's meta-equivalence class without worrying
+ * about erroneously looking up the meta-equivalence
+ * class twice
+ */
+ do_indent ();
+
+ /* lastdfa + 2 is the beginning of the templates */
+ out_dec ("if ( yy_current_state >= %d )\n", lastdfa + 2);
+
+ indent_up ();
+ indent_puts ("yy_c = yy_meta[(unsigned int) yy_c];");
+ indent_down ();
+ }
+
+ indent_puts ("}");
+ indent_down ();
+
+ indent_puts
+ ("yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];");
+}
+
+
+/* Generate the code to find the next match. */
+
+void gen_next_match (void)
+{
+ /* NOTE - changes in here should be reflected in gen_next_state() and
+ * gen_NUL_trans().
+ */
+ char *char_map = useecs ?
+ "yy_ec[YY_SC_TO_UI(*yy_cp)] " : "YY_SC_TO_UI(*yy_cp)";
+
+ char *char_map_2 = useecs ?
+ "yy_ec[YY_SC_TO_UI(*++yy_cp)] " : "YY_SC_TO_UI(*++yy_cp)";
+
+ if (fulltbl) {
+ if (gentables)
+ indent_put2s
+ ("while ( (yy_current_state = yy_nxt[yy_current_state][ %s ]) > 0 )",
+ char_map);
+ else
+ indent_put2s
+ ("while ( (yy_current_state = yy_nxt[yy_current_state*YY_NXT_LOLEN + %s ]) > 0 )",
+ char_map);
+
+ indent_up ();
+
+ if (num_backing_up > 0) {
+ indent_puts ("{");
+ gen_backing_up ();
+ outc ('\n');
+ }
+
+ indent_puts ("++yy_cp;");
+
+ if (num_backing_up > 0)
+
+ indent_puts ("}");
+
+ indent_down ();
+
+ outc ('\n');
+ indent_puts ("yy_current_state = -yy_current_state;");
+ }
+
+ else if (fullspd) {
+ indent_puts ("{");
+ indent_puts
+ ("yyconst struct yy_trans_info *yy_trans_info;\n");
+ indent_puts ("YY_CHAR yy_c;\n");
+ indent_put2s ("for ( yy_c = %s;", char_map);
+ indent_puts
+ (" (yy_trans_info = &yy_current_state[(unsigned int) yy_c])->");
+ indent_puts ("yy_verify == yy_c;");
+ indent_put2s (" yy_c = %s )", char_map_2);
+
+ indent_up ();
+
+ if (num_backing_up > 0)
+ indent_puts ("{");
+
+ indent_puts ("yy_current_state += yy_trans_info->yy_nxt;");
+
+ if (num_backing_up > 0) {
+ outc ('\n');
+ gen_backing_up ();
+ indent_puts ("}");
+ }
+
+ indent_down ();
+ indent_puts ("}");
+ }
+
+ else { /* compressed */
+ indent_puts ("do");
+
+ indent_up ();
+ indent_puts ("{");
+
+ gen_next_state (false);
+
+ indent_puts ("++yy_cp;");
+
+
+ indent_puts ("}");
+ indent_down ();
+
+ do_indent ();
+
+ if (interactive)
+ out_dec ("while ( yy_base[yy_current_state] != %d );\n", jambase);
+ else
+ out_dec ("while ( yy_current_state != %d );\n",
+ jamstate);
+
+ if (!reject && !interactive) {
+ /* Do the guaranteed-needed backing up to figure out
+ * the match.
+ */
+ indent_puts
+ ("yy_cp = YY_G(yy_last_accepting_cpos);");
+ indent_puts
+ ("yy_current_state = YY_G(yy_last_accepting_state);");
+ }
+ }
+}
+
+
+/* Generate the code to find the next state. */
+
+void gen_next_state (worry_about_NULs)
+ int worry_about_NULs;
+{ /* NOTE - changes in here should be reflected in gen_next_match() */
+ char char_map[256];
+
+ if (worry_about_NULs && !nultrans) {
+ if (useecs)
+ snprintf (char_map, sizeof(char_map),
+ "(*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : %d)",
+ NUL_ec);
+ else
+ snprintf (char_map, sizeof(char_map),
+ "(*yy_cp ? YY_SC_TO_UI(*yy_cp) : %d)",
+ NUL_ec);
+ }
+
+ else
+ strcpy (char_map, useecs ?
+ "yy_ec[YY_SC_TO_UI(*yy_cp)] " :
+ "YY_SC_TO_UI(*yy_cp)");
+
+ if (worry_about_NULs && nultrans) {
+ if (!fulltbl && !fullspd)
+ /* Compressed tables back up *before* they match. */
+ gen_backing_up ();
+
+ indent_puts ("if ( *yy_cp )");
+ indent_up ();
+ indent_puts ("{");
+ }
+
+ if (fulltbl) {
+ if (gentables)
+ indent_put2s
+ ("yy_current_state = yy_nxt[yy_current_state][%s];",
+ char_map);
+ else
+ indent_put2s
+ ("yy_current_state = yy_nxt[yy_current_state*YY_NXT_LOLEN + %s];",
+ char_map);
+ }
+
+ else if (fullspd)
+ indent_put2s
+ ("yy_current_state += yy_current_state[%s].yy_nxt;",
+ char_map);
+
+ else
+ gen_next_compressed_state (char_map);
+
+ if (worry_about_NULs && nultrans) {
+
+ indent_puts ("}");
+ indent_down ();
+ indent_puts ("else");
+ indent_up ();
+ indent_puts
+ ("yy_current_state = yy_NUL_trans[yy_current_state];");
+ indent_down ();
+ }
+
+ if (fullspd || fulltbl)
+ gen_backing_up ();
+
+ if (reject)
+ indent_puts ("*YY_G(yy_state_ptr)++ = yy_current_state;");
+}
+
+
+/* Generate the code to make a NUL transition. */
+
+void gen_NUL_trans (void)
+{ /* NOTE - changes in here should be reflected in gen_next_match() */
+ /* Only generate a definition for "yy_cp" if we'll generate code
+ * that uses it. Otherwise lint and the like complain.
+ */
+ int need_backing_up = (num_backing_up > 0 && !reject);
+
+ if (need_backing_up && (!nultrans || fullspd || fulltbl))
+ /* We're going to need yy_cp lying around for the call
+ * below to gen_backing_up().
+ */
+ indent_puts ("char *yy_cp = YY_G(yy_c_buf_p);");
+
+ outc ('\n');
+
+ if (nultrans) {
+ indent_puts
+ ("yy_current_state = yy_NUL_trans[yy_current_state];");
+ indent_puts ("yy_is_jam = (yy_current_state == 0);");
+ }
+
+ else if (fulltbl) {
+ do_indent ();
+ if (gentables)
+ out_dec ("yy_current_state = yy_nxt[yy_current_state][%d];\n", NUL_ec);
+ else
+ out_dec ("yy_current_state = yy_nxt[yy_current_state*YY_NXT_LOLEN + %d];\n", NUL_ec);
+ indent_puts ("yy_is_jam = (yy_current_state <= 0);");
+ }
+
+ else if (fullspd) {
+ do_indent ();
+ out_dec ("int yy_c = %d;\n", NUL_ec);
+
+ indent_puts
+ ("yyconst struct yy_trans_info *yy_trans_info;\n");
+ indent_puts
+ ("yy_trans_info = &yy_current_state[(unsigned int) yy_c];");
+ indent_puts ("yy_current_state += yy_trans_info->yy_nxt;");
+
+ indent_puts
+ ("yy_is_jam = (yy_trans_info->yy_verify != yy_c);");
+ }
+
+ else {
+ char NUL_ec_str[20];
+
+ snprintf (NUL_ec_str, sizeof(NUL_ec_str), "%d", NUL_ec);
+ gen_next_compressed_state (NUL_ec_str);
+
+ do_indent ();
+ out_dec ("yy_is_jam = (yy_current_state == %d);\n",
+ jamstate);
+
+ if (reject) {
+ /* Only stack this state if it's a transition we
+ * actually make. If we stack it on a jam, then
+ * the state stack and yy_c_buf_p get out of sync.
+ */
+ indent_puts ("if ( ! yy_is_jam )");
+ indent_up ();
+ indent_puts
+ ("*YY_G(yy_state_ptr)++ = yy_current_state;");
+ indent_down ();
+ }
+ }
+
+ /* If we've entered an accepting state, back up; note that
+ * compressed tables have *already* done such backing up, so
+ * we needn't bother with it again.
+ */
+ if (need_backing_up && (fullspd || fulltbl)) {
+ outc ('\n');
+ indent_puts ("if ( ! yy_is_jam )");
+ indent_up ();
+ indent_puts ("{");
+ gen_backing_up ();
+ indent_puts ("}");
+ indent_down ();
+ }
+}
+
+
+/* Generate the code to find the start state. */
+
+void gen_start_state (void)
+{
+ if (fullspd) {
+ if (bol_needed) {
+ indent_puts
+ ("yy_current_state = yy_start_state_list[YY_G(yy_start) + YY_AT_BOL()];");
+ }
+ else
+ indent_puts
+ ("yy_current_state = yy_start_state_list[YY_G(yy_start)];");
+ }
+
+ else {
+ indent_puts ("yy_current_state = YY_G(yy_start);");
+
+ if (bol_needed)
+ indent_puts ("yy_current_state += YY_AT_BOL();");
+
+ if (reject) {
+ /* Set up for storing up states. */
+ outn ("m4_ifdef( [[M4_YY_USES_REJECT]],\n[[");
+ indent_puts
+ ("YY_G(yy_state_ptr) = YY_G(yy_state_buf);");
+ indent_puts
+ ("*YY_G(yy_state_ptr)++ = yy_current_state;");
+ outn ("]])");
+ }
+ }
+}
+
+
+/* gentabs - generate data statements for the transition tables */
+
+void gentabs (void)
+{
+ int i, j, k, *accset, nacc, *acc_array, total_states;
+ int end_of_buffer_action = num_rules + 1;
+ struct yytbl_data *yyacc_tbl = 0, *yymeta_tbl = 0, *yybase_tbl = 0,
+ *yydef_tbl = 0, *yynxt_tbl = 0, *yychk_tbl = 0, *yyacclist_tbl=0;
+ flex_int32_t *yyacc_data = 0, *yybase_data = 0, *yydef_data = 0,
+ *yynxt_data = 0, *yychk_data = 0, *yyacclist_data=0;
+ flex_int32_t yybase_curr = 0, yyacclist_curr=0,yyacc_curr=0;
+
+ acc_array = allocate_integer_array (current_max_dfas);
+ nummt = 0;
+
+ /* The compressed table format jams by entering the "jam state",
+ * losing information about the previous state in the process.
+ * In order to recover the previous state, we effectively need
+ * to keep backing-up information.
+ */
+ ++num_backing_up;
+
+ if (reject) {
+ /* Write out accepting list and pointer list.
+
+ * First we generate the "yy_acclist" array. In the process,
+ * we compute the indices that will go into the "yy_accept"
+ * array, and save the indices in the dfaacc array.
+ */
+ int EOB_accepting_list[2];
+
+ /* Set up accepting structures for the End Of Buffer state. */
+ EOB_accepting_list[0] = 0;
+ EOB_accepting_list[1] = end_of_buffer_action;
+ accsiz[end_of_buffer_state] = 1;
+ dfaacc[end_of_buffer_state].dfaacc_set =
+ EOB_accepting_list;
+
+ out_str_dec (long_align ? get_int32_decl () :
+ get_int16_decl (), "yy_acclist", MAX (numas,
+ 1) + 1);
+
+ buf_prints (&yydmap_buf,
+ "\t{YYTD_ID_ACCLIST, (void**)&yy_acclist, sizeof(%s)},\n",
+ long_align ? "flex_int32_t" : "flex_int16_t");
+
+ yyacclist_tbl = (struct yytbl_data*)calloc(1,sizeof(struct yytbl_data));
+ yytbl_data_init (yyacclist_tbl, YYTD_ID_ACCLIST);
+ yyacclist_tbl->td_lolen = MAX(numas,1) + 1;
+ yyacclist_tbl->td_data = yyacclist_data =
+ (flex_int32_t *) calloc (yyacclist_tbl->td_lolen, sizeof (flex_int32_t));
+ yyacclist_curr = 1;
+
+ j = 1; /* index into "yy_acclist" array */
+
+ for (i = 1; i <= lastdfa; ++i) {
+ acc_array[i] = j;
+
+ if (accsiz[i] != 0) {
+ accset = dfaacc[i].dfaacc_set;
+ nacc = accsiz[i];
+
+ if (trace)
+ fprintf (stderr,
+ _("state # %d accepts: "),
+ i);
+
+ for (k = 1; k <= nacc; ++k) {
+ int accnum = accset[k];
+
+ ++j;
+
+ if (variable_trailing_context_rules
+ && !(accnum &
+ YY_TRAILING_HEAD_MASK)
+ && accnum > 0
+ && accnum <= num_rules
+ && rule_type[accnum] ==
+ RULE_VARIABLE) {
+ /* Special hack to flag
+ * accepting number as part
+ * of trailing context rule.
+ */
+ accnum |= YY_TRAILING_MASK;
+ }
+
+ mkdata (accnum);
+ yyacclist_data[yyacclist_curr++] = accnum;
+
+ if (trace) {
+ fprintf (stderr, "[%d]",
+ accset[k]);
+
+ if (k < nacc)
+ fputs (", ",
+ stderr);
+ else
+ putc ('\n',
+ stderr);
+ }
+ }
+ }
+ }
+
+ /* add accepting number for the "jam" state */
+ acc_array[i] = j;
+
+ dataend ();
+ if (tablesext) {
+ yytbl_data_compress (yyacclist_tbl);
+ if (yytbl_data_fwrite (&tableswr, yyacclist_tbl) < 0)
+ flexerror (_("Could not write yyacclist_tbl"));
+ yytbl_data_destroy (yyacclist_tbl);
+ yyacclist_tbl = NULL;
+ }
+ }
+
+ else {
+ dfaacc[end_of_buffer_state].dfaacc_state =
+ end_of_buffer_action;
+
+ for (i = 1; i <= lastdfa; ++i)
+ acc_array[i] = dfaacc[i].dfaacc_state;
+
+ /* add accepting number for jam state */
+ acc_array[i] = 0;
+ }
+
+ /* Begin generating yy_accept */
+
+ /* Spit out "yy_accept" array. If we're doing "reject", it'll be
+ * pointers into the "yy_acclist" array. Otherwise it's actual
+ * accepting numbers. In either case, we just dump the numbers.
+ */
+
+ /* "lastdfa + 2" is the size of "yy_accept"; includes room for C arrays
+ * beginning at 0 and for "jam" state.
+ */
+ k = lastdfa + 2;
+
+ if (reject)
+ /* We put a "cap" on the table associating lists of accepting
+ * numbers with state numbers. This is needed because we tell
+ * where the end of an accepting list is by looking at where
+ * the list for the next state starts.
+ */
+ ++k;
+
+ out_str_dec (long_align ? get_int32_decl () : get_int16_decl (),
+ "yy_accept", k);
+
+ buf_prints (&yydmap_buf,
+ "\t{YYTD_ID_ACCEPT, (void**)&yy_accept, sizeof(%s)},\n",
+ long_align ? "flex_int32_t" : "flex_int16_t");
+
+ yyacc_tbl =
+ (struct yytbl_data *) calloc (1,
+ sizeof (struct yytbl_data));
+ yytbl_data_init (yyacc_tbl, YYTD_ID_ACCEPT);
+ yyacc_tbl->td_lolen = k;
+ yyacc_tbl->td_data = yyacc_data =
+ (flex_int32_t *) calloc (yyacc_tbl->td_lolen, sizeof (flex_int32_t));
+ yyacc_curr=1;
+
+ for (i = 1; i <= lastdfa; ++i) {
+ mkdata (acc_array[i]);
+ yyacc_data[yyacc_curr++] = acc_array[i];
+
+ if (!reject && trace && acc_array[i])
+ fprintf (stderr, _("state # %d accepts: [%d]\n"),
+ i, acc_array[i]);
+ }
+
+ /* Add entry for "jam" state. */
+ mkdata (acc_array[i]);
+ yyacc_data[yyacc_curr++] = acc_array[i];
+
+ if (reject) {
+ /* Add "cap" for the list. */
+ mkdata (acc_array[i]);
+ yyacc_data[yyacc_curr++] = acc_array[i];
+ }
+
+ dataend ();
+ if (tablesext) {
+ yytbl_data_compress (yyacc_tbl);
+ if (yytbl_data_fwrite (&tableswr, yyacc_tbl) < 0)
+ flexerror (_("Could not write yyacc_tbl"));
+ yytbl_data_destroy (yyacc_tbl);
+ yyacc_tbl = NULL;
+ }
+ /* End generating yy_accept */
+
+ if (useecs) {
+
+ genecs ();
+ if (tablesext) {
+ struct yytbl_data *tbl;
+
+ tbl = mkecstbl ();
+ yytbl_data_compress (tbl);
+ if (yytbl_data_fwrite (&tableswr, tbl) < 0)
+ flexerror (_("Could not write ecstbl"));
+ yytbl_data_destroy (tbl);
+ tbl = 0;
+ }
+ }
+
+ if (usemecs) {
+ /* Begin generating yy_meta */
+ /* Write out meta-equivalence classes (used to index
+ * templates with).
+ */
+ flex_int32_t *yymecs_data = 0;
+ yymeta_tbl =
+ (struct yytbl_data *) calloc (1,
+ sizeof (struct
+ yytbl_data));
+ yytbl_data_init (yymeta_tbl, YYTD_ID_META);
+ yymeta_tbl->td_lolen = numecs + 1;
+ yymeta_tbl->td_data = yymecs_data =
+ (flex_int32_t *) calloc (yymeta_tbl->td_lolen,
+ sizeof (flex_int32_t));
+
+ if (trace)
+ fputs (_("\n\nMeta-Equivalence Classes:\n"),
+ stderr);
+
+ out_str_dec (get_yy_char_decl (), "yy_meta", numecs + 1);
+ buf_prints (&yydmap_buf,
+ "\t{YYTD_ID_META, (void**)&yy_meta, sizeof(%s)},\n",
+ "YY_CHAR");
+
+ for (i = 1; i <= numecs; ++i) {
+ if (trace)
+ fprintf (stderr, "%d = %d\n",
+ i, ABS (tecbck[i]));
+
+ mkdata (ABS (tecbck[i]));
+ yymecs_data[i] = ABS (tecbck[i]);
+ }
+
+ dataend ();
+ if (tablesext) {
+ yytbl_data_compress (yymeta_tbl);
+ if (yytbl_data_fwrite (&tableswr, yymeta_tbl) < 0)
+ flexerror (_
+ ("Could not write yymeta_tbl"));
+ yytbl_data_destroy (yymeta_tbl);
+ yymeta_tbl = NULL;
+ }
+ /* End generating yy_meta */
+ }
+
+ total_states = lastdfa + numtemps;
+
+ /* Begin generating yy_base */
+ out_str_dec ((tblend >= INT16_MAX || long_align) ?
+ get_uint32_decl () : get_uint16_decl (),
+ "yy_base", total_states + 1);
+
+ buf_prints (&yydmap_buf,
+ "\t{YYTD_ID_BASE, (void**)&yy_base, sizeof(%s)},\n",
+ (tblend >= INT16_MAX
+ || long_align) ? "flex_uint32_t" : "flex_uint16_t");
+ yybase_tbl =
+ (struct yytbl_data *) calloc (1,
+ sizeof (struct yytbl_data));
+ yytbl_data_init (yybase_tbl, YYTD_ID_BASE);
+ yybase_tbl->td_lolen = total_states + 1;
+ yybase_tbl->td_data = yybase_data =
+ (flex_int32_t *) calloc (yybase_tbl->td_lolen,
+ sizeof (flex_int32_t));
+ yybase_curr = 1;
+
+ for (i = 1; i <= lastdfa; ++i) {
+ int d = def[i];
+
+ if (base[i] == JAMSTATE)
+ base[i] = jambase;
+
+ if (d == JAMSTATE)
+ def[i] = jamstate;
+
+ else if (d < 0) {
+ /* Template reference. */
+ ++tmpuses;
+ def[i] = lastdfa - d + 1;
+ }
+
+ mkdata (base[i]);
+ yybase_data[yybase_curr++] = base[i];
+ }
+
+ /* Generate jam state's base index. */
+ mkdata (base[i]);
+ yybase_data[yybase_curr++] = base[i];
+
+ for (++i /* skip jam state */ ; i <= total_states; ++i) {
+ mkdata (base[i]);
+ yybase_data[yybase_curr++] = base[i];
+ def[i] = jamstate;
+ }
+
+ dataend ();
+ if (tablesext) {
+ yytbl_data_compress (yybase_tbl);
+ if (yytbl_data_fwrite (&tableswr, yybase_tbl) < 0)
+ flexerror (_("Could not write yybase_tbl"));
+ yytbl_data_destroy (yybase_tbl);
+ yybase_tbl = NULL;
+ }
+ /* End generating yy_base */
+
+
+ /* Begin generating yy_def */
+ out_str_dec ((total_states >= INT16_MAX || long_align) ?
+ get_int32_decl () : get_int16_decl (),
+ "yy_def", total_states + 1);
+
+ buf_prints (&yydmap_buf,
+ "\t{YYTD_ID_DEF, (void**)&yy_def, sizeof(%s)},\n",
+ (total_states >= INT16_MAX
+ || long_align) ? "flex_int32_t" : "flex_int16_t");
+
+ yydef_tbl =
+ (struct yytbl_data *) calloc (1,
+ sizeof (struct yytbl_data));
+ yytbl_data_init (yydef_tbl, YYTD_ID_DEF);
+ yydef_tbl->td_lolen = total_states + 1;
+ yydef_tbl->td_data = yydef_data =
+ (flex_int32_t *) calloc (yydef_tbl->td_lolen, sizeof (flex_int32_t));
+
+ for (i = 1; i <= total_states; ++i) {
+ mkdata (def[i]);
+ yydef_data[i] = def[i];
+ }
+
+ dataend ();
+ if (tablesext) {
+ yytbl_data_compress (yydef_tbl);
+ if (yytbl_data_fwrite (&tableswr, yydef_tbl) < 0)
+ flexerror (_("Could not write yydef_tbl"));
+ yytbl_data_destroy (yydef_tbl);
+ yydef_tbl = NULL;
+ }
+ /* End generating yy_def */
+
+
+ /* Begin generating yy_nxt */
+ out_str_dec ((total_states >= INT16_MAX || long_align) ?
+ get_uint32_decl () : get_uint16_decl (), "yy_nxt",
+ tblend + 1);
+
+ buf_prints (&yydmap_buf,
+ "\t{YYTD_ID_NXT, (void**)&yy_nxt, sizeof(%s)},\n",
+ (total_states >= INT16_MAX
+ || long_align) ? "flex_uint32_t" : "flex_uint16_t");
+
+ yynxt_tbl =
+ (struct yytbl_data *) calloc (1,
+ sizeof (struct yytbl_data));
+ yytbl_data_init (yynxt_tbl, YYTD_ID_NXT);
+ yynxt_tbl->td_lolen = tblend + 1;
+ yynxt_tbl->td_data = yynxt_data =
+ (flex_int32_t *) calloc (yynxt_tbl->td_lolen, sizeof (flex_int32_t));
+
+ for (i = 1; i <= tblend; ++i) {
+ /* Note, the order of the following test is important.
+ * If chk[i] is 0, then nxt[i] is undefined.
+ */
+ if (chk[i] == 0 || nxt[i] == 0)
+ nxt[i] = jamstate; /* new state is the JAM state */
+
+ mkdata (nxt[i]);
+ yynxt_data[i] = nxt[i];
+ }
+
+ dataend ();
+ if (tablesext) {
+ yytbl_data_compress (yynxt_tbl);
+ if (yytbl_data_fwrite (&tableswr, yynxt_tbl) < 0)
+ flexerror (_("Could not write yynxt_tbl"));
+ yytbl_data_destroy (yynxt_tbl);
+ yynxt_tbl = NULL;
+ }
+ /* End generating yy_nxt */
+
+ /* Begin generating yy_chk */
+ out_str_dec ((total_states >= INT16_MAX || long_align) ?
+ get_int32_decl () : get_int16_decl (), "yy_chk",
+ tblend + 1);
+
+ buf_prints (&yydmap_buf,
+ "\t{YYTD_ID_CHK, (void**)&yy_chk, sizeof(%s)},\n",
+ (total_states >= INT16_MAX
+ || long_align) ? "flex_int32_t" : "flex_int16_t");
+
+ yychk_tbl =
+ (struct yytbl_data *) calloc (1,
+ sizeof (struct yytbl_data));
+ yytbl_data_init (yychk_tbl, YYTD_ID_CHK);
+ yychk_tbl->td_lolen = tblend + 1;
+ yychk_tbl->td_data = yychk_data =
+ (flex_int32_t *) calloc (yychk_tbl->td_lolen, sizeof (flex_int32_t));
+
+ for (i = 1; i <= tblend; ++i) {
+ if (chk[i] == 0)
+ ++nummt;
+
+ mkdata (chk[i]);
+ yychk_data[i] = chk[i];
+ }
+
+ dataend ();
+ if (tablesext) {
+ yytbl_data_compress (yychk_tbl);
+ if (yytbl_data_fwrite (&tableswr, yychk_tbl) < 0)
+ flexerror (_("Could not write yychk_tbl"));
+ yytbl_data_destroy (yychk_tbl);
+ yychk_tbl = NULL;
+ }
+ /* End generating yy_chk */
+
+ flex_free ((void *) acc_array);
+}
+
+
+/* Write out a formatted string (with a secondary string argument) at the
+ * current indentation level, adding a final newline.
+ */
+
+void indent_put2s (fmt, arg)
+ const char *fmt, *arg;
+{
+ do_indent ();
+ out_str (fmt, arg);
+ outn ("");
+}
+
+
+/* Write out a string at the current indentation level, adding a final
+ * newline.
+ */
+
+void indent_puts (str)
+ const char *str;
+{
+ do_indent ();
+ outn (str);
+}
+
+
+/* make_tables - generate transition tables and finishes generating output file
+ */
+
+void make_tables (void)
+{
+ int i;
+ int did_eof_rule = false;
+ struct yytbl_data *yynultrans_tbl = NULL;
+
+
+ skelout (); /* %% [2.0] - break point in skel */
+
+ /* First, take care of YY_DO_BEFORE_ACTION depending on yymore
+ * being used.
+ */
+ set_indent (1);
+
+ if (yymore_used && !yytext_is_array) {
+ indent_puts ("YY_G(yytext_ptr) -= YY_G(yy_more_len); \\");
+ indent_puts
+ ("yyleng = (size_t) (yy_cp - YY_G(yytext_ptr)); \\");
+ }
+
+ else
+ indent_puts ("yyleng = (size_t) (yy_cp - yy_bp); \\");
+
+ /* Now also deal with copying yytext_ptr to yytext if needed. */
+ skelout (); /* %% [3.0] - break point in skel */
+ if (yytext_is_array) {
+ if (yymore_used)
+ indent_puts
+ ("if ( yyleng + YY_G(yy_more_offset) >= YYLMAX ) \\");
+ else
+ indent_puts ("if ( yyleng >= YYLMAX ) \\");
+
+ indent_up ();
+ indent_puts
+ ("YY_FATAL_ERROR( \"token too large, exceeds YYLMAX\" ); \\");
+ indent_down ();
+
+ if (yymore_used) {
+ indent_puts
+ ("yy_flex_strncpy( &yytext[YY_G(yy_more_offset)], YY_G(yytext_ptr), yyleng + 1 M4_YY_CALL_LAST_ARG); \\");
+ indent_puts ("yyleng += YY_G(yy_more_offset); \\");
+ indent_puts
+ ("YY_G(yy_prev_more_offset) = YY_G(yy_more_offset); \\");
+ indent_puts ("YY_G(yy_more_offset) = 0; \\");
+ }
+ else {
+ indent_puts
+ ("yy_flex_strncpy( yytext, YY_G(yytext_ptr), yyleng + 1 M4_YY_CALL_LAST_ARG); \\");
+ }
+ }
+
+ set_indent (0);
+
+ skelout (); /* %% [4.0] - break point in skel */
+
+
+ /* This is where we REALLY begin generating the tables. */
+
+ out_dec ("#define YY_NUM_RULES %d\n", num_rules);
+ out_dec ("#define YY_END_OF_BUFFER %d\n", num_rules + 1);
+
+ if (fullspd) {
+ /* Need to define the transet type as a size large
+ * enough to hold the biggest offset.
+ */
+ int total_table_size = tblend + numecs + 1;
+ char *trans_offset_type =
+ (total_table_size >= INT16_MAX || long_align) ?
+ "flex_int32_t" : "flex_int16_t";
+
+ set_indent (0);
+ indent_puts ("struct yy_trans_info");
+ indent_up ();
+ indent_puts ("{");
+
+ /* We require that yy_verify and yy_nxt must be of the same size int. */
+ indent_put2s ("%s yy_verify;", trans_offset_type);
+
+ /* In cases where its sister yy_verify *is* a "yes, there is
+ * a transition", yy_nxt is the offset (in records) to the
+ * next state. In most cases where there is no transition,
+ * the value of yy_nxt is irrelevant. If yy_nxt is the -1th
+ * record of a state, though, then yy_nxt is the action number
+ * for that state.
+ */
+
+ indent_put2s ("%s yy_nxt;", trans_offset_type);
+ indent_puts ("};");
+ indent_down ();
+ }
+ else {
+ /* We generate a bogus 'struct yy_trans_info' data type
+ * so we can guarantee that it is always declared in the skel.
+ * This is so we can compile "sizeof(struct yy_trans_info)"
+ * in any scanner.
+ */
+ indent_puts
+ ("/* This struct is not used in this scanner,");
+ indent_puts (" but its presence is necessary. */");
+ indent_puts ("struct yy_trans_info");
+ indent_up ();
+ indent_puts ("{");
+ indent_puts ("flex_int32_t yy_verify;");
+ indent_puts ("flex_int32_t yy_nxt;");
+ indent_puts ("};");
+ indent_down ();
+ }
+
+ if (fullspd) {
+ genctbl ();
+ if (tablesext) {
+ struct yytbl_data *tbl;
+
+ tbl = mkctbl ();
+ yytbl_data_compress (tbl);
+ if (yytbl_data_fwrite (&tableswr, tbl) < 0)
+ flexerror (_("Could not write ftbl"));
+ yytbl_data_destroy (tbl);
+
+ tbl = mkssltbl ();
+ yytbl_data_compress (tbl);
+ if (yytbl_data_fwrite (&tableswr, tbl) < 0)
+ flexerror (_("Could not write ssltbl"));
+ yytbl_data_destroy (tbl);
+ tbl = 0;
+
+ if (useecs) {
+ tbl = mkecstbl ();
+ yytbl_data_compress (tbl);
+ if (yytbl_data_fwrite (&tableswr, tbl) < 0)
+ flexerror (_
+ ("Could not write ecstbl"));
+ yytbl_data_destroy (tbl);
+ tbl = 0;
+ }
+ }
+ }
+ else if (fulltbl) {
+ genftbl ();
+ if (tablesext) {
+ struct yytbl_data *tbl;
+
+ tbl = mkftbl ();
+ yytbl_data_compress (tbl);
+ if (yytbl_data_fwrite (&tableswr, tbl) < 0)
+ flexerror (_("Could not write ftbl"));
+ yytbl_data_destroy (tbl);
+ tbl = 0;
+
+ if (useecs) {
+ tbl = mkecstbl ();
+ yytbl_data_compress (tbl);
+ if (yytbl_data_fwrite (&tableswr, tbl) < 0)
+ flexerror (_
+ ("Could not write ecstbl"));
+ yytbl_data_destroy (tbl);
+ tbl = 0;
+ }
+ }
+ }
+ else
+ gentabs ();
+
+ if (do_yylineno) {
+
+ geneoltbl ();
+
+ if (tablesext) {
+ struct yytbl_data *tbl;
+
+ tbl = mkeoltbl ();
+ yytbl_data_compress (tbl);
+ if (yytbl_data_fwrite (&tableswr, tbl) < 0)
+ flexerror (_("Could not write eoltbl"));
+ yytbl_data_destroy (tbl);
+ tbl = 0;
+ }
+ }
+
+ /* Definitions for backing up. We don't need them if REJECT
+ * is being used because then we use an alternative backin-up
+ * technique instead.
+ */
+ if (num_backing_up > 0 && !reject) {
+ if (!C_plus_plus && !reentrant) {
+ indent_puts
+ ("static yy_state_type yy_last_accepting_state;");
+ indent_puts
+ ("static char *yy_last_accepting_cpos;\n");
+ }
+ }
+
+ if (nultrans) {
+ flex_int32_t *yynultrans_data = 0;
+
+ /* Begin generating yy_NUL_trans */
+ out_str_dec (get_state_decl (), "yy_NUL_trans",
+ lastdfa + 1);
+ buf_prints (&yydmap_buf,
+ "\t{YYTD_ID_NUL_TRANS, (void**)&yy_NUL_trans, sizeof(%s)},\n",
+ (fullspd) ? "struct yy_trans_info*" :
+ "flex_int32_t");
+
+ yynultrans_tbl =
+ (struct yytbl_data *) calloc (1,
+ sizeof (struct
+ yytbl_data));
+ yytbl_data_init (yynultrans_tbl, YYTD_ID_NUL_TRANS);
+ if (fullspd)
+ yynultrans_tbl->td_flags |= YYTD_PTRANS;
+ yynultrans_tbl->td_lolen = lastdfa + 1;
+ yynultrans_tbl->td_data = yynultrans_data =
+ (flex_int32_t *) calloc (yynultrans_tbl->td_lolen,
+ sizeof (flex_int32_t));
+
+ for (i = 1; i <= lastdfa; ++i) {
+ if (fullspd) {
+ out_dec (" &yy_transition[%d],\n",
+ base[i]);
+ yynultrans_data[i] = base[i];
+ }
+ else {
+ mkdata (nultrans[i]);
+ yynultrans_data[i] = nultrans[i];
+ }
+ }
+
+ dataend ();
+ if (tablesext) {
+ yytbl_data_compress (yynultrans_tbl);
+ if (yytbl_data_fwrite (&tableswr, yynultrans_tbl) <
+ 0)
+ flexerror (_
+ ("Could not write yynultrans_tbl"));
+ }
+
+ if (yynultrans_tbl != NULL) {
+ yytbl_data_destroy (yynultrans_tbl);
+ yynultrans_tbl = NULL;
+ }
+
+ /* End generating yy_NUL_trans */
+ }
+
+ if (!C_plus_plus && !reentrant) {
+ indent_puts ("extern int yy_flex_debug;");
+ indent_put2s ("int yy_flex_debug = %s;\n",
+ ddebug ? "1" : "0");
+ }
+
+ if (ddebug) { /* Spit out table mapping rules to line numbers. */
+ out_str_dec (long_align ? get_int32_decl () :
+ get_int16_decl (), "yy_rule_linenum",
+ num_rules);
+ for (i = 1; i < num_rules; ++i)
+ mkdata (rule_linenum[i]);
+ dataend ();
+ }
+
+ if (reject) {
+ outn ("m4_ifdef( [[M4_YY_USES_REJECT]],\n[[");
+ /* Declare state buffer variables. */
+ if (!C_plus_plus && !reentrant) {
+ outn ("static yy_state_type *yy_state_buf=0, *yy_state_ptr=0;");
+ outn ("static char *yy_full_match;");
+ outn ("static int yy_lp;");
+ }
+
+ if (variable_trailing_context_rules) {
+ if (!C_plus_plus && !reentrant) {
+ outn ("static int yy_looking_for_trail_begin = 0;");
+ outn ("static int yy_full_lp;");
+ outn ("static int *yy_full_state;");
+ }
+
+ out_hex ("#define YY_TRAILING_MASK 0x%x\n",
+ (unsigned int) YY_TRAILING_MASK);
+ out_hex ("#define YY_TRAILING_HEAD_MASK 0x%x\n",
+ (unsigned int) YY_TRAILING_HEAD_MASK);
+ }
+
+ outn ("#define REJECT \\");
+ outn ("{ \\");
+ outn ("*yy_cp = YY_G(yy_hold_char); /* undo effects of setting up yytext */ \\");
+ outn ("yy_cp = YY_G(yy_full_match); /* restore poss. backed-over text */ \\");
+
+ if (variable_trailing_context_rules) {
+ outn ("YY_G(yy_lp) = YY_G(yy_full_lp); /* restore orig. accepting pos. */ \\");
+ outn ("YY_G(yy_state_ptr) = YY_G(yy_full_state); /* restore orig. state */ \\");
+ outn ("yy_current_state = *YY_G(yy_state_ptr); /* restore curr. state */ \\");
+ }
+
+ outn ("++YY_G(yy_lp); \\");
+ outn ("goto find_rule; \\");
+
+ outn ("}");
+ outn ("]])\n");
+ }
+
+ else {
+ outn ("/* The intent behind this definition is that it'll catch");
+ outn (" * any uses of REJECT which flex missed.");
+ outn (" */");
+ outn ("#define REJECT reject_used_but_not_detected");
+ }
+
+ if (yymore_used) {
+ if (!C_plus_plus) {
+ if (yytext_is_array) {
+ if (!reentrant){
+ indent_puts ("static int yy_more_offset = 0;");
+ indent_puts ("static int yy_prev_more_offset = 0;");
+ }
+ }
+ else if (!reentrant) {
+ indent_puts
+ ("static int yy_more_flag = 0;");
+ indent_puts
+ ("static int yy_more_len = 0;");
+ }
+ }
+
+ if (yytext_is_array) {
+ indent_puts
+ ("#define yymore() (YY_G(yy_more_offset) = yy_flex_strlen( yytext M4_YY_CALL_LAST_ARG))");
+ indent_puts ("#define YY_NEED_STRLEN");
+ indent_puts ("#define YY_MORE_ADJ 0");
+ indent_puts
+ ("#define YY_RESTORE_YY_MORE_OFFSET \\");
+ indent_up ();
+ indent_puts ("{ \\");
+ indent_puts
+ ("YY_G(yy_more_offset) = YY_G(yy_prev_more_offset); \\");
+ indent_puts ("yyleng -= YY_G(yy_more_offset); \\");
+ indent_puts ("}");
+ indent_down ();
+ }
+ else {
+ indent_puts
+ ("#define yymore() (YY_G(yy_more_flag) = 1)");
+ indent_puts
+ ("#define YY_MORE_ADJ YY_G(yy_more_len)");
+ indent_puts ("#define YY_RESTORE_YY_MORE_OFFSET");
+ }
+ }
+
+ else {
+ indent_puts
+ ("#define yymore() yymore_used_but_not_detected");
+ indent_puts ("#define YY_MORE_ADJ 0");
+ indent_puts ("#define YY_RESTORE_YY_MORE_OFFSET");
+ }
+
+ if (!C_plus_plus) {
+ if (yytext_is_array) {
+ outn ("#ifndef YYLMAX");
+ outn ("#define YYLMAX 8192");
+ outn ("#endif\n");
+ if (!reentrant){
+ outn ("char yytext[YYLMAX];");
+ outn ("char *yytext_ptr;");
+ }
+ }
+
+ else {
+ if(! reentrant)
+ outn ("char *yytext;");
+ }
+ }
+
+ out (&action_array[defs1_offset]);
+
+ line_directive_out (stdout, 0);
+
+ skelout (); /* %% [5.0] - break point in skel */
+
+ if (!C_plus_plus) {
+ if (use_read) {
+ outn ("\terrno=0; \\");
+ outn ("\twhile ( (result = read( fileno(yyin), (char *) buf, max_size )) < 0 ) \\");
+ outn ("\t{ \\");
+ outn ("\t\tif( errno != EINTR) \\");
+ outn ("\t\t{ \\");
+ outn ("\t\t\tYY_FATAL_ERROR( \"input in flex scanner failed\" ); \\");
+ outn ("\t\t\tbreak; \\");
+ outn ("\t\t} \\");
+ outn ("\t\terrno=0; \\");
+ outn ("\t\tclearerr(yyin); \\");
+ outn ("\t}\\");
+ }
+
+ else {
+ outn ("\tif ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \\");
+ outn ("\t\t{ \\");
+ outn ("\t\tint c = '*'; \\");
+ outn ("\t\tsize_t n; \\");
+ outn ("\t\tfor ( n = 0; n < max_size && \\");
+ outn ("\t\t\t (c = getc( yyin )) != EOF && c != '\\n'; ++n ) \\");
+ outn ("\t\t\tbuf[n] = (char) c; \\");
+ outn ("\t\tif ( c == '\\n' ) \\");
+ outn ("\t\t\tbuf[n++] = (char) c; \\");
+ outn ("\t\tif ( c == EOF && ferror( yyin ) ) \\");
+ outn ("\t\t\tYY_FATAL_ERROR( \"input in flex scanner failed\" ); \\");
+ outn ("\t\tresult = n; \\");
+ outn ("\t\t} \\");
+ outn ("\telse \\");
+ outn ("\t\t{ \\");
+ outn ("\t\terrno=0; \\");
+ outn ("\t\twhile ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \\");
+ outn ("\t\t\t{ \\");
+ outn ("\t\t\tif( errno != EINTR) \\");
+ outn ("\t\t\t\t{ \\");
+ outn ("\t\t\t\tYY_FATAL_ERROR( \"input in flex scanner failed\" ); \\");
+ outn ("\t\t\t\tbreak; \\");
+ outn ("\t\t\t\t} \\");
+ outn ("\t\t\terrno=0; \\");
+ outn ("\t\t\tclearerr(yyin); \\");
+ outn ("\t\t\t} \\");
+ outn ("\t\t}\\");
+ }
+ }
+
+ skelout (); /* %% [6.0] - break point in skel */
+
+ indent_puts ("#define YY_RULE_SETUP \\");
+ indent_up ();
+ if (bol_needed) {
+ indent_puts ("if ( yyleng > 0 ) \\");
+ indent_up ();
+ indent_puts ("YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \\");
+ indent_puts ("\t\t(yytext[yyleng - 1] == '\\n'); \\");
+ indent_down ();
+ }
+ indent_puts ("YY_USER_ACTION");
+ indent_down ();
+
+ skelout (); /* %% [7.0] - break point in skel */
+
+ /* Copy prolog to output file. */
+ out (&action_array[prolog_offset]);
+
+ line_directive_out (stdout, 0);
+
+ skelout (); /* %% [8.0] - break point in skel */
+
+ set_indent (2);
+
+ if (yymore_used && !yytext_is_array) {
+ indent_puts ("YY_G(yy_more_len) = 0;");
+ indent_puts ("if ( YY_G(yy_more_flag) )");
+ indent_up ();
+ indent_puts ("{");
+ indent_puts
+ ("YY_G(yy_more_len) = YY_G(yy_c_buf_p) - YY_G(yytext_ptr);");
+ indent_puts ("YY_G(yy_more_flag) = 0;");
+ indent_puts ("}");
+ indent_down ();
+ }
+
+ skelout (); /* %% [9.0] - break point in skel */
+
+ gen_start_state ();
+
+ /* Note, don't use any indentation. */
+ outn ("yy_match:");
+ gen_next_match ();
+
+ skelout (); /* %% [10.0] - break point in skel */
+ set_indent (2);
+ gen_find_action ();
+
+ skelout (); /* %% [11.0] - break point in skel */
+ outn ("m4_ifdef( [[M4_YY_USE_LINENO]],[[");
+ indent_puts
+ ("if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )");
+ indent_up ();
+ indent_puts ("{");
+ indent_puts ("yy_size_t yyl;");
+ do_indent ();
+ out_str ("for ( yyl = %s; yyl < yyleng; ++yyl )\n",
+ yymore_used ? (yytext_is_array ? "YY_G(yy_prev_more_offset)" :
+ "YY_G(yy_more_len)") : "0");
+ indent_up ();
+ indent_puts ("if ( yytext[yyl] == '\\n' )");
+ indent_up ();
+ indent_puts ("M4_YY_INCR_LINENO();");
+ indent_down ();
+ indent_down ();
+ indent_puts ("}");
+ indent_down ();
+ outn ("]])");
+
+ skelout (); /* %% [12.0] - break point in skel */
+ if (ddebug) {
+ indent_puts ("if ( yy_flex_debug )");
+ indent_up ();
+
+ indent_puts ("{");
+ indent_puts ("if ( yy_act == 0 )");
+ indent_up ();
+ indent_puts (C_plus_plus ?
+ "std::cerr << \"--scanner backing up\\n\";" :
+ "fprintf( stderr, \"--scanner backing up\\n\" );");
+ indent_down ();
+
+ do_indent ();
+ out_dec ("else if ( yy_act < %d )\n", num_rules);
+ indent_up ();
+
+ if (C_plus_plus) {
+ indent_puts
+ ("std::cerr << \"--accepting rule at line \" << yy_rule_linenum[yy_act] <<");
+ indent_puts
+ (" \"(\\\"\" << yytext << \"\\\")\\n\";");
+ }
+ else {
+ indent_puts
+ ("fprintf( stderr, \"--accepting rule at line %ld (\\\"%s\\\")\\n\",");
+
+ indent_puts
+ (" (long)yy_rule_linenum[yy_act], yytext );");
+ }
+
+ indent_down ();
+
+ do_indent ();
+ out_dec ("else if ( yy_act == %d )\n", num_rules);
+ indent_up ();
+
+ if (C_plus_plus) {
+ indent_puts
+ ("std::cerr << \"--accepting default rule (\\\"\" << yytext << \"\\\")\\n\";");
+ }
+ else {
+ indent_puts
+ ("fprintf( stderr, \"--accepting default rule (\\\"%s\\\")\\n\",");
+ indent_puts (" yytext );");
+ }
+
+ indent_down ();
+
+ do_indent ();
+ out_dec ("else if ( yy_act == %d )\n", num_rules + 1);
+ indent_up ();
+
+ indent_puts (C_plus_plus ?
+ "std::cerr << \"--(end of buffer or a NUL)\\n\";" :
+ "fprintf( stderr, \"--(end of buffer or a NUL)\\n\" );");
+
+ indent_down ();
+
+ do_indent ();
+ outn ("else");
+ indent_up ();
+
+ if (C_plus_plus) {
+ indent_puts
+ ("std::cerr << \"--EOF (start condition \" << YY_START << \")\\n\";");
+ }
+ else {
+ indent_puts
+ ("fprintf( stderr, \"--EOF (start condition %d)\\n\", YY_START );");
+ }
+
+ indent_down ();
+
+ indent_puts ("}");
+ indent_down ();
+ }
+
+ /* Copy actions to output file. */
+ skelout (); /* %% [13.0] - break point in skel */
+ indent_up ();
+ gen_bu_action ();
+ out (&action_array[action_offset]);
+
+ line_directive_out (stdout, 0);
+
+ /* generate cases for any missing EOF rules */
+ for (i = 1; i <= lastsc; ++i)
+ if (!sceof[i]) {
+ do_indent ();
+ out_str ("case YY_STATE_EOF(%s):\n", scname[i]);
+ did_eof_rule = true;
+ }
+
+ if (did_eof_rule) {
+ indent_up ();
+ indent_puts ("yyterminate();");
+ indent_down ();
+ }
+
+
+ /* Generate code for handling NUL's, if needed. */
+
+ /* First, deal with backing up and setting up yy_cp if the scanner
+ * finds that it should JAM on the NUL.
+ */
+ skelout (); /* %% [14.0] - break point in skel */
+ set_indent (4);
+
+ if (fullspd || fulltbl)
+ indent_puts ("yy_cp = YY_G(yy_c_buf_p);");
+
+ else { /* compressed table */
+ if (!reject && !interactive) {
+ /* Do the guaranteed-needed backing up to figure
+ * out the match.
+ */
+ indent_puts
+ ("yy_cp = YY_G(yy_last_accepting_cpos);");
+ indent_puts
+ ("yy_current_state = YY_G(yy_last_accepting_state);");
+ }
+
+ else
+ /* Still need to initialize yy_cp, though
+ * yy_current_state was set up by
+ * yy_get_previous_state().
+ */
+ indent_puts ("yy_cp = YY_G(yy_c_buf_p);");
+ }
+
+
+ /* Generate code for yy_get_previous_state(). */
+ set_indent (1);
+ skelout (); /* %% [15.0] - break point in skel */
+
+ gen_start_state ();
+
+ set_indent (2);
+ skelout (); /* %% [16.0] - break point in skel */
+ gen_next_state (true);
+
+ set_indent (1);
+ skelout (); /* %% [17.0] - break point in skel */
+ gen_NUL_trans ();
+
+ skelout (); /* %% [18.0] - break point in skel */
+ skelout (); /* %% [19.0] - break point in skel */
+ /* Update BOL and yylineno inside of input(). */
+ if (bol_needed) {
+ indent_puts
+ ("YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\\n');");
+ if (do_yylineno) {
+ indent_puts
+ ("if ( YY_CURRENT_BUFFER_LVALUE->yy_at_bol )");
+ indent_up ();
+ indent_puts ("M4_YY_INCR_LINENO();");
+ indent_down ();
+ }
+ }
+
+ else if (do_yylineno) {
+ indent_puts ("if ( c == '\\n' )");
+ indent_up ();
+ indent_puts ("M4_YY_INCR_LINENO();");
+ indent_down ();
+ }
+
+ skelout ();
+
+ /* Copy remainder of input to output. */
+
+ line_directive_out (stdout, 1);
+
+ if (sectnum == 3) {
+ OUT_BEGIN_CODE ();
+ (void) flexscan (); /* copy remainder of input to output */
+ OUT_END_CODE ();
+ }
+}
diff --git a/src/gettext.h b/src/gettext.h
new file mode 100644
index 0000000..ea67f30
--- /dev/null
+++ b/src/gettext.h
@@ -0,0 +1,59 @@
+/* Convenience header for conditional use of GNU <libintl.h>.
+ Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+ USA. */
+
+#ifndef _LIBGETTEXT_H
+#define _LIBGETTEXT_H 1
+
+/* NLS can be disabled through the configure --disable-nls option. */
+#if ENABLE_NLS
+
+/* Get declarations of GNU message catalog functions. */
+# include <libintl.h>
+
+#else
+
+/* Disabled NLS.
+ The casts to 'const char *' serve the purpose of producing warnings
+ for invalid uses of the value returned from these functions.
+ On pre-ANSI systems without 'const', the config.h file is supposed to
+ contain "#define const". */
+# define gettext(Msgid) ((const char *) (Msgid))
+# define dgettext(Domainname, Msgid) ((const char *) (Msgid))
+# define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid))
+# define ngettext(Msgid1, Msgid2, N) \
+ ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
+# define dngettext(Domainname, Msgid1, Msgid2, N) \
+ ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
+# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
+ ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
+# define textdomain(Domainname) ((const char *) (Domainname))
+# define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname))
+# define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset))
+
+#endif
+
+/* A pseudo function call that serves as a marker for the automated
+ extraction of messages, but does not call gettext(). The run-time
+ translation is done at a different place in the code.
+ The argument, String, should be a literal string. Concatenated strings
+ and other string expressions won't work.
+ The macro's expansion is not parenthesized, so that it is suitable as
+ initializer for static 'char[]' or 'const char[]' variables. */
+#define gettext_noop(String) String
+
+#endif /* _LIBGETTEXT_H */
diff --git a/src/libmain.c b/src/libmain.c
new file mode 100644
index 0000000..f400fc3
--- /dev/null
+++ b/src/libmain.c
@@ -0,0 +1,34 @@
+/* libmain - flex run-time support library "main" function */
+
+/* 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. */
+
+extern int yylex (void);
+
+int main (int argc, char *argv[])
+{
+ (void)argc;
+ (void)argv;
+
+ while (yylex () != 0) ;
+
+ return 0;
+}
diff --git a/src/libyywrap.c b/src/libyywrap.c
new file mode 100644
index 0000000..b0427c4
--- /dev/null
+++ b/src/libyywrap.c
@@ -0,0 +1,29 @@
+/* libyywrap - flex run-time support library "yywrap" function */
+
+/* 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. */
+
+int yywrap (void);
+
+int yywrap (void)
+{
+ return 1;
+}
diff --git a/src/main.c b/src/main.c
new file mode 100644
index 0000000..8710702
--- /dev/null
+++ b/src/main.c
@@ -0,0 +1,1866 @@
+/* flex - tool to generate fast lexical analyzers */
+
+/* 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 "version.h"
+#include "options.h"
+#include "tables.h"
+
+static char flex_version[] = FLEX_VERSION;
+
+/* declare functions that have forward references */
+
+void flexinit PROTO ((int, char **));
+void readin PROTO ((void));
+void set_up_initial_allocations PROTO ((void));
+static char *basename2 PROTO ((char *path, int should_strip_ext));
+
+
+/* these globals are all defined and commented in flexdef.h */
+int printstats, syntaxerror, eofseen, ddebug, trace, nowarn, spprdflt;
+int interactive, lex_compat, posix_compat, do_yylineno,
+ useecs, fulltbl, usemecs;
+int fullspd, gen_line_dirs, performance_report, backing_up_report;
+int C_plus_plus, long_align, use_read, yytext_is_array, do_yywrap,
+ csize;
+int reentrant, bison_bridge_lval, bison_bridge_lloc;
+int yymore_used, reject, real_reject, continued_action, in_rule;
+int yymore_really_used, reject_really_used;
+int trace_hex = 0;
+int datapos, dataline, linenum;
+FILE *skelfile = NULL;
+int skel_ind = 0;
+char *action_array;
+int action_size, defs1_offset, prolog_offset, action_offset,
+ action_index;
+char *infilename = NULL, *outfilename = NULL, *headerfilename = NULL;
+int did_outfilename;
+char *prefix, *yyclass, *extra_type = NULL;
+int do_stdinit, use_stdout;
+int onestate[ONE_STACK_SIZE], onesym[ONE_STACK_SIZE];
+int onenext[ONE_STACK_SIZE], onedef[ONE_STACK_SIZE], onesp;
+int maximum_mns, current_mns, current_max_rules;
+int num_rules, num_eof_rules, default_rule, lastnfa;
+int *firstst, *lastst, *finalst, *transchar, *trans1, *trans2;
+int *accptnum, *assoc_rule, *state_type;
+int *rule_type, *rule_linenum, *rule_useful;
+int current_state_type;
+int variable_trailing_context_rules;
+int numtemps, numprots, protprev[MSP], protnext[MSP], prottbl[MSP];
+int protcomst[MSP], firstprot, lastprot, protsave[PROT_SAVE_SIZE];
+int numecs, nextecm[CSIZE + 1], ecgroup[CSIZE + 1], nummecs,
+ tecfwd[CSIZE + 1];
+int tecbck[CSIZE + 1];
+int lastsc, *scset, *scbol, *scxclu, *sceof;
+int current_max_scs;
+char **scname;
+int current_max_dfa_size, current_max_xpairs;
+int current_max_template_xpairs, current_max_dfas;
+int lastdfa, *nxt, *chk, *tnxt;
+int *base, *def, *nultrans, NUL_ec, tblend, firstfree, **dss, *dfasiz;
+union dfaacc_union *dfaacc;
+int *accsiz, *dhash, numas;
+int numsnpairs, jambase, jamstate;
+int lastccl, *cclmap, *ccllen, *cclng, cclreuse;
+int current_maxccls, current_max_ccl_tbl_size;
+Char *ccltbl;
+char nmstr[MAXLINE];
+int sectnum, nummt, hshcol, dfaeql, numeps, eps2, num_reallocs;
+int tmpuses, totnst, peakpairs, numuniq, numdup, hshsave;
+int num_backing_up, bol_needed;
+FILE *backing_up_file;
+int end_of_buffer_state;
+char **input_files;
+int num_input_files;
+jmp_buf flex_main_jmp_buf;
+bool *rule_has_nl, *ccl_has_nl;
+int nlch = '\n';
+bool ansi_func_defs, ansi_func_protos;
+
+bool tablesext, tablesverify, gentables;
+char *tablesfilename=0,*tablesname=0;
+struct yytbl_writer tableswr;
+
+/* Make sure program_name is initialized so we don't crash if writing
+ * out an error message before getting the program name from argv[0].
+ */
+char *program_name = "flex";
+
+#ifndef SHORT_FILE_NAMES
+static const char outfile_template[] = "lex.%s.%s";
+static const char backing_name[] = "lex.backup";
+static const char tablesfile_template[] = "lex.%s.tables";
+#else
+static const char outfile_template[] = "lex%s.%s";
+static const char backing_name[] = "lex.bck";
+static const char tablesfile_template[] = "lex%s.tbl";
+#endif
+
+#ifdef MS_DOS
+extern unsigned _stklen = 16384;
+#endif
+
+/* From scan.l */
+extern FILE* yyout;
+
+static char outfile_path[MAXLINE];
+static int outfile_created = 0;
+static char *skelname = NULL;
+static int _stdout_closed = 0; /* flag to prevent double-fclose() on stdout. */
+const char *escaped_qstart = "[[]]M4_YY_NOOP[M4_YY_NOOP[M4_YY_NOOP[[]]";
+const char *escaped_qend = "[[]]M4_YY_NOOP]M4_YY_NOOP]M4_YY_NOOP[[]]";
+
+/* For debugging. The max number of filters to apply to skeleton. */
+static int preproc_level = 1000;
+
+int flex_main PROTO ((int argc, char *argv[]));
+int main PROTO ((int argc, char *argv[]));
+
+int flex_main (argc, argv)
+ int argc;
+ char *argv[];
+{
+ int i, exit_status, child_status;
+
+ /* Set a longjmp target. Yes, I know it's a hack, but it gets worse: The
+ * return value of setjmp, if non-zero, is the desired exit code PLUS ONE.
+ * For example, if you want 'main' to return with code '2', then call
+ * longjmp() with an argument of 3. This is because it is invalid to
+ * specify a value of 0 to longjmp. FLEX_EXIT(n) should be used instead of
+ * exit(n);
+ */
+ exit_status = setjmp (flex_main_jmp_buf);
+ if (exit_status){
+ if (stdout && !_stdout_closed && !ferror(stdout)){
+ fflush(stdout);
+ fclose(stdout);
+ }
+ while (wait(&child_status) > 0){
+ if (!WIFEXITED (child_status)
+ || WEXITSTATUS (child_status) != 0){
+ /* report an error of a child
+ */
+ if( exit_status <= 1 )
+ exit_status = 2;
+
+ }
+ }
+ return exit_status - 1;
+ }
+
+ flexinit (argc, argv);
+
+ readin ();
+
+ skelout ();
+ /* %% [1.5] DFA */
+ ntod ();
+
+ for (i = 1; i <= num_rules; ++i)
+ if (!rule_useful[i] && i != default_rule)
+ line_warning (_("rule cannot be matched"),
+ rule_linenum[i]);
+
+ if (spprdflt && !reject && rule_useful[default_rule])
+ line_warning (_
+ ("-s option given but default rule can be matched"),
+ rule_linenum[default_rule]);
+
+ /* Generate the C state transition tables from the DFA. */
+ make_tables ();
+
+ /* Note, flexend does not return. It exits with its argument
+ * as status.
+ */
+ flexend (0);
+
+ return 0; /* keep compilers/lint happy */
+}
+
+/* Wrapper around flex_main, so flex_main can be built as a library. */
+int main (argc, argv)
+ int argc;
+ char *argv[];
+{
+#if ENABLE_NLS
+#if HAVE_LOCALE_H
+ setlocale (LC_MESSAGES, "");
+ setlocale (LC_CTYPE, "");
+ textdomain (PACKAGE);
+ bindtextdomain (PACKAGE, LOCALEDIR);
+#endif
+#endif
+
+ return flex_main (argc, argv);
+}
+
+/* check_options - check user-specified options */
+
+void check_options ()
+{
+ int i;
+ const char * m4 = NULL;
+
+ if (lex_compat) {
+ if (C_plus_plus)
+ flexerror (_("Can't use -+ with -l option"));
+
+ if (fulltbl || fullspd)
+ flexerror (_("Can't use -f or -F with -l option"));
+
+ if (reentrant || bison_bridge_lval)
+ flexerror (_
+ ("Can't use --reentrant or --bison-bridge with -l option"));
+
+ yytext_is_array = true;
+ do_yylineno = true;
+ use_read = false;
+ }
+
+
+#if 0
+ /* This makes no sense whatsoever. I'm removing it. */
+ if (do_yylineno)
+ /* This should really be "maintain_backup_tables = true" */
+ reject_really_used = true;
+#endif
+
+ if (csize == unspecified) {
+ if ((fulltbl || fullspd) && !useecs)
+ csize = DEFAULT_CSIZE;
+ else
+ csize = CSIZE;
+ }
+
+ if (interactive == unspecified) {
+ if (fulltbl || fullspd)
+ interactive = false;
+ else
+ interactive = true;
+ }
+
+ if (fulltbl || fullspd) {
+ if (usemecs)
+ flexerror (_
+ ("-Cf/-CF and -Cm don't make sense together"));
+
+ if (interactive)
+ flexerror (_("-Cf/-CF and -I are incompatible"));
+
+ if (lex_compat)
+ flexerror (_
+ ("-Cf/-CF are incompatible with lex-compatibility mode"));
+
+
+ if (fulltbl && fullspd)
+ flexerror (_
+ ("-Cf and -CF are mutually exclusive"));
+ }
+
+ if (C_plus_plus && fullspd)
+ flexerror (_("Can't use -+ with -CF option"));
+
+ if (C_plus_plus && yytext_is_array) {
+ warn (_("%array incompatible with -+ option"));
+ yytext_is_array = false;
+ }
+
+ if (C_plus_plus && (reentrant))
+ flexerror (_("Options -+ and --reentrant are mutually exclusive."));
+
+ if (C_plus_plus && bison_bridge_lval)
+ flexerror (_("bison bridge not supported for the C++ scanner."));
+
+
+ if (useecs) { /* Set up doubly-linked equivalence classes. */
+
+ /* We loop all the way up to csize, since ecgroup[csize] is
+ * the position used for NUL characters.
+ */
+ ecgroup[1] = NIL;
+
+ for (i = 2; i <= csize; ++i) {
+ ecgroup[i] = i - 1;
+ nextecm[i - 1] = i;
+ }
+
+ nextecm[csize] = NIL;
+ }
+
+ else {
+ /* Put everything in its own equivalence class. */
+ for (i = 1; i <= csize; ++i) {
+ ecgroup[i] = i;
+ nextecm[i] = BAD_SUBSCRIPT; /* to catch errors */
+ }
+ }
+
+ if (!ansi_func_defs)
+ buf_m4_define( &m4defs_buf, "M4_YY_NO_ANSI_FUNC_DEFS", NULL);
+
+ if (!ansi_func_protos)
+ buf_m4_define( &m4defs_buf, "M4_YY_NO_ANSI_FUNC_PROTOS", NULL);
+
+ if (extra_type)
+ buf_m4_define( &m4defs_buf, "M4_EXTRA_TYPE_DEFS", extra_type);
+
+ if (!use_stdout) {
+ FILE *prev_stdout;
+
+ if (!did_outfilename) {
+ char *suffix;
+
+ if (C_plus_plus)
+ suffix = "cc";
+ else
+ suffix = "c";
+
+ snprintf (outfile_path, sizeof(outfile_path), outfile_template,
+ prefix, suffix);
+
+ outfilename = outfile_path;
+ }
+
+ prev_stdout = freopen (outfilename, "w+", stdout);
+
+ if (prev_stdout == NULL)
+ lerr (_("could not create %s"), outfilename);
+
+ outfile_created = 1;
+ }
+
+
+ /* Setup the filter chain. */
+ output_chain = filter_create_int(NULL, filter_tee_header, headerfilename);
+ if ( !(m4 = getenv("M4")))
+ m4 = M4;
+ filter_create_ext(output_chain, m4, "-P", 0);
+ filter_create_int(output_chain, filter_fix_linedirs, NULL);
+
+ /* For debugging, only run the requested number of filters. */
+ if (preproc_level > 0) {
+ filter_truncate(output_chain, preproc_level);
+ filter_apply_chain(output_chain);
+ }
+ yyout = stdout;
+
+
+ /* always generate the tablesverify flag. */
+ buf_m4_define (&m4defs_buf, "M4_YY_TABLES_VERIFY", tablesverify ? "1" : "0");
+ if (tablesext)
+ gentables = false;
+
+ if (tablesverify)
+ /* force generation of C tables. */
+ gentables = true;
+
+
+ if (tablesext) {
+ FILE *tablesout;
+ struct yytbl_hdr hdr;
+ char *pname = 0;
+ int nbytes = 0;
+
+ buf_m4_define (&m4defs_buf, "M4_YY_TABLES_EXTERNAL", NULL);
+
+ if (!tablesfilename) {
+ nbytes = strlen (prefix) + strlen (tablesfile_template) + 2;
+ tablesfilename = pname = (char *) calloc (nbytes, 1);
+ snprintf (pname, nbytes, tablesfile_template, prefix);
+ }
+
+ if ((tablesout = fopen (tablesfilename, "w")) == NULL)
+ lerr (_("could not create %s"), tablesfilename);
+ if (pname)
+ free (pname);
+ tablesfilename = 0;
+
+ yytbl_writer_init (&tableswr, tablesout);
+
+ nbytes = strlen (prefix) + strlen ("tables") + 2;
+ tablesname = (char *) calloc (nbytes, 1);
+ snprintf (tablesname, nbytes, "%stables", prefix);
+ yytbl_hdr_init (&hdr, flex_version, tablesname);
+
+ if (yytbl_hdr_fwrite (&tableswr, &hdr) <= 0)
+ flexerror (_("could not write tables header"));
+ }
+
+ if (skelname && (skelfile = fopen (skelname, "r")) == NULL)
+ lerr (_("can't open skeleton file %s"), skelname);
+
+ if (reentrant) {
+ buf_m4_define (&m4defs_buf, "M4_YY_REENTRANT", NULL);
+ if (yytext_is_array)
+ buf_m4_define (&m4defs_buf, "M4_YY_TEXT_IS_ARRAY", NULL);
+ }
+
+ if ( bison_bridge_lval)
+ buf_m4_define (&m4defs_buf, "M4_YY_BISON_LVAL", NULL);
+
+ if ( bison_bridge_lloc)
+ buf_m4_define (&m4defs_buf, "<M4_YY_BISON_LLOC>", NULL);
+
+ buf_m4_define(&m4defs_buf, "M4_YY_PREFIX", prefix);
+
+ if (did_outfilename)
+ line_directive_out (stdout, 0);
+
+ if (do_yylineno)
+ buf_m4_define (&m4defs_buf, "M4_YY_USE_LINENO", NULL);
+
+ /* Create the alignment type. */
+ buf_strdefine (&userdef_buf, "YY_INT_ALIGNED",
+ long_align ? "long int" : "short int");
+
+ /* Define the start condition macros. */
+ {
+ struct Buf tmpbuf;
+ buf_init(&tmpbuf, sizeof(char));
+ for (i = 1; i <= lastsc; i++) {
+ char *str, *fmt = "#define %s %d\n";
+ size_t strsz;
+
+ str = (char*)flex_alloc(strsz = strlen(fmt) + strlen(scname[i]) + (int)(1 + log10(i)) + 2);
+ if (!str)
+ flexfatal(_("allocation of macro definition failed"));
+ snprintf(str, strsz, fmt, scname[i], i - 1);
+ buf_strappend(&tmpbuf, str);
+ free(str);
+ }
+ buf_m4_define(&m4defs_buf, "M4_YY_SC_DEFS", tmpbuf.elts);
+ buf_destroy(&tmpbuf);
+ }
+
+ /* This is where we begin writing to the file. */
+
+ /* Dump the %top code. */
+ if( top_buf.elts)
+ outn((char*) top_buf.elts);
+
+ /* Dump the m4 definitions. */
+ buf_print_strings(&m4defs_buf, stdout);
+ m4defs_buf.nelts = 0; /* memory leak here. */
+
+ /* Place a bogus line directive, it will be fixed in the filter. */
+ outn("#line 0 \"M4_YY_OUTFILE_NAME\"\n");
+
+ /* Dump the user defined preproc directives. */
+ if (userdef_buf.elts)
+ outn ((char *) (userdef_buf.elts));
+
+ skelout ();
+ /* %% [1.0] */
+}
+
+/* flexend - terminate flex
+ *
+ * note
+ * This routine does not return.
+ */
+
+void flexend (exit_status)
+ int exit_status;
+
+{
+ static int called_before = -1; /* prevent infinite recursion. */
+ int tblsiz;
+
+ if (++called_before)
+ FLEX_EXIT (exit_status);
+
+ if (skelfile != NULL) {
+ if (ferror (skelfile))
+ lerr (_("input error reading skeleton file %s"),
+ skelname);
+
+ else if (fclose (skelfile))
+ lerr (_("error closing skeleton file %s"),
+ skelname);
+ }
+
+#if 0
+ fprintf (header_out,
+ "#ifdef YY_HEADER_EXPORT_START_CONDITIONS\n");
+ fprintf (header_out,
+ "/* Beware! Start conditions are not prefixed. */\n");
+
+ /* Special case for "INITIAL" */
+ fprintf (header_out,
+ "#undef INITIAL\n#define INITIAL 0\n");
+ for (i = 2; i <= lastsc; i++)
+ fprintf (header_out, "#define %s %d\n", scname[i], i - 1);
+ fprintf (header_out,
+ "#endif /* YY_HEADER_EXPORT_START_CONDITIONS */\n\n");
+
+ /* Kill ALL flex-related macros. This is so the user
+ * can #include more than one generated header file. */
+ fprintf (header_out, "#ifndef YY_HEADER_NO_UNDEFS\n");
+ fprintf (header_out,
+ "/* Undefine all internal macros, etc., that do no belong in the header. */\n\n");
+
+ {
+ const char * undef_list[] = {
+
+ "BEGIN",
+ "ECHO",
+ "EOB_ACT_CONTINUE_SCAN",
+ "EOB_ACT_END_OF_FILE",
+ "EOB_ACT_LAST_MATCH",
+ "FLEX_SCANNER",
+ "FLEX_STD",
+ "REJECT",
+ "YYFARGS0",
+ "YYFARGS1",
+ "YYFARGS2",
+ "YYFARGS3",
+ "YYLMAX",
+ "YYSTATE",
+ "YY_AT_BOL",
+ "YY_BREAK",
+ "YY_BUFFER_EOF_PENDING",
+ "YY_BUFFER_NEW",
+ "YY_BUFFER_NORMAL",
+ "YY_BUF_SIZE",
+ "M4_YY_CALL_LAST_ARG",
+ "M4_YY_CALL_ONLY_ARG",
+ "YY_CURRENT_BUFFER",
+ "YY_DECL",
+ "M4_YY_DECL_LAST_ARG",
+ "M4_YY_DEF_LAST_ARG",
+ "M4_YY_DEF_ONLY_ARG",
+ "YY_DO_BEFORE_ACTION",
+ "YY_END_OF_BUFFER",
+ "YY_END_OF_BUFFER_CHAR",
+ "YY_EXIT_FAILURE",
+ "YY_EXTRA_TYPE",
+ "YY_FATAL_ERROR",
+ "YY_FLEX_DEFINED_ECHO",
+ "YY_FLEX_LEX_COMPAT",
+ "YY_FLEX_MAJOR_VERSION",
+ "YY_FLEX_MINOR_VERSION",
+ "YY_FLEX_SUBMINOR_VERSION",
+ "YY_FLUSH_BUFFER",
+ "YY_G",
+ "YY_INPUT",
+ "YY_INTERACTIVE",
+ "YY_INT_ALIGNED",
+ "YY_LAST_ARG",
+ "YY_LESS_LINENO",
+ "YY_LEX_ARGS",
+ "YY_LEX_DECLARATION",
+ "YY_LEX_PROTO",
+ "YY_MAIN",
+ "YY_MORE_ADJ",
+ "YY_NEED_STRLEN",
+ "YY_NEW_FILE",
+ "YY_NULL",
+ "YY_NUM_RULES",
+ "YY_ONLY_ARG",
+ "YY_PARAMS",
+ "YY_PROTO",
+ "M4_YY_PROTO_LAST_ARG",
+ "M4_YY_PROTO_ONLY_ARG void",
+ "YY_READ_BUF_SIZE",
+ "YY_REENTRANT",
+ "YY_RESTORE_YY_MORE_OFFSET",
+ "YY_RULE_SETUP",
+ "YY_SC_TO_UI",
+ "YY_SKIP_YYWRAP",
+ "YY_START",
+ "YY_START_STACK_INCR",
+ "YY_STATE_EOF",
+ "YY_STDINIT",
+ "YY_TRAILING_HEAD_MASK",
+ "YY_TRAILING_MASK",
+ "YY_USER_ACTION",
+ "YY_USE_CONST",
+ "YY_USE_PROTOS",
+ "unput",
+ "yyTABLES_NAME",
+ "yy_create_buffer",
+ "yy_delete_buffer",
+ "yy_flex_debug",
+ "yy_flush_buffer",
+ "yy_init_buffer",
+ "yy_load_buffer_state",
+ "yy_new_buffer",
+ "yy_scan_buffer",
+ "yy_scan_bytes",
+ "yy_scan_string",
+ "yy_set_bol",
+ "yy_set_interactive",
+ "yy_switch_to_buffer",
+ "yypush_buffer_state",
+ "yypop_buffer_state",
+ "yyensure_buffer_stack",
+ "yyalloc",
+ "yyconst",
+ "yyextra",
+ "yyfree",
+ "yyget_debug",
+ "yyget_extra",
+ "yyget_in",
+ "yyget_leng",
+ "yyget_lineno",
+ "yyget_lloc",
+ "yyget_lval",
+ "yyget_out",
+ "yyget_text",
+ "yyin",
+ "yyleng",
+ "yyless",
+ "yylex",
+ "yylex_destroy",
+ "yylex_init",
+ "yylex_init_extra",
+ "yylineno",
+ "yylloc",
+ "yylval",
+ "yymore",
+ "yyout",
+ "yyrealloc",
+ "yyrestart",
+ "yyset_debug",
+ "yyset_extra",
+ "yyset_in",
+ "yyset_lineno",
+ "yyset_lloc",
+ "yyset_lval",
+ "yyset_out",
+ "yytables_destroy",
+ "yytables_fload",
+ "yyterminate",
+ "yytext",
+ "yytext_ptr",
+ "yywrap",
+
+ /* must be null-terminated */
+ NULL};
+
+
+ for (i=0; undef_list[i] != NULL; i++)
+ fprintf (header_out, "#undef %s\n", undef_list[i]);
+ }
+
+ /* undef any of the auto-generated symbols. */
+ for (i = 0; i < defs_buf.nelts; i++) {
+
+ /* don't undef start conditions */
+ if (sclookup (((char **) defs_buf.elts)[i]) > 0)
+ continue;
+ fprintf (header_out, "#undef %s\n",
+ ((char **) defs_buf.elts)[i]);
+ }
+
+ fprintf (header_out,
+ "#endif /* !YY_HEADER_NO_UNDEFS */\n");
+ fprintf (header_out, "\n");
+ fprintf (header_out, "#undef %sIN_HEADER\n", prefix);
+ fprintf (header_out, "#endif /* %sHEADER_H */\n", prefix);
+
+ if (ferror (header_out))
+ lerr (_("error creating header file %s"),
+ headerfilename);
+ fflush (header_out);
+ fclose (header_out);
+#endif
+
+ if (exit_status != 0 && outfile_created) {
+ if (ferror (stdout))
+ lerr (_("error writing output file %s"),
+ outfilename);
+
+ else if ((_stdout_closed = 1) && fclose (stdout))
+ lerr (_("error closing output file %s"),
+ outfilename);
+
+ else if (unlink (outfilename))
+ lerr (_("error deleting output file %s"),
+ outfilename);
+ }
+
+
+ if (backing_up_report && backing_up_file) {
+ if (num_backing_up == 0)
+ fprintf (backing_up_file, _("No backing up.\n"));
+ else if (fullspd || fulltbl)
+ fprintf (backing_up_file,
+ _
+ ("%d backing up (non-accepting) states.\n"),
+ num_backing_up);
+ else
+ fprintf (backing_up_file,
+ _("Compressed tables always back up.\n"));
+
+ if (ferror (backing_up_file))
+ lerr (_("error writing backup file %s"),
+ backing_name);
+
+ else if (fclose (backing_up_file))
+ lerr (_("error closing backup file %s"),
+ backing_name);
+ }
+
+ if (printstats) {
+ fprintf (stderr, _("%s version %s usage statistics:\n"),
+ program_name, flex_version);
+
+ fprintf (stderr, _(" scanner options: -"));
+
+ if (C_plus_plus)
+ putc ('+', stderr);
+ if (backing_up_report)
+ putc ('b', stderr);
+ if (ddebug)
+ putc ('d', stderr);
+ if (sf_case_ins())
+ putc ('i', stderr);
+ if (lex_compat)
+ putc ('l', stderr);
+ if (posix_compat)
+ putc ('X', stderr);
+ if (performance_report > 0)
+ putc ('p', stderr);
+ if (performance_report > 1)
+ putc ('p', stderr);
+ if (spprdflt)
+ putc ('s', stderr);
+ if (reentrant)
+ fputs ("--reentrant", stderr);
+ if (bison_bridge_lval)
+ fputs ("--bison-bridge", stderr);
+ if (bison_bridge_lloc)
+ fputs ("--bison-locations", stderr);
+ if (use_stdout)
+ putc ('t', stderr);
+ if (printstats)
+ putc ('v', stderr); /* always true! */
+ if (nowarn)
+ putc ('w', stderr);
+ if (interactive == false)
+ putc ('B', stderr);
+ if (interactive == true)
+ putc ('I', stderr);
+ if (!gen_line_dirs)
+ putc ('L', stderr);
+ if (trace)
+ putc ('T', stderr);
+
+ if (csize == unspecified)
+ /* We encountered an error fairly early on, so csize
+ * never got specified. Define it now, to prevent
+ * bogus table sizes being written out below.
+ */
+ csize = 256;
+
+ if (csize == 128)
+ putc ('7', stderr);
+ else
+ putc ('8', stderr);
+
+ fprintf (stderr, " -C");
+
+ if (long_align)
+ putc ('a', stderr);
+ if (fulltbl)
+ putc ('f', stderr);
+ if (fullspd)
+ putc ('F', stderr);
+ if (useecs)
+ putc ('e', stderr);
+ if (usemecs)
+ putc ('m', stderr);
+ if (use_read)
+ putc ('r', stderr);
+
+ if (did_outfilename)
+ fprintf (stderr, " -o%s", outfilename);
+
+ if (skelname)
+ fprintf (stderr, " -S%s", skelname);
+
+ if (strcmp (prefix, "yy"))
+ fprintf (stderr, " -P%s", prefix);
+
+ putc ('\n', stderr);
+
+ fprintf (stderr, _(" %d/%d NFA states\n"),
+ lastnfa, current_mns);
+ fprintf (stderr, _(" %d/%d DFA states (%d words)\n"),
+ lastdfa, current_max_dfas, totnst);
+ fprintf (stderr, _(" %d rules\n"),
+ num_rules + num_eof_rules -
+ 1 /* - 1 for def. rule */ );
+
+ if (num_backing_up == 0)
+ fprintf (stderr, _(" No backing up\n"));
+ else if (fullspd || fulltbl)
+ fprintf (stderr,
+ _
+ (" %d backing-up (non-accepting) states\n"),
+ num_backing_up);
+ else
+ fprintf (stderr,
+ _
+ (" Compressed tables always back-up\n"));
+
+ if (bol_needed)
+ fprintf (stderr,
+ _(" Beginning-of-line patterns used\n"));
+
+ fprintf (stderr, _(" %d/%d start conditions\n"), lastsc,
+ current_max_scs);
+ fprintf (stderr,
+ _
+ (" %d epsilon states, %d double epsilon states\n"),
+ numeps, eps2);
+
+ if (lastccl == 0)
+ fprintf (stderr, _(" no character classes\n"));
+ else
+ fprintf (stderr,
+ _
+ (" %d/%d character classes needed %d/%d words of storage, %d reused\n"),
+ lastccl, current_maxccls,
+ cclmap[lastccl] + ccllen[lastccl],
+ current_max_ccl_tbl_size, cclreuse);
+
+ fprintf (stderr, _(" %d state/nextstate pairs created\n"),
+ numsnpairs);
+ fprintf (stderr,
+ _(" %d/%d unique/duplicate transitions\n"),
+ numuniq, numdup);
+
+ if (fulltbl) {
+ tblsiz = lastdfa * numecs;
+ fprintf (stderr, _(" %d table entries\n"),
+ tblsiz);
+ }
+
+ else {
+ tblsiz = 2 * (lastdfa + numtemps) + 2 * tblend;
+
+ fprintf (stderr,
+ _(" %d/%d base-def entries created\n"),
+ lastdfa + numtemps, current_max_dfas);
+ fprintf (stderr,
+ _
+ (" %d/%d (peak %d) nxt-chk entries created\n"),
+ tblend, current_max_xpairs, peakpairs);
+ fprintf (stderr,
+ _
+ (" %d/%d (peak %d) template nxt-chk entries created\n"),
+ numtemps * nummecs,
+ current_max_template_xpairs,
+ numtemps * numecs);
+ fprintf (stderr, _(" %d empty table entries\n"),
+ nummt);
+ fprintf (stderr, _(" %d protos created\n"),
+ numprots);
+ fprintf (stderr,
+ _(" %d templates created, %d uses\n"),
+ numtemps, tmpuses);
+ }
+
+ if (useecs) {
+ tblsiz = tblsiz + csize;
+ fprintf (stderr,
+ _
+ (" %d/%d equivalence classes created\n"),
+ numecs, csize);
+ }
+
+ if (usemecs) {
+ tblsiz = tblsiz + numecs;
+ fprintf (stderr,
+ _
+ (" %d/%d meta-equivalence classes created\n"),
+ nummecs, csize);
+ }
+
+ fprintf (stderr,
+ _
+ (" %d (%d saved) hash collisions, %d DFAs equal\n"),
+ hshcol, hshsave, dfaeql);
+ fprintf (stderr, _(" %d sets of reallocations needed\n"),
+ num_reallocs);
+ fprintf (stderr, _(" %d total table entries needed\n"),
+ tblsiz);
+ }
+
+ FLEX_EXIT (exit_status);
+}
+
+
+/* flexinit - initialize flex */
+
+void flexinit (argc, argv)
+ int argc;
+ char **argv;
+{
+ int i, sawcmpflag, rv, optind;
+ char *arg;
+ scanopt_t sopt;
+
+ printstats = syntaxerror = trace = spprdflt = false;
+ lex_compat = posix_compat = C_plus_plus = backing_up_report =
+ ddebug = fulltbl = false;
+ fullspd = long_align = nowarn = yymore_used = continued_action =
+ false;
+ do_yylineno = yytext_is_array = in_rule = reject = do_stdinit =
+ false;
+ yymore_really_used = reject_really_used = unspecified;
+ interactive = csize = unspecified;
+ do_yywrap = gen_line_dirs = usemecs = useecs = true;
+ reentrant = bison_bridge_lval = bison_bridge_lloc = false;
+ performance_report = 0;
+ did_outfilename = 0;
+ prefix = "yy";
+ yyclass = 0;
+ use_read = use_stdout = false;
+ tablesext = tablesverify = false;
+ gentables = true;
+ tablesfilename = tablesname = NULL;
+ ansi_func_defs = ansi_func_protos = true;
+
+ sawcmpflag = false;
+
+ /* Initialize dynamic array for holding the rule actions. */
+ action_size = 2048; /* default size of action array in bytes */
+ action_array = allocate_character_array (action_size);
+ defs1_offset = prolog_offset = action_offset = action_index = 0;
+ action_array[0] = '\0';
+
+ /* Initialize any buffers. */
+ buf_init (&userdef_buf, sizeof (char)); /* one long string */
+ buf_init (&defs_buf, sizeof (char *)); /* list of strings */
+ buf_init (&yydmap_buf, sizeof (char)); /* one long string */
+ buf_init (&top_buf, sizeof (char)); /* one long string */
+
+ {
+ const char * m4defs_init_str[] = {"m4_changequote\n",
+ "m4_changequote([[, ]])\n"};
+ buf_init (&m4defs_buf, sizeof (char *));
+ buf_append (&m4defs_buf, &m4defs_init_str, 2);
+ }
+
+ sf_init ();
+
+ /* initialize regex lib */
+ flex_init_regex();
+
+ /* Enable C++ if program name ends with '+'. */
+ program_name = basename2 (argv[0], 0);
+
+ if (program_name[0] != '\0' &&
+ program_name[strlen (program_name) - 1] == '+')
+ C_plus_plus = true;
+
+ /* read flags */
+ sopt = scanopt_init (flexopts, argc, argv, 0);
+ if (!sopt) {
+ /* This will only happen when flexopts array is altered. */
+ fprintf (stderr,
+ _("Internal error. flexopts are malformed.\n"));
+ FLEX_EXIT (1);
+ }
+
+ while ((rv = scanopt (sopt, &arg, &optind)) != 0) {
+
+ if (rv < 0) {
+ /* Scanopt has already printed an option-specific error message. */
+ fprintf (stderr,
+ _
+ ("Try `%s --help' for more information.\n"),
+ program_name);
+ FLEX_EXIT (1);
+ }
+
+ switch ((enum flexopt_flag_t) rv) {
+ case OPT_CPLUSPLUS:
+ C_plus_plus = true;
+ break;
+
+ case OPT_BATCH:
+ interactive = false;
+ break;
+
+ case OPT_BACKUP:
+ backing_up_report = true;
+ break;
+
+ case OPT_DONOTHING:
+ break;
+
+ case OPT_COMPRESSION:
+ if (!sawcmpflag) {
+ useecs = false;
+ usemecs = false;
+ fulltbl = false;
+ sawcmpflag = true;
+ }
+
+ for (i = 0; arg && arg[i] != '\0'; i++)
+ switch (arg[i]) {
+ case 'a':
+ long_align = true;
+ break;
+
+ case 'e':
+ useecs = true;
+ break;
+
+ case 'F':
+ fullspd = true;
+ break;
+
+ case 'f':
+ fulltbl = true;
+ break;
+
+ case 'm':
+ usemecs = true;
+ break;
+
+ case 'r':
+ use_read = true;
+ break;
+
+ default:
+ lerr (_
+ ("unknown -C option '%c'"),
+ arg[i]);
+ break;
+ }
+ break;
+
+ case OPT_DEBUG:
+ ddebug = true;
+ break;
+
+ case OPT_NO_DEBUG:
+ ddebug = false;
+ break;
+
+ case OPT_FULL:
+ useecs = usemecs = false;
+ use_read = fulltbl = true;
+ break;
+
+ case OPT_FAST:
+ useecs = usemecs = false;
+ use_read = fullspd = true;
+ break;
+
+ case OPT_HELP:
+ usage ();
+ FLEX_EXIT (0);
+
+ case OPT_INTERACTIVE:
+ interactive = true;
+ break;
+
+ case OPT_CASE_INSENSITIVE:
+ sf_set_case_ins(true);
+ break;
+
+ case OPT_LEX_COMPAT:
+ lex_compat = true;
+ break;
+
+ case OPT_POSIX_COMPAT:
+ posix_compat = true;
+ break;
+
+ case OPT_PREPROC_LEVEL:
+ preproc_level = strtol(arg,NULL,0);
+ break;
+
+ case OPT_MAIN:
+ buf_strdefine (&userdef_buf, "YY_MAIN", "1");
+ do_yywrap = false;
+ break;
+
+ case OPT_NO_MAIN:
+ buf_strdefine (&userdef_buf, "YY_MAIN", "0");
+ break;
+
+ case OPT_NO_LINE:
+ gen_line_dirs = false;
+ break;
+
+ case OPT_OUTFILE:
+ outfilename = arg;
+ did_outfilename = 1;
+ break;
+
+ case OPT_PREFIX:
+ prefix = arg;
+ break;
+
+ case OPT_PERF_REPORT:
+ ++performance_report;
+ break;
+
+ case OPT_BISON_BRIDGE:
+ bison_bridge_lval = true;
+ break;
+
+ case OPT_BISON_BRIDGE_LOCATIONS:
+ bison_bridge_lval = bison_bridge_lloc = true;
+ break;
+
+ case OPT_REENTRANT:
+ reentrant = true;
+ break;
+
+ case OPT_NO_REENTRANT:
+ reentrant = false;
+ break;
+
+ case OPT_SKEL:
+ skelname = arg;
+ break;
+
+ case OPT_DEFAULT:
+ spprdflt = false;
+ break;
+
+ case OPT_NO_DEFAULT:
+ spprdflt = true;
+ break;
+
+ case OPT_STDOUT:
+ use_stdout = true;
+ break;
+
+ case OPT_NO_UNISTD_H:
+ //buf_strdefine (&userdef_buf, "YY_NO_UNISTD_H", "1");
+ buf_m4_define( &m4defs_buf, "M4_YY_NO_UNISTD_H",0);
+ break;
+
+ case OPT_TABLES_FILE:
+ tablesext = true;
+ tablesfilename = arg;
+ break;
+
+ case OPT_TABLES_VERIFY:
+ tablesverify = true;
+ break;
+
+ case OPT_TRACE:
+ trace = true;
+ break;
+
+ case OPT_VERBOSE:
+ printstats = true;
+ break;
+
+ case OPT_VERSION:
+ printf (_("%s %s\n"), program_name, flex_version);
+ FLEX_EXIT (0);
+
+ case OPT_WARN:
+ nowarn = false;
+ break;
+
+ case OPT_NO_WARN:
+ nowarn = true;
+ break;
+
+ case OPT_7BIT:
+ csize = 128;
+ break;
+
+ case OPT_8BIT:
+ csize = CSIZE;
+ break;
+
+ case OPT_ALIGN:
+ long_align = true;
+ break;
+
+ case OPT_NO_ALIGN:
+ long_align = false;
+ break;
+
+ case OPT_ALWAYS_INTERACTIVE:
+ buf_m4_define (&m4defs_buf, "M4_YY_ALWAYS_INTERACTIVE", 0);
+ break;
+
+ case OPT_NEVER_INTERACTIVE:
+ buf_m4_define( &m4defs_buf, "M4_YY_NEVER_INTERACTIVE", 0);
+ break;
+
+ case OPT_ARRAY:
+ yytext_is_array = true;
+ break;
+
+ case OPT_POINTER:
+ yytext_is_array = false;
+ break;
+
+ case OPT_ECS:
+ useecs = true;
+ break;
+
+ case OPT_NO_ECS:
+ useecs = false;
+ break;
+
+ case OPT_HEADER_FILE:
+ headerfilename = arg;
+ break;
+
+ case OPT_META_ECS:
+ usemecs = true;
+ break;
+
+ case OPT_NO_META_ECS:
+ usemecs = false;
+ break;
+
+ case OPT_PREPROCDEFINE:
+ {
+ /* arg is "symbol" or "symbol=definition". */
+ char *def;
+
+ for (def = arg;
+ *def != '\0' && *def != '='; ++def) ;
+
+ buf_strappend (&userdef_buf, "#define ");
+ if (*def == '\0') {
+ buf_strappend (&userdef_buf, arg);
+ buf_strappend (&userdef_buf,
+ " 1\n");
+ }
+ else {
+ buf_strnappend (&userdef_buf, arg,
+ def - arg);
+ buf_strappend (&userdef_buf, " ");
+ buf_strappend (&userdef_buf,
+ def + 1);
+ buf_strappend (&userdef_buf, "\n");
+ }
+ }
+ break;
+
+ case OPT_READ:
+ use_read = true;
+ break;
+
+ case OPT_STACK:
+ //buf_strdefine (&userdef_buf, "YY_STACK_USED", "1");
+ buf_m4_define( &m4defs_buf, "M4_YY_STACK_USED",0);
+ break;
+
+ case OPT_STDINIT:
+ do_stdinit = true;
+ break;
+
+ case OPT_NO_STDINIT:
+ do_stdinit = false;
+ break;
+
+ case OPT_YYCLASS:
+ yyclass = arg;
+ break;
+
+ case OPT_YYLINENO:
+ do_yylineno = true;
+ break;
+
+ case OPT_NO_YYLINENO:
+ do_yylineno = false;
+ break;
+
+ case OPT_YYWRAP:
+ do_yywrap = true;
+ break;
+
+ case OPT_NO_YYWRAP:
+ do_yywrap = false;
+ break;
+
+ case OPT_YYMORE:
+ yymore_really_used = true;
+ break;
+
+ case OPT_NO_YYMORE:
+ yymore_really_used = false;
+ break;
+
+ case OPT_REJECT:
+ reject_really_used = true;
+ break;
+
+ case OPT_NO_REJECT:
+ reject_really_used = false;
+ break;
+
+ case OPT_NO_ANSI_FUNC_DEFS:
+ ansi_func_defs = false;
+ break;
+
+ case OPT_NO_ANSI_FUNC_PROTOS:
+ ansi_func_protos = false;
+ break;
+
+ case OPT_NO_YY_PUSH_STATE:
+ //buf_strdefine (&userdef_buf, "YY_NO_PUSH_STATE", "1");
+ buf_m4_define( &m4defs_buf, "M4_YY_NO_PUSH_STATE",0);
+ break;
+ case OPT_NO_YY_POP_STATE:
+ //buf_strdefine (&userdef_buf, "YY_NO_POP_STATE", "1");
+ buf_m4_define( &m4defs_buf, "M4_YY_NO_POP_STATE",0);
+ break;
+ case OPT_NO_YY_TOP_STATE:
+ //buf_strdefine (&userdef_buf, "YY_NO_TOP_STATE", "1");
+ buf_m4_define( &m4defs_buf, "M4_YY_NO_TOP_STATE",0);
+ break;
+ case OPT_NO_UNPUT:
+ //buf_strdefine (&userdef_buf, "YY_NO_UNPUT", "1");
+ buf_m4_define( &m4defs_buf, "M4_YY_NO_UNPUT",0);
+ break;
+ case OPT_NO_YY_SCAN_BUFFER:
+ //buf_strdefine (&userdef_buf, "YY_NO_SCAN_BUFFER", "1");
+ buf_m4_define( &m4defs_buf, "M4_YY_NO_SCAN_BUFFER",0);
+ break;
+ case OPT_NO_YY_SCAN_BYTES:
+ //buf_strdefine (&userdef_buf, "YY_NO_SCAN_BYTES", "1");
+ buf_m4_define( &m4defs_buf, "M4_YY_NO_SCAN_BYTES",0);
+ break;
+ case OPT_NO_YY_SCAN_STRING:
+ //buf_strdefine (&userdef_buf, "YY_NO_SCAN_STRING", "1");
+ buf_m4_define( &m4defs_buf, "M4_YY_NO_SCAN_STRING",0);
+ break;
+ case OPT_NO_YYGET_EXTRA:
+ //buf_strdefine (&userdef_buf, "YY_NO_GET_EXTRA", "1");
+ buf_m4_define( &m4defs_buf, "M4_YY_NO_GET_EXTRA",0);
+ break;
+ case OPT_NO_YYSET_EXTRA:
+ //buf_strdefine (&userdef_buf, "YY_NO_SET_EXTRA", "1");
+ buf_m4_define( &m4defs_buf, "M4_YY_NO_SET_EXTRA",0);
+ break;
+ case OPT_NO_YYGET_LENG:
+ //buf_strdefine (&userdef_buf, "YY_NO_GET_LENG", "1");
+ buf_m4_define( &m4defs_buf, "M4_YY_NO_GET_LENG",0);
+ break;
+ case OPT_NO_YYGET_TEXT:
+ //buf_strdefine (&userdef_buf, "YY_NO_GET_TEXT", "1");
+ buf_m4_define( &m4defs_buf, "M4_YY_NO_GET_TEXT",0);
+ break;
+ case OPT_NO_YYGET_LINENO:
+ //buf_strdefine (&userdef_buf, "YY_NO_GET_LINENO", "1");
+ buf_m4_define( &m4defs_buf, "M4_YY_NO_GET_LINENO",0);
+ break;
+ case OPT_NO_YYSET_LINENO:
+ //buf_strdefine (&userdef_buf, "YY_NO_SET_LINENO", "1");
+ buf_m4_define( &m4defs_buf, "M4_YY_NO_SET_LINENO",0);
+ break;
+ case OPT_NO_YYGET_IN:
+ //buf_strdefine (&userdef_buf, "YY_NO_GET_IN", "1");
+ buf_m4_define( &m4defs_buf, "M4_YY_NO_GET_IN",0);
+ break;
+ case OPT_NO_YYSET_IN:
+ //buf_strdefine (&userdef_buf, "YY_NO_SET_IN", "1");
+ buf_m4_define( &m4defs_buf, "M4_YY_NO_SET_IN",0);
+ break;
+ case OPT_NO_YYGET_OUT:
+ //buf_strdefine (&userdef_buf, "YY_NO_GET_OUT", "1");
+ buf_m4_define( &m4defs_buf, "M4_YY_NO_GET_OUT",0);
+ break;
+ case OPT_NO_YYSET_OUT:
+ //buf_strdefine (&userdef_buf, "YY_NO_SET_OUT", "1");
+ buf_m4_define( &m4defs_buf, "M4_YY_NO_SET_OUT",0);
+ break;
+ case OPT_NO_YYGET_LVAL:
+ //buf_strdefine (&userdef_buf, "YY_NO_GET_LVAL", "1");
+ buf_m4_define( &m4defs_buf, "M4_YY_NO_GET_LVAL",0);
+ break;
+ case OPT_NO_YYSET_LVAL:
+ //buf_strdefine (&userdef_buf, "YY_NO_SET_LVAL", "1");
+ buf_m4_define( &m4defs_buf, "M4_YY_NO_SET_LVAL",0);
+ break;
+ case OPT_NO_YYGET_LLOC:
+ //buf_strdefine (&userdef_buf, "YY_NO_GET_LLOC", "1");
+ buf_m4_define( &m4defs_buf, "M4_YY_NO_GET_LLOC",0);
+ break;
+ case OPT_NO_YYSET_LLOC:
+ //buf_strdefine (&userdef_buf, "YY_NO_SET_LLOC", "1");
+ buf_m4_define( &m4defs_buf, "M4_YY_NO_SET_LLOC",0);
+ break;
+ case OPT_HEX:
+ trace_hex = 1;
+ } /* switch */
+ } /* while scanopt() */
+
+ scanopt_destroy (sopt);
+
+ num_input_files = argc - optind;
+ input_files = argv + optind;
+ set_input_file (num_input_files > 0 ? input_files[0] : NULL);
+
+ lastccl = lastsc = lastdfa = lastnfa = 0;
+ num_rules = num_eof_rules = default_rule = 0;
+ numas = numsnpairs = tmpuses = 0;
+ numecs = numeps = eps2 = num_reallocs = hshcol = dfaeql = totnst =
+ 0;
+ numuniq = numdup = hshsave = eofseen = datapos = dataline = 0;
+ num_backing_up = onesp = numprots = 0;
+ variable_trailing_context_rules = bol_needed = false;
+
+ linenum = sectnum = 1;
+ firstprot = NIL;
+
+ /* Used in mkprot() so that the first proto goes in slot 1
+ * of the proto queue.
+ */
+ lastprot = 1;
+
+ set_up_initial_allocations ();
+}
+
+
+/* readin - read in the rules section of the input file(s) */
+
+void readin ()
+{
+ static char yy_stdinit[] = "FILE *yyin = stdin, *yyout = stdout;";
+ static char yy_nostdinit[] =
+ "FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;";
+
+ line_directive_out ((FILE *) 0, 1);
+
+ if (yyparse ()) {
+ pinpoint_message (_("fatal parse error"));
+ flexend (1);
+ }
+
+ if (syntaxerror)
+ flexend (1);
+
+ /* If the user explicitly requested posix compatibility by specifing the
+ * posix-compat option, then we check for conflicting options. However, if
+ * the POSIXLY_CORRECT variable is set, then we quietly make flex as
+ * posix-compatible as possible. This is the recommended behavior
+ * according to the GNU Coding Standards.
+ *
+ * Note: The posix option was added to flex to provide the posix behavior
+ * of the repeat operator in regular expressions, e.g., `ab{3}'
+ */
+ if (posix_compat) {
+ /* TODO: This is where we try to make flex behave according to
+ * posiz, AND check for conflicting options. How far should we go
+ * with this? Should we disable all the neat-o flex features?
+ */
+ /* Update: Estes says no, since other flex features don't violate posix. */
+ }
+
+ if (getenv ("POSIXLY_CORRECT")) {
+ posix_compat = true;
+ }
+
+ if (backing_up_report) {
+ backing_up_file = fopen (backing_name, "w");
+ if (backing_up_file == NULL)
+ lerr (_
+ ("could not create backing-up info file %s"),
+ backing_name);
+ }
+
+ else
+ backing_up_file = NULL;
+
+ if (yymore_really_used == true)
+ yymore_used = true;
+ else if (yymore_really_used == false)
+ yymore_used = false;
+
+ if (reject_really_used == true)
+ reject = true;
+ else if (reject_really_used == false)
+ reject = false;
+
+ if (performance_report > 0) {
+ if (lex_compat) {
+ fprintf (stderr,
+ _
+ ("-l AT&T lex compatibility option entails a large performance penalty\n"));
+ fprintf (stderr,
+ _
+ (" and may be the actual source of other reported performance penalties\n"));
+ }
+
+ else if (do_yylineno) {
+ fprintf (stderr,
+ _
+ ("%%option yylineno entails a performance penalty ONLY on rules that can match newline characters\n"));
+ }
+
+ if (performance_report > 1) {
+ if (interactive)
+ fprintf (stderr,
+ _
+ ("-I (interactive) entails a minor performance penalty\n"));
+
+ if (yymore_used)
+ fprintf (stderr,
+ _
+ ("yymore() entails a minor performance penalty\n"));
+ }
+
+ if (reject)
+ fprintf (stderr,
+ _
+ ("REJECT entails a large performance penalty\n"));
+
+ if (variable_trailing_context_rules)
+ fprintf (stderr,
+ _
+ ("Variable trailing context rules entail a large performance penalty\n"));
+ }
+
+ if (reject)
+ real_reject = true;
+
+ if (variable_trailing_context_rules)
+ reject = true;
+
+ if ((fulltbl || fullspd) && reject) {
+ if (real_reject)
+ flexerror (_
+ ("REJECT cannot be used with -f or -F"));
+ else if (do_yylineno)
+ flexerror (_
+ ("%option yylineno cannot be used with REJECT"));
+ else
+ flexerror (_
+ ("variable trailing context rules cannot be used with -f or -F"));
+ }
+
+ if (reject){
+ out_m4_define( "M4_YY_USES_REJECT", NULL);
+ //outn ("\n#define YY_USES_REJECT");
+ }
+
+ if (!do_yywrap) {
+ if (!C_plus_plus) {
+ if (reentrant)
+ outn ("\n#define yywrap(yyscanner) (/*CONSTCOND*/1)");
+ else
+ outn ("\n#define yywrap() (/*CONSTCOND*/1)");
+ }
+ outn ("#define YY_SKIP_YYWRAP");
+ }
+
+ if (ddebug)
+ outn ("\n#define FLEX_DEBUG");
+
+ OUT_BEGIN_CODE ();
+ if (csize == 256)
+ outn ("typedef unsigned char YY_CHAR;");
+ else
+ outn ("typedef char YY_CHAR;");
+ OUT_END_CODE ();
+
+ if (C_plus_plus) {
+ outn ("#define yytext_ptr yytext");
+
+ if (interactive)
+ outn ("#define YY_INTERACTIVE");
+ }
+
+ else {
+ OUT_BEGIN_CODE ();
+ /* In reentrant scanner, stdinit is handled in flex.skl. */
+ if (do_stdinit) {
+ if (reentrant){
+ outn ("#ifdef VMS");
+ outn ("#ifdef __VMS_POSIX");
+ outn ("#define YY_STDINIT");
+ outn ("#endif");
+ outn ("#else");
+ outn ("#define YY_STDINIT");
+ outn ("#endif");
+ }
+
+ outn ("#ifdef VMS");
+ outn ("#ifndef __VMS_POSIX");
+ outn (yy_nostdinit);
+ outn ("#else");
+ outn (yy_stdinit);
+ outn ("#endif");
+ outn ("#else");
+ outn (yy_stdinit);
+ outn ("#endif");
+ }
+
+ else {
+ if(!reentrant)
+ outn (yy_nostdinit);
+ }
+ OUT_END_CODE ();
+ }
+
+ OUT_BEGIN_CODE ();
+ if (fullspd)
+ outn ("typedef yyconst struct yy_trans_info *yy_state_type;");
+ else if (!C_plus_plus)
+ outn ("typedef int yy_state_type;");
+ OUT_END_CODE ();
+
+ if (lex_compat)
+ outn ("#define YY_FLEX_LEX_COMPAT");
+
+ if (!C_plus_plus && !reentrant) {
+ outn ("extern int yylineno;");
+ OUT_BEGIN_CODE ();
+ outn ("int yylineno = 1;");
+ OUT_END_CODE ();
+ }
+
+ if (C_plus_plus) {
+ outn ("\n#include <FlexLexer.h>");
+
+ if (!do_yywrap) {
+ outn("\nint yyFlexLexer::yywrap() { return 1; }");
+ }
+
+ if (yyclass) {
+ outn ("int yyFlexLexer::yylex()");
+ outn ("\t{");
+ outn ("\tLexerError( \"yyFlexLexer::yylex invoked but %option yyclass used\" );");
+ outn ("\treturn 0;");
+ outn ("\t}");
+
+ out_str ("\n#define YY_DECL int %s::yylex()\n",
+ yyclass);
+ }
+ }
+
+ else {
+
+ /* Watch out: yytext_ptr is a variable when yytext is an array,
+ * but it's a macro when yytext is a pointer.
+ */
+ if (yytext_is_array) {
+ if (!reentrant)
+ outn ("extern char yytext[];\n");
+ }
+ else {
+ if (reentrant) {
+ outn ("#define yytext_ptr yytext_r");
+ }
+ else {
+ outn ("extern char *yytext;");
+
+ outn("#ifdef yytext_ptr");
+ outn("#undef yytext_ptr");
+ outn("#endif");
+ outn ("#define yytext_ptr yytext");
+ }
+ }
+
+ if (yyclass)
+ flexerror (_
+ ("%option yyclass only meaningful for C++ scanners"));
+ }
+
+ if (useecs)
+ numecs = cre8ecs (nextecm, ecgroup, csize);
+ else
+ numecs = csize;
+
+ /* Now map the equivalence class for NUL to its expected place. */
+ ecgroup[0] = ecgroup[csize];
+ NUL_ec = ABS (ecgroup[0]);
+
+ if (useecs)
+ ccl2ecl ();
+}
+
+
+/* set_up_initial_allocations - allocate memory for internal tables */
+
+void set_up_initial_allocations ()
+{
+ maximum_mns = (long_align ? MAXIMUM_MNS_LONG : MAXIMUM_MNS);
+ current_mns = INITIAL_MNS;
+ firstst = allocate_integer_array (current_mns);
+ lastst = allocate_integer_array (current_mns);
+ finalst = allocate_integer_array (current_mns);
+ transchar = allocate_integer_array (current_mns);
+ trans1 = allocate_integer_array (current_mns);
+ trans2 = allocate_integer_array (current_mns);
+ accptnum = allocate_integer_array (current_mns);
+ assoc_rule = allocate_integer_array (current_mns);
+ state_type = allocate_integer_array (current_mns);
+
+ current_max_rules = INITIAL_MAX_RULES;
+ rule_type = allocate_integer_array (current_max_rules);
+ rule_linenum = allocate_integer_array (current_max_rules);
+ rule_useful = allocate_integer_array (current_max_rules);
+ rule_has_nl = allocate_bool_array (current_max_rules);
+
+ current_max_scs = INITIAL_MAX_SCS;
+ scset = allocate_integer_array (current_max_scs);
+ scbol = allocate_integer_array (current_max_scs);
+ scxclu = allocate_integer_array (current_max_scs);
+ sceof = allocate_integer_array (current_max_scs);
+ scname = allocate_char_ptr_array (current_max_scs);
+
+ current_maxccls = INITIAL_MAX_CCLS;
+ cclmap = allocate_integer_array (current_maxccls);
+ ccllen = allocate_integer_array (current_maxccls);
+ cclng = allocate_integer_array (current_maxccls);
+ ccl_has_nl = allocate_bool_array (current_maxccls);
+
+ current_max_ccl_tbl_size = INITIAL_MAX_CCL_TBL_SIZE;
+ ccltbl = allocate_Character_array (current_max_ccl_tbl_size);
+
+ current_max_dfa_size = INITIAL_MAX_DFA_SIZE;
+
+ current_max_xpairs = INITIAL_MAX_XPAIRS;
+ nxt = allocate_integer_array (current_max_xpairs);
+ chk = allocate_integer_array (current_max_xpairs);
+
+ current_max_template_xpairs = INITIAL_MAX_TEMPLATE_XPAIRS;
+ tnxt = allocate_integer_array (current_max_template_xpairs);
+
+ current_max_dfas = INITIAL_MAX_DFAS;
+ base = allocate_integer_array (current_max_dfas);
+ def = allocate_integer_array (current_max_dfas);
+ dfasiz = allocate_integer_array (current_max_dfas);
+ accsiz = allocate_integer_array (current_max_dfas);
+ dhash = allocate_integer_array (current_max_dfas);
+ dss = allocate_int_ptr_array (current_max_dfas);
+ dfaacc = allocate_dfaacc_union (current_max_dfas);
+
+ nultrans = (int *) 0;
+}
+
+
+/* extracts basename from path, optionally stripping the extension "\.*"
+ * (same concept as /bin/sh `basename`, but different handling of extension). */
+static char *basename2 (path, strip_ext)
+ char *path;
+ int strip_ext; /* boolean */
+{
+ char *b, *e = 0;
+
+ b = path;
+ for (b = path; *path; path++)
+ if (*path == '/')
+ b = path + 1;
+ else if (*path == '.')
+ e = path;
+
+ if (strip_ext && e && e > b)
+ *e = '\0';
+ return b;
+}
+
+void usage ()
+{
+ FILE *f = stdout;
+
+ if (!did_outfilename) {
+ snprintf (outfile_path, sizeof(outfile_path), outfile_template,
+ prefix, C_plus_plus ? "cc" : "c");
+ outfilename = outfile_path;
+ }
+
+ fprintf (f, _("Usage: %s [OPTIONS] [FILE]...\n"), program_name);
+ fprintf (f,
+ _
+ ("Generates programs that perform pattern-matching on text.\n"
+ "\n" "Table Compression:\n"
+ " -Ca, --align trade off larger tables for better memory alignment\n"
+ " -Ce, --ecs construct equivalence classes\n"
+ " -Cf do not compress tables; use -f representation\n"
+ " -CF do not compress tables; use -F representation\n"
+ " -Cm, --meta-ecs construct meta-equivalence classes\n"
+ " -Cr, --read use read() instead of stdio for scanner input\n"
+ " -f, --full generate fast, large scanner. Same as -Cfr\n"
+ " -F, --fast use alternate table representation. Same as -CFr\n"
+ " -Cem default compression (same as --ecs --meta-ecs)\n"
+ "\n" "Debugging:\n"
+ " -d, --debug enable debug mode in scanner\n"
+ " -b, --backup write backing-up information to %s\n"
+ " -p, --perf-report write performance report to stderr\n"
+ " -s, --nodefault suppress default rule to ECHO unmatched text\n"
+ " -T, --trace %s should run in trace mode\n"
+ " -w, --nowarn do not generate warnings\n"
+ " -v, --verbose write summary of scanner statistics to stdout\n"
+ " --hex use hexadecimal numbers instead of octal in debug outputs\n"
+ "\n" "Files:\n"
+ " -o, --outfile=FILE specify output filename\n"
+ " -S, --skel=FILE specify skeleton file\n"
+ " -t, --stdout write scanner on stdout instead of %s\n"
+ " --yyclass=NAME name of C++ class\n"
+ " --header-file=FILE create a C header file in addition to the scanner\n"
+ " --tables-file[=FILE] write tables to FILE\n" "\n"
+ "Scanner behavior:\n"
+ " -7, --7bit generate 7-bit scanner\n"
+ " -8, --8bit generate 8-bit scanner\n"
+ " -B, --batch generate batch scanner (opposite of -I)\n"
+ " -i, --case-insensitive ignore case in patterns\n"
+ " -l, --lex-compat maximal compatibility with original lex\n"
+ " -X, --posix-compat maximal compatibility with POSIX lex\n"
+ " -I, --interactive generate interactive scanner (opposite of -B)\n"
+ " --yylineno track line count in yylineno\n"
+ "\n" "Generated code:\n"
+ " -+, --c++ generate C++ scanner class\n"
+ " -Dmacro[=defn] #define macro defn (default defn is '1')\n"
+ " -L, --noline suppress #line directives in scanner\n"
+ " -P, --prefix=STRING use STRING as prefix instead of \"yy\"\n"
+ " -R, --reentrant generate a reentrant C scanner\n"
+ " --bison-bridge scanner for bison pure parser.\n"
+ " --bison-locations include yylloc support.\n"
+ " --stdinit initialize yyin/yyout to stdin/stdout\n"
+ " --noansi-definitions old-style function definitions\n"
+ " --noansi-prototypes empty parameter list in prototypes\n"
+ " --nounistd do not include <unistd.h>\n"
+ " --noFUNCTION do not generate a particular FUNCTION\n"
+ "\n" "Miscellaneous:\n"
+ " -c do-nothing POSIX option\n"
+ " -n do-nothing POSIX option\n"
+ " -?\n"
+ " -h, --help produce this help message\n"
+ " -V, --version report %s version\n"),
+ backing_name, program_name, outfile_path, program_name);
+
+}
diff --git a/src/misc.c b/src/misc.c
new file mode 100644
index 0000000..8e0edca
--- /dev/null
+++ b/src/misc.c
@@ -0,0 +1,1015 @@
+/* misc - miscellaneous flex routines */
+
+/* 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"
+
+#define CMD_IF_TABLES_SER "%if-tables-serialization"
+#define CMD_TABLES_YYDMAP "%tables-yydmap"
+#define CMD_DEFINE_YYTABLES "%define-yytables"
+#define CMD_IF_CPP_ONLY "%if-c++-only"
+#define CMD_IF_C_ONLY "%if-c-only"
+#define CMD_IF_C_OR_CPP "%if-c-or-c++"
+#define CMD_NOT_FOR_HEADER "%not-for-header"
+#define CMD_OK_FOR_HEADER "%ok-for-header"
+#define CMD_PUSH "%push"
+#define CMD_POP "%pop"
+#define CMD_IF_REENTRANT "%if-reentrant"
+#define CMD_IF_NOT_REENTRANT "%if-not-reentrant"
+#define CMD_IF_BISON_BRIDGE "%if-bison-bridge"
+#define CMD_IF_NOT_BISON_BRIDGE "%if-not-bison-bridge"
+#define CMD_ENDIF "%endif"
+
+/* we allow the skeleton to push and pop. */
+struct sko_state {
+ bool dc; /**< do_copy */
+};
+static struct sko_state *sko_stack=0;
+static int sko_len=0,sko_sz=0;
+static void sko_push(bool dc)
+{
+ if(!sko_stack){
+ sko_sz = 1;
+ sko_stack = (struct sko_state*)flex_alloc(sizeof(struct sko_state)*sko_sz);
+ if (!sko_stack)
+ flexfatal(_("allocation of sko_stack failed"));
+ sko_len = 0;
+ }
+ if(sko_len >= sko_sz){
+ sko_sz *= 2;
+ sko_stack = (struct sko_state*)flex_realloc(sko_stack,sizeof(struct sko_state)*sko_sz);
+ }
+
+ /* initialize to zero and push */
+ sko_stack[sko_len].dc = dc;
+ sko_len++;
+}
+static void sko_peek(bool *dc)
+{
+ if(sko_len <= 0)
+ flex_die("peek attempt when sko stack is empty");
+ if(dc)
+ *dc = sko_stack[sko_len-1].dc;
+}
+static void sko_pop(bool* dc)
+{
+ sko_peek(dc);
+ sko_len--;
+ if(sko_len < 0)
+ flex_die("popped too many times in skeleton.");
+}
+
+/* Append "#define defname value\n" to the running buffer. */
+void action_define (defname, value)
+ const char *defname;
+ int value;
+{
+ char buf[MAXLINE];
+ char *cpy;
+
+ if ((int) strlen (defname) > MAXLINE / 2) {
+ format_pinpoint_message (_
+ ("name \"%s\" ridiculously long"),
+ defname);
+ return;
+ }
+
+ snprintf (buf, sizeof(buf), "#define %s %d\n", defname, value);
+ add_action (buf);
+
+ /* track #defines so we can undef them when we're done. */
+ cpy = copy_string (defname);
+ buf_append (&defs_buf, &cpy, 1);
+}
+
+
+#ifdef notdef
+/** Append "m4_define([[defname]],[[value]])m4_dnl\n" to the running buffer.
+ * @param defname The macro name.
+ * @param value The macro value, can be NULL, which is the same as the empty string.
+ */
+static void action_m4_define (const char *defname, const char * value)
+{
+ char buf[MAXLINE];
+
+ flexfatal ("DO NOT USE THIS FUNCTION!");
+
+ if ((int) strlen (defname) > MAXLINE / 2) {
+ format_pinpoint_message (_
+ ("name \"%s\" ridiculously long"),
+ defname);
+ return;
+ }
+
+ snprintf (buf, sizeof(buf), "m4_define([[%s]],[[%s]])m4_dnl\n", defname, value?value:"");
+ add_action (buf);
+}
+#endif
+
+/* Append "new_text" to the running buffer. */
+void add_action (new_text)
+ const char *new_text;
+{
+ int len = strlen (new_text);
+
+ while (len + action_index >= action_size - 10 /* slop */ ) {
+ int new_size = action_size * 2;
+
+ if (new_size <= 0)
+ /* Increase just a little, to try to avoid overflow
+ * on 16-bit machines.
+ */
+ action_size += action_size / 8;
+ else
+ action_size = new_size;
+
+ action_array =
+ reallocate_character_array (action_array,
+ action_size);
+ }
+
+ strcpy (&action_array[action_index], new_text);
+
+ action_index += len;
+}
+
+
+/* allocate_array - allocate memory for an integer array of the given size */
+
+void *allocate_array (size, element_size)
+ int size;
+ size_t element_size;
+{
+ void *mem;
+ size_t num_bytes = element_size * size;
+
+ mem = flex_alloc (num_bytes);
+ if (!mem)
+ flexfatal (_
+ ("memory allocation failed in allocate_array()"));
+
+ return mem;
+}
+
+
+/* all_lower - true if a string is all lower-case */
+
+int all_lower (str)
+ char *str;
+{
+ while (*str) {
+ if (!isascii ((Char) * str) || !islower ((Char) * str))
+ return 0;
+ ++str;
+ }
+
+ return 1;
+}
+
+
+/* all_upper - true if a string is all upper-case */
+
+int all_upper (str)
+ char *str;
+{
+ while (*str) {
+ if (!isascii ((Char) * str) || !isupper ((Char) * str))
+ return 0;
+ ++str;
+ }
+
+ return 1;
+}
+
+
+/* intcmp - compares two integers for use by qsort. */
+
+int intcmp (const void *a, const void *b)
+{
+ return *(const int *) a - *(const int *) b;
+}
+
+
+/* check_char - checks a character to make sure it's within the range
+ * we're expecting. If not, generates fatal error message
+ * and exits.
+ */
+
+void check_char (c)
+ int c;
+{
+ if (c >= CSIZE)
+ lerr (_("bad character '%s' detected in check_char()"),
+ readable_form (c));
+
+ if (c >= csize)
+ lerr (_
+ ("scanner requires -8 flag to use the character %s"),
+ readable_form (c));
+}
+
+
+
+/* clower - replace upper-case letter to lower-case */
+
+Char clower (c)
+ int c;
+{
+ return (Char) ((isascii (c) && isupper (c)) ? tolower (c) : c);
+}
+
+
+/* copy_string - returns a dynamically allocated copy of a string */
+
+char *copy_string (str)
+ const char *str;
+{
+ const char *c1;
+ char *c2;
+ char *copy;
+ unsigned int size;
+
+ /* find length */
+ for (c1 = str; *c1; ++c1) ;
+
+ size = (c1 - str + 1) * sizeof (char);
+
+ copy = (char *) flex_alloc (size);
+
+ if (copy == NULL)
+ flexfatal (_("dynamic memory failure in copy_string()"));
+
+ for (c2 = copy; (*c2++ = *str++) != 0;) ;
+
+ return copy;
+}
+
+
+/* copy_unsigned_string -
+ * returns a dynamically allocated copy of a (potentially) unsigned string
+ */
+
+Char *copy_unsigned_string (str)
+ Char *str;
+{
+ Char *c;
+ Char *copy;
+
+ /* find length */
+ for (c = str; *c; ++c) ;
+
+ copy = allocate_Character_array (c - str + 1);
+
+ for (c = copy; (*c++ = *str++) != 0;) ;
+
+ return copy;
+}
+
+
+/* cclcmp - compares two characters for use by qsort with '\0' sorting last. */
+
+int cclcmp (const void *a, const void *b)
+{
+ if (!*(const Char *) a)
+ return 1;
+ else
+ if (!*(const Char *) b)
+ return - 1;
+ else
+ return *(const Char *) a - *(const Char *) b;
+}
+
+
+/* dataend - finish up a block of data declarations */
+
+void dataend ()
+{
+ /* short circuit any output */
+ if (gentables) {
+
+ if (datapos > 0)
+ dataflush ();
+
+ /* add terminator for initialization; { for vi */
+ outn (" } ;\n");
+ }
+ dataline = 0;
+ datapos = 0;
+}
+
+
+/* dataflush - flush generated data statements */
+
+void dataflush ()
+{
+ /* short circuit any output */
+ if (!gentables)
+ return;
+
+ outc ('\n');
+
+ if (++dataline >= NUMDATALINES) {
+ /* Put out a blank line so that the table is grouped into
+ * large blocks that enable the user to find elements easily.
+ */
+ outc ('\n');
+ dataline = 0;
+ }
+
+ /* Reset the number of characters written on the current line. */
+ datapos = 0;
+}
+
+
+/* flexerror - report an error message and terminate */
+
+void flexerror (msg)
+ const char *msg;
+{
+ fprintf (stderr, "%s: %s\n", program_name, msg);
+ flexend (1);
+}
+
+
+/* flexfatal - report a fatal error message and terminate */
+
+void flexfatal (msg)
+ const char *msg;
+{
+ fprintf (stderr, _("%s: fatal internal error, %s\n"),
+ program_name, msg);
+ FLEX_EXIT (1);
+}
+
+
+/* htoi - convert a hexadecimal digit string to an integer value */
+
+int htoi (str)
+ Char str[];
+{
+ unsigned int result;
+
+ (void) sscanf ((char *) str, "%x", &result);
+
+ return result;
+}
+
+
+/* lerr - report an error message */
+
+void lerr (const char *msg, ...) {
+ char errmsg[MAXLINE];
+ va_list args;
+
+ va_start(args, msg);
+ vsnprintf (errmsg, sizeof(errmsg), msg, args);
+ va_end(args);
+ flexerror (errmsg);
+}
+
+
+/* lerr_fatal - as lerr, but call flexfatal */
+
+void lerr_fatal (const char *msg, ...)
+{
+ char errmsg[MAXLINE];
+ va_list args;
+ va_start(args, msg);
+
+ vsnprintf (errmsg, sizeof(errmsg), msg, args);
+ va_end(args);
+ flexfatal (errmsg);
+}
+
+
+/* line_directive_out - spit out a "#line" statement */
+
+void line_directive_out (output_file, do_infile)
+ FILE *output_file;
+ int do_infile;
+{
+ char directive[MAXLINE], filename[MAXLINE];
+ char *s1, *s2, *s3;
+ static const char *line_fmt = "#line %d \"%s\"\n";
+
+ if (!gen_line_dirs)
+ return;
+
+ s1 = do_infile ? infilename : "M4_YY_OUTFILE_NAME";
+
+ if (do_infile && !s1)
+ s1 = "<stdin>";
+
+ s2 = filename;
+ s3 = &filename[sizeof (filename) - 2];
+
+ while (s2 < s3 && *s1) {
+ if (*s1 == '\\')
+ /* Escape the '\' */
+ *s2++ = '\\';
+
+ *s2++ = *s1++;
+ }
+
+ *s2 = '\0';
+
+ if (do_infile)
+ snprintf (directive, sizeof(directive), line_fmt, linenum, filename);
+ else {
+ snprintf (directive, sizeof(directive), line_fmt, 0, filename);
+ }
+
+ /* If output_file is nil then we should put the directive in
+ * the accumulated actions.
+ */
+ if (output_file) {
+ fputs (directive, output_file);
+ }
+ else
+ add_action (directive);
+}
+
+
+/* mark_defs1 - mark the current position in the action array as
+ * representing where the user's section 1 definitions end
+ * and the prolog begins
+ */
+void mark_defs1 ()
+{
+ defs1_offset = 0;
+ action_array[action_index++] = '\0';
+ action_offset = prolog_offset = action_index;
+ action_array[action_index] = '\0';
+}
+
+
+/* mark_prolog - mark the current position in the action array as
+ * representing the end of the action prolog
+ */
+void mark_prolog ()
+{
+ action_array[action_index++] = '\0';
+ action_offset = action_index;
+ action_array[action_index] = '\0';
+}
+
+
+/* mk2data - generate a data statement for a two-dimensional array
+ *
+ * Generates a data statement initializing the current 2-D array to "value".
+ */
+void mk2data (value)
+ int value;
+{
+ /* short circuit any output */
+ if (!gentables)
+ return;
+
+ if (datapos >= NUMDATAITEMS) {
+ outc (',');
+ dataflush ();
+ }
+
+ if (datapos == 0)
+ /* Indent. */
+ out (" ");
+
+ else
+ outc (',');
+
+ ++datapos;
+
+ out_dec ("%5d", value);
+}
+
+
+/* mkdata - generate a data statement
+ *
+ * Generates a data statement initializing the current array element to
+ * "value".
+ */
+void mkdata (value)
+ int value;
+{
+ /* short circuit any output */
+ if (!gentables)
+ return;
+
+ if (datapos >= NUMDATAITEMS) {
+ outc (',');
+ dataflush ();
+ }
+
+ if (datapos == 0)
+ /* Indent. */
+ out (" ");
+ else
+ outc (',');
+
+ ++datapos;
+
+ out_dec ("%5d", value);
+}
+
+
+/* myctoi - return the integer represented by a string of digits */
+
+int myctoi (array)
+ const char *array;
+{
+ int val = 0;
+
+ (void) sscanf (array, "%d", &val);
+
+ return val;
+}
+
+
+/* myesc - return character corresponding to escape sequence */
+
+Char myesc (array)
+ Char array[];
+{
+ Char c, esc_char;
+
+ switch (array[1]) {
+ case 'b':
+ return '\b';
+ case 'f':
+ return '\f';
+ case 'n':
+ return '\n';
+ case 'r':
+ return '\r';
+ case 't':
+ return '\t';
+
+#if defined (__STDC__)
+ case 'a':
+ return '\a';
+ case 'v':
+ return '\v';
+#else
+ case 'a':
+ return '\007';
+ case 'v':
+ return '\013';
+#endif
+
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ { /* \<octal> */
+ int sptr = 1;
+
+ while (isascii (array[sptr]) &&
+ isdigit (array[sptr]))
+ /* Don't increment inside loop control
+ * because if isdigit() is a macro it might
+ * expand into multiple increments ...
+ */
+ ++sptr;
+
+ c = array[sptr];
+ array[sptr] = '\0';
+
+ esc_char = otoi (array + 1);
+
+ array[sptr] = c;
+
+ return esc_char;
+ }
+
+ case 'x':
+ { /* \x<hex> */
+ int sptr = 2;
+
+ while (isascii (array[sptr]) &&
+ isxdigit (array[sptr]))
+ /* Don't increment inside loop control
+ * because if isdigit() is a macro it might
+ * expand into multiple increments ...
+ */
+ ++sptr;
+
+ c = array[sptr];
+ array[sptr] = '\0';
+
+ esc_char = htoi (array + 2);
+
+ array[sptr] = c;
+
+ return esc_char;
+ }
+
+ default:
+ return array[1];
+ }
+}
+
+
+/* otoi - convert an octal digit string to an integer value */
+
+int otoi (str)
+ Char str[];
+{
+ unsigned int result;
+
+ (void) sscanf ((char *) str, "%o", &result);
+ return result;
+}
+
+
+/* out - various flavors of outputing a (possibly formatted) string for the
+ * generated scanner, keeping track of the line count.
+ */
+
+void out (str)
+ const char *str;
+{
+ fputs (str, stdout);
+}
+
+void out_dec (fmt, n)
+ const char *fmt;
+ int n;
+{
+ fprintf (stdout, fmt, n);
+}
+
+void out_dec2 (fmt, n1, n2)
+ const char *fmt;
+ int n1, n2;
+{
+ fprintf (stdout, fmt, n1, n2);
+}
+
+void out_hex (fmt, x)
+ const char *fmt;
+ unsigned int x;
+{
+ fprintf (stdout, fmt, x);
+}
+
+void out_str (fmt, str)
+ const char *fmt, str[];
+{
+ fprintf (stdout,fmt, str);
+}
+
+void out_str3 (fmt, s1, s2, s3)
+ const char *fmt, s1[], s2[], s3[];
+{
+ fprintf (stdout,fmt, s1, s2, s3);
+}
+
+void out_str_dec (fmt, str, n)
+ const char *fmt, str[];
+ int n;
+{
+ fprintf (stdout,fmt, str, n);
+}
+
+void outc (c)
+ int c;
+{
+ fputc (c, stdout);
+}
+
+void outn (str)
+ const char *str;
+{
+ fputs (str,stdout);
+ fputc('\n',stdout);
+}
+
+/** Print "m4_define( [[def]], [[val]])m4_dnl\n".
+ * @param def The m4 symbol to define.
+ * @param val The definition; may be NULL.
+ */
+void out_m4_define (const char* def, const char* val)
+{
+ const char * fmt = "m4_define( [[%s]], [[%s]])m4_dnl\n";
+ fprintf(stdout, fmt, def, val?val:"");
+}
+
+
+/* readable_form - return the the human-readable form of a character
+ *
+ * The returned string is in static storage.
+ */
+
+char *readable_form (c)
+ int c;
+{
+ static char rform[20];
+
+ if ((c >= 0 && c < 32) || c >= 127) {
+ switch (c) {
+ case '\b':
+ return "\\b";
+ case '\f':
+ return "\\f";
+ case '\n':
+ return "\\n";
+ case '\r':
+ return "\\r";
+ case '\t':
+ return "\\t";
+
+#if defined (__STDC__)
+ case '\a':
+ return "\\a";
+ case '\v':
+ return "\\v";
+#endif
+
+ default:
+ if(trace_hex)
+ snprintf (rform, sizeof(rform), "\\x%.2x", (unsigned int) c);
+ else
+ snprintf (rform, sizeof(rform), "\\%.3o", (unsigned int) c);
+ return rform;
+ }
+ }
+
+ else if (c == ' ')
+ return "' '";
+
+ else {
+ rform[0] = c;
+ rform[1] = '\0';
+
+ return rform;
+ }
+}
+
+
+/* reallocate_array - increase the size of a dynamic array */
+
+void *reallocate_array (array, size, element_size)
+ void *array;
+ int size;
+ size_t element_size;
+{
+ void *new_array;
+ size_t num_bytes = element_size * size;
+
+ new_array = flex_realloc (array, num_bytes);
+ if (!new_array)
+ flexfatal (_("attempt to increase array size failed"));
+
+ return new_array;
+}
+
+
+/* skelout - write out one section of the skeleton file
+ *
+ * Description
+ * Copies skelfile or skel array to stdout until a line beginning with
+ * "%%" or EOF is found.
+ */
+void skelout ()
+{
+ char buf_storage[MAXLINE];
+ char *buf = buf_storage;
+ bool do_copy = true;
+
+ /* "reset" the state by clearing the buffer and pushing a '1' */
+ if(sko_len > 0)
+ sko_peek(&do_copy);
+ sko_len = 0;
+ sko_push(do_copy=true);
+
+
+ /* Loop pulling lines either from the skelfile, if we're using
+ * one, or from the skel[] array.
+ */
+ while (skelfile ?
+ (fgets (buf, MAXLINE, skelfile) != NULL) :
+ ((buf = (char *) skel[skel_ind++]) != 0)) {
+
+ if (skelfile)
+ chomp (buf);
+
+ /* copy from skel array */
+ if (buf[0] == '%') { /* control line */
+ /* print the control line as a comment. */
+ if (ddebug && buf[1] != '#') {
+ if (buf[strlen (buf) - 1] == '\\')
+ out_str ("/* %s */\\\n", buf);
+ else
+ out_str ("/* %s */\n", buf);
+ }
+
+ /* We've been accused of using cryptic markers in the skel.
+ * So we'll use emacs-style-hyphenated-commands.
+ * We might consider a hash if this if-else-if-else
+ * chain gets too large.
+ */
+#define cmd_match(s) (strncmp(buf,(s),strlen(s))==0)
+
+ if (buf[1] == '%') {
+ /* %% is a break point for skelout() */
+ return;
+ }
+ else if (cmd_match (CMD_PUSH)){
+ sko_push(do_copy);
+ if(ddebug){
+ out_str("/*(state = (%s) */",do_copy?"true":"false");
+ }
+ out_str("%s\n", buf[strlen (buf) - 1] =='\\' ? "\\" : "");
+ }
+ else if (cmd_match (CMD_POP)){
+ sko_pop(&do_copy);
+ if(ddebug){
+ out_str("/*(state = (%s) */",do_copy?"true":"false");
+ }
+ out_str("%s\n", buf[strlen (buf) - 1] =='\\' ? "\\" : "");
+ }
+ else if (cmd_match (CMD_IF_REENTRANT)){
+ sko_push(do_copy);
+ do_copy = reentrant && do_copy;
+ }
+ else if (cmd_match (CMD_IF_NOT_REENTRANT)){
+ sko_push(do_copy);
+ do_copy = !reentrant && do_copy;
+ }
+ else if (cmd_match(CMD_IF_BISON_BRIDGE)){
+ sko_push(do_copy);
+ do_copy = bison_bridge_lval && do_copy;
+ }
+ else if (cmd_match(CMD_IF_NOT_BISON_BRIDGE)){
+ sko_push(do_copy);
+ do_copy = !bison_bridge_lval && do_copy;
+ }
+ else if (cmd_match (CMD_ENDIF)){
+ sko_pop(&do_copy);
+ }
+ else if (cmd_match (CMD_IF_TABLES_SER)) {
+ do_copy = do_copy && tablesext;
+ }
+ else if (cmd_match (CMD_TABLES_YYDMAP)) {
+ if (tablesext && yydmap_buf.elts)
+ outn ((char *) (yydmap_buf.elts));
+ }
+ else if (cmd_match (CMD_DEFINE_YYTABLES)) {
+ out_str("#define YYTABLES_NAME \"%s\"\n",
+ tablesname?tablesname:"yytables");
+ }
+ else if (cmd_match (CMD_IF_CPP_ONLY)) {
+ /* only for C++ */
+ sko_push(do_copy);
+ do_copy = C_plus_plus;
+ }
+ else if (cmd_match (CMD_IF_C_ONLY)) {
+ /* %- only for C */
+ sko_push(do_copy);
+ do_copy = !C_plus_plus;
+ }
+ else if (cmd_match (CMD_IF_C_OR_CPP)) {
+ /* %* for C and C++ */
+ sko_push(do_copy);
+ do_copy = true;
+ }
+ else if (cmd_match (CMD_NOT_FOR_HEADER)) {
+ /* %c begin linkage-only (non-header) code. */
+ OUT_BEGIN_CODE ();
+ }
+ else if (cmd_match (CMD_OK_FOR_HEADER)) {
+ /* %e end linkage-only code. */
+ OUT_END_CODE ();
+ }
+ else if (buf[1] == '#') {
+ /* %# a comment in the skel. ignore. */
+ }
+ else {
+ flexfatal (_("bad line in skeleton file"));
+ }
+ }
+
+ else if (do_copy)
+ outn (buf);
+ } /* end while */
+}
+
+
+/* transition_struct_out - output a yy_trans_info structure
+ *
+ * outputs the yy_trans_info structure with the two elements, element_v and
+ * element_n. Formats the output with spaces and carriage returns.
+ */
+
+void transition_struct_out (element_v, element_n)
+ int element_v, element_n;
+{
+
+ /* short circuit any output */
+ if (!gentables)
+ return;
+
+ out_dec2 (" {%4d,%4d },", element_v, element_n);
+
+ datapos += TRANS_STRUCT_PRINT_LENGTH;
+
+ if (datapos >= 79 - TRANS_STRUCT_PRINT_LENGTH) {
+ outc ('\n');
+
+ if (++dataline % 10 == 0)
+ outc ('\n');
+
+ datapos = 0;
+ }
+}
+
+
+/* The following is only needed when building flex's parser using certain
+ * broken versions of bison.
+ */
+void *yy_flex_xmalloc (size)
+ int size;
+{
+ void *result = flex_alloc ((size_t) size);
+
+ if (!result)
+ flexfatal (_
+ ("memory allocation failed in yy_flex_xmalloc()"));
+
+ return result;
+}
+
+
+/* zero_out - set a region of memory to 0
+ *
+ * Sets region_ptr[0] through region_ptr[size_in_bytes - 1] to zero.
+ */
+
+void zero_out (region_ptr, size_in_bytes)
+ char *region_ptr;
+ size_t size_in_bytes;
+{
+ char *rp, *rp_end;
+
+ rp = region_ptr;
+ rp_end = region_ptr + size_in_bytes;
+
+ while (rp < rp_end)
+ *rp++ = 0;
+}
+
+/* Remove all '\n' and '\r' characters, if any, from the end of str.
+ * str can be any null-terminated string, or NULL.
+ * returns str. */
+char *chomp (str)
+ char *str;
+{
+ char *p = str;
+
+ if (!str || !*str) /* s is null or empty string */
+ return str;
+
+ /* find end of string minus one */
+ while (*p)
+ ++p;
+ --p;
+
+ /* eat newlines */
+ while (p >= str && (*p == '\r' || *p == '\n'))
+ *p-- = 0;
+ return str;
+}
diff --git a/src/mkskel.sh b/src/mkskel.sh
new file mode 100755
index 0000000..02c397a
--- /dev/null
+++ b/src/mkskel.sh
@@ -0,0 +1,37 @@
+#! /bin/sh
+
+# 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.
+
+cat <<!
+/* File created from flex.skl via mkskel.sh */
+
+#include "flexdef.h"
+
+const char *skel[] = {
+!
+
+sed 's/\\/&&/g' | sed 's/"/\\"/g' | sed 's/.*/ "&",/'
+
+cat <<!
+ 0
+};
+!
diff --git a/src/nfa.c b/src/nfa.c
new file mode 100644
index 0000000..ee06578
--- /dev/null
+++ b/src/nfa.c
@@ -0,0 +1,719 @@
+/* nfa - NFA construction routines */
+
+/* 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"
+
+
+/* declare functions that have forward references */
+
+int dupmachine PROTO ((int));
+void mkxtion PROTO ((int, int));
+
+
+/* add_accept - add an accepting state to a machine
+ *
+ * accepting_number becomes mach's accepting number.
+ */
+
+void add_accept (mach, accepting_number)
+ int mach, accepting_number;
+{
+ /* Hang the accepting number off an epsilon state. if it is associated
+ * with a state that has a non-epsilon out-transition, then the state
+ * will accept BEFORE it makes that transition, i.e., one character
+ * too soon.
+ */
+
+ if (transchar[finalst[mach]] == SYM_EPSILON)
+ accptnum[finalst[mach]] = accepting_number;
+
+ else {
+ int astate = mkstate (SYM_EPSILON);
+
+ accptnum[astate] = accepting_number;
+ (void) link_machines (mach, astate);
+ }
+}
+
+
+/* copysingl - make a given number of copies of a singleton machine
+ *
+ * synopsis
+ *
+ * newsng = copysingl( singl, num );
+ *
+ * newsng - a new singleton composed of num copies of singl
+ * singl - a singleton machine
+ * num - the number of copies of singl to be present in newsng
+ */
+
+int copysingl (singl, num)
+ int singl, num;
+{
+ int copy, i;
+
+ copy = mkstate (SYM_EPSILON);
+
+ for (i = 1; i <= num; ++i)
+ copy = link_machines (copy, dupmachine (singl));
+
+ return copy;
+}
+
+
+/* dumpnfa - debugging routine to write out an nfa */
+
+void dumpnfa (state1)
+ int state1;
+
+{
+ int sym, tsp1, tsp2, anum, ns;
+
+ fprintf (stderr,
+ _
+ ("\n\n********** beginning dump of nfa with start state %d\n"),
+ state1);
+
+ /* We probably should loop starting at firstst[state1] and going to
+ * lastst[state1], but they're not maintained properly when we "or"
+ * all of the rules together. So we use our knowledge that the machine
+ * starts at state 1 and ends at lastnfa.
+ */
+
+ /* for ( ns = firstst[state1]; ns <= lastst[state1]; ++ns ) */
+ for (ns = 1; ns <= lastnfa; ++ns) {
+ fprintf (stderr, _("state # %4d\t"), ns);
+
+ sym = transchar[ns];
+ tsp1 = trans1[ns];
+ tsp2 = trans2[ns];
+ anum = accptnum[ns];
+
+ fprintf (stderr, "%3d: %4d, %4d", sym, tsp1, tsp2);
+
+ if (anum != NIL)
+ fprintf (stderr, " [%d]", anum);
+
+ fprintf (stderr, "\n");
+ }
+
+ fprintf (stderr, _("********** end of dump\n"));
+}
+
+
+/* dupmachine - make a duplicate of a given machine
+ *
+ * synopsis
+ *
+ * copy = dupmachine( mach );
+ *
+ * copy - holds duplicate of mach
+ * mach - machine to be duplicated
+ *
+ * note that the copy of mach is NOT an exact duplicate; rather, all the
+ * transition states values are adjusted so that the copy is self-contained,
+ * as the original should have been.
+ *
+ * also note that the original MUST be contiguous, with its low and high
+ * states accessible by the arrays firstst and lastst
+ */
+
+int dupmachine (mach)
+ int mach;
+{
+ int i, init, state_offset;
+ int state = 0;
+ int last = lastst[mach];
+
+ for (i = firstst[mach]; i <= last; ++i) {
+ state = mkstate (transchar[i]);
+
+ if (trans1[i] != NO_TRANSITION) {
+ mkxtion (finalst[state], trans1[i] + state - i);
+
+ if (transchar[i] == SYM_EPSILON &&
+ trans2[i] != NO_TRANSITION)
+ mkxtion (finalst[state],
+ trans2[i] + state - i);
+ }
+
+ accptnum[state] = accptnum[i];
+ }
+
+ if (state == 0)
+ flexfatal (_("empty machine in dupmachine()"));
+
+ state_offset = state - i + 1;
+
+ init = mach + state_offset;
+ firstst[init] = firstst[mach] + state_offset;
+ finalst[init] = finalst[mach] + state_offset;
+ lastst[init] = lastst[mach] + state_offset;
+
+ return init;
+}
+
+
+/* finish_rule - finish up the processing for a rule
+ *
+ * An accepting number is added to the given machine. If variable_trail_rule
+ * is true then the rule has trailing context and both the head and trail
+ * are variable size. Otherwise if headcnt or trailcnt is non-zero then
+ * the machine recognizes a pattern with trailing context and headcnt is
+ * the number of characters in the matched part of the pattern, or zero
+ * if the matched part has variable length. trailcnt is the number of
+ * trailing context characters in the pattern, or zero if the trailing
+ * context has variable length.
+ */
+
+void finish_rule (mach, variable_trail_rule, headcnt, trailcnt,
+ pcont_act)
+ int mach, variable_trail_rule, headcnt, trailcnt, pcont_act;
+{
+ char action_text[MAXLINE];
+
+ add_accept (mach, num_rules);
+
+ /* We did this in new_rule(), but it often gets the wrong
+ * number because we do it before we start parsing the current rule.
+ */
+ rule_linenum[num_rules] = linenum;
+
+ /* If this is a continued action, then the line-number has already
+ * been updated, giving us the wrong number.
+ */
+ if (continued_action)
+ --rule_linenum[num_rules];
+
+
+ /* If the previous rule was continued action, then we inherit the
+ * previous newline flag, possibly overriding the current one.
+ */
+ if (pcont_act && rule_has_nl[num_rules - 1])
+ rule_has_nl[num_rules] = true;
+
+ snprintf (action_text, sizeof(action_text), "case %d:\n", num_rules);
+ add_action (action_text);
+ if (rule_has_nl[num_rules]) {
+ snprintf (action_text, sizeof(action_text), "/* rule %d can match eol */\n",
+ num_rules);
+ add_action (action_text);
+ }
+
+
+ if (variable_trail_rule) {
+ rule_type[num_rules] = RULE_VARIABLE;
+
+ if (performance_report > 0)
+ fprintf (stderr,
+ _
+ ("Variable trailing context rule at line %d\n"),
+ rule_linenum[num_rules]);
+
+ variable_trailing_context_rules = true;
+ }
+
+ else {
+ rule_type[num_rules] = RULE_NORMAL;
+
+ if (headcnt > 0 || trailcnt > 0) {
+ /* Do trailing context magic to not match the trailing
+ * characters.
+ */
+ char *scanner_cp = "YY_G(yy_c_buf_p) = yy_cp";
+ char *scanner_bp = "yy_bp";
+
+ add_action
+ ("*yy_cp = YY_G(yy_hold_char); /* undo effects of setting up yytext */\n");
+
+ if (headcnt > 0) {
+ if (rule_has_nl[num_rules]) {
+ snprintf (action_text, sizeof(action_text),
+ "YY_LINENO_REWIND_TO(%s + %d);\n", scanner_bp, headcnt);
+ add_action (action_text);
+ }
+ snprintf (action_text, sizeof(action_text), "%s = %s + %d;\n",
+ scanner_cp, scanner_bp, headcnt);
+ add_action (action_text);
+ }
+
+ else {
+ if (rule_has_nl[num_rules]) {
+ snprintf (action_text, sizeof(action_text),
+ "YY_LINENO_REWIND_TO(yy_cp - %d);\n", trailcnt);
+ add_action (action_text);
+ }
+
+ snprintf (action_text, sizeof(action_text), "%s -= %d;\n",
+ scanner_cp, trailcnt);
+ add_action (action_text);
+ }
+
+ add_action
+ ("YY_DO_BEFORE_ACTION; /* set up yytext again */\n");
+ }
+ }
+
+ /* Okay, in the action code at this point yytext and yyleng have
+ * their proper final values for this rule, so here's the point
+ * to do any user action. But don't do it for continued actions,
+ * as that'll result in multiple YY_RULE_SETUP's.
+ */
+ if (!continued_action)
+ add_action ("YY_RULE_SETUP\n");
+
+ line_directive_out ((FILE *) 0, 1);
+}
+
+
+/* link_machines - connect two machines together
+ *
+ * synopsis
+ *
+ * new = link_machines( first, last );
+ *
+ * new - a machine constructed by connecting first to last
+ * first - the machine whose successor is to be last
+ * last - the machine whose predecessor is to be first
+ *
+ * note: this routine concatenates the machine first with the machine
+ * last to produce a machine new which will pattern-match first first
+ * and then last, and will fail if either of the sub-patterns fails.
+ * FIRST is set to new by the operation. last is unmolested.
+ */
+
+int link_machines (first, last)
+ int first, last;
+{
+ if (first == NIL)
+ return last;
+
+ else if (last == NIL)
+ return first;
+
+ else {
+ mkxtion (finalst[first], last);
+ finalst[first] = finalst[last];
+ lastst[first] = MAX (lastst[first], lastst[last]);
+ firstst[first] = MIN (firstst[first], firstst[last]);
+
+ return first;
+ }
+}
+
+
+/* mark_beginning_as_normal - mark each "beginning" state in a machine
+ * as being a "normal" (i.e., not trailing context-
+ * associated) states
+ *
+ * The "beginning" states are the epsilon closure of the first state
+ */
+
+void mark_beginning_as_normal (mach)
+ int mach;
+{
+ switch (state_type[mach]) {
+ case STATE_NORMAL:
+ /* Oh, we've already visited here. */
+ return;
+
+ case STATE_TRAILING_CONTEXT:
+ state_type[mach] = STATE_NORMAL;
+
+ if (transchar[mach] == SYM_EPSILON) {
+ if (trans1[mach] != NO_TRANSITION)
+ mark_beginning_as_normal (trans1[mach]);
+
+ if (trans2[mach] != NO_TRANSITION)
+ mark_beginning_as_normal (trans2[mach]);
+ }
+ break;
+
+ default:
+ flexerror (_
+ ("bad state type in mark_beginning_as_normal()"));
+ break;
+ }
+}
+
+
+/* mkbranch - make a machine that branches to two machines
+ *
+ * synopsis
+ *
+ * branch = mkbranch( first, second );
+ *
+ * branch - a machine which matches either first's pattern or second's
+ * first, second - machines whose patterns are to be or'ed (the | operator)
+ *
+ * Note that first and second are NEITHER destroyed by the operation. Also,
+ * the resulting machine CANNOT be used with any other "mk" operation except
+ * more mkbranch's. Compare with mkor()
+ */
+
+int mkbranch (first, second)
+ int first, second;
+{
+ int eps;
+
+ if (first == NO_TRANSITION)
+ return second;
+
+ else if (second == NO_TRANSITION)
+ return first;
+
+ eps = mkstate (SYM_EPSILON);
+
+ mkxtion (eps, first);
+ mkxtion (eps, second);
+
+ return eps;
+}
+
+
+/* mkclos - convert a machine into a closure
+ *
+ * synopsis
+ * new = mkclos( state );
+ *
+ * new - a new state which matches the closure of "state"
+ */
+
+int mkclos (state)
+ int state;
+{
+ return mkopt (mkposcl (state));
+}
+
+
+/* mkopt - make a machine optional
+ *
+ * synopsis
+ *
+ * new = mkopt( mach );
+ *
+ * new - a machine which optionally matches whatever mach matched
+ * mach - the machine to make optional
+ *
+ * notes:
+ * 1. mach must be the last machine created
+ * 2. mach is destroyed by the call
+ */
+
+int mkopt (mach)
+ int mach;
+{
+ int eps;
+
+ if (!SUPER_FREE_EPSILON (finalst[mach])) {
+ eps = mkstate (SYM_EPSILON);
+ mach = link_machines (mach, eps);
+ }
+
+ /* Can't skimp on the following if FREE_EPSILON(mach) is true because
+ * some state interior to "mach" might point back to the beginning
+ * for a closure.
+ */
+ eps = mkstate (SYM_EPSILON);
+ mach = link_machines (eps, mach);
+
+ mkxtion (mach, finalst[mach]);
+
+ return mach;
+}
+
+
+/* mkor - make a machine that matches either one of two machines
+ *
+ * synopsis
+ *
+ * new = mkor( first, second );
+ *
+ * new - a machine which matches either first's pattern or second's
+ * first, second - machines whose patterns are to be or'ed (the | operator)
+ *
+ * note that first and second are both destroyed by the operation
+ * the code is rather convoluted because an attempt is made to minimize
+ * the number of epsilon states needed
+ */
+
+int mkor (first, second)
+ int first, second;
+{
+ int eps, orend;
+
+ if (first == NIL)
+ return second;
+
+ else if (second == NIL)
+ return first;
+
+ else {
+ /* See comment in mkopt() about why we can't use the first
+ * state of "first" or "second" if they satisfy "FREE_EPSILON".
+ */
+ eps = mkstate (SYM_EPSILON);
+
+ first = link_machines (eps, first);
+
+ mkxtion (first, second);
+
+ if (SUPER_FREE_EPSILON (finalst[first]) &&
+ accptnum[finalst[first]] == NIL) {
+ orend = finalst[first];
+ mkxtion (finalst[second], orend);
+ }
+
+ else if (SUPER_FREE_EPSILON (finalst[second]) &&
+ accptnum[finalst[second]] == NIL) {
+ orend = finalst[second];
+ mkxtion (finalst[first], orend);
+ }
+
+ else {
+ eps = mkstate (SYM_EPSILON);
+
+ first = link_machines (first, eps);
+ orend = finalst[first];
+
+ mkxtion (finalst[second], orend);
+ }
+ }
+
+ finalst[first] = orend;
+ return first;
+}
+
+
+/* mkposcl - convert a machine into a positive closure
+ *
+ * synopsis
+ * new = mkposcl( state );
+ *
+ * new - a machine matching the positive closure of "state"
+ */
+
+int mkposcl (state)
+ int state;
+{
+ int eps;
+
+ if (SUPER_FREE_EPSILON (finalst[state])) {
+ mkxtion (finalst[state], state);
+ return state;
+ }
+
+ else {
+ eps = mkstate (SYM_EPSILON);
+ mkxtion (eps, state);
+ return link_machines (state, eps);
+ }
+}
+
+
+/* mkrep - make a replicated machine
+ *
+ * synopsis
+ * new = mkrep( mach, lb, ub );
+ *
+ * new - a machine that matches whatever "mach" matched from "lb"
+ * number of times to "ub" number of times
+ *
+ * note
+ * if "ub" is INFINITE_REPEAT then "new" matches "lb" or more occurrences of "mach"
+ */
+
+int mkrep (mach, lb, ub)
+ int mach, lb, ub;
+{
+ int base_mach, tail, copy, i;
+
+ base_mach = copysingl (mach, lb - 1);
+
+ if (ub == INFINITE_REPEAT) {
+ copy = dupmachine (mach);
+ mach = link_machines (mach,
+ link_machines (base_mach,
+ mkclos (copy)));
+ }
+
+ else {
+ tail = mkstate (SYM_EPSILON);
+
+ for (i = lb; i < ub; ++i) {
+ copy = dupmachine (mach);
+ tail = mkopt (link_machines (copy, tail));
+ }
+
+ mach =
+ link_machines (mach,
+ link_machines (base_mach, tail));
+ }
+
+ return mach;
+}
+
+
+/* mkstate - create a state with a transition on a given symbol
+ *
+ * synopsis
+ *
+ * state = mkstate( sym );
+ *
+ * state - a new state matching sym
+ * sym - the symbol the new state is to have an out-transition on
+ *
+ * note that this routine makes new states in ascending order through the
+ * state array (and increments LASTNFA accordingly). The routine DUPMACHINE
+ * relies on machines being made in ascending order and that they are
+ * CONTIGUOUS. Change it and you will have to rewrite DUPMACHINE (kludge
+ * that it admittedly is)
+ */
+
+int mkstate (sym)
+ int sym;
+{
+ if (++lastnfa >= current_mns) {
+ if ((current_mns += MNS_INCREMENT) >= maximum_mns)
+ lerr(_
+ ("input rules are too complicated (>= %d NFA states)"),
+current_mns);
+
+ ++num_reallocs;
+
+ firstst = reallocate_integer_array (firstst, current_mns);
+ lastst = reallocate_integer_array (lastst, current_mns);
+ finalst = reallocate_integer_array (finalst, current_mns);
+ transchar =
+ reallocate_integer_array (transchar, current_mns);
+ trans1 = reallocate_integer_array (trans1, current_mns);
+ trans2 = reallocate_integer_array (trans2, current_mns);
+ accptnum =
+ reallocate_integer_array (accptnum, current_mns);
+ assoc_rule =
+ reallocate_integer_array (assoc_rule, current_mns);
+ state_type =
+ reallocate_integer_array (state_type, current_mns);
+ }
+
+ firstst[lastnfa] = lastnfa;
+ finalst[lastnfa] = lastnfa;
+ lastst[lastnfa] = lastnfa;
+ transchar[lastnfa] = sym;
+ trans1[lastnfa] = NO_TRANSITION;
+ trans2[lastnfa] = NO_TRANSITION;
+ accptnum[lastnfa] = NIL;
+ assoc_rule[lastnfa] = num_rules;
+ state_type[lastnfa] = current_state_type;
+
+ /* Fix up equivalence classes base on this transition. Note that any
+ * character which has its own transition gets its own equivalence
+ * class. Thus only characters which are only in character classes
+ * have a chance at being in the same equivalence class. E.g. "a|b"
+ * puts 'a' and 'b' into two different equivalence classes. "[ab]"
+ * puts them in the same equivalence class (barring other differences
+ * elsewhere in the input).
+ */
+
+ if (sym < 0) {
+ /* We don't have to update the equivalence classes since
+ * that was already done when the ccl was created for the
+ * first time.
+ */
+ }
+
+ else if (sym == SYM_EPSILON)
+ ++numeps;
+
+ else {
+ check_char (sym);
+
+ if (useecs)
+ /* Map NUL's to csize. */
+ mkechar (sym ? sym : csize, nextecm, ecgroup);
+ }
+
+ return lastnfa;
+}
+
+
+/* mkxtion - make a transition from one state to another
+ *
+ * synopsis
+ *
+ * mkxtion( statefrom, stateto );
+ *
+ * statefrom - the state from which the transition is to be made
+ * stateto - the state to which the transition is to be made
+ */
+
+void mkxtion (statefrom, stateto)
+ int statefrom, stateto;
+{
+ if (trans1[statefrom] == NO_TRANSITION)
+ trans1[statefrom] = stateto;
+
+ else if ((transchar[statefrom] != SYM_EPSILON) ||
+ (trans2[statefrom] != NO_TRANSITION))
+ flexfatal (_("found too many transitions in mkxtion()"));
+
+ else { /* second out-transition for an epsilon state */
+ ++eps2;
+ trans2[statefrom] = stateto;
+ }
+}
+
+/* new_rule - initialize for a new rule */
+
+void new_rule ()
+{
+ if (++num_rules >= current_max_rules) {
+ ++num_reallocs;
+ current_max_rules += MAX_RULES_INCREMENT;
+ rule_type = reallocate_integer_array (rule_type,
+ current_max_rules);
+ rule_linenum = reallocate_integer_array (rule_linenum,
+ current_max_rules);
+ rule_useful = reallocate_integer_array (rule_useful,
+ current_max_rules);
+ rule_has_nl = reallocate_bool_array (rule_has_nl,
+ current_max_rules);
+ }
+
+ if (num_rules > MAX_RULE)
+ lerr (_("too many rules (> %d)!"), MAX_RULE);
+
+ rule_linenum[num_rules] = linenum;
+ rule_useful[num_rules] = false;
+ rule_has_nl[num_rules] = false;
+}
diff --git a/src/options.c b/src/options.c
new file mode 100644
index 0000000..39d020e
--- /dev/null
+++ b/src/options.c
@@ -0,0 +1,282 @@
+/* flex - tool to generate fast lexical analyzers */
+
+/* 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 "options.h"
+
+/* Be sure to synchronize these options with those defined in "options.h",
+ * the giant switch() statement in "main.c", and the %option processing in
+ * "scan.l".
+ */
+
+
+/* The command-line options, passed to scanopt_init() */
+optspec_t flexopts[] = {
+
+ {"-7", OPT_7BIT, 0}
+ ,
+ {"--7bit", OPT_7BIT, 0}
+ , /* Generate 7-bit scanner. */
+ {"-8", OPT_8BIT, 0}
+ ,
+ {"--8bit", OPT_8BIT, 0}
+ , /* Generate 8-bit scanner. */
+ {"--align", OPT_ALIGN, 0}
+ , /* Trade off larger tables for better memory alignment. */
+ {"--noalign", OPT_NO_ALIGN, 0}
+ ,
+ {"--always-interactive", OPT_ALWAYS_INTERACTIVE, 0}
+ ,
+ {"--array", OPT_ARRAY, 0}
+ ,
+ {"-b", OPT_BACKUP, 0}
+ ,
+ {"--backup", OPT_BACKUP, 0}
+ , /* Generate backing-up information to lex.backup. */
+ {"-B", OPT_BATCH, 0}
+ ,
+ {"--batch", OPT_BATCH, 0}
+ , /* Generate batch scanner (opposite of -I). */
+ {"--bison-bridge", OPT_BISON_BRIDGE, 0}
+ , /* Scanner to be called by a bison pure parser. */
+ {"--bison-locations", OPT_BISON_BRIDGE_LOCATIONS, 0}
+ , /* Scanner to be called by a bison pure parser. */
+ {"-i", OPT_CASE_INSENSITIVE, 0}
+ ,
+ {"--case-insensitive", OPT_CASE_INSENSITIVE, 0}
+ , /* Generate case-insensitive scanner. */
+
+ {"-C[aefFmr]", OPT_COMPRESSION,
+ "Specify degree of table compression (default is -Cem)"},
+ {"-+", OPT_CPLUSPLUS, 0}
+ ,
+ {"--c++", OPT_CPLUSPLUS, 0}
+ , /* Generate C++ scanner class. */
+ {"-d", OPT_DEBUG, 0}
+ ,
+ {"--debug", OPT_DEBUG, 0}
+ , /* Turn on debug mode in generated scanner. */
+ {"--nodebug", OPT_NO_DEBUG, 0}
+ ,
+ {"-s", OPT_NO_DEFAULT, 0}
+ ,
+ {"--nodefault", OPT_NO_DEFAULT, 0}
+ , /* Suppress default rule to ECHO unmatched text. */
+ {"--default", OPT_DEFAULT, 0}
+ ,
+ {"-c", OPT_DONOTHING, 0}
+ , /* For POSIX lex compatibility. */
+ {"-n", OPT_DONOTHING, 0}
+ , /* For POSIX lex compatibility. */
+ {"--ecs", OPT_ECS, 0}
+ , /* Construct equivalence classes. */
+ {"--noecs", OPT_NO_ECS, 0}
+ ,
+ {"-F", OPT_FAST, 0}
+ ,
+ {"--fast", OPT_FAST, 0}
+ , /* Same as -CFr. */
+ {"-f", OPT_FULL, 0}
+ ,
+ {"--full", OPT_FULL, 0}
+ , /* Same as -Cfr. */
+ {"--header-file[=FILE]", OPT_HEADER_FILE, 0}
+ ,
+ {"-?", OPT_HELP, 0}
+ ,
+ {"-h", OPT_HELP, 0}
+ ,
+ {"--help", OPT_HELP, 0}
+ , /* Produce this help message. */
+ {"--hex", OPT_HEX, 0}
+ , /* Use hexadecimals in debug/trace outputs */
+ {"-I", OPT_INTERACTIVE, 0}
+ ,
+ {"--interactive", OPT_INTERACTIVE, 0}
+ , /* Generate interactive scanner (opposite of -B). */
+ {"-l", OPT_LEX_COMPAT, 0}
+ ,
+ {"--lex-compat", OPT_LEX_COMPAT, 0}
+ , /* Maximal compatibility with original lex. */
+ {"-X", OPT_POSIX_COMPAT, 0}
+ ,
+ {"--posix-compat", OPT_POSIX_COMPAT, 0}
+ , /* Maximal compatibility with POSIX lex. */
+ {"--preproc=NUM", OPT_PREPROC_LEVEL, 0}
+ ,
+ {"-L", OPT_NO_LINE, 0}
+ , /* Suppress #line directives in scanner. */
+ {"--noline", OPT_NO_LINE, 0}
+ , /* Suppress #line directives in scanner. */
+ {"--main", OPT_MAIN, 0}
+ , /* use built-in main() function. */
+ {"--nomain", OPT_NO_MAIN, 0}
+ ,
+ {"--meta-ecs", OPT_META_ECS, 0}
+ , /* Construct meta-equivalence classes. */
+ {"--nometa-ecs", OPT_NO_META_ECS, 0}
+ ,
+ {"--never-interactive", OPT_NEVER_INTERACTIVE, 0}
+ ,
+ {"-o FILE", OPT_OUTFILE, 0}
+ ,
+ {"--outfile=FILE", OPT_OUTFILE, 0}
+ , /* Write to FILE (default is lex.yy.c) */
+ {"-p", OPT_PERF_REPORT, 0}
+ ,
+ {"--perf-report", OPT_PERF_REPORT, 0}
+ , /* Generate performance report to stderr. */
+ {"--pointer", OPT_POINTER, 0}
+ ,
+ {"-P PREFIX", OPT_PREFIX, 0}
+ ,
+ {"--prefix=PREFIX", OPT_PREFIX, 0}
+ , /* Use PREFIX (default is yy) */
+ {"-Dmacro", OPT_PREPROCDEFINE, 0}
+ , /* Define a preprocessor symbol. */
+ {"--read", OPT_READ, 0}
+ , /* Use read(2) instead of stdio. */
+ {"-R", OPT_REENTRANT, 0}
+ ,
+ {"--reentrant", OPT_REENTRANT, 0}
+ , /* Generate a reentrant C scanner. */
+ {"--noreentrant", OPT_NO_REENTRANT, 0}
+ ,
+ {"--reject", OPT_REJECT, 0}
+ ,
+ {"--noreject", OPT_NO_REJECT, 0}
+ ,
+ {"-S FILE", OPT_SKEL, 0}
+ ,
+ {"--skel=FILE", OPT_SKEL, 0}
+ , /* Use skeleton from FILE */
+ {"--stack", OPT_STACK, 0}
+ ,
+ {"--stdinit", OPT_STDINIT, 0}
+ ,
+ {"--nostdinit", OPT_NO_STDINIT, 0}
+ ,
+ {"-t", OPT_STDOUT, 0}
+ ,
+ {"--stdout", OPT_STDOUT, 0}
+ , /* Write generated scanner to stdout. */
+ {"-T", OPT_TRACE, 0}
+ ,
+ {"--trace", OPT_TRACE, 0}
+ , /* Flex should run in trace mode. */
+ {"--tables-file[=FILE]", OPT_TABLES_FILE, 0}
+ , /* Save tables to FILE */
+ {"--tables-verify", OPT_TABLES_VERIFY, 0}
+ , /* Tables integrity check */
+ {"--nounistd", OPT_NO_UNISTD_H, 0}
+ , /* Do not include unistd.h */
+ {"-v", OPT_VERBOSE, 0}
+ ,
+ {"--verbose", OPT_VERBOSE, 0}
+ , /* Write summary of scanner statistics to stdout. */
+ {"-V", OPT_VERSION, 0}
+ ,
+ {"--version", OPT_VERSION, 0}
+ , /* Report flex version. */
+ {"--warn", OPT_WARN, 0}
+ ,
+ {"-w", OPT_NO_WARN, 0}
+ ,
+ {"--nowarn", OPT_NO_WARN, 0}
+ , /* Suppress warning messages. */
+ {"--noansi-definitions", OPT_NO_ANSI_FUNC_DEFS, 0}
+ ,
+ {"--noansi-prototypes", OPT_NO_ANSI_FUNC_PROTOS, 0}
+ ,
+ {"--yyclass=NAME", OPT_YYCLASS, 0}
+ ,
+ {"--yylineno", OPT_YYLINENO, 0}
+ ,
+ {"--noyylineno", OPT_NO_YYLINENO, 0}
+ ,
+
+ {"--yymore", OPT_YYMORE, 0}
+ ,
+ {"--noyymore", OPT_NO_YYMORE, 0}
+ ,
+ {"--noyywrap", OPT_NO_YYWRAP, 0}
+ ,
+ {"--yywrap", OPT_YYWRAP, 0}
+ ,
+
+ {"--nounput", OPT_NO_UNPUT, 0}
+ ,
+ {"--noyy_push_state", OPT_NO_YY_PUSH_STATE, 0}
+ ,
+ {"--noyy_pop_state", OPT_NO_YY_POP_STATE, 0}
+ ,
+ {"--noyy_top_state", OPT_NO_YY_TOP_STATE, 0}
+ ,
+ {"--noyy_scan_buffer", OPT_NO_YY_SCAN_BUFFER, 0}
+ ,
+ {"--noyy_scan_bytes", OPT_NO_YY_SCAN_BYTES, 0}
+ ,
+ {"--noyy_scan_string", OPT_NO_YY_SCAN_STRING, 0}
+ ,
+ {"--noyyget_extra", OPT_NO_YYGET_EXTRA, 0}
+ ,
+ {"--noyyset_extra", OPT_NO_YYSET_EXTRA, 0}
+ ,
+ {"--noyyget_leng", OPT_NO_YYGET_LENG, 0}
+ ,
+ {"--noyyget_text", OPT_NO_YYGET_TEXT, 0}
+ ,
+ {"--noyyget_lineno", OPT_NO_YYGET_LINENO, 0}
+ ,
+ {"--noyyset_lineno", OPT_NO_YYSET_LINENO, 0}
+ ,
+ {"--noyyget_in", OPT_NO_YYGET_IN, 0}
+ ,
+ {"--noyyset_in", OPT_NO_YYSET_IN, 0}
+ ,
+ {"--noyyget_out", OPT_NO_YYGET_OUT, 0}
+ ,
+ {"--noyyset_out", OPT_NO_YYSET_OUT, 0}
+ ,
+ {"--noyyget_lval", OPT_NO_YYGET_LVAL, 0}
+ ,
+ {"--noyyset_lval", OPT_NO_YYSET_LVAL, 0}
+ ,
+ {"--noyyget_lloc", OPT_NO_YYGET_LLOC, 0}
+ ,
+ {"--noyyset_lloc", OPT_NO_YYSET_LLOC, 0}
+ ,
+
+ {0, 0, 0} /* required final NULL entry. */
+};
+
+/* vim:set tabstop=8 softtabstop=4 shiftwidth=4: */
diff --git a/src/options.h b/src/options.h
new file mode 100644
index 0000000..ac3391c
--- /dev/null
+++ b/src/options.h
@@ -0,0 +1,135 @@
+/* flex - tool to generate fast lexical analyzers */
+
+/* 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. */
+
+#ifndef OPTIONS_H
+#define OPTIONS_H
+#include "scanopt.h"
+
+extern optspec_t flexopts[];
+
+enum flexopt_flag_t {
+ /* Use positive integers only, since they are return codes for scanopt.
+ * Order is not important. */
+ OPT_7BIT = 1,
+ OPT_8BIT,
+ OPT_ALIGN,
+ OPT_ALWAYS_INTERACTIVE,
+ OPT_ARRAY,
+ OPT_BACKUP,
+ OPT_BATCH,
+ OPT_BISON_BRIDGE,
+ OPT_BISON_BRIDGE_LOCATIONS,
+ OPT_CASE_INSENSITIVE,
+ OPT_COMPRESSION,
+ OPT_CPLUSPLUS,
+ OPT_DEBUG,
+ OPT_DEFAULT,
+ OPT_DONOTHING,
+ OPT_ECS,
+ OPT_FAST,
+ OPT_FULL,
+ OPT_HEADER_FILE,
+ OPT_HELP,
+ OPT_HEX,
+ OPT_INTERACTIVE,
+ OPT_LEX_COMPAT,
+ OPT_POSIX_COMPAT,
+ OPT_MAIN,
+ OPT_META_ECS,
+ OPT_NEVER_INTERACTIVE,
+ OPT_NO_ALIGN,
+ OPT_NO_ANSI_FUNC_DEFS,
+ OPT_NO_ANSI_FUNC_PROTOS,
+ OPT_NO_DEBUG,
+ OPT_NO_DEFAULT,
+ OPT_NO_ECS,
+ OPT_NO_LINE,
+ OPT_NO_MAIN,
+ OPT_NO_META_ECS,
+ OPT_NO_REENTRANT,
+ OPT_NO_REJECT,
+ OPT_NO_STDINIT,
+ OPT_NO_UNPUT,
+ OPT_NO_WARN,
+ OPT_NO_YYGET_EXTRA,
+ OPT_NO_YYGET_IN,
+ OPT_NO_YYGET_LENG,
+ OPT_NO_YYGET_LINENO,
+ OPT_NO_YYGET_LLOC,
+ OPT_NO_YYGET_LVAL,
+ OPT_NO_YYGET_OUT,
+ OPT_NO_YYGET_TEXT,
+ OPT_NO_YYLINENO,
+ OPT_NO_YYMORE,
+ OPT_NO_YYSET_EXTRA,
+ OPT_NO_YYSET_IN,
+ OPT_NO_YYSET_LINENO,
+ OPT_NO_YYSET_LLOC,
+ OPT_NO_YYSET_LVAL,
+ OPT_NO_YYSET_OUT,
+ OPT_NO_YYWRAP,
+ OPT_NO_YY_POP_STATE,
+ OPT_NO_YY_PUSH_STATE,
+ OPT_NO_YY_SCAN_BUFFER,
+ OPT_NO_YY_SCAN_BYTES,
+ OPT_NO_YY_SCAN_STRING,
+ OPT_NO_YY_TOP_STATE,
+ OPT_OUTFILE,
+ OPT_PERF_REPORT,
+ OPT_POINTER,
+ OPT_PREFIX,
+ OPT_PREPROCDEFINE,
+ OPT_PREPROC_LEVEL,
+ OPT_READ,
+ OPT_REENTRANT,
+ OPT_REJECT,
+ OPT_SKEL,
+ OPT_STACK,
+ OPT_STDINIT,
+ OPT_STDOUT,
+ OPT_TABLES_FILE,
+ OPT_TABLES_VERIFY,
+ OPT_TRACE,
+ OPT_NO_UNISTD_H,
+ OPT_VERBOSE,
+ OPT_VERSION,
+ OPT_WARN,
+ OPT_YYCLASS,
+ OPT_YYLINENO,
+ OPT_YYMORE,
+ OPT_YYWRAP
+};
+
+#endif
+
+/* vim:set tabstop=8 softtabstop=4 shiftwidth=4 textwidth=0: */
diff --git a/src/parse.y b/src/parse.y
new file mode 100644
index 0000000..939cc05
--- /dev/null
+++ b/src/parse.y
@@ -0,0 +1,1090 @@
+/* parse.y - parser for flex input */
+
+%token CHAR NUMBER SECTEND SCDECL XSCDECL NAME PREVCCL EOF_OP
+%token OPTION_OP OPT_OUTFILE OPT_PREFIX OPT_YYCLASS OPT_HEADER OPT_EXTRA_TYPE
+%token OPT_TABLES
+
+%token CCE_ALNUM CCE_ALPHA CCE_BLANK CCE_CNTRL CCE_DIGIT CCE_GRAPH
+%token CCE_LOWER CCE_PRINT CCE_PUNCT CCE_SPACE CCE_UPPER CCE_XDIGIT
+
+%token CCE_NEG_ALNUM CCE_NEG_ALPHA CCE_NEG_BLANK CCE_NEG_CNTRL CCE_NEG_DIGIT CCE_NEG_GRAPH
+%token CCE_NEG_LOWER CCE_NEG_PRINT CCE_NEG_PUNCT CCE_NEG_SPACE CCE_NEG_UPPER CCE_NEG_XDIGIT
+
+%left CCL_OP_DIFF CCL_OP_UNION
+
+/*
+ *POSIX and AT&T lex place the
+ * precedence of the repeat operator, {}, below that of concatenation.
+ * Thus, ab{3} is ababab. Most other POSIX utilities use an Extended
+ * Regular Expression (ERE) precedence that has the repeat operator
+ * higher than concatenation. This causes ab{3} to yield abbb.
+ *
+ * In order to support the POSIX and AT&T precedence and the flex
+ * precedence we define two token sets for the begin and end tokens of
+ * the repeat operator, '{' and '}'. The lexical scanner chooses
+ * which tokens to return based on whether posix_compat or lex_compat
+ * are specified. Specifying either posix_compat or lex_compat will
+ * cause flex to parse scanner files as per the AT&T and
+ * POSIX-mandated behavior.
+ */
+
+%token BEGIN_REPEAT_POSIX END_REPEAT_POSIX BEGIN_REPEAT_FLEX END_REPEAT_FLEX
+
+
+%{
+/* 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
+
+%}
+
+%%
+goal : initlex sect1 sect1end sect2 initforrule
+ { /* 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" );
+ }
+ ;
+
+initlex :
+ { /* initialize for processing rules */
+
+ /* Create default DFA start condition. */
+ scinstal( "INITIAL", false );
+ }
+ ;
+
+sect1 : sect1 startconddecl namelist1
+ | sect1 options
+ |
+ | error
+ { synerr( _("unknown error processing section 1") ); }
+ ;
+
+sect1end : SECTEND
+ {
+ check_options();
+ scon_stk = allocate_integer_array( lastsc + 1 );
+ scon_stk_ptr = 0;
+ }
+ ;
+
+startconddecl : SCDECL
+ { xcluflg = false; }
+
+ | XSCDECL
+ { xcluflg = true; }
+ ;
+
+namelist1 : namelist1 NAME
+ { scinstal( nmstr, xcluflg ); }
+
+ | NAME
+ { scinstal( nmstr, xcluflg ); }
+
+ | error
+ { synerr( _("bad start condition list") ); }
+ ;
+
+options : OPTION_OP optionlist
+ ;
+
+optionlist : optionlist option
+ |
+ ;
+
+option : OPT_OUTFILE '=' NAME
+ {
+ outfilename = copy_string( nmstr );
+ did_outfilename = 1;
+ }
+ | OPT_EXTRA_TYPE '=' NAME
+ { extra_type = copy_string( nmstr ); }
+ | OPT_PREFIX '=' NAME
+ { prefix = copy_string( nmstr ); }
+ | OPT_YYCLASS '=' NAME
+ { yyclass = copy_string( nmstr ); }
+ | OPT_HEADER '=' NAME
+ { headerfilename = copy_string( nmstr ); }
+ | OPT_TABLES '=' NAME
+ { tablesext = true; tablesfilename = copy_string( nmstr ); }
+ ;
+
+sect2 : sect2 scon initforrule flexrule '\n'
+ { scon_stk_ptr = $2; }
+ | sect2 scon '{' sect2 '}'
+ { scon_stk_ptr = $2; }
+ |
+ ;
+
+initforrule :
+ {
+ /* 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();
+ }
+ ;
+
+flexrule : '^' rule
+ {
+ pat = $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" );
+ }
+ }
+
+ | rule
+ {
+ pat = $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 );
+ }
+ }
+
+ | EOF_OP
+ {
+ 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();
+ }
+ }
+
+ | error
+ { synerr( _("unrecognized rule") ); }
+ ;
+
+scon_stk_ptr :
+ { $$ = scon_stk_ptr; }
+ ;
+
+scon : '<' scon_stk_ptr namelist2 '>'
+ { $$ = $2; }
+
+ | '<' '*' '>'
+ {
+ $$ = 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;
+ }
+ }
+
+ |
+ { $$ = scon_stk_ptr; }
+ ;
+
+namelist2 : namelist2 ',' sconname
+
+ | sconname
+
+ | error
+ { synerr( _("bad start condition list") ); }
+ ;
+
+sconname : NAME
+ {
+ 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;
+ }
+ }
+ ;
+
+rule : re2 re
+ {
+ if ( transchar[lastst[$2]] != SYM_EPSILON )
+ /* Provide final transition \now/ so it
+ * will be marked as a trailing context
+ * state.
+ */
+ $2 = link_machines( $2,
+ mkstate( SYM_EPSILON ) );
+
+ mark_beginning_as_normal( $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( $1,
+ num_rules | YY_TRAILING_HEAD_MASK );
+ variable_trail_rule = true;
+ }
+
+ else
+ trailcnt = rulelen;
+
+ $$ = link_machines( $1, $2 );
+ }
+
+ | re2 re '$'
+ { synerr( _("trailing context used twice") ); }
+
+ | re '$'
+ {
+ headcnt = 0;
+ trailcnt = 1;
+ rulelen = 1;
+ varlength = false;
+
+ current_state_type = STATE_TRAILING_CONTEXT;
+
+ if ( trlcontxt )
+ {
+ synerr( _("trailing context used twice") );
+ $$ = 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( $1,
+ num_rules | YY_TRAILING_HEAD_MASK );
+ variable_trail_rule = true;
+ }
+
+ trlcontxt = true;
+
+ eps = mkstate( SYM_EPSILON );
+ $$ = link_machines( $1,
+ link_machines( eps, mkstate( '\n' ) ) );
+ }
+
+ | re
+ {
+ $$ = $1;
+
+ if ( trlcontxt )
+ {
+ if ( lex_compat || (varlength && headcnt == 0) )
+ /* Both head and trail are
+ * variable-length.
+ */
+ variable_trail_rule = true;
+ else
+ trailcnt = rulelen;
+ }
+ }
+ ;
+
+
+re : re '|' series
+ {
+ varlength = true;
+ $$ = mkor( $1, $3 );
+ }
+
+ | series
+ { $$ = $1; }
+ ;
+
+
+re2 : re '/'
+ {
+ /* 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;
+ $$ = $1;
+ }
+ ;
+
+series : series singleton
+ {
+ /* This is where concatenation of adjacent patterns
+ * gets done.
+ */
+ $$ = link_machines( $1, $2 );
+ }
+
+ | singleton
+ { $$ = $1; }
+
+ | series BEGIN_REPEAT_POSIX NUMBER ',' NUMBER END_REPEAT_POSIX
+ {
+ varlength = true;
+
+ if ( $3 > $5 || $3 < 0 )
+ {
+ synerr( _("bad iteration values") );
+ $$ = $1;
+ }
+ else
+ {
+ if ( $3 == 0 )
+ {
+ if ( $5 <= 0 )
+ {
+ synerr(
+ _("bad iteration values") );
+ $$ = $1;
+ }
+ else
+ $$ = mkopt(
+ mkrep( $1, 1, $5 ) );
+ }
+ else
+ $$ = mkrep( $1, $3, $5 );
+ }
+ }
+
+ | series BEGIN_REPEAT_POSIX NUMBER ',' END_REPEAT_POSIX
+ {
+ varlength = true;
+
+ if ( $3 <= 0 )
+ {
+ synerr( _("iteration value must be positive") );
+ $$ = $1;
+ }
+
+ else
+ $$ = mkrep( $1, $3, INFINITE_REPEAT );
+ }
+
+ | series BEGIN_REPEAT_POSIX NUMBER END_REPEAT_POSIX
+ {
+ /* 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 ( $3 <= 0 )
+ {
+ synerr( _("iteration value must be positive")
+ );
+ $$ = $1;
+ }
+
+ else
+ $$ = link_machines( $1,
+ copysingl( $1, $3 - 1 ) );
+ }
+
+ ;
+
+singleton : singleton '*'
+ {
+ varlength = true;
+
+ $$ = mkclos( $1 );
+ }
+
+ | singleton '+'
+ {
+ varlength = true;
+ $$ = mkposcl( $1 );
+ }
+
+ | singleton '?'
+ {
+ varlength = true;
+ $$ = mkopt( $1 );
+ }
+
+ | singleton BEGIN_REPEAT_FLEX NUMBER ',' NUMBER END_REPEAT_FLEX
+ {
+ varlength = true;
+
+ if ( $3 > $5 || $3 < 0 )
+ {
+ synerr( _("bad iteration values") );
+ $$ = $1;
+ }
+ else
+ {
+ if ( $3 == 0 )
+ {
+ if ( $5 <= 0 )
+ {
+ synerr(
+ _("bad iteration values") );
+ $$ = $1;
+ }
+ else
+ $$ = mkopt(
+ mkrep( $1, 1, $5 ) );
+ }
+ else
+ $$ = mkrep( $1, $3, $5 );
+ }
+ }
+
+ | singleton BEGIN_REPEAT_FLEX NUMBER ',' END_REPEAT_FLEX
+ {
+ varlength = true;
+
+ if ( $3 <= 0 )
+ {
+ synerr( _("iteration value must be positive") );
+ $$ = $1;
+ }
+
+ else
+ $$ = mkrep( $1, $3, INFINITE_REPEAT );
+ }
+
+ | singleton BEGIN_REPEAT_FLEX NUMBER END_REPEAT_FLEX
+ {
+ /* 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 ( $3 <= 0 )
+ {
+ synerr( _("iteration value must be positive") );
+ $$ = $1;
+ }
+
+ else
+ $$ = link_machines( $1,
+ copysingl( $1, $3 - 1 ) );
+ }
+
+ | '.'
+ {
+ 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())
+ $$ = mkstate( -cclany );
+ else
+ $$ = mkstate( -ccldot );
+ }
+
+ | fullccl
+ {
+ /* Sort characters for fast searching.
+ */
+ qsort( ccltbl + cclmap[$1], ccllen[$1], sizeof (*ccltbl), cclcmp );
+
+ if ( useecs )
+ mkeccl( ccltbl + cclmap[$1], ccllen[$1],
+ nextecm, ecgroup, csize, csize );
+
+ ++rulelen;
+
+ if (ccl_has_nl[$1])
+ rule_has_nl[num_rules] = true;
+
+ $$ = mkstate( -$1 );
+ }
+
+ | PREVCCL
+ {
+ ++rulelen;
+
+ if (ccl_has_nl[$1])
+ rule_has_nl[num_rules] = true;
+
+ $$ = mkstate( -$1 );
+ }
+
+ | '"' string '"'
+ { $$ = $2; }
+
+ | '(' re ')'
+ { $$ = $2; }
+
+ | CHAR
+ {
+ ++rulelen;
+
+ if ($1 == nlch)
+ rule_has_nl[num_rules] = true;
+
+ if (sf_case_ins() && has_case($1))
+ /* create an alternation, as in (a|A) */
+ $$ = mkor (mkstate($1), mkstate(reverse_case($1)));
+ else
+ $$ = mkstate( $1 );
+ }
+ ;
+fullccl:
+ fullccl CCL_OP_DIFF braceccl { $$ = ccl_set_diff ($1, $3); }
+ | fullccl CCL_OP_UNION braceccl { $$ = ccl_set_union ($1, $3); }
+ | braceccl
+ ;
+
+braceccl:
+
+ '[' ccl ']' { $$ = $2; }
+
+ | '[' '^' ccl ']'
+ {
+ cclnegate( $3 );
+ $$ = $3;
+ }
+ ;
+
+ccl : ccl CHAR '-' CHAR
+ {
+
+ 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 ($2) != has_case ($4)
+ || (has_case ($2) && (b_islower ($2) != b_islower ($4)))
+ || (has_case ($2) && (b_isupper ($2) != b_isupper ($4))))
+ format_warn3 (
+ _("the character range [%c-%c] is ambiguous in a case-insensitive scanner"),
+ $2, $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 ($2) && !has_case ($4) && !range_covers_case ($2, $4))
+ format_warn3 (
+ _("the character range [%c-%c] is ambiguous in a case-insensitive scanner"),
+ $2, $4);
+ }
+
+ if ( $2 > $4 )
+ synerr( _("negative range in character class") );
+
+ else
+ {
+ for ( i = $2; i <= $4; ++i )
+ ccladd( $1, i );
+
+ /* Keep track if this ccl is staying in
+ * alphabetical order.
+ */
+ cclsorted = cclsorted && ($2 > lastchar);
+ lastchar = $4;
+
+ /* Do it again for upper/lowercase */
+ if (sf_case_ins() && has_case($2) && has_case($4)){
+ $2 = reverse_case ($2);
+ $4 = reverse_case ($4);
+
+ for ( i = $2; i <= $4; ++i )
+ ccladd( $1, i );
+
+ cclsorted = cclsorted && ($2 > lastchar);
+ lastchar = $4;
+ }
+
+ }
+
+ $$ = $1;
+ }
+
+ | ccl CHAR
+ {
+ ccladd( $1, $2 );
+ cclsorted = cclsorted && ($2 > lastchar);
+ lastchar = $2;
+
+ /* Do it again for upper/lowercase */
+ if (sf_case_ins() && has_case($2)){
+ $2 = reverse_case ($2);
+ ccladd ($1, $2);
+
+ cclsorted = cclsorted && ($2 > lastchar);
+ lastchar = $2;
+ }
+
+ $$ = $1;
+ }
+
+ | ccl ccl_expr
+ {
+ /* Too hard to properly maintain cclsorted. */
+ cclsorted = false;
+ $$ = $1;
+ }
+
+ |
+ {
+ cclsorted = true;
+ lastchar = 0;
+ currccl = $$ = cclinit();
+ }
+ ;
+
+ccl_expr:
+ CCE_ALNUM { CCL_EXPR(isalnum); }
+ | CCE_ALPHA { CCL_EXPR(isalpha); }
+ | CCE_BLANK { CCL_EXPR(IS_BLANK); }
+ | CCE_CNTRL { CCL_EXPR(iscntrl); }
+ | CCE_DIGIT { CCL_EXPR(isdigit); }
+ | CCE_GRAPH { CCL_EXPR(isgraph); }
+ | CCE_LOWER {
+ CCL_EXPR(islower);
+ if (sf_case_ins())
+ CCL_EXPR(isupper);
+ }
+ | CCE_PRINT { CCL_EXPR(isprint); }
+ | CCE_PUNCT { CCL_EXPR(ispunct); }
+ | CCE_SPACE { CCL_EXPR(isspace); }
+ | CCE_XDIGIT { CCL_EXPR(isxdigit); }
+ | CCE_UPPER {
+ CCL_EXPR(isupper);
+ if (sf_case_ins())
+ CCL_EXPR(islower);
+ }
+
+ | CCE_NEG_ALNUM { CCL_NEG_EXPR(isalnum); }
+ | CCE_NEG_ALPHA { CCL_NEG_EXPR(isalpha); }
+ | CCE_NEG_BLANK { CCL_NEG_EXPR(IS_BLANK); }
+ | CCE_NEG_CNTRL { CCL_NEG_EXPR(iscntrl); }
+ | CCE_NEG_DIGIT { CCL_NEG_EXPR(isdigit); }
+ | CCE_NEG_GRAPH { CCL_NEG_EXPR(isgraph); }
+ | CCE_NEG_PRINT { CCL_NEG_EXPR(isprint); }
+ | CCE_NEG_PUNCT { CCL_NEG_EXPR(ispunct); }
+ | CCE_NEG_SPACE { CCL_NEG_EXPR(isspace); }
+ | CCE_NEG_XDIGIT { CCL_NEG_EXPR(isxdigit); }
+ | CCE_NEG_LOWER {
+ if ( sf_case_ins() )
+ warn(_("[:^lower:] is ambiguous in case insensitive scanner"));
+ else
+ CCL_NEG_EXPR(islower);
+ }
+ | CCE_NEG_UPPER {
+ if ( sf_case_ins() )
+ warn(_("[:^upper:] ambiguous in case insensitive scanner"));
+ else
+ CCL_NEG_EXPR(isupper);
+ }
+ ;
+
+string : string CHAR
+ {
+ if ( $2 == nlch )
+ rule_has_nl[num_rules] = true;
+
+ ++rulelen;
+
+ if (sf_case_ins() && has_case($2))
+ $$ = mkor (mkstate($2), mkstate(reverse_case($2)));
+ else
+ $$ = mkstate ($2);
+
+ $$ = link_machines( $1, $$);
+ }
+
+ |
+ { $$ = mkstate( SYM_EPSILON ); }
+ ;
+
+%%
+
+
+/* build_eof_action - build the "<<EOF>>" action for the active start
+ * conditions
+ */
+
+void build_eof_action()
+ {
+ 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;
+ {
+ (void)msg;
+ }
diff --git a/src/regex.c b/src/regex.c
new file mode 100644
index 0000000..2bb580e
--- /dev/null
+++ b/src/regex.c
@@ -0,0 +1,171 @@
+/** regex - regular expression functions related to POSIX regex lib. */
+
+/* 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"
+
+
+static const char* REGEXP_LINEDIR = "^#line ([[:digit:]]+) \"(.*)\"";
+static const char* REGEXP_BLANK_LINE = "^[[:space:]]*$";
+
+regex_t regex_linedir; /**< matches line directives */
+regex_t regex_blank_line; /**< matches blank lines */
+
+
+/** Initialize the regular expressions.
+ * @return true upon success.
+ */
+bool flex_init_regex(void)
+{
+ flex_regcomp(&regex_linedir, REGEXP_LINEDIR, REG_EXTENDED);
+ flex_regcomp(&regex_blank_line, REGEXP_BLANK_LINE, REG_EXTENDED);
+
+ return true;
+}
+
+/** Compiles a regular expression or dies trying.
+ * @param preg Same as for regcomp().
+ * @param regex Same as for regcomp().
+ * @param cflags Same as for regcomp().
+ */
+void flex_regcomp(regex_t *preg, const char *regex, int cflags)
+{
+ int err;
+
+ memset (preg, 0, sizeof (regex_t));
+
+ if ((err = regcomp (preg, regex, cflags)) != 0) {
+ const int errbuf_sz = 200;
+ char *errbuf, *rxerr;
+
+ errbuf = (char*)flex_alloc(errbuf_sz *sizeof(char));
+ if (!errbuf)
+ flexfatal(_("Unable to allocate buffer to report regcomp"));
+ rxerr = (char*)flex_alloc(errbuf_sz *sizeof(char));
+ if (!rxerr)
+ flexfatal(_("Unable to allocate buffer for regerror"));
+ regerror (err, preg, rxerr, errbuf_sz);
+ snprintf (errbuf, errbuf_sz, "regcomp for \"%s\" failed: %s", regex, rxerr);
+
+ flexfatal (errbuf);
+ free(errbuf);
+ free(rxerr);
+ }
+}
+
+/** Extract a copy of the match, or NULL if no match.
+ * @param m A match as returned by regexec().
+ * @param src The source string that was passed to regexec().
+ * @return The allocated string.
+ */
+char *regmatch_dup (regmatch_t * m, const char *src)
+{
+ char *str;
+ int len;
+
+ if (m == NULL || m->rm_so < 0)
+ return NULL;
+ len = m->rm_eo - m->rm_so;
+ str = (char *) flex_alloc ((len + 1) * sizeof (char));
+ if (!str)
+ flexfatal(_("Unable to allocate a copy of the match"));
+ strncpy (str, src + m->rm_so, len);
+ str[len] = 0;
+ return str;
+}
+
+/** Copy the match.
+ * @param m A match as returned by regexec().
+ * @param dest The destination buffer.
+ * @param src The source string that was passed to regexec().
+ * @return dest
+ */
+char *regmatch_cpy (regmatch_t * m, char *dest, const char *src)
+{
+ if (m == NULL || m->rm_so < 0) {
+ if (dest)
+ dest[0] = '\0';
+ return dest;
+ }
+
+ snprintf (dest, regmatch_len(m), "%s", src + m->rm_so);
+ return dest;
+}
+
+/** Get the length in characters of the match.
+ * @param m A match as returned by regexec().
+ * @return The length of the match.
+ */
+int regmatch_len (regmatch_t * m)
+{
+ if (m == NULL || m->rm_so < 0) {
+ return 0;
+ }
+
+ return m->rm_eo - m->rm_so;
+}
+
+
+
+/** Convert a regmatch_t object to an integer using the strtol() function.
+ * @param m A match as returned by regexec().
+ * @param src The source string that was passed to regexec().
+ * @param endptr Same as the second argument to strtol().
+ * @param base Same as the third argument to strtol().
+ * @return The converted integer or error (Return value is the same as for strtol()).
+ */
+int regmatch_strtol (regmatch_t * m, const char *src, char **endptr,
+ int base)
+{
+ int n = 0;
+
+#define bufsz 20
+ char buf[bufsz];
+ char *s;
+
+ if (m == NULL || m->rm_so < 0)
+ return 0;
+
+ if (regmatch_len (m) < bufsz)
+ s = regmatch_cpy (m, buf, src);
+ else
+ s = regmatch_dup (m, src);
+
+ n = strtol (s, endptr, base);
+
+ if (s != buf)
+ free (s);
+
+ return n;
+}
+
+/** Check for empty or non-existent match.
+ * @param m A match as returned by regexec().
+ * @return false if match length is non-zero.
+ * Note that reg_empty returns true even if match did not occur at all.
+ */
+bool regmatch_empty (regmatch_t * m)
+{
+ return (m == NULL || m->rm_so < 0 || m->rm_so == m->rm_eo);
+}
+
+/* vim:set expandtab cindent tabstop=4 softtabstop=4 shiftwidth=4 textwidth=0: */
diff --git a/src/scan.l b/src/scan.l
new file mode 100644
index 0000000..9eb857a
--- /dev/null
+++ b/src/scan.l
@@ -0,0 +1,1029 @@
+/* scan.l - scanner for flex input -*-C-*- */
+
+%{
+/* 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) \
+ { \
+ strcpy( nmstr, yytext ); \
+ } \
+ 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;
+
+%}
+
+%option caseless nodefault noreject stack noyy_top_state
+%option nostdinit
+
+%x SECT2 SECT2PROLOG SECT3 CODEBLOCK PICKUPDEF SC CARETISBOL NUM QUOTE
+%x FIRSTCCL CCL ACTION RECOVER COMMENT ACTION_STRING PERCENT_BRACE_ACTION
+%x OPTION LINEDIR CODEBLOCK_MATCH_BRACE
+%x GROUP_WITH_PARAMS
+%x GROUP_MINUS_PARAMS
+%x EXTENDED_COMMENT
+%x COMMENT_DISCARD
+
+WS [[:blank:]]+
+OPTWS [[:blank:]]*
+NOT_WS [^[:blank:]\r\n]
+
+NL \r?\n
+
+NAME ([[:alpha:]_][[:alnum:]_-]*)
+NOT_NAME [^[:alpha:]_*\n]+
+
+SCNAME {NAME}
+
+ESCSEQ (\\([^\n]|[0-7]{1,3}|x[[:xdigit:]]{1,2}))
+
+FIRST_CCL_CHAR ([^\\\n]|{ESCSEQ})
+CCL_CHAR ([^\\\n\]]|{ESCSEQ})
+CCL_EXPR ("[:"^?[[:alpha:]]+":]")
+
+LEXOPT [aceknopr]
+
+M4QSTART "[["
+M4QEND "]]"
+
+%%
+ 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];
+
+
+<INITIAL>{
+ ^{WS} indented_code = true; BEGIN(CODEBLOCK);
+ ^"/*" ACTION_ECHO; yy_push_state( COMMENT );
+ ^#{OPTWS}line{WS} yy_push_state( LINEDIR );
+ ^"%s"{NAME}? return SCDECL;
+ ^"%x"{NAME}? return XSCDECL;
+ ^"%{".*{NL} {
+ ++linenum;
+ line_directive_out( (FILE *) 0, 1 );
+ indented_code = false;
+ BEGIN(CODEBLOCK);
+ }
+ ^"%top"[[:blank:]]*"{"[[:blank:]]*{NL} {
+ brace_start_line = linenum;
+ ++linenum;
+ buf_linedir( &top_buf, infilename?infilename:"<stdin>", linenum);
+ brace_depth = 1;
+ yy_push_state(CODEBLOCK_MATCH_BRACE);
+ }
+
+ ^"%top".* synerr( _("malformed '%top' directive") );
+
+ {WS} /* discard */
+
+ ^"%%".* {
+ sectnum = 2;
+ bracelevel = 0;
+ mark_defs1();
+ line_directive_out( (FILE *) 0, 1 );
+ BEGIN(SECT2PROLOG);
+ return SECTEND;
+ }
+
+ ^"%pointer".*{NL} yytext_is_array = false; ++linenum;
+ ^"%array".*{NL} yytext_is_array = true; ++linenum;
+
+ ^"%option" BEGIN(OPTION); return OPTION_OP;
+
+ ^"%"{LEXOPT}{OPTWS}[[:digit:]]*{OPTWS}{NL} ++linenum; /* ignore */
+ ^"%"{LEXOPT}{WS}.*{NL} ++linenum; /* ignore */
+
+ /* xgettext: no-c-format */
+ ^"%"[^sxaceknopr{}].* synerr( _( "unrecognized '%' directive" ) );
+
+ ^{NAME} {
+ if(yyleng < MAXLINE)
+ {
+ strcpy( nmstr, yytext );
+ }
+ else
+ {
+ synerr( _("Definition name too long\n"));
+ FLEX_EXIT(EXIT_FAILURE);
+ }
+
+ didadef = false;
+ BEGIN(PICKUPDEF);
+ }
+
+ {SCNAME} RETURNNAME;
+ ^{OPTWS}{NL} ++linenum; /* allows blank lines in section 1 */
+ {OPTWS}{NL} ACTION_ECHO; ++linenum; /* maybe end of comment line */
+}
+
+
+<COMMENT>{
+ "*/" ACTION_ECHO; yy_pop_state();
+ "*" ACTION_ECHO;
+ {M4QSTART} ACTION_ECHO_QSTART;
+ {M4QEND} ACTION_ECHO_QEND;
+ [^*\n] ACTION_ECHO;
+ {NL} ++linenum; ACTION_ECHO;
+}
+
+<COMMENT_DISCARD>{
+ /* This is the same as COMMENT, but is discarded rather than output. */
+ "*/" yy_pop_state();
+ "*" ;
+ [^*\n] ;
+ {NL} ++linenum;
+}
+
+<EXTENDED_COMMENT>{
+ ")" yy_pop_state();
+ [^\n\)]+ ;
+ {NL} ++linenum;
+}
+
+<LINEDIR>{
+ \n yy_pop_state();
+ [[:digit:]]+ linenum = myctoi( yytext );
+
+ \"[^"\n]*\" {
+ flex_free( (void *) infilename );
+ infilename = copy_string( yytext + 1 );
+ infilename[strlen( infilename ) - 1] = '\0';
+ }
+ . /* ignore spurious characters */
+}
+
+<CODEBLOCK>{
+ ^"%}".*{NL} ++linenum; BEGIN(INITIAL);
+
+ {M4QSTART} ACTION_ECHO_QSTART;
+ {M4QEND} ACTION_ECHO_QEND;
+ . ACTION_ECHO;
+
+ {NL} {
+ ++linenum;
+ ACTION_ECHO;
+ if ( indented_code )
+ BEGIN(INITIAL);
+ }
+}
+
+<CODEBLOCK_MATCH_BRACE>{
+ "}" {
+ if( --brace_depth == 0){
+ /* TODO: Matched. */
+ yy_pop_state();
+ }else
+ buf_strnappend(&top_buf, yytext, yyleng);
+ }
+
+ "{" {
+ brace_depth++;
+ buf_strnappend(&top_buf, yytext, yyleng);
+ }
+
+ {NL} {
+ ++linenum;
+ buf_strnappend(&top_buf, yytext, yyleng);
+ }
+
+ {M4QSTART} buf_strnappend(&top_buf, escaped_qstart, strlen(escaped_qstart));
+ {M4QEND} buf_strnappend(&top_buf, escaped_qend, strlen(escaped_qend));
+
+ [^{}\r\n] {
+ buf_strnappend(&top_buf, yytext, yyleng);
+ }
+
+ <<EOF>> {
+ linenum = brace_start_line;
+ synerr(_("Unmatched '{'"));
+ yyterminate();
+ }
+}
+
+
+<PICKUPDEF>{
+ {WS} /* separates name and definition */
+
+ {NOT_WS}[^\r\n]* {
+ if(yyleng < MAXLINE)
+ {
+ strcpy( (char *) nmdef, yytext );
+ }
+ 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;
+ }
+
+ {NL} {
+ if ( ! didadef )
+ synerr( _( "incomplete name definition" ) );
+ BEGIN(INITIAL);
+ ++linenum;
+ }
+}
+
+
+<OPTION>{
+ {NL} ++linenum; BEGIN(INITIAL);
+ {WS} option_sense = true;
+
+ "=" return '=';
+
+ no option_sense = ! option_sense;
+
+ 7bit csize = option_sense ? 128 : 256;
+ 8bit csize = option_sense ? 256 : 128;
+
+ align long_align = option_sense;
+ always-interactive {
+ ACTION_M4_IFDEF( "M4""_YY_ALWAYS_INTERACTIVE", option_sense );
+ interactive = option_sense;
+ }
+ array yytext_is_array = option_sense;
+ ansi-definitions ansi_func_defs = option_sense;
+ ansi-prototypes ansi_func_protos = option_sense;
+ backup backing_up_report = option_sense;
+ batch interactive = ! option_sense;
+ bison-bridge bison_bridge_lval = option_sense;
+ bison-locations { if((bison_bridge_lloc = option_sense))
+ bison_bridge_lval = true;
+ }
+ "c++" C_plus_plus = option_sense;
+ caseful|case-sensitive sf_set_case_ins(!option_sense);
+ caseless|case-insensitive sf_set_case_ins(option_sense);
+ debug ddebug = option_sense;
+ default spprdflt = ! option_sense;
+ ecs useecs = option_sense;
+ fast {
+ useecs = usemecs = false;
+ use_read = fullspd = true;
+ }
+ full {
+ useecs = usemecs = false;
+ use_read = fulltbl = true;
+ }
+ input ACTION_IFDEF("YY_NO_INPUT", ! option_sense);
+ interactive interactive = option_sense;
+ lex-compat lex_compat = option_sense;
+ posix-compat posix_compat = option_sense;
+ main {
+ ACTION_M4_IFDEF( "M4""_YY_MAIN", option_sense);
+ /* Override yywrap */
+ if( option_sense == true )
+ do_yywrap = false;
+ }
+ meta-ecs usemecs = option_sense;
+ never-interactive {
+ ACTION_M4_IFDEF( "M4""_YY_NEVER_INTERACTIVE", option_sense );
+ interactive = !option_sense;
+ }
+ perf-report performance_report += option_sense ? 1 : -1;
+ pointer yytext_is_array = ! option_sense;
+ read use_read = option_sense;
+ reentrant reentrant = option_sense;
+ reject reject_really_used = option_sense;
+ stack ACTION_M4_IFDEF( "M4""_YY_STACK_USED", option_sense );
+ stdinit do_stdinit = option_sense;
+ stdout use_stdout = option_sense;
+ unistd ACTION_IFDEF("YY_NO_UNISTD_H", ! option_sense);
+ unput ACTION_M4_IFDEF("M4""_YY_NO_UNPUT", ! option_sense);
+ verbose printstats = option_sense;
+ warn nowarn = ! option_sense;
+ yylineno do_yylineno = option_sense; ACTION_M4_IFDEF("M4""_YY_USE_LINENO", option_sense);
+ yymore yymore_really_used = option_sense;
+ yywrap do_yywrap = option_sense;
+
+ yy_push_state ACTION_M4_IFDEF("M4""_YY_NO_PUSH_STATE", ! option_sense);
+ yy_pop_state ACTION_M4_IFDEF("M4""_YY_NO_POP_STATE", ! option_sense);
+ yy_top_state ACTION_M4_IFDEF("M4""_YY_NO_TOP_STATE", ! option_sense);
+
+ yy_scan_buffer ACTION_M4_IFDEF("M4""_YY_NO_SCAN_BUFFER", ! option_sense);
+ yy_scan_bytes ACTION_M4_IFDEF("M4""_YY_NO_SCAN_BYTES", ! option_sense);
+ yy_scan_string ACTION_M4_IFDEF("M4""_YY_NO_SCAN_STRING", ! option_sense);
+
+ yyalloc ACTION_M4_IFDEF("M4""_YY_NO_FLEX_ALLOC", ! option_sense);
+ yyrealloc ACTION_M4_IFDEF("M4""_YY_NO_FLEX_REALLOC", ! option_sense);
+ yyfree ACTION_M4_IFDEF("M4""_YY_NO_FLEX_FREE", ! option_sense);
+
+ yyget_debug ACTION_M4_IFDEF("M4""_YY_NO_GET_DEBUG", ! option_sense);
+ yyset_debug ACTION_M4_IFDEF("M4""_YY_NO_SET_DEBUG", ! option_sense);
+ yyget_extra ACTION_M4_IFDEF("M4""_YY_NO_GET_EXTRA", ! option_sense);
+ yyset_extra ACTION_M4_IFDEF("M4""_YY_NO_SET_EXTRA", ! option_sense);
+ yyget_leng ACTION_M4_IFDEF("M4""_YY_NO_GET_LENG", ! option_sense);
+ yyget_text ACTION_M4_IFDEF("M4""_YY_NO_GET_TEXT", ! option_sense);
+ yyget_lineno ACTION_M4_IFDEF("M4""_YY_NO_GET_LINENO", ! option_sense);
+ yyset_lineno ACTION_M4_IFDEF("M4""_YY_NO_SET_LINENO", ! option_sense);
+ yyget_in ACTION_M4_IFDEF("M4""_YY_NO_GET_IN", ! option_sense);
+ yyset_in ACTION_M4_IFDEF("M4""_YY_NO_SET_IN", ! option_sense);
+ yyget_out ACTION_M4_IFDEF("M4""_YY_NO_GET_OUT", ! option_sense);
+ yyset_out ACTION_M4_IFDEF("M4""_YY_NO_SET_OUT", ! option_sense);
+ yyget_lval ACTION_M4_IFDEF("M4""_YY_NO_GET_LVAL", ! option_sense);
+ yyset_lval ACTION_M4_IFDEF("M4""_YY_NO_SET_LVAL", ! option_sense);
+ yyget_lloc ACTION_M4_IFDEF("M4""_YY_NO_GET_LLOC", ! option_sense);
+ yyset_lloc ACTION_M4_IFDEF("M4""_YY_NO_SET_LLOC", ! option_sense);
+
+ extra-type return OPT_EXTRA_TYPE;
+ outfile return OPT_OUTFILE;
+ prefix return OPT_PREFIX;
+ yyclass return OPT_YYCLASS;
+ header(-file)? return OPT_HEADER;
+ tables-file return OPT_TABLES;
+ tables-verify {
+ tablesverify = option_sense;
+ if(!tablesext && option_sense)
+ tablesext = true;
+ }
+
+
+ \"[^"\n]*\" {
+ if(yyleng-1 < MAXLINE)
+ {
+ strcpy( nmstr, yytext + 1 );
+ }
+ else
+ {
+ synerr( _("Option line too long\n"));
+ FLEX_EXIT(EXIT_FAILURE);
+ }
+ nmstr[strlen( nmstr ) - 1] = '\0';
+ return NAME;
+ }
+
+ (([a-mo-z]|n[a-np-z])[[:alpha:]\-+]*)|. {
+ format_synerr( _( "unrecognized %%option: %s" ),
+ yytext );
+ BEGIN(RECOVER);
+ }
+}
+
+<RECOVER>.*{NL} ++linenum; BEGIN(INITIAL);
+
+
+<SECT2PROLOG>{
+ ^"%{".* ++bracelevel; yyless( 2 ); /* eat only %{ */
+ ^"%}".* --bracelevel; yyless( 2 ); /* eat only %} */
+
+ ^{WS}.* ACTION_ECHO; /* indented code in prolog */
+
+ ^{NOT_WS}.* { /* 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;
+ }
+
+ . ACTION_ECHO;
+ {NL} ++linenum; ACTION_ECHO;
+
+ <<EOF>> {
+ mark_prolog();
+ sectnum = 0;
+ yyterminate(); /* to stop the parser */
+ }
+}
+
+<SECT2>{
+ ^{OPTWS}{NL} ++linenum; /* allow blank lines in section 2 */
+
+ ^{OPTWS}"%{" {
+ indented_code = false;
+ doing_codeblock = true;
+ bracelevel = 1;
+ BEGIN(PERCENT_BRACE_ACTION);
+ }
+
+ ^{OPTWS}"<" {
+ /* Allow "<" to appear in (?x) patterns. */
+ if (!sf_skip_ws())
+ BEGIN(SC);
+ return '<';
+ }
+ ^{OPTWS}"^" return '^';
+ \" BEGIN(QUOTE); return '"';
+ "{"/[[:digit:]] {
+ BEGIN(NUM);
+ if ( lex_compat || posix_compat )
+ return BEGIN_REPEAT_POSIX;
+ else
+ return BEGIN_REPEAT_FLEX;
+ }
+ "$"/([[:blank:]]|{NL}) return '$';
+
+ {WS}"%{" {
+ bracelevel = 1;
+ BEGIN(PERCENT_BRACE_ACTION);
+
+ if ( in_rule )
+ {
+ doing_rule_action = true;
+ in_rule = false;
+ return '\n';
+ }
+ }
+ {WS}"|".*{NL} {
+ 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';
+ }
+ }
+
+ ^{WS}"/*" {
+
+ 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);
+ }
+ }
+
+ ^{WS} /* allow indented rules */ ;
+
+ {WS} {
+ 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';
+ }
+ }
+ }
+
+ {OPTWS}{NL} {
+ 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';
+ }
+ }
+ }
+
+ ^{OPTWS}"<<EOF>>" |
+ "<<EOF>>" return EOF_OP;
+
+ ^"%%".* {
+ sectnum = 3;
+ BEGIN(SECT3);
+ outn("/* Begin user sect3 */");
+ yyterminate(); /* to stop the parser */
+ }
+
+ "["({FIRST_CCL_CHAR}|{CCL_EXPR})({CCL_CHAR}|{CCL_EXPR})* {
+ int cclval;
+
+ if(yyleng < MAXLINE)
+ {
+ strcpy( nmstr, yytext );
+ }
+ 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 '[';
+ }
+ }
+ "{-}" return CCL_OP_DIFF;
+ "{+}" return CCL_OP_UNION;
+
+
+ /* Check for :space: at the end of the rule so we don't
+ * wrap the expanded regex in '(' ')' -- breaking trailing
+ * context.
+ */
+ "{"{NAME}"}"[[:space:]]? {
+ Char *nmdefptr;
+ int end_is_ws, end_ch;
+
+ end_ch = yytext[yyleng-1];
+ end_is_ws = end_ch != '}' ? 1 : 0;
+
+ if(yyleng-1 < MAXLINE)
+ {
+ strcpy( nmstr, yytext + 1 );
+ }
+ 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('(');
+ }
+ }
+ }
+
+ "/*" {
+ if (sf_skip_ws())
+ yy_push_state(COMMENT_DISCARD);
+ else{
+ /* Push back the "*" and return "/" as usual. */
+ yyless(1);
+ return '/';
+ }
+ }
+
+ "(?#" {
+ 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);
+ }
+ "(?" {
+ 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 '(';
+ }
+ "(" sf_push(); return '(';
+ ")" sf_pop(); return ')';
+
+ [/|*+?.(){}] return (unsigned char) yytext[0];
+ . RETURNCHAR;
+}
+
+
+<SC>{
+ {OPTWS}{NL}{OPTWS} ++linenum; /* Allow blank lines & continuations */
+ [,*] return (unsigned char) yytext[0];
+ ">" BEGIN(SECT2); return '>';
+ ">"/^ BEGIN(CARETISBOL); return '>';
+ {SCNAME} RETURNNAME;
+ . {
+ format_synerr( _( "bad <start condition>: %s" ),
+ yytext );
+ }
+}
+
+<CARETISBOL>"^" BEGIN(SECT2); return '^';
+
+
+<QUOTE>{
+ [^"\n] RETURNCHAR;
+ \" BEGIN(SECT2); return '"';
+
+ {NL} {
+ synerr( _( "missing quote" ) );
+ BEGIN(SECT2);
+ ++linenum;
+ return '"';
+ }
+}
+
+<GROUP_WITH_PARAMS>{
+ ":" BEGIN(SECT2);
+ "-" BEGIN(GROUP_MINUS_PARAMS);
+ i sf_set_case_ins(1);
+ s sf_set_dot_all(1);
+ x sf_set_skip_ws(1);
+}
+<GROUP_MINUS_PARAMS>{
+ ":" BEGIN(SECT2);
+ i sf_set_case_ins(0);
+ s sf_set_dot_all(0);
+ x sf_set_skip_ws(0);
+}
+
+<FIRSTCCL>{
+ "^"/[^-\]\n] BEGIN(CCL); return '^';
+ "^"/("-"|"]") return '^';
+ . BEGIN(CCL); RETURNCHAR;
+}
+
+<CCL>{
+ -/[^\]\n] return '-';
+ [^\]\n] RETURNCHAR;
+ "]" BEGIN(SECT2); return ']';
+ .|{NL} {
+ synerr( _( "bad character class" ) );
+ BEGIN(SECT2);
+ return ']';
+ }
+}
+
+<FIRSTCCL,CCL>{
+ "[:alnum:]" BEGIN(CCL); return CCE_ALNUM;
+ "[:alpha:]" BEGIN(CCL); return CCE_ALPHA;
+ "[:blank:]" BEGIN(CCL); return CCE_BLANK;
+ "[:cntrl:]" BEGIN(CCL); return CCE_CNTRL;
+ "[:digit:]" BEGIN(CCL); return CCE_DIGIT;
+ "[:graph:]" BEGIN(CCL); return CCE_GRAPH;
+ "[:lower:]" BEGIN(CCL); return CCE_LOWER;
+ "[:print:]" BEGIN(CCL); return CCE_PRINT;
+ "[:punct:]" BEGIN(CCL); return CCE_PUNCT;
+ "[:space:]" BEGIN(CCL); return CCE_SPACE;
+ "[:upper:]" BEGIN(CCL); return CCE_UPPER;
+ "[:xdigit:]" BEGIN(CCL); return CCE_XDIGIT;
+
+ "[:^alnum:]" BEGIN(CCL); return CCE_NEG_ALNUM;
+ "[:^alpha:]" BEGIN(CCL); return CCE_NEG_ALPHA;
+ "[:^blank:]" BEGIN(CCL); return CCE_NEG_BLANK;
+ "[:^cntrl:]" BEGIN(CCL); return CCE_NEG_CNTRL;
+ "[:^digit:]" BEGIN(CCL); return CCE_NEG_DIGIT;
+ "[:^graph:]" BEGIN(CCL); return CCE_NEG_GRAPH;
+ "[:^lower:]" BEGIN(CCL); return CCE_NEG_LOWER;
+ "[:^print:]" BEGIN(CCL); return CCE_NEG_PRINT;
+ "[:^punct:]" BEGIN(CCL); return CCE_NEG_PUNCT;
+ "[:^space:]" BEGIN(CCL); return CCE_NEG_SPACE;
+ "[:^upper:]" BEGIN(CCL); return CCE_NEG_UPPER;
+ "[:^xdigit:]" BEGIN(CCL); return CCE_NEG_XDIGIT;
+ {CCL_EXPR} {
+ format_synerr(
+ _( "bad character class expression: %s" ),
+ yytext );
+ BEGIN(CCL); return CCE_ALNUM;
+ }
+}
+
+<NUM>{
+ [[:digit:]]+ {
+ yylval = myctoi( yytext );
+ return NUMBER;
+ }
+
+ "," return ',';
+ "}" {
+ BEGIN(SECT2);
+ if ( lex_compat || posix_compat )
+ return END_REPEAT_POSIX;
+ else
+ return END_REPEAT_FLEX;
+ }
+
+ . {
+ synerr( _( "bad character inside {}'s" ) );
+ BEGIN(SECT2);
+ return '}';
+ }
+
+ {NL} {
+ synerr( _( "missing }" ) );
+ BEGIN(SECT2);
+ ++linenum;
+ return '}';
+ }
+}
+
+
+<PERCENT_BRACE_ACTION>{
+ {OPTWS}"%}".* bracelevel = 0;
+
+ <ACTION>"/*" ACTION_ECHO; yy_push_state( COMMENT );
+
+ <CODEBLOCK,ACTION>{
+ "reject" {
+ ACTION_ECHO;
+ CHECK_REJECT(yytext);
+ }
+ "yymore" {
+ ACTION_ECHO;
+ CHECK_YYMORE(yytext);
+ }
+ }
+
+ {M4QSTART} ACTION_ECHO_QSTART;
+ {M4QEND} ACTION_ECHO_QEND;
+ . ACTION_ECHO;
+ {NL} {
+ ++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);
+ }
+ }
+}
+
+
+ /* Reject and YYmore() are checked for above, in PERCENT_BRACE_ACTION */
+<ACTION>{
+ "{" ACTION_ECHO; ++bracelevel;
+ "}" ACTION_ECHO; --bracelevel;
+ {M4QSTART} ACTION_ECHO_QSTART;
+ {M4QEND} ACTION_ECHO_QEND;
+ [^[:alpha:]_{}"'/\n\[\]]+ ACTION_ECHO;
+ [\[\]] ACTION_ECHO;
+ {NAME} ACTION_ECHO;
+ "'"([^'\\\n]|\\.)*"'" ACTION_ECHO; /* character constant */
+ \" ACTION_ECHO; BEGIN(ACTION_STRING);
+ {NL} {
+ ++linenum;
+ ACTION_ECHO;
+ if ( bracelevel == 0 )
+ {
+ if ( doing_rule_action )
+ add_action( "\tYY_BREAK\n" );
+
+ doing_rule_action = false;
+ BEGIN(SECT2);
+ }
+ }
+ . ACTION_ECHO;
+}
+
+<ACTION_STRING>{
+ [^"\\\n]+ ACTION_ECHO;
+ \\. ACTION_ECHO;
+ {NL} ++linenum; ACTION_ECHO; BEGIN(ACTION);
+ \" ACTION_ECHO; BEGIN(ACTION);
+ . ACTION_ECHO;
+}
+
+<COMMENT,COMMENT_DISCARD,ACTION,ACTION_STRING><<EOF>> {
+ synerr( _( "EOF encountered inside an action" ) );
+ yyterminate();
+ }
+
+<EXTENDED_COMMENT,GROUP_WITH_PARAMS,GROUP_MINUS_PARAMS><<EOF>> {
+ synerr( _( "EOF encountered inside pattern" ) );
+ yyterminate();
+ }
+
+<SECT2,QUOTE,FIRSTCCL,CCL>{ESCSEQ} {
+ yylval = myesc( (Char *) yytext );
+
+ if ( YY_START == FIRSTCCL )
+ BEGIN(CCL);
+
+ return CHAR;
+ }
+
+
+<SECT3>{
+ {M4QSTART} fwrite (escaped_qstart, 1, strlen(escaped_qstart), yyout);
+ {M4QEND} fwrite (escaped_qend, 1, strlen(escaped_qend), yyout);
+ [^\[\]\n]*(\n?) ECHO;
+ (.|\n) ECHO;
+ <<EOF>> sectnum = 0; yyterminate();
+}
+
+<*>.|\n format_synerr( _( "bad character: %s" ), yytext );
+
+%%
+
+
+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 )
+ lerr( _( "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 --git a/src/scanflags.c b/src/scanflags.c
new file mode 100644
index 0000000..5beb24a
--- /dev/null
+++ b/src/scanflags.c
@@ -0,0 +1,68 @@
+/* scanflags - flags used by scanning. */
+
+/* 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"
+
+scanflags_t* _sf_stk = NULL;
+size_t _sf_top_ix=0, _sf_max=0;
+
+void
+sf_push (void)
+{
+ if (_sf_top_ix + 1 >= _sf_max)
+ _sf_stk = (scanflags_t*) flex_realloc ( (void*) _sf_stk, sizeof(scanflags_t) * (_sf_max += 32));
+
+ // copy the top element
+ _sf_stk[_sf_top_ix + 1] = _sf_stk[_sf_top_ix];
+ ++_sf_top_ix;
+}
+
+void
+sf_pop (void)
+{
+ assert(_sf_top_ix > 0);
+ --_sf_top_ix;
+}
+
+/* one-time initialization. Should be called before any sf_ functions. */
+void
+sf_init (void)
+{
+ assert(_sf_stk == NULL);
+ _sf_stk = (scanflags_t*) flex_alloc ( sizeof(scanflags_t) * (_sf_max = 32));
+ if (!_sf_stk)
+ lerr_fatal(_("Unable to allocate %zu of stack"), sizeof(scanflags_t));
+ _sf_stk[_sf_top_ix] = 0;
+}
+
+/* vim:set expandtab cindent tabstop=4 softtabstop=4 shiftwidth=4 textwidth=0: */
diff --git a/src/scanopt.c b/src/scanopt.c
new file mode 100644
index 0000000..10c372a
--- /dev/null
+++ b/src/scanopt.c
@@ -0,0 +1,866 @@
+/* flex - tool to generate fast lexical analyzers */
+
+/* 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 "scanopt.h"
+
+
+/* Internal structures */
+
+#ifdef HAVE_STRCASECMP
+#define STRCASECMP(a,b) strcasecmp(a,b)
+#else
+static int STRCASECMP PROTO ((const char *, const char *));
+
+static int STRCASECMP (a, b)
+ const char *a;
+ const char *b;
+{
+ while (tolower ((unsigned char)*a++) == tolower ((unsigned char)*b++)) ;
+ return b - a;
+}
+#endif
+
+#define ARG_NONE 0x01
+#define ARG_REQ 0x02
+#define ARG_OPT 0x04
+#define IS_LONG 0x08
+
+struct _aux {
+ int flags; /* The above hex flags. */
+ int namelen; /* Length of the actual option word, e.g., "--file[=foo]" is 4 */
+ int printlen; /* Length of entire string, e.g., "--file[=foo]" is 12 */
+};
+
+
+struct _scanopt_t {
+ const optspec_t *options; /* List of options. */
+ struct _aux *aux; /* Auxiliary data about options. */
+ int optc; /* Number of options. */
+ int argc; /* Number of args. */
+ char **argv; /* Array of strings. */
+ int index; /* Used as: argv[index][subscript]. */
+ int subscript;
+ char no_err_msg; /* If true, do not print errors. */
+ char has_long;
+ char has_short;
+};
+
+/* Accessor functions. These WOULD be one-liners, but portability calls. */
+static const char *NAME PROTO ((struct _scanopt_t *, int));
+static int PRINTLEN PROTO ((struct _scanopt_t *, int));
+static int RVAL PROTO ((struct _scanopt_t *, int));
+static int FLAGS PROTO ((struct _scanopt_t *, int));
+static const char *DESC PROTO ((struct _scanopt_t *, int));
+static int scanopt_err PROTO ((struct _scanopt_t *, int, int));
+static int matchlongopt PROTO ((char *, char **, int *, char **, int *));
+static int find_opt
+PROTO ((struct _scanopt_t *, int, char *, int, int *, int *opt_offset));
+
+static const char *NAME (s, i)
+ struct _scanopt_t *s;
+ int i;
+{
+ return s->options[i].opt_fmt +
+ ((s->aux[i].flags & IS_LONG) ? 2 : 1);
+}
+
+static int PRINTLEN (s, i)
+ struct _scanopt_t *s;
+ int i;
+{
+ return s->aux[i].printlen;
+}
+
+static int RVAL (s, i)
+ struct _scanopt_t *s;
+ int i;
+{
+ return s->options[i].r_val;
+}
+
+static int FLAGS (s, i)
+ struct _scanopt_t *s;
+ int i;
+{
+ return s->aux[i].flags;
+}
+
+static const char *DESC (s, i)
+ struct _scanopt_t *s;
+ int i;
+{
+ return s->options[i].desc ? s->options[i].desc : "";
+}
+
+#ifndef NO_SCANOPT_USAGE
+static int get_cols PROTO ((void));
+
+static int get_cols ()
+{
+ char *env;
+ int cols = 80; /* default */
+
+#ifdef HAVE_NCURSES_H
+ initscr ();
+ endwin ();
+ if (COLS > 0)
+ return COLS;
+#endif
+
+ if ((env = getenv ("COLUMNS")) != NULL)
+ cols = atoi (env);
+
+ return cols;
+}
+#endif
+
+/* Macro to check for NULL before assigning a value. */
+#define SAFE_ASSIGN(ptr,val) \
+ do{ \
+ if((ptr)!=NULL) \
+ *(ptr) = val; \
+ }while(0)
+
+/* Macro to assure we reset subscript whenever we adjust s->index.*/
+#define INC_INDEX(s,n) \
+ do{ \
+ (s)->index += (n); \
+ (s)->subscript= 0; \
+ }while(0)
+
+scanopt_t *scanopt_init (options, argc, argv, flags)
+ const optspec_t *options;
+ int argc;
+ char **argv;
+ int flags;
+{
+ int i;
+ struct _scanopt_t *s;
+ s = (struct _scanopt_t *) malloc (sizeof (struct _scanopt_t));
+
+ s->options = options;
+ s->optc = 0;
+ s->argc = argc;
+ s->argv = (char **) argv;
+ s->index = 1;
+ s->subscript = 0;
+ s->no_err_msg = (flags & SCANOPT_NO_ERR_MSG);
+ s->has_long = 0;
+ s->has_short = 0;
+
+ /* Determine option count. (Find entry with all zeros). */
+ s->optc = 0;
+ while (options[s->optc].opt_fmt
+ || options[s->optc].r_val || options[s->optc].desc)
+ s->optc++;
+
+ /* Build auxiliary data */
+ s->aux = (struct _aux *) malloc (s->optc * sizeof (struct _aux));
+
+ for (i = 0; i < s->optc; i++) {
+ const Char *p, *pname;
+ const struct optspec_t *opt;
+ struct _aux *aux;
+
+ opt = s->options + i;
+ aux = s->aux + i;
+
+ aux->flags = ARG_NONE;
+
+ if (opt->opt_fmt[0] == '-' && opt->opt_fmt[1] == '-') {
+ aux->flags |= IS_LONG;
+ pname = (const Char *)(opt->opt_fmt + 2);
+ s->has_long = 1;
+ }
+ else {
+ pname = (const Char *)(opt->opt_fmt + 1);
+ s->has_short = 1;
+ }
+ aux->printlen = strlen (opt->opt_fmt);
+
+ aux->namelen = 0;
+ for (p = pname + 1; *p; p++) {
+ /* detect required arg */
+ if (*p == '=' || isspace ((unsigned char)*p)
+ || !(aux->flags & IS_LONG)) {
+ if (aux->namelen == 0)
+ aux->namelen = p - pname;
+ aux->flags |= ARG_REQ;
+ aux->flags &= ~ARG_NONE;
+ }
+ /* detect optional arg. This overrides required arg. */
+ if (*p == '[') {
+ if (aux->namelen == 0)
+ aux->namelen = p - pname;
+ aux->flags &= ~(ARG_REQ | ARG_NONE);
+ aux->flags |= ARG_OPT;
+ break;
+ }
+ }
+ if (aux->namelen == 0)
+ aux->namelen = p - pname;
+ }
+ return (scanopt_t *) s;
+}
+
+#ifndef NO_SCANOPT_USAGE
+/* these structs are for scanopt_usage(). */
+struct usg_elem {
+ int idx;
+ struct usg_elem *next;
+ struct usg_elem *alias;
+};
+typedef struct usg_elem usg_elem;
+
+
+/* Prints a usage message based on contents of optlist.
+ * Parameters:
+ * scanner - The scanner, already initialized with scanopt_init().
+ * fp - The file stream to write to.
+ * usage - Text to be prepended to option list.
+ * Return: Always returns 0 (zero).
+ * The output looks something like this:
+
+[indent][option, alias1, alias2...][indent][description line1
+ description line2...]
+ */
+int scanopt_usage (scanner, fp, usage)
+ scanopt_t *scanner;
+ FILE *fp;
+ const char *usage;
+{
+ struct _scanopt_t *s;
+ int i, columns, indent = 2;
+ usg_elem *byr_val = NULL; /* option indices sorted by r_val */
+ usg_elem *store; /* array of preallocated elements. */
+ int store_idx = 0;
+ usg_elem *ue;
+ int maxlen[2];
+ int desccol = 0;
+ int print_run = 0;
+
+ maxlen[0] = 0;
+ maxlen[1] = 0;
+
+ s = (struct _scanopt_t *) scanner;
+
+ if (usage) {
+ fprintf (fp, "%s\n", usage);
+ }
+ else {
+ /* Find the basename of argv[0] */
+ const char *p;
+
+ p = s->argv[0] + strlen (s->argv[0]);
+ while (p != s->argv[0] && *p != '/')
+ --p;
+ if (*p == '/')
+ p++;
+
+ fprintf (fp, _("Usage: %s [OPTIONS]...\n"), p);
+ }
+ fprintf (fp, "\n");
+
+ /* Sort by r_val and string. Yes, this is O(n*n), but n is small. */
+ store = (usg_elem *) malloc (s->optc * sizeof (usg_elem));
+ for (i = 0; i < s->optc; i++) {
+
+ /* grab the next preallocate node. */
+ ue = store + store_idx++;
+ ue->idx = i;
+ ue->next = ue->alias = NULL;
+
+ /* insert into list. */
+ if (!byr_val)
+ byr_val = ue;
+ else {
+ int found_alias = 0;
+ usg_elem **ue_curr, **ptr_if_no_alias = NULL;
+
+ ue_curr = &byr_val;
+ while (*ue_curr) {
+ if (RVAL (s, (*ue_curr)->idx) ==
+ RVAL (s, ue->idx)) {
+ /* push onto the alias list. */
+ ue_curr = &((*ue_curr)->alias);
+ found_alias = 1;
+ break;
+ }
+ if (!ptr_if_no_alias
+ &&
+ STRCASECMP (NAME (s, (*ue_curr)->idx),
+ NAME (s, ue->idx)) > 0) {
+ ptr_if_no_alias = ue_curr;
+ }
+ ue_curr = &((*ue_curr)->next);
+ }
+ if (!found_alias && ptr_if_no_alias)
+ ue_curr = ptr_if_no_alias;
+ ue->next = *ue_curr;
+ *ue_curr = ue;
+ }
+ }
+
+#if 0
+ if (1) {
+ printf ("ORIGINAL:\n");
+ for (i = 0; i < s->optc; i++)
+ printf ("%2d: %s\n", i, NAME (s, i));
+ printf ("SORTED:\n");
+ ue = byr_val;
+ while (ue) {
+ usg_elem *ue2;
+
+ printf ("%2d: %s\n", ue->idx, NAME (s, ue->idx));
+ for (ue2 = ue->alias; ue2; ue2 = ue2->next)
+ printf (" +---> %2d: %s\n", ue2->idx,
+ NAME (s, ue2->idx));
+ ue = ue->next;
+ }
+ }
+#endif
+
+ /* Now build each row of output. */
+
+ /* first pass calculate how much room we need. */
+ for (ue = byr_val; ue; ue = ue->next) {
+ usg_elem *ap;
+ int len = 0;
+ int nshort = 0, nlong = 0;
+
+
+#define CALC_LEN(i) do {\
+ if(FLAGS(s,i) & IS_LONG) \
+ len += (nlong++||nshort) ? 2+PRINTLEN(s,i) : PRINTLEN(s,i);\
+ else\
+ len += (nshort++||nlong)? 2+PRINTLEN(s,i) : PRINTLEN(s,i);\
+ }while(0)
+
+ if (!(FLAGS (s, ue->idx) & IS_LONG))
+ CALC_LEN (ue->idx);
+
+ /* do short aliases first. */
+ for (ap = ue->alias; ap; ap = ap->next) {
+ if (FLAGS (s, ap->idx) & IS_LONG)
+ continue;
+ CALC_LEN (ap->idx);
+ }
+
+ if (FLAGS (s, ue->idx) & IS_LONG)
+ CALC_LEN (ue->idx);
+
+ /* repeat the above loop, this time for long aliases. */
+ for (ap = ue->alias; ap; ap = ap->next) {
+ if (!(FLAGS (s, ap->idx) & IS_LONG))
+ continue;
+ CALC_LEN (ap->idx);
+ }
+
+ if (len > maxlen[0])
+ maxlen[0] = len;
+
+ /* It's much easier to calculate length for description column! */
+ len = strlen (DESC (s, ue->idx));
+ if (len > maxlen[1])
+ maxlen[1] = len;
+ }
+
+ /* Determine how much room we have, and how much we will allocate to each col.
+ * Do not address pathological cases. Output will just be ugly. */
+ columns = get_cols () - 1;
+ if (maxlen[0] + maxlen[1] + indent * 2 > columns) {
+ /* col 0 gets whatever it wants. we'll wrap the desc col. */
+ maxlen[1] = columns - (maxlen[0] + indent * 2);
+ if (maxlen[1] < 14) /* 14 is arbitrary lower limit on desc width. */
+ maxlen[1] = INT_MAX;
+ }
+ desccol = maxlen[0] + indent * 2;
+
+#define PRINT_SPACES(fp,n)\
+ do{\
+ int _n;\
+ _n=(n);\
+ while(_n-- > 0)\
+ fputc(' ',(fp));\
+ }while(0)
+
+
+ /* Second pass (same as above loop), this time we print. */
+ /* Sloppy hack: We iterate twice. The first time we print short and long options.
+ The second time we print those lines that have ONLY long options. */
+ while (print_run++ < 2) {
+ for (ue = byr_val; ue; ue = ue->next) {
+ usg_elem *ap;
+ int nwords = 0, nchars = 0, has_short = 0;
+
+/* TODO: get has_short schtick to work */
+ has_short = !(FLAGS (s, ue->idx) & IS_LONG);
+ for (ap = ue->alias; ap; ap = ap->next) {
+ if (!(FLAGS (s, ap->idx) & IS_LONG)) {
+ has_short = 1;
+ break;
+ }
+ }
+ if ((print_run == 1 && !has_short) ||
+ (print_run == 2 && has_short))
+ continue;
+
+ PRINT_SPACES (fp, indent);
+ nchars += indent;
+
+/* Print, adding a ", " between aliases. */
+#define PRINT_IT(i) do{\
+ if(nwords++)\
+ nchars+=fprintf(fp,", ");\
+ nchars+=fprintf(fp,"%s",s->options[i].opt_fmt);\
+ }while(0)
+
+ if (!(FLAGS (s, ue->idx) & IS_LONG))
+ PRINT_IT (ue->idx);
+
+ /* print short aliases first. */
+ for (ap = ue->alias; ap; ap = ap->next) {
+ if (!(FLAGS (s, ap->idx) & IS_LONG))
+ PRINT_IT (ap->idx);
+ }
+
+
+ if (FLAGS (s, ue->idx) & IS_LONG)
+ PRINT_IT (ue->idx);
+
+ /* repeat the above loop, this time for long aliases. */
+ for (ap = ue->alias; ap; ap = ap->next) {
+ if (FLAGS (s, ap->idx) & IS_LONG)
+ PRINT_IT (ap->idx);
+ }
+
+ /* pad to desccol */
+ PRINT_SPACES (fp, desccol - nchars);
+
+ /* Print description, wrapped to maxlen[1] columns. */
+ if (1) {
+ const char *pstart;
+
+ pstart = DESC (s, ue->idx);
+ while (1) {
+ int n = 0;
+ const char *lastws = NULL, *p;
+
+ p = pstart;
+
+ while (*p && n < maxlen[1]
+ && *p != '\n') {
+ if (isspace ((unsigned char)(*p))
+ || *p == '-') lastws =
+ p;
+ n++;
+ p++;
+ }
+
+ if (!*p) { /* hit end of desc. done. */
+ fprintf (fp, "%s\n",
+ pstart);
+ break;
+ }
+ else if (*p == '\n') { /* print everything up to here then wrap. */
+ fprintf (fp, "%.*s\n", n,
+ pstart);
+ PRINT_SPACES (fp, desccol);
+ pstart = p + 1;
+ continue;
+ }
+ else { /* we hit the edge of the screen. wrap at space if possible. */
+ if (lastws) {
+ fprintf (fp,
+ "%.*s\n",
+ (int)(lastws - pstart),
+ pstart);
+ pstart =
+ lastws + 1;
+ }
+ else {
+ fprintf (fp,
+ "%.*s\n",
+ n,
+ pstart);
+ pstart = p + 1;
+ }
+ PRINT_SPACES (fp, desccol);
+ continue;
+ }
+ }
+ }
+ }
+ } /* end while */
+ free (store);
+ return 0;
+}
+#endif /* no scanopt_usage */
+
+
+static int scanopt_err (s, is_short, err)
+ struct _scanopt_t *s;
+ int is_short;
+ int err;
+{
+ const char *optname = "";
+ char optchar[2];
+
+ if (!s->no_err_msg) {
+
+ if (s->index > 0 && s->index < s->argc) {
+ if (is_short) {
+ optchar[0] =
+ s->argv[s->index][s->subscript];
+ optchar[1] = '\0';
+ optname = optchar;
+ }
+ else {
+ optname = s->argv[s->index];
+ }
+ }
+
+ fprintf (stderr, "%s: ", s->argv[0]);
+ switch (err) {
+ case SCANOPT_ERR_ARG_NOT_ALLOWED:
+ fprintf (stderr,
+ _
+ ("option `%s' doesn't allow an argument\n"),
+ optname);
+ break;
+ case SCANOPT_ERR_ARG_NOT_FOUND:
+ fprintf (stderr,
+ _("option `%s' requires an argument\n"),
+ optname);
+ break;
+ case SCANOPT_ERR_OPT_AMBIGUOUS:
+ fprintf (stderr, _("option `%s' is ambiguous\n"),
+ optname);
+ break;
+ case SCANOPT_ERR_OPT_UNRECOGNIZED:
+ fprintf (stderr, _("Unrecognized option `%s'\n"),
+ optname);
+ break;
+ default:
+ fprintf (stderr, _("Unknown error=(%d)\n"), err);
+ break;
+ }
+ }
+ return err;
+}
+
+
+/* Internal. Match str against the regex ^--([^=]+)(=(.*))?
+ * return 1 if *looks* like a long option.
+ * 'str' is the only input argument, the rest of the arguments are output only.
+ * optname will point to str + 2
+ *
+ */
+static int matchlongopt (str, optname, optlen, arg, arglen)
+ char *str;
+ char **optname;
+ int *optlen;
+ char **arg;
+ int *arglen;
+{
+ char *p;
+
+ *optname = *arg = (char *) 0;
+ *optlen = *arglen = 0;
+
+ /* Match regex /--./ */
+ p = str;
+ if (p[0] != '-' || p[1] != '-' || !p[2])
+ return 0;
+
+ p += 2;
+ *optname = (char *) p;
+
+ /* find the end of optname */
+ while (*p && *p != '=')
+ ++p;
+
+ *optlen = p - *optname;
+
+ if (!*p)
+ /* an option with no '=...' part. */
+ return 1;
+
+
+ /* We saw an '=' char. The rest of p is the arg. */
+ p++;
+ *arg = p;
+ while (*p)
+ ++p;
+ *arglen = p - *arg;
+
+ return 1;
+}
+
+
+/* Internal. Look up long or short option by name.
+ * Long options must match a non-ambiguous prefix, or exact match.
+ * Short options must be exact.
+ * Return boolean true if found and no error.
+ * Error stored in err_code or zero if no error. */
+static int find_opt (s, lookup_long, optstart, len, err_code, opt_offset)
+ struct _scanopt_t *s;
+ int lookup_long;
+ char *optstart;
+ int len;
+ int *err_code;
+ int *opt_offset;
+{
+ int nmatch = 0, lastr_val = 0, i;
+
+ *err_code = 0;
+ *opt_offset = -1;
+
+ if (!optstart)
+ return 0;
+
+ for (i = 0; i < s->optc; i++) {
+ char *optname;
+
+ optname =
+ (char *) (s->options[i].opt_fmt +
+ (lookup_long ? 2 : 1));
+
+ if (lookup_long && (s->aux[i].flags & IS_LONG)) {
+ if (len > s->aux[i].namelen)
+ continue;
+
+ if (strncmp (optname, optstart, len) == 0) {
+ nmatch++;
+ *opt_offset = i;
+
+ /* exact match overrides all. */
+ if (len == s->aux[i].namelen) {
+ nmatch = 1;
+ break;
+ }
+
+ /* ambiguity is ok between aliases. */
+ if (lastr_val
+ && lastr_val ==
+ s->options[i].r_val) nmatch--;
+ lastr_val = s->options[i].r_val;
+ }
+ }
+ else if (!lookup_long && !(s->aux[i].flags & IS_LONG)) {
+ if (optname[0] == optstart[0]) {
+ nmatch++;
+ *opt_offset = i;
+ }
+ }
+ }
+
+ if (nmatch == 0) {
+ *err_code = SCANOPT_ERR_OPT_UNRECOGNIZED;
+ *opt_offset = -1;
+ }
+ else if (nmatch > 1) {
+ *err_code = SCANOPT_ERR_OPT_AMBIGUOUS;
+ *opt_offset = -1;
+ }
+
+ return *err_code ? 0 : 1;
+}
+
+
+int scanopt (svoid, arg, optindex)
+ scanopt_t *svoid;
+ char **arg;
+ int *optindex;
+{
+ char *optname = NULL, *optarg = NULL, *pstart;
+ int namelen = 0, arglen = 0;
+ int errcode = 0, has_next;
+ const optspec_t *optp;
+ struct _scanopt_t *s;
+ struct _aux *auxp;
+ int is_short;
+ int opt_offset = -1;
+
+ s = (struct _scanopt_t *) svoid;
+
+ /* Normalize return-parameters. */
+ SAFE_ASSIGN (arg, NULL);
+ SAFE_ASSIGN (optindex, s->index);
+
+ if (s->index >= s->argc)
+ return 0;
+
+ /* pstart always points to the start of our current scan. */
+ pstart = s->argv[s->index] + s->subscript;
+ if (!pstart)
+ return 0;
+
+ if (s->subscript == 0) {
+
+ /* test for exact match of "--" */
+ if (pstart[0] == '-' && pstart[1] == '-' && !pstart[2]) {
+ SAFE_ASSIGN (optindex, s->index + 1);
+ INC_INDEX (s, 1);
+ return 0;
+ }
+
+ /* Match an opt. */
+ if (matchlongopt
+ (pstart, &optname, &namelen, &optarg, &arglen)) {
+
+ /* it LOOKS like an opt, but is it one?! */
+ if (!find_opt
+ (s, 1, optname, namelen, &errcode,
+ &opt_offset)) {
+ scanopt_err (s, 0, errcode);
+ return errcode;
+ }
+ /* We handle this below. */
+ is_short = 0;
+
+ /* Check for short opt. */
+ }
+ else if (pstart[0] == '-' && pstart[1]) {
+ /* Pass through to below. */
+ is_short = 1;
+ s->subscript++;
+ pstart++;
+ }
+
+ else {
+ /* It's not an option. We're done. */
+ return 0;
+ }
+ }
+
+ /* We have to re-check the subscript status because it
+ * may have changed above. */
+
+ if (s->subscript != 0) {
+
+ /* we are somewhere in a run of short opts,
+ * e.g., at the 'z' in `tar -xzf` */
+
+ optname = pstart;
+ namelen = 1;
+ is_short = 1;
+
+ if (!find_opt
+ (s, 0, pstart, namelen, &errcode, &opt_offset)) {
+ return scanopt_err (s, 1, errcode);
+ }
+
+ optarg = pstart + 1;
+ if (!*optarg) {
+ optarg = NULL;
+ arglen = 0;
+ }
+ else
+ arglen = strlen (optarg);
+ }
+
+ /* At this point, we have a long or short option matched at opt_offset into
+ * the s->options array (and corresponding aux array).
+ * A trailing argument is in {optarg,arglen}, if any.
+ */
+
+ /* Look ahead in argv[] to see if there is something
+ * that we can use as an argument (if needed). */
+ has_next = s->index + 1 < s->argc
+ && strcmp ("--", s->argv[s->index + 1]) != 0;
+
+ optp = s->options + opt_offset;
+ auxp = s->aux + opt_offset;
+
+ /* case: no args allowed */
+ if (auxp->flags & ARG_NONE) {
+ if (optarg && !is_short) {
+ scanopt_err (s, is_short, errcode = SCANOPT_ERR_ARG_NOT_ALLOWED);
+ INC_INDEX (s, 1);
+ return errcode;
+ }
+ else if (!optarg)
+ INC_INDEX (s, 1);
+ else
+ s->subscript++;
+ return optp->r_val;
+ }
+
+ /* case: required */
+ if (auxp->flags & ARG_REQ) {
+ if (!optarg && !has_next)
+ return scanopt_err (s, is_short, SCANOPT_ERR_ARG_NOT_FOUND);
+
+ if (!optarg) {
+ /* Let the next argv element become the argument. */
+ SAFE_ASSIGN (arg, s->argv[s->index + 1]);
+ INC_INDEX (s, 2);
+ }
+ else {
+ SAFE_ASSIGN (arg, (char *) optarg);
+ INC_INDEX (s, 1);
+ }
+ return optp->r_val;
+ }
+
+ /* case: optional */
+ if (auxp->flags & ARG_OPT) {
+ SAFE_ASSIGN (arg, optarg);
+ INC_INDEX (s, 1);
+ return optp->r_val;
+ }
+
+
+ /* Should not reach here. */
+ return 0;
+}
+
+
+int scanopt_destroy (svoid)
+ scanopt_t *svoid;
+{
+ struct _scanopt_t *s;
+
+ s = (struct _scanopt_t *) svoid;
+ if (s) {
+ if (s->aux)
+ free (s->aux);
+ free (s);
+ }
+ return 0;
+}
+
+
+/* vim:set tabstop=8 softtabstop=4 shiftwidth=4: */
diff --git a/src/scanopt.h b/src/scanopt.h
new file mode 100644
index 0000000..359a18a
--- /dev/null
+++ b/src/scanopt.h
@@ -0,0 +1,132 @@
+/* flex - tool to generate fast lexical analyzers */
+
+/* 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. */
+
+#ifndef SCANOPT_H
+#define SCANOPT_H
+
+#include "flexdef.h"
+
+
+#ifndef NO_SCANOPT_USAGE
+/* Used by scanopt_usage for pretty-printing. */
+#ifdef HAVE_NCURSES_H
+#include <ncurses.h>
+#endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifndef PROTO
+#define PROTO(args) args
+#endif
+/* Error codes. */ enum scanopt_err_t {
+ SCANOPT_ERR_OPT_UNRECOGNIZED = -1, /* Unrecognized option. */
+ SCANOPT_ERR_OPT_AMBIGUOUS = -2, /* It matched more than one option name. */
+ SCANOPT_ERR_ARG_NOT_FOUND = -3, /* The required arg was not found. */
+ SCANOPT_ERR_ARG_NOT_ALLOWED = -4 /* Option does not take an argument. */
+ };
+
+
+/* flags passed to scanopt_init */
+ enum scanopt_flag_t {
+ SCANOPT_NO_ERR_MSG = 0x01 /* Suppress printing to stderr. */
+ };
+
+/* Specification for a single option. */
+ struct optspec_t {
+ const char *opt_fmt; /* e.g., "--foo=FILE", "-f FILE", "-n [NUM]" */
+ int r_val; /* Value to be returned by scanopt_ex(). */
+ const char *desc; /* Brief description of this option, or NULL. */
+ };
+ typedef struct optspec_t optspec_t;
+
+
+/* Used internally by scanopt() to maintain state. */
+/* Never modify these value directly. */
+ typedef void *scanopt_t;
+
+
+/* Initializes scanner and checks option list for errors.
+ * Parameters:
+ * options - Array of options.
+ * argc - Same as passed to main().
+ * argv - Same as passed to main(). First element is skipped.
+ * flags - Control behavior.
+ * Return: A malloc'd pointer .
+ */
+ scanopt_t *scanopt_init PROTO ((const optspec_t * options,
+ int argc, char **argv, int flags));
+
+/* Frees memory used by scanner.
+ * Always returns 0. */
+ int scanopt_destroy PROTO ((scanopt_t * scanner));
+
+#ifndef NO_SCANOPT_USAGE
+/* Prints a usage message based on contents of optlist.
+ * Parameters:
+ * scanner - The scanner, already initialized with scanopt_init().
+ * fp - The file stream to write to.
+ * usage - Text to be prepended to option list. May be NULL.
+ * Return: Always returns 0 (zero).
+ */
+ int scanopt_usage
+ PROTO (
+ (scanopt_t * scanner, FILE * fp,
+ const char *usage));
+#endif
+
+/* Scans command-line options in argv[].
+ * Parameters:
+ * scanner - The scanner, already initialized with scanopt_init().
+ * optarg - Return argument, may be NULL.
+ * On success, it points to start of an argument.
+ * optindex - Return argument, may be NULL.
+ * On success or failure, it is the index of this option.
+ * If return is zero, then optindex is the NEXT valid option index.
+ *
+ * Return: > 0 on success. Return value is from optspec_t->rval.
+ * == 0 if at end of options.
+ * < 0 on error (return value is an error code).
+ *
+ */
+ int scanopt
+ PROTO (
+ (scanopt_t * scanner, char **optarg,
+ int *optindex));
+
+#ifdef __cplusplus
+}
+#endif
+#endif
+/* vim:set tabstop=8 softtabstop=4 shiftwidth=4: */
diff --git a/src/sym.c b/src/sym.c
new file mode 100644
index 0000000..232cd0a
--- /dev/null
+++ b/src/sym.c
@@ -0,0 +1,272 @@
+/* sym - symbol table routines */
+
+/* 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"
+
+/* Variables for symbol tables:
+ * sctbl - start-condition symbol table
+ * ndtbl - name-definition symbol table
+ * ccltab - character class text symbol table
+ */
+
+struct hash_entry {
+ struct hash_entry *prev, *next;
+ char *name;
+ char *str_val;
+ int int_val;
+};
+
+typedef struct hash_entry **hash_table;
+
+#define NAME_TABLE_HASH_SIZE 101
+#define START_COND_HASH_SIZE 101
+#define CCL_HASH_SIZE 101
+
+static struct hash_entry *ndtbl[NAME_TABLE_HASH_SIZE];
+static struct hash_entry *sctbl[START_COND_HASH_SIZE];
+static struct hash_entry *ccltab[CCL_HASH_SIZE];
+
+
+/* declare functions that have forward references */
+
+static int addsym PROTO ((char[], char *, int, hash_table, int));
+static struct hash_entry *findsym PROTO ((const char *sym,
+ hash_table table,
+
+ int table_size));
+static int hashfunct PROTO ((const char *, int));
+
+
+/* addsym - add symbol and definitions to symbol table
+ *
+ * -1 is returned if the symbol already exists, and the change not made.
+ */
+
+static int addsym (sym, str_def, int_def, table, table_size)
+ char sym[];
+ char *str_def;
+ int int_def;
+ hash_table table;
+ int table_size;
+{
+ int hash_val = hashfunct (sym, table_size);
+ struct hash_entry *sym_entry = table[hash_val];
+ struct hash_entry *new_entry;
+ struct hash_entry *successor;
+
+ while (sym_entry) {
+ if (!strcmp (sym, sym_entry->name)) { /* entry already exists */
+ return -1;
+ }
+
+ sym_entry = sym_entry->next;
+ }
+
+ /* create new entry */
+ new_entry = (struct hash_entry *)
+ flex_alloc (sizeof (struct hash_entry));
+
+ if (new_entry == NULL)
+ flexfatal (_("symbol table memory allocation failed"));
+
+ if ((successor = table[hash_val]) != 0) {
+ new_entry->next = successor;
+ successor->prev = new_entry;
+ }
+ else
+ new_entry->next = NULL;
+
+ new_entry->prev = NULL;
+ new_entry->name = sym;
+ new_entry->str_val = str_def;
+ new_entry->int_val = int_def;
+
+ table[hash_val] = new_entry;
+
+ return 0;
+}
+
+
+/* cclinstal - save the text of a character class */
+
+void cclinstal (ccltxt, cclnum)
+ Char ccltxt[];
+ int cclnum;
+{
+ /* We don't bother checking the return status because we are not
+ * called unless the symbol is new.
+ */
+
+ (void) addsym ((char *) copy_unsigned_string (ccltxt),
+ (char *) 0, cclnum, ccltab, CCL_HASH_SIZE);
+}
+
+
+/* ccllookup - lookup the number associated with character class text
+ *
+ * Returns 0 if there's no CCL associated with the text.
+ */
+
+int ccllookup (ccltxt)
+ Char ccltxt[];
+{
+ return findsym ((char *) ccltxt, ccltab, CCL_HASH_SIZE)->int_val;
+}
+
+
+/* findsym - find symbol in symbol table */
+
+static struct hash_entry *findsym (sym, table, table_size)
+ const char *sym;
+ hash_table table;
+ int table_size;
+{
+ static struct hash_entry empty_entry = {
+ (struct hash_entry *) 0, (struct hash_entry *) 0,
+ (char *) 0, (char *) 0, 0,
+ };
+ struct hash_entry *sym_entry =
+
+ table[hashfunct (sym, table_size)];
+
+ while (sym_entry) {
+ if (!strcmp (sym, sym_entry->name))
+ return sym_entry;
+ sym_entry = sym_entry->next;
+ }
+
+ return &empty_entry;
+}
+
+/* hashfunct - compute the hash value for "str" and hash size "hash_size" */
+
+static int hashfunct (str, hash_size)
+ const char *str;
+ int hash_size;
+{
+ int hashval;
+ int locstr;
+
+ hashval = 0;
+ locstr = 0;
+
+ while (str[locstr]) {
+ hashval = (hashval << 1) + (unsigned char) str[locstr++];
+ hashval %= hash_size;
+ }
+
+ return hashval;
+}
+
+
+/* ndinstal - install a name definition */
+
+void ndinstal (name, definition)
+ const char *name;
+ Char definition[];
+{
+
+ if (addsym (copy_string (name),
+ (char *) copy_unsigned_string (definition), 0,
+ ndtbl, NAME_TABLE_HASH_SIZE))
+ synerr (_("name defined twice"));
+}
+
+
+/* ndlookup - lookup a name definition
+ *
+ * Returns a nil pointer if the name definition does not exist.
+ */
+
+Char *ndlookup (nd)
+ const char *nd;
+{
+ return (Char *) findsym (nd, ndtbl, NAME_TABLE_HASH_SIZE)->str_val;
+}
+
+
+/* scextend - increase the maximum number of start conditions */
+
+void scextend ()
+{
+ current_max_scs += MAX_SCS_INCREMENT;
+
+ ++num_reallocs;
+
+ scset = reallocate_integer_array (scset, current_max_scs);
+ scbol = reallocate_integer_array (scbol, current_max_scs);
+ scxclu = reallocate_integer_array (scxclu, current_max_scs);
+ sceof = reallocate_integer_array (sceof, current_max_scs);
+ scname = reallocate_char_ptr_array (scname, current_max_scs);
+}
+
+
+/* scinstal - make a start condition
+ *
+ * NOTE
+ * The start condition is "exclusive" if xcluflg is true.
+ */
+
+void scinstal (str, xcluflg)
+ const char *str;
+ int xcluflg;
+{
+
+ if (++lastsc >= current_max_scs)
+ scextend ();
+
+ scname[lastsc] = copy_string (str);
+
+ if (addsym (scname[lastsc], (char *) 0, lastsc,
+ sctbl, START_COND_HASH_SIZE))
+ format_pinpoint_message (_
+ ("start condition %s declared twice"),
+str);
+
+ scset[lastsc] = mkstate (SYM_EPSILON);
+ scbol[lastsc] = mkstate (SYM_EPSILON);
+ scxclu[lastsc] = xcluflg;
+ sceof[lastsc] = false;
+}
+
+
+/* sclookup - lookup the number associated with a start condition
+ *
+ * Returns 0 if no such start condition.
+ */
+
+int sclookup (str)
+ const char *str;
+{
+ return findsym (str, sctbl, START_COND_HASH_SIZE)->int_val;
+}
diff --git a/src/tables.c b/src/tables.c
new file mode 100644
index 0000000..ef49ad0
--- /dev/null
+++ b/src/tables.c
@@ -0,0 +1,502 @@
+/* tables.c - tables serialization code
+ *
+ * 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"
+
+/** Convert size_t to t_flag.
+ * @param n in {1,2,4}
+ * @return YYTD_DATA*.
+ */
+#define BYTES2TFLAG(n)\
+ (((n) == sizeof(flex_int8_t))\
+ ? YYTD_DATA8\
+ :(((n)== sizeof(flex_int16_t))\
+ ? YYTD_DATA16\
+ : YYTD_DATA32))
+
+/** Clear YYTD_DATA* bit flags
+ * @return the flag with the YYTD_DATA* bits cleared
+ */
+#define TFLAGS_CLRDATA(flg) ((flg) & ~(YYTD_DATA8 | YYTD_DATA16 | YYTD_DATA32))
+
+int yytbl_write32 (struct yytbl_writer *wr, flex_uint32_t v);
+int yytbl_write16 (struct yytbl_writer *wr, flex_uint16_t v);
+int yytbl_write8 (struct yytbl_writer *wr, flex_uint8_t v);
+int yytbl_writen (struct yytbl_writer *wr, void *v, flex_int32_t len);
+static flex_int32_t yytbl_data_geti (const struct yytbl_data *tbl, int i);
+/* XXX Not used
+static flex_int32_t yytbl_data_getijk (const struct yytbl_data *tbl, int i,
+ int j, int k);
+ */
+
+
+/** Initialize the table writer.
+ * @param wr an uninitialized writer
+ * @param out the output file
+ * @return 0 on success
+ */
+int yytbl_writer_init (struct yytbl_writer *wr, FILE * out)
+{
+ wr->out = out;
+ wr->total_written = 0;
+ return 0;
+}
+
+/** Initialize a table header.
+ * @param th The uninitialized structure
+ * @param version_str the version string
+ * @param name the name of this table set
+ */
+int yytbl_hdr_init (struct yytbl_hdr *th, const char *version_str,
+ const char *name)
+{
+ memset (th, 0, sizeof (struct yytbl_hdr));
+
+ th->th_magic = YYTBL_MAGIC;
+ th->th_hsize = 14 + strlen (version_str) + 1 + strlen (name) + 1;
+ th->th_hsize += yypad64 (th->th_hsize);
+ th->th_ssize = 0; // Not known at this point.
+ th->th_flags = 0;
+ th->th_version = copy_string (version_str);
+ th->th_name = copy_string (name);
+ return 0;
+}
+
+/** Allocate and initialize a table data structure.
+ * @param td a pointer to an uninitialized table
+ * @param id the table identifier
+ * @return 0 on success
+ */
+int yytbl_data_init (struct yytbl_data *td, enum yytbl_id id)
+{
+
+ memset (td, 0, sizeof (struct yytbl_data));
+ td->td_id = id;
+ td->td_flags = YYTD_DATA32;
+ return 0;
+}
+
+/** Clean up table and data array.
+ * @param td will be destroyed
+ * @return 0 on success
+ */
+int yytbl_data_destroy (struct yytbl_data *td)
+{
+ if (td->td_data)
+ free (td->td_data);
+ td->td_data = 0;
+ free (td);
+ return 0;
+}
+
+/** Write enough padding to bring the file pointer to a 64-bit boundary. */
+static int yytbl_write_pad64 (struct yytbl_writer *wr)
+{
+ int pad, bwritten = 0;
+
+ pad = yypad64 (wr->total_written);
+ while (pad-- > 0)
+ if (yytbl_write8 (wr, 0) < 0)
+ return -1;
+ else
+ bwritten++;
+ return bwritten;
+}
+
+/** write the header.
+ * @param wr the output stream
+ * @param th table header to be written
+ * @return -1 on error, or bytes written on success.
+ */
+int yytbl_hdr_fwrite (struct yytbl_writer *wr, const struct yytbl_hdr *th)
+{
+ int sz, rv;
+ int bwritten = 0;
+
+ if (yytbl_write32 (wr, th->th_magic) < 0
+ || yytbl_write32 (wr, th->th_hsize) < 0)
+ flex_die (_("th_magic|th_hsize write32 failed"));
+ bwritten += 8;
+
+ if (fgetpos (wr->out, &(wr->th_ssize_pos)) != 0)
+ flex_die (_("fgetpos failed"));
+
+ if (yytbl_write32 (wr, th->th_ssize) < 0
+ || yytbl_write16 (wr, th->th_flags) < 0)
+ flex_die (_("th_ssize|th_flags write failed"));
+ bwritten += 6;
+
+ sz = strlen (th->th_version) + 1;
+ if ((rv = yytbl_writen (wr, th->th_version, sz)) != sz)
+ flex_die (_("th_version writen failed"));
+ bwritten += rv;
+
+ sz = strlen (th->th_name) + 1;
+ if ((rv = yytbl_writen (wr, th->th_name, sz)) != sz)
+ flex_die (_("th_name writen failed"));
+ bwritten += rv;
+
+ /* add padding */
+ if ((rv = yytbl_write_pad64 (wr)) < 0)
+ flex_die (_("pad64 failed"));
+ bwritten += rv;
+
+ /* Sanity check */
+ if (bwritten != (int) th->th_hsize)
+ flex_die (_("pad64 failed"));
+
+ return bwritten;
+}
+
+
+/** Write this table.
+ * @param wr the file writer
+ * @param td table data to be written
+ * @return -1 on error, or bytes written on success.
+ */
+int yytbl_data_fwrite (struct yytbl_writer *wr, struct yytbl_data *td)
+{
+ int rv;
+ flex_int32_t bwritten = 0;
+ flex_int32_t i, total_len;
+ fpos_t pos;
+
+ if ((rv = yytbl_write16 (wr, td->td_id)) < 0)
+ return -1;
+ bwritten += rv;
+
+ if ((rv = yytbl_write16 (wr, td->td_flags)) < 0)
+ return -1;
+ bwritten += rv;
+
+ if ((rv = yytbl_write32 (wr, td->td_hilen)) < 0)
+ return -1;
+ bwritten += rv;
+
+ if ((rv = yytbl_write32 (wr, td->td_lolen)) < 0)
+ return -1;
+ bwritten += rv;
+
+ total_len = yytbl_calc_total_len (td);
+ for (i = 0; i < total_len; i++) {
+ switch (YYTDFLAGS2BYTES (td->td_flags)) {
+ case sizeof (flex_int8_t):
+ rv = yytbl_write8 (wr, yytbl_data_geti (td, i));
+ break;
+ case sizeof (flex_int16_t):
+ rv = yytbl_write16 (wr, yytbl_data_geti (td, i));
+ break;
+ case sizeof (flex_int32_t):
+ rv = yytbl_write32 (wr, yytbl_data_geti (td, i));
+ break;
+ default:
+ flex_die (_("invalid td_flags detected"));
+ }
+ if (rv < 0) {
+ flex_die (_("error while writing tables"));
+ return -1;
+ }
+ bwritten += rv;
+ }
+
+ /* Sanity check */
+ if (bwritten != (int) (12 + total_len * YYTDFLAGS2BYTES (td->td_flags))) {
+ flex_die (_("insanity detected"));
+ return -1;
+ }
+
+ /* add padding */
+ if ((rv = yytbl_write_pad64 (wr)) < 0) {
+ flex_die (_("pad64 failed"));
+ return -1;
+ }
+ bwritten += rv;
+
+ /* Now go back and update the th_hsize member */
+ if (fgetpos (wr->out, &pos) != 0
+ || fsetpos (wr->out, &(wr->th_ssize_pos)) != 0
+ || yytbl_write32 (wr, wr->total_written) < 0
+ || fsetpos (wr->out, &pos)) {
+ flex_die (_("get|set|fwrite32 failed"));
+ return -1;
+ }
+ else
+ /* Don't count the int we just wrote. */
+ wr->total_written -= sizeof (flex_int32_t);
+ return bwritten;
+}
+
+/** Write n bytes.
+ * @param wr the table writer
+ * @param v data to be written
+ * @param len number of bytes
+ * @return -1 on error. number of bytes written on success.
+ */
+int yytbl_writen (struct yytbl_writer *wr, void *v, flex_int32_t len)
+{
+ int rv;
+
+ rv = fwrite (v, 1, len, wr->out);
+ if (rv != len)
+ return -1;
+ wr->total_written += len;
+ return len;
+}
+
+/** Write four bytes in network byte order
+ * @param wr the table writer
+ * @param v a dword in host byte order
+ * @return -1 on error. number of bytes written on success.
+ */
+int yytbl_write32 (struct yytbl_writer *wr, flex_uint32_t v)
+{
+ flex_uint32_t vnet;
+ size_t bytes, rv;
+
+ vnet = htonl (v);
+ bytes = sizeof (flex_uint32_t);
+ rv = fwrite (&vnet, bytes, 1, wr->out);
+ if (rv != 1)
+ return -1;
+ wr->total_written += bytes;
+ return bytes;
+}
+
+/** Write two bytes in network byte order.
+ * @param wr the table writer
+ * @param v a word in host byte order
+ * @return -1 on error. number of bytes written on success.
+ */
+int yytbl_write16 (struct yytbl_writer *wr, flex_uint16_t v)
+{
+ flex_uint16_t vnet;
+ size_t bytes, rv;
+
+ vnet = htons (v);
+ bytes = sizeof (flex_uint16_t);
+ rv = fwrite (&vnet, bytes, 1, wr->out);
+ if (rv != 1)
+ return -1;
+ wr->total_written += bytes;
+ return bytes;
+}
+
+/** Write a byte.
+ * @param wr the table writer
+ * @param v the value to be written
+ * @return -1 on error. number of bytes written on success.
+ */
+int yytbl_write8 (struct yytbl_writer *wr, flex_uint8_t v)
+{
+ size_t bytes, rv;
+
+ bytes = sizeof (flex_uint8_t);
+ rv = fwrite (&v, bytes, 1, wr->out);
+ if (rv != 1)
+ return -1;
+ wr->total_written += bytes;
+ return bytes;
+}
+
+
+/* XXX Not Used */
+#if 0
+/** Extract data element [i][j] from array data tables.
+ * @param tbl data table
+ * @param i index into higher dimension array. i should be zero for one-dimensional arrays.
+ * @param j index into lower dimension array.
+ * @param k index into struct, must be 0 or 1. Only valid for YYTD_ID_TRANSITION table
+ * @return data[i][j + k]
+ */
+static flex_int32_t yytbl_data_getijk (const struct yytbl_data *tbl, int i,
+ int j, int k)
+{
+ flex_int32_t lo;
+
+ k %= 2;
+ lo = tbl->td_lolen;
+
+ switch (YYTDFLAGS2BYTES (tbl->td_flags)) {
+ case sizeof (flex_int8_t):
+ return ((flex_int8_t *) (tbl->td_data))[(i * lo + j) * (k + 1) +
+ k];
+ case sizeof (flex_int16_t):
+ return ((flex_int16_t *) (tbl->td_data))[(i * lo + j) * (k +
+ 1) +
+ k];
+ case sizeof (flex_int32_t):
+ return ((flex_int32_t *) (tbl->td_data))[(i * lo + j) * (k +
+ 1) +
+ k];
+ default:
+ flex_die (_("invalid td_flags detected"));
+ break;
+ }
+
+ return 0;
+}
+#endif /* Not used */
+
+/** Extract data element [i] from array data tables treated as a single flat array of integers.
+ * Be careful for 2-dimensional arrays or for YYTD_ID_TRANSITION, which is an array
+ * of structs.
+ * @param tbl data table
+ * @param i index into array.
+ * @return data[i]
+ */
+static flex_int32_t yytbl_data_geti (const struct yytbl_data *tbl, int i)
+{
+
+ switch (YYTDFLAGS2BYTES (tbl->td_flags)) {
+ case sizeof (flex_int8_t):
+ return ((flex_int8_t *) (tbl->td_data))[i];
+ case sizeof (flex_int16_t):
+ return ((flex_int16_t *) (tbl->td_data))[i];
+ case sizeof (flex_int32_t):
+ return ((flex_int32_t *) (tbl->td_data))[i];
+ default:
+ flex_die (_("invalid td_flags detected"));
+ break;
+ }
+ return 0;
+}
+
+/** Set data element [i] in array data tables treated as a single flat array of integers.
+ * Be careful for 2-dimensional arrays or for YYTD_ID_TRANSITION, which is an array
+ * of structs.
+ * @param tbl data table
+ * @param i index into array.
+ * @param newval new value for data[i]
+ */
+static void yytbl_data_seti (const struct yytbl_data *tbl, int i,
+ flex_int32_t newval)
+{
+
+ switch (YYTDFLAGS2BYTES (tbl->td_flags)) {
+ case sizeof (flex_int8_t):
+ ((flex_int8_t *) (tbl->td_data))[i] = (flex_int8_t) newval;
+ break;
+ case sizeof (flex_int16_t):
+ ((flex_int16_t *) (tbl->td_data))[i] = (flex_int16_t) newval;
+ break;
+ case sizeof (flex_int32_t):
+ ((flex_int32_t *) (tbl->td_data))[i] = (flex_int32_t) newval;
+ break;
+ default:
+ flex_die (_("invalid td_flags detected"));
+ break;
+ }
+}
+
+/** Calculate the number of bytes needed to hold the largest
+ * absolute value in this data array.
+ * @param tbl the data table
+ * @return sizeof(n) where n in {flex_int8_t, flex_int16_t, flex_int32_t}
+ */
+static size_t min_int_size (struct yytbl_data *tbl)
+{
+ flex_uint32_t i, total_len;
+ flex_int32_t max = 0;
+
+ total_len = yytbl_calc_total_len (tbl);
+
+ for (i = 0; i < total_len; i++) {
+ flex_int32_t n;
+
+ n = abs (yytbl_data_geti (tbl, i));
+
+ if (n > max)
+ max = n;
+ }
+
+ if (max <= INT8_MAX)
+ return sizeof (flex_int8_t);
+ else if (max <= INT16_MAX)
+ return sizeof (flex_int16_t);
+ else
+ return sizeof (flex_int32_t);
+}
+
+/** Transform data to smallest possible of (int32, int16, int8).
+ * For example, we may have generated an int32 array due to user options
+ * (e.g., %option align), but if the maximum value in that array
+ * is 80 (for example), then we can serialize it with only 1 byte per int.
+ * This is NOT the same as compressed DFA tables. We're just trying
+ * to save storage space here.
+ *
+ * @param tbl the table to be compressed
+ */
+void yytbl_data_compress (struct yytbl_data *tbl)
+{
+ flex_int32_t i, newsz, total_len;
+ struct yytbl_data newtbl;
+
+ yytbl_data_init (&newtbl, tbl->td_id);
+ newtbl.td_hilen = tbl->td_hilen;
+ newtbl.td_lolen = tbl->td_lolen;
+ newtbl.td_flags = tbl->td_flags;
+
+ newsz = min_int_size (tbl);
+
+
+ if (newsz == (int) YYTDFLAGS2BYTES (tbl->td_flags))
+ /* No change in this table needed. */
+ return;
+
+ if (newsz > (int) YYTDFLAGS2BYTES (tbl->td_flags)) {
+ flex_die (_("detected negative compression"));
+ return;
+ }
+
+ total_len = yytbl_calc_total_len (tbl);
+ newtbl.td_data = calloc (total_len, newsz);
+ newtbl.td_flags =
+ TFLAGS_CLRDATA (newtbl.td_flags) | BYTES2TFLAG (newsz);
+
+ for (i = 0; i < total_len; i++) {
+ flex_int32_t g;
+
+ g = yytbl_data_geti (tbl, i);
+ yytbl_data_seti (&newtbl, i, g);
+ }
+
+
+ /* Now copy over the old table */
+ free (tbl->td_data);
+ *tbl = newtbl;
+}
+
+/* vim:set noexpandtab cindent tabstop=8 softtabstop=0 shiftwidth=8 textwidth=0: */
diff --git a/src/tables.h b/src/tables.h
new file mode 100644
index 0000000..2e4afe5
--- /dev/null
+++ b/src/tables.h
@@ -0,0 +1,85 @@
+/* tables.h - tables serialization code
+ *
+ * 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.
+ */
+
+#ifndef TABLES_H
+#define TABLES_H
+
+#ifdef __cplusplus
+/* *INDENT-OFF* */
+extern "C" {
+/* *INDENT-ON* */
+#endif
+
+/* Tables serialization API declarations. */
+#include "tables_shared.h"
+struct yytbl_writer {
+ FILE *out;
+ flex_uint32_t total_written;
+ /**< bytes written so far */
+ fpos_t th_ssize_pos;
+ /**< position of th_ssize */
+};
+
+/* These are used by main.c, gen.c, etc.
+ * tablesext - if true, create external tables
+ * tablesfilename - filename for external tables
+ * tablesname - name that goes in serialized data, e.g., "yytables"
+ * tableswr - writer for external tables
+ * tablesverify - true if tables-verify option specified
+ * gentables - true if we should spit out the normal C tables
+ */
+extern bool tablesext, tablesverify,gentables;
+extern char *tablesfilename, *tablesname;
+extern struct yytbl_writer tableswr;
+
+int yytbl_writer_init (struct yytbl_writer *, FILE *);
+int yytbl_hdr_init (struct yytbl_hdr *th, const char *version_str,
+ const char *name);
+int yytbl_data_init (struct yytbl_data *tbl, enum yytbl_id id);
+int yytbl_data_destroy (struct yytbl_data *td);
+int yytbl_hdr_fwrite (struct yytbl_writer *wr,
+ const struct yytbl_hdr *th);
+int yytbl_data_fwrite (struct yytbl_writer *wr, struct yytbl_data *td);
+void yytbl_data_compress (struct yytbl_data *tbl);
+struct yytbl_data *mkftbl (void);
+
+
+#ifdef __cplusplus
+/* *INDENT-OFF* */
+}
+/* *INDENT-ON* */
+#endif
+#endif
+
+/* vim:set expandtab cindent tabstop=4 softtabstop=4 shiftwidth=4 textwidth=0: */
diff --git a/src/tables_shared.c b/src/tables_shared.c
new file mode 100644
index 0000000..123626c
--- /dev/null
+++ b/src/tables_shared.c
@@ -0,0 +1,70 @@
+#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 tbl 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;
+}
diff --git a/src/tables_shared.h b/src/tables_shared.h
new file mode 100644
index 0000000..bbf9910
--- /dev/null
+++ b/src/tables_shared.h
@@ -0,0 +1,144 @@
+#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: */
diff --git a/src/tblcmp.c b/src/tblcmp.c
new file mode 100644
index 0000000..0c058e6
--- /dev/null
+++ b/src/tblcmp.c
@@ -0,0 +1,853 @@
+/* tblcmp - table compression routines */
+
+/* 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"
+
+
+/* declarations for functions that have forward references */
+
+void mkentry PROTO ((int *, int, int, int, int));
+void mkprot PROTO ((int[], int, int));
+void mktemplate PROTO ((int[], int, int));
+void mv2front PROTO ((int));
+int tbldiff PROTO ((int[], int, int[]));
+
+
+/* bldtbl - build table entries for dfa state
+ *
+ * synopsis
+ * int state[numecs], statenum, totaltrans, comstate, comfreq;
+ * bldtbl( state, statenum, totaltrans, comstate, comfreq );
+ *
+ * State is the statenum'th dfa state. It is indexed by equivalence class and
+ * gives the number of the state to enter for a given equivalence class.
+ * totaltrans is the total number of transitions out of the state. Comstate
+ * is that state which is the destination of the most transitions out of State.
+ * Comfreq is how many transitions there are out of State to Comstate.
+ *
+ * A note on terminology:
+ * "protos" are transition tables which have a high probability of
+ * either being redundant (a state processed later will have an identical
+ * transition table) or nearly redundant (a state processed later will have
+ * many of the same out-transitions). A "most recently used" queue of
+ * protos is kept around with the hope that most states will find a proto
+ * which is similar enough to be usable, and therefore compacting the
+ * output tables.
+ * "templates" are a special type of proto. If a transition table is
+ * homogeneous or nearly homogeneous (all transitions go to the same
+ * destination) then the odds are good that future states will also go
+ * to the same destination state on basically the same character set.
+ * These homogeneous states are so common when dealing with large rule
+ * sets that they merit special attention. If the transition table were
+ * simply made into a proto, then (typically) each subsequent, similar
+ * state will differ from the proto for two out-transitions. One of these
+ * out-transitions will be that character on which the proto does not go
+ * to the common destination, and one will be that character on which the
+ * state does not go to the common destination. Templates, on the other
+ * hand, go to the common state on EVERY transition character, and therefore
+ * cost only one difference.
+ */
+
+void bldtbl (state, statenum, totaltrans, comstate, comfreq)
+ int state[], statenum, totaltrans, comstate, comfreq;
+{
+ int extptr, extrct[2][CSIZE + 1];
+ int mindiff, minprot, i, d;
+
+ /* If extptr is 0 then the first array of extrct holds the result
+ * of the "best difference" to date, which is those transitions
+ * which occur in "state" but not in the proto which, to date,
+ * has the fewest differences between itself and "state". If
+ * extptr is 1 then the second array of extrct hold the best
+ * difference. The two arrays are toggled between so that the
+ * best difference to date can be kept around and also a difference
+ * just created by checking against a candidate "best" proto.
+ */
+
+ extptr = 0;
+
+ /* If the state has too few out-transitions, don't bother trying to
+ * compact its tables.
+ */
+
+ if ((totaltrans * 100) < (numecs * PROTO_SIZE_PERCENTAGE))
+ mkentry (state, numecs, statenum, JAMSTATE, totaltrans);
+
+ else {
+ /* "checkcom" is true if we should only check "state" against
+ * protos which have the same "comstate" value.
+ */
+ int checkcom =
+
+ comfreq * 100 > totaltrans * CHECK_COM_PERCENTAGE;
+
+ minprot = firstprot;
+ mindiff = totaltrans;
+
+ if (checkcom) {
+ /* Find first proto which has the same "comstate". */
+ for (i = firstprot; i != NIL; i = protnext[i])
+ if (protcomst[i] == comstate) {
+ minprot = i;
+ mindiff = tbldiff (state, minprot,
+ extrct[extptr]);
+ break;
+ }
+ }
+
+ else {
+ /* Since we've decided that the most common destination
+ * out of "state" does not occur with a high enough
+ * frequency, we set the "comstate" to zero, assuring
+ * that if this state is entered into the proto list,
+ * it will not be considered a template.
+ */
+ comstate = 0;
+
+ if (firstprot != NIL) {
+ minprot = firstprot;
+ mindiff = tbldiff (state, minprot,
+ extrct[extptr]);
+ }
+ }
+
+ /* We now have the first interesting proto in "minprot". If
+ * it matches within the tolerances set for the first proto,
+ * we don't want to bother scanning the rest of the proto list
+ * to see if we have any other reasonable matches.
+ */
+
+ if (mindiff * 100 >
+ totaltrans * FIRST_MATCH_DIFF_PERCENTAGE) {
+ /* Not a good enough match. Scan the rest of the
+ * protos.
+ */
+ for (i = minprot; i != NIL; i = protnext[i]) {
+ d = tbldiff (state, i, extrct[1 - extptr]);
+ if (d < mindiff) {
+ extptr = 1 - extptr;
+ mindiff = d;
+ minprot = i;
+ }
+ }
+ }
+
+ /* Check if the proto we've decided on as our best bet is close
+ * enough to the state we want to match to be usable.
+ */
+
+ if (mindiff * 100 >
+ totaltrans * ACCEPTABLE_DIFF_PERCENTAGE) {
+ /* No good. If the state is homogeneous enough,
+ * we make a template out of it. Otherwise, we
+ * make a proto.
+ */
+
+ if (comfreq * 100 >=
+ totaltrans * TEMPLATE_SAME_PERCENTAGE)
+ mktemplate (state, statenum,
+ comstate);
+
+ else {
+ mkprot (state, statenum, comstate);
+ mkentry (state, numecs, statenum,
+ JAMSTATE, totaltrans);
+ }
+ }
+
+ else { /* use the proto */
+ mkentry (extrct[extptr], numecs, statenum,
+ prottbl[minprot], mindiff);
+
+ /* If this state was sufficiently different from the
+ * proto we built it from, make it, too, a proto.
+ */
+
+ if (mindiff * 100 >=
+ totaltrans * NEW_PROTO_DIFF_PERCENTAGE)
+ mkprot (state, statenum, comstate);
+
+ /* Since mkprot added a new proto to the proto queue,
+ * it's possible that "minprot" is no longer on the
+ * proto queue (if it happened to have been the last
+ * entry, it would have been bumped off). If it's
+ * not there, then the new proto took its physical
+ * place (though logically the new proto is at the
+ * beginning of the queue), so in that case the
+ * following call will do nothing.
+ */
+
+ mv2front (minprot);
+ }
+ }
+}
+
+
+/* cmptmps - compress template table entries
+ *
+ * Template tables are compressed by using the 'template equivalence
+ * classes', which are collections of transition character equivalence
+ * classes which always appear together in templates - really meta-equivalence
+ * classes.
+ */
+
+void cmptmps ()
+{
+ int tmpstorage[CSIZE + 1];
+ int *tmp = tmpstorage, i, j;
+ int totaltrans, trans;
+
+ peakpairs = numtemps * numecs + tblend;
+
+ if (usemecs) {
+ /* Create equivalence classes based on data gathered on
+ * template transitions.
+ */
+ nummecs = cre8ecs (tecfwd, tecbck, numecs);
+ }
+
+ else
+ nummecs = numecs;
+
+ while (lastdfa + numtemps + 1 >= current_max_dfas)
+ increase_max_dfas ();
+
+ /* Loop through each template. */
+
+ for (i = 1; i <= numtemps; ++i) {
+ /* Number of non-jam transitions out of this template. */
+ totaltrans = 0;
+
+ for (j = 1; j <= numecs; ++j) {
+ trans = tnxt[numecs * i + j];
+
+ if (usemecs) {
+ /* The absolute value of tecbck is the
+ * meta-equivalence class of a given
+ * equivalence class, as set up by cre8ecs().
+ */
+ if (tecbck[j] > 0) {
+ tmp[tecbck[j]] = trans;
+
+ if (trans > 0)
+ ++totaltrans;
+ }
+ }
+
+ else {
+ tmp[j] = trans;
+
+ if (trans > 0)
+ ++totaltrans;
+ }
+ }
+
+ /* It is assumed (in a rather subtle way) in the skeleton
+ * that if we're using meta-equivalence classes, the def[]
+ * entry for all templates is the jam template, i.e.,
+ * templates never default to other non-jam table entries
+ * (e.g., another template)
+ */
+
+ /* Leave room for the jam-state after the last real state. */
+ mkentry (tmp, nummecs, lastdfa + i + 1, JAMSTATE,
+ totaltrans);
+ }
+}
+
+
+
+/* expand_nxt_chk - expand the next check arrays */
+
+void expand_nxt_chk ()
+{
+ int old_max = current_max_xpairs;
+
+ current_max_xpairs += MAX_XPAIRS_INCREMENT;
+
+ ++num_reallocs;
+
+ nxt = reallocate_integer_array (nxt, current_max_xpairs);
+ chk = reallocate_integer_array (chk, current_max_xpairs);
+
+ zero_out ((char *) (chk + old_max),
+ (size_t) (MAX_XPAIRS_INCREMENT * sizeof (int)));
+}
+
+
+/* find_table_space - finds a space in the table for a state to be placed
+ *
+ * synopsis
+ * int *state, numtrans, block_start;
+ * int find_table_space();
+ *
+ * block_start = find_table_space( state, numtrans );
+ *
+ * State is the state to be added to the full speed transition table.
+ * Numtrans is the number of out-transitions for the state.
+ *
+ * find_table_space() returns the position of the start of the first block (in
+ * chk) able to accommodate the state
+ *
+ * In determining if a state will or will not fit, find_table_space() must take
+ * into account the fact that an end-of-buffer state will be added at [0],
+ * and an action number will be added in [-1].
+ */
+
+int find_table_space (state, numtrans)
+ int *state, numtrans;
+{
+ /* Firstfree is the position of the first possible occurrence of two
+ * consecutive unused records in the chk and nxt arrays.
+ */
+ int i;
+ int *state_ptr, *chk_ptr;
+ int *ptr_to_last_entry_in_state;
+
+ /* If there are too many out-transitions, put the state at the end of
+ * nxt and chk.
+ */
+ if (numtrans > MAX_XTIONS_FULL_INTERIOR_FIT) {
+ /* If table is empty, return the first available spot in
+ * chk/nxt, which should be 1.
+ */
+ if (tblend < 2)
+ return 1;
+
+ /* Start searching for table space near the end of
+ * chk/nxt arrays.
+ */
+ i = tblend - numecs;
+ }
+
+ else
+ /* Start searching for table space from the beginning
+ * (skipping only the elements which will definitely not
+ * hold the new state).
+ */
+ i = firstfree;
+
+ while (1) { /* loops until a space is found */
+ while (i + numecs >= current_max_xpairs)
+ expand_nxt_chk ();
+
+ /* Loops until space for end-of-buffer and action number
+ * are found.
+ */
+ while (1) {
+ /* Check for action number space. */
+ if (chk[i - 1] == 0) {
+ /* Check for end-of-buffer space. */
+ if (chk[i] == 0)
+ break;
+
+ else
+ /* Since i != 0, there is no use
+ * checking to see if (++i) - 1 == 0,
+ * because that's the same as i == 0,
+ * so we skip a space.
+ */
+ i += 2;
+ }
+
+ else
+ ++i;
+
+ while (i + numecs >= current_max_xpairs)
+ expand_nxt_chk ();
+ }
+
+ /* If we started search from the beginning, store the new
+ * firstfree for the next call of find_table_space().
+ */
+ if (numtrans <= MAX_XTIONS_FULL_INTERIOR_FIT)
+ firstfree = i + 1;
+
+ /* Check to see if all elements in chk (and therefore nxt)
+ * that are needed for the new state have not yet been taken.
+ */
+
+ state_ptr = &state[1];
+ ptr_to_last_entry_in_state = &chk[i + numecs + 1];
+
+ for (chk_ptr = &chk[i + 1];
+ chk_ptr != ptr_to_last_entry_in_state; ++chk_ptr)
+ if (*(state_ptr++) != 0 && *chk_ptr != 0)
+ break;
+
+ if (chk_ptr == ptr_to_last_entry_in_state)
+ return i;
+
+ else
+ ++i;
+ }
+}
+
+
+/* inittbl - initialize transition tables
+ *
+ * Initializes "firstfree" to be one beyond the end of the table. Initializes
+ * all "chk" entries to be zero.
+ */
+void inittbl ()
+{
+ int i;
+
+ zero_out ((char *) chk,
+
+ (size_t) (current_max_xpairs * sizeof (int)));
+
+ tblend = 0;
+ firstfree = tblend + 1;
+ numtemps = 0;
+
+ if (usemecs) {
+ /* Set up doubly-linked meta-equivalence classes; these
+ * are sets of equivalence classes which all have identical
+ * transitions out of TEMPLATES.
+ */
+
+ tecbck[1] = NIL;
+
+ for (i = 2; i <= numecs; ++i) {
+ tecbck[i] = i - 1;
+ tecfwd[i - 1] = i;
+ }
+
+ tecfwd[numecs] = NIL;
+ }
+}
+
+
+/* mkdeftbl - make the default, "jam" table entries */
+
+void mkdeftbl ()
+{
+ int i;
+
+ jamstate = lastdfa + 1;
+
+ ++tblend; /* room for transition on end-of-buffer character */
+
+ while (tblend + numecs >= current_max_xpairs)
+ expand_nxt_chk ();
+
+ /* Add in default end-of-buffer transition. */
+ nxt[tblend] = end_of_buffer_state;
+ chk[tblend] = jamstate;
+
+ for (i = 1; i <= numecs; ++i) {
+ nxt[tblend + i] = 0;
+ chk[tblend + i] = jamstate;
+ }
+
+ jambase = tblend;
+
+ base[jamstate] = jambase;
+ def[jamstate] = 0;
+
+ tblend += numecs;
+ ++numtemps;
+}
+
+
+/* mkentry - create base/def and nxt/chk entries for transition array
+ *
+ * synopsis
+ * int state[numchars + 1], numchars, statenum, deflink, totaltrans;
+ * mkentry( state, numchars, statenum, deflink, totaltrans );
+ *
+ * "state" is a transition array "numchars" characters in size, "statenum"
+ * is the offset to be used into the base/def tables, and "deflink" is the
+ * entry to put in the "def" table entry. If "deflink" is equal to
+ * "JAMSTATE", then no attempt will be made to fit zero entries of "state"
+ * (i.e., jam entries) into the table. It is assumed that by linking to
+ * "JAMSTATE" they will be taken care of. In any case, entries in "state"
+ * marking transitions to "SAME_TRANS" are treated as though they will be
+ * taken care of by whereever "deflink" points. "totaltrans" is the total
+ * number of transitions out of the state. If it is below a certain threshold,
+ * the tables are searched for an interior spot that will accommodate the
+ * state array.
+ */
+
+void mkentry (state, numchars, statenum, deflink, totaltrans)
+ int *state;
+ int numchars, statenum, deflink, totaltrans;
+{
+ int minec, maxec, i, baseaddr;
+ int tblbase, tbllast;
+
+ if (totaltrans == 0) { /* there are no out-transitions */
+ if (deflink == JAMSTATE)
+ base[statenum] = JAMSTATE;
+ else
+ base[statenum] = 0;
+
+ def[statenum] = deflink;
+ return;
+ }
+
+ for (minec = 1; minec <= numchars; ++minec) {
+ if (state[minec] != SAME_TRANS)
+ if (state[minec] != 0 || deflink != JAMSTATE)
+ break;
+ }
+
+ if (totaltrans == 1) {
+ /* There's only one out-transition. Save it for later to fill
+ * in holes in the tables.
+ */
+ stack1 (statenum, minec, state[minec], deflink);
+ return;
+ }
+
+ for (maxec = numchars; maxec > 0; --maxec) {
+ if (state[maxec] != SAME_TRANS)
+ if (state[maxec] != 0 || deflink != JAMSTATE)
+ break;
+ }
+
+ /* Whether we try to fit the state table in the middle of the table
+ * entries we have already generated, or if we just take the state
+ * table at the end of the nxt/chk tables, we must make sure that we
+ * have a valid base address (i.e., non-negative). Note that
+ * negative base addresses dangerous at run-time (because indexing
+ * the nxt array with one and a low-valued character will access
+ * memory before the start of the array.
+ */
+
+ /* Find the first transition of state that we need to worry about. */
+ if (totaltrans * 100 <= numchars * INTERIOR_FIT_PERCENTAGE) {
+ /* Attempt to squeeze it into the middle of the tables. */
+ baseaddr = firstfree;
+
+ while (baseaddr < minec) {
+ /* Using baseaddr would result in a negative base
+ * address below; find the next free slot.
+ */
+ for (++baseaddr; chk[baseaddr] != 0; ++baseaddr) ;
+ }
+
+ while (baseaddr + maxec - minec + 1 >= current_max_xpairs)
+ expand_nxt_chk ();
+
+ for (i = minec; i <= maxec; ++i)
+ if (state[i] != SAME_TRANS &&
+ (state[i] != 0 || deflink != JAMSTATE) &&
+ chk[baseaddr + i - minec] != 0) { /* baseaddr unsuitable - find another */
+ for (++baseaddr;
+ baseaddr < current_max_xpairs &&
+ chk[baseaddr] != 0; ++baseaddr) ;
+
+ while (baseaddr + maxec - minec + 1 >=
+ current_max_xpairs)
+ expand_nxt_chk ();
+
+ /* Reset the loop counter so we'll start all
+ * over again next time it's incremented.
+ */
+
+ i = minec - 1;
+ }
+ }
+
+ else {
+ /* Ensure that the base address we eventually generate is
+ * non-negative.
+ */
+ baseaddr = MAX (tblend + 1, minec);
+ }
+
+ tblbase = baseaddr - minec;
+ tbllast = tblbase + maxec;
+
+ while (tbllast + 1 >= current_max_xpairs)
+ expand_nxt_chk ();
+
+ base[statenum] = tblbase;
+ def[statenum] = deflink;
+
+ for (i = minec; i <= maxec; ++i)
+ if (state[i] != SAME_TRANS)
+ if (state[i] != 0 || deflink != JAMSTATE) {
+ nxt[tblbase + i] = state[i];
+ chk[tblbase + i] = statenum;
+ }
+
+ if (baseaddr == firstfree)
+ /* Find next free slot in tables. */
+ for (++firstfree; chk[firstfree] != 0; ++firstfree) ;
+
+ tblend = MAX (tblend, tbllast);
+}
+
+
+/* mk1tbl - create table entries for a state (or state fragment) which
+ * has only one out-transition
+ */
+
+void mk1tbl (state, sym, onenxt, onedef)
+ int state, sym, onenxt, onedef;
+{
+ if (firstfree < sym)
+ firstfree = sym;
+
+ while (chk[firstfree] != 0)
+ if (++firstfree >= current_max_xpairs)
+ expand_nxt_chk ();
+
+ base[state] = firstfree - sym;
+ def[state] = onedef;
+ chk[firstfree] = state;
+ nxt[firstfree] = onenxt;
+
+ if (firstfree > tblend) {
+ tblend = firstfree++;
+
+ if (firstfree >= current_max_xpairs)
+ expand_nxt_chk ();
+ }
+}
+
+
+/* mkprot - create new proto entry */
+
+void mkprot (state, statenum, comstate)
+ int state[], statenum, comstate;
+{
+ int i, slot, tblbase;
+
+ if (++numprots >= MSP || numecs * numprots >= PROT_SAVE_SIZE) {
+ /* Gotta make room for the new proto by dropping last entry in
+ * the queue.
+ */
+ slot = lastprot;
+ lastprot = protprev[lastprot];
+ protnext[lastprot] = NIL;
+ }
+
+ else
+ slot = numprots;
+
+ protnext[slot] = firstprot;
+
+ if (firstprot != NIL)
+ protprev[firstprot] = slot;
+
+ firstprot = slot;
+ prottbl[slot] = statenum;
+ protcomst[slot] = comstate;
+
+ /* Copy state into save area so it can be compared with rapidly. */
+ tblbase = numecs * (slot - 1);
+
+ for (i = 1; i <= numecs; ++i)
+ protsave[tblbase + i] = state[i];
+}
+
+
+/* mktemplate - create a template entry based on a state, and connect the state
+ * to it
+ */
+
+void mktemplate (state, statenum, comstate)
+ int state[], statenum, comstate;
+{
+ int i, numdiff, tmpbase, tmp[CSIZE + 1];
+ Char transset[CSIZE + 1];
+ int tsptr;
+
+ ++numtemps;
+
+ tsptr = 0;
+
+ /* Calculate where we will temporarily store the transition table
+ * of the template in the tnxt[] array. The final transition table
+ * gets created by cmptmps().
+ */
+
+ tmpbase = numtemps * numecs;
+
+ if (tmpbase + numecs >= current_max_template_xpairs) {
+ current_max_template_xpairs +=
+ MAX_TEMPLATE_XPAIRS_INCREMENT;
+
+ ++num_reallocs;
+
+ tnxt = reallocate_integer_array (tnxt,
+ current_max_template_xpairs);
+ }
+
+ for (i = 1; i <= numecs; ++i)
+ if (state[i] == 0)
+ tnxt[tmpbase + i] = 0;
+ else {
+ transset[tsptr++] = i;
+ tnxt[tmpbase + i] = comstate;
+ }
+
+ if (usemecs)
+ mkeccl (transset, tsptr, tecfwd, tecbck, numecs, 0);
+
+ mkprot (tnxt + tmpbase, -numtemps, comstate);
+
+ /* We rely on the fact that mkprot adds things to the beginning
+ * of the proto queue.
+ */
+
+ numdiff = tbldiff (state, firstprot, tmp);
+ mkentry (tmp, numecs, statenum, -numtemps, numdiff);
+}
+
+
+/* mv2front - move proto queue element to front of queue */
+
+void mv2front (qelm)
+ int qelm;
+{
+ if (firstprot != qelm) {
+ if (qelm == lastprot)
+ lastprot = protprev[lastprot];
+
+ protnext[protprev[qelm]] = protnext[qelm];
+
+ if (protnext[qelm] != NIL)
+ protprev[protnext[qelm]] = protprev[qelm];
+
+ protprev[qelm] = NIL;
+ protnext[qelm] = firstprot;
+ protprev[firstprot] = qelm;
+ firstprot = qelm;
+ }
+}
+
+
+/* place_state - place a state into full speed transition table
+ *
+ * State is the statenum'th state. It is indexed by equivalence class and
+ * gives the number of the state to enter for a given equivalence class.
+ * Transnum is the number of out-transitions for the state.
+ */
+
+void place_state (state, statenum, transnum)
+ int *state, statenum, transnum;
+{
+ int i;
+ int *state_ptr;
+ int position = find_table_space (state, transnum);
+
+ /* "base" is the table of start positions. */
+ base[statenum] = position;
+
+ /* Put in action number marker; this non-zero number makes sure that
+ * find_table_space() knows that this position in chk/nxt is taken
+ * and should not be used for another accepting number in another
+ * state.
+ */
+ chk[position - 1] = 1;
+
+ /* Put in end-of-buffer marker; this is for the same purposes as
+ * above.
+ */
+ chk[position] = 1;
+
+ /* Place the state into chk and nxt. */
+ state_ptr = &state[1];
+
+ for (i = 1; i <= numecs; ++i, ++state_ptr)
+ if (*state_ptr != 0) {
+ chk[position + i] = i;
+ nxt[position + i] = *state_ptr;
+ }
+
+ if (position + numecs > tblend)
+ tblend = position + numecs;
+}
+
+
+/* stack1 - save states with only one out-transition to be processed later
+ *
+ * If there's room for another state on the "one-transition" stack, the
+ * state is pushed onto it, to be processed later by mk1tbl. If there's
+ * no room, we process the sucker right now.
+ */
+
+void stack1 (statenum, sym, nextstate, deflink)
+ int statenum, sym, nextstate, deflink;
+{
+ if (onesp >= ONE_STACK_SIZE - 1)
+ mk1tbl (statenum, sym, nextstate, deflink);
+
+ else {
+ ++onesp;
+ onestate[onesp] = statenum;
+ onesym[onesp] = sym;
+ onenext[onesp] = nextstate;
+ onedef[onesp] = deflink;
+ }
+}
+
+
+/* tbldiff - compute differences between two state tables
+ *
+ * "state" is the state array which is to be extracted from the pr'th
+ * proto. "pr" is both the number of the proto we are extracting from
+ * and an index into the save area where we can find the proto's complete
+ * state table. Each entry in "state" which differs from the corresponding
+ * entry of "pr" will appear in "ext".
+ *
+ * Entries which are the same in both "state" and "pr" will be marked
+ * as transitions to "SAME_TRANS" in "ext". The total number of differences
+ * between "state" and "pr" is returned as function value. Note that this
+ * number is "numecs" minus the number of "SAME_TRANS" entries in "ext".
+ */
+
+int tbldiff (state, pr, ext)
+ int state[], pr, ext[];
+{
+ int i, *sp = state, *ep = ext, *protp;
+ int numdiff = 0;
+
+ protp = &protsave[numecs * (pr - 1)];
+
+ for (i = numecs; i > 0; --i) {
+ if (*++protp == *++sp)
+ *++ep = SAME_TRANS;
+ else {
+ *++ep = *sp;
+ ++numdiff;
+ }
+ }
+
+ return numdiff;
+}
diff --git a/src/version.h b/src/version.h
new file mode 100644
index 0000000..b9e5d6c
--- /dev/null
+++ b/src/version.h
@@ -0,0 +1 @@
+#define FLEX_VERSION VERSION
diff --git a/src/yylex.c b/src/yylex.c
new file mode 100644
index 0000000..17b3e61
--- /dev/null
+++ b/src/yylex.c
@@ -0,0 +1,212 @@
+/* yylex - scanner front-end for flex */
+
+/* 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 <ctype.h>
+#include "flexdef.h"
+#include "parse.h"
+
+
+/* yylex - scan for a regular expression token */
+
+extern char *yytext;
+int yylex (void)
+{
+ int toktype;
+ static int beglin = false;
+
+ if (eofseen)
+ toktype = EOF;
+ else
+ toktype = flexscan ();
+
+ if (toktype == EOF || toktype == 0) {
+ eofseen = 1;
+
+ if (sectnum == 1) {
+ synerr (_("premature EOF"));
+ sectnum = 2;
+ toktype = SECTEND;
+ }
+
+ else
+ toktype = 0;
+ }
+
+ if (trace) {
+ if (beglin) {
+ fprintf (stderr, "%d\t", num_rules + 1);
+ beglin = 0;
+ }
+
+ switch (toktype) {
+ case '<':
+ case '>':
+ case '^':
+ case '$':
+ case '"':
+ case '[':
+ case ']':
+ case '{':
+ case '}':
+ case '|':
+ case '(':
+ case ')':
+ case '-':
+ case '/':
+ case '\\':
+ case '?':
+ case '.':
+ case '*':
+ case '+':
+ case ',':
+ (void) putc (toktype, stderr);
+ break;
+
+ case '\n':
+ (void) putc ('\n', stderr);
+
+ if (sectnum == 2)
+ beglin = 1;
+
+ break;
+
+ case SCDECL:
+ fputs ("%s", stderr);
+ break;
+
+ case XSCDECL:
+ fputs ("%x", stderr);
+ break;
+
+ case SECTEND:
+ fputs ("%%\n", stderr);
+
+ /* We set beglin to be true so we'll start
+ * writing out numbers as we echo rules.
+ * flexscan() has already assigned sectnum.
+ */
+ if (sectnum == 2)
+ beglin = 1;
+
+ break;
+
+ case NAME:
+ fprintf (stderr, "'%s'", nmstr);
+ break;
+
+ case CHAR:
+ switch (yylval) {
+ case '<':
+ case '>':
+ case '^':
+ case '$':
+ case '"':
+ case '[':
+ case ']':
+ case '{':
+ case '}':
+ case '|':
+ case '(':
+ case ')':
+ case '-':
+ case '/':
+ case '\\':
+ case '?':
+ case '.':
+ case '*':
+ case '+':
+ case ',':
+ fprintf (stderr, "\\%c", yylval);
+ break;
+
+ default:
+ if (!isascii (yylval) || !isprint (yylval)) {
+ if(trace_hex)
+ fprintf (stderr, "\\x%02x", (unsigned int) yylval);
+ else
+ fprintf (stderr, "\\%.3o", (unsigned int) yylval);
+ } else
+ (void) putc (yylval, stderr);
+ break;
+ }
+
+ break;
+
+ case NUMBER:
+ fprintf (stderr, "%d", yylval);
+ break;
+
+ case PREVCCL:
+ fprintf (stderr, "[%d]", yylval);
+ break;
+
+ case EOF_OP:
+ fprintf (stderr, "<<EOF>>");
+ break;
+
+ case OPTION_OP:
+ fprintf (stderr, "%s ", yytext);
+ break;
+
+ case OPT_OUTFILE:
+ case OPT_PREFIX:
+ case CCE_ALNUM:
+ case CCE_ALPHA:
+ case CCE_BLANK:
+ case CCE_CNTRL:
+ case CCE_DIGIT:
+ case CCE_GRAPH:
+ case CCE_LOWER:
+ case CCE_PRINT:
+ case CCE_PUNCT:
+ case CCE_SPACE:
+ case CCE_UPPER:
+ case CCE_XDIGIT:
+ fprintf (stderr, "%s", yytext);
+ break;
+
+ case 0:
+ fprintf (stderr, _("End Marker\n"));
+ break;
+
+ default:
+ fprintf (stderr,
+ _
+ ("*Something Weird* - tok: %d val: %d\n"),
+ toktype, yylval);
+ break;
+ }
+ }
+
+ return toktype;
+}
diff --git a/tests/.gitignore b/tests/.gitignore
new file mode 100644
index 0000000..5bece86
--- /dev/null
+++ b/tests/.gitignore
@@ -0,0 +1,105 @@
+*.log
+*.trs
+*.o
+*.tables
+alloc_extra
+alloc_extra.c
+array_nr
+array_nr.c
+array_r
+array_r.c
+basic_nr
+basic_nr.c
+basic_r
+basic_r.c
+bison_nr
+bison_nr_scanner.[ch]
+bison_nr_parser.[ch]
+bison_yylloc
+bison_yylloc_parser.[ch]
+bison_yylloc_scanner.[ch]
+bison_yylval
+bison_yylval_parser.[ch]
+bison_yylval_scanner.[ch]
+c_cxx_nr
+c_cxx_nr.cc
+c_cxx_r
+c_cxx_r.cc
+ccl
+ccl.c
+cxx_basic
+cxx_basic.cc
+cxx_multiple_scanners
+cxx_multiple_scanners_[12].cc
+cxx_yywrap.i3
+cxx_yywrap.cc
+debug_nr
+debug_nr.c
+debug_r
+debug_r.c
+extended
+extended.c
+header_nr
+header_nr_scanner.[ch]
+header_r
+header_r_scanner.[ch]
+include_by_buffer.direct
+include_by_buffer.direct.c
+include_by_push.direct
+include_by_push.direct.c
+include_by_reentrant.direct
+include_by_reentrant.direct.c
+lineno_nr.one
+lineno_nr.c
+lineno_r.one
+lineno_r.c
+lineno_trailing.one
+lineno_trailing.c
+mem_nr
+mem_nr.c
+mem_r
+mem_r.c
+multiple_scanners_nr
+multiple_scanners_nr_[12].[ch]
+multiple_scanners_r
+multiple_scanners_r_[12].[ch]
+noansi_nr
+noansi_nr.c
+noansi_r
+noansi_r.c
+posix
+posix.c
+posixly_correct
+posixly_correct.c
+prefix_nr
+prefix_nr.c
+prefix_r
+prefix_r.c
+pthread.pthread
+pthread.c
+reject_nr.reject
+reject_nr.reject.c
+reject_r.reject
+reject_r.reject.c
+reject_ver.table
+reject_ver.table.c
+reject_ser.table
+reject_ser.table.c
+rescan_nr.direct
+rescan_nr.direct.c
+rescan_r.direct
+rescan_r.direct.c
+quotes
+quotes.c
+string_nr
+string_nr.c
+string_r
+string_r.c
+top
+top.[ch]
+yyextra
+yyextra.c
+tableopts_*.c
+*.opt
+*.ser
+*.ver
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 25d8b0c..78eaf3d 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -19,129 +19,464 @@
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE.
+TESTS = $(check_PROGRAMS) options.cn
+
+# The script testwrapper.sh will run most tests as is. A couple tests
+# in the suite end in .reject, .table and the like so that we can pass
+# different arguments to the test runner. We list those extensions so
+# automake knows how to distinguish between the various kinds of tests
+# we have.
+
+TEST_EXTENSIONS = .reject .table .direct .cn .i3 .pthread .one .opt .ser .ver
+
+LOG_COMPILER = $(srcdir)/testwrapper.sh
+AM_LOG_FLAGS = -d $(srcdir) -r
+
+REJECT_LOG_COMPILER = $(srcdir)/testwrapper.sh
+AM_REJECT_LOG_FLAGS = -d $(srcdir) -i reject.txt -r
+
+TABLE_LOG_COMPILER = $(srcdir)/testwrapper.sh
+AM_TABLE_LOG_FLAGS = -d $(builddir) -i $(srcdir)/reject.txt -t
+
+DIRECT_LOG_COMPILER=$(srcdir)/testwrapper.sh
+AM_DIRECT_LOG_FLAGS = -d $(srcdir)
+
+CN_LOG_COMPILER=$(srcdir)/options.cn
+AM_CN_LOG_FLAGS=$(FLEX)
+
+I3_LOG_COMPILER=$(srcdir)/testwrapper.sh
+AM_I3_LOG_FLAGS=-i $(srcdir)/cxx_yywrap.txt -i $(srcdir)/cxx_yywrap.txt -i $(srcdir)/cxx_yywrap.txt
+
+PTHREAD_LOG_COMPILER=$(srcdir)/testwrapper.sh
+AM_PTHREAD_LOG_FLAGS=-i $(srcdir)/pthread_1.txt -i $(srcdir)/pthread_2.txt -i $(srcdir)/pthread_3.txt -i $(srcdir)/pthread_4.txt -i $(srcdir)/pthread_5.txt
+
+ONE_LOG_COMPILER = $(srcdir)/testwrapper.sh
+AM_ONE_LOG_FLAGS = -1 -d $(srcdir)
+
+AM_YFLAGS = -d -p test
+
+check_PROGRAMS = $(simple_tests) $(reject_tests) $(TABLE_TESTS) $(DIRECT_TESTS) $(I3_TESTS) $(PTHREAD_TESTS) $(ONE_TESTS) $(TABLEOPTS_TESTS)
+
+simple_tests = \
+ alloc_extra \
+ array_nr \
+ array_r \
+ basic_nr \
+ basic_r \
+ bison_nr \
+ bison_yylloc \
+ bison_yylval \
+ c_cxx_nr \
+ c_cxx_r \
+ ccl \
+ cxx_basic \
+ cxx_multiple_scanners \
+ debug_nr \
+ debug_r \
+ extended \
+ header_nr \
+ header_r \
+ mem_nr \
+ mem_r \
+ multiple_scanners_nr \
+ multiple_scanners_r \
+ noansi_nr \
+ noansi_r \
+ posix \
+ posixly_correct \
+ prefix_nr \
+ prefix_r \
+ quotes \
+ string_nr \
+ string_r \
+ top \
+ yyextra
+
+reject_tests = \
+ reject_nr.reject \
+ reject_r.reject
+
+TABLE_TESTS = \
+ reject_ver.table \
+ reject_ser.table
+
+DIRECT_TESTS = \
+ include_by_buffer.direct \
+ include_by_push.direct \
+ include_by_reentrant.direct \
+ rescan_nr.direct \
+ rescan_r.direct
+
+I3_TESTS = \
+ cxx_yywrap.i3
+
+if want_pthread
+PTHREAD_TESTS = \
+ pthread.pthread
+endif
+
+ONE_TESTS = \
+ lineno_nr.one \
+ lineno_r.one \
+ lineno_trailing.one
+
+alloc_extra_SOURCES = alloc_extra.l
+array_nr_SOURCES = array_nr.l
+array_r_SOURCES = array_r.l
+basic_nr_SOURCES = basic_nr.l
+basic_r_SOURCES = basic_r.l
+bison_nr_SOURCES = bison_nr_scanner.l bison_nr_parser.y bison_nr_main.c
+bison_yylloc_SOURCES = bison_yylloc_scanner.l bison_yylloc_parser.y bison_yylloc_main.c
+bison_yylval_SOURCES = bison_yylval_scanner.l bison_yylval_parser.y bison_yylval_main.c
+c_cxx_nr_SOURCES = c_cxx_nr.lll
+c_cxx_r_SOURCES = c_cxx_r.lll
+ccl_SOURCES = ccl.l
+cxx_basic_SOURCES = cxx_basic.ll
+cxx_multiple_scanners_SOURCES = cxx_multiple_scanners_main.cc cxx_multiple_scanners_1.ll cxx_multiple_scanners_2.ll
+cxx_yywrap_i3_SOURCES = cxx_yywrap.ll
+debug_nr_SOURCES = debug_nr.l
+debug_r_SOURCES = debug_r.l
+extended_SOURCES = extended.l
+header_nr_SOURCES = header_nr_scanner.l header_nr_main.c
+header_r_SOURCES = header_r_scanner.l header_r_main.c
+include_by_buffer_direct_SOURCES = include_by_buffer.direct.l
+include_by_push_direct_SOURCES = include_by_push.direct.l
+include_by_reentrant_direct_SOURCES = include_by_reentrant.direct.l
+lineno_nr_one_SOURCES = lineno_nr.l
+lineno_r_one_SOURCES = lineno_r.l
+lineno_trailing_one_SOURCES = lineno_trailing.l
+mem_nr_SOURCES = mem_nr.l
+mem_r_SOURCES = mem_r.l
+multiple_scanners_nr_SOURCES = multiple_scanners_nr_main.c multiple_scanners_nr_1.l multiple_scanners_nr_2.l
+multiple_scanners_r_SOURCES = multiple_scanners_r_main.c multiple_scanners_r_1.l multiple_scanners_r_2.l
+noansi_nr_SOURCES = noansi_nr.l
+noansi_r_SOURCES = noansi_r.l
+posix_SOURCES = posix.l
+posixly_correct_SOURCES = posixly_correct.l
+prefix_nr_SOURCES = prefix_nr.l
+prefix_r_SOURCES = prefix_r.l
+pthread_pthread_SOURCES = pthread.l
+quotes_SOURCES = quotes.l
+reject_nr_reject_SOURCES = reject.l4
+reject_r_reject_SOURCES = reject.l4
+reject_ver_table_SOURCES = reject.l4
+reject_ser_table_SOURCES = reject.l4
+rescan_nr_direct_SOURCES = rescan_nr.direct.l
+rescan_r_direct_SOURCES = rescan_r.direct.l
+string_nr_SOURCES = string_nr.l
+string_r_SOURCES = string_r.l
+top_SOURCES = top.l top_main.c
+yyextra_SOURCES = yyextra.l
+
+BUILT_SOURCES = \
+ bison_nr_parser.h \
+ bison_nr_scanner.h \
+ bison_yylloc_parser.h \
+ bison_yylloc_scanner.h \
+ bison_yylval_parser.h \
+ bison_yylval_scanner.h \
+ header_nr_scanner.h \
+ header_r_scanner.h \
+ multiple_scanners_nr_1.h \
+ multiple_scanners_nr_2.h \
+ multiple_scanners_r_1.h \
+ multiple_scanners_r_2.h \
+ top.h
+
+# Normally, automake would distribute files built by flex. Since the
+# point of the test suite is to test the files that flex builds, and
+# since anyone who has the flex distribution can build a flex binary
+# without having a flex binary, we want to not distribute the files
+# built by flex in the test suite. The dist-hook target accomplishes
+# this goal. It's also handy to have the list of files to clean since
+# automake doesn't know about the whacky ways in which we're abusing
+# it.
+
+CLEANFILES = \
+ array_nr.c \
+ array_r.c \
+ basic_nr.c \
+ basic_r.c \
+ bison_nr_parser.c \
+ bison_nr_parser.h \
+ bison_nr_scanner.c \
+ bison_nr_scanner.h \
+ bison_yylloc_parser.c \
+ bison_yylloc_parser.h \
+ bison_yylloc_scanner.c \
+ bison_yylloc_scanner.h \
+ bison_yylval_parser.c \
+ bison_yylval_parser.h \
+ bison_yylval_scanner.c \
+ bison_yylval_scanner.h \
+ c_cxx_nr.cc \
+ c_cxx_r.cc \
+ ccl.c \
+ cxx_basic.cc \
+ cxx_multiple_scanners_1.cc \
+ cxx_multiple_scanners_2.cc \
+ cxx_yywrap.cc \
+ debug_nr.c \
+ debug_r.c \
+ extended.c \
+ header_nr_scanner.c \
+ header_nr_scanner.h \
+ header_r_scanner.c \
+ header_r_scanner.h \
+ include_by_buffer.direct.c \
+ include_by_push.direct.c \
+ include_by_reentrant.direct.c \
+ lineno_nr.c \
+ lineno_r.c \
+ lineno_trailing.c \
+ mem_nr.c \
+ mem_r.c \
+ multiple_scanners_nr_1.c \
+ multiple_scanners_nr_1.h \
+ multiple_scanners_nr_2.c \
+ multiple_scanners_nr_2.h \
+ multiple_scanners_r_1.c \
+ multiple_scanners_r_1.h \
+ multiple_scanners_r_2.c \
+ multiple_scanners_r_2.h \
+ noansi_nr.c \
+ noansi_r.c \
+ posix.c \
+ posixly_correct.c \
+ prefix_nr.c \
+ prefix_r.c \
+ pthread.c \
+ quotes.c \
+ reject_nr.reject.c \
+ reject_r.reject.c \
+ reject_ser.table.c \
+ reject_ser.table.tables \
+ reject_ver.table.c \
+ reject_ver.table.tables \
+ rescan_nr.direct.c \
+ rescan_r.direct.c \
+ string_nr.c \
+ string_r.c \
+ top.c \
+ top.h \
+ yyextra.c \
+alloc_extra.c \
+ $(tableopts_c) \
+ $(tableopts_tables)
+
+dist-hook:
+ for file in $(CLEANFILES) ; do \
+ rm -f $(distdir)/$$file \
+ ; done
+
EXTRA_DIST = \
- README
+ README \
+ alloc_extra.txt \
+ array_nr.txt \
+ array_r.txt \
+ basic_nr.txt \
+ basic_r.txt \
+ bison_nr.txt \
+ bison_yylloc.txt \
+ bison_yylval.txt \
+ c_cxx_nr.txt \
+ c_cxx_r.txt \
+ ccl.txt \
+ cxx_basic.txt \
+ cxx_multiple_scanners.txt \
+ cxx_yywrap.txt \
+ debug_nr.txt \
+ debug_r.txt \
+ extended.txt \
+ header_nr.txt \
+ header_r.txt \
+ include_by_buffer.direct.txt \
+ include_by_buffer.direct_2.txt \
+ include_by_buffer.direct_3.txt \
+ include_by_push.direct.txt \
+ include_by_push.direct_2.txt \
+ include_by_push.direct_3.txt \
+ include_by_reentrant.direct.txt \
+ include_by_reentrant.direct_2.txt \
+ include_by_reentrant.direct_3.txt \
+ lineno_nr.one.txt \
+ lineno_r.one.txt \
+ lineno_trailing.one.txt \
+ mem_nr.txt \
+ mem_r.txt \
+ noansi_nr.txt \
+ noansi_r.txt \
+ prefix_nr.txt \
+ prefix_r.txt \
+ pthread_1.txt \
+ pthread_2.txt \
+ pthread_3.txt \
+ pthread_4.txt \
+ pthread_5.txt \
+ reject.txt \
+ rescan_nr.direct.txt \
+ rescan_r.direct.txt \
+ quotes.txt \
+ top.txt \
+ yyextra.txt \
+ tableopts.txt
dist_noinst_SCRIPTS = \
- create-test
-
-DIST_SUBDIRS = \
- test-concatenated-options \
- test-c++-yywrap \
- test-extended \
- test-ccl \
- test-quotes \
- test-rescan-r \
- test-rescan-nr \
- test-basic-nr \
- test-basic-r \
- test-bison-yylloc \
- test-bison-yylval \
- test-bison-nr \
- test-multiple-scanners-nr \
- test-multiple-scanners-r \
- test-header-nr \
- test-header-r \
- test-reject \
- test-c++-multiple-scanners \
- test-c++-basic \
- test-posixly-correct \
- test-posix \
- test-mem-r \
- test-mem-nr \
- test-debug-nr \
- test-debug-r \
- test-lineno-r \
- test-lineno-nr \
- test-lineno-trailing \
- test-linedir-r \
- TEMPLATE \
- test-top \
- test-array-nr \
- test-array-r \
- test-c-cpp-nr \
- test-c-cpp-r \
- test-include-by-buffer \
- test-include-by-push \
- test-include-by-reentrant \
- test-prefix-nr \
- test-prefix-r \
- test-pthread \
- test-string-nr \
- test-string-r \
- test-yyextra \
- test-alloc-extra \
- test-noansi-nr \
- test-noansi-r \
- test-table-opts
-
-SUBDIRS = \
- test-concatenated-options \
- test-c++-yywrap \
- test-extended \
- test-ccl \
- test-quotes \
- test-rescan-r \
- test-rescan-nr \
- test-basic-nr \
- test-basic-r \
- test-bison-yylloc \
- test-bison-yylval \
- test-bison-nr \
- test-multiple-scanners-nr \
- test-multiple-scanners-r \
- test-header-nr \
- test-header-r \
- test-reject \
- test-c++-multiple-scanners \
- test-c++-basic \
- test-posixly-correct \
- test-posix \
- test-mem-r \
- test-mem-nr \
- test-debug-nr \
- test-debug-r \
- test-lineno-r \
- test-lineno-nr \
- test-lineno-trailing \
- test-linedir-r \
- test-array-nr \
- test-array-r \
- test-c-cpp-nr \
- test-c-cpp-r \
- test-include-by-buffer \
- test-include-by-push \
- test-include-by-reentrant \
- test-prefix-nr \
- test-prefix-r \
- test-pthread \
- test-string-nr \
- test-string-r \
- test-yyextra \
- test-alloc-extra \
- test-noansi-nr \
- test-noansi-r \
- test-top \
- test-table-opts
-
-# clean up before running the test suite so we dont test old builds of test code
-
-check-local: clean
- NOK=;\
- NFAIL=;\
- for dir in $(SUBDIRS) ; do \
- echo Executing test "$$dir" ; \
- ( cd "$$dir" && $(MAKE) test > OUTPUT 2>&1 ) ; \
- case $$? in \
- 0 ) echo Test "$$dir" succeeded.; \
- NOK=0$$NOK;\
- ;; \
- * ) echo Test "$$dir" FAILED. See "$$dir"/OUTPUT for details. ; \
- NFAIL=0$$NFAIL; \
- ;; \
- esac; \
- done ; \
- echo Results: ; \
- echo Tests succeeded: `echo @ECHO_N@ "$$NOK@ECHO_C@"|wc -c`; \
- echo Tests FAILED: `echo @ECHO_N@ "$$NFAIL@ECHO_C@"|wc -c` ; \
- test "$$NFAIL" = ""
+ tableopts.sh
+
+dist_check_SCRIPTS = \
+ options.cn \
+ testwrapper.sh
+
+pthread_pthread_LDADD = -lpthread
+
+# specify how to process .l files in order to test the flex built by make all
+
+FLEX = $(top_builddir)/src/flex
+
+.l.c: $(FLEX)
+ $(FLEX) -o $@ $<
+
+.ll.cc: $(FLEX)
+ $(FLEX) -+ -o $@ $<
+
+bison_nr_main.($OBJEXT): bison_nr_parser.h bison_nr_scanner.h
+bison_nr_scanner.h: bison_nr_scanner.c
+
+bison_yylloc_main.$(OBJEXT): bison_yylloc_parser.h bison_yylloc_scanner.h
+bison_yylloc_scanner.h: bison_yylloc_scanner.c
+
+bison_yylval_main.$(OBJEXT): bison_yylval_parser.h bison_yylval_scanner.h
+bison_yylval_scanner.h: bison_yylval_scanner.c
+
+# automake does not support compiling flex scanners output in C as C++
+# so we explicitly sayhow, using the .lll suffix for the lex input file
+
+.lll.cc: $(FLEX)
+ $(FLEX) -o $@ $<
+
+header_nr_main.$(OBJEXT): header_nr_scanner.h
+header_nr_scanner.h: header_nr_scanner.c
+
+header_r_main.$(OBJEXT): header_r_scanner.h
+header_r_scanner.h: header_r_scanner.c
+
+include_by_buffer.direct$(EXE): include_by_buffer.direct.txt include_by_buffer.direct_2.txt include_by_buffer.direct_3.txt
+
+include_by_push.direct$(EXE): include_by_push.direct.txt include_by_push.direct_2.txt include_by_push.direct_3.txt
+
+include_by_reentrant.direct$(EXE): include_by_reentrant.direct.txt include_by_reentrant.direct_2.txt include_by_reentrant.direct_3.txt
+
+multiple_scanners_nr_main.$(OBJEXT): multiple_scanners_nr_1.h multiple_scanners_nr_2.h
+multiple_scanners_nr_1.h: multiple_scanners_nr_1.c
+multiple_scanners_nr_2.h: multiple_scanners_nr_2.c
+
+multiple_scanners_r_main.$(OBJEXT): multiple_scanners_r_1.h multiple_scanners_r_2.h
+multiple_scanners_r_1.h: multiple_scanners_r_1.c
+multiple_scanners_r_2.h: multiple_scanners_r_2.c
+
+posixly_correct.c: posixly_correct.l $(FLEX)
+ POSIXLY_CORRECT=1 $(FLEX) -o $@ $<
+
+reject_nr.reject.c: reject.l4 $(FLEX)
+ $(FLEX) -o $@ $<
+
+reject_nr.reject$(EXEEXT): reject_nr.reject.$(OBJEXT)
+ $(LINK) $^
+
+reject_r.reject.c: reject.l4 $(FLEX)
+ $(FLEX) --reentrant -o $@ $<
+
+reject_r.reject.$(OBJEXT): reject_r.reject.c
+ $(COMPILE) -DTEST_IS_REENTRANT -c -o $@ $<
+
+reject_r.reject$(EXEEXT): reject_r.reject.$(OBJEXT)
+ $(LINK) $^
+
+reject_ver.table.c: reject.l4 $(FLEX)
+ $(FLEX) -o $@ --tables-verify --tables-file=$(basename $@).tables $<
+
+reject_ver.table.$(OBJEXT): reject_ver.table.c
+ $(COMPILE) -DTEST_HAS_TABLES_EXTERNAL -c -o $@ $<
+
+reject_ver.table$(EXEEXT): reject_ver.table.$(OBJEXT)
+ $(LINK) $^
+
+reject_ser.table.c: reject.l4 $(FLEX)
+ $(FLEX) -o $@ --tables-file=$(basename $@).tables $<
+
+reject_ser.table.$(OBJEXT): reject_ser.table.c
+ $(COMPILE) -DTEST_HAS_TABLES_EXTERNAL -c -o $@ $<
+
+reject_ser.table$(EXEEXT): reject_ser.table.$(OBJEXT)
+ $(LINK) $^
+
+top_main.$(OBJEXT): top.h
+top.h: top.c
+
+# We separate out the tableopts _SOURCES variables and the linking
+# rules for those programs because automake has no way to specify such
+# things with a loop in a variable (even though make can do such
+# things) and the resultant list is both long an unenlightening. And
+# it can be / is generated by a shell script, tableopts.sh.
+
+tableopts.am: tableopts.sh
+ $(srcdir)/tableopts.sh > $(srcdir)/tableopts.am
+
+include $(srcdir)/tableopts.am
+
+tableopts := -Ca -Ce -Cf -CF -Cm -Cem -Cae -Caef -CaeF -Cam -Caem
+tableopts_opt_tests := $(foreach opt,$(tableopts), tableopts_opt_nr$(opt) tableopts_opt_r$(opt))
+tableopts_sertests := $(foreach opt,$(tableopts), tableopts_ser_nr$(opt) tableopts_ser_r$(opt))
+tableopts_vertests := $(foreach opt,$(tableopts), tableopts_ver_nr$(opt) tableopts_ver_r$(opt))
+tableopts_tests := $(tableopts_opttests) $(tableopts_vertests) $(tableopts_sertests)
+
+tableopts_c := $(addsuffix .c,$(tableopts_tests))
+
+OPT_LOG_COMPILER = $(srcdir)/testwrapper.sh
+AM_OPT_LOG_FLAGS = -d $(srcdir) -i tableopts.txt -r
+
+tableopts_opt_nr%.c: tableopts.l4 $(FLEX)
+ $(FLEX) -P $(subst -,_,$(basename $(*F))) $* -o $@ $<
+
+tableopts_opt_nr%.$(OBJEXT): tableopts_opt_nr%.c
+ $(COMPILE) -c -o $@ $<
+
+tableopts_opt_r%.c: tableopts.l4 $(FLEX)
+ $(FLEX) -P $(subst -,_,$(basename $(*F))) --reentrant $* -o $@ $<
+
+tableopts_opt_r%.$(OBJEXT): tableopts_opt_r%.c
+ $(COMPILE) -DTEST_IS_REENTRANT -c -o $@ $<
+
+SER_LOG_COMPILER = $(srcdir)/testwrapper.sh
+AM_SER_LOG_FLAGS = -d $(builddir) -i $(srcdir)/tableopts.txt -r -t
+
+tableopts_ser_nr%.c: tableopts.l4 $(FLEX)
+ $(FLEX) -P $(subst -,_,$(basename $(*F))) --tables-file="tableopts_ser_nr$*.ser.tables" $* -o $@ $<
+
+tableopts_ser_nr%.$(OBJEXT): tableopts_ser_nr%.c
+ $(COMPILE) -DTEST_HAS_TABLES_EXTERNAL -c -o $@ $<
+
+tableopts_ser_r%.c: tableopts.l4 $(FLEX)
+ $(FLEX) -P $(subst -,_,$(basename $(*F))) -R --tables-file="tableopts_ser_r$*.ser.tables" $* -o $@ $<
+
+tableopts_ser_r%.$(OBJEXT): tableopts_ser_r%.c
+ $(COMPILE) -DTEST_HAS_TABLES_EXTERNAL -DTEST_IS_REENTRANT -c -o $@ $<
+
+VER_LOG_COMPILER = $(srcdir)/testwrapper.sh
+AM_VER_LOG_FLAGS = -d $(builddir) -i $(srcdir)/tableopts.txt -r -t
+
+tableopts_ver_nr%.c: tableopts.l4 $(FLEX)
+ $(FLEX) -P $(subst -,_,$(basename $(*F))) --tables-file="tableopts_ver_nr$*.ver.tables" --tables-verify $* -o $@ $<
+
+tableopts_ver_nr%.$(OBJEXT): tableopts_ver_nr%.c
+ $(COMPILE) -DTEST_HAS_TABLES_EXTERNAL -c -o $@ $<
+
+tableopts_ver_nr%.ver$(EXEEXT): tableopts_ver_nr%.$(OBJEXT)
+ $(LINK) -o $@ $^
+
+tableopts_ver_r%.c: tableopts.l4 $(FLEX)
+ $(FLEX) -P $(subst -,_,$(basename $(*F))) -R --tables-file="tableopts_ver_r$*.ver.tables" --tables-verify $* -o $@ $<
+
+tableopts_ver_r%.$(OBJEXT): tableopts_ver_r%.c
+ $(COMPILE) -DTEST_HAS_TABLES_EXTERNAL -DTEST_IS_REENTRANT -c -o $@ $<
diff --git a/tests/README b/tests/README
index f948eaf..43387f4 100644
--- a/tests/README
+++ b/tests/README
@@ -8,14 +8,14 @@ this directory and its contents.
* STRUCTURE OF THE TEST SUITE
-The test suite consists of several directories, each containing a
-scanner known to work with the most recent version of flex. In
+The testsuite consists of several tests. Each test is centered around
+a scanner known to work with the most recent version of flex. In
general, after you modify your copy of the flex distribution, you
-should re-run the test suite. Some of the tests may require certain tools
-to be available (e.g., bison, diff). If any test returns an error or
-generates an error message, then your modifications *may* have broken
-a feature of flex. At a minimum, you'll want to investigate the
-failure and determine if it's truly significant.
+should re-run the test suite. Some of the tests may require certain
+tools to be available (e.g., bison, diff). If any test returns an
+error or generates an error message, then your modifications *may*
+have broken a feature of flex. At a minimum, you'll want to
+investigate the failure and determine if it's truly significant.
* HOW TO RUN THE TEST SUITE
@@ -26,52 +26,32 @@ To build and execute all tests from the top level of the flex source tree:
To build and execute a single test:
$ cd tests/ # from the top level of the flex tree.
- $ cd test-pthread-nr # for example
- $ make test
+ $ make testname.log
-* HOW TO ADD A NEW TEST TO THE TEST SUITE
+ where "testname" is the name of the test. This is an automake-ism
+ that will create (or re-create, if need be), a log of the particular
+ test run that you're working on.
-**- RUN the script `create-test` found in this directory with a single
-argument of the name of the test you want to create. If it fails with
-a message about a non-existent file `config.status', then run the
-configure script in the top-level directory and everything will be
-fine. If it fails to work for you other than this, report it as a
-bug.
+* HOW TO ADD A NEW TEST TO THE TEST SUITE
-** Modify the files in the newly created directory so that they test
-whatever feature of flex you are interested in.
+** List your test in the TESTS variable in Makefile.am in this
+ directory. Note that due to the large number of tests, we use
+ variables to group similar tests together. This also helps with
+ handling the automake test suite requirements. Hopefully your test
+ can be listed in SIMPLE_TESTS. You'll need to add the appropriate
+ automake _SOURCES variable as well. If you're unsure, then consult
+ the automake manual, paying attention to the parallel test harness
+ section.
** On success, your test should return zero.
** On error, your test should return 1 (one) and print a message to
-stderr, which will have been redirected to the file named, "OUTPUT",
-in your test's directory.
+stderr, which will have been redirected to the log file created by the
+automake test suite harness.
** If your test is skipped (e.g., because bison was not found), then
- the test should return 2 (two). See "test-bison-nr/Makefile.am" for
- an example.
-
-** You must modify the last few lines of the top-level configure.in by
- adding the Makefile for your test directory. (This step is
- done automatically by `create-test`.)
-
-** You must add the name of your test to the SUBDIRS variable in
- tests/Makefile.am. (This is also done automatically for you by `create-test'.)
-
-** Add a description of your new test to the end of the file
- `descriptions'. Remember to keep the description as brief as
- possible, preferably to one line.
-
-** You will have to run the autogen.sh script in the top-level
- directory as well as run the configure script in that
- directory. (Note that running config.status may prove easier or
- quicker.)
-
-** The easiest way for you to submit your new test to the flex
- maintainers is by generating a patch. The flex maintainers only
- need to have the Makefile.am, the flex input file, the test input
- file (if there is one) and any other files necessary to compile the
- test. You do not need to submit files generated by autoconf,
- automake, configure etc. It would be helpful to include the file
- .cvsignore which you will find in your test directory if you used
- the `create-test' script.
+ the test should return 2 (two).
+
+** Once your work is done, submit a patch via the flex development
+ mailing list, the github pull request mechanism or some other
+ suitable means.
diff --git a/tests/alloc_extra.l b/tests/alloc_extra.l
new file mode 100644
index 0000000..2c582a8
--- /dev/null
+++ b/tests/alloc_extra.l
@@ -0,0 +1,123 @@
+/*
+ * 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.
+ */
+
+%{
+/* A file to build "scanner.c". */
+/* This tests that we can use "yyextra".
+ We buffer all input into a growable array, then print it.
+ We run diff on the input and output.
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "config.h"
+
+
+/* We'll store the entire input in this buffer, growing as necessary. */
+struct Check {
+ char foo;
+ char *bar;
+ char qux;
+};
+
+/* Save char into junk array at next position. */
+static void check_extra ( yyscan_t scanner );
+
+/* Special yyalloc */
+void *yyalloc ( size_t size, yyscan_t scanner );
+
+%}
+
+%option 8bit prefix="test"
+%option nounput nomain noyywrap nodefault noinput
+%option warn
+%option extra-type="struct Check *"
+%option reentrant
+%option noyyalloc
+
+
+%%
+
+.|\r|\n { check_extra (yyscanner); }
+
+%%
+
+int main(void);
+
+int
+main ()
+{
+ yyscan_t scanner;
+ struct Check check;
+
+ check.foo = 'a';
+ check.bar = NULL;
+ check.qux = 'z';
+
+ testlex_init_extra(&check, &scanner);
+ testset_in(stdin, scanner);
+ testset_out(stdout, scanner);
+
+ /* Test to confirm that yyalloc was called from
+ * yylex_init_extra with the yyextra argument.
+ */
+ check_extra(scanner);
+
+ testlex(scanner);
+
+ testlex_destroy(scanner);
+ return 0;
+}
+
+void *yyalloc(size_t size, yyscan_t scanner)
+{
+ struct Check *check;
+ check = testget_extra(scanner);
+
+ if (!check->bar)
+ check->bar = "Hello World";
+
+ check_extra(scanner);
+
+ return malloc(size);
+}
+
+/* Save char into junk array at next position. */
+static void check_extra(yyscan_t scanner)
+{
+ struct Check *check;
+ check = testget_extra(scanner);
+
+ if (check->foo != 'a') {
+ fprintf(stderr, "foo is not 'a'\n");
+ exit(1);
+ }
+ if (strcmp(check->bar, "Hello World") != 0) {
+ fprintf(stderr, "bar is not Hello World\n");
+ exit(1);
+ }
+ if (check->qux != 'z') {
+ fprintf(stderr, "qux is not 'z'\n");
+ exit(1);
+ }
+}
diff --git a/tests/alloc_extra.txt b/tests/alloc_extra.txt
new file mode 100644
index 0000000..243df29
--- /dev/null
+++ b/tests/alloc_extra.txt
@@ -0,0 +1,795 @@
+
+ THE UNITED STATES CONSTITUTION
+ _________________________________________________________________
+
+ (See Note 1)
+
+ We the People of the United States, in Order to form a more perfect
+ Union, establish Justice, insure domestic Tranquility, provide for the
+ common defence, promote the general Welfare, and secure the Blessings
+ of Liberty to ourselves and our Posterity, do ordain and establish
+ this Constitution for the United States of America.
+
+Article. I.
+
+ Section 1.
+
+ All legislative Powers herein granted shall be vested in a Congress of
+ the United States, which shall consist of a Senate and House of
+ Representatives.
+
+ Section. 2.
+
+ Clause 1: The House of Representatives shall be composed of Members
+ chosen every second Year by the People of the several States, and the
+ Electors in each State shall have the Qualifications requisite for
+ Electors of the most numerous Branch of the State Legislature.
+
+ Clause 2: No Person shall be a Representative who shall not have
+ attained to the Age of twenty five Years, and been seven Years a
+ Citizen of the United States, and who shall not, when elected, be an
+ Inhabitant of that State in which he shall be chosen.
+
+ Clause 3: Representatives and direct Taxes shall be apportioned among
+ the several States which may be included within this Union, according
+ to their respective Numbers, which shall be determined by adding to
+ the whole Number of free Persons, including those bound to Service for
+ a Term of Years, and excluding Indians not taxed, three fifths of all
+ other Persons. (See Note 2) The actual Enumeration shall be made
+ within three Years after the first Meeting of the Congress of the
+ United States, and within every subsequent Term of ten Years, in such
+ Manner as they shall by Law direct. The Number of Representatives
+ shall not exceed one for every thirty Thousand, but each State shall
+ have at Least one Representative; and until such enumeration shall be
+ made, the State of New Hampshire shall be entitled to chuse three,
+ Massachusetts eight, Rhode-Island and Providence Plantations one,
+ Connecticut five, New-York six, New Jersey four, Pennsylvania eight,
+ Delaware one, Maryland six, Virginia ten, North Carolina five, South
+ Carolina five, and Georgia three.
+
+ Clause 4: When vacancies happen in the Representation from any State,
+ the Executive Authority thereof shall issue Writs of Election to fill
+ such Vacancies.
+
+ Clause 5: The House of Representatives shall chuse their Speaker and
+ other Officers; and shall have the sole Power of Impeachment.
+
+ Section. 3.
+
+ Clause 1: The Senate of the United States shall be composed of two
+ Senators from each State, chosen by the Legislature thereof, (See Note
+ 3) for six Years; and each Senator shall have one Vote.
+
+ Clause 2: Immediately after they shall be assembled in Consequence of
+ the first Election, they shall be divided as equally as may be into
+ three Classes. The Seats of the Senators of the first Class shall be
+ vacated at the Expiration of the second Year, of the second Class at
+ the Expiration of the fourth Year, and of the third Class at the
+ Expiration of the sixth Year, so that one third may be chosen every
+ second Year; and if Vacancies happen by Resignation, or otherwise,
+ during the Recess of the Legislature of any State, the Executive
+ thereof may make temporary Appointments until the next Meeting of the
+ Legislature, which shall then fill such Vacancies. (See Note 4)
+
+ Clause 3: No Person shall be a Senator who shall not have attained to
+ the Age of thirty Years, and been nine Years a Citizen of the United
+ States, and who shall not, when elected, be an Inhabitant of that
+ State for which he shall be chosen.
+
+ Clause 4: The Vice President of the United States shall be President
+ of the Senate, but shall have no Vote, unless they be equally divided.
+
+ Clause 5: The Senate shall chuse their other Officers, and also a
+ President pro tempore, in the Absence of the Vice President, or when
+ he shall exercise the Office of President of the United States.
+
+ Clause 6: The Senate shall have the sole Power to try all
+ Impeachments. When sitting for that Purpose, they shall be on Oath or
+ Affirmation. When the President of the United States is tried, the
+ Chief Justice shall preside: And no Person shall be convicted without
+ the Concurrence of two thirds of the Members present.
+
+ Clause 7: Judgment in Cases of Impeachment shall not extend further
+ than to removal from Office, and disqualification to hold and enjoy
+ any Office of honor, Trust or Profit under the United States: but the
+ Party convicted shall nevertheless be liable and subject to
+ Indictment, Trial, Judgment and Punishment, according to Law.
+
+ Section. 4.
+
+ Clause 1: The Times, Places and Manner of holding Elections for
+ Senators and Representatives, shall be prescribed in each State by the
+ Legislature thereof; but the Congress may at any time by Law make or
+ alter such Regulations, except as to the Places of chusing Senators.
+
+ Clause 2: The Congress shall assemble at least once in every Year, and
+ such Meeting shall be on the first Monday in December, (See Note 5)
+ unless they shall by Law appoint a different Day.
+
+ Section. 5.
+
+ Clause 1: Each House shall be the Judge of the Elections, Returns and
+ Qualifications of its own Members, and a Majority of each shall
+ constitute a Quorum to do Business; but a smaller Number may adjourn
+ from day to day, and may be authorized to compel the Attendance of
+ absent Members, in such Manner, and under such Penalties as each House
+ may provide.
+
+ Clause 2: Each House may determine the Rules of its Proceedings,
+ punish its Members for disorderly Behaviour, and, with the Concurrence
+ of two thirds, expel a Member.
+
+ Clause 3: Each House shall keep a Journal of its Proceedings, and from
+ time to time publish the same, excepting such Parts as may in their
+ Judgment require Secrecy; and the Yeas and Nays of the Members of
+ either House on any question shall, at the Desire of one fifth of
+ those Present, be entered on the Journal.
+
+ Clause 4: Neither House, during the Session of Congress, shall,
+ without the Consent of the other, adjourn for more than three days,
+ nor to any other Place than that in which the two Houses shall be
+ sitting.
+
+ Section. 6.
+
+ Clause 1: The Senators and Representatives shall receive a
+ Compensation for their Services, to be ascertained by Law, and paid
+ out of the Treasury of the United States. (See Note 6) They shall in
+ all Cases, except Treason, Felony and Breach of the Peace,
+ beprivileged from Arrest during their Attendance at the Session of
+ their respective Houses, and in going to and returning from the same;
+ and for any Speech or Debate in either House, they shall not be
+ questioned in any other Place.
+
+ Clause 2: No Senator or Representative shall, during the Time for
+ which he was elected, be appointed to any civil Office under the
+ Authority of the United States, which shall have been created, or the
+ Emoluments whereof shall have been encreased during such time; and no
+ Person holding any Office under the United States, shall be a Member
+ of either House during his Continuance in Office.
+
+ Section. 7.
+
+ Clause 1: All Bills for raising Revenue shall originate in the House
+ of Representatives; but the Senate may propose or concur with
+ Amendments as on other Bills.
+
+ Clause 2: Every Bill which shall have passed the House of
+ Representatives and the Senate, shall, before it become a Law, be
+ presented to the President of the United States; If he approve he
+ shall sign it, but if not he shall return it, with his Objections to
+ that House in which it shall have originated, who shall enter the
+ Objections at large on their Journal, and proceed to reconsider it. If
+ after such Reconsideration two thirds of that House shall agree to
+ pass the Bill, it shall be sent, together with the Objections, to the
+ other House, by which it shall likewise be reconsidered, and if
+ approved by two thirds of that House, it shall become a Law. But in
+ all such Cases the Votes of both Houses shall be determined by yeas
+ and Nays, and the Names of the Persons voting for and against the Bill
+ shall be entered on the Journal of each House respectively. If any
+ Bill shall not be returned by the President within ten Days (Sundays
+ excepted) after it shall have been presented to him, the Same shall be
+ a Law, in like Manner as if he had signed it, unless the Congress by
+ their Adjournment prevent its Return, in which Case it shall not be a
+ Law.
+
+ Clause 3: Every Order, Resolution, or Vote to which the Concurrence of
+ the Senate and House of Representatives may be necessary (except on a
+ question of Adjournment) shall be presented to the President of the
+ United States; and before the Same shall take Effect, shall be
+ approved by him, or being disapproved by him, shall be repassed by two
+ thirds of the Senate and House of Representatives, according to the
+ Rules and Limitations prescribed in the Case of a Bill.
+
+ Section. 8.
+
+ Clause 1: The Congress shall have Power To lay and collect Taxes,
+ Duties, Imposts and Excises, to pay the Debts and provide for the
+ common Defence and general Welfare of the United States; but all
+ Duties, Imposts and Excises shall be uniform throughout the United
+ States;
+
+ Clause 2: To borrow Money on the credit of the United States;
+
+ Clause 3: To regulate Commerce with foreign Nations, and among the
+ several States, and with the Indian Tribes;
+
+ Clause 4: To establish an uniform Rule of Naturalization, and uniform
+ Laws on the subject of Bankruptcies throughout the United States;
+
+ Clause 5: To coin Money, regulate the Value thereof, and of foreign
+ Coin, and fix the Standard of Weights and Measures;
+
+ Clause 6: To provide for the Punishment of counterfeiting the
+ Securities and current Coin of the United States;
+
+ Clause 7: To establish Post Offices and post Roads;
+
+ Clause 8: To promote the Progress of Science and useful Arts, by
+ securing for limited Times to Authors and Inventors the exclusive
+ Right to their respective Writings and Discoveries;
+
+ Clause 9: To constitute Tribunals inferior to the supreme Court;
+
+ Clause 10: To define and punish Piracies and Felonies committed on the
+ high Seas, and Offences against the Law of Nations;
+
+ Clause 11: To declare War, grant Letters of Marque and Reprisal, and
+ make Rules concerning Captures on Land and Water;
+
+ Clause 12: To raise and support Armies, but no Appropriation of Money
+ to that Use shall be for a longer Term than two Years;
+
+ Clause 13: To provide and maintain a Navy;
+
+ Clause 14: To make Rules for the Government and Regulation of the land
+ and naval Forces;
+
+ Clause 15: To provide for calling forth the Militia to execute the
+ Laws of the Union, suppress Insurrections and repel Invasions;
+
+ Clause 16: To provide for organizing, arming, and disciplining, the
+ Militia, and for governing such Part of them as may be employed in the
+ Service of the United States, reserving to the States respectively,
+ the Appointment of the Officers, and the Authority of training the
+ Militia according to the discipline prescribed by Congress;
+
+ Clause 17: To exercise exclusive Legislation in all Cases whatsoever,
+ over such District (not exceeding ten Miles square) as may, byCession
+ of particular States, and the Acceptance of Congress, become the Seat
+ of the Government of the United States, and to exercise like Authority
+ over all Places purchased by the Consent of the Legislature of the
+ State in which the Same shall be, for the Erection of Forts,
+ Magazines, Arsenals, dock-Yards, and other needful Buildings;--And
+
+ Clause 18: To make all Laws which shall be necessary and proper for
+ carrying into Execution the foregoing Powers, and all other Powers
+ vested by this Constitution in the Government of the United States, or
+ in any Department or Officer thereof.
+
+ Section. 9.
+
+ Clause 1: The Migration or Importation of such Persons as any of the
+ States now existing shall think proper to admit, shall not be
+ prohibited by the Congress prior to the Year one thousand eight
+ hundred and eight, but a Tax or duty may be imposed on such
+ Importation, not exceeding ten dollars for each Person.
+
+ Clause 2: The Privilege of the Writ of Habeas Corpus shall not be
+ suspended, unless when in Cases of Rebellion or Invasion the public
+ Safety may require it.
+
+ Clause 3: No Bill of Attainder or ex post facto Law shall be passed.
+
+ Clause 4: No Capitation, or other direct, Tax shall be laid, unless in
+ Proportion to the Census or Enumeration herein before directed to be
+ taken. (See Note 7)
+
+ Clause 5: No Tax or Duty shall be laid on Articles exported from any
+ State.
+
+ Clause 6: No Preference shall be given by any Regulation of Commerce
+ or Revenue to the Ports of one State over those of another: nor shall
+ Vessels bound to, or from, one State, be obliged to enter, clear, or
+ pay Duties in another.
+
+ Clause 7: No Money shall be drawn from the Treasury, but in
+ Consequence of Appropriations made by Law; and a regular Statement and
+ Account of the Receipts and Expenditures of all public Money shall be
+ published from time to time.
+
+ Clause 8: No Title of Nobility shall be granted by the United States:
+ And no Person holding any Office of Profit or Trust under them, shall,
+ without the Consent of the Congress, accept of any present, Emolument,
+ Office, or Title, of any kind whatever, from any King, Prince, or
+ foreign State.
+
+ Section. 10.
+
+ Clause 1: No State shall enter into any Treaty, Alliance, or
+ Confederation; grant Letters of Marque and Reprisal; coin Money; emit
+ Bills of Credit; make any Thing but gold and silver Coin a Tender in
+ Payment of Debts; pass any Bill of Attainder, ex post facto Law, or
+ Law impairing the Obligation of Contracts, or grant any Title of
+ Nobility.
+
+ Clause 2: No State shall, without the Consent of the Congress, lay any
+ Imposts or Duties on Imports or Exports, except what may be absolutely
+ necessary for executing it's inspection Laws: and the net Produce of
+ all Duties and Imposts, laid by any State on Imports or Exports, shall
+ be for the Use of the Treasury of the United States; and all such Laws
+ shall be subject to the Revision and Controul of the Congress.
+
+ Clause 3: No State shall, without the Consent of Congress, lay any
+ Duty of Tonnage, keep Troops, or Ships of War in time of Peace, enter
+ into any Agreement or Compact with another State, or with a foreign
+ Power, or engage in War, unless actually invaded, or in such imminent
+ Danger as will not admit of delay.
+
+Article. II.
+
+ Section. 1.
+
+ Clause 1: The executive Power shall be vested in a President of the
+ United States of America. He shall hold his Office during the Term of
+ four Years, and, together with the Vice President, chosen for the same
+ Term, be elected, as follows
+
+ Clause 2: Each State shall appoint, in such Manner as the Legislature
+ thereof may direct, a Number of Electors, equal to the whole Number of
+ Senators and Representatives to which the State may be entitled in the
+ Congress: but no Senator or Representative, or Person holding an
+ Office of Trust or Profit under the United States, shall be appointed
+ an Elector.
+
+ Clause 3: The Electors shall meet in their respective States, and vote
+ by Ballot for two Persons, of whom one at least shall not be an
+ Inhabitant of the same State with themselves. And they shall make a
+ List of all the Persons voted for, and of the Number of Votes for
+ each; which List they shall sign and certify, and transmit sealed to
+ the Seat of the Government of the United States, directed to the
+ President of the Senate. The President of the Senate shall, in the
+ Presence of the Senate and House of Representatives, open all the
+ Certificates, and the Votes shall then be counted. The Person having
+ the greatest Number of Votes shall be the President, if such Number be
+ a Majority of the whole Number of Electors appointed; and if there be
+ more than one who have such Majority, and have an equal Number of
+ Votes, then the House of Representatives shall immediately chuse by
+ Ballot one of them for President; and if no Person have a Majority,
+ then from the five highest on the List the said House shall in like
+ Manner chuse the President. But in chusing the President, the Votes
+ shall be taken by States, the Representation from each State having
+ one Vote; A quorum for this Purpose shall consist of a Member or
+ Members from two thirds of the States, and a Majority of all the
+ States shall be necessary to a Choice. In every Case, after the Choice
+ of the President, the Person having the greatest Number of Votes of
+ the Electors shall be the Vice President. But if there should remain
+ two or more who have equal Votes, the Senate shall chuse from them by
+ Ballot the Vice President. (See Note 8)
+
+ Clause 4: The Congress may determine the Time of chusing the Electors,
+ and the Day on which they shall give their Votes; which Day shall be
+ the same throughout the United States.
+
+ Clause 5: No Person except a natural born Citizen, or a Citizen of the
+ United States, at the time of the Adoption of this Constitution, shall
+ be eligible to the Office of President; neither shall any Person be
+ eligible to that Office who shall not have attained to the Age of
+ thirty five Years, and been fourteen Years a Resident within the
+ United States.
+
+ Clause 6: In Case of the Removal of the President from Office, or of
+ his Death, Resignation, or Inability to discharge the Powers and
+ Duties of the said Office, (See Note 9) the Same shall devolve on the
+ VicePresident, and the Congress may by Law provide for the Case of
+ Removal, Death, Resignation or Inability, both of the President and
+ Vice President, declaring what Officer shall then act as President,
+ and such Officer shall act accordingly, until the Disability be
+ removed, or a President shall be elected.
+
+ Clause 7: The President shall, at stated Times, receive for his
+ Services, a Compensation, which shall neither be encreased nor
+ diminished during the Period for which he shall have been elected, and
+ he shall not receive within that Period any other Emolument from the
+ United States, or any of them.
+
+ Clause 8: Before he enter on the Execution of his Office, he shall
+ take the following Oath or Affirmation:--"I do solemnly swear (or
+ affirm) that I will faithfully execute the Office of President of the
+ United States, and will to the best of my Ability, preserve, protect
+ and defend the Constitution of the United States."
+
+ Section. 2.
+
+ Clause 1: The President shall be Commander in Chief of the Army and
+ Navy of the United States, and of the Militia of the several States,
+ when called into the actual Service of the United States; he may
+ require the Opinion, in writing, of the principal Officer in each of
+ the executive Departments, upon any Subject relating to the Duties of
+ their respective Offices, and he shall have Power to grant Reprieves
+ and Pardons for Offences against the United States, except in Cases of
+ Impeachment.
+
+ Clause 2: He shall have Power, by and with the Advice and Consent of
+ the Senate, to make Treaties, provided two thirds of the Senators
+ present concur; and he shall nominate, and by and with the Advice and
+ Consent of the Senate, shall appoint Ambassadors, other public
+ Ministers and Consuls, Judges of the supreme Court, and all other
+ Officers of the United States, whose Appointments are not herein
+ otherwise provided for, and which shall be established by Law: but the
+ Congress may by Law vest the Appointment of such inferior Officers, as
+ they think proper, in the President alone, in the Courts of Law, or in
+ the Heads of Departments.
+
+ Clause 3: The President shall have Power to fill up all Vacancies that
+ may happen during the Recess of the Senate, by granting Commissions
+ which shall expire at the End of their next Session.
+
+ Section. 3.
+
+ He shall from time to time give to the Congress Information of the
+ State of the Union, and recommend to their Consideration such Measures
+ as he shall judge necessary and expedient; he may, on extraordinary
+ Occasions, convene both Houses, or either of them, and in Case of
+ Disagreement between them, with Respect to the Time of Adjournment, he
+ may adjourn them to such Time as he shall think proper; he shall
+ receive Ambassadors and other public Ministers; he shall take Care
+ that the Laws be faithfully executed, and shall Commission all the
+ Officers of the United States.
+
+ Section. 4.
+
+ The President, Vice President and all civil Officers of the United
+ States, shall be removed from Office on Impeachment for, and
+ Conviction of, Treason, Bribery, or other high Crimes and
+ Misdemeanors.
+
+Article. III.
+
+ Section. 1.
+
+ The judicial Power of the United States, shall be vested in one
+ supreme Court, and in such inferior Courts as the Congress may from
+ time to time ordain and establish. The Judges, both of the supreme and
+ inferior Courts, shall hold their Offices during good Behaviour, and
+ shall, at stated Times, receive for their Services, a Compensation,
+ which shall not be diminished during their Continuance in Office.
+
+ Section. 2.
+
+ Clause 1: The judicial Power shall extend to all Cases, in Law and
+ Equity, arising under this Constitution, the Laws of the United
+ States, and Treaties made, or which shall be made, under their
+ Authority;--to all Cases affecting Ambassadors, other public Ministers
+ and Consuls;--to all Cases of admiralty and maritime Jurisdiction;--to
+ Controversies to which the United States shall be a Party;--to
+ Controversies between two or more States;--between a State and
+ Citizens of another State; (See Note 10)--between Citizens of
+ different States, --between Citizens of the same State claiming Lands
+ under Grants of different States, and between a State, or the Citizens
+ thereof, and foreign States, Citizens or Subjects.
+
+ Clause 2: In all Cases affecting Ambassadors, other public Ministers
+ and Consuls, and those in which a State shall be Party, the supreme
+ Court shall have original Jurisdiction. In all the other Cases before
+ mentioned, the supreme Court shall have appellate Jurisdiction, both
+ as to Law and Fact, with such Exceptions, and under such Regulations
+ as the Congress shall make.
+
+ Clause 3: The Trial of all Crimes, except in Cases of Impeachment,
+ shall be by Jury; and such Trial shall be held in the State where the
+ said Crimes shall have been committed; but when not committed within
+ any State, the Trial shall be at such Place or Places as the Congress
+ may by Law have directed.
+
+ Section. 3.
+
+ Clause 1: Treason against the United States, shall consist only in
+ levying War against them, or in adhering to their Enemies, giving them
+ Aid and Comfort. No Person shall be convicted of Treason unless on the
+ Testimony of two Witnesses to the same overt Act, or on Confession in
+ open Court.
+
+ Clause 2: The Congress shall have Power to declare the Punishment of
+ Treason, but no Attainder of Treason shall work Corruption of Blood,
+ or Forfeiture except during the Life of the Person attainted.
+
+Article. IV.
+
+ Section. 1.
+
+ Full Faith and Credit shall be given in each State to the public Acts,
+ Records, and judicial Proceedings of every other State. And the
+ Congress may by general Laws prescribe the Manner in which such Acts,
+ Records and Proceedings shall be proved, and the Effect thereof.
+
+ Section. 2.
+
+ Clause 1: The Citizens of each State shall be entitled to all
+ Privileges and Immunities of Citizens in the several States.
+
+ Clause 2: A Person charged in any State with Treason, Felony, or other
+ Crime, who shall flee from Justice, and be found in another State,
+ shall on Demand of the executive Authority of the State from which he
+ fled, be delivered up, to be removed to the State having Jurisdiction
+ of the Crime.
+
+ Clause 3: No Person held to Service or Labour in one State, under the
+ Laws thereof, escaping into another, shall, in Consequence of any Law
+ or Regulation therein, be discharged from such Service or Labour, but
+ shall be delivered up on Claim of the Party to whom such Service or
+ Labour may be due. (See Note 11)
+
+ Section. 3.
+
+ Clause 1: New States may be admitted by the Congress into this Union;
+ but no new State shall be formed or erected within the Jurisdiction of
+ any other State; nor any State be formed by the Junction of two or
+ more States, or Parts of States, without the Consent of the
+ Legislatures of the States concerned as well as of the Congress.
+
+ Clause 2: The Congress shall have Power to dispose of and make all
+ needful Rules and Regulations respecting the Territory or other
+ Property belonging to the United States; and nothing in this
+ Constitution shall be so construed as to Prejudice any Claims of the
+ United States, or of any particular State.
+
+ Section. 4.
+
+ The United States shall guarantee to every State in this Union a
+ Republican Form of Government, and shall protect each of them against
+ Invasion; and on Application of the Legislature, or of the Executive
+ (when the Legislature cannot be convened) against domestic Violence.
+
+Article. V.
+
+ The Congress, whenever two thirds of both Houses shall deem it
+ necessary, shall propose [1]Amendments to this Constitution, or, on
+ the Application of the Legislatures of two thirds of the several
+ States, shall call a Convention for proposing Amendments, which, in
+ either Case, shall be valid to all Intents and Purposes, as Part of
+ this Constitution, when ratified by the Legislatures of three fourths
+ of the several States, or by Conventions in three fourths thereof, as
+ the one or the other Mode of Ratification may be proposed by the
+ Congress; Provided that no Amendment which may be made prior to the
+ Year One thousand eight hundred and eight shall in any Manner affect
+ the first and fourth Clauses in the Ninth Section of the first
+ Article; and that no State, without its Consent, shall be deprived of
+ its equal Suffrage in the Senate.
+
+Article. VI.
+
+ Clause 1: All Debts contracted and Engagements entered into, before
+ the Adoption of this Constitution, shall be as valid against the
+ United States under this Constitution, as under the Confederation.
+
+ Clause 2: This Constitution, and the Laws of the United States which
+ shall be made in Pursuance thereof; and all Treaties made, or which
+ shall be made, under the Authority of the United States, shall be the
+ supreme Law of the Land; and the Judges in every State shall be bound
+ thereby, any Thing in the Constitution or Laws of any State to the
+ Contrary notwithstanding.
+
+ Clause 3: The Senators and Representatives before mentioned, and the
+ Members of the several State Legislatures, and all executive and
+ judicial Officers, both of the United States and of the several
+ States, shall be bound by Oath or Affirmation, to support this
+ Constitution; but no religious Test shall ever be required as a
+ Qualification to any Office or public Trust under the United States.
+
+Article. VII.
+
+ The Ratification of the Conventions of nine States, shall be
+ sufficient for the Establishment of this Constitution between the
+ States so ratifying the Same.
+
+ done in Convention by the Unanimous Consent of the States present the
+ Seventeenth Day of September in the Year of our Lord one thousand
+ seven hundred and Eighty seven and of the Independence of the United
+ States of America the Twelfth In witness whereof We have hereunto
+ subscribed our Names,
+
+ GO WASHINGTON--Presidt. and deputy from Virginia
+
+ [Signed also by the deputies of twelve States.]
+
+ Delaware
+
+ Geo: Read
+ Gunning Bedford jun
+ John Dickinson
+ Richard Bassett
+ Jaco: Broom
+
+ Maryland
+
+ James MCHenry
+ Dan of ST ThoS. Jenifer
+ DanL Carroll.
+
+ Virginia
+
+ John Blair--
+ James Madison Jr.
+
+ North Carolina
+
+ WM Blount
+ RichD. Dobbs Spaight.
+ Hu Williamson
+
+ South Carolina
+
+ J. Rutledge
+ Charles 1ACotesworth Pinckney
+ Charles Pinckney
+ Pierce Butler.
+
+ Georgia
+
+ William Few
+ Abr Baldwin
+
+ New Hampshire
+
+ John Langdon
+ Nicholas Gilman
+
+ Massachusetts
+
+ Nathaniel Gorham
+ Rufus King
+
+ Connecticut
+ WM. SamL. Johnson
+ Roger Sherman
+
+ New York
+
+ Alexander Hamilton
+
+ New Jersey
+
+ Wil: Livingston
+ David Brearley.
+ WM. Paterson.
+ Jona: Dayton
+
+ Pennsylvania
+
+ B Franklin
+ Thomas Mifflin
+ RobT Morris
+ Geo. Clymer
+ ThoS. FitzSimons
+ Jared Ingersoll
+ James Wilson.
+ Gouv Morris
+
+ Attest William Jackson Secretary
+
+ NOTES
+
+ Note 1: This text of the Constitution follows the engrossed copy
+ signed by Gen. Washington and the deputies from 12 States. The small
+ superior figures preceding the paragraphs designate Clauses, and were
+ not in the original and have no reference to footnotes.
+
+ The Constitution was adopted by a convention of the States on
+ September 17, 1787, and was subsequently ratified by the several
+ States, on the following dates: Delaware, December 7, 1787;
+ Pennsylvania, December 12, 1787; New Jersey, December 18, 1787;
+ Georgia, January 2, 1788; Connecticut, January 9, 1788; Massachusetts,
+ February 6, 1788; Maryland, April 28, 1788; South Carolina, May 23,
+ 1788; New Hampshire, June 21, 1788.
+
+ Ratification was completed on June 21, 1788.
+
+ The Constitution was subsequently ratified by Virginia, June 25, 1788;
+ New York, July 26, 1788; North Carolina, November 21, 1789; Rhode
+ Island, May 29, 1790; and Vermont, January 10, 1791.
+
+ In May 1785, a committee of Congress made a report recommending an
+ alteration in the Articles of Confederation, but no action was taken
+ on it, and it was left to the State Legislatures to proceed in the
+ matter. In January 1786, the Legislature of Virginia passed a
+ resolution providing for the appointment of five commissioners, who,
+ or any three of them, should meet such commissioners as might be
+ appointed in the other States of the Union, at a time and place to be
+ agreed upon, to take into consideration the trade of the United
+ States; to consider how far a uniform system in their commercial
+ regulations may be necessary to their common interest and their
+ permanent harmony; and to report to the several States such an act,
+ relative to this great object, as, when ratified by them, will enable
+ the United States in Congress effectually to provide for the same. The
+ Virginia commissioners, after some correspondence, fixed the first
+ Monday in September as the time, and the city of Annapolis as the
+ place for the meeting, but only four other States were represented,
+ viz: Delaware, New York, New Jersey, and Pennsylvania; the
+ commissioners appointed by Massachusetts, New Hampshire, North
+ Carolina, and Rhode Island failed to attend. Under the circumstances
+ of so partial a representation, the commissioners present agreed upon
+ a report, (drawn by Mr. Hamilton, of New York,) expressing their
+ unanimous conviction that it might essentially tend to advance the
+ interests of the Union if the States by which they were respectively
+ delegated would concur, and use their endeavors to procure the
+ concurrence of the other States, in the appointment of commissioners
+ to meet at Philadelphia on the Second Monday of May following, to take
+ into consideration the situation of the United States; to devise such
+ further provisions as should appear to them necessary to render the
+ Constitution of the Federal Government adequate to the exigencies of
+ the Union; and to report such an act for that purpose to the United
+ States in Congress assembled as, when agreed to by them and afterwards
+ confirmed by the Legislatures of every State, would effectually
+ provide for the same.
+
+ Congress, on the 21st of February, 1787, adopted a resolution in favor
+ of a convention, and the Legislatures of those States which had not
+ already done so (with the exception of Rhode Island) promptly
+ appointed delegates. On the 25th of May, seven States having convened,
+ George Washington, of Virginia, was unanimously elected President, and
+ the consideration of the proposed constitution was commenced. On the
+ 17th of September, 1787, the Constitution as engrossed and agreed upon
+ was signed by all the members present, except Mr. Gerry of
+ Massachusetts, and Messrs. Mason and Randolph, of Virginia. The
+ president of the convention transmitted it to Congress, with a
+ resolution stating how the proposed Federal Government should be put
+ in operation, and an explanatory letter. Congress, on the 28th of
+ September, 1787, directed the Constitution so framed, with the
+ resolutions and letter concerning the same, to "be transmitted to the
+ several Legislatures in order to be submitted to a convention of
+ delegates chosen in each State by the people thereof, in conformity to
+ the resolves of the convention."
+
+ On the 4th of March, 1789, the day which had been fixed for commencing
+ the operations of Government under the new Constitution, it had been
+ ratified by the conventions chosen in each State to consider it, as
+ follows: Delaware, December 7, 1787; Pennsylvania, December 12, 1787;
+ New Jersey, December 18, 1787; Georgia, January 2, 1788; Connecticut,
+ January 9, 1788; Massachusetts, February 6, 1788; Maryland, April 28,
+ 1788; South Carolina, May 23, 1788; New Hampshire, June 21, 1788;
+ Virginia, June 25, 1788; and New York, July 26, 1788.
+
+ The President informed Congress, on the 28th of January, 1790, that
+ North Carolina had ratified the Constitution November 21, 1789; and he
+ informed Congress on the 1st of June, 1790, that Rhode Island had
+ ratified the Constitution May 29, 1790. Vermont, in convention,
+ ratified the Constitution January 10, 1791, and was, by an act of
+ Congress approved February 18, 1791, "received and admitted into this
+ Union as a new and entire member of the United States."
+
+ Note 2: The part of this Clause relating to the mode of apportionment
+ of representatives among the several States has been affected by
+ Section 2 of amendment XIV, and as to taxes on incomes without
+ apportionment by amendment XVI.
+
+ Note 3: This Clause has been affected by Clause 1 of amendment XVII.
+
+ Note 4: This Clause has been affected by Clause 2 of amendment XVIII.
+
+ Note 5: This Clause has been affected by amendment XX.
+
+ Note 6: This Clause has been affected by amendment XXVII.
+
+ Note 7: This Clause has been affected by amendment XVI.
+
+ Note 8: This Clause has been superseded by amendment XII.
+
+ Note 9: This Clause has been affected by amendment XXV.
+
+ Note 10: This Clause has been affected by amendment XI.
+
+ Note 11: This Clause has been affected by amendment XIII.
+
+ Note 12: The first ten amendments to the Constitution of the United
+ States (and two others, one of which failed of ratification and the
+ other which later became the 27th amendment) were proposed to the
+ legislatures of the several States by the First Congress on September
+ 25, 1789. The first ten amendments were ratified by the following
+ States, and the notifications of ratification by the Governors thereof
+ were successively communicated by the President to Congress: New
+ Jersey, November 20, 1789; Maryland, December 19, 1789; North
+ Carolina, December 22, 1789; South Carolina, January 19, 1790; New
+ Hampshire, January 25, 1790; Delaware, January 28, 1790; New York,
+ February 24, 1790; Pennsylvania, March 10, 1790; Rhode Island, June 7,
+ 1790; Vermont, November 3, 1791; and Virginia, December 15, 1791.
+
+ Ratification was completed on December 15, 1791.
+
+ The amendments were subsequently ratified by the legislatures of
+ Massachusetts, March 2, 1939; Georgia, March 18, 1939; and
+ Connecticut, April 19, 1939.
+
+ Note 13: Only the 13th, 14th, 15th, and 16th articles of amendment had
+ numbers assigned to them at the time of ratification.
+
+ Note 14: This sentence has been superseded by section 3 of amendment
+ XX.
+
+ Note 15: See amendment XIX and section 1 of amendment XXVI.
+
+ Note 16: Repealed by section 1 of amendment XXI.
+
+References
+
+ 1. http://www.house.gov/Constitution/Amend.html
diff --git a/tests/array_nr.l b/tests/array_nr.l
new file mode 100644
index 0000000..52e0753
--- /dev/null
+++ b/tests/array_nr.l
@@ -0,0 +1,55 @@
+/*
+ * 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.
+ */
+
+%{
+/* A template scanner file to build "scanner.c". */
+#include <stdio.h>
+#include <stdlib.h>
+#include "config.h"
+/*#include "parser.h" */
+
+%}
+
+%option 8bit prefix="test"
+%option nounput nomain noyywrap noinput
+%option warn array
+
+
+%%
+
+.|\n { }
+
+
+%%
+
+int main (void);
+
+int
+main ()
+{
+ yyin = stdin;
+ yyout = stdout;
+ yylex();
+ printf("TEST RETURNING OK.\n");
+ return 0;
+}
diff --git a/tests/array_nr.txt b/tests/array_nr.txt
new file mode 100644
index 0000000..7288a40
--- /dev/null
+++ b/tests/array_nr.txt
@@ -0,0 +1,2 @@
+0000 foo 1111 foo 0000 bar
+0000 foo 1111 foo 0000 bar
diff --git a/tests/array_r.l b/tests/array_r.l
new file mode 100644
index 0000000..556d26f
--- /dev/null
+++ b/tests/array_r.l
@@ -0,0 +1,62 @@
+/*
+ * 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.
+ */
+
+%{
+/* A template scanner file to build "scanner.c". */
+#include <stdio.h>
+#include <stdlib.h>
+#include "config.h"
+/*#include "parser.h" */
+
+%}
+
+%option 8bit prefix="test"
+%option nounput nomain noyywrap noinput
+%option warn array reentrant
+
+
+%%
+
+.|\n { }
+
+
+%%
+
+int main(void);
+
+int
+main ()
+{
+ yyscan_t lexer;
+
+ yylex_init(&lexer);
+ yyset_in(stdin, lexer);
+ yyset_out(stdout, lexer);
+
+ yylex( lexer );
+
+ yylex_destroy( lexer);
+ printf("TEST RETURNING OK.\n");
+
+ return 0;
+}
diff --git a/tests/array_r.txt b/tests/array_r.txt
new file mode 100644
index 0000000..7288a40
--- /dev/null
+++ b/tests/array_r.txt
@@ -0,0 +1,2 @@
+0000 foo 1111 foo 0000 bar
+0000 foo 1111 foo 0000 bar
diff --git a/tests/basic_nr.l b/tests/basic_nr.l
new file mode 100644
index 0000000..3c29757
--- /dev/null
+++ b/tests/basic_nr.l
@@ -0,0 +1,64 @@
+/*
+ * 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.
+ */
+
+/* TEST scanner.
+ Basic non-reentrant scanner.
+
+ Sample Input:
+ # this is a comment
+ foo = true
+ bar = "string value"
+ integer = 43
+*/
+%{
+#include "config.h"
+%}
+
+%option prefix="test"
+%option nounput noyywrap noyylineno warn nodefault noinput
+
+IDENT [[:alnum:]_-]
+WS [[:blank:]]
+%%
+
+^{IDENT}+{WS}*={WS}*(true|false){WS}*\r?\n { return 100;}
+^{IDENT}+{WS}*={WS}*\"[^\"\n\r]*\"{WS}*\r?\n { return 101;}
+^{IDENT}+{WS}*={WS}*[[:digit:]]+{WS}*\r?\n { return 102;}
+^{WS}*#.*\r?\n { }
+^{WS}*\r?\n { }
+.|\n { fprintf(stderr,"Invalid line.\n"); exit(-1);}
+
+%%
+
+int main(void);
+
+int main ()
+{
+ yyin = stdin;
+ yyout = stdout;
+ while( yylex() )
+ {
+ }
+ printf("TEST RETURNING OK.\n");
+ return 0;
+}
diff --git a/tests/basic_nr.txt b/tests/basic_nr.txt
new file mode 100644
index 0000000..642e0fb
--- /dev/null
+++ b/tests/basic_nr.txt
@@ -0,0 +1,5 @@
+# this is a comment
+foo = "bar"
+num = 43
+setting = false
+
diff --git a/tests/basic_r.l b/tests/basic_r.l
new file mode 100644
index 0000000..e9ff59f
--- /dev/null
+++ b/tests/basic_r.l
@@ -0,0 +1,68 @@
+/*
+ * 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.
+ */
+
+/* A reentrant scanner.
+ This file will not compile under flex version <= 2.5.4.
+ Sample Input:
+ # this is a comment
+ foo = true
+ bar = "string value"
+ integer = 43
+*/
+%{
+#include "config.h"
+%}
+
+%option prefix="test"
+%option nounput noyywrap noyylineno warn nodefault noinput
+%option reentrant
+
+IDENT [[:alnum:]_-]
+WS [[:blank:]]
+%%
+
+^{IDENT}+{WS}*={WS}*(true|false){WS}*\r?\n { return 100;}
+^{IDENT}+{WS}*={WS}*\"[^\"\n\r]*\"{WS}*\r?\n { return 101;}
+^{IDENT}+{WS}*={WS}*[[:digit:]]+{WS}*\r?\n { return 102;}
+^{WS}*#.*\r?\n { }
+^{WS}*\r?\n { }
+.|\n { fprintf(stderr,"Invalid line.\n"); exit(-1);}
+
+%%
+
+int main(void);
+
+int main ()
+{
+ yyscan_t lexer;
+ yylex_init( &lexer );
+ yyset_out ( stdout,lexer);
+ yyset_in ( stdin, lexer);
+ while( yylex(lexer) )
+ {
+ }
+ yylex_destroy( lexer );
+ printf("TEST RETURNING OK.\n");
+ return 0;
+}
+
diff --git a/tests/basic_r.txt b/tests/basic_r.txt
new file mode 100644
index 0000000..2160628
--- /dev/null
+++ b/tests/basic_r.txt
@@ -0,0 +1,4 @@
+# this is a comment
+foo = "bar"
+num = 43
+setting = false
diff --git a/tests/bison_nr.txt b/tests/bison_nr.txt
new file mode 100644
index 0000000..94adcb2
--- /dev/null
+++ b/tests/bison_nr.txt
@@ -0,0 +1,4 @@
+0001: FIRSTNAME=firstname
+0002: MIDDLENAME=middle
+0003: LASTNAME=lastname
+0004: ADDRESS=address
diff --git a/tests/bison_nr_main.c b/tests/bison_nr_main.c
new file mode 100644
index 0000000..f5dd98a
--- /dev/null
+++ b/tests/bison_nr_main.c
@@ -0,0 +1,42 @@
+/*
+ * 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 "bison_nr_parser.h"
+#include "bison_nr_scanner.h"
+
+extern int testparse(void);
+
+int main ( int argc, char** argv )
+{
+ (void)argc;
+ (void)argv;
+
+ /*yydebug =1;*/
+ testin = stdin;
+ testparse ( );
+ return 0;
+}
+
+
+
+/* vim:set tabstop=8 softtabstop=4 shiftwidth=4: */
diff --git a/tests/bison_nr_parser.y b/tests/bison_nr_parser.y
new file mode 100644
index 0000000..3021048
--- /dev/null
+++ b/tests/bison_nr_parser.y
@@ -0,0 +1,98 @@
+/*
+ * 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.
+ */
+
+/*
+ How to compile:
+ bison --defines --output-file="parser.c" --name-prefix="test" parser.y
+ */
+%{
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "config.h"
+#include "bison_nr_parser.h"
+#include "bison_nr_scanner.h"
+
+#define YYERROR_VERBOSE 1
+/* #define YYPARSE_PARAM scanner */
+/* #define YYLEX_PARAM scanner */
+
+int yyerror(const char* msg);
+extern int testget_lineno(void);
+
+
+/* A dummy function. A check against seg-faults in yylval->str. */
+int process_text(char* s) {
+ int total =0;
+ while(*s) {
+ total += (int) *s;
+ ++s;
+ }
+ return total;
+}
+
+
+%}
+
+%pure_parser
+
+%union {
+ int lineno;
+ char * str;
+}
+%token <str> IDENT
+%token <lineno> LINENO
+%token EQUAL "="
+%token COLON ":"
+%token SPACE " "
+%%
+
+file:
+ line
+ | file line
+ ;
+
+line:
+ LINENO COLON SPACE IDENT EQUAL IDENT
+ {
+ process_text($4);
+ process_text($6);
+ /* Check lineno. */
+ if( $1 != @1.first_line || $1 != testget_lineno())
+ {
+ yyerror("Parse failed: Line numbers do not match.");
+ YYABORT;
+ }
+
+ /* Recreate the line to stdout. */
+ printf ( "%04d: %s=%s\n", @1.first_line, $4, $6);
+ }
+ ;
+
+%%
+
+int yyerror(const char* msg) {
+ fprintf(stderr,"%s\n",msg);
+ return 0;
+}
+
diff --git a/tests/bison_nr_scanner.l b/tests/bison_nr_scanner.l
new file mode 100644
index 0000000..4378e5a
--- /dev/null
+++ b/tests/bison_nr_scanner.l
@@ -0,0 +1,62 @@
+/*
+ * 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.
+ */
+
+%{
+/* The scanner expects to link to bison yylval . */
+#include <stdio.h>
+#include <stdlib.h>
+#include "bison_nr_parser.h"
+#include "config.h"
+static char* STRDUP(char* s1);
+#define YY_EXTRA_TYPE int
+%}
+
+%option 8bit prefix="test"
+%option bison-locations yylineno
+%option prefix="test" header="bison_nr_scanner.h" yylineno
+%option nomain nounput noyy_top_state noyywrap nodefault noinput warn
+
+
+%%
+
+^[[:digit:]]+ {
+ yylval->lineno = yylineno;
+ yylloc->first_line = (int)strtol(yytext,NULL,10);
+ return LINENO;
+ }
+":" { return COLON; }
+" " { return SPACE; }
+"=" { return EQUAL; }
+[[:alnum:]_]+ { yylval->str = STRDUP(yytext); return IDENT;}
+
+\r|\n { }
+. { yyterminate();}
+%%
+
+
+static char* STRDUP(char* s1)
+{
+ char* s2 = (char*)malloc(strlen(s1)+1);
+ sprintf(s2,"%s",s1);
+ return s2;
+}
diff --git a/tests/bison_yylloc.txt b/tests/bison_yylloc.txt
new file mode 100644
index 0000000..94adcb2
--- /dev/null
+++ b/tests/bison_yylloc.txt
@@ -0,0 +1,4 @@
+0001: FIRSTNAME=firstname
+0002: MIDDLENAME=middle
+0003: LASTNAME=lastname
+0004: ADDRESS=address
diff --git a/tests/bison_yylloc_main.c b/tests/bison_yylloc_main.c
new file mode 100644
index 0000000..0274d39
--- /dev/null
+++ b/tests/bison_yylloc_main.c
@@ -0,0 +1,44 @@
+/*
+ * 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 "bison_yylloc_parser.h"
+#include "bison_yylloc_scanner.h"
+
+int main ( int argc, char** argv )
+{
+ yyscan_t scanner;
+
+ (void)argc;
+ (void)argv;
+
+ /*yydebug =1;*/
+ testlex_init ( &scanner );
+ testset_in(stdin,scanner);
+ testparse ( scanner );
+ testlex_destroy ( scanner );
+ return 0;
+}
+
+
+
+/* vim:set tabstop=8 softtabstop=4 shiftwidth=4: */
diff --git a/tests/bison_yylloc_parser.y b/tests/bison_yylloc_parser.y
new file mode 100644
index 0000000..8737291
--- /dev/null
+++ b/tests/bison_yylloc_parser.y
@@ -0,0 +1,102 @@
+/*
+ * 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.
+ */
+
+%parse-param { void* scanner }
+%lex-param { void* scanner }
+
+/*
+ How to compile:
+ bison --defines --output-file="bison_yylloc_parser.c" --name-prefix="test" parser.y
+ */
+%{
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "config.h"
+#include "bison_yylloc_parser.h"
+#include "bison_yylloc_scanner.h"
+
+int yyerror(YYLTYPE *location, void* scanner, const char* msg);
+
+#define YYERROR_VERBOSE 1
+
+extern int testget_lineno(void*);
+
+
+/* A dummy function. A check against seg-faults in yylval->str. */
+int process_text(char* s) {
+ int total =0;
+ while(*s) {
+ total += (int) *s;
+ ++s;
+ }
+ return total;
+}
+
+
+%}
+
+%pure-parser
+
+%union {
+ int lineno;
+ char * str;
+}
+%token <str> IDENT
+%token <lineno> LINENO
+%token EQUAL "="
+%token COLON ":"
+%token SPACE " "
+%%
+
+file:
+ line
+ | file line
+ ;
+
+line:
+ LINENO COLON SPACE IDENT EQUAL IDENT
+ {
+ process_text($4);
+ process_text($6);
+ /* Check lineno. */
+ if( $1 != @1.first_line || $1 != testget_lineno(scanner))
+ {
+ yyerror(0, 0, "Parse failed: Line numbers do not match.");
+ YYABORT;
+ }
+
+ /* Recreate the line to stdout. */
+ printf ( "%04d: %s=%s\n", @1.first_line, $4, $6);
+ }
+ ;
+
+%%
+
+int yyerror(YYLTYPE *location, void* scanner, const char* msg) {
+ (void)location;
+ (void)scanner;
+ fprintf(stderr,"%s\n",msg);
+ return 0;
+}
+
diff --git a/tests/bison_yylloc_scanner.l b/tests/bison_yylloc_scanner.l
new file mode 100644
index 0000000..3708237
--- /dev/null
+++ b/tests/bison_yylloc_scanner.l
@@ -0,0 +1,65 @@
+/*
+ * 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.
+ */
+
+%{
+/* The scanner expects to link to bison yylval . */
+#include <stdio.h>
+#include <stdlib.h>
+#include "bison_yylloc_parser.h"
+#include "config.h"
+static char* STRDUP(char* s1);
+#define YY_EXTRA_TYPE int
+%}
+
+%option 8bit prefix="test"
+%option reentrant bison-bridge bison-locations yylineno
+%option header="bison_yylloc_scanner.h"
+%option nomain nounput noyy_top_state noyywrap nodefault noinput warn
+
+
+%%
+
+ if ( !yyextra)
+ yyextra = 1;
+
+^[[:digit:]]+ {
+ yylval->lineno = yyextra++;
+ yylloc->first_line = (int)strtol(yytext,NULL,10);
+ return LINENO;
+ }
+":" { return COLON; }
+" " { return SPACE; }
+"=" { return EQUAL; }
+[[:alnum:]_]+ { yylval->str = STRDUP(yytext); return IDENT;}
+
+\r|\n { }
+. { yyterminate();}
+%%
+
+
+static char* STRDUP(char* s1)
+{
+ char* s2 = (char*)malloc(strlen(s1)+1);
+ sprintf(s2,"%s",s1);
+ return s2;
+}
diff --git a/tests/bison_yylval.txt b/tests/bison_yylval.txt
new file mode 100644
index 0000000..846f206
--- /dev/null
+++ b/tests/bison_yylval.txt
@@ -0,0 +1,5 @@
+<html>
+<body bgcolor="white">
+ This is a <b>test</b>
+</body>
+</html>
diff --git a/tests/bison_yylval_main.c b/tests/bison_yylval_main.c
new file mode 100644
index 0000000..fb04538
--- /dev/null
+++ b/tests/bison_yylval_main.c
@@ -0,0 +1,43 @@
+/*
+ * 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 "bison_yylval_parser.h"
+#include "bison_yylval_scanner.h"
+
+int main ( int argc, char** argv )
+{
+ yyscan_t scanner;
+
+ (void)argc;
+ (void)argv;
+
+ /*yydebug =1;*/
+ testlex_init ( &scanner );
+ testset_in(stdin,scanner);
+ testparse ( scanner );
+ testlex_destroy ( scanner );
+ return 0;
+}
+
+
+/* vim:set tabstop=8 softtabstop=4 shiftwidth=4: */
diff --git a/tests/bison_yylval_parser.y b/tests/bison_yylval_parser.y
new file mode 100644
index 0000000..4159d7b
--- /dev/null
+++ b/tests/bison_yylval_parser.y
@@ -0,0 +1,84 @@
+/*
+ * 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.
+ */
+
+/* Accepts html-like input.
+ How to compile:
+ bison --defines --output-file="parser.c" --name-prefix="test" parser.y
+ */
+%parse-param { void* scanner }
+%lex-param { void* scanner }
+%{
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "config.h"
+#include "bison_yylval_parser.h"
+#include "bison_yylval_scanner.h"
+
+#define YYERROR_VERBOSE 1
+
+int yyerror(void* scanner, const char* msg);
+
+/* A dummy function. A check against seg-faults in yylval->str. */
+int process_text(char* s) {
+ int total =0;
+ while(*s) {
+ total += (int) *s;
+ ++s;
+ }
+ return total;
+}
+
+
+%}
+
+%pure-parser
+
+%union {
+ long unused;
+ char * str;
+}
+
+%token <str> TAGNAME TEXT
+%token LT
+%token GT
+%token LTSLASH "</"
+
+%%
+
+html:
+ TEXT { process_text($1); free($1);}
+ | starttag html endtag
+ | html TEXT { process_text($2); free($2);}
+ | html starttag html endtag
+ ;
+
+starttag: LT TAGNAME GT { process_text($2); free($2);} ;
+endtag: LTSLASH TAGNAME GT { process_text($2);free($2);} ;
+%%
+
+int yyerror(void* scanner, const char* msg) {
+ (void)scanner;
+ fprintf(stderr,"%s\n",msg);
+ return 0;
+}
diff --git a/tests/bison_yylval_scanner.l b/tests/bison_yylval_scanner.l
new file mode 100644
index 0000000..db99fa0
--- /dev/null
+++ b/tests/bison_yylval_scanner.l
@@ -0,0 +1,81 @@
+/*
+ * 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.
+ */
+
+%{
+/* The scanner expects to link to bison yylval . */
+#include <stdio.h>
+#include <stdlib.h>
+#include "bison_yylval_parser.h"
+#include "config.h"
+static char* STRDUP(char* s1);
+
+enum yesno_t { no=0, yes=1 };
+#define YY_EXTRA_TYPE enum yesno_t
+%}
+
+%option 8bit prefix="test"
+%option reentrant bison-bridge
+%option header="bison_yylval_scanner.h"
+%option noyywrap nomain nounput noyy_top_state noyywrap nodefault noinput warn
+%option stack
+
+
+%x IN_TAG
+%x DISCARD_THRU_GT
+%%
+
+ #define YY_USER_INIT yyextra = no;
+ #define NEED_TAG_NAME yyextra
+
+
+<INITIAL>{
+"</" { NEED_TAG_NAME= yes; yy_push_state( IN_TAG, yyscanner); return LTSLASH;}
+"<"[^[:alpha:]] { yy_push_state(DISCARD_THRU_GT,yyscanner); }
+"<" { NEED_TAG_NAME= yes; yy_push_state( IN_TAG, yyscanner); return LT; }
+[^<]{1,512} { yyget_lval(yyscanner)->str = STRDUP(yytext); return TEXT;}
+}
+<IN_TAG>{
+">" { yy_pop_state( yyscanner ); return GT; }
+[[:alpha:]][[:alnum:]]* {
+ if( NEED_TAG_NAME == yes){
+ NEED_TAG_NAME=no;
+ yylval->str = STRDUP(yytext);
+ return TAGNAME;
+ }
+ }
+
+.|\r|\n { }
+}
+<DISCARD_THRU_GT>{
+[^>]{1,512} { }
+">" { yy_pop_state(yyscanner);}
+}
+%%
+
+
+static char* STRDUP(char* s1)
+{
+ char* s2 = (char*)malloc(strlen(s1)+1);
+ sprintf(s2,"%s",s1);
+ return s2;
+}
diff --git a/tests/c_cxx_nr.lll b/tests/c_cxx_nr.lll
new file mode 100644
index 0000000..c9e0fb6
--- /dev/null
+++ b/tests/c_cxx_nr.lll
@@ -0,0 +1,57 @@
+/*
+ * 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.
+ */
+
+%{
+/* A template scanner file to build "scanner.c".
+ The scanner is not really important -- we only care if
+ it compiles under a c++ compiler, and runs. */
+#include <stdio.h>
+#include <stdlib.h>
+#include "config.h"
+/*#include "parser.h" */
+
+%}
+
+%option 8bit prefix="test"
+%option nounput nomain noyywrap
+%option warn
+
+
+%%
+
+. { }
+
+%%
+
+int main(void);
+
+int
+main ()
+{
+ yyin = stdin;
+ yyout = stdout;
+ yylex();
+ yylex_destroy();
+ printf("TEST RETURNING OK.\n");
+ return 0;
+}
diff --git a/tests/c_cxx_nr.txt b/tests/c_cxx_nr.txt
new file mode 100644
index 0000000..7288a40
--- /dev/null
+++ b/tests/c_cxx_nr.txt
@@ -0,0 +1,2 @@
+0000 foo 1111 foo 0000 bar
+0000 foo 1111 foo 0000 bar
diff --git a/tests/c_cxx_r.lll b/tests/c_cxx_r.lll
new file mode 100644
index 0000000..83a39d7
--- /dev/null
+++ b/tests/c_cxx_r.lll
@@ -0,0 +1,61 @@
+/*
+ * 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.
+ */
+
+%{
+/* A template scanner file to build "scanner.c".
+ The scanner is not really important -- we only care if
+ it compiles under a c++ compiler, and runs. */
+#include <stdio.h>
+#include <stdlib.h>
+#include "config.h"
+/*#include "parser.h" */
+
+%}
+
+%option 8bit prefix="test"
+%option nounput nomain noyywrap
+%option warn reentrant
+
+
+%%
+
+. { }
+
+%%
+
+int main(void);
+
+int
+main ()
+{
+ yyscan_t lexer;
+ yylex_init( &lexer );
+ yyset_out ( stdout,lexer);
+ yyset_in ( stdin, lexer);
+ while( yylex(lexer) )
+ {
+ }
+ yylex_destroy( lexer );
+ printf("TEST RETURNING OK.\n");
+ return 0;
+}
diff --git a/tests/c_cxx_r.txt b/tests/c_cxx_r.txt
new file mode 100644
index 0000000..7288a40
--- /dev/null
+++ b/tests/c_cxx_r.txt
@@ -0,0 +1,2 @@
+0000 foo 1111 foo 0000 bar
+0000 foo 1111 foo 0000 bar
diff --git a/tests/ccl.l b/tests/ccl.l
new file mode 100644
index 0000000..c244892
--- /dev/null
+++ b/tests/ccl.l
@@ -0,0 +1,95 @@
+/*
+ * 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.
+ */
+
+%{
+/* A template scanner file to build "scanner.c". */
+#include <stdio.h>
+#include <stdlib.h>
+#include "config.h"
+/*#include "parser.h" */
+
+#define err_abort() do{printf("ERROR: flex line %d. input line %d.\n", __LINE__, yylineno); abort();} while(0)
+#define a_ok() do{printf("OK: flex line %d. input line %d.\n", __LINE__, yylineno); return 1;}while(0)
+%}
+
+%option 8bit prefix="test"
+%option nounput nomain noyywrap noinput
+%option warn
+
+
+%%
+
+^"^alpha:"[[:^alpha:]]+@alpha@\n printf("OK: %s", yytext); ++yylineno; return 1;
+^"^digit:"[[:^digit:]]+@digit@\n printf("OK: %s", yytext); ++yylineno; return 1;
+^"^alnum:"[[:^alnum:]]+@alnum@\n printf("OK: %s", yytext); ++yylineno; return 1;
+^"^upper:"[[:^upper:]]+@upper@\n printf("OK: %s", yytext); ++yylineno; return 1;
+^"^lower:"[[:^lower:]]+@lower@\n printf("OK: %s", yytext); ++yylineno; return 1;
+^"^space:"[[:^space:]]+@space@\n printf("OK: %s", yytext); ++yylineno; return 1;
+^"^blank:"[[:^blank:]]+@blank@\n printf("OK: %s", yytext); ++yylineno; return 1;
+^"^punct:"[[:^punct:]]+@punct@\n printf("OK: %s", yytext); ++yylineno; return 1;
+^"^cntrl:"[[:^cntrl:]]+@cntrl@\n printf("OK: %s", yytext); ++yylineno; return 1;
+^"^xdigit:"[[:^xdigit:]]+@xdigit@\n printf("OK: %s", yytext); ++yylineno; return 1;
+
+^"a-d:"[[:alpha:]]{-}[[:digit:]]+@a-d@\n printf("OK: %s", yytext); ++yylineno; return 1;
+^"l-xyz:"([[:lower:]]{-}[xyz])+@l-xyz@\n printf("OK: %s", yytext); ++yylineno; return 1;
+^"abcd-bc:"([abcd]{-}[bc])+@abcd-bc@\n printf("OK: %s", yytext); ++yylineno; return 1;
+^"abcde-b-c:"([abcde]{-}[b]{-}[c])+@abcde-b-c@\n printf("OK: %s", yytext); ++yylineno; return 1;
+^"^XY-^XYZ:"([^XY]{-}[^XYZ])+@^XY-^XYZ@\n printf("OK: %s", yytext); ++yylineno; return 1;
+
+^"a+d:"([[:alpha:]]{+}[[:digit:]])+"@a+d@"\n a_ok();
+^"a-u+Q:"([[:alpha:]]{-}[[:upper:]]{+}[Q])+"@a-u+Q@"\n a_ok();
+
+^"ia:"(?i:a)+@ia@\n printf("OK: %s", yytext); ++yylineno; return 1;
+^"iabc:"(?i:abc)+@iabc@\n printf("OK: %s", yytext); ++yylineno; return 1;
+^"ia-c:"(?i:[a-c]+)@ia-c@\n printf("OK: %s", yytext); ++yylineno; return 1;
+
+ /* We don't want this one to match. */
+^"check-a:"(?i:(?-i:A))@\n err_abort();
+^"check-a:"(?i:(?-i:(?i:A)))@\n printf("OK: %s", yytext); ++yylineno; return 1;
+
+ /* We don't want this one to match. */
+^"dot-all-1:"(?-s:XXX.*)@dot-all-1@\n err_abort();
+^"dot-all-1:"(?s:XXX.*)@dot-all-1@\n a_ok();
+
+^"x1:"(?x: a | b )+@x1@\n a_ok();
+^"x2:"(?x: a |
+ (?# Comment )
+ b
+ )+@x2@\n a_ok();
+
+
+.|\n { err_abort(); }
+%%
+
+int main(void);
+
+int
+main ()
+{
+ yyin = stdin;
+ yyout = stdout;
+ while (yylex())
+ ;
+ printf("TEST RETURNING OK.\n");
+ return 0;
+}
diff --git a/tests/ccl.txt b/tests/ccl.txt
new file mode 100644
index 0000000..b318fe6
--- /dev/null
+++ b/tests/ccl.txt
@@ -0,0 +1,27 @@
+^alpha:0123456789 ~!@#$%^&*(){}[]':;"<>,./?\+=_-`@alpha@
+^digit:abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ~!@#$%^&*(){}[]':;"<>,./?\+=_-`@digit@
+^alnum:~!@#$%^&*(){}[]':;"<>,./?\+=_-`@alnum@
+^upper:abcdefghijklmnopqrstuvwxyz0123456789 ~!@#$%^&*(){}[]':;"<>,./?\+=_-`@upper@
+^lower:ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEF ~!@#$%^&*(){}[]':;"<>,./?\+=_-`@lower@
+^space:abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEF~!@#$%^&*(){}[]':;"<>,./?\+=_-`@space@
+^blank:abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEF~!@#$%^&*(){}[]':;"<>,./?\+=_-`@blank@
+^punct:abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEF Z@punct@
+^cntrl:abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789ABCDEF~!@#$%^&*(){}[]':;"<>,./?\+=_-`@cntrl@
+^xdigit:ghijklmnopqrstuvwxyzGHIJKLMNOPQRSTUVWXYZ ~!@#$%^&*(){}[]':;"<>,./?\+=_-`@xdigit@
+a-d:abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@a-d@
+l-xyz:abcdefghijklmnopqrstuvw@l-xyz@
+abcd-bc:aaaaddddaaaa@abcd-bc@
+abcde-b-c:aaaaddddeeee@abcde-b-c@
+^XY-^XYZ:ZZZZZZZZZZZ@^XY-^XYZ@
+a+d:abc0123xyz789@a+d@
+a-u+Q:abcQQQQxyz@a-u+Q@
+ia:AaAa@ia@
+iabc:ABCabcAbCaBc@iabc@
+ia-c:ABCabcAbCaBc@ia-c@
+check-a:a@
+dot-all-1:XXX junk
+ junk
+ junk
+ @dot-all-1@
+x1:abaabb@x1@
+x2:abaabb@x2@
diff --git a/tests/cxx_basic.ll b/tests/cxx_basic.ll
new file mode 100644
index 0000000..6ffa39c
--- /dev/null
+++ b/tests/cxx_basic.ll
@@ -0,0 +1,50 @@
+/*
+ * 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 "config.h"
+
+%}
+
+%option 8bit prefix="test"
+%option warn c++
+%option nounput nomain noinput noyywrap
+
+%%
+
+. { }
+
+%%
+
+int main(void);
+
+int
+main (void)
+{
+ yyFlexLexer f;
+ f.switch_streams(&std::cin, &std::cout);
+ f.yylex();
+ std::cout << "TEST RETURNING OK." << std::endl;
+ return 0;
+}
diff --git a/tests/cxx_basic.txt b/tests/cxx_basic.txt
new file mode 100644
index 0000000..7288a40
--- /dev/null
+++ b/tests/cxx_basic.txt
@@ -0,0 +1,2 @@
+0000 foo 1111 foo 0000 bar
+0000 foo 1111 foo 0000 bar
diff --git a/tests/cxx_multiple_scanners.txt b/tests/cxx_multiple_scanners.txt
new file mode 100644
index 0000000..08498fa
--- /dev/null
+++ b/tests/cxx_multiple_scanners.txt
@@ -0,0 +1 @@
+foo on bar off
diff --git a/tests/cxx_multiple_scanners_1.ll b/tests/cxx_multiple_scanners_1.ll
new file mode 100644
index 0000000..f4adb9d
--- /dev/null
+++ b/tests/cxx_multiple_scanners_1.ll
@@ -0,0 +1,44 @@
+ // 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 "config.h"
+
+%}
+
+%option 8bit prefix="S1_"
+%option nounput nomain noyywrap
+%option warn stack noyy_top_state
+
+%x ON
+%x OFF
+%%
+<INITIAL>{
+on yy_push_state(ON); return 10;
+off yy_push_state(OFF); return 11;
+.|\n return 12;
+}
+<ON>.|\n yy_pop_state(); return 13;
+
+<OFF>.|\n yy_pop_state(); return 14;
+
+%%
+
diff --git a/tests/cxx_multiple_scanners_2.ll b/tests/cxx_multiple_scanners_2.ll
new file mode 100644
index 0000000..d84c530
--- /dev/null
+++ b/tests/cxx_multiple_scanners_2.ll
@@ -0,0 +1,48 @@
+ // 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 "config.h"
+
+%}
+
+%option 8bit prefix="S2_"
+%option nounput nomain
+%option warn stack noyy_top_state
+
+%x OFF
+%x ON
+%%
+<INITIAL>{
+on yy_push_state(ON); return 3;
+off yy_push_state(OFF); return 4;
+.|\n return 5;
+}
+<ON>.|\n yy_pop_state(); return 6;
+
+<OFF>.|\n yy_pop_state(); return 7;
+%%
+
+int S2_FlexLexer::yywrap()
+{
+ std::cout << "NOW WRAPPING." << std::endl;
+ return 1;
+}
diff --git a/tests/cxx_multiple_scanners_main.cc b/tests/cxx_multiple_scanners_main.cc
new file mode 100644
index 0000000..08fe2c1
--- /dev/null
+++ b/tests/cxx_multiple_scanners_main.cc
@@ -0,0 +1,56 @@
+/*
+ * 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 <stdio.h>
+
+#undef yyFlexLexer
+#define yyFlexLexer S1_FlexLexer
+#include <FlexLexer.h>
+
+#undef yyFlexLexer
+#define yyFlexLexer S2_FlexLexer
+#include <FlexLexer.h>
+
+int
+main ( int argc, char** argv )
+{
+ int S1_ok=1, S2_ok=1;
+ S1_FlexLexer* S1 = new S1_FlexLexer;
+ S2_FlexLexer* S2 = new S2_FlexLexer;
+
+ // scan simultaneously.
+ while(S1_ok || S2_ok)
+ {
+ if (S1_ok)
+ S1_ok = S1->yylex();
+ if (S2_ok)
+ S2_ok = S2->yylex();
+ }
+ printf("TEST RETURNING OK.\n");
+ delete S1;
+ delete S2;
+ return 0;
+}
+
+
+/* vim:set tabstop=8 softtabstop=4 shiftwidth=4: */
diff --git a/tests/cxx_yywrap.ll b/tests/cxx_yywrap.ll
new file mode 100644
index 0000000..0947cec
--- /dev/null
+++ b/tests/cxx_yywrap.ll
@@ -0,0 +1,70 @@
+/*
+ * 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 "config.h"
+#include <fstream>
+
+%}
+
+%option 8bit prefix="test"
+%option nounput nomain
+%option warn c++
+
+
+%%
+
+. { }
+
+%%
+
+#define MAX_FILES 10
+
+char *files[MAX_FILES] = { 0 };
+int filecounter = 0;
+
+int testFlexLexer::yywrap()
+{
+ if (filecounter-- > 0) {
+ std::cout << "NOW WRAPPING TO READ " << files[filecounter] << std::endl;
+ std::ifstream *ifs = new std::ifstream(files[filecounter]);
+ switch_streams(ifs);
+ return 0;
+ }
+ return 1;
+}
+
+int
+main (int argc, char *argv[])
+{
+ for (int i = 1; i < argc && i <= MAX_FILES; i++) {
+ files[i-1] = argv[i];
+ filecounter++;
+ }
+ testFlexLexer* f = new testFlexLexer;
+ f->yywrap();
+ f->yylex();
+ std::cout << "TEST RETURNING OK." << std::endl;
+ return 0;
+}
diff --git a/tests/cxx_yywrap.txt b/tests/cxx_yywrap.txt
new file mode 100644
index 0000000..7288a40
--- /dev/null
+++ b/tests/cxx_yywrap.txt
@@ -0,0 +1,2 @@
+0000 foo 1111 foo 0000 bar
+0000 foo 1111 foo 0000 bar
diff --git a/tests/debug_nr.l b/tests/debug_nr.l
new file mode 100644
index 0000000..0596dce
--- /dev/null
+++ b/tests/debug_nr.l
@@ -0,0 +1,52 @@
+/*
+ * 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.
+ */
+
+%{
+/* A template scanner file to build "scanner.c". */
+#include <stdio.h>
+#include <stdlib.h>
+#include "config.h"
+
+%}
+
+%option 8bit prefix="test"
+%option nounput nomain noyywrap noinput
+%option warn debug
+
+%%
+.+ { }
+\n { }
+%%
+
+int main(void);
+
+int
+main ()
+{
+ yyin = stdin;
+ yyout = stdout;
+ yy_flex_debug = 1;
+ yylex();
+ printf("TEST RETURNING OK.\n");
+ return 0;
+}
diff --git a/tests/debug_nr.txt b/tests/debug_nr.txt
new file mode 100644
index 0000000..8d6476c
--- /dev/null
+++ b/tests/debug_nr.txt
@@ -0,0 +1,2 @@
+Any input will do for this test.
+We are only testing if it actually runs in debug mode.
diff --git a/tests/debug_r.l b/tests/debug_r.l
new file mode 100644
index 0000000..0d40e0e
--- /dev/null
+++ b/tests/debug_r.l
@@ -0,0 +1,59 @@
+/*
+ * 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.
+ */
+
+%{
+/* A template scanner file to build "scanner.c". */
+#include <stdio.h>
+#include <stdlib.h>
+#include "config.h"
+
+%}
+
+%option 8bit prefix="test"
+%option nounput nomain noyywrap noinput
+%option warn debug reentrant
+
+%%
+.+ { }
+\n { }
+%%
+
+int main(void);
+
+int main ()
+{
+ yyscan_t lexer;
+ yylex_init( &lexer );
+ yyset_out ( stdout,lexer);
+ yyset_in ( stdin, lexer);
+
+ /* Just see if the next line compiles. */
+ testset_debug (testget_debug(lexer), lexer);
+
+ while( yylex(lexer) )
+ {
+ }
+ yylex_destroy( lexer );
+ printf("TEST RETURNING OK.\n");
+ return 0;
+}
diff --git a/tests/debug_r.txt b/tests/debug_r.txt
new file mode 100644
index 0000000..8d6476c
--- /dev/null
+++ b/tests/debug_r.txt
@@ -0,0 +1,2 @@
+Any input will do for this test.
+We are only testing if it actually runs in debug mode.
diff --git a/tests/extended.l b/tests/extended.l
new file mode 100644
index 0000000..a113fac
--- /dev/null
+++ b/tests/extended.l
@@ -0,0 +1,73 @@
+/*
+ * 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.
+ */
+
+%{
+/* This test is for correctness of extended (?...) patterns. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "config.h"
+
+%}
+
+%option 8bit prefix="test"
+%option nounput nomain noyywrap noinput
+%option warn
+
+
+%%
+
+ /* Output should match the input. */
+
+abc(?# Single Line Comment )def ECHO;
+ghi(?#
+ multi-line
+ comment
+ )jkl ECHO;
+
+mno(?#
+ multi-line //
+ comment with ##
+ ~~!@#$ %^&*(@-_+=\|,.<>/ ?: ;
+ punctuation
+ )pqr ECHO;
+(?# Start of a rule.)stu ECHO;
+vwxyz(?#End of a rule.) ECHO;
+A(?x: B
+ /* comment */
+ C D) ECHO;
+
+\n ECHO;
+%%
+
+int main(void);
+
+int
+main ()
+{
+ yyin = stdin;
+ yyout = stdout;
+ yylex();
+ //printf("TEST RETURNING OK.\n");
+ return 0;
+}
diff --git a/tests/extended.txt b/tests/extended.txt
new file mode 100644
index 0000000..829e23d
--- /dev/null
+++ b/tests/extended.txt
@@ -0,0 +1,2 @@
+abcdefghijklmnopqrstuvwxyz
+ABCD
diff --git a/tests/header_nr.txt b/tests/header_nr.txt
new file mode 100644
index 0000000..2ce5001
--- /dev/null
+++ b/tests/header_nr.txt
@@ -0,0 +1,3 @@
+Any input is ok for this scanner.
+We only care if it links.
+
diff --git a/tests/header_nr_main.c b/tests/header_nr_main.c
new file mode 100644
index 0000000..bb14749
--- /dev/null
+++ b/tests/header_nr_main.c
@@ -0,0 +1,40 @@
+/*
+ * 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 "header_nr_scanner.h"
+
+int
+main ( int argc, char** argv )
+{
+ (void)argc;
+ (void)argv;
+
+ testin = stdin;
+ testout = stdout;
+ testlex();
+ printf("TEST RETURNING OK.\n");
+ return 0;
+}
+
+
+/* vim:set tabstop=8 softtabstop=4 shiftwidth=4: */
diff --git a/tests/header_nr_scanner.l b/tests/header_nr_scanner.l
new file mode 100644
index 0000000..b429a6c
--- /dev/null
+++ b/tests/header_nr_scanner.l
@@ -0,0 +1,42 @@
+/*
+ * 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.
+ */
+
+%{
+/* A template scanner file to build "scanner.c". */
+#include <stdio.h>
+#include <stdlib.h>
+#include "config.h"
+
+%}
+
+%option 8bit prefix="test" header="header_nr_scanner.h"
+%option nounput nomain noyywrap noinput
+%option warn
+
+
+%%
+
+.|\n { }
+
+%%
+
diff --git a/tests/header_r.txt b/tests/header_r.txt
new file mode 100644
index 0000000..2ce5001
--- /dev/null
+++ b/tests/header_r.txt
@@ -0,0 +1,3 @@
+Any input is ok for this scanner.
+We only care if it links.
+
diff --git a/tests/header_r_main.c b/tests/header_r_main.c
new file mode 100644
index 0000000..22b397d
--- /dev/null
+++ b/tests/header_r_main.c
@@ -0,0 +1,67 @@
+/*
+ * 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 <assert.h>
+
+#include "header_r_scanner.h"
+
+/* The scanner itself is not important here.
+ * We simply try to use all the functions that are exported in the
+ * header, to see if we get any compiler warnings.
+ */
+int
+main ( int argc, char** argv )
+{
+ (void)argc;
+ (void)argv;
+
+ yyscan_t scanner;
+ FILE *fp;
+ char * extra = "EXTRA";
+
+ testlex_init(&scanner);
+ testset_in(stdin,scanner);
+ testset_out(stdout,scanner);
+ testset_extra(extra,scanner);
+
+ fp = testget_in(scanner);
+ assert(fp == stdin);
+ fp = testget_out(scanner);
+ assert(fp == stdout);
+
+ while(testlex(scanner)) {
+ char * text;
+ int line;
+ line = testget_lineno(scanner);
+ text = testget_text(scanner);
+
+ if( (char*)testget_extra(scanner) != extra)
+ break;
+
+ if ( !text || line < 0)
+ continue;
+ }
+ testlex_destroy(scanner);
+ printf("TEST RETURNING OK.\n");
+ return 0;
+}
diff --git a/tests/header_r_scanner.l b/tests/header_r_scanner.l
new file mode 100644
index 0000000..bfad8ba
--- /dev/null
+++ b/tests/header_r_scanner.l
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+
+%{
+/* Build "scanner.c".
+ The scanner is not important.
+ This test is really about compilation. See "main.c".
+*/
+#include <stdio.h>
+#include <stdlib.h>
+#include "config.h"
+
+%}
+
+%option reentrant
+%option 8bit prefix="test" header="header_r_scanner.h"
+%option nounput nomain noyywrap noinput
+%option warn
+
+
+%%
+
+.|\n { }
+
+%%
+
diff --git a/tests/include_by_buffer.direct.l b/tests/include_by_buffer.direct.l
new file mode 100644
index 0000000..f3b2d2a
--- /dev/null
+++ b/tests/include_by_buffer.direct.l
@@ -0,0 +1,102 @@
+/*
+ * 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
+f * 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.
+ */
+
+%{
+/* A scanner file to build "scanner.c".
+ Input language is any text.
+ "#include <filename>" causes a buffer switch.
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include "config.h"
+%}
+
+%option 8bit prefix="test"
+%option nounput nomain noyywrap noinput
+%option warn
+
+%x GET_FILENAME
+%{
+
+#define MAX_INCLUDE_DEPTH 10
+YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
+int include_stack_ptr = 0;
+%}
+%%
+
+<INITIAL>{
+^"#include"[[:blank:]]+"<" { BEGIN(GET_FILENAME); }
+.|\n { ECHO; }
+}
+
+<GET_FILENAME>{
+[[:alnum:]_.-]+> {
+ /* recurse */
+ yytext[yyleng-1]='\0';
+ include_stack[include_stack_ptr++] = YY_CURRENT_BUFFER;
+ if((yyin=fopen(yytext,"r"))==NULL) {
+ fprintf(stderr,"*** Error: Could not open include file \"%s\".\n",yytext);
+ yyterminate();
+ }
+ yy_switch_to_buffer( yy_create_buffer( yyin, YY_BUF_SIZE ));
+ BEGIN(0);
+ }
+.|\n {
+ fprintf(stderr,"Invalid input \"%s\".\n", yytext);
+ yyterminate();
+ }
+}
+
+<<EOF>> {
+ if ( --include_stack_ptr < 0 ) {
+ yyterminate();
+ }
+ else {
+ fclose(yyin);
+ yy_delete_buffer( YY_CURRENT_BUFFER );
+ yy_switch_to_buffer( include_stack[include_stack_ptr] );
+ }
+ }
+
+%%
+
+int main(int argc, char** argv);
+
+int
+main ( int argc, char** argv )
+{
+ FILE * fp;
+ if( argc != 2 ) {
+ fprintf(stderr,"*** Error: Must specify one filename.\n");
+ exit(-1);
+ }
+ if((fp=fopen(argv[1],"r"))==NULL) {
+ fprintf(stderr,"*** Error: fopen(%s) failed.\n",argv[1]);
+ exit(-1);
+ }
+ yyin = fp;
+ yyout = stdout;
+ yylex();
+ printf("TEST RETURNING OK.\n");
+ return 0;
+}
diff --git a/tests/include_by_buffer.direct.txt b/tests/include_by_buffer.direct.txt
new file mode 100644
index 0000000..56f1ed2
--- /dev/null
+++ b/tests/include_by_buffer.direct.txt
@@ -0,0 +1,3 @@
+Beginning of "include_by_buffer.direct.txt"
+#include <include_by_buffer.direct_2.txt>
+End of "include_by_buffer.direct.txt"
diff --git a/tests/include_by_buffer.direct_2.txt b/tests/include_by_buffer.direct_2.txt
new file mode 100644
index 0000000..52e61ea
--- /dev/null
+++ b/tests/include_by_buffer.direct_2.txt
@@ -0,0 +1,3 @@
+Beginning of "include_by_buffer.direct_2.txt"
+#include <include_by_buffer.direct_3.txt>
+End of "include_by_buffer.direct_2.txt"
diff --git a/tests/include_by_buffer.direct_3.txt b/tests/include_by_buffer.direct_3.txt
new file mode 100644
index 0000000..3cfdd0f
--- /dev/null
+++ b/tests/include_by_buffer.direct_3.txt
@@ -0,0 +1,2 @@
+Beginning of "include_by_buffer.direct_3.txt"
+End of "include_by_buffer.direct_3.txt"
diff --git a/tests/include_by_push.direct.l b/tests/include_by_push.direct.l
new file mode 100644
index 0000000..6b7a5fa
--- /dev/null
+++ b/tests/include_by_push.direct.l
@@ -0,0 +1,92 @@
+/*
+ * 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.
+ */
+
+%{
+/* A scanner file to build "scanner.c".
+ Input language is any text.
+ "#include <filename>" causes a buffer switch.
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include "config.h"
+%}
+
+%option 8bit prefix="test"
+%option nounput nomain noyywrap noinput
+%option warn
+
+%x GET_FILENAME
+
+%%
+
+<INITIAL>{
+^"#include"[[:blank:]]+"<" { BEGIN(GET_FILENAME); }
+.|\n { ECHO; }
+}
+
+<GET_FILENAME>{
+[[:alnum:]_.-]+> {
+ /* recurse */
+ yytext[yyleng-1]='\0';
+ if((yyin=fopen(yytext,"r"))==NULL) {
+ fprintf(stderr,"*** Error: Could not open include file \"%s\".\n",yytext);
+ yyterminate();
+ }
+ yypush_buffer_state( yy_create_buffer( yyin, YY_BUF_SIZE ));
+ BEGIN(0);
+ }
+.|\n {
+ fprintf(stderr,"Invalid input \"%s\".\n", yytext);
+ yyterminate();
+ }
+}
+
+<<EOF>> {
+ fclose(yyin);
+ yypop_buffer_state();
+ if(!YY_CURRENT_BUFFER)
+ yyterminate();
+ }
+
+%%
+
+int main(int argc, char** argv);
+
+int
+main ( int argc, char** argv )
+{
+ FILE * fp;
+ if( argc != 2 ) {
+ fprintf(stderr,"*** Error: Must specify one filename.\n");
+ exit(-1);
+ }
+ if((fp=fopen(argv[1],"r"))==NULL) {
+ fprintf(stderr,"*** Error: fopen(%s) failed.\n",argv[1]);
+ exit(-1);
+ }
+ yyin = fp;
+ yyout = stdout;
+ yylex();
+ printf("TEST RETURNING OK.\n");
+ return 0;
+}
diff --git a/tests/include_by_push.direct.txt b/tests/include_by_push.direct.txt
new file mode 100644
index 0000000..93136f6
--- /dev/null
+++ b/tests/include_by_push.direct.txt
@@ -0,0 +1,3 @@
+Beginning of "include_by_push.direct.txt"
+#include <include_by_push.direct_2.txt>
+End of "include_by_push.direct.txt"
diff --git a/tests/include_by_push.direct_2.txt b/tests/include_by_push.direct_2.txt
new file mode 100644
index 0000000..8b378e8
--- /dev/null
+++ b/tests/include_by_push.direct_2.txt
@@ -0,0 +1,3 @@
+Beginning of "include_by_push.direct_2.txt"
+#include <include_by_push.direct_3.txt>
+End of "include_by_push.direct_2.txt"
diff --git a/tests/include_by_push.direct_3.txt b/tests/include_by_push.direct_3.txt
new file mode 100644
index 0000000..8b8f9a5
--- /dev/null
+++ b/tests/include_by_push.direct_3.txt
@@ -0,0 +1,2 @@
+Beginning of "include_by_push.direct_3.txt"
+End of "include_by_push.direct_3.txt"
diff --git a/tests/include_by_reentrant.direct.l b/tests/include_by_reentrant.direct.l
new file mode 100644
index 0000000..8cd4900
--- /dev/null
+++ b/tests/include_by_reentrant.direct.l
@@ -0,0 +1,101 @@
+/*
+ * 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.
+ */
+
+%{
+/* A scanner file to build "scanner.c".
+ Input language is any text.
+ "#include <filename>" causes a new scanner to be created.
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include "config.h"
+%}
+
+%option 8bit prefix="test"
+%option nounput nomain noyywrap noinput
+%option reentrant
+%option warn
+
+%x GET_FILENAME
+
+%%
+
+<INITIAL>{
+^"#include"[[:blank:]]+"<" { BEGIN(GET_FILENAME); }
+.|\n { ECHO; }
+}
+
+<GET_FILENAME>{
+[[:alnum:]_.-]+> {
+ /* recurse */
+ yyscan_t scanner;
+ FILE * fp;
+ yytext[yyleng-1]='\0';
+ if((fp=fopen(yytext,"r"))==NULL) {
+ fprintf(stderr,"*** Error: Could not open include file \"%s\".\n",
+ yytext);
+ yyterminate();
+ }
+ yylex_init(&scanner);
+ yyset_in( fp, scanner);
+ yyset_out( stdout, scanner);
+ yylex(scanner);
+ yylex_destroy(scanner);
+
+ BEGIN(0);
+ }
+.|\n {
+ fprintf(stderr,"Invalid input \"%s\".\n", yytext);
+ yyterminate();
+ }
+}
+
+<<EOF>> { fclose(yyin); yyterminate();}
+
+%%
+
+int main (int argc, char** argv);
+
+int
+main ( argc, argv )
+ int argc;
+ char ** argv;
+{
+ FILE * fp;
+ yyscan_t scanner;
+ if( argc != 2 ) {
+ fprintf(stderr,"*** Error: Must specify one filename.\n");
+ exit(-1);
+ }
+ if((fp=fopen(argv[1],"r"))==NULL) {
+ fprintf(stderr,"*** Error: fopen(%s) failed.\n",argv[1]);
+ exit(-1);
+ }
+ yylex_init(&scanner);
+ yyset_in( fp, scanner);
+ yyset_out( stdout, scanner);
+ yylex(scanner);
+ yylex_destroy(scanner);
+ printf("TEST RETURNING OK.\n");
+ return 0;
+}
diff --git a/tests/include_by_reentrant.direct.txt b/tests/include_by_reentrant.direct.txt
new file mode 100644
index 0000000..190a600
--- /dev/null
+++ b/tests/include_by_reentrant.direct.txt
@@ -0,0 +1,3 @@
+Beginning of "include_by_reentrant.direct.txt".
+#include <include_by_reentrant.direct_2.txt>
+End of "include_by_reentrant.direct.txt".
diff --git a/tests/include_by_reentrant.direct_2.txt b/tests/include_by_reentrant.direct_2.txt
new file mode 100644
index 0000000..84a647b
--- /dev/null
+++ b/tests/include_by_reentrant.direct_2.txt
@@ -0,0 +1,3 @@
+Beginning of "include_by_reentrant.direct_2.txt".
+#include <include_by_reentrant.direct_3.txt>
+End of "include_by_reentrant.direct_2.txt".
diff --git a/tests/include_by_reentrant.direct_3.txt b/tests/include_by_reentrant.direct_3.txt
new file mode 100644
index 0000000..b0fba64
--- /dev/null
+++ b/tests/include_by_reentrant.direct_3.txt
@@ -0,0 +1,2 @@
+Beginning of "include_by_reentrant.direct_3.txt".
+End of "include_by_reentrant.direct_3.txt".
diff --git a/tests/lineno_nr.l b/tests/lineno_nr.l
new file mode 100644
index 0000000..8e35fc1
--- /dev/null
+++ b/tests/lineno_nr.l
@@ -0,0 +1,96 @@
+/*
+ * 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.
+ */
+
+%{
+/* A template scanner file to build "scanner.c".
+ Run as:
+ test-lineno-nr # report flex's yylineno
+ test-lineno-nr 1 # report count_newlines(stdin)
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "config.h"
+
+%}
+
+%option 8bit prefix="test"
+%option nounput nomain noyywrap noinput yylineno
+%option warn
+
+WORD [[:alpha:]]+
+DIGIT [[:digit:]]
+
+%%
+ /* The goal here is to test the yylineno processing by:
+ - providing some rules than CAN match newlines and
+ other rules that can NOT match newlines,
+ - matching several newlines in one rule,
+ - directly modifying yylineno.
+ */
+
+"yylineno++" yylineno++;
+"yylineno--" yylineno--;
+[[:blank:]]+
+{WORD}
+{DIGIT}+(\n{DIGIT}+)*
+\n
+.
+<<EOF>> { printf("%d\n", yylineno);
+ yyterminate();
+ }
+
+%%
+
+/* returns number of '\n' characters in input, plus one.
+ This is what flex does, essentially. */
+
+static int
+count_newlines (FILE* in)
+{
+ int n=1,c;
+ while ((c=fgetc(in)) != EOF)
+ if( c == '\n')
+ n++;
+ return n;
+}
+
+int main ( int, char**);
+
+int
+main ( argc, argv )
+ int argc;
+ char** argv;
+{
+ (void)argv;
+
+ if( argc > 1 )
+ printf("%d\n", count_newlines(stdin));
+
+ else{
+ yyin = stdin;
+ yyout = stdout;
+ yylex();
+ }
+ return 0;
+}
diff --git a/tests/lineno_nr.one.txt b/tests/lineno_nr.one.txt
new file mode 100644
index 0000000..c1eb961
--- /dev/null
+++ b/tests/lineno_nr.one.txt
@@ -0,0 +1,19 @@
+These words
+are separated
+by newlines
+and sometimes
+ spaces
+too.
+The next three lines are numbers with only intervening newlines
+01123
+581321
+34
+And now for some blank lines....
+
+
+Finally, we directly modify yylineno, but then change it back afterwards
+(see scanner.l):
+
+yylineno++
+
+yylineno--
diff --git a/tests/lineno_r.l b/tests/lineno_r.l
new file mode 100644
index 0000000..e6207c6
--- /dev/null
+++ b/tests/lineno_r.l
@@ -0,0 +1,99 @@
+/*
+ * 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.
+ */
+
+%{
+/* A template scanner file to build "scanner.c".
+ Run as:
+ test-lineno-r # report flex's yylineno
+ test-lineno-r 1 # report count_newlines(stdin)
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "config.h"
+
+%}
+
+%option 8bit prefix="test"
+%option nounput nomain noyywrap noinput yylineno reentrant
+%option warn
+
+WORD [[:alpha:]]+
+DIGIT [[:digit:]]
+
+%%
+ /* The goal here is to test the yylineno processing by:
+ - providing some rules than CAN match newlines and
+ other rules that can NOT match newlines,
+ - matching several newlines in one rule,
+ - directly modifying yylineno.
+ */
+
+"yylineno++" yylineno++;
+"yylineno--" yylineno--;
+[[:blank:]]+
+{WORD}
+{DIGIT}+(\n{DIGIT}+)*
+\n
+.
+<<EOF>> { printf("%d\n", yylineno);
+ yyterminate();
+ }
+
+%%
+
+/* returns number of '\n' characters in input, plus one.
+ This is what flex does, essentially. */
+
+static int
+count_newlines (FILE* in)
+{
+ int n=1,c;
+ while ((c=fgetc(in)) != EOF)
+ if( c == '\n')
+ n++;
+ return n;
+}
+
+int main ( int argc, char** argv );
+
+int
+main (argc, argv)
+ int argc;
+ char ** argv;
+{
+ (void)argv;
+
+ if( argc > 1 )
+ printf("%d\n", count_newlines(stdin));
+
+ else{
+ yyscan_t s;
+ yylex_init(&s);
+ yyset_in(stdin,s);
+ yyset_out(stdout,s);
+ yylex(s);
+ yylex_destroy(s);
+ }
+ return 0;
+}
diff --git a/tests/lineno_r.one.txt b/tests/lineno_r.one.txt
new file mode 100644
index 0000000..c1eb961
--- /dev/null
+++ b/tests/lineno_r.one.txt
@@ -0,0 +1,19 @@
+These words
+are separated
+by newlines
+and sometimes
+ spaces
+too.
+The next three lines are numbers with only intervening newlines
+01123
+581321
+34
+And now for some blank lines....
+
+
+Finally, we directly modify yylineno, but then change it back afterwards
+(see scanner.l):
+
+yylineno++
+
+yylineno--
diff --git a/tests/lineno_trailing.l b/tests/lineno_trailing.l
new file mode 100644
index 0000000..3a8a683
--- /dev/null
+++ b/tests/lineno_trailing.l
@@ -0,0 +1,89 @@
+/*
+ * 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.
+ */
+
+%{
+/* A template scanner file to build "scanner.c".
+ Run as:
+ test-lineno-trailing # report flex's yylineno
+ test-lineno-trailing 1 # report count_newlines(stdin)
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "config.h"
+
+%}
+
+%option 8bit prefix="test"
+%option nounput nomain noyywrap noinput yylineno
+%option warn
+
+WORD [[:alpha:]]+
+
+%%
+ /* The goal here is to test the yylineno in the context of trailing-contexts.
+ Using rules that have newlines in look-ahead.
+ */
+"Fixed_trailing:"/[\n]"test"[\n] {}
+"Var_trailing:"{WORD}/[\n] {}
+"Var_prefix_and_trailing:"{WORD}":"/(\n{WORD})* {}
+\n {}
+. {}
+<<EOF>> { printf("%d\n", yylineno);
+ yyterminate();
+ }
+
+%%
+
+/* returns number of '\n' characters in input, plus one.
+ This is what flex does, essentially. */
+
+static int
+count_newlines (FILE* in)
+{
+ int n=1,c;
+ while ((c=fgetc(in)) != EOF)
+ if( c == '\n')
+ n++;
+ return n;
+}
+
+int main ( int, char**);
+
+int
+main ( argc, argv )
+ int argc;
+ char** argv;
+{
+ (void)argv;
+
+ if( argc > 1 )
+ printf("%d\n", count_newlines(stdin));
+
+ else{
+ yyin = stdin;
+ yyout = stdout;
+ yylex();
+ }
+ return 0;
+}
diff --git a/tests/lineno_trailing.one.txt b/tests/lineno_trailing.one.txt
new file mode 100644
index 0000000..201164d
--- /dev/null
+++ b/tests/lineno_trailing.one.txt
@@ -0,0 +1,13 @@
+We are testing rules with trailing contexts containing newlines (see scanner.l):
+
+Fixed_trailing:
+test
+
+Var_trailing:word
+test
+
+Var_prefix_and_trailing:word:
+more
+text
+comes
+here
diff --git a/tests/mem_nr.l b/tests/mem_nr.l
new file mode 100644
index 0000000..c7a6ce0
--- /dev/null
+++ b/tests/mem_nr.l
@@ -0,0 +1,179 @@
+/*
+ * 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.
+ */
+
+%{
+/* A template scanner file to build "scanner.c".
+ * The whole idea is to cause memory realloc by
+ * 1. pushing a lot on the condition stack, and
+ * 2. eating input greater than YY_BUF_SIZE
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include "config.h"
+
+/* Insanely small read buffer. This pretty much guarantees at least one realloc. */
+#ifdef YY_BUF_SIZE
+#undef YY_BUF_SIZE
+#endif
+#define YY_BUF_SIZE 8
+
+%}
+
+%option 8bit prefix="test"
+%option nounput nomain noyywrap noinput noyy_top_state
+%option warn stack nodefault
+%option noyyalloc noyyrealloc noyyfree
+
+%x parens
+
+%%
+
+<INITIAL>{
+"(" { printf("yy_push_state(parens)\n"); yy_push_state(parens); }
+len=[0-9]+ { printf("About read token where %s\n",yytext); }
+0+ { }
+.|\n { }
+}
+
+<parens>{
+"(" { printf("yy_push_state(parens)\n"); yy_push_state(parens); }
+")" { printf("yy_pop_state()\n");yy_pop_state();}
+[^()\n]+ { }
+.|\n { }
+}
+
+%%
+/* total memory allocated */
+static size_t total_mem=0;
+
+/* track the amount of memory for ptr. */
+struct memsz {
+ void* p;
+ size_t sz;
+};
+
+static struct memsz * ptrs=0; /* Array of pairs. */
+static int nptrs=0; /* Number of pairs in array. */
+static int arrsz=0; /* Capacity of array. */
+
+static void dump_mem(FILE* fp){
+ int i;
+ fprintf(fp,"\tptrs[%d] = {", nptrs);
+ for (i=0; i < arrsz; i++)
+ fprintf(fp," {%#lx,%ld},", (long)ptrs[i].p, (long)ptrs[i].sz);
+
+ fprintf(fp,"}\n");
+}
+
+void * yyalloc(yy_size_t n)
+{
+ void * p;
+ int i;
+
+ total_mem += n;
+ p = (void*)malloc(n);
+
+ if( nptrs >= arrsz){
+ /* increase array size by 1 */
+ arrsz++;
+ ptrs = (struct memsz*)realloc( ptrs, arrsz * sizeof(struct memsz));
+ ptrs[nptrs].p = 0;
+ ptrs[nptrs].sz = 0;
+ }
+
+ /* find a null slot */
+ for(i=0; i < arrsz ; i++)
+ if (ptrs[i].p == 0) {
+ ptrs[i].p = p;
+ ptrs[i].sz = n;
+ }
+
+ nptrs++;
+ printf("yyflex_alloc(%8ld) total=%8ld return=%#10lx\n",(long)n,(long)total_mem,(long)p);
+ dump_mem(stdout);
+ return p;
+}
+
+void * yyrealloc(void* p, yy_size_t n)
+{
+ int i;
+ for (i=0; i < arrsz; i++)
+ if ( ptrs[i].p == p){
+ total_mem -= ptrs[i].sz;
+ total_mem += n;
+ ptrs[i].p = (void*)realloc(p,n);
+ ptrs[i].sz = n;
+
+ printf("yyflex_realloc(%#10lx,%8ld) total=%8ld return=%8lx\n",
+ (long)p,(long)n,(long)total_mem,(long)ptrs[i].p);
+ dump_mem(stdout);
+ return ptrs[i].p;
+ }
+
+ fprintf(stderr,"ERROR: yyflex_realloc could not locate pointer %#lx.\n",(long)p);
+ dump_mem(stdout);
+ exit(1);
+}
+
+void yyfree(void* p)
+{
+ int i;
+ for (i=0; i < arrsz; i++)
+ if ( ptrs[i].p == p){
+ total_mem -= ptrs[i].sz;
+ free(p);
+ ptrs[i].p = 0;
+ ptrs[i].sz = 0;
+ nptrs--;
+ printf("yyflex_free(%#10lx) total=%8ld\n",(long)p,(long)total_mem);
+ dump_mem(stdout);
+ return;
+ }
+
+ fprintf(stderr,"ERROR: yyflex_free could not locate pointer %#lx.\n",(long)p);
+ dump_mem(stdout);
+ exit(1);
+}
+
+int main(void);
+
+int
+main ()
+{
+ arrsz = 1;
+ ptrs = (struct memsz*)calloc(1,sizeof(struct memsz));
+ nptrs = 0;
+
+ yyin = stdin;
+ yyout = stdout;
+ yylex();
+ yylex_destroy();
+ free(ptrs);
+
+ if ( nptrs > 0 || total_mem > 0){
+ fprintf(stderr,"Oops. Looks like a memory leak: nptrs=%d, unfreed memory=%ld\n",nptrs,(long)total_mem);
+ exit(1);
+ }
+ printf("TEST RETURNING OK.\n");
+ return 0;
+}
diff --git a/tests/mem_nr.txt b/tests/mem_nr.txt
new file mode 100644
index 0000000..79aa16a
--- /dev/null
+++ b/tests/mem_nr.txt
@@ -0,0 +1,25 @@
+First we push a lot on the stack by nesting parenthesis:
+
+((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
+((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
+(((((((((((((((((((((((((((((((((((((((((((
+
+(should be 200 states pushed here)
+
+))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
+))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
+)))))))))))))))))))))))))))))))))))))))))))
+
+Now we match progressively bigger tokens to increase the read buffer:
+
+len=1 0
+len=2 00
+len=4 0000
+len=8 00000000
+len=16 0000000000000000
+len=32 00000000000000000000000000000000
+len=64 0000000000000000000000000000000000000000000000000000000000000000
+len=128 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+len=256 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+len=512 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+len=1024 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
diff --git a/tests/mem_r.l b/tests/mem_r.l
new file mode 100644
index 0000000..cbfe08c
--- /dev/null
+++ b/tests/mem_r.l
@@ -0,0 +1,187 @@
+/*
+ * 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.
+ */
+
+%{
+/* A template scanner file to build "scanner.c".
+ * The whole idea is to cause memory realloc by
+ * 1. pushing a lot on the condition stack, and
+ * 2. eating input greater than YY_BUF_SIZE
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include "config.h"
+
+/* Insanely small read buffer. This pretty much guarantees at least one realloc. */
+#ifdef YY_BUF_SIZE
+#undef YY_BUF_SIZE
+#endif
+#define YY_BUF_SIZE 8
+
+%}
+
+%option 8bit prefix="test"
+%option nounput nomain noyywrap noinput noyy_top_state
+%option warn stack nodefault reentrant
+%option noyyalloc noyyrealloc noyyfree
+
+%x parens
+
+%%
+
+<INITIAL>{
+"(" { printf("yy_push_state(parens)\n"); yy_push_state(parens,yyscanner); }
+len=[0-9]+ { printf("About read token where %s\n",yytext); }
+0+ { }
+.|\n { }
+}
+
+<parens>{
+"(" { printf("yy_push_state(parens)\n"); yy_push_state(parens,yyscanner); }
+")" { printf("yy_pop_state()\n");yy_pop_state(yyscanner);}
+[^()\n]+ { }
+.|\n { }
+}
+
+%%
+/* total memory allocated */
+static size_t total_mem=0;
+
+/* track the amount of memory for ptr. */
+struct memsz {
+ void* p;
+ size_t sz;
+};
+
+static struct memsz * ptrs=0; /* Array of pairs. */
+static int nptrs=0; /* Number of pairs in array. */
+static int arrsz=0; /* Capacity of array. */
+
+static void dump_mem(FILE* fp){
+ int i;
+ fprintf(fp,"\tptrs[%d] = {", nptrs);
+ for (i=0; i < arrsz; i++)
+ fprintf(fp," {%#lx,%ld},", (long)ptrs[i].p, (long)ptrs[i].sz);
+
+ fprintf(fp,"}\n");
+}
+
+void * yyalloc(yy_size_t n , void* yyscanner)
+{
+ (void)yyscanner;
+
+ void * p;
+ int i;
+
+ total_mem += n;
+ p = (void*)malloc(n);
+
+ if( nptrs >= arrsz){
+ /* increase array size by 1 */
+ arrsz++;
+ ptrs = (struct memsz*)realloc( ptrs, arrsz * sizeof(struct memsz));
+ ptrs[nptrs].p = 0;
+ ptrs[nptrs].sz = 0;
+ }
+
+ /* find a null slot */
+ for(i=0; i < arrsz ; i++)
+ if (ptrs[i].p == 0) {
+ ptrs[i].p = p;
+ ptrs[i].sz = n;
+ }
+
+ nptrs++;
+ printf("yyflex_alloc(%8ld) total=%8ld return=%#10lx\n",(long)n,(long)total_mem,(long)p);
+ dump_mem(stdout);
+ return p;
+}
+
+void * yyrealloc(void* p, yy_size_t n , void* yyscanner)
+{
+ (void)yyscanner;
+
+ int i;
+ for (i=0; i < arrsz; i++)
+ if ( ptrs[i].p == p){
+ total_mem -= ptrs[i].sz;
+ total_mem += n;
+ ptrs[i].p = (void*)realloc(p,n);
+ ptrs[i].sz = n;
+
+ printf("yyflex_realloc(%#10lx,%8ld) total=%8ld return=%8lx\n",
+ (long)p,(long)n,(long)total_mem,(long)ptrs[i].p);
+ dump_mem(stdout);
+ return ptrs[i].p;
+ }
+
+ fprintf(stderr,"ERROR: yyflex_realloc could not locate pointer %#lx.\n",(long)p);
+ dump_mem(stdout);
+ exit(1);
+}
+
+void yyfree(void* p , void* yyscanner)
+{
+ (void)yyscanner;
+
+ int i;
+ for (i=0; i < arrsz; i++)
+ if ( ptrs[i].p == p){
+ total_mem -= ptrs[i].sz;
+ free(p);
+ ptrs[i].p = 0;
+ ptrs[i].sz = 0;
+ nptrs--;
+ printf("yyflex_free(%#10lx) total=%8ld\n",(long)p,(long)total_mem);
+ dump_mem(stdout);
+ return;
+ }
+
+ fprintf(stderr,"ERROR: yyflex_free could not locate pointer %#lx.\n",(long)p);
+ dump_mem(stdout);
+ exit(1);
+}
+
+int main(void);
+
+int
+main ()
+{
+ yyscan_t scanner;
+ arrsz = 1;
+ ptrs = (struct memsz*)calloc(1,sizeof(struct memsz));
+ nptrs = 0;
+
+ yylex_init(&scanner);
+ yyset_in(stdin,scanner);
+ yyset_out(stdout,scanner);
+ yylex(scanner);
+ yylex_destroy(scanner);
+ free(ptrs);
+
+ if ( nptrs > 0 || total_mem > 0){
+ fprintf(stderr,"Oops. Looks like a memory leak: nptrs=%d, unfreed memory=%ld\n",nptrs,(long)total_mem);
+ exit(1);
+ }
+ printf("TEST RETURNING OK.\n");
+ return 0;
+}
diff --git a/tests/mem_r.txt b/tests/mem_r.txt
new file mode 100644
index 0000000..79aa16a
--- /dev/null
+++ b/tests/mem_r.txt
@@ -0,0 +1,25 @@
+First we push a lot on the stack by nesting parenthesis:
+
+((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
+((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
+(((((((((((((((((((((((((((((((((((((((((((
+
+(should be 200 states pushed here)
+
+))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
+))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
+)))))))))))))))))))))))))))))))))))))))))))
+
+Now we match progressively bigger tokens to increase the read buffer:
+
+len=1 0
+len=2 00
+len=4 0000
+len=8 00000000
+len=16 0000000000000000
+len=32 00000000000000000000000000000000
+len=64 0000000000000000000000000000000000000000000000000000000000000000
+len=128 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+len=256 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+len=512 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+len=1024 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
diff --git a/tests/multiple_scanners_nr_1.l b/tests/multiple_scanners_nr_1.l
new file mode 100644
index 0000000..fcba194
--- /dev/null
+++ b/tests/multiple_scanners_nr_1.l
@@ -0,0 +1,50 @@
+/*
+ * 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.
+ */
+
+%{
+/* A template scanner file to build "scanner-1.c" and "scanner-1.h". */
+#include <stdio.h>
+#include <stdlib.h>
+#include "config.h"
+
+%}
+
+%option header="multiple_scanners_nr_1.h"
+%option 8bit prefix="S1_"
+%option nounput nomain noyywrap noinput
+%option warn stack noyy_top_state
+
+%x ON
+%x OFF
+%%
+<INITIAL>{
+on yy_push_state(ON); return 10;
+off yy_push_state(OFF); return 11;
+.|\n return 12;
+}
+<ON>.|\n yy_pop_state(); return 13;
+
+<OFF>.|\n yy_pop_state(); return 14;
+
+%%
+
diff --git a/tests/multiple_scanners_nr_2.l b/tests/multiple_scanners_nr_2.l
new file mode 100644
index 0000000..fff2e88
--- /dev/null
+++ b/tests/multiple_scanners_nr_2.l
@@ -0,0 +1,49 @@
+/*
+ * 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.
+ */
+
+%{
+/* A template scanner file to build "scanner-2.c" and "scanner-2.h". */
+#include <stdio.h>
+#include <stdlib.h>
+#include "config.h"
+
+%}
+
+%option header="multiple_scanners_nr_2.h"
+%option 8bit prefix="S2_"
+%option nounput nomain noyywrap noinput
+%option warn stack noyy_top_state
+
+%x OFF
+%x ON
+%%
+<INITIAL>{
+on yy_push_state(ON); return 3;
+off yy_push_state(OFF); return 4;
+.|\n return 5;
+}
+<ON>.|\n yy_pop_state(); return 6;
+
+<OFF>.|\n yy_pop_state(); return 7;
+%%
+
diff --git a/tests/multiple_scanners_nr_main.c b/tests/multiple_scanners_nr_main.c
new file mode 100644
index 0000000..497bd9f
--- /dev/null
+++ b/tests/multiple_scanners_nr_main.c
@@ -0,0 +1,51 @@
+/*
+ * 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 "multiple_scanners_nr_1.h"
+#include "multiple_scanners_nr_2.h"
+
+int
+main ( int argc, char** argv )
+{
+ (void)argc;
+ (void)argv;
+
+ int S1_ok=1, S2_ok=1;
+ YY_BUFFER_STATE buff1, buff2;
+ S1_out = S2_out = stdout;
+ buff1 = S1__scan_string("foo on bar off");
+ buff2 = S2__scan_string("on blah blah off foo on bar off");
+
+ /* scan simultaneously. */
+ while(S1_ok || S2_ok)
+ {
+ if (S1_ok)
+ S1_ok = S1_lex();
+ if (S2_ok)
+ S2_ok = S2_lex();
+ }
+ S1__delete_buffer(buff1);
+ S2__delete_buffer(buff2);
+ printf("TEST RETURNING OK.\n");
+ return 0;
+}
diff --git a/tests/multiple_scanners_r_1.l b/tests/multiple_scanners_r_1.l
new file mode 100644
index 0000000..75ef179
--- /dev/null
+++ b/tests/multiple_scanners_r_1.l
@@ -0,0 +1,50 @@
+/*
+ * 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.
+ */
+
+%{
+/* A template scanner file to build "scanner-1.c" and "scanner-1.h". */
+#include <stdio.h>
+#include <stdlib.h>
+#include "config.h"
+
+%}
+
+%option header="multiple_scanners_r_1.h"
+%option 8bit prefix="S1_"
+%option nounput nomain noyywrap noinput noyy_top_state
+%option warn stack reentrant
+
+%x ON
+%x OFF
+%%
+<INITIAL>{
+on yy_push_state(ON, yyscanner); return 10;
+off yy_push_state(OFF, yyscanner); return 11;
+.|\n return 12;
+}
+<ON>.|\n yy_pop_state(yyscanner); return 13;
+
+<OFF>.|\n yy_pop_state(yyscanner); return 14;
+
+%%
+
diff --git a/tests/multiple_scanners_r_2.l b/tests/multiple_scanners_r_2.l
new file mode 100644
index 0000000..a10d63d
--- /dev/null
+++ b/tests/multiple_scanners_r_2.l
@@ -0,0 +1,49 @@
+/*
+ * 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.
+ */
+
+%{
+/* A template scanner file to build "scanner-2.c" and "scanner-2.h". */
+#include <stdio.h>
+#include <stdlib.h>
+#include "config.h"
+
+%}
+
+%option header="multiple_scanners_r_2.h"
+%option 8bit prefix="S2_"
+%option nounput nomain noyywrap noinput
+%option warn stack reentrant noyy_top_state
+
+%x OFF
+%x ON
+%%
+<INITIAL>{
+on yy_push_state(ON, yyscanner); return 3;
+off yy_push_state(OFF, yyscanner); return 4;
+.|\n return 5;
+}
+<ON>.|\n yy_pop_state(yyscanner); return 6;
+
+<OFF>.|\n yy_pop_state(yyscanner); return 7;
+%%
+
diff --git a/tests/multiple_scanners_r_main.c b/tests/multiple_scanners_r_main.c
new file mode 100644
index 0000000..ea73806
--- /dev/null
+++ b/tests/multiple_scanners_r_main.c
@@ -0,0 +1,65 @@
+/*
+ * 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 "multiple_scanners_r_1.h"
+#include "multiple_scanners_r_2.h"
+
+int
+main ( int argc, char** argv )
+{
+ (void)argc;
+ (void)argv;
+
+ int S1_ok=1, S2_ok=1;
+ FILE * fp;
+ YY_BUFFER_STATE buff1, buff2;
+ yyscan_t scan1, scan2;
+
+ S1_lex_init(&scan1);
+ S2_lex_init(&scan2);
+
+ S1_set_out(stdout,scan1);
+ S2_set_out(S1_get_out(scan1),scan2);
+
+ buff1 = S1__scan_string("foo on bar off", scan1);
+ buff2 = S2__scan_string("on blah blah off foo on bar off", scan2);
+
+ /* scan simultaneously. */
+ while(S1_ok || S2_ok)
+ {
+ if (S1_ok)
+ S1_ok = S1_lex(scan1);
+ if (S2_ok)
+ S2_ok = S2_lex(scan2);
+ }
+ S1__delete_buffer(buff1, scan1);
+ S2__delete_buffer(buff2, scan2);
+
+ S1_lex_destroy(scan1);
+ S2_lex_destroy(scan2);
+ printf("TEST RETURNING OK.\n");
+ return 0;
+}
+
+
+/* vim:set tabstop=8 softtabstop=4 shiftwidth=4: */
diff --git a/tests/noansi_nr.l b/tests/noansi_nr.l
new file mode 100644
index 0000000..db075a4
--- /dev/null
+++ b/tests/noansi_nr.l
@@ -0,0 +1,67 @@
+/*
+ * 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.
+ */
+
+/* TEST scanner.
+ Basic non-reentrant scanner, but with non-ansi function defs.
+ Compile with: flex scanner.l
+
+ Sample Input:
+ # this is a comment
+ foo = true
+ bar = "string value"
+ integer = 43
+*/
+%{
+#include "config.h"
+%}
+
+%option prefix="test"
+%option nounput noyywrap noyylineno warn nodefault noinput
+%option noansi-prototypes noansi-definitions
+
+IDENT [[:alnum:]_-]
+WS [[:blank:]]
+%%
+
+^{IDENT}+{WS}*={WS}*(true|false){WS}*\r?\n { return 100;}
+^{IDENT}+{WS}*={WS}*\"[^\"\n\r]*\"{WS}*\r?\n { return 101;}
+^{IDENT}+{WS}*={WS}*[[:digit:]]+{WS}*\r?\n { return 102;}
+^{WS}*#.*\r?\n { }
+^{WS}*\r?\n { }
+.|\n { fprintf(stderr,"Invalid line.\n"); exit(-1);}
+
+%%
+
+int main(void);
+
+int main ()
+{
+ yyin = stdin;
+ yyout = stdout;
+ while( yylex() )
+ {
+ }
+ printf("TEST RETURNING OK.\n");
+ return 0;
+}
+
diff --git a/tests/noansi_nr.txt b/tests/noansi_nr.txt
new file mode 100644
index 0000000..642e0fb
--- /dev/null
+++ b/tests/noansi_nr.txt
@@ -0,0 +1,5 @@
+# this is a comment
+foo = "bar"
+num = 43
+setting = false
+
diff --git a/tests/noansi_r.l b/tests/noansi_r.l
new file mode 100644
index 0000000..5a3b778
--- /dev/null
+++ b/tests/noansi_r.l
@@ -0,0 +1,69 @@
+/*
+ * 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.
+ */
+
+/* A reentrant scanner.
+ This file will not compile under flex version <= 2.5.4.
+ Sample Input:
+ # this is a comment
+ foo = true
+ bar = "string value"
+ integer = 43
+*/
+%{
+#include "config.h"
+%}
+
+%option prefix="test"
+%option nounput noyywrap noyylineno warn nodefault noinput
+%option reentrant
+%option noansi-definitions noansi-prototypes
+
+IDENT [[:alnum:]_-]
+WS [[:blank:]]
+%%
+
+^{IDENT}+{WS}*={WS}*(true|false){WS}*\r?\n { return 100;}
+^{IDENT}+{WS}*={WS}*\"[^\"\n\r]*\"{WS}*\r?\n { return 101;}
+^{IDENT}+{WS}*={WS}*[[:digit:]]+{WS}*\r?\n { return 102;}
+^{WS}*#.*\r?\n { }
+^{WS}*\r?\n { }
+.|\n { fprintf(stderr,"Invalid line.\n"); exit(-1);}
+
+%%
+
+int main(void);
+
+int main ()
+{
+ yyscan_t lexer;
+ yylex_init( &lexer );
+ yyset_out ( stdout,lexer);
+ yyset_in ( stdin, lexer);
+ while( yylex(lexer) )
+ {
+ }
+ yylex_destroy( lexer );
+ printf("TEST RETURNING OK.\n");
+ return 0;
+}
+
diff --git a/tests/noansi_r.txt b/tests/noansi_r.txt
new file mode 100644
index 0000000..2160628
--- /dev/null
+++ b/tests/noansi_r.txt
@@ -0,0 +1,4 @@
+# this is a comment
+foo = "bar"
+num = 43
+setting = false
diff --git a/tests/options.cn b/tests/options.cn
new file mode 100755
index 0000000..2f592e9
--- /dev/null
+++ b/tests/options.cn
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+# Test that flex handles the grouped noop options -c and -n properly.
+
+echo %% | $1 -cn -o /dev/null
diff --git a/tests/posix.l b/tests/posix.l
new file mode 100644
index 0000000..38e8d3b
--- /dev/null
+++ b/tests/posix.l
@@ -0,0 +1,79 @@
+/*
+ * 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.
+ */
+
+%{
+/* The goal of this test is to verify that we are getting the counter-intuitive
+ * posix behavior of the repeat operator `{}'.
+ *
+ * ab{3} - In traditional flex, this matches "abbb".
+ * In posix, this matches "ababab".
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include "config.h"
+
+#define NUM_TESTS 1
+char * tests[NUM_TESTS] = { "ababab"};
+int main(void);
+
+int tests_ok[NUM_TESTS] = { 0 };
+
+%}
+
+%option 8bit prefix="test"
+%option nounput nomain noyywrap noinput
+%option warn posix-compat
+
+
+%%
+
+ab{3} tests_ok[0] = 1; return 0;
+.|\n return 0;
+
+%%
+
+
+int main ()
+{
+ YY_BUFFER_STATE state;
+ int i;
+
+ yyin = stdin;
+ yyout = stdout;
+
+ /* Run the tests */
+ for (i=0; i < NUM_TESTS; i++){
+ printf("Testing: yy_scan_string(%s): ", tests[i]);
+ state = yy_scan_string(tests[i]);
+ yylex();
+ yy_delete_buffer(state);
+ printf("... %s\n", tests_ok[i] ? "OK" : "FAILED");
+ }
+
+ for (i=0; i < NUM_TESTS; i++)
+ if (!tests_ok[i])
+ exit(1);
+
+ printf("TEST RETURNING OK.\n");
+ return 0;
+}
diff --git a/tests/posixly_correct.l b/tests/posixly_correct.l
new file mode 100644
index 0000000..aff9cbd
--- /dev/null
+++ b/tests/posixly_correct.l
@@ -0,0 +1,79 @@
+/*
+ * 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.
+ */
+
+%{
+/* The goal of this test is to verify that we are getting the counter-intuitive
+ * posix behavior of the repeat operator `{}'.
+ *
+ * ab{3} - In traditional flex, this matches "abbb".
+ * In posix, this matches "ababab".
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include "config.h"
+
+#define NUM_TESTS 1
+char * tests[NUM_TESTS] = { "ababab"};
+int main(void);
+
+int tests_ok[NUM_TESTS] = { 0 };
+
+%}
+
+%option 8bit prefix="test"
+%option nounput nomain noyywrap noinput
+%option warn
+
+
+%%
+
+ab{3} tests_ok[0] = 1; return 0;
+.|\n return 0;
+
+%%
+
+
+int main ()
+{
+ YY_BUFFER_STATE state;
+ int i;
+
+ yyin = stdin;
+ yyout = stdout;
+
+ /* Run the tests */
+ for (i=0; i < NUM_TESTS; i++){
+ printf("Testing: yy_scan_string(%s): ", tests[i]);
+ state = yy_scan_string(tests[i]);
+ yylex();
+ yy_delete_buffer(state);
+ printf("... %s\n", tests_ok[i] ? "OK" : "FAILED");
+ }
+
+ for (i=0; i < NUM_TESTS; i++)
+ if (!tests_ok[i])
+ exit(1);
+
+ printf("TEST RETURNING OK.\n");
+ return 0;
+}
diff --git a/tests/prefix_nr.l b/tests/prefix_nr.l
new file mode 100644
index 0000000..c1665df
--- /dev/null
+++ b/tests/prefix_nr.l
@@ -0,0 +1,75 @@
+/*
+ * 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.
+ */
+
+%{
+/* Builds "scanner.c". */
+/* The scanner itself is a no-op. A successful compilation is all we want. */
+#include <stdio.h>
+#include <stdlib.h>
+#include "config.h"
+
+%}
+
+%option 8bit prefix="FOO"
+%option nounput nomain noyywrap noinput
+%option warn
+
+
+%%
+
+.|\n|\r {
+
+ /* Compile, but do not execute the following code. */
+ if( 0) {
+ FOO_create_buffer((FILE*)0,0);
+ FOO_delete_buffer((YY_BUFFER_STATE)0);
+ FOO_flush_buffer((YY_BUFFER_STATE)0);
+ FOO_init_buffer((YY_BUFFER_STATE)0,(FILE*)0);
+ FOO_load_buffer_state();
+ FOO_scan_buffer((char*)0,(yy_size_t)0);
+ FOO_scan_bytes((yyconst char*)0, 0);
+ FOO_scan_string((yyconst char*)0);
+ FOO_switch_to_buffer((YY_BUFFER_STATE)0);
+ yyin = (FILE*)0;
+ yyout = (FILE*)0;
+ yyleng = 0;
+ yylex();
+ yyrestart((FILE*)0);
+ yytext = (char*)0;
+ }
+ }
+%%
+
+
+int main(void);
+
+int
+main ()
+{
+ yyin = stdin;
+ yyout = stdout;
+ FOOlex();
+ printf("TEST RETURNING OK.\n");
+ return 0;
+}
+
diff --git a/tests/prefix_nr.txt b/tests/prefix_nr.txt
new file mode 100644
index 0000000..0e6c88f
--- /dev/null
+++ b/tests/prefix_nr.txt
@@ -0,0 +1 @@
+Dummy input.
diff --git a/tests/prefix_r.l b/tests/prefix_r.l
new file mode 100644
index 0000000..a2d4c1a
--- /dev/null
+++ b/tests/prefix_r.l
@@ -0,0 +1,83 @@
+/*
+ * 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.
+ */
+
+%{
+/* Builds "scanner.c". */
+/* The scanner itself is a no-op. A successful compilation is all we want. */
+#include <stdio.h>
+#include <stdlib.h>
+#include "config.h"
+
+%}
+%option reentrant
+%option 8bit prefix="FOO"
+%option nounput nomain noyywrap noinput
+%option warn
+
+
+%%
+
+
+.|\n|\r {
+
+ /* Compile, but do not execute the following code. */
+ if( 0 ) {
+ FOO_create_buffer( (FILE*)0, 0, yyscanner);
+ FOO_delete_buffer( (YY_BUFFER_STATE)0, yyscanner);
+ FOO_flush_buffer( (YY_BUFFER_STATE)0, yyscanner);
+ FOO_init_buffer( (YY_BUFFER_STATE)0, (FILE*)0, yyscanner);
+ FOO_load_buffer_state( yyscanner);
+ FOO_scan_buffer( (char*)0, (yy_size_t)0, yyscanner);
+ FOO_scan_bytes( (yyconst char*)0, 0, yyscanner);
+ FOO_scan_string( (yyconst char*)0, yyscanner);
+ FOO_switch_to_buffer( (YY_BUFFER_STATE)0, yyscanner);
+ FOOrestart( (FILE*)0, (yyscan_t )0);
+
+ FOOget_extra( (yyscan_t )0 );
+ FOOget_in( (yyscan_t )0 );
+ FOOget_leng( (yyscan_t )0 );
+ FOOget_out( (yyscan_t )0 );
+ FOOget_text( (yyscan_t )0 );
+ FOOlex( (yyscan_t )0 );
+ FOOlex_destroy( (yyscan_t )0 );
+ FOOlex_init( (yyscan_t *)0 );
+ FOOset_extra( (void *)0, (yyscan_t )0 );
+ FOOset_in( (FILE*)0, (yyscan_t )0 );
+ FOOset_out( (FILE*)0, (yyscan_t )0 );
+ }
+ }
+%%
+
+int main(void);
+
+int
+main ()
+{
+ yyscan_t scanner;
+ FOOlex_init( &scanner);
+ FOOlex( scanner);
+ FOOlex_destroy( scanner);
+ printf( "TEST RETURNING OK.\n");
+ return 0;
+}
+
diff --git a/tests/prefix_r.txt b/tests/prefix_r.txt
new file mode 100644
index 0000000..0e6c88f
--- /dev/null
+++ b/tests/prefix_r.txt
@@ -0,0 +1 @@
+Dummy input.
diff --git a/tests/pthread.l b/tests/pthread.l
new file mode 100644
index 0000000..38080c1
--- /dev/null
+++ b/tests/pthread.l
@@ -0,0 +1,210 @@
+/*
+ * 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.
+ */
+
+%{
+/* A scanner file to build "scanner.c".
+ Input language is any text made of spaces, newlines, and alphanumerics.
+
+ We create N_THREADS number of threads. Each thread has it's own scanner.
+ Each thread selects one of the files specified in ARGV, scans it, then
+ closes it. This is repeated N_SCANS numebr of times for each thread.
+
+ The idea is to press the scanner to break under threads.
+ If we see "Scanner Jammed", then we know
+
+*/
+#include <stdio.h>
+#include <stdlib.h>
+#include <config.h>
+
+#ifdef HAVE_PTHREAD_H
+#include <pthread.h>
+#endif
+
+/* A naive test for segfaults when accessing yytext. */
+static int process_text(char* s, yyscan_t scanner);
+
+%}
+
+%option 8bit prefix="test"
+%option nounput nomain nodefault noinput
+%option yywrap
+%option reentrant
+%option warn
+
+ /* Arbitrary states.*/
+%x STATE_1
+%x STATE_2
+
+%%
+
+ #define NUMBER 200
+ #define WORD 201
+
+<INITIAL>[[:digit:]]+ { BEGIN(STATE_1); process_text(yytext,yyscanner); return NUMBER; }
+<INITIAL>[[:alpha:]]+ { BEGIN(STATE_2); process_text(yytext,yyscanner); return WORD; }
+
+<STATE_1>[[:alpha:]]+ { BEGIN(0); process_text(yytext,yyscanner); return WORD; }
+<STATE_1>[[:digit:]]+ { BEGIN(0); process_text(yytext,yyscanner); return NUMBER; }
+
+<STATE_2>[[:alpha:]]+ { BEGIN(0); process_text(yytext,yyscanner); return WORD; }
+<STATE_2>[[:digit:]]+ { BEGIN(0); process_text(yytext,yyscanner); return NUMBER; }
+
+<INITIAL,STATE_1,STATE_2>" "|\t|\r|\n { process_text(yytext,yyscanner); }
+<INITIAL,STATE_1,STATE_2>[^[:alnum:][:space:]\t\r\n] {
+ /*fprintf(stderr,"*** Error: bad input char '%c'.\n", yytext[0]); */
+ yyterminate();
+ }
+<INITIAL,STATE_1,STATE_2>[[:space:]\r\n]+ { }
+%%
+
+int yywrap( yyscan_t scanner) {
+ (void)scanner;
+ return 1;
+}
+static int process_text(char* s, yyscan_t scanner)
+{
+ (void)scanner;
+ return (int)(*s) + (int) *(s + yyget_leng(scanner)-1);
+}
+
+int main(int ARGC, char *ARGV[]);
+
+#ifndef HAVE_LIBPTHREAD
+ int main (int ARGC, char *ARGV[]) {
+ printf(
+ "TEST ABORTED because pthread library not available \n"
+ "-- This is expected on some systems. It is not a flex error.\n" );
+ return 0;
+ }
+#else
+
+#define N_THREADS 4
+#define N_SCANS 20
+#define INPUT_FILE "test.input"
+
+/* Each thread selects the next file to scan in round-robin fashion.
+ If there are less files than threads, some threads may block. */
+
+static pthread_mutex_t next_lock = PTHREAD_MUTEX_INITIALIZER;
+static pthread_mutex_t go_ahead = PTHREAD_MUTEX_INITIALIZER;
+static int n_files, next_file;
+
+static pthread_mutex_t *file_locks;
+static char **filenames;
+
+
+void * thread_func ( void* arg )
+{
+ int i;
+
+ (void)arg;
+
+ /* Wait for go-ahead. */
+ pthread_mutex_lock( &go_ahead);
+ pthread_mutex_unlock(&go_ahead);
+
+ for( i =0 ; i < N_SCANS ; i++ )
+ {
+ int main(int ARGC, char *ARGV[]);
+
+ int next;
+ yyscan_t scanner;
+ FILE * fp;
+
+ pthread_mutex_lock ( &next_lock );
+ next = (next_file++) % n_files;
+ pthread_mutex_unlock ( &next_lock );
+
+ pthread_mutex_lock ( &file_locks[ next ] );
+
+ yylex_init( &scanner );
+ /*printf("Scanning file %s #%d\n",filenames[next],i); fflush(stdout); */
+ if((fp = fopen(filenames[next],"r"))==NULL) {
+ perror("fopen");
+ return NULL;
+ }
+ yyset_in(fp,scanner);
+
+ while( yylex( scanner) != 0)
+ {
+ }
+ fclose(fp);
+ yylex_destroy(scanner);
+ pthread_mutex_unlock ( &file_locks[ next ] );
+ }
+ return NULL;
+}
+
+int main (int ARGC, char *ARGV[])
+{
+ int i;
+ pthread_t threads[N_THREADS];
+
+ if( ARGC < 2 ) {
+ fprintf(stderr,"*** Error: No filenames specified.\n");
+ exit(-1);
+ }
+
+ /* Allocate and initialize the locks. One for each filename in ARGV. */
+ file_locks = (pthread_mutex_t*)malloc( (ARGC-1) * sizeof(pthread_mutex_t));
+ for( i = 0; i < ARGC-1; i++)
+ pthread_mutex_init( &file_locks[i], NULL );
+
+ n_files = ARGC -1;
+ filenames = ARGV + 1;
+ next_file = 0;
+
+ /* prevent threads from starting until all threads have been created. */
+ pthread_mutex_lock(&go_ahead);
+
+ /* Create N threads then wait for them. */
+ for(i =0; i < N_THREADS ; i++ ) {
+ if( pthread_create( &threads[i], NULL, thread_func, NULL) != 0)
+ {
+ fprintf(stderr, "*** Error: pthread_create failed.\n");
+ exit(-1);
+ }
+ printf("Created thread %d.\n",i); fflush(stdout);
+ }
+
+ /* Tell threads to begin. */
+ pthread_mutex_unlock(&go_ahead);
+
+ for(i =0; i < N_THREADS ; i++ ) {
+ pthread_join ( threads[i], NULL );
+ printf("Thread %d done.\n", i ); fflush(stdout);
+ }
+
+ for( i = 0; i < ARGC-1; i++)
+ pthread_mutex_destroy( &file_locks[i] );
+
+ pthread_mutex_destroy( &next_lock );
+ pthread_mutex_destroy( &go_ahead );
+ free( file_locks );
+ printf("TEST RETURNING OK.\n");
+ return 0;
+}
+
+#endif /* HAVE_LIBPTHREAD */
+
diff --git a/tests/pthread_1.txt b/tests/pthread_1.txt
new file mode 100644
index 0000000..234774b
--- /dev/null
+++ b/tests/pthread_1.txt
@@ -0,0 +1,847 @@
+Many lines of numbers and words
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
diff --git a/tests/pthread_2.txt b/tests/pthread_2.txt
new file mode 100644
index 0000000..234774b
--- /dev/null
+++ b/tests/pthread_2.txt
@@ -0,0 +1,847 @@
+Many lines of numbers and words
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
diff --git a/tests/pthread_3.txt b/tests/pthread_3.txt
new file mode 100644
index 0000000..234774b
--- /dev/null
+++ b/tests/pthread_3.txt
@@ -0,0 +1,847 @@
+Many lines of numbers and words
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
diff --git a/tests/pthread_4.txt b/tests/pthread_4.txt
new file mode 100644
index 0000000..234774b
--- /dev/null
+++ b/tests/pthread_4.txt
@@ -0,0 +1,847 @@
+Many lines of numbers and words
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
diff --git a/tests/pthread_5.txt b/tests/pthread_5.txt
new file mode 100644
index 0000000..234774b
--- /dev/null
+++ b/tests/pthread_5.txt
@@ -0,0 +1,847 @@
+Many lines of numbers and words
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
+0000 foo 1111 foo 0000 bar 2222 foo bar 0000 foo 1111 foo 0000 bar 2222 foo bar
+foo 2444 foo blah 1234 2444 111 1111 bar foo 2444 foo blah 1234 2444 111 1111 bar
diff --git a/tests/quotes.l b/tests/quotes.l
new file mode 100644
index 0000000..c1386c3
--- /dev/null
+++ b/tests/quotes.l
@@ -0,0 +1,101 @@
+/*
+ * 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.
+ */
+
+/* The point of this test is to be sure our M4 madness does not
+ * interfere with user code. I particular, we are looking
+ * for instances of M4 quotes, [[ and ]], in here to make it through the flex
+ * machinery unscathed.
+ */
+
+/* sect 1 [ 1 ] TEST_XXX */
+/* sect 1 [[ 2 ]] TEST_XXX */
+/* sect 1 [[[ 3 ]]] TEST_XXX */
+/* sect 1 [[[[ 4 ]]]] TEST_XXX */
+/* sect 1 ]] unmatched [[ TEST_XXX */
+
+%{
+/* A template scanner file to build "scanner.c". */
+#include <stdio.h>
+#include <stdlib.h>
+#include "config.h"
+/*#include "parser.h" */
+
+/* sect 1 block [ 1 ] TEST_XXX */
+/* sect 1 block [[ 2 ]] TEST_XXX */
+/* sect 1 block [[[ 3 ]]] TEST_XXX */
+/* sect 1 block [[[[ 4 ]]]] TEST_XXX */
+/* sect 1 block ]] unmatched [[ TEST_XXX */
+
+static int a[1] = {0};
+static int b[1] = {0};
+static int c[1] = {0};
+
+static int foo (int i){
+ return a[b[c[i]]]; /* sect 1 code TEST_XXX */
+}
+%}
+
+%option 8bit prefix="test"
+%option nounput nomain noyywrap noinput
+%option warn
+
+
+%%
+
+a /* action comment [ 1 ] */ ;
+b /* action comment [[ 2 ]] */ ;
+c /* action comment [[[ 3 ]]] */ ;
+d /* action comment [[[[ 4 ]]]] */ ;
+e /* action comment ]] unmatched [[ */ ;
+f return 1+foo(a[b[c[0]]]);
+.|\n {
+ /* action block [ 1 ] TEST_XXX */
+ /* action block [[ 2 ]] TEST_XXX */
+ /* action block [[[ 3 ]]] TEST_XXX */
+ /* action block [[[[ 4 ]]]] TEST_XXX */
+ /* action block ]] unmatched [[ TEST_XXX */
+ return 1+foo(a[b[c[0]]]); // TEST_XXX
+ }
+%%
+
+/* sect 3 [ 1 ] TEST_XXX */
+/* sect 3 [[ 2 ]] TEST_XXX */
+/* sect 3 [[[ 3 ]]] TEST_XXX */
+/* sect 3 [[[[ 4 ]]]] TEST_XXX */
+/* sect 3 ]] unmatched [[ TEST_XXX */
+static int bar (int i){
+ return c[b[a[i]]]; /* sect 3 code TEST_XXX */
+}
+int main(void);
+
+int
+main ()
+{
+ yyin = stdin;
+ yyout = stdout;
+ while (yylex())
+ ;
+ printf("TEST RETURNING OK.\n");
+ return bar(0);
+}
+
diff --git a/tests/quotes.txt b/tests/quotes.txt
new file mode 100644
index 0000000..7288a40
--- /dev/null
+++ b/tests/quotes.txt
@@ -0,0 +1,2 @@
+0000 foo 1111 foo 0000 bar
+0000 foo 1111 foo 0000 bar
diff --git a/tests/reject.l4 b/tests/reject.l4
new file mode 100644
index 0000000..27982b1
--- /dev/null
+++ b/tests/reject.l4
@@ -0,0 +1,82 @@
+/*
+ * 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 <stdio.h>
+#include <stdlib.h>
+#include "config.h"
+
+%}
+
+%option 8bit prefix="test"
+%option nounput nomain noyywrap noinput
+%option warn reject
+
+
+%%
+
+. { REJECT; }
+.|\n ;
+
+%%
+
+int main ( int argc, char** argv )
+{
+ FILE* fp = NULL;
+ void *yyscanner=0;
+ M4_YY_DECL_GUTS_VAR();
+
+#ifdef TEST_IS_REENTRANT
+ yylex_init(&yyscanner);
+#else
+ (void)yyscanner;
+#endif
+
+#ifdef TEST_HAS_TABLES_EXTERNAL
+ if((fp = fopen(argv[1],"r"))== NULL)
+ YY_FATAL_ERROR("could not open tables file for reading");
+
+ if(yytables_fload(fp M4_YY_CALL_LAST_ARG) < 0)
+ YY_FATAL_ERROR("yytables_fload returned < 0");
+ if(M4_YY_TABLES_VERIFY)
+ exit(0);
+#endif
+
+ if(argc > 2){
+ if((fp = fopen(argv[2],"r"))== NULL)
+ YY_FATAL_ERROR("could not open input file for reading");
+ yyin = fp;
+ }
+ while(yylex(M4_YY_CALL_ONLY_ARG) != 0)
+ ;
+
+#ifdef TEST_HAS_TABLES_EXTERNAL
+ yytables_destroy(M4_YY_CALL_ONLY_ARG);
+#endif
+ yylex_destroy(M4_YY_CALL_ONLY_ARG);
+
+ if(argc < 0) /* silence the compiler */
+ yyscanner = (void*)fp;
+
+ return 0;
+}
diff --git a/tests/reject.txt b/tests/reject.txt
new file mode 100644
index 0000000..7288a40
--- /dev/null
+++ b/tests/reject.txt
@@ -0,0 +1,2 @@
+0000 foo 1111 foo 0000 bar
+0000 foo 1111 foo 0000 bar
diff --git a/tests/rescan_nr.direct.l b/tests/rescan_nr.direct.l
new file mode 100644
index 0000000..86103aa
--- /dev/null
+++ b/tests/rescan_nr.direct.l
@@ -0,0 +1,72 @@
+/*
+ * 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.
+ */
+
+%{
+/* A template scanner file to build "scanner.c". */
+#include <stdio.h>
+#include <stdlib.h>
+%}
+
+%option 8bit prefix="test"
+%option nounput nomain noyywrap noinput
+%option warn stack never-interactive
+%x STATE_1
+
+%%
+
+<INITIAL>{
+0 yy_push_state (STATE_1);
+.|\n return 1;
+}
+<STATE_1>{
+1 yy_pop_state();
+.|\n return yy_top_state() + 1;
+}
+
+%%
+
+int
+main (int argc, char* const argv[])
+{
+ FILE* fp;
+ int i;
+
+ (void)argc;
+
+ if ((fp = fopen(argv[1],"r")) == NULL){
+ perror("Failed to open input file.");
+ return 1;
+ }
+
+ yyset_out ( stdout);
+
+ for (i=0; i < 4; ++i){
+ rewind(fp);
+ yyset_in ( fp);
+ while( yylex() )
+ ;
+ yylex_destroy();
+ }
+ printf("TEST RETURNING OK.\n");
+ return 0;
+}
diff --git a/tests/rescan_nr.direct.txt b/tests/rescan_nr.direct.txt
new file mode 100644
index 0000000..7288a40
--- /dev/null
+++ b/tests/rescan_nr.direct.txt
@@ -0,0 +1,2 @@
+0000 foo 1111 foo 0000 bar
+0000 foo 1111 foo 0000 bar
diff --git a/tests/rescan_r.direct.l b/tests/rescan_r.direct.l
new file mode 100644
index 0000000..2255ee2
--- /dev/null
+++ b/tests/rescan_r.direct.l
@@ -0,0 +1,97 @@
+/*
+ * 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.
+ */
+
+%{
+/* A template scanner file to build "scanner.c". */
+#include <stdio.h>
+#include <stdlib.h>
+%}
+
+%option 8bit prefix="test"
+%option nounput nomain noyywrap noinput reentrant
+%option warn stack never-interactive
+%x STATE_1
+
+%%
+
+<INITIAL>{
+0 yy_push_state (STATE_1, yyscanner);
+.|\n return 1;
+}
+<STATE_1>{
+1 yy_pop_state(yyscanner);
+.|\n return yy_top_state(yyscanner) + 1;
+}
+
+%%
+
+int
+main (int argc, char* const argv[])
+{
+ FILE* fp;
+ int i;
+ yyscan_t yyscanner;
+
+ (void)argc;
+
+ if ((fp = fopen(argv[1],"r")) == NULL){
+ perror("Failed to open input file.");
+ return 1;
+ }
+
+ printf("Test 1: Reusing same scanner.\n");
+ yylex_init( &yyscanner );
+ yyset_out ( stdout, yyscanner);
+
+ for (i=0; i < 4; ++i){
+
+ rewind(fp);
+ yyset_in ( fp, yyscanner);
+
+ while( yylex(yyscanner) )
+ ;
+ }
+ yylex_destroy( yyscanner );
+ printf("Test 1 OK\n\n");
+
+ printf("Test 2: Rescanning with new scanner each time.\n");
+
+ memset(&yyscanner,0,sizeof(yyscanner)); // Just to be clean about it.
+
+ for (i=0; i < 4; ++i){
+ yyscan_t s;
+ yylex_init( &s );
+ yyset_out ( stdout, s);
+ rewind(fp);
+ yyset_in ( fp, s);
+
+ while( yylex(s) )
+ ;
+ yylex_destroy( s );
+ }
+ printf("Test 2 OK\n\n");
+
+
+ printf("TEST RETURNING OK.\n");
+ return 0;
+}
diff --git a/tests/rescan_r.direct.txt b/tests/rescan_r.direct.txt
new file mode 100644
index 0000000..7288a40
--- /dev/null
+++ b/tests/rescan_r.direct.txt
@@ -0,0 +1,2 @@
+0000 foo 1111 foo 0000 bar
+0000 foo 1111 foo 0000 bar
diff --git a/tests/string_nr.l b/tests/string_nr.l
new file mode 100644
index 0000000..3dd752a
--- /dev/null
+++ b/tests/string_nr.l
@@ -0,0 +1,96 @@
+/*
+ * 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.
+ */
+
+%{
+/* A template scanner file to build "scanner.c". */
+#include <stdio.h>
+#include <stdlib.h>
+#include "config.h"
+
+#define NUMBER 200
+#define WORD 201
+
+%}
+
+%option 8bit prefix="test"
+%option nounput nomain nodefault noyywrap noinput
+%option warn
+
+
+%%
+
+[[:space:]]+ { }
+[[:digit:]]+ { printf("NUMBER "); fflush(stdout);}
+[[:alpha:]]+ { printf("WORD "); fflush(stdout);}
+. {
+ fprintf(stderr,"*** Error: Unrecognized character '%c' while scanning.\n",
+ yytext[0]);
+ yyterminate();
+ }
+
+<<EOF>> { printf("<<EOF>>\n"); yyterminate();}
+
+%%
+
+
+#define INPUT_STRING_1 "1234 foo bar"
+#define INPUT_STRING_2 "1234 foo bar *@&@&###@^$#&#*"
+
+int main(void);
+
+int
+main ()
+{
+ char * buf;
+ int len;
+ YY_BUFFER_STATE state;
+
+
+ /* Scan a good string. */
+ printf("Testing: yy_scan_string(%s): ",INPUT_STRING_1); fflush(stdout);
+ state = yy_scan_string ( INPUT_STRING_1 );
+ yylex();
+ yy_delete_buffer(state);
+
+ /* Scan only the first 12 chars of a string. */
+ printf("Testing: yy_scan_bytes(%s): ",INPUT_STRING_2); fflush(stdout);
+ state = yy_scan_bytes ( INPUT_STRING_2, 12 );
+ yylex();
+ yy_delete_buffer(state);
+
+ /* Scan directly from a buffer.
+ We make a copy, since the buffer will be modified by flex.*/
+ printf("Testing: yy_scan_buffer(%s): ",INPUT_STRING_1); fflush(stdout);
+ len = strlen(INPUT_STRING_1) + 2;
+ buf = (char*)malloc( len );
+ strcpy( buf, INPUT_STRING_1);
+ buf[ len -2 ] = 0; /* Flex requires two NUL bytes at end of buffer. */
+ buf[ len -1 ] =0;
+
+ state = yy_scan_buffer( buf, len );
+ yylex();
+ yy_delete_buffer(state);
+
+ printf("TEST RETURNING OK.\n");
+ return 0;
+}
diff --git a/tests/string_r.l b/tests/string_r.l
new file mode 100644
index 0000000..d98c98a
--- /dev/null
+++ b/tests/string_r.l
@@ -0,0 +1,103 @@
+/*
+ * 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.
+ */
+
+%{
+/* A template scanner file to build "scanner.c". */
+#include <stdio.h>
+#include <stdlib.h>
+#include "config.h"
+
+#define NUMBER 200
+#define WORD 201
+
+%}
+
+%option 8bit prefix="test"
+%option nounput nomain nodefault noyywrap noinput
+%option warn reentrant
+
+
+%%
+
+[[:space:]]+ { }
+[[:digit:]]+ { printf("NUMBER "); fflush(stdout);}
+[[:alpha:]]+ { printf("WORD "); fflush(stdout);}
+. {
+ fprintf(stderr,"*** Error: Unrecognized character '%c' while scanning.\n",
+ yytext[0]);
+ yyterminate();
+ }
+
+<<EOF>> { printf("<<EOF>>\n"); yyterminate();}
+
+%%
+
+
+#define INPUT_STRING_1 "1234 foo bar"
+#define INPUT_STRING_2 "1234 foo bar *@&@&###@^$#&#*"
+
+int main(void);
+
+int
+main ()
+{
+ char * buf;
+ int len;
+ YY_BUFFER_STATE state;
+ yyscan_t scanner=NULL;
+
+
+ /* Scan a good string. */
+ printf("Testing: yy_scan_string(%s): ",INPUT_STRING_1); fflush(stdout);
+ yylex_init(&scanner);
+ state = yy_scan_string ( INPUT_STRING_1 ,scanner);
+ yylex(scanner);
+ yy_delete_buffer(state, scanner);
+ yylex_destroy(scanner);
+
+ /* Scan only the first 12 chars of a string. */
+ printf("Testing: yy_scan_bytes(%s): ",INPUT_STRING_2); fflush(stdout);
+ yylex_init(&scanner);
+ state = yy_scan_bytes ( INPUT_STRING_2, 12 ,scanner);
+ yylex(scanner);
+ yy_delete_buffer(state,scanner);
+ yylex_destroy(scanner);
+
+ /* Scan directly from a buffer.
+ We make a copy, since the buffer will be modified by flex.*/
+ printf("Testing: yy_scan_buffer(%s): ",INPUT_STRING_1); fflush(stdout);
+ len = strlen(INPUT_STRING_1) + 2;
+ buf = (char*)malloc( len );
+ strcpy( buf, INPUT_STRING_1);
+ buf[ len -2 ] = 0; /* Flex requires two NUL bytes at end of buffer. */
+ buf[ len -1 ] =0;
+
+ yylex_init(&scanner);
+ state = yy_scan_buffer( buf, len ,scanner);
+ yylex(scanner);
+ yy_delete_buffer(state,scanner);
+ yylex_destroy(scanner);
+
+ printf("TEST RETURNING OK.\n");
+ return 0;
+}
diff --git a/tests/tableopts.am b/tests/tableopts.am
new file mode 100644
index 0000000..bbb20d0
--- /dev/null
+++ b/tests/tableopts.am
@@ -0,0 +1,333 @@
+tableopts_opt_nr_Ca_opt_SOURCES = tableopts.l4
+
+tableopts_opt_nr-Ca.opt$(EXEEXT): tableopts_opt_nr-Ca.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_opt_nr_Ce_opt_SOURCES = tableopts.l4
+
+tableopts_opt_nr-Ce.opt$(EXEEXT): tableopts_opt_nr-Ce.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_opt_nr_Cf_opt_SOURCES = tableopts.l4
+
+tableopts_opt_nr-Cf.opt$(EXEEXT): tableopts_opt_nr-Cf.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_opt_nr_CF_opt_SOURCES = tableopts.l4
+
+tableopts_opt_nr-CF.opt$(EXEEXT): tableopts_opt_nr-CF.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_opt_nr_Cm_opt_SOURCES = tableopts.l4
+
+tableopts_opt_nr-Cm.opt$(EXEEXT): tableopts_opt_nr-Cm.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_opt_nr_Cem_opt_SOURCES = tableopts.l4
+
+tableopts_opt_nr-Cem.opt$(EXEEXT): tableopts_opt_nr-Cem.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_opt_nr_Cae_opt_SOURCES = tableopts.l4
+
+tableopts_opt_nr-Cae.opt$(EXEEXT): tableopts_opt_nr-Cae.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_opt_nr_Caef_opt_SOURCES = tableopts.l4
+
+tableopts_opt_nr-Caef.opt$(EXEEXT): tableopts_opt_nr-Caef.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_opt_nr_CaeF_opt_SOURCES = tableopts.l4
+
+tableopts_opt_nr-CaeF.opt$(EXEEXT): tableopts_opt_nr-CaeF.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_opt_nr_Cam_opt_SOURCES = tableopts.l4
+
+tableopts_opt_nr-Cam.opt$(EXEEXT): tableopts_opt_nr-Cam.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_opt_nr_Caem_opt_SOURCES = tableopts.l4
+
+tableopts_opt_nr-Caem.opt$(EXEEXT): tableopts_opt_nr-Caem.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_opt_r_Ca_opt_SOURCES = tableopts.l4
+
+tableopts_opt_r-Ca.opt$(EXEEXT): tableopts_opt_r-Ca.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_opt_r_Ce_opt_SOURCES = tableopts.l4
+
+tableopts_opt_r-Ce.opt$(EXEEXT): tableopts_opt_r-Ce.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_opt_r_Cf_opt_SOURCES = tableopts.l4
+
+tableopts_opt_r-Cf.opt$(EXEEXT): tableopts_opt_r-Cf.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_opt_r_CF_opt_SOURCES = tableopts.l4
+
+tableopts_opt_r-CF.opt$(EXEEXT): tableopts_opt_r-CF.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_opt_r_Cm_opt_SOURCES = tableopts.l4
+
+tableopts_opt_r-Cm.opt$(EXEEXT): tableopts_opt_r-Cm.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_opt_r_Cem_opt_SOURCES = tableopts.l4
+
+tableopts_opt_r-Cem.opt$(EXEEXT): tableopts_opt_r-Cem.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_opt_r_Cae_opt_SOURCES = tableopts.l4
+
+tableopts_opt_r-Cae.opt$(EXEEXT): tableopts_opt_r-Cae.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_opt_r_Caef_opt_SOURCES = tableopts.l4
+
+tableopts_opt_r-Caef.opt$(EXEEXT): tableopts_opt_r-Caef.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_opt_r_CaeF_opt_SOURCES = tableopts.l4
+
+tableopts_opt_r-CaeF.opt$(EXEEXT): tableopts_opt_r-CaeF.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_opt_r_Cam_opt_SOURCES = tableopts.l4
+
+tableopts_opt_r-Cam.opt$(EXEEXT): tableopts_opt_r-Cam.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_opt_r_Caem_opt_SOURCES = tableopts.l4
+
+tableopts_opt_r-Caem.opt$(EXEEXT): tableopts_opt_r-Caem.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ser_nr_Ca_ser_SOURCES = tableopts.l4
+
+tableopts_ser_nr-Ca.ser$(EXEEXT): tableopts_ser_nr-Ca.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ser_nr_Ce_ser_SOURCES = tableopts.l4
+
+tableopts_ser_nr-Ce.ser$(EXEEXT): tableopts_ser_nr-Ce.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ser_nr_Cf_ser_SOURCES = tableopts.l4
+
+tableopts_ser_nr-Cf.ser$(EXEEXT): tableopts_ser_nr-Cf.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ser_nr_CF_ser_SOURCES = tableopts.l4
+
+tableopts_ser_nr-CF.ser$(EXEEXT): tableopts_ser_nr-CF.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ser_nr_Cm_ser_SOURCES = tableopts.l4
+
+tableopts_ser_nr-Cm.ser$(EXEEXT): tableopts_ser_nr-Cm.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ser_nr_Cem_ser_SOURCES = tableopts.l4
+
+tableopts_ser_nr-Cem.ser$(EXEEXT): tableopts_ser_nr-Cem.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ser_nr_Cae_ser_SOURCES = tableopts.l4
+
+tableopts_ser_nr-Cae.ser$(EXEEXT): tableopts_ser_nr-Cae.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ser_nr_Caef_ser_SOURCES = tableopts.l4
+
+tableopts_ser_nr-Caef.ser$(EXEEXT): tableopts_ser_nr-Caef.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ser_nr_CaeF_ser_SOURCES = tableopts.l4
+
+tableopts_ser_nr-CaeF.ser$(EXEEXT): tableopts_ser_nr-CaeF.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ser_nr_Cam_ser_SOURCES = tableopts.l4
+
+tableopts_ser_nr-Cam.ser$(EXEEXT): tableopts_ser_nr-Cam.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ser_nr_Caem_ser_SOURCES = tableopts.l4
+
+tableopts_ser_nr-Caem.ser$(EXEEXT): tableopts_ser_nr-Caem.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ser_r_Ca_ser_SOURCES = tableopts.l4
+
+tableopts_ser_r-Ca.ser$(EXEEXT): tableopts_ser_r-Ca.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ser_r_Ce_ser_SOURCES = tableopts.l4
+
+tableopts_ser_r-Ce.ser$(EXEEXT): tableopts_ser_r-Ce.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ser_r_Cf_ser_SOURCES = tableopts.l4
+
+tableopts_ser_r-Cf.ser$(EXEEXT): tableopts_ser_r-Cf.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ser_r_CF_ser_SOURCES = tableopts.l4
+
+tableopts_ser_r-CF.ser$(EXEEXT): tableopts_ser_r-CF.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ser_r_Cm_ser_SOURCES = tableopts.l4
+
+tableopts_ser_r-Cm.ser$(EXEEXT): tableopts_ser_r-Cm.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ser_r_Cem_ser_SOURCES = tableopts.l4
+
+tableopts_ser_r-Cem.ser$(EXEEXT): tableopts_ser_r-Cem.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ser_r_Cae_ser_SOURCES = tableopts.l4
+
+tableopts_ser_r-Cae.ser$(EXEEXT): tableopts_ser_r-Cae.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ser_r_Caef_ser_SOURCES = tableopts.l4
+
+tableopts_ser_r-Caef.ser$(EXEEXT): tableopts_ser_r-Caef.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ser_r_CaeF_ser_SOURCES = tableopts.l4
+
+tableopts_ser_r-CaeF.ser$(EXEEXT): tableopts_ser_r-CaeF.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ser_r_Cam_ser_SOURCES = tableopts.l4
+
+tableopts_ser_r-Cam.ser$(EXEEXT): tableopts_ser_r-Cam.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ser_r_Caem_ser_SOURCES = tableopts.l4
+
+tableopts_ser_r-Caem.ser$(EXEEXT): tableopts_ser_r-Caem.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ver_nr_Ca_ver_SOURCES = tableopts.l4
+
+tableopts_ver_nr-Ca.ver$(EXEEXT): tableopts_ver_nr-Ca.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ver_nr_Ce_ver_SOURCES = tableopts.l4
+
+tableopts_ver_nr-Ce.ver$(EXEEXT): tableopts_ver_nr-Ce.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ver_nr_Cf_ver_SOURCES = tableopts.l4
+
+tableopts_ver_nr-Cf.ver$(EXEEXT): tableopts_ver_nr-Cf.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ver_nr_CF_ver_SOURCES = tableopts.l4
+
+tableopts_ver_nr-CF.ver$(EXEEXT): tableopts_ver_nr-CF.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ver_nr_Cm_ver_SOURCES = tableopts.l4
+
+tableopts_ver_nr-Cm.ver$(EXEEXT): tableopts_ver_nr-Cm.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ver_nr_Cem_ver_SOURCES = tableopts.l4
+
+tableopts_ver_nr-Cem.ver$(EXEEXT): tableopts_ver_nr-Cem.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ver_nr_Cae_ver_SOURCES = tableopts.l4
+
+tableopts_ver_nr-Cae.ver$(EXEEXT): tableopts_ver_nr-Cae.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ver_nr_Caef_ver_SOURCES = tableopts.l4
+
+tableopts_ver_nr-Caef.ver$(EXEEXT): tableopts_ver_nr-Caef.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ver_nr_CaeF_ver_SOURCES = tableopts.l4
+
+tableopts_ver_nr-CaeF.ver$(EXEEXT): tableopts_ver_nr-CaeF.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ver_nr_Cam_ver_SOURCES = tableopts.l4
+
+tableopts_ver_nr-Cam.ver$(EXEEXT): tableopts_ver_nr-Cam.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ver_nr_Caem_ver_SOURCES = tableopts.l4
+
+tableopts_ver_nr-Caem.ver$(EXEEXT): tableopts_ver_nr-Caem.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ver_r_Ca_ver_SOURCES = tableopts.l4
+
+tableopts_ver_r-Ca.ver$(EXEEXT): tableopts_ver_r-Ca.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ver_r_Ce_ver_SOURCES = tableopts.l4
+
+tableopts_ver_r-Ce.ver$(EXEEXT): tableopts_ver_r-Ce.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ver_r_Cf_ver_SOURCES = tableopts.l4
+
+tableopts_ver_r-Cf.ver$(EXEEXT): tableopts_ver_r-Cf.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ver_r_CF_ver_SOURCES = tableopts.l4
+
+tableopts_ver_r-CF.ver$(EXEEXT): tableopts_ver_r-CF.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ver_r_Cm_ver_SOURCES = tableopts.l4
+
+tableopts_ver_r-Cm.ver$(EXEEXT): tableopts_ver_r-Cm.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ver_r_Cem_ver_SOURCES = tableopts.l4
+
+tableopts_ver_r-Cem.ver$(EXEEXT): tableopts_ver_r-Cem.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ver_r_Cae_ver_SOURCES = tableopts.l4
+
+tableopts_ver_r-Cae.ver$(EXEEXT): tableopts_ver_r-Cae.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ver_r_Caef_ver_SOURCES = tableopts.l4
+
+tableopts_ver_r-Caef.ver$(EXEEXT): tableopts_ver_r-Caef.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ver_r_CaeF_ver_SOURCES = tableopts.l4
+
+tableopts_ver_r-CaeF.ver$(EXEEXT): tableopts_ver_r-CaeF.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ver_r_Cam_ver_SOURCES = tableopts.l4
+
+tableopts_ver_r-Cam.ver$(EXEEXT): tableopts_ver_r-Cam.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+tableopts_ver_r_Caem_ver_SOURCES = tableopts.l4
+
+tableopts_ver_r-Caem.ver$(EXEEXT): tableopts_ver_r-Caem.$(OBJEXT)
+ $(LINK) -o $@ $<
+
+TABLEOPTS_TESTS = tableopts_opt_nr-Ca.opt tableopts_opt_nr-Ce.opt tableopts_opt_nr-Cf.opt tableopts_opt_nr-CF.opt tableopts_opt_nr-Cm.opt tableopts_opt_nr-Cem.opt tableopts_opt_nr-Cae.opt tableopts_opt_nr-Caef.opt tableopts_opt_nr-CaeF.opt tableopts_opt_nr-Cam.opt tableopts_opt_nr-Caem.opt tableopts_opt_r-Ca.opt tableopts_opt_r-Ce.opt tableopts_opt_r-Cf.opt tableopts_opt_r-CF.opt tableopts_opt_r-Cm.opt tableopts_opt_r-Cem.opt tableopts_opt_r-Cae.opt tableopts_opt_r-Caef.opt tableopts_opt_r-CaeF.opt tableopts_opt_r-Cam.opt tableopts_opt_r-Caem.opt tableopts_ser_nr-Ca.ser tableopts_ser_nr-Ce.ser tableopts_ser_nr-Cf.ser tableopts_ser_nr-CF.ser tableopts_ser_nr-Cm.ser tableopts_ser_nr-Cem.ser tableopts_ser_nr-Cae.ser tableopts_ser_nr-Caef.ser tableopts_ser_nr-CaeF.ser tableopts_ser_nr-Cam.ser tableopts_ser_nr-Caem.ser tableopts_ser_r-Ca.ser tableopts_ser_r-Ce.ser tableopts_ser_r-Cf.ser tableopts_ser_r-CF.ser tableopts_ser_r-Cm.ser tableopts_ser_r-Cem.ser tableopts_ser_r-Cae.ser tableopts_ser_r-Caef.ser tableopts_ser_r-CaeF.ser tableopts_ser_r-Cam.ser tableopts_ser_r-Caem.ser tableopts_ver_nr-Ca.ver tableopts_ver_nr-Ce.ver tableopts_ver_nr-Cf.ver tableopts_ver_nr-CF.ver tableopts_ver_nr-Cm.ver tableopts_ver_nr-Cem.ver tableopts_ver_nr-Cae.ver tableopts_ver_nr-Caef.ver tableopts_ver_nr-CaeF.ver tableopts_ver_nr-Cam.ver tableopts_ver_nr-Caem.ver tableopts_ver_r-Ca.ver tableopts_ver_r-Ce.ver tableopts_ver_r-Cf.ver tableopts_ver_r-CF.ver tableopts_ver_r-Cm.ver tableopts_ver_r-Cem.ver tableopts_ver_r-Cae.ver tableopts_ver_r-Caef.ver tableopts_ver_r-CaeF.ver tableopts_ver_r-Cam.ver tableopts_ver_r-Caem.ver
+
+tableopts_tables = tableopts_ser_nr-Ca.ser.tables tableopts_ser_nr-Ce.ser.tables tableopts_ser_nr-Cf.ser.tables tableopts_ser_nr-CF.ser.tables tableopts_ser_nr-Cm.ser.tables tableopts_ser_nr-Cem.ser.tables tableopts_ser_nr-Cae.ser.tables tableopts_ser_nr-Caef.ser.tables tableopts_ser_nr-CaeF.ser.tables tableopts_ser_nr-Cam.ser.tables tableopts_ser_nr-Caem.ser.tables tableopts_ser_r-Ca.ser.tables tableopts_ser_r-Ce.ser.tables tableopts_ser_r-Cf.ser.tables tableopts_ser_r-CF.ser.tables tableopts_ser_r-Cm.ser.tables tableopts_ser_r-Cem.ser.tables tableopts_ser_r-Cae.ser.tables tableopts_ser_r-Caef.ser.tables tableopts_ser_r-CaeF.ser.tables tableopts_ser_r-Cam.ser.tables tableopts_ser_r-Caem.ser.tables tableopts_ver_nr-Ca.ver.tables tableopts_ver_nr-Ce.ver.tables tableopts_ver_nr-Cf.ver.tables tableopts_ver_nr-CF.ver.tables tableopts_ver_nr-Cm.ver.tables tableopts_ver_nr-Cem.ver.tables tableopts_ver_nr-Cae.ver.tables tableopts_ver_nr-Caef.ver.tables tableopts_ver_nr-CaeF.ver.tables tableopts_ver_nr-Cam.ver.tables tableopts_ver_nr-Caem.ver.tables tableopts_ver_r-Ca.ver.tables tableopts_ver_r-Ce.ver.tables tableopts_ver_r-Cf.ver.tables tableopts_ver_r-CF.ver.tables tableopts_ver_r-Cm.ver.tables tableopts_ver_r-Cem.ver.tables tableopts_ver_r-Cae.ver.tables tableopts_ver_r-Caef.ver.tables tableopts_ver_r-CaeF.ver.tables tableopts_ver_r-Cam.ver.tables tableopts_ver_r-Caem.ver.tables
diff --git a/tests/tableopts.l4 b/tests/tableopts.l4
new file mode 100644
index 0000000..bb79407
--- /dev/null
+++ b/tests/tableopts.l4
@@ -0,0 +1,84 @@
+/*
+ * 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.
+ */
+
+%{
+/* A template scanner file to build "scanner.c". */
+#include <stdio.h>
+#include <stdlib.h>
+#include "config.h"
+%}
+
+%option 8bit
+%option nounput nomain noyywrap noinput
+%option warn yylineno
+
+
+
+%%
+
+foo|bar ;
+[[:digit:]]+ ;
+[[:blank:]]+ ;
+.|\n ;
+%%
+
+int main ( int argc, char** argv )
+{
+ FILE* fp = NULL;
+ void *yyscanner=0;
+ M4_YY_DECL_GUTS_VAR();
+
+#ifdef TEST_IS_REENTRANT
+ yylex_init(&yyscanner);
+#else
+ (void)yyscanner;
+#endif
+
+#ifdef TEST_HAS_TABLES_EXTERNAL
+ if((fp = fopen(argv[1],"r"))== NULL)
+ YY_FATAL_ERROR("could not open tables file for reading");
+
+ if(yytables_fload(fp M4_YY_CALL_LAST_ARG) < 0)
+ YY_FATAL_ERROR("yytables_fload returned < 0");
+ if(M4_YY_TABLES_VERIFY)
+ exit(0);
+#endif
+
+ if(argc > 2){
+ if((fp = fopen(argv[2],"r"))== NULL)
+ YY_FATAL_ERROR("could not open input file for reading");
+ yyin = fp;
+ }
+ while(yylex(M4_YY_CALL_ONLY_ARG) != 0)
+ ;
+
+#ifdef TEST_HAS_TABLES_EXTERNAL
+ yytables_destroy(M4_YY_CALL_ONLY_ARG);
+#endif
+ yylex_destroy(M4_YY_CALL_ONLY_ARG);
+
+ if(argc < 0) /* silence the compiler */
+ yyscanner = (void*)fp;
+
+ return 0;
+}
diff --git a/tests/tableopts.sh b/tests/tableopts.sh
new file mode 100755
index 0000000..63a36d3
--- /dev/null
+++ b/tests/tableopts.sh
@@ -0,0 +1,44 @@
+#!/bin/bash
+set -euo pipefail
+IFS=$'\n\t'
+
+# This script is present to generate the automake _SOURCES variables
+# for the tableopts_* tests. It also generates the linking rules for
+# each test since automake isn't able to handle the pattern rules that
+# would be natural to use. Output is written to standard output for
+# inclusion in a Makefile.am, typically by redirecting the output and then an automake include directive.
+
+TABLEOPTS_TESTS=""
+tableopts_tables=""
+
+for kind in opt ser ver ; do
+ for threading in nr r ; do
+ for opt in -Ca -Ce -Cf -CF -Cm -Cem -Cae -Caef -CaeF -Cam -Caem ; do
+ testname=tableopts_${kind}_${threading}${opt}.${kind}
+ if [ "${TABLEOPTS_TESTS}" = "" ] ;then
+ TABLEOPTS_TESTS=${testname}
+ if [ "$kind" = "ser" -o "$kind" = "ver" ] ; then
+ tableopts_tables=${testname}.tables
+ fi
+ else
+ TABLEOPTS_TESTS="${TABLEOPTS_TESTS} ${testname}"
+ if [ "$kind" = "ser" -o "$kind" = "ver" ] ; then
+ tableopts_tables="${tableopts_tables} ${testname}.tables"
+ fi
+ fi
+
+ bare_opt=${opt#-}
+ cat << EOF
+tableopts_${kind}_${threading}_${bare_opt}_${kind}_SOURCES = tableopts.l4
+
+${testname}\$(EXEEXT): tableopts_${kind}_${threading}${opt}.\$(OBJEXT)
+ \$(LINK) -o \$@ \$<
+
+EOF
+ done
+ done
+done
+
+echo TABLEOPTS_TESTS = ${TABLEOPTS_TESTS}
+echo
+echo tableopts_tables = ${tableopts_tables}
diff --git a/tests/tableopts.txt b/tests/tableopts.txt
new file mode 100644
index 0000000..aec9276
--- /dev/null
+++ b/tests/tableopts.txt
@@ -0,0 +1,2 @@
+0000 foo 1111 foo 0000 bar foobar
+0000 foo 1111 foo 0000 bar foobar
diff --git a/tests/testwrapper.sh b/tests/testwrapper.sh
new file mode 100755
index 0000000..30127b5
--- /dev/null
+++ b/tests/testwrapper.sh
@@ -0,0 +1,53 @@
+#!/bin/bash -vx
+set -euo pipefail
+
+# testwrapper.sh: run a flex test, typically called by a Makefile
+
+# Each test will exercise some feature or aspect of flex. Run the test with any input it may need.
+
+INPUT_DIRECTORY=""
+INPUT_NAME=""
+INPUT_COUNT=0
+USE_REDIRECT=0
+DO_COMPARISON=0
+
+while getopts :d:i:rt1 OPTION ; do
+ case $OPTION in
+ d) INPUT_DIRECTORY=$OPTARG ;;
+ i)
+ if [ "$INPUT_NAME" == "" ] ; then
+ INPUT_NAME="$OPTARG"
+ else
+ INPUT_NAME="$INPUT_NAME $OPTARG"
+ fi
+ INPUT_COUNT=$(($INPUT_COUNT+1))
+ ;;
+ r) USE_REDIRECT=1 ;;
+ t) USE_TABLES=1 ;;
+ 1) DO_COMPARISON=1 ;;
+ esac
+ done
+
+TESTNAME="${!OPTIND}"
+
+INPUT_NAME=${INPUT_NAME:-`basename $TESTNAME`.txt}
+
+if [ "$DO_COMPARISON" -eq "1" ] ; then
+ test `$TESTNAME 1 < $INPUT_DIRECTORY/$INPUT_NAME` -eq `$TESTNAME < $INPUT_DIRECTORY/$INPUT_NAME`
+ exit $?
+ fi
+
+if [ $INPUT_COUNT -gt 1 ] ; then
+ $TESTNAME ${USE_TABLES:+${INPUT_DIRECTORY}/${TESTNAME}.tables} ${INPUT_NAME}
+ exit $?
+ fi
+
+if [ -f ${INPUT_DIRECTORY}/${INPUT_NAME} ] ; then
+ if [ $USE_REDIRECT == 1 ] ; then
+ $TESTNAME ${USE_TABLES:+${INPUT_DIRECTORY}/${TESTNAME}.tables} < $INPUT_DIRECTORY/$INPUT_NAME
+ else
+ $TESTNAME ${USE_TABLES:+${INPUT_DIRECTORY}/${TESTNAME}.tables} $INPUT_DIRECTORY/$INPUT_NAME
+ fi
+else
+ $TESTNAME
+fi
diff --git a/tests/top.l b/tests/top.l
new file mode 100644
index 0000000..25f4773
--- /dev/null
+++ b/tests/top.l
@@ -0,0 +1,53 @@
+/*
+ * 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.
+ */
+
+%{
+/* Build "scanner.c".
+ The scanner is not important.
+ This test is really about compilation. See "main.c".
+*/
+#include <stdio.h>
+#include <stdlib.h>
+#include "config.h"
+
+#ifndef DEFINE_ME
+#error "DEFINE_ME undefined!"
+#endif
+%}
+
+%top{
+#define DEFINE_ME 1
+}
+
+%option reentrant
+%option 8bit header="top.h" prefix="test"
+%option nounput nomain noyywrap noinput
+%option warn
+
+
+%%
+
+.|\n { }
+
+%%
+
diff --git a/tests/top.txt b/tests/top.txt
new file mode 100644
index 0000000..2ce5001
--- /dev/null
+++ b/tests/top.txt
@@ -0,0 +1,3 @@
+Any input is ok for this scanner.
+We only care if it links.
+
diff --git a/tests/top_main.c b/tests/top_main.c
new file mode 100644
index 0000000..b273214
--- /dev/null
+++ b/tests/top_main.c
@@ -0,0 +1,67 @@
+/*
+ * 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 <assert.h>
+
+#include "top.h"
+
+/* The scanner itself is not important here.
+ * We simply try to use all the functions that are exported in the
+ * header, to see if we get any compiler warnings.
+ */
+int
+main ( int argc, char** argv )
+{
+ (void)argc;
+ (void)argv;
+
+ yyscan_t scanner;
+ FILE *fp;
+ char * extra = "EXTRA";
+
+ testlex_init(&scanner);
+ testset_in(stdin,scanner);
+ testset_out(stdout,scanner);
+ testset_extra(extra,scanner);
+
+ fp = testget_in(scanner);
+ assert(fp == stdin);
+ fp = testget_out(scanner);
+ assert(fp == stdout);
+
+ while(testlex(scanner)) {
+ char * text;
+ int line;
+ line = testget_lineno(scanner);
+ text = testget_text(scanner);
+
+ if( (char*)testget_extra(scanner) != extra)
+ break;
+
+ if ( !text || line < 0)
+ continue;
+ }
+ testlex_destroy(scanner);
+ printf("TEST RETURNING OK.\n");
+ return 0;
+}
diff --git a/tests/yyextra.l b/tests/yyextra.l
new file mode 100644
index 0000000..37e8821
--- /dev/null
+++ b/tests/yyextra.l
@@ -0,0 +1,121 @@
+/*
+ * 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.
+ */
+
+%{
+/* A file to build "scanner.c". */
+/* This tests that we can use "yyextra".
+ We buffer all input into a growable array, then print it.
+ We run diff on the input and output.
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "config.h"
+
+
+/* We'll store the entire input in this buffer, growing as necessary. */
+struct Buffer {
+ int curr_len;
+ int max_len;
+ int grow_len;
+ char * data;
+};
+#define YY_EXTRA_TYPE struct Buffer *
+
+/* Save char into junk array at next position. */
+static void append_char (char c, yyscan_t scanner );
+
+%}
+
+%option 8bit prefix="test"
+%option nounput nomain noyywrap nodefault noinput
+%option warn
+%option reentrant
+
+
+%%
+
+.|\r|\n { append_char (yytext[0],yyscanner); }
+
+%%
+
+int main(void);
+
+int
+main ()
+{
+ yyscan_t scanner;
+ struct Buffer * buf;
+ int i;
+
+ buf = (struct Buffer*) malloc(sizeof(struct Buffer));
+ buf->curr_len =0;
+ buf->max_len = 4;
+ buf->grow_len = 100;
+ buf->data = (char*)malloc(buf->max_len);
+
+ testlex_init(&scanner);
+ testset_in( stdin, scanner);
+ testset_out( stdout, scanner);
+ testset_extra( buf, scanner );
+ testlex(scanner);
+
+ buf = testget_extra(scanner);
+ for(i=0; i < buf->curr_len; i++)
+ fputc( buf->data[i], stdout );
+ free( buf->data);
+ free( buf);
+
+ testlex_destroy(scanner);
+ return 0;
+}
+
+/* Save char into junk array at next position. */
+static void append_char (char c, yyscan_t scanner )
+{
+ struct Buffer *buf, *new_buf;
+ buf = testget_extra(scanner);
+
+ /* Grow buffer if necessary. */
+
+ if( buf->curr_len >= buf->max_len )
+ {
+ new_buf = (struct Buffer*) malloc(sizeof(struct Buffer));
+ new_buf->max_len = buf->max_len + buf->grow_len;
+ new_buf->grow_len = buf->grow_len;
+ new_buf->data = (char*)malloc(new_buf->max_len);
+ for( new_buf->curr_len = 0;
+ new_buf->curr_len < buf->curr_len;
+ new_buf->curr_len++ )
+ {
+ new_buf->data[ new_buf->curr_len] = buf->data [ new_buf->curr_len];
+ }
+ free( buf->data );
+ free( buf );
+ buf = new_buf;
+ testset_extra( buf, scanner );
+ }
+
+
+ buf->data[ buf->curr_len++ ] = c;
+}
diff --git a/tests/yyextra.txt b/tests/yyextra.txt
new file mode 100644
index 0000000..243df29
--- /dev/null
+++ b/tests/yyextra.txt
@@ -0,0 +1,795 @@
+
+ THE UNITED STATES CONSTITUTION
+ _________________________________________________________________
+
+ (See Note 1)
+
+ We the People of the United States, in Order to form a more perfect
+ Union, establish Justice, insure domestic Tranquility, provide for the
+ common defence, promote the general Welfare, and secure the Blessings
+ of Liberty to ourselves and our Posterity, do ordain and establish
+ this Constitution for the United States of America.
+
+Article. I.
+
+ Section 1.
+
+ All legislative Powers herein granted shall be vested in a Congress of
+ the United States, which shall consist of a Senate and House of
+ Representatives.
+
+ Section. 2.
+
+ Clause 1: The House of Representatives shall be composed of Members
+ chosen every second Year by the People of the several States, and the
+ Electors in each State shall have the Qualifications requisite for
+ Electors of the most numerous Branch of the State Legislature.
+
+ Clause 2: No Person shall be a Representative who shall not have
+ attained to the Age of twenty five Years, and been seven Years a
+ Citizen of the United States, and who shall not, when elected, be an
+ Inhabitant of that State in which he shall be chosen.
+
+ Clause 3: Representatives and direct Taxes shall be apportioned among
+ the several States which may be included within this Union, according
+ to their respective Numbers, which shall be determined by adding to
+ the whole Number of free Persons, including those bound to Service for
+ a Term of Years, and excluding Indians not taxed, three fifths of all
+ other Persons. (See Note 2) The actual Enumeration shall be made
+ within three Years after the first Meeting of the Congress of the
+ United States, and within every subsequent Term of ten Years, in such
+ Manner as they shall by Law direct. The Number of Representatives
+ shall not exceed one for every thirty Thousand, but each State shall
+ have at Least one Representative; and until such enumeration shall be
+ made, the State of New Hampshire shall be entitled to chuse three,
+ Massachusetts eight, Rhode-Island and Providence Plantations one,
+ Connecticut five, New-York six, New Jersey four, Pennsylvania eight,
+ Delaware one, Maryland six, Virginia ten, North Carolina five, South
+ Carolina five, and Georgia three.
+
+ Clause 4: When vacancies happen in the Representation from any State,
+ the Executive Authority thereof shall issue Writs of Election to fill
+ such Vacancies.
+
+ Clause 5: The House of Representatives shall chuse their Speaker and
+ other Officers; and shall have the sole Power of Impeachment.
+
+ Section. 3.
+
+ Clause 1: The Senate of the United States shall be composed of two
+ Senators from each State, chosen by the Legislature thereof, (See Note
+ 3) for six Years; and each Senator shall have one Vote.
+
+ Clause 2: Immediately after they shall be assembled in Consequence of
+ the first Election, they shall be divided as equally as may be into
+ three Classes. The Seats of the Senators of the first Class shall be
+ vacated at the Expiration of the second Year, of the second Class at
+ the Expiration of the fourth Year, and of the third Class at the
+ Expiration of the sixth Year, so that one third may be chosen every
+ second Year; and if Vacancies happen by Resignation, or otherwise,
+ during the Recess of the Legislature of any State, the Executive
+ thereof may make temporary Appointments until the next Meeting of the
+ Legislature, which shall then fill such Vacancies. (See Note 4)
+
+ Clause 3: No Person shall be a Senator who shall not have attained to
+ the Age of thirty Years, and been nine Years a Citizen of the United
+ States, and who shall not, when elected, be an Inhabitant of that
+ State for which he shall be chosen.
+
+ Clause 4: The Vice President of the United States shall be President
+ of the Senate, but shall have no Vote, unless they be equally divided.
+
+ Clause 5: The Senate shall chuse their other Officers, and also a
+ President pro tempore, in the Absence of the Vice President, or when
+ he shall exercise the Office of President of the United States.
+
+ Clause 6: The Senate shall have the sole Power to try all
+ Impeachments. When sitting for that Purpose, they shall be on Oath or
+ Affirmation. When the President of the United States is tried, the
+ Chief Justice shall preside: And no Person shall be convicted without
+ the Concurrence of two thirds of the Members present.
+
+ Clause 7: Judgment in Cases of Impeachment shall not extend further
+ than to removal from Office, and disqualification to hold and enjoy
+ any Office of honor, Trust or Profit under the United States: but the
+ Party convicted shall nevertheless be liable and subject to
+ Indictment, Trial, Judgment and Punishment, according to Law.
+
+ Section. 4.
+
+ Clause 1: The Times, Places and Manner of holding Elections for
+ Senators and Representatives, shall be prescribed in each State by the
+ Legislature thereof; but the Congress may at any time by Law make or
+ alter such Regulations, except as to the Places of chusing Senators.
+
+ Clause 2: The Congress shall assemble at least once in every Year, and
+ such Meeting shall be on the first Monday in December, (See Note 5)
+ unless they shall by Law appoint a different Day.
+
+ Section. 5.
+
+ Clause 1: Each House shall be the Judge of the Elections, Returns and
+ Qualifications of its own Members, and a Majority of each shall
+ constitute a Quorum to do Business; but a smaller Number may adjourn
+ from day to day, and may be authorized to compel the Attendance of
+ absent Members, in such Manner, and under such Penalties as each House
+ may provide.
+
+ Clause 2: Each House may determine the Rules of its Proceedings,
+ punish its Members for disorderly Behaviour, and, with the Concurrence
+ of two thirds, expel a Member.
+
+ Clause 3: Each House shall keep a Journal of its Proceedings, and from
+ time to time publish the same, excepting such Parts as may in their
+ Judgment require Secrecy; and the Yeas and Nays of the Members of
+ either House on any question shall, at the Desire of one fifth of
+ those Present, be entered on the Journal.
+
+ Clause 4: Neither House, during the Session of Congress, shall,
+ without the Consent of the other, adjourn for more than three days,
+ nor to any other Place than that in which the two Houses shall be
+ sitting.
+
+ Section. 6.
+
+ Clause 1: The Senators and Representatives shall receive a
+ Compensation for their Services, to be ascertained by Law, and paid
+ out of the Treasury of the United States. (See Note 6) They shall in
+ all Cases, except Treason, Felony and Breach of the Peace,
+ beprivileged from Arrest during their Attendance at the Session of
+ their respective Houses, and in going to and returning from the same;
+ and for any Speech or Debate in either House, they shall not be
+ questioned in any other Place.
+
+ Clause 2: No Senator or Representative shall, during the Time for
+ which he was elected, be appointed to any civil Office under the
+ Authority of the United States, which shall have been created, or the
+ Emoluments whereof shall have been encreased during such time; and no
+ Person holding any Office under the United States, shall be a Member
+ of either House during his Continuance in Office.
+
+ Section. 7.
+
+ Clause 1: All Bills for raising Revenue shall originate in the House
+ of Representatives; but the Senate may propose or concur with
+ Amendments as on other Bills.
+
+ Clause 2: Every Bill which shall have passed the House of
+ Representatives and the Senate, shall, before it become a Law, be
+ presented to the President of the United States; If he approve he
+ shall sign it, but if not he shall return it, with his Objections to
+ that House in which it shall have originated, who shall enter the
+ Objections at large on their Journal, and proceed to reconsider it. If
+ after such Reconsideration two thirds of that House shall agree to
+ pass the Bill, it shall be sent, together with the Objections, to the
+ other House, by which it shall likewise be reconsidered, and if
+ approved by two thirds of that House, it shall become a Law. But in
+ all such Cases the Votes of both Houses shall be determined by yeas
+ and Nays, and the Names of the Persons voting for and against the Bill
+ shall be entered on the Journal of each House respectively. If any
+ Bill shall not be returned by the President within ten Days (Sundays
+ excepted) after it shall have been presented to him, the Same shall be
+ a Law, in like Manner as if he had signed it, unless the Congress by
+ their Adjournment prevent its Return, in which Case it shall not be a
+ Law.
+
+ Clause 3: Every Order, Resolution, or Vote to which the Concurrence of
+ the Senate and House of Representatives may be necessary (except on a
+ question of Adjournment) shall be presented to the President of the
+ United States; and before the Same shall take Effect, shall be
+ approved by him, or being disapproved by him, shall be repassed by two
+ thirds of the Senate and House of Representatives, according to the
+ Rules and Limitations prescribed in the Case of a Bill.
+
+ Section. 8.
+
+ Clause 1: The Congress shall have Power To lay and collect Taxes,
+ Duties, Imposts and Excises, to pay the Debts and provide for the
+ common Defence and general Welfare of the United States; but all
+ Duties, Imposts and Excises shall be uniform throughout the United
+ States;
+
+ Clause 2: To borrow Money on the credit of the United States;
+
+ Clause 3: To regulate Commerce with foreign Nations, and among the
+ several States, and with the Indian Tribes;
+
+ Clause 4: To establish an uniform Rule of Naturalization, and uniform
+ Laws on the subject of Bankruptcies throughout the United States;
+
+ Clause 5: To coin Money, regulate the Value thereof, and of foreign
+ Coin, and fix the Standard of Weights and Measures;
+
+ Clause 6: To provide for the Punishment of counterfeiting the
+ Securities and current Coin of the United States;
+
+ Clause 7: To establish Post Offices and post Roads;
+
+ Clause 8: To promote the Progress of Science and useful Arts, by
+ securing for limited Times to Authors and Inventors the exclusive
+ Right to their respective Writings and Discoveries;
+
+ Clause 9: To constitute Tribunals inferior to the supreme Court;
+
+ Clause 10: To define and punish Piracies and Felonies committed on the
+ high Seas, and Offences against the Law of Nations;
+
+ Clause 11: To declare War, grant Letters of Marque and Reprisal, and
+ make Rules concerning Captures on Land and Water;
+
+ Clause 12: To raise and support Armies, but no Appropriation of Money
+ to that Use shall be for a longer Term than two Years;
+
+ Clause 13: To provide and maintain a Navy;
+
+ Clause 14: To make Rules for the Government and Regulation of the land
+ and naval Forces;
+
+ Clause 15: To provide for calling forth the Militia to execute the
+ Laws of the Union, suppress Insurrections and repel Invasions;
+
+ Clause 16: To provide for organizing, arming, and disciplining, the
+ Militia, and for governing such Part of them as may be employed in the
+ Service of the United States, reserving to the States respectively,
+ the Appointment of the Officers, and the Authority of training the
+ Militia according to the discipline prescribed by Congress;
+
+ Clause 17: To exercise exclusive Legislation in all Cases whatsoever,
+ over such District (not exceeding ten Miles square) as may, byCession
+ of particular States, and the Acceptance of Congress, become the Seat
+ of the Government of the United States, and to exercise like Authority
+ over all Places purchased by the Consent of the Legislature of the
+ State in which the Same shall be, for the Erection of Forts,
+ Magazines, Arsenals, dock-Yards, and other needful Buildings;--And
+
+ Clause 18: To make all Laws which shall be necessary and proper for
+ carrying into Execution the foregoing Powers, and all other Powers
+ vested by this Constitution in the Government of the United States, or
+ in any Department or Officer thereof.
+
+ Section. 9.
+
+ Clause 1: The Migration or Importation of such Persons as any of the
+ States now existing shall think proper to admit, shall not be
+ prohibited by the Congress prior to the Year one thousand eight
+ hundred and eight, but a Tax or duty may be imposed on such
+ Importation, not exceeding ten dollars for each Person.
+
+ Clause 2: The Privilege of the Writ of Habeas Corpus shall not be
+ suspended, unless when in Cases of Rebellion or Invasion the public
+ Safety may require it.
+
+ Clause 3: No Bill of Attainder or ex post facto Law shall be passed.
+
+ Clause 4: No Capitation, or other direct, Tax shall be laid, unless in
+ Proportion to the Census or Enumeration herein before directed to be
+ taken. (See Note 7)
+
+ Clause 5: No Tax or Duty shall be laid on Articles exported from any
+ State.
+
+ Clause 6: No Preference shall be given by any Regulation of Commerce
+ or Revenue to the Ports of one State over those of another: nor shall
+ Vessels bound to, or from, one State, be obliged to enter, clear, or
+ pay Duties in another.
+
+ Clause 7: No Money shall be drawn from the Treasury, but in
+ Consequence of Appropriations made by Law; and a regular Statement and
+ Account of the Receipts and Expenditures of all public Money shall be
+ published from time to time.
+
+ Clause 8: No Title of Nobility shall be granted by the United States:
+ And no Person holding any Office of Profit or Trust under them, shall,
+ without the Consent of the Congress, accept of any present, Emolument,
+ Office, or Title, of any kind whatever, from any King, Prince, or
+ foreign State.
+
+ Section. 10.
+
+ Clause 1: No State shall enter into any Treaty, Alliance, or
+ Confederation; grant Letters of Marque and Reprisal; coin Money; emit
+ Bills of Credit; make any Thing but gold and silver Coin a Tender in
+ Payment of Debts; pass any Bill of Attainder, ex post facto Law, or
+ Law impairing the Obligation of Contracts, or grant any Title of
+ Nobility.
+
+ Clause 2: No State shall, without the Consent of the Congress, lay any
+ Imposts or Duties on Imports or Exports, except what may be absolutely
+ necessary for executing it's inspection Laws: and the net Produce of
+ all Duties and Imposts, laid by any State on Imports or Exports, shall
+ be for the Use of the Treasury of the United States; and all such Laws
+ shall be subject to the Revision and Controul of the Congress.
+
+ Clause 3: No State shall, without the Consent of Congress, lay any
+ Duty of Tonnage, keep Troops, or Ships of War in time of Peace, enter
+ into any Agreement or Compact with another State, or with a foreign
+ Power, or engage in War, unless actually invaded, or in such imminent
+ Danger as will not admit of delay.
+
+Article. II.
+
+ Section. 1.
+
+ Clause 1: The executive Power shall be vested in a President of the
+ United States of America. He shall hold his Office during the Term of
+ four Years, and, together with the Vice President, chosen for the same
+ Term, be elected, as follows
+
+ Clause 2: Each State shall appoint, in such Manner as the Legislature
+ thereof may direct, a Number of Electors, equal to the whole Number of
+ Senators and Representatives to which the State may be entitled in the
+ Congress: but no Senator or Representative, or Person holding an
+ Office of Trust or Profit under the United States, shall be appointed
+ an Elector.
+
+ Clause 3: The Electors shall meet in their respective States, and vote
+ by Ballot for two Persons, of whom one at least shall not be an
+ Inhabitant of the same State with themselves. And they shall make a
+ List of all the Persons voted for, and of the Number of Votes for
+ each; which List they shall sign and certify, and transmit sealed to
+ the Seat of the Government of the United States, directed to the
+ President of the Senate. The President of the Senate shall, in the
+ Presence of the Senate and House of Representatives, open all the
+ Certificates, and the Votes shall then be counted. The Person having
+ the greatest Number of Votes shall be the President, if such Number be
+ a Majority of the whole Number of Electors appointed; and if there be
+ more than one who have such Majority, and have an equal Number of
+ Votes, then the House of Representatives shall immediately chuse by
+ Ballot one of them for President; and if no Person have a Majority,
+ then from the five highest on the List the said House shall in like
+ Manner chuse the President. But in chusing the President, the Votes
+ shall be taken by States, the Representation from each State having
+ one Vote; A quorum for this Purpose shall consist of a Member or
+ Members from two thirds of the States, and a Majority of all the
+ States shall be necessary to a Choice. In every Case, after the Choice
+ of the President, the Person having the greatest Number of Votes of
+ the Electors shall be the Vice President. But if there should remain
+ two or more who have equal Votes, the Senate shall chuse from them by
+ Ballot the Vice President. (See Note 8)
+
+ Clause 4: The Congress may determine the Time of chusing the Electors,
+ and the Day on which they shall give their Votes; which Day shall be
+ the same throughout the United States.
+
+ Clause 5: No Person except a natural born Citizen, or a Citizen of the
+ United States, at the time of the Adoption of this Constitution, shall
+ be eligible to the Office of President; neither shall any Person be
+ eligible to that Office who shall not have attained to the Age of
+ thirty five Years, and been fourteen Years a Resident within the
+ United States.
+
+ Clause 6: In Case of the Removal of the President from Office, or of
+ his Death, Resignation, or Inability to discharge the Powers and
+ Duties of the said Office, (See Note 9) the Same shall devolve on the
+ VicePresident, and the Congress may by Law provide for the Case of
+ Removal, Death, Resignation or Inability, both of the President and
+ Vice President, declaring what Officer shall then act as President,
+ and such Officer shall act accordingly, until the Disability be
+ removed, or a President shall be elected.
+
+ Clause 7: The President shall, at stated Times, receive for his
+ Services, a Compensation, which shall neither be encreased nor
+ diminished during the Period for which he shall have been elected, and
+ he shall not receive within that Period any other Emolument from the
+ United States, or any of them.
+
+ Clause 8: Before he enter on the Execution of his Office, he shall
+ take the following Oath or Affirmation:--"I do solemnly swear (or
+ affirm) that I will faithfully execute the Office of President of the
+ United States, and will to the best of my Ability, preserve, protect
+ and defend the Constitution of the United States."
+
+ Section. 2.
+
+ Clause 1: The President shall be Commander in Chief of the Army and
+ Navy of the United States, and of the Militia of the several States,
+ when called into the actual Service of the United States; he may
+ require the Opinion, in writing, of the principal Officer in each of
+ the executive Departments, upon any Subject relating to the Duties of
+ their respective Offices, and he shall have Power to grant Reprieves
+ and Pardons for Offences against the United States, except in Cases of
+ Impeachment.
+
+ Clause 2: He shall have Power, by and with the Advice and Consent of
+ the Senate, to make Treaties, provided two thirds of the Senators
+ present concur; and he shall nominate, and by and with the Advice and
+ Consent of the Senate, shall appoint Ambassadors, other public
+ Ministers and Consuls, Judges of the supreme Court, and all other
+ Officers of the United States, whose Appointments are not herein
+ otherwise provided for, and which shall be established by Law: but the
+ Congress may by Law vest the Appointment of such inferior Officers, as
+ they think proper, in the President alone, in the Courts of Law, or in
+ the Heads of Departments.
+
+ Clause 3: The President shall have Power to fill up all Vacancies that
+ may happen during the Recess of the Senate, by granting Commissions
+ which shall expire at the End of their next Session.
+
+ Section. 3.
+
+ He shall from time to time give to the Congress Information of the
+ State of the Union, and recommend to their Consideration such Measures
+ as he shall judge necessary and expedient; he may, on extraordinary
+ Occasions, convene both Houses, or either of them, and in Case of
+ Disagreement between them, with Respect to the Time of Adjournment, he
+ may adjourn them to such Time as he shall think proper; he shall
+ receive Ambassadors and other public Ministers; he shall take Care
+ that the Laws be faithfully executed, and shall Commission all the
+ Officers of the United States.
+
+ Section. 4.
+
+ The President, Vice President and all civil Officers of the United
+ States, shall be removed from Office on Impeachment for, and
+ Conviction of, Treason, Bribery, or other high Crimes and
+ Misdemeanors.
+
+Article. III.
+
+ Section. 1.
+
+ The judicial Power of the United States, shall be vested in one
+ supreme Court, and in such inferior Courts as the Congress may from
+ time to time ordain and establish. The Judges, both of the supreme and
+ inferior Courts, shall hold their Offices during good Behaviour, and
+ shall, at stated Times, receive for their Services, a Compensation,
+ which shall not be diminished during their Continuance in Office.
+
+ Section. 2.
+
+ Clause 1: The judicial Power shall extend to all Cases, in Law and
+ Equity, arising under this Constitution, the Laws of the United
+ States, and Treaties made, or which shall be made, under their
+ Authority;--to all Cases affecting Ambassadors, other public Ministers
+ and Consuls;--to all Cases of admiralty and maritime Jurisdiction;--to
+ Controversies to which the United States shall be a Party;--to
+ Controversies between two or more States;--between a State and
+ Citizens of another State; (See Note 10)--between Citizens of
+ different States, --between Citizens of the same State claiming Lands
+ under Grants of different States, and between a State, or the Citizens
+ thereof, and foreign States, Citizens or Subjects.
+
+ Clause 2: In all Cases affecting Ambassadors, other public Ministers
+ and Consuls, and those in which a State shall be Party, the supreme
+ Court shall have original Jurisdiction. In all the other Cases before
+ mentioned, the supreme Court shall have appellate Jurisdiction, both
+ as to Law and Fact, with such Exceptions, and under such Regulations
+ as the Congress shall make.
+
+ Clause 3: The Trial of all Crimes, except in Cases of Impeachment,
+ shall be by Jury; and such Trial shall be held in the State where the
+ said Crimes shall have been committed; but when not committed within
+ any State, the Trial shall be at such Place or Places as the Congress
+ may by Law have directed.
+
+ Section. 3.
+
+ Clause 1: Treason against the United States, shall consist only in
+ levying War against them, or in adhering to their Enemies, giving them
+ Aid and Comfort. No Person shall be convicted of Treason unless on the
+ Testimony of two Witnesses to the same overt Act, or on Confession in
+ open Court.
+
+ Clause 2: The Congress shall have Power to declare the Punishment of
+ Treason, but no Attainder of Treason shall work Corruption of Blood,
+ or Forfeiture except during the Life of the Person attainted.
+
+Article. IV.
+
+ Section. 1.
+
+ Full Faith and Credit shall be given in each State to the public Acts,
+ Records, and judicial Proceedings of every other State. And the
+ Congress may by general Laws prescribe the Manner in which such Acts,
+ Records and Proceedings shall be proved, and the Effect thereof.
+
+ Section. 2.
+
+ Clause 1: The Citizens of each State shall be entitled to all
+ Privileges and Immunities of Citizens in the several States.
+
+ Clause 2: A Person charged in any State with Treason, Felony, or other
+ Crime, who shall flee from Justice, and be found in another State,
+ shall on Demand of the executive Authority of the State from which he
+ fled, be delivered up, to be removed to the State having Jurisdiction
+ of the Crime.
+
+ Clause 3: No Person held to Service or Labour in one State, under the
+ Laws thereof, escaping into another, shall, in Consequence of any Law
+ or Regulation therein, be discharged from such Service or Labour, but
+ shall be delivered up on Claim of the Party to whom such Service or
+ Labour may be due. (See Note 11)
+
+ Section. 3.
+
+ Clause 1: New States may be admitted by the Congress into this Union;
+ but no new State shall be formed or erected within the Jurisdiction of
+ any other State; nor any State be formed by the Junction of two or
+ more States, or Parts of States, without the Consent of the
+ Legislatures of the States concerned as well as of the Congress.
+
+ Clause 2: The Congress shall have Power to dispose of and make all
+ needful Rules and Regulations respecting the Territory or other
+ Property belonging to the United States; and nothing in this
+ Constitution shall be so construed as to Prejudice any Claims of the
+ United States, or of any particular State.
+
+ Section. 4.
+
+ The United States shall guarantee to every State in this Union a
+ Republican Form of Government, and shall protect each of them against
+ Invasion; and on Application of the Legislature, or of the Executive
+ (when the Legislature cannot be convened) against domestic Violence.
+
+Article. V.
+
+ The Congress, whenever two thirds of both Houses shall deem it
+ necessary, shall propose [1]Amendments to this Constitution, or, on
+ the Application of the Legislatures of two thirds of the several
+ States, shall call a Convention for proposing Amendments, which, in
+ either Case, shall be valid to all Intents and Purposes, as Part of
+ this Constitution, when ratified by the Legislatures of three fourths
+ of the several States, or by Conventions in three fourths thereof, as
+ the one or the other Mode of Ratification may be proposed by the
+ Congress; Provided that no Amendment which may be made prior to the
+ Year One thousand eight hundred and eight shall in any Manner affect
+ the first and fourth Clauses in the Ninth Section of the first
+ Article; and that no State, without its Consent, shall be deprived of
+ its equal Suffrage in the Senate.
+
+Article. VI.
+
+ Clause 1: All Debts contracted and Engagements entered into, before
+ the Adoption of this Constitution, shall be as valid against the
+ United States under this Constitution, as under the Confederation.
+
+ Clause 2: This Constitution, and the Laws of the United States which
+ shall be made in Pursuance thereof; and all Treaties made, or which
+ shall be made, under the Authority of the United States, shall be the
+ supreme Law of the Land; and the Judges in every State shall be bound
+ thereby, any Thing in the Constitution or Laws of any State to the
+ Contrary notwithstanding.
+
+ Clause 3: The Senators and Representatives before mentioned, and the
+ Members of the several State Legislatures, and all executive and
+ judicial Officers, both of the United States and of the several
+ States, shall be bound by Oath or Affirmation, to support this
+ Constitution; but no religious Test shall ever be required as a
+ Qualification to any Office or public Trust under the United States.
+
+Article. VII.
+
+ The Ratification of the Conventions of nine States, shall be
+ sufficient for the Establishment of this Constitution between the
+ States so ratifying the Same.
+
+ done in Convention by the Unanimous Consent of the States present the
+ Seventeenth Day of September in the Year of our Lord one thousand
+ seven hundred and Eighty seven and of the Independence of the United
+ States of America the Twelfth In witness whereof We have hereunto
+ subscribed our Names,
+
+ GO WASHINGTON--Presidt. and deputy from Virginia
+
+ [Signed also by the deputies of twelve States.]
+
+ Delaware
+
+ Geo: Read
+ Gunning Bedford jun
+ John Dickinson
+ Richard Bassett
+ Jaco: Broom
+
+ Maryland
+
+ James MCHenry
+ Dan of ST ThoS. Jenifer
+ DanL Carroll.
+
+ Virginia
+
+ John Blair--
+ James Madison Jr.
+
+ North Carolina
+
+ WM Blount
+ RichD. Dobbs Spaight.
+ Hu Williamson
+
+ South Carolina
+
+ J. Rutledge
+ Charles 1ACotesworth Pinckney
+ Charles Pinckney
+ Pierce Butler.
+
+ Georgia
+
+ William Few
+ Abr Baldwin
+
+ New Hampshire
+
+ John Langdon
+ Nicholas Gilman
+
+ Massachusetts
+
+ Nathaniel Gorham
+ Rufus King
+
+ Connecticut
+ WM. SamL. Johnson
+ Roger Sherman
+
+ New York
+
+ Alexander Hamilton
+
+ New Jersey
+
+ Wil: Livingston
+ David Brearley.
+ WM. Paterson.
+ Jona: Dayton
+
+ Pennsylvania
+
+ B Franklin
+ Thomas Mifflin
+ RobT Morris
+ Geo. Clymer
+ ThoS. FitzSimons
+ Jared Ingersoll
+ James Wilson.
+ Gouv Morris
+
+ Attest William Jackson Secretary
+
+ NOTES
+
+ Note 1: This text of the Constitution follows the engrossed copy
+ signed by Gen. Washington and the deputies from 12 States. The small
+ superior figures preceding the paragraphs designate Clauses, and were
+ not in the original and have no reference to footnotes.
+
+ The Constitution was adopted by a convention of the States on
+ September 17, 1787, and was subsequently ratified by the several
+ States, on the following dates: Delaware, December 7, 1787;
+ Pennsylvania, December 12, 1787; New Jersey, December 18, 1787;
+ Georgia, January 2, 1788; Connecticut, January 9, 1788; Massachusetts,
+ February 6, 1788; Maryland, April 28, 1788; South Carolina, May 23,
+ 1788; New Hampshire, June 21, 1788.
+
+ Ratification was completed on June 21, 1788.
+
+ The Constitution was subsequently ratified by Virginia, June 25, 1788;
+ New York, July 26, 1788; North Carolina, November 21, 1789; Rhode
+ Island, May 29, 1790; and Vermont, January 10, 1791.
+
+ In May 1785, a committee of Congress made a report recommending an
+ alteration in the Articles of Confederation, but no action was taken
+ on it, and it was left to the State Legislatures to proceed in the
+ matter. In January 1786, the Legislature of Virginia passed a
+ resolution providing for the appointment of five commissioners, who,
+ or any three of them, should meet such commissioners as might be
+ appointed in the other States of the Union, at a time and place to be
+ agreed upon, to take into consideration the trade of the United
+ States; to consider how far a uniform system in their commercial
+ regulations may be necessary to their common interest and their
+ permanent harmony; and to report to the several States such an act,
+ relative to this great object, as, when ratified by them, will enable
+ the United States in Congress effectually to provide for the same. The
+ Virginia commissioners, after some correspondence, fixed the first
+ Monday in September as the time, and the city of Annapolis as the
+ place for the meeting, but only four other States were represented,
+ viz: Delaware, New York, New Jersey, and Pennsylvania; the
+ commissioners appointed by Massachusetts, New Hampshire, North
+ Carolina, and Rhode Island failed to attend. Under the circumstances
+ of so partial a representation, the commissioners present agreed upon
+ a report, (drawn by Mr. Hamilton, of New York,) expressing their
+ unanimous conviction that it might essentially tend to advance the
+ interests of the Union if the States by which they were respectively
+ delegated would concur, and use their endeavors to procure the
+ concurrence of the other States, in the appointment of commissioners
+ to meet at Philadelphia on the Second Monday of May following, to take
+ into consideration the situation of the United States; to devise such
+ further provisions as should appear to them necessary to render the
+ Constitution of the Federal Government adequate to the exigencies of
+ the Union; and to report such an act for that purpose to the United
+ States in Congress assembled as, when agreed to by them and afterwards
+ confirmed by the Legislatures of every State, would effectually
+ provide for the same.
+
+ Congress, on the 21st of February, 1787, adopted a resolution in favor
+ of a convention, and the Legislatures of those States which had not
+ already done so (with the exception of Rhode Island) promptly
+ appointed delegates. On the 25th of May, seven States having convened,
+ George Washington, of Virginia, was unanimously elected President, and
+ the consideration of the proposed constitution was commenced. On the
+ 17th of September, 1787, the Constitution as engrossed and agreed upon
+ was signed by all the members present, except Mr. Gerry of
+ Massachusetts, and Messrs. Mason and Randolph, of Virginia. The
+ president of the convention transmitted it to Congress, with a
+ resolution stating how the proposed Federal Government should be put
+ in operation, and an explanatory letter. Congress, on the 28th of
+ September, 1787, directed the Constitution so framed, with the
+ resolutions and letter concerning the same, to "be transmitted to the
+ several Legislatures in order to be submitted to a convention of
+ delegates chosen in each State by the people thereof, in conformity to
+ the resolves of the convention."
+
+ On the 4th of March, 1789, the day which had been fixed for commencing
+ the operations of Government under the new Constitution, it had been
+ ratified by the conventions chosen in each State to consider it, as
+ follows: Delaware, December 7, 1787; Pennsylvania, December 12, 1787;
+ New Jersey, December 18, 1787; Georgia, January 2, 1788; Connecticut,
+ January 9, 1788; Massachusetts, February 6, 1788; Maryland, April 28,
+ 1788; South Carolina, May 23, 1788; New Hampshire, June 21, 1788;
+ Virginia, June 25, 1788; and New York, July 26, 1788.
+
+ The President informed Congress, on the 28th of January, 1790, that
+ North Carolina had ratified the Constitution November 21, 1789; and he
+ informed Congress on the 1st of June, 1790, that Rhode Island had
+ ratified the Constitution May 29, 1790. Vermont, in convention,
+ ratified the Constitution January 10, 1791, and was, by an act of
+ Congress approved February 18, 1791, "received and admitted into this
+ Union as a new and entire member of the United States."
+
+ Note 2: The part of this Clause relating to the mode of apportionment
+ of representatives among the several States has been affected by
+ Section 2 of amendment XIV, and as to taxes on incomes without
+ apportionment by amendment XVI.
+
+ Note 3: This Clause has been affected by Clause 1 of amendment XVII.
+
+ Note 4: This Clause has been affected by Clause 2 of amendment XVIII.
+
+ Note 5: This Clause has been affected by amendment XX.
+
+ Note 6: This Clause has been affected by amendment XXVII.
+
+ Note 7: This Clause has been affected by amendment XVI.
+
+ Note 8: This Clause has been superseded by amendment XII.
+
+ Note 9: This Clause has been affected by amendment XXV.
+
+ Note 10: This Clause has been affected by amendment XI.
+
+ Note 11: This Clause has been affected by amendment XIII.
+
+ Note 12: The first ten amendments to the Constitution of the United
+ States (and two others, one of which failed of ratification and the
+ other which later became the 27th amendment) were proposed to the
+ legislatures of the several States by the First Congress on September
+ 25, 1789. The first ten amendments were ratified by the following
+ States, and the notifications of ratification by the Governors thereof
+ were successively communicated by the President to Congress: New
+ Jersey, November 20, 1789; Maryland, December 19, 1789; North
+ Carolina, December 22, 1789; South Carolina, January 19, 1790; New
+ Hampshire, January 25, 1790; Delaware, January 28, 1790; New York,
+ February 24, 1790; Pennsylvania, March 10, 1790; Rhode Island, June 7,
+ 1790; Vermont, November 3, 1791; and Virginia, December 15, 1791.
+
+ Ratification was completed on December 15, 1791.
+
+ The amendments were subsequently ratified by the legislatures of
+ Massachusetts, March 2, 1939; Georgia, March 18, 1939; and
+ Connecticut, April 19, 1939.
+
+ Note 13: Only the 13th, 14th, 15th, and 16th articles of amendment had
+ numbers assigned to them at the time of ratification.
+
+ Note 14: This sentence has been superseded by section 3 of amendment
+ XX.
+
+ Note 15: See amendment XIX and section 1 of amendment XXVI.
+
+ Note 16: Repealed by section 1 of amendment XXI.
+
+References
+
+ 1. http://www.house.gov/Constitution/Amend.html
diff --git a/to.do/README b/to.do/README
new file mode 100644
index 0000000..7123c30
--- /dev/null
+++ b/to.do/README
@@ -0,0 +1,46 @@
+The contents of this directory are:
+
+ Wilhelms.todo
+ This guy Gerhard Wilhelms did an exhaustive line-by-line
+ study of flex, finding a large number of glitches; it's
+ not clear how significant they are (some have subseuqently
+ been fixed).
+
+ Wish-List
+ A long list of cryptic one-line descriptions of various
+ features people have asked for, or I've thought would be
+ handy. If you have questions about particular ones, let
+ me know.
+
+ reentrant
+ A set of mods contributed by John Bossom for adding
+ an option to flex to make reentrant scanners.
+
+ rflex-2.5.4-diffs
+ A set of mods contributed by Chris Appleton for
+ the same purpose.
+
+ streams
+ email from David Madden about coping with non-blocking
+ I/O.
+
+ unicode
+ patches to support Unicode scanners, contributed
+ by James A. Lauth.
+
+
+Of these, the ones that people frequently ask about are support for reentrant
+scanners and support for Unicode. I haven't played with the reentrant stuff
+so don't know how solid / well designed it is. I've sent out the Unicode
+stuff to numerous people and haven't received any complaints, so I imagine
+it works well.
+
+Another thing people ask for fairly often is removing the limit on size
+of the scanners. There's some mail in the faqs/ directory about ways to
+do this by cranking some #define's in flexdef.h, though of course the best
+solution would be dynamic memory/resizing.
+
+By the way, I have translated the core flex algorithms into a C++ regular
+expression class (but one that doesn't support the uglier stuff like
+yymore()/yyless(), trailing context, etc.). If you ever wind up wanting
+it, just let me know.
diff --git a/to.do/Wilhelms.todo b/to.do/Wilhelms.todo
new file mode 100644
index 0000000..f64a335
--- /dev/null
+++ b/to.do/Wilhelms.todo
@@ -0,0 +1,711 @@
+PARSE.Y 344: ('rule'-rule " | re '$' ": There are some errors concerning
+ trailing context. First of all the rule " re '$' " implies that this is
+ no variable_trail_rule because the tail of it ( '$' ) has a fixed length
+ of 1. The only possible reason for making this rule variable is when
+ 'previous_continued_action' is true. In this case 'variable_trail_rule'
+ must be set and the beginning of the trailing part must be marked.
+ However the variables 'varlength' and 'headcnt' have not the same meaning
+ as in the rule " re2 re ". Here ( in the rule " re '$' " ) 'varlength'
+ is true if the head ( 're' ) of the rule has variable length, and
+ 'headcnt' is still 0 because it isn't set during reduction of 're'.
+ Therefore the test for a variable trailing rule
+ " if ( ! varlength || headcnt != 0 ) "
+ is wrong and should be removed.
+ Also it is not necessary to set 'varlength' or 'headcnt' if you set
+ " trailcnt = 1; ". If this rule is made variable then 'variable_trail_rule'
+ is set and neither 'headcnt' nor 'trailcnt' are used in 'finish_rule()'.
+ And if this rule is normal then the head may be variable or not, but in
+ 'finish_rule()' code is generated to reduce 'yy_cp' by 1.
+ Finally I found no reason to create an epsilon-state and insert it in
+ front of mkstate( '\n' ) instead of adding it behind. This epsilon-state
+ should be marked as STATE_TRAILING_CONTEXT. Otherwise you get no warning
+ of dangerous trailing context if you have a rule " x\n*$ " which was made
+ variable with '|'.)
+
+ | re '$'
+ {
+ /* if ( trlcontxt )
+ {
+ synerr( "trailing context used twice" );
+ $$ = mkstate( SYM_EPSILON );
+ }
+
+ else */ if ( previous_continued_action )
+ {
+ /* see the comment in the rule for "re2 re"
+ * above
+ */
+ /* if ( ! varlength || headcnt != 0 ) */
+ {
+ fprintf( stderr,
+ "%s: warning - trailing context rule at line %d made variable because\n",
+ program_name, linenum );
+ fprintf( stderr,
+ " of preceding '|' action\n" );
+ }
+
+ /* mark as variable */
+ /* varlength = true;
+ headcnt = 0; */
+
+ add_accept( $1, num_rules | YY_TRAILING_HEAD_MASK )
+;
+ variable_trail_rule = true;
+ }
+
+ /* trlcontxt = true;
+
+ if ( ! varlength )
+ headcnt = rulelen;
+
+ ++rulelen; */
+ trailcnt = 1;
+
+ current_state_type = STATE_TRAILING_CONTEXT;
+ eps = mkstate( SYM_EPSILON );
+ current_state_type = STATE_NORMAL;
+
+ $$ = link_machines( $1,
+ link_machines( mkstate( '\n' ), eps ) );
+ }
+
+DFA.C 618: (ntod(): The arrays 'targstate[]' and 'targfreq[]' can be
+ maintained in a better way. Up to now it is possible that states are added
+ to 'targstate[]' more than once, because the state 'newds' from the call
+ to snstods() creates a new entry in 'targstate[]'. But 'newds' may already
+ exist in 'targstate[]' !
+ Another point is that 'targfreq[]' is not updated if "caseins && ! useecs"
+ is true.
+ My algorithm should solve these problems. However it could be simplified
+ by replacing 'newds' by 'targ' and removing the statement "targ = newds;".
+ Remark to the second point: I decremented the targfreq-counter if 'sym'
+ was an uppercase letter and incremented it if 'sym' was a lowercase
+ letter. The index 'i' of 'targfreq[i]' points to the correct position in
+ 'targstate[]' even if a new state was added.)
+
+ for ( sym = 1; sym <= numecs; ++sym )
+ {
+ if ( symlist[sym] )
+ {
+ symlist[sym] = 0;
+
+ if ( duplist[sym] == NIL )
+ { /* symbol has unique out-transitions */
+ numstates = symfollowset( dset, dsize, sym, nset );
+ nset = epsclosure( nset, &numstates, accset,
+ &nacc, &hashval );
+
+ if ( snstods( nset, numstates, accset,
+ nacc, hashval, &newds ) )
+ {
+ totnst = totnst + numstates;
+ ++todo_next;
+ numas += nacc;
+
+ if ( variable_trailing_context_rules && nacc > 0 )
+ check_trailing_context( nset, numstates,
+ accset, nacc );
+ }
+
+ targ = newds;
+ }
+
+ else
+ {
+ /* sym's equivalence class has the same transitions
+ * as duplist(sym)'s equivalence class
+ */
+ targ = state[duplist[sym]];
+ }
+
+ state[sym] = targ;
+
+ if ( trace )
+ fprintf( stderr, "\t%d\t%d\n", sym, targ );
+
+ /* update frequency count for destination state */
+
+ for ( i = 1; i <= targptr; ++i )
+ if ( targstate[i] == targ )
+ break;
+
+ if ( i <= targptr )
+ {
+ ++targfreq[i];
+ ++numdup;
+ }
+ else
+ {
+ targfreq[++targptr] = 1;
+ targstate[targptr] = targ;
+ ++numuniq;
+ }
+
+ if ( caseins && ! useecs )
+ {
+ if ( sym >= 'A' && sym <= 'Z' )
+ {
+ --targfreq[i];
+ --totaltrans;
+ }
+ else if ( sym >= 'a' && sym <= 'z' )
+ {
+ ++targfreq[i];
+ ++totaltrans;
+ }
+ }
+
+ ++totaltrans;
+ duplist[sym] = NIL;
+ }
+ }
+
+
+GEN.C 438: (gen_next_compressed_state(): I have rewritten the function
+ 'yy_try_NUL_trans()' so it really just tries to find out whether a
+ transition on the NUL character goes to the jamstate or not. ( That means
+ I removed each creation of backtracking information and the saving of the
+ new state on the 'yy_state_buf[]'. )
+ Therefore I removed the call for 'gen_backtracking()' here, because the
+ function 'gen_next_compressed_state()' is also used in 'gen_NUL_trans()'.)
+
+/* gen_backtracking(); */
+
+GEN.C 587ff: (gen_next_state(): Since the backtracking information is not
+ created in 'gen_next_compressed_state()' any more, it is done here
+ before the next state is computed ( for "compressed" tables ). This
+ removes the bug that the backtracking information is created twice if
+ 'nultrans' is not NULL and 'gen_next_compressed_state()' is called.
+ Finally I had to insert the creation of a "{" and a "}", because there
+ is a local variable created in 'gen_next_compressed_state()'. ( These are
+ needed only when backtracking information is really created.) )
+
+ if ( ! fulltbl && ! fullspd )
+ gen_backtracking();
+
+ if ( worry_about_NULs && nultrans )
+ {
+ indent_puts( "if ( *yy_cp )" );
+ indent_up();
+ indent_puts( "{" );
+ }
+ else if ( ! fulltbl && ! fullspd && ! reject && num_backtracking > 0 )
+ indent_puts( "{" );
+
+ if ( fulltbl )
+ indent_put2s( "yy_current_state = yy_nxt[yy_current_state][%s];",
+ char_map );
+
+ else if ( fullspd )
+ indent_put2s( "yy_current_state += yy_current_state[%s].yy_nxt;",
+ char_map );
+
+ else
+ gen_next_compressed_state( char_map );
+
+ if ( worry_about_NULs && nultrans )
+ {
+ indent_puts( "}" );
+ indent_down();
+ indent_puts( "else" );
+ indent_up();
+
+ indent_puts( "yy_current_state = yy_NUL_trans[yy_current_state];" );
+ indent_down();
+ }
+ else if ( ! fulltbl && ! fullspd && ! reject && num_backtracking > 0 )
+ indent_puts( "}" );
+
+ if ( fullspd || fulltbl )
+ gen_backtracking();
+
+ if ( reject )
+ indent_puts( "*yy_state_ptr++ = yy_current_state;" );
+ }
+
+GEN.C 553: (gen_next_match(): There is a problem if 'interactive' is true. In
+ this case the scanner jams if the next state is the jamstate ( i.e.
+ yy_base[yy_current_state] == jambase ). However the scanner reaches also
+ the jamstate if the transition character is the NUL-character or if the
+ end of the buffer is reached. Then in the EOB-action is decided whether
+ this was really a NUL character or the end-of-buffer. ( If it was a NUL,
+ scanning will be resumed. If it was the end-of-buffer, the buffer will be
+ filled first, before scanning will be resumed. )
+ These actions are not done if you use an 'interactive' scanner, because
+ the EOB-action is not executed. Therefore you have to continue scanning,
+ if you have just matched a NUL character ( i.e. *yy_cp == '\0' and
+ yy_cp < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) and if you are not
+ already in the yamstate ( i.e. yy_current_state != jamstate ).
+ Note that the '<' in " yy_cp < &yy_current_buffer->yy_ch_buf[yy_n_chars] "
+ implies that the EOB action is *not* executed if the last match before the
+ end-of-buffer was maximal.
+ The following change in the algorithm results in a minor performance
+ penalty because the additional conditions are tested only if you have
+ reached the end of the match or if you are using NUL characters in your
+ patterns.)
+
+ if ( interactive )
+ {
+ printf( "while ( yy_base[yy_current_state] != %d\n", jambase );
+ set_indent( 4 );
+ indent_puts( "|| ( *yy_cp == '\\0'" );
+ indent_up();
+ indent_puts(
+ " && yy_cp < &yy_current_buffer->yy_ch_buf[yy_n_chars]" );
+ do_indent();
+ printf( " && yy_current_state != %d ) );\n", jamstate );
+ set_indent( 2 );
+ }
+ else
+ printf( "while ( yy_current_state != %d );\n", jamstate );
+
+GEN.C 341: (gen_find_action(): Question: The variables 'yy_full_match',
+ 'yy_full_state' and 'yy_full_lp' are used only in the REJECT macro. Why
+ do you not also test here on 'real_reject' before you create code to set
+ these variables ( like you did in line 327ff for the action of the case
+ " ( yy_act & YY_TRAILING_MASK ) " ) ?)
+
+ New code beginning at line 338 to show the context:
+ indent_puts( "else" );
+ indent_up();
+ indent_puts( "{" );
+
+ if ( real_reject )
+ {
+ /* remember matched text in case we back up due to REJECT */
+ indent_puts( "yy_full_match = yy_cp;" );
+ indent_puts( "yy_full_state = yy_state_ptr;" );
+ indent_puts( "yy_full_lp = yy_lp;" );
+ }
+
+ indent_puts( "break;" );
+ indent_puts( "}" );
+ indent_down();
+
+ indent_puts( "++yy_lp;" );
+ indent_puts( "goto find_rule;" );
+ }
+
+
+FLEX.SKEL 364,379: (YY_END_OF_BUFFER action: If it was really a NUL character
+ which started this action, then 'yy_bp' points still at the beginning of
+ the current run and 'yy_c_buf_p' points behind the NUL character.
+ Contrast this with the situation after the call of 'yy_get_next_buffer()'!
+ Therefore I removed the statement " yy_bp = yytext + YY_MORE_ADJ; "
+ ( line 379 ) and replaced the statement
+ " yy_c_buf_p = yytext + yy_amount_of_matched_text; " ( line 364 ) by the
+ easier one " yy_c_buf_p = --yy_cp; ". Here 'yy_cp' is also adjusted.
+ This guarantees that both 'yy_c_buf_p' and 'yy_cp' point at the NUL
+ character. Therefore 'yy_cp' will have the correct value when it is needed
+ after the call to 'yy_try_NUL_trans()' ( when we know whether we make a
+ transition or not ).
+
+ line 364:
+ yy_c_buf_p = --yy_cp;
+
+ line 379:
+ /* yy_bp = yytext + YY_MORE_ADJ; */
+
+GEN.C 632: (gen_NUL_trans(): I have rewritten 'yy_try_NUL_trans()'. The new
+ version just finds out whether a transition on the NUL character goes to
+ the jamstate or not. See also my remarks to 'gen_next_compressed_state()'.
+ Note that the test " yy_is_jam = (yy_current_state == jamstate); " is
+ also used, if 'interactive' is true. Otherwise 'yy_try_NUL_trans()' would
+ return 0, if the NUL character was the last character of a pattern
+ ( e.g. "x\0" ), and we therefore would not reach the last state.
+ Remark: Change also the comment in FLEX.SKEL for this function.)
+
+ FLEX.SKEL, line 583:
+%% code to find the next state goes here
+
+ GEN.C, line 632ff:
+/* int need_backtracking = (num_backtracking > 0 && ! reject);
+
+ if ( need_backtracking )
+ / * we'll need yy_cp lying around for the gen_backtracking() * /
+ indent_puts( "register YY_CHAR *yy_cp = yy_c_buf_p;" ); */
+
+ GEN.C, line 674ff:
+/* if ( reject )
+ indent_puts( "*yy_state_ptr++ = yy_current_state;" ); */
+
+ do_indent();
+
+/* if ( interactive )
+ printf( "yy_is_jam = (yy_base[yy_current_state] == %d);\n",
+ jambase );
+ else */
+ printf( "yy_is_jam = (yy_current_state == %d);\n", jamstate );
+ }
+
+ /* if we've entered an accepting state, backtrack; note that
+ * compressed tables have *already* done such backtracking, so
+ * we needn't bother with it again
+ */
+/* if ( need_backtracking && (fullspd || fulltbl) )
+ {
+ putchar( '\n' );
+ indent_puts( "if ( ! yy_is_jam )" );
+ indent_up();
+ indent_puts( "{" );
+ gen_backtracking();
+ indent_puts( "}" );
+ indent_down();
+ } */
+ }
+
+GEN.C 1293: (make_tables(): The changed functionality of 'yy_try_NUL_trans()'
+ implies changes in the EOB action. If the next state 'yy_next_state' is 0
+ ( i.e. the jamstate ), you can immediately jump to 'yy_find_action'.
+ Remember that 'yy_cp' was already adjusted to point at the NUL !
+ Also you must not use the backtracking information because the actual
+ state 'yy_current_state' may be an accepting state.
+ If 'yy_next_state' is not the jamstate, we make a transition on the NUL.
+ This requires the following actions:
+ - Create backtracking information for compressed tables *before* we make
+ the transition on NUL.
+ - Now increment 'yy_cp' and set 'yy_current_state' to 'yy_next_state'.
+ ( Note that 'yy_cp' points at the NUL up to now. )
+ - Save the new state on the stack 'yy_state_buf[]' if 'reject' is true.
+ - Create backtracking information *after* the transition, if 'fulltbl'
+ or 'fullspd' is true.
+ - Finally decide, if 'interactive' is true, whether scanning should be
+ resumed at 'yy_match' or whether we have reached a final state and
+ should jump to 'yy_find_action'. (Condition like in 'gen_next_match()'.)
+ If 'interactive' is false, just resume scanning.)
+
+ Corresponding code in FLEX.SKEL beginning at line 381:
+ if ( yy_next_state )
+ {
+ /* consume the NUL */
+%% code to do backtracking for compressed tables and set up yy_cp goes here
+ }
+ else
+ goto yy_find_action;
+
+ Code in GEN.C beginning at line 1293:
+ /* first, deal with backtracking and setting up yy_cp if the scanner
+ * finds that it should JAM on the NUL
+ */
+ skelout();
+ set_indent( 6 );
+
+ if ( ! fulltbl && ! fullspd )
+ gen_backtracking();
+
+ indent_puts( "++yy_cp;" );
+ indent_puts( "yy_current_state = yy_next_state;" );
+
+ if ( reject )
+ indent_puts( "*yy_state_ptr++ = yy_current_state;" );
+
+ if ( fulltbl || fullspd )
+ gen_backtracking();
+
+ if ( interactive )
+ {
+ do_indent();
+ printf( "if ( yy_base[yy_current_state] != %d\n", jambase );
+ indent_up();
+ indent_puts( "|| ( *yy_cp == '\\0'" );
+ indent_puts( "&& yy_cp < &yy_current_buffer->yy_ch_buf[yy_n_chars]" );
+ do_indent();
+ printf( "&& yy_current_state != %d ) )\n", jamstate );
+ indent_puts( "goto yy_match;" );
+ indent_down();
+ indent_puts( "else" );
+ indent_up();
+ indent_puts( "goto yy_find_action;" );
+ indent_down();
+ }
+ else
+ indent_puts( "goto yy_match;" );
+
+/* if ( fullspd || fulltbl )
+ indent_puts( "yy_cp = yy_c_buf_p;" );
+
+ else
+ { / * compressed table * /
+ if ( ! reject && ! interactive )
+ {
+ / * do the guaranteed-needed backtrack to figure out the match * /
+ indent_puts( "yy_cp = yy_last_accepting_cpos;" );
+ indent_puts( "yy_current_state = yy_last_accepting_state;" );
+ }
+ } */
+
+FLEX.SKEL 513: (yy_get_next_buffer(): Here is an error if 'yymore()' is active
+ in the last match (i.e. yy_doing_yy_more == 1 and yy_more_len > 0). Then
+ 'number_to_move' will be (1 + yy_more_len), i.e. the previous character
+ plus the additional characters for using 'yymore()'.)
+
+ if ( number_to_move == 1 + YY_MORE_ADJ )
+ {
+ ret_val = EOB_ACT_END_OF_FILE;
+ yy_current_buffer->yy_eof_status = EOF_DONE;
+ }
+
+ else
+ {
+ ret_val = EOB_ACT_LAST_MATCH;
+ yy_current_buffer->yy_eof_status = EOF_PENDING;
+ }
+ }
+
+GEN.C 1317: (make_tables(): In the generation of 'yy_get_previous_state()' the
+ variable 'yy_bp' must be set to 'yytext + YY_MORE_ADJ' if 'bol_needed' is
+ true. Otherwise 'yy_bp' points eventually at the beginning of the
+ yymore-prefix instead of the current run.)
+
+ if ( bol_needed )
+ indent_puts( "register YY_CHAR *yy_bp = yytext + YY_MORE_ADJ;\n" );
+
+FLEX.SKEL 589ff: (yyunput(): The function 'yyunput()' should be rewritten.
+ First of all the example for 'unput()' in file flexdoc doesn't work:
+ {
+ int i;
+ unput( ')' );
+ for ( i = yyleng - 1; i >= 0; --i )
+ unput( yytext[i] );
+ unput( '(' );
+ }
+ The actual version of 'yyunput()' modifies 'yyleng'. Therefore 'yyleng' is
+ decremented by " unput( ')' ) " and the pattern to be pushed back has lost
+ its last character. To avoid this just copy the 'yytext'-string and
+ 'yyleng' before you call 'unput()'.
+ Another point is that 'yytext' and 'yyleng' could be maintained in a
+ better way. ( Up to now 'yyleng' can become negative ! )
+ I think it's better to say that the pushed back pattern should fulfill
+ the beginning-of-line-condition if and only if the old pattern does
+ ( excluding a possibly existing 'yymore'-prefix ! ).
+ Up to now you have problems if there is a 'yymore'-prefix, because
+ 'yytext' will be corrupted by YY_DO_BEFORE_ACTION. ( This macro sets
+ 'yytext' to 'yy_bp - yy_more_len', but our 'yy_bp' points already at the
+ beginning of the 'yymore'-prefix. )
+
+ My version of 'yyunput()' reduces the 'yytext'-string by 1 for every
+ pushed back character and decrements 'yyleng' until 'yytext' is the empty
+ string. The beginning-of-line-condition is preserved when 'bol_needed' is
+ true. ( Then the character before the current run is copied in front of
+ the pushed back character. ) If there is a 'yymore'-prefix, 'yy_more_len'
+ will be decremented if 'yy_cp' reaches the beginning of the current run.
+
+ Remark: The parameter 'yytext' in " yyunput( c, yytext ) " is not really
+ necessary since 'yytext' is a global variable. You could also set
+ " register YY_CHAR *yy_bp = yytext; " at the beginning of 'yyunput()'.)
+
+ Replace lines 622 - 623 in FLEX.SKEL:
+
+ if ( yy_cp > yy_bp && yy_cp[-1] == '\n' )
+ yy_cp[-2] = '\n';
+
+ by
+
+%% code to adjust yy_bp and yy_more_len goes here
+
+ Add in GEN.C a function 'gen_yyunput()':
+/* generate code to adjust yy_bp and yy_more_len in yyunput
+ */
+
+void gen_yyunput()
+
+ {
+ if ( yymore_used )
+ indent_puts( "yy_bp += YY_MORE_ADJ;\n" );
+
+ if ( bol_needed )
+ indent_puts( "yy_cp[-2] = yy_bp[-1];\n" );
+
+ if ( yymore_used )
+ {
+ indent_puts( "if ( (yy_cp == yy_bp) && YY_MORE_ADJ )" );
+ indent_up();
+ indent_puts( "--yy_more_len;" );
+ indent_down();
+ indent_puts( "else" );
+ indent_up();
+ indent_puts( "--yy_bp;" );
+ indent_down();
+ }
+ else
+ indent_puts( "--yy_bp;" );
+ }
+
+ Finally add in the function 'make_tables()' behind the call of
+ 'gen_NUL_trans()' in line 1328:
+
+ skelout();
+ gen_yyunput();
+
+FLEX.SKEL 642,658: (input(): There is an error in 'input()' if the end of
+ 'yy_current_buffer' is reached and 'yymore' is active. Then
+ 'yy_get_next_buffer()' is called which function assumes that 'yytext'
+ points at the beginning of the 'yymore'-prefix. This function can't
+ recognize the end of the input stream correctly and therefore returns
+ EOB_ACT_LAST_MATCH instead of EOB_ACT_END_OF_FILE. Also if the end of
+ the input file isn't reached yet (EOB_ACT_CONTINUE_SCAN) at least one
+ character will be lost.
+ To avoid this error just turn off 'yy_doing_yy_more'. Then you need
+ not to adjust with YY_MORE_ADJ in lines 667 and 682. However you have to
+ use a function 'gen_input()', because 'yy_doing_yy_more' does not exist
+ if 'yymore_used' is false.
+
+ ( Another solution is to adjust 'yytext':
+ " yytext = yy_c_buf_p - YY_MORE_ADJ; ", line 658. )
+
+ I think the trick with "yy_did_buffer_switch_on_eof" should be done here
+ the same way as in the YY_END_OF_BUFFER action.
+ Finally I removed the variable 'yy_cp' and used 'yy_c_buf_p' instead.)
+
+#ifdef __cplusplus
+static int yyinput()
+#else
+static int input()
+#endif
+
+ {
+ int c;
+
+ *yy_c_buf_p = yy_hold_char; /* yy_cp not needed */
+
+ 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->yy_ch_buf[yy_n_chars] )
+ /* this was really a NUL */
+ *yy_c_buf_p = '\0';
+
+ else
+ { /* need more input */
+%% code to turn off yy_doing_yy_more and yy_more_len goes here
+ yytext = yy_c_buf_p;
+ ++yy_c_buf_p;
+
+ switch ( yy_get_next_buffer() )
+ {
+ case EOB_ACT_END_OF_FILE:
+ {
+ yy_did_buffer_switch_on_eof = 0;
+
+ if ( yywrap() )
+ {
+ yy_c_buf_p = yytext; /* + YY_MORE_ADJ not needed */
+ return ( EOF );
+ }
+ else
+ {
+ if ( ! yy_did_buffer_switch_on_eof )
+ YY_NEW_FILE;
+ }
+
+#ifdef __cplusplus
+ return ( yyinput() );
+#else
+ return ( input() );
+#endif
+ }
+ break;
+
+ case EOB_ACT_CONTINUE_SCAN:
+ yy_c_buf_p = yytext; /* + YY_MORE_ADJ not needed */
+ break;
+
+ case EOB_ACT_LAST_MATCH:
+#ifdef __cplusplus
+ YY_FATAL_ERROR( "unexpected last match in yyinput()" );
+#else
+ YY_FATAL_ERROR( "unexpected last match in input()" );
+#endif
+ }
+ }
+ }
+
+ c = *yy_c_buf_p;
+ yy_hold_char = *++yy_c_buf_p;
+
+ return ( c );
+ }
+
+ Add in GEN.C a function 'gen_input()':
+/* generate code to turn off yy_doing_yy_more and yy_more_len in input
+ */
+
+void gen_input()
+
+ {
+ if ( yymore_used )
+ indent_puts( "yy_doing_yy_more = yy_more_len = 0;" );
+ }
+
+ Finally add in the function 'make_tables()' behind the call of
+ 'gen_yyunput()':
+
+ set_indent( 3 );
+ skelout();
+ gen_input();
+
+PARSE.Y 54: ( 'goal'-rule: If there is no rule in the input file, the end of
+ the prolog is not marked yet, because 'flexscan()' is still in the start
+ condition <SECT2PROLOG> and the rule <SECT2PROLOG><<EOF>> is not done up
+ to now. Therefore mark the end of prolog here, before you add the default
+ rule. I test here on " num_rules == 1 ", because the 'initforrule'-rule
+ increments 'num_rules' before this action is executed.)
+
+ if ( num_rules == 1 )
+ fprintf( temp_action_file, "%%%% end of prolog\n" )
+;
+
+SCAN.L 255: ( '<SECT2PROLOG><<EOF>>'-rule: If there are no rules at all in
+ the input file, then this rule will be executed at the end of
+ 'make_tables()'. At this point 'temp_action_file' was closed for writing
+ and has been reopened for reading. The macro MARK_END_OF_PROLOG will
+ therefore lead to a write-error.
+ To avoid this error add the condition " if ( num_rules == 0 ) ". If this
+ rule is executed at the end of 'make_tables()' there will be at least the
+ default rule, i.e. 'num_rules' will be greater than 0.
+ Remark: This correction together with the one before will allow an input
+ file which just consists of "%%". ( Copy 'stdin' to 'stdout'. ))
+
+<SECT2PROLOG><<EOF>> {
+ if ( num_rules == 0 )
+ MARK_END_OF_PROLOG;
+ yyterminate();
+ }
+
+MISC.C 376: ( flexfatal(): The call of 'flexend( 1 )' will lead to an
+ infinite loop if 'flexfatal()' is called from 'flexend()'. I therefore
+ introduced the flag 'doing_flexend' to prevent 'flexend()' to be called
+ more than once.)
+
+ Replace the function call 'flexend( 1 );' in GEN.C, line 376, by
+ if ( ! doing_flexend )
+ flexend( 1 );
+
+ Set 'doing_flexend' at the beginning of 'flexend()' in MAIN.C, line 195:
+ doing_flexend = true;
+
+ Add in FLEXDEF.H, line 381, the declaration of 'doing_flexend':
+extern int yymore_used, reject, real_reject, continued_action, doing_flexend;
+
+ Add in FLEXDEF.H, line 376, a comment for this variable:
+ * doing_flexend - true if flexend() has been started
+
+ Initialize 'doing_flexend' in 'flexinit()' in MAIN.C, line 401:
+ yymore_used = continued_action = reject = doing_flexend = false;
+
+FLEX.SKEL 94: ( 'YY_INPUT()'-macro: I have problems with 'fileno()' and
+ 'read()'.
+ I used the C Compiler of the BORLAND C++ Compiler and compiled the created
+ scanner with the option 'ANSI keywords'.
+ In this compiler the prototype of the function 'read(...)' is declared in
+ the header file 'io.h' and not in 'stdio.h'. Therefore I get a warning.
+ Real trouble caused 'fileno' which is defined as macro in 'stdio.h':
+ #define fileno(f) ((f)->fd)
+ However this macro does not belong to the 'ANSI keywords' because it is
+ define'd under the condition " #if !__STDC__ ". Therefore I get a warning
+ and a linker error that the function 'fileno()' does not exist.
+ (I can avoid this problem by adding the above define-macro in the *.l file
+ or by replacing the option 'ANSI keywords' by 'Borland C++ keywords'.))
diff --git a/to.do/Wish-List b/to.do/Wish-List
new file mode 100644
index 0000000..2ef20e0
--- /dev/null
+++ b/to.do/Wish-List
@@ -0,0 +1,277 @@
+// Good idea. It might be easier to auto-prefix them instead.
+start conditions given own name space by making them structure fields
+ #define BEGIN(x) yy_start_state = yy_states->x
+
+// Easy.
+yylineno maintained per input buffer
+
+// Done.
+use yyconst instead of const, to fix __STDC__ == 0 problem
+
+// We rely on %option unput instead.
+scan input for unput()
+
+// Not worth the effort.
+-CF/-Cf support interactive scanners
+
+// What does this mean?
+reject_really_used -> maintain_backup_tables
+
+// Would be easier to rewrite it.
+full library encapsulation: flex'ing on the fly
+
+// Currently, max=32k states. Is this an unreasonable limit?
+fix MAX_MNS/MARKER_DIFFERENCE to not be a hard limit
+
+// Not doable, especially for the regex operator precedence case.
+Two flags to warn when something is seen that lex or posix might interpret
+ differently; this should be quite doable as -l already exists. Proposed
+ names: -Wl, -Wp.
+
+// Done.
+reentrant C scanners
+
+// Why not use fseek/lseek ?
+yy_fseek() for positioning in input file
+
+// What does this mean?
+set-able "at beginning of line" , no more unput() trashes yytext?
+
+// Doable.
+yy_unput_string(); unput() shifts yytext to preserve it, grows buffer as needed
+
+// Bleh.
+yy_malloc_type as void* so can be easily switched to char* for poor
+ hopeless bastards running SunSoft stuff?
+
+// Done.
+public "TODO" file, requesting help?
+
+// Done.
+test -P to make sure it's not broken now due to e.g. yy_scan_string
+
+// What does this mean?
+hook for treating input interactively even if not isatty()
+
+// Easy.
+document yy_fill_buffer
+
+// Are these tools even updated anymore?
+lint, gcc-lint
+
+// Obsolete.
+-lfl removed from flex.1
+
+// What does this mean?
+merge 2.4.6, e.g., NEWS
+
+// Is it bothering anyone?
+'|' action copies action instead of omitting break
+
+// Doable.
+if yy_current_buffer defined on entry to yylex(), don't promote nil yyin
+ to stdin, etc.
+
+// Inevitable, but a daunting task.
+multibyte character flex
+
+// Done ("traditional")
+ANSI only
+
+// Obsolete.
+multiple inclusion of <stdlib.h>?
+
+// Put on back burner.
+[=...=] POSIX stuff
+
+// Done.
+yylineno, yycol by checking for whether rules can match embedded newlines,
+ only trailing newlines, always trailing newlines, or no newlines
+
+// Bleh.
+compute transition path to each DFA state, to aid in backtracking
+ for each state, store pointer to predecessor, character for xtion
+
+// Obsolete.
+merge flex.1, flexdoc.1?
+
+// In the works.
+bison++ interface
+
+// What is this supposed to do?
+YYLEXER_NAME
+
+// Moot. C++ will get an overhaul eventually.
+out-line FlexLexer destructors
+
+// What does this mean?
+GNU readline contrib?
+
+// Done.
+isatty() decl?
+
+// I think this is obsolete.
+#ifdef chud for unput() etc. not being used?
+ "../scan.l", line 207: warning: ::yy_did_buffer_switch_on_eof defined but not used
+ cc -c -g scan.c
+ "scan.cc", line 1752: warning: statement not reached
+
+// Done.
+alloca.c removed from Makefile
+
+// Doable.
+// comments
+
+// Done. (%% lines in skel)
+output partitioning for e.g., scanning tables, actions, etc.
+
+// Done.
+texinfo version of manual
+
+// What does this mean?
+example of "error" backtracking rules as opposed to "catch-all"
+
+// What does this mean?
+get rid of get_previous_state via accepting #'s tied to previous state #'s
+
+// Doable.
+-p tells something about backtracking
+
+// Done.
+easy way to scan strings instead of files
+
+// Useful, but tricky.
+input() across buffer boundaries, buffer overflow; unput() fix
+
+// Done.
+start state stack
+
+// I guess this is handled by the set_bol() stuff.
+NLSTATE - sets "in newline" state; also mechanism to clear "in newline" state
+
+// Unreachable rules are flagged. Is this what is meant?
+checks for bogus backtrack rules ... - rule shadowing
+
+// Done.
+document incompatibility with lex when unput()'ing a newline
+ after a newline has been read
+
+// Incorrect. They are allowed.
+document that comments are not allowed on definition lines
+ foo bar /* the "foo" definition ... */
+
+// What does this mean?
+perhaps indented code in section 2 leads to warnings?
+
+// Easy.
+#line directives for code at beginning of scanner routine
+
+// Done.
+nuke %used etc.
+
+// Done.
+hooks for direct access to the buffer, e.g. for flushing it
+
+// Done.
+options in .l file as well as on command line; particularly the rename-prefix
+ option
+
+// Done.
+clarify "eat up * not followed by /" in <comment> example; move it to
+ performance, offer simpler version for start states
+
+// Doable.
+hook for finding out how much text can be safely pushed back
+
+// What does this mean?
+the .backtrack code knows how to identify characters that cause transitions
+ (you wanted this for some clearer error messages for the
+ "default rule can be matched")
+
+// Obsolete.
+yy_switch_to_buffer sets yy_init to 0?
+
+// Excellent idea.
+handy library routines, such as yy_C_comment(), yy_C_string(),
+
+// Done.
+obey #line directives in input; first, get rid of # comments ...
+
+// Done.
+flex.h header for declarations of e.g., yymore(), yytext?
+ but what about %array making the yytext definition out of date?
+
+// What does this mean?
+merge w/ okeeffe code
+
+// Easy.
+rearrange the Performance Considerations section so that the easy
+ fixes come first
+
+// Done.
+copyright notice in manuals?
+
+// Doable.
+input() updates yytext and yyleng; perhaps unput too???;
+ right now it trashes them (doesn't restore '\0')
+
+// No. yyleng should not be modifable.
+document that yyleng can now be modified
+ except if yymore() used?
+
+// Icky.
+anchoring allowed inside ()'s - (^abc|def$)
+
+//
+unput() propagates non-newline state too?
+
+// Not doable. Anchors chars are only special at ends of RE.
+complain about invalid anchoring - foo(^abc), (^abc)+
+
+// Not likely.
+library in its own directory
+
+// Done.
+yylineno
+
+// Why?
+example in flexdoc on YY_INPUT reading from input()
+
+// Not currently doable.
+redesign for retargetability (i.e., use w/ other languages ...)
+
+// ???
+clean up escape expansion
+
+// In progress.
+bison @N
+
+// Done.
+example for doc. on scanning strings w/ escapes in them:
+
+// Done.
+POSIX/
+
+// Done.
+get rid of duplicated code between "re2 re" rule and "re '$'" rule
+
+// Obsolete.
+preformatted man pages for VMS sites, possibly using col -b to get rid
+ of backspaces ...
+
+// Interesting.
+slurp entire input file into mega-buffer; allows pointers to in-place
+ identifiers
+
+// Done.
+lex compatibility flag
+
+// Done.
+update flags in docs
+
+// Done. It's still there.
+-n removed from POSIX?
+
+// Obsolete.
+"MAKE = ..." shouldn't be commented out, or else bigtest can fail
+BSD man macros
diff --git a/to.do/flex.rmail b/to.do/flex.rmail
new file mode 100644
index 0000000..6c7f445
--- /dev/null
+++ b/to.do/flex.rmail
@@ -0,0 +1,4520 @@
+BABYL OPTIONS: -*- rmail -*-
+Version: 5
+Labels:
+Note: This is the header of an rmail file.
+Note: If you are seeing it in rmail,
+Note: it means the file has no messages in it.
+
+1,,
+X-Coding-System: nil
+Mail-from: From vern@daffy.ee.lbl.gov Wed Mar 14 04:01:40 2001
+Return-Path: <vern@daffy.ee.lbl.gov>
+Received: from localhost (localhost [127.0.0.1])
+ by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id EAA09959
+ for <wlestes@localhost>; Wed, 14 Mar 2001 04:01:40 -0500
+Received: from imap.uncg.edu
+ by localhost with IMAP (fetchmail-5.1.0)
+ for wlestes@localhost (single-drop); Wed, 14 Mar 2001 04:01:40 -0500 (EST)
+Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70])
+ by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f2E8pme19617
+ for <wlestes@hermes.email.uncg.edu>; Wed, 14 Mar 2001 03:51:48 -0500 (EST)
+Received: from daffy.ee.lbl.gov (daffy.ee.lbl.gov [131.243.1.31])
+ by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id DAA20394
+ for <wlestes@uncg.edu>; Wed, 14 Mar 2001 03:51:47 -0500 (EST)
+Received: (from vern@localhost)
+ by daffy.ee.lbl.gov (8.10.0/8.10.0) id f2E8pkM07870;
+ Wed, 14 Mar 2001 00:51:46 -0800 (PST)
+Message-Id: <200103140851.f2E8pkM07870@daffy.ee.lbl.gov>
+To: "W. L. Estes" <wlestes@uncg.edu>
+Subject: Re: possibly taking over maintenance of flex
+In-reply-to: Your message of Tue, 13 Mar 2001 09:00:58 EST.
+Date: Wed, 14 Mar 2001 00:51:46 PST
+From: Vern Paxson <vern@ee.lbl.gov>
+
+*** EOOH ***
+To: "W. L. Estes" <wlestes@uncg.edu>
+Subject: Re: possibly taking over maintenance of flex
+In-reply-to: Your message of Tue, 13 Mar 2001 09:00:58 EST.
+Date: Wed, 14 Mar 2001 00:51:46 PST
+From: Vern Paxson <vern@ee.lbl.gov>
+
+> probably best to have a trial period up front as you suggest.
+
+Okay, you can get a copy of the master sources from
+
+ ftp://ftp.ee.lbl.gov/.vp-flex-sources.tar.gz
+
+The TODO/ subdirectory has the general wish list plus a number of contributed
+patches. The faqs/ subdirectory has a bunch of email messages (in MH
+folder format, i.e., one message per file, files numbered sequentially)
+for commonly asked questions - worth taking a look through to see what
+sorts of things people frequently ask about.
+
+Next messages are various stuff I sent to Dick King.
+
+Thanks for giving it a try - naturally, by all means let me know when you
+have questions ...
+
+ Vern
+
+
+1,,
+X-Coding-System: nil
+Mail-from: From vern@daffy.ee.lbl.gov Wed Mar 14 04:01:40 2001
+Return-Path: <vern@daffy.ee.lbl.gov>
+Received: from localhost (localhost [127.0.0.1])
+ by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id EAA09961
+ for <wlestes@localhost>; Wed, 14 Mar 2001 04:01:40 -0500
+Received: from imap.uncg.edu
+ by localhost with IMAP (fetchmail-5.1.0)
+ for wlestes@localhost (single-drop); Wed, 14 Mar 2001 04:01:40 -0500 (EST)
+Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70])
+ by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f2E8ppe19633
+ for <wlestes@hermes.email.uncg.edu>; Wed, 14 Mar 2001 03:51:51 -0500 (EST)
+Received: from daffy.ee.lbl.gov (daffy.ee.lbl.gov [131.243.1.31])
+ by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id DAA20402
+ for <wlestes@uncg.edu>; Wed, 14 Mar 2001 03:51:50 -0500 (EST)
+Received: (from vern@localhost)
+ by daffy.ee.lbl.gov (8.10.0/8.10.0) id f2E8poV07877;
+ Wed, 14 Mar 2001 00:51:50 -0800 (PST)
+Message-Id: <200103140851.f2E8poV07877@daffy.ee.lbl.gov>
+To: wlestes@uncg.edu
+Subject: messages sent to Dick King (1 of 2)
+Date: Wed, 14 Mar 2001 00:51:49 PST
+From: Vern Paxson <vern@ee.lbl.gov>
+
+*** EOOH ***
+To: wlestes@uncg.edu
+Subject: messages sent to Dick King (1 of 2)
+Date: Wed, 14 Mar 2001 00:51:49 PST
+From: Vern Paxson <vern@ee.lbl.gov>
+
+
+------- Forwarded Messages
+
+Date: Mon, 21 Aug 2000 23:03:54 PDT
+From: Vern Paxson <vern>
+Subject: Re: Some new Flex maintainer volunteers
+To: Dick King <king@reasoning.com>
+Cc: bkuhn@ebb.org
+In-reply-to: Your message of Tue, 15 Aug 2000 14:03:58 PDT.
+
+> Vern, i'm ready when you are.
+
+Okay, I've put the master sources in
+
+ ftp://ftp.ee.lbl.gov/.vp-flex-sources.tar.gz
+
+The TODO/ subdirectory has a the general wish list plus a number of
+contributed patches (per the mail I'll be cc'ing you on regarding reentrant
+scanners). The faqs/ subdirectory has a bunch of email messages (in MH
+folder format, i.e., one message per file, files numbered sequentially) for
+commonly asked questions - worth taking a look through to see what sorts of
+things people frequently ask about.
+
+I very much appreciate your taking over maintaining/developing flex, and
+apologize for how long it's taken me to bundle stuff up to give to you (all
+too symptomatic of why I'm no longer able to work on flex :-( ). By all
+means, let me know when you have questions ...
+
+ Vern
+
+------- Message 2
+
+Date: Mon, 21 Aug 2000 23:38:00 PDT
+From: Vern Paxson <vern>
+Subject: Re: I volunteer to modify flex to generate reentrant C code.
+To: "John W. Millaway" <jmillawa@nimbus.ocis.temple.edu>
+Cc: help-flex@gnu.org, king@reasoning.com
+In-reply-to: Your message of Mon, 21 Aug 2000 16:23:18 PDT.
+
+> I'm requesting this feature and at the same time volunteering to implement
+> it:
+
+John Bossom contributed patches a while ago for adding reentrant scanners.
+I never managed to try them out or integrate them (note that I'm no longer
+the flex maintainer/developer, having just transferred the honors to Dick
+King, whom I've cc'd), but I've made them available from:
+
+ ftp://ftp.ee.lbl.gov/.vp-flex-reentrant.tar.gz
+
+I imagine Dick will be interested in hearing of problems/improvements/etc.
+
+ Vern
+
+------- Message 3
+
+Date: Wed, 30 Aug 2000 07:23:07 PDT
+From: Vern Paxson <vern>
+Subject: Re: bug in flex 2.5.4?
+To: Keith McGuigan <keith.mcguigan@ecora.com>
+Cc: king@reasoning.com
+In-reply-to: Your message of Tue, 29 Aug 2000 12:21:02 EDT.
+
+This does indeed sound like a bug. Dick King (cc'd) recently took over
+development & maintenance for flex; I've sent him a copy of your message.
+
+ Vern
+
+------- Message 4
+
+Date: Thu, 31 Aug 2000 15:41:00 PDT
+From: Vern Paxson <vern>
+Subject: Re: Flex
+To: "Skifstrom, Eric" <SKIFSTRE@Mattel.com>
+Cc: king@reasoning.com
+In-reply-to: Your message of Wed, 30 Aug 2000 09:35:58 PDT.
+
+> Thanks for all the work on Flex. It is appreciated. How do I get a copy of
+> flex for Windows 98 platform.
+
+I've only directly support flex for Unix, and have always distributed it
+in source-code form only. So I don't know where you get a copy, though
+I bet with some web surfing you can find one.
+
+Also, please note, Dick King (cc'd) has taken over flex development
+and maintenance.
+
+ Vern
+
+------- Message 5
+
+Date: Thu, 31 Aug 2000 15:43:40 -0700 (PDT)
+From: Dick King <king@reasoning.com>
+Subject: Re: Flex
+To: vern@ee.lbl.gov
+MIME-Version: 1.0
+Content-Type: text/plain; charset=us-ascii
+Content-Transfer-Encoding: 7bit
+In-Reply-To: <200008312241.e7VMf0G14335@daffy.ee.lbl.gov>
+References: <200008312241.e7VMf0G14335@daffy.ee.lbl.gov>
+X-Mailer: VM 6.61 under 19.14 XEmacs Lucid
+
+Vern Paxson writes:
+ >> Thanks for all the work on Flex. It is appreciated. How do I get a copy of
+ >> flex for Windows 98 platform.
+ >
+ >I've only directly support flex for Unix, and have always distributed it
+ >in source-code form only. So I don't know where you get a copy, though
+ >I bet with some web surfing you can find one.
+ >
+ >Also, please note, Dick King (cc'd) has taken over flex development
+ >and maintenance.
+ >
+ > Vern
+ >
+
+I have a couple of how-to-be-a-gnu-product-maintainer questions.
+
+First, how do i get to the wish list? I assume people mail the stuff and it
+accumulates somewhere.
+
+Second, if i decide i have a fix for a group of problems what do i do to get it
+distributed?
+
+- -dk
+
+------- Message 6
+
+Date: Sun, 03 Sep 2000 12:22:48 PDT
+From: Vern Paxson <vern>
+Subject: Re: Flex
+To: Dick King <king@reasoning.com>
+In-reply-to: Your message of Thu, 31 Aug 2000 15:43:40 PDT.
+
+> First, how do i get to the wish list? I assume people mail the stuff and it
+> accumulates somewhere.
+
+There's a honed-down copy in the distribution I put together. I also have
+several hundred email messages, which will be rather tedious to wade through,
+but I can put together for you if you wish (this is non-trivial, though,
+since there's some personal mail intermixed in it which I'll have to locate
+and remove).
+
+> Second, if i decide i have a fix for a group of problems what do i do to get it
+> distributed?
+
+Put together a new release distribution (either a minor version change or
+a major one, depennding on the scope of the changes). Make sure it works
+with "make bigcheck", and make sure you can copy the distribution to a
+virgin machine, unpack it & successfully build it (including "make bigcheck").
+
+Next, make it available somewhere for anonymous ftp and/or Web access.
+(If this is a problem, I can still host the distribution at ftp.ee.lbl.gov.)
+
+Finally, send mail like the appended example. For your first message,
+you should explain that you've taken over development of flex from me.
+It would probably be good to cc me, in case a thread develops from the
+note that it would be helpful to have me contribute to. No need to cc
+me on later notes (though I don't mind, either).
+
+I used to send the note to compilers@iecc.com (the USENET comp.compilers
+group) and info-gnu@prep.ai.mit.edu. I don't know if the former is still
+the correct address - you could find out from the USENET group's archives,
+presumably. The latter has likely changed to info-gnu@gnu.org.
+
+ Vern
+
+
+Date: Tue, 28 Mar 95 11:58:04 PST
+From: Vern Paxson <vern>
+Subject: flex release 2.5.1 now available
+To: compilers@iecc.com, info-gnu@prep.ai.mit.edu
+
+Release 2.5.1 of flex, a POSIX-compliant "lex" scanner generator, is now
+available for anonymous ftp to ftp.ee.lbl.gov. Retrieve flex-2.5.1.tar.Z
+or flex-2.5.1.tar.gz. flex-2.5.1.tar.gz should be showing up shortly at
+the usual GNU mirror sites.
+
+The main changes between 2.5 and 2.4 are:
+
+ - A new concept of "start condition" scope lets you group together
+ rules sharing the same start conditions into a syntactic unit.
+ - Flex now includes a general mechanism for specifying scanner options.
+ - Routines have been added for scanning strings instead of files.
+ - Routines have been added for manipulating stacks of start conditions.
+ - Fledgling support for POSIX character class expressions.
+ - Enhanced portability to MS-DOS, VMS, NT, Macintosh, Amiga.
+ - A number of bugs have been fixed.
+ - input() no longer trashes yytext.
+ - Interactive scanners now run significantly faster.
+ - C++ scanner objects now work with the -P option.
+ - The promised rewrite of the C++ FlexLexer class has not been done,
+ but is still planned.
+
+See the "NEWS" file for more details.
+
+Please report bugs to: vern@ee.lbl.gov or bug-gnu-utils@prep.ai.mit.edu
+
+ Vern
+
+Vern Paxson
+Lawrence Berkeley Laboratory
+vern@ee.lbl.gov
+
+------- Message 7
+
+Date: Wed, 13 Sep 2000 00:59:33 PDT
+From: Vern Paxson <vern>
+Subject: Re: Does the FSF maintain Flex?
+To: "Leanard Lin" <leanard@syntest.com.tw>
+Cc: king@reasoning.com
+In-reply-to: Your message of Wed, 13 Sep 2000 00:55:38 PDT.
+
+> Dear Vern,
+>
+> I have a problem about flex of linux version.
+> If comment is very long, flex will not re-malloc
+> for it.
+> It will display a error message and exit program.
+>
+> Thanks,
+>
+> Leanard
+
+Well, clearly if a comment is larger than the available memory, then flex
+can't realloc to accommodate it. But presumably that's not what's going on
+or you wouldn't have bothered writing; so I don't know what the problem
+might be.
+
+Flex is now developed & maintained by Dick King, king@reasoning.com, whom
+I've cc'd.
+
+ Vern
+
+------- Message 8
+
+Date: Wed, 04 Oct 2000 23:36:59 PDT
+From: Vern Paxson <vern>
+Subject: Re: Flex 2.5.4.1 Bugs
+To: Hans Aberg <haberg@matematik.su.se>
+Cc: king@reasoning.com
+In-reply-to: Your message of Sun, 01 Oct 2000 20:32:48 PDT.
+
+> I made a Metrowerks MacOS CW Pro 5 plugin out of the Flex 2.5.4.1. Here are
+> some bugs:
+>
+> -- flexerror() calls flexend() which becomes an infinite loop in the case
+> of an error in flexend(). So, flexerror(), replace flexend() by exit().
+>
+> -- If there is no output file error, flexend() fails to close the output
+> file. This causes a problem as a plugin, because the file remains locked
+> the next time the compiler runs, and the file cannot be reopened.
+>
+> This bug also occurs if, one first has created the .c file, then runs it
+> with a -S option for a skeleton filet Flex cannot find, in which case
+> flexend() fails to close the output file.
+
+Please note, Dick King (king@reasoning.com) has taken over flex maintenance
+and development. I've cc'd him.
+
+ Vern
+
+------- Message 9
+
+Date: Wed, 04 Oct 2000 23:38:07 PDT
+From: Vern Paxson <vern>
+Subject: Re: flex -+ option and ISO C++ IOStreams
+To: Harri Pasanen <harri.pasanen@trema.com>
+Cc: king@reasoning.com
+In-reply-to: Your message of Mon, 02 Oct 2000 10:15:59 PDT.
+
+> You probably already know this:
+>
+> flex version 2.5.4 generates with -+ flag a forward declaration of class
+> istream.
+> Problem is that it is incompatible with the new ANSI IOStreams. This
+> becomes apparent if I try to use KAI C++ (http://www.kai.com/) to
+> compile the generated scanner.
+>
+> Lexing Scanner.l...
+> Compiling Scanner.o...
+> "/usr/local/KAI/KCC.pu-4.0b-1/KCC_BASE/include/istream.h", line 12:
+> error #101:
+> "istream" has already been declared in the current scope
+> using std::istream;
+>
+> I wonder if an updated version of flex is in the works? In the time
+> being I can compile my own...
+
+Dick King (king@reasoning.com) has recently taken over flex maintenance and
+development (I've cc'd him). Since there will be a fair amount of getting
+up to speed for him, I think building your own version for now is the
+best course.
+
+ Vern
+
+------- Message 10
+
+Date: Thu, 05 Oct 2000 00:27:15 PDT
+From: Vern Paxson <vern>
+Subject: Re: Flex Feature Idea
+To: Davy Durham <david.durham@wcom.com>
+Cc: king@reasoning.com
+In-reply-to: Your message of Thu, 28 Sep 2000 11:28:52 EDT.
+
+> First I just want to say how much flex has been helpful to me in
+> writing my parser, and that I really appreciate the free use of the
+> program...
+
+You're welcome!
+
+Please note, though, that Dick King (cc'd) has taken over flex maintenance
+and development.
+
+> I can't re-write YY_INPUT which could detect and remove the '\' and
+> \n and go ahead and return the _next_ char, because I'm keeping up
+> with the line-number and column-number in YY_USER_ACTION for each
+> token... Since flex buffer's the data retrieved from YY_INPUT, _my_
+> YY_INPUT would need to increment the line-number, but it would happen
+> possibly too soon... Plus I'm using yy_switch_buffer to do macro
+> replacements quite a bit which I think would complicate things even
+> more....
+
+Well, that's how you have to do it, I'm afraid. I can't see any practical
+way to add this as a feature to flex at a later stage in the input analysis,
+since the semantics really are "pretend this slash and this newline don't
+exist (mod line numbers)". What you can probably do for line numbers is
+the following: create a data structure that maps byte offsets in the current
+input stream to line numbers. YY_INPUT would fill this in as it returns
+new (possibly munged) lines, and your actions would consult it in order to
+generate correct location information for error messages. (To deal with
+multiple input buffers, you maintain one data structure per buffer.)
+
+ Vern
+
+------- Message 11
+
+Date: Thu, 05 Oct 2000 01:03:01 PDT
+From: Vern Paxson <vern>
+Subject: Re: [minor] obscure error messages if YY_DECL ends in semicolon
+To: "Eric R. Buddington" <ebuddington@mail.wesleyan.edu>
+Cc: king@reasoning.com
+In-reply-to: Your message of Thu, 14 Sep 2000 13:39:52 EDT.
+
+> Your address was listed in the flex info pages, so I send this to you; if
+> you aren't the currnet maintainer, please let me know.
+
+I'm not longer the maintainer - Dick King (cc'd) has taken over.
+
+> First, I would like to add an '%option reentrant", such that the flex code
+> would have the lexer function as its only global symbol. Would you
+> consider such a patch for inclusion in the official flex?
+
+Someone has already contributed patches for this - you can get them
+from ftp://ftp.ee.lbl.gov/.vp-flex-reentrant.tar.gz .
+
+> Secondly, an erroneous input that might give better error messages:
+>
+> If YY_DECL ends with a semicolon, the generated error messages refer to
+> wrong (nonexistant in this case) line numbers in the source file. The
+> user error is only clear after turning off #line directives and looking at
+> the generated .c file.
+>
+> It would be good to have this error (a fairly easy one to make) reported
+> clearly, if that can be done elegantly. This I what I get now:
+>
+> flex -t -Pcap_string_ cap_string.flex > cap_string.c
+> cc -Wall -c -o cap_string.o cap_string.c
+> cap_string.flex:163: parse error before `{'
+> cap_string.flex:165: register name not specified for `yy_cp'
+> cap_string.flex:165: register name not specified for `yy_bp'
+> cap_string.flex:166: register name not specified for `yy_act'
+> cap_string.flex:39: parse error before `if'
+> ...
+
+I don't offhand see an easy way to fix this, other than scanning the source
+for a YY_DECL definition and looking for a semi-colon (urgh, what a hack).
+Dick will have to toss it onto the to-do list.
+
+ Vern
+
+------- Message 12
+
+Date: Thu, 5 Oct 2000 10:51:53 +0200
+From: Hans Aberg <haberg@matematik.su.se>
+Subject: Re: Flex 2.5.4.1 Bugs
+To: Vern Paxson <vern@ee.lbl.gov>
+Cc: king@reasoning.com
+X-Sender: haberg@pop.matematik.su.se (Unverified)
+In-Reply-To: <200010050636.e956axT12828@daffy.ee.lbl.gov>
+References: Your message of Sun, 01 Oct 2000 20:32:48 PDT.
+Mime-Version: 1.0
+Content-Type: text/plain; charset="us-ascii"
+Status: U
+
+At 23.36 -0700 0-10-04, Vern Paxson wrote:
+>Please note, Dick King (king@reasoning.com) has taken over flex maintenance
+>and development. I've cc'd him.
+
+OK.
+
+To: Dick King
+Bison seems to under revision right now (I'm working hard with the Bison
+development team just these days on pinpointing some bugs). -- Perhaps Flex
+& Bison development should somehow be synchronized.
+
+I have labelled Flex as BSD. Is that correct?
+
+ Hans Aberg
+
+
+
+------- Message 13
+
+Date: Fri, 06 Oct 2000 02:04:11 PDT
+From: Vern Paxson <vern>
+Subject: Re: C++, flex under cygwin and Visual C++
+To: "Simon J. Julier" <sjulier@erols.com>
+Cc: king@reasoning.com
+In-reply-to: Your message of Thu, 05 Oct 2000 07:15:17 PDT.
+
+> Many apologies if either (a) it's a stupid question or (b) if I'm emailing
+> the wrong person.
+
+It's (b) :-). Dick King (king@reasoning.com) has taken over flex
+maintenance and development. I've cc'd him.
+
+> I have been using flex (v. impressive) to write a parser
+> for a C++ program. The program is being compiled using a Windows
+> 2000/Windows NT machine using the cygwin tool set and the Microsoft Visual
+> C++ compiler. Because the cygwin distribution does not include FlexLexer.h,
+> I took the advice from the man page and simply renamed lex.yy.c as
+> lex.yy.cxx and compiled this as a C++ program. This almost works except for
+> the fact that, in C++ compile mode, there is a dependency on unistd.h due
+> to the following code snippet:
+>
+> #ifdef __cplusplus
+>
+> #include <stdlib.h>
+> #include <unistd.h>
+>
+> ... (other stuff) ...
+>
+> Since the Visual C++ compiler does not come with the header file unistd.h,
+> I manually modified the code to:
+>
+> #ifdef __cplusplus
+>
+> #include <stdlib.h>
+> #ifndef _WIN32
+> #include <unistd.h>
+> #endif /* ! _WIN32 */
+>
+> Is this the "right way" to solve the problem?
+
+I imagine it is. This problem has come up a bunch of times, and,
+much as I hate adding #ifdef's to the skeleton, I haven't thought of
+any other way to do it.
+
+> If so, would it be possible
+> to consider making the appropriate changes to flex.skl?
+
+Sounds okay to me, but this is now Dick's call.
+
+ Vern
+
+------- Message 14
+
+Date: Fri, 6 Oct 2000 09:31:08 -0700 (PDT)
+From: Dick King <king@reasoning.com>
+Subject: Re: C++, flex under cygwin and Visual C++
+To: vern@ee.lbl.gov
+Cc: sjulier@erols.com
+MIME-Version: 1.0
+Content-Type: text/plain; charset=us-ascii
+Content-Transfer-Encoding: 7bit
+In-Reply-To: <200010060904.e9694BU17584@daffy.ee.lbl.gov>
+References: <200010060904.e9694BU17584@daffy.ee.lbl.gov>
+X-Mailer: VM 6.61 under 19.14 XEmacs Lucid
+
+
+
+I'm getting my flex support operations organized, finally.
+
+I've established a new eddress, flex@2xtreme.net .
+
+I'll start looking at the small bug fixes flex has been asked for in a week or
+so. Then i will get to meaty changes.
+
+One meaty change i've been asked for which i would like to do [i did it for my
+current company's lexer product so i think i understand the issues] is a
+character level prefilter infrastructure, that would allow you to integrate a
+cpp-style preprocessor [rather than making it a separate pass as is the norm]
+or to write a flex lexer for a language like FORTRAN or COBOL or that language
+i've heard about whose name escapes me where indentation is syntactically
+significant.
+
+Vern Paxson writes:
+ >> Many apologies if either (a) it's a stupid question or (b) if I'm emailing
+ >> the wrong person.
+ >
+ >It's (b) :-). Dick King (king@reasoning.com) has taken over flex
+ >maintenance and development. I've cc'd him.
+ >
+ >> I have been using flex (v. impressive) to write a parser
+ >> for a C++ program. The program is being compiled using a Windows
+ >> 2000/Windows NT machine using the cygwin tool set and the Microsoft Visual
+ >> C++ compiler. Because the cygwin distribution does not include FlexLexer.h,
+ >> I took the advice from the man page and simply renamed lex.yy.c as
+ >> lex.yy.cxx and compiled this as a C++ program. This almost works except for
+ >> the fact that, in C++ compile mode, there is a dependency on unistd.h due
+ >> to the following code snippet:
+ >>
+ >> #ifdef __cplusplus
+ >>
+ >> #include <stdlib.h>
+ >> #include <unistd.h>
+ >>
+ >> ... (other stuff) ...
+ >>
+ >> Since the Visual C++ compiler does not come with the header file unistd.h,
+ >> I manually modified the code to:
+ >>
+ >> #ifdef __cplusplus
+ >>
+ >> #include <stdlib.h>
+ >> #ifndef _WIN32
+ >> #include <unistd.h>
+ >> #endif /* ! _WIN32 */
+ >>
+ >> Is this the "right way" to solve the problem?
+ >
+ >I imagine it is. This problem has come up a bunch of times, and,
+ >much as I hate adding #ifdef's to the skeleton, I haven't thought of
+ >any other way to do it.
+ >
+ >> If so, would it be possible
+ >> to consider making the appropriate changes to flex.skl?
+ >
+ >Sounds okay to me, but this is now Dick's call.
+ >
+ > Vern
+ >
+
+------- Message 15
+
+Date: Sun, 08 Oct 2000 01:19:08 PDT
+From: Vern Paxson <vern>
+Subject: Re: C++, flex under cygwin and Visual C++
+To: Dick King <king@reasoning.com>
+In-reply-to: Your message of Fri, 06 Oct 2000 09:31:08 PDT.
+
+> One meaty change i've been asked for which i would like to do [i did it for my
+> current company's lexer product so i think i understand the issues] is a
+> character level prefilter infrastructure, that would allow you to integrate a
+> cpp-style preprocessor [rather than making it a separate pass as is the norm]
+> or to write a flex lexer for a language like FORTRAN or COBOL or that language
+> i've heard about whose name escapes me where indentation is syntactically
+> significant.
+
+That would be really nice to have!
+
+ Vern
+
+------- Message 16
+
+Date: Mon, 9 Oct 2000 12:27:13 -0400 (EDT)
+From: Andrew Droffner <adroffne@versus.dmz.advance.net>
+Subject: Re: Flex & Multiple Threads
+To: Vern Paxson <vern@ee.lbl.gov>
+Cc: help-flex@gnu.org, king@reasoning.com
+In-Reply-To: <200010050752.e957qGq13639@daffy.ee.lbl.gov>
+MIME-Version: 1.0
+Content-Type: TEXT/PLAIN; charset=US-ASCII
+
+I'm unable to compile the scan.l LEX specification using the bootstrap
+scanner, initscan.c. I have tried it on the latest flex source from GNU,
+and the tarball from your page at ee.lbl.gov.
+
+If I drop the "%option reentrant" from scan.l, then it all compiles. I
+doubt it works right then. What else do I need here, a new initscan.c?
+
+Thanks for the help.
+
+On Thu, 5 Oct 2000, Vern Paxson wrote:
+
+> > I'm interested in building a multi-threaded server using YACC & Lex.
+> > The server & client parse the data they pass to each other.
+> >
+> > The Bison dialect of YACC uses a "%pure_parser" option to force re-entrant
+> > code. I would like a Flex equivalent; is there one already?
+>
+> There are patches to flex to support reentrant scanners, which I've
+> put in ftp://ftp.ee.lbl.gov/.vp-flex-reentrant.tar.gz .
+>
+> Also, please note, flex maintenance has been taken over by Dick King
+> <king@reasoning.com>.
+>
+> Vern
+>
+
+- --
+[ Andrew Droffner
+[ Advance Publications Internet
+[
+[ adroffne@advance.net
+
+
+------- Message 17
+
+Date: Tue, 10 Oct 2000 22:40:12 PDT
+From: Vern Paxson <vern>
+Subject: Re: Flex & Multiple Threads
+To: Andrew Droffner <adroffne@versus.dmz.advance.net>
+Cc: help-flex@gnu.org, king@reasoning.com
+In-reply-to: Your message of Mon, 09 Oct 2000 12:27:13 PDT.
+
+> I'm unable to compile the scan.l LEX specification using the bootstrap
+> scanner, initscan.c. I have tried it on the latest flex source from GNU,
+> and the tarball from your page at ee.lbl.gov.
+>
+> If I drop the "%option reentrant" from scan.l, then it all compiles. I
+> doubt it works right then. What else do I need here, a new initscan.c?
+
+I don't have any firsthand experience with those patches, unfortunately,
+so all I can offer is to try building without the %option reentrant;
+then run flex on scan.l to build a new scan.c; recompile using that;
+run "make check" to make sure it's working okay; then try putting the
+%option reentrant back in. Because I believe the modified scan.l doesn't
+actually need %option reentrant, it's just there to exercise the scanning
+during "make check".
+
+ Vern
+
+------- Message 18
+
+Date: Wed, 11 Oct 2000 11:42:35 PDT
+From: Vern Paxson <vern>
+Subject: Re: Flex & Multiple Threads
+To: Dick King <king@reasoning.com>
+In-reply-to: Your message of Wed, 11 Oct 2000 11:29:49 PDT.
+
+> How do i read help-flex@gnu.org?
+
+Try sending mail to help-flex-request@gnu.org with a message body of
+"subscribe". Let me know if that doesn't work.
+
+ Ven
+
+------- End of Forwarded Messages
+
+
+1,,
+X-Coding-System: nil
+Mail-from: From vern@daffy.ee.lbl.gov Wed Mar 14 04:01:40 2001
+Return-Path: <vern@daffy.ee.lbl.gov>
+Received: from localhost (localhost [127.0.0.1])
+ by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id EAA09964
+ for <wlestes@localhost>; Wed, 14 Mar 2001 04:01:40 -0500
+Received: from imap.uncg.edu
+ by localhost with IMAP (fetchmail-5.1.0)
+ for wlestes@localhost (single-drop); Wed, 14 Mar 2001 04:01:40 -0500 (EST)
+Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70])
+ by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f2E8pse19643
+ for <wlestes@hermes.email.uncg.edu>; Wed, 14 Mar 2001 03:51:54 -0500 (EST)
+Received: from daffy.ee.lbl.gov (daffy.ee.lbl.gov [131.243.1.31])
+ by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id DAA20408
+ for <wlestes@uncg.edu>; Wed, 14 Mar 2001 03:51:53 -0500 (EST)
+Received: (from vern@localhost)
+ by daffy.ee.lbl.gov (8.10.0/8.10.0) id f2E8pqR07884;
+ Wed, 14 Mar 2001 00:51:52 -0800 (PST)
+Message-Id: <200103140851.f2E8pqR07884@daffy.ee.lbl.gov>
+To: wlestes@uncg.edu
+Subject: messages sent to Dick King (2 of 2)
+Date: Wed, 14 Mar 2001 00:51:52 PST
+From: Vern Paxson <vern@ee.lbl.gov>
+
+*** EOOH ***
+To: wlestes@uncg.edu
+Subject: messages sent to Dick King (2 of 2)
+Date: Wed, 14 Mar 2001 00:51:52 PST
+From: Vern Paxson <vern@ee.lbl.gov>
+
+
+------- Forwarded Messages
+
+Date: Sat, 07 Oct 2000 10:31:22 -0700
+From: "Dick King, flex maintainer" <flex@2xtreme.net>
+Subject: Re: the source tree
+To: vern@ee.lbl.gov
+Cc: flex@2xtreme.net
+In-reply-to: <14814.15467.441052.399457@fiddle.mtview.reasoning.com>
+Reply-to: flex@2xtreme.net
+MIME-version: 1.0
+X-Mailer: Forte Agent 1.8/32.548
+Content-type: text/plain; charset=us-ascii
+Content-transfer-encoding: 7bit
+References: <14814.15467.441052.399457@fiddle.mtview.reasoning.com>
+
+On Fri, 6 Oct 2000 13:56:11 -0700 (PDT), you wrote:
+
+> > I think i'm prepared to give this a try.
+>
+> Cool!, thanks. Here's a snapshot of the current source tree. I'm about
+> to leave for two week's vacation, not reading email, but upon my return
+> I'll put together the stuff-to-do email archive, etc.
+>
+> Vern
+>
+
+What is the current release?
+
+You sent me 2.5.4a to my office computer on June 20, but i found 2.5.5a on
+June 20 and downloaded it to my home computer.
+
+- -dk
+
+PS: when anyone writes to you, tell them about my new eddress
+[flex@2xtreme.net]? Thanks.
+
+- -dk
+
+
+------- Message 2
+
+Date: Sun, 08 Oct 2000 01:26:26 PDT
+From: Vern Paxson <vern>
+Subject: Re: a sort of flex-related question :-)
+To: Alan Donovan <alan.donovan@arm.com>
+Cc: flex@2xtreme.net
+In-reply-to: Your message of Thu, 05 Oct 2000 18:49:51 PDT.
+
+> Vern, sorry to write out of the blue like this but I figure that as the
+> maintainer of flex, you could probably answer my question in a second.
+
+I'm actually no longer the maintainer. Dick King has taken over. He's set
+up the address flex@2xtreme.net for flex correspondence. I've cc'd him.
+
+> I'm writing a tool somewhere between flex and yacc, in which you specify
+> a set of rules and actions (as in yacc) but the language is that of
+> regular expressions not context-free grammars.
+>
+> Each rule may include literals, operators, and simpler (i.e. previously
+> declared) rules as components, and have an action. e.g.
+>
+> foo :[0-9]+ { func1(); }
+>
+> bar :"x"foo { func2(); }
+> |"y"foo { func3(); }
+>
+> So the NDFA for "bar" actually contains two copies of the NDFA for
+> "foo". My problem arises when trying to determine where in the DFA
+> (generated by subset construction) to invoke the actions associated with
+> each rule. All my DFA states are annotated as to which rules (if any)
+> they start and which rules (if any) they accept. However this is not
+> enough to correctly invoke the actions.
+>
+> Consider:
+>
+> foo: ab
+> bar: a
+>
+> in the context of some larger expression zip:(foo|bar)"c".
+>
+> The DFA for "zip" looks like:
+>
+> a b c
+> P ---> Q ---> R ---> T
+> |
+> +----> S
+> c
+>
+> P starts rules "foo", "bar" and "zip". Q accepts "bar" and R accepts
+> rule "foo". S and T accept zip.
+>
+> On input "abc", how do you know _not_ to invoke the action for rule
+> "bar" when you reach state Q (or more correctly, when you receive the
+> "b" and move to state R)?
+>
+> So the question is: do you think what I am trying to do is possible?
+
+What you are doing looks like a parse, and you can only parse LR(0)
+languages with DFAs (if I recall correctly), i.e., those without
+lookahead. The above example requires lookahead to differentiate
+matching foo from bar. So I think you're out of luck here, if
+I understand the example correctly.
+
+ Vern
+
+------- Message 3
+
+Date: Sun, 08 Oct 2000 07:47:01 -0700
+From: "Dick King, flex maintainer" <flex@2xtreme.net>
+Subject: Re: a sort of flex-related question :-)
+To: Vern Paxson <vern@ee.lbl.gov>
+Cc: Alan Donovan <alan.donovan@arm.com>
+In-reply-to: <200010080826.e988QQC23650@daffy.ee.lbl.gov>
+Reply-to: flex@2xtreme.net
+MIME-version: 1.0
+X-Mailer: Forte Agent 1.8/32.548
+Content-type: text/plain; charset=us-ascii
+Content-transfer-encoding: 7bit
+References: <200010080826.e988QQC23650@daffy.ee.lbl.gov>
+Status: U
+
+On Sun, 08 Oct 2000 01:26:26 PDT, you wrote:
+
+> > Vern, sorry to write out of the blue like this but I figure that as the
+> > maintainer of flex, you could probably answer my question in a second.
+>
+> I'm actually no longer the maintainer. Dick King has taken over. He's set
+> up the address flex@2xtreme.net for flex correspondence. I've cc'd him.
+>
+> > I'm writing a tool somewhere between flex and yacc, in which you specify
+> > a set of rules and actions (as in yacc) but the language is that of
+> > regular expressions not context-free grammars.
+> >
+> > Each rule may include literals, operators, and simpler (i.e. previously
+> > declared) rules as components, and have an action. e.g.
+> >
+> > foo :[0-9]+ { func1(); }
+> >
+> > bar :"x"foo { func2(); }
+> > |"y"foo { func3(); }
+> >
+> > So the NDFA for "bar" actually contains two copies of the NDFA for
+> > "foo". My problem arises when trying to determine where in the DFA
+> > (generated by subset construction) to invoke the actions associated with
+> > each rule. All my DFA states are annotated as to which rules (if any)
+> > they start and which rules (if any) they accept. However this is not
+> > enough to correctly invoke the actions.
+> >
+> > Consider:
+> >
+> > foo: ab
+> > bar: a
+> >
+> > in the context of some larger expression zip:(foo|bar)"c".
+> >
+> > The DFA for "zip" looks like:
+> >
+> > a b c
+> > P ---> Q ---> R ---> T
+> > |
+> > +----> S
+> > c
+> >
+> > P starts rules "foo", "bar" and "zip". Q accepts "bar" and R accepts
+> > rule "foo". S and T accept zip.
+> >
+> > On input "abc", how do you know _not_ to invoke the action for rule
+> > "bar" when you reach state Q (or more correctly, when you receive the
+> > "b" and move to state R)?
+> >
+> > So the question is: do you think what I am trying to do is possible?
+>
+> What you are doing looks like a parse, and you can only parse LR(0)
+> languages with DFAs (if I recall correctly), i.e., those without
+> lookahead. The above example requires lookahead to differentiate
+> matching foo from bar. So I think you're out of luck here, if
+> I understand the example correctly.
+>
+> Vern
+
+Vern is mostly correct. Small extensions can give you a single token
+[character, here] lookahead but that is not enough to deliver the
+functionality you want. Consider
+
+foo: a { foo_fn(); }
+bar: ab { bar_fn(); }
+
+mumble: foo bcde.....yZ { any }
+ | bar cde.....yW { any }
+
+- -dk
+
+
+------- Message 4
+
+Date: Tue, 10 Oct 2000 02:36:57 PDT
+From: Vern Paxson <vern>
+Subject: Re: Bison's semantic parsers
+To: Akim Demaille <akim@epita.fr>
+Cc: Hans Aberg <haberg@matematik.su.se>,
+ Davy Durham <david.durham@wcom.com>, Bison Help <help-bison@gnu.org>,
+ flex@2xtreme.net
+In-reply-to: Your message of 10 Oct 2000 11:43:07 PDT.
+
+> Nope, indeed Vern seems also to say he won't work on Flex again.
+
+Unfortunately, yes.
+
+> Vern, could we imagine that Flex be put on the CVS server of the FSF,
+> subversions.gnu.org?
+
+Thank you very much for the offer, I certainly appreciate it. However,
+Dick King has already volunteered to take over maitenance and development.
+I've cc'd the address he's using for flex-related mail, flex@2xtreme.net.
+
+ Vern
+
+------- Message 5
+
+Date: Tue, 10 Oct 2000 13:30:02 +0200
+From: Hans Aberg <haberg@matematik.su.se>
+Subject: Re: Bison's semantic parsers
+To: Vern Paxson <vern@ee.lbl.gov>
+Cc: Akim Demaille <akim@epita.fr>, Davy Durham <david.durham@wcom.com>,
+ Bison Help <help-bison@gnu.org>, flex@2xtreme.net
+X-Sender: haberg@pop.matematik.su.se
+In-Reply-To: <200010100936.e9A9avg01250@daffy.ee.lbl.gov>
+References: Your message of 10 Oct 2000 11:43:07 PDT.
+Mime-Version: 1.0
+Content-Type: text/plain; charset="us-ascii"
+Status: U
+
+At 02.36 -0700 0-10-10, Vern Paxson wrote:
+>> Vern, could we imagine that Flex be put on the CVS server of the FSF,
+>> subversions.gnu.org?
+>
+>Thank you very much for the offer, I certainly appreciate it. However,
+>Dick King has already volunteered to take over maitenance and development.
+>I've cc'd the address he's using for flex-related mail, flex@2xtreme.net.
+
+At 11.43 +0200 0-10-10, Akim Demaille wrote:
+>Hans> Perhaps Bison and Flex should be bundled, or tuned up together.
+>
+>It's a good but bad idea. For instance you could also argue that
+>Autoconf, Automake and Libtool be merged, but if you just observe that
+>they have totally different evolutions, it becomes infeasible. While
+>definitely a seducing idea, it wouldn't work IMHO.
+
+My experimenting with C++ though suggests that Bison and Flex needs some
+synchronizing if one should take full advantage of that language:
+
+- -- One thing that come to my mind is that instead of letting the Bison
+output .cc file include the Flex .cc file, they communicate the information
+via header files.
+
+- -- When experimenting C++ manipulator style I mentioned before
+ Parser parser;
+ parser_value val;
+ ifstream ifs("...", ios_base::in | ios_base::binary);
+ ofstream ofs("...");
+ if (ifs) try { for (;;) {
+ ifs >> parser >> val;
+ cout << val << endl;
+ }
+I experience problems with how Flex resets its state, and how streams and
+such are initialized.
+
+For example, if I try to gobble up UNIX, MacOS & DOS line separators in Flex by
+ \n|\r|\r\n { return '\n'; }
+then, when Flex sees a \r it must first look ahead to verify the next
+character isn't a \n. However, if a successful value "val" is produced,
+then the next time one ends up at the line ifs >> parser >> val, Flex is
+reset, and as a consequence, the extra character needed to the \n check is
+gobbled up.
+
+One can get around this by not allowing this ifs >> parser >> val
+construct, then the advantage of freer, and therefore easier user syntaxes
+are lost.
+
+- -- I think that there might be some other issues, such as how to properly
+localize all data that Bison and Flex uses, and how they should communicate
+that. These are more questions of hand-shaking than bundling them together
+as a single program.
+
+As for the comparisons of Bison and Flex versus other types of
+compiler-compilers, I think the main disadvantage with them (the former) is
+that they are extremely difficult to debug. It's rather hopeless trying to
+debug the C/C++ files they produce as output. If one could hook up an
+debugger though, so that one could step throw the .l/.y source files, just
+as in the case of visual debugging of a C/C++ file, then this would change,
+and it would not make any difference of what method is used, as long as it
+is efficient and does the job.
+
+ Hans Aberg
+
+
+
+------- Message 6
+
+Date: 10 Oct 2000 13:51:33 +0200
+From: Akim Demaille <akim@epita.fr>
+Subject: Re: Bison's semantic parsers
+To: Vern Paxson <vern@ee.lbl.gov>
+Cc: Hans Aberg <haberg@matematik.su.se>, Davy Durham <david.durham@wcom.com>,
+ Bison Help <help-bison@gnu.org>, flex@2xtreme.net,
+ Didier Verna <didier@epita.fr>
+References: <200010100936.e9A9avg01250@daffy.ee.lbl.gov>
+In-Reply-To: Vern Paxson's message of "Tue, 10 Oct 2000 02:36:57 PDT"
+Lines: 27
+User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=us-ascii
+Status: U
+
+>>>>> "Vern" == Vern Paxson <vern@ee.lbl.gov> writes:
+
+>> Nope, indeed Vern seems also to say he won't work on Flex again.
+
+Vern> Unfortunately, yes.
+
+Just by curiosity: you're no longer interested, or you don't have time
+enough?
+
+>> Vern, could we imagine that Flex be put on the CVS server of the
+>> FSF, subversions.gnu.org?
+
+Vern> Thank you very much for the offer, I certainly appreciate it.
+
+I'm also quite pleased to see my offer pleased you so much :)
+
+Vern> However, Dick King has already volunteered to take over
+Vern> maitenance and development. I've cc'd the address he's using
+Vern> for flex-related mail, flex@2xtreme.net.
+
+Thanks!
+
+Then, I shall restate my question for flex@2xtreme: is there a CVS
+server or something which would make it possible to participate the
+development of Flex?
+
+ Akim
+
+------- Message 7
+
+Date: Tue, 10 Oct 2000 14:15:53 PDT
+From: Vern Paxson <vern>
+Subject: Re: Bison's semantic parsers
+To: Akim Demaille <akim@epita.fr>
+Cc: Hans Aberg <haberg@matematik.su.se>,
+ Davy Durham <david.durham@wcom.com>, Bison Help <help-bison@gnu.org>,
+ flex@2xtreme.net, Didier Verna <didier@epita.fr>
+In-reply-to: Your message of 10 Oct 2000 13:51:33 PDT.
+
+> Just by curiosity: you're no longer interested, or you don't have time
+> enough?
+
+No time ...
+
+ Vern
+
+------- Message 8
+
+Date: Thu, 12 Oct 2000 20:07:57 PDT
+From: Vern Paxson <vern>
+Subject: Re: Flex 2.5.4 Bug
+To: Cliff Sarginson <csarginson@descartes.com>
+Cc: flex@2xtreme.net
+In-reply-to: Your message of Thu, 12 Oct 2000 13:52:06 +0200.
+
+> I dont know if you still receive bug reports about flex ..
+
+I'm not, Dick King (cc'd) has taken over maintenance & development.
+
+> but here is one.. !
+>
+> In a scanner we have ..
+>
+> %start this that msg another
+>
+> The field "msg" gets turned into a
+>
+> #define msg 3
+>
+> We do not define a xxx_YY_FATAL_ERROR
+>
+> So flex supplies one, as a macro, with a definition:
+>
+> xxx_yy_fatal_error (const msg [])
+>
+> The "C" pre-processor merrily turns this into
+>
+> xx_yy_fatal_error ( const 3 [] )
+>
+> Are we really the first to come across this ? Flex should maybe
+> be a bit more creative with it's paramater naming for macro's
+> or do some other name space checking maybe ?
+
+Yep, this is a known problem. The difficulty is that when lex was
+originally designed, it allowed you to switch start states using
+"BEGIN msg" rather than "BEGIN(msg)". This means that either you
+do a major analysis of the source to only patch up true BEGIN's
+(rather than, say, one that occurs inside a string literal); or you
+use a gross hack in defining BEGIN, like flex does:
+
+ #define BEGIN yy_start = 1 + 2 *
+
+With this sort of definition, there's no way to modify the namespace
+consumed by start states. If instead you could require the ()'s, then
+you could use
+
+ #define BEGIN(state) yy_start = 1 + 2 * (YY_STATE_ ## state)
+
+and all would be happy ...
+
+ Vern
+
+------- Message 9
+
+Date: Thu, 12 Oct 2000 20:08:03 PDT
+From: Vern Paxson <vern>
+Subject: Re: a sort of flex-related question :-)
+To: Alan.Donovan@arm.com
+Cc: flex@2xtreme.net
+In-reply-to: Your message of Thu, 12 Oct 2000 15:36:38 BST.
+
+> Thank you both for your help. I can probably rearrange my grammars to be
+> LR(0). Can you give me a reference for the algorithm for LR(0) parsing with
+> a DFA?
+
+Dunno off hand, but I imagine it must be in the Dragon Book.
+
+ Vern
+
+------- Message 10
+
+Date: Thu, 02 Nov 2000 11:56:35 PST
+From: Vern Paxson <vern>
+Subject: Re: flex documentation enhancement request
+To: Tracy Camp <campt@thalvors.miralink.com>
+Cc: flex@2xtreme.net
+In-reply-to: Your message of Thu, 02 Nov 2000 10:17:17 PST.
+
+Yes, a lot of people get bitten by this, unfortunately.
+
+Note, Dick King has taken over flex maintenance and development, and has
+set up the address flex@2xtreme.net for flex correspondence. I've cc'd him.
+
+ Vern
+
+
+> As a new user to flex I found the following situation quite confusing and
+> think a breif caviate note in the manual would have helped out (or at
+> least an emphisis if there was one) :)
+>
+> when using external variables when patching a pattern such as:
+>
+> %x buffer_dev
+> %{
+> extern struct mystruct astruct; /* struct containing member buffer_dev */
+> %}
+> %%
+> buffer_dev= BEGIN(buffer_dev);
+>
+> <buffer_dev>.*$ {
+> strncpy(astruct.buffer_dev,yytext,255);
+> }
+> %%
+>
+> this causes all sorts of problems because 'buffer_dev' is defined by flex
+> at some point and I used buffer_dev as a member of an external structure
+> that I'm trying to fill in with flex. This causes all sorts of compile
+> problems. Renaming my 'buffer_dev' condition to something else works
+> around this, but it was not immediately obvious what the problem was from
+> the compile error. For all else I found your manual to be of GREAT help -
+> thanks!
+>
+> t.
+>
+> Tracy Camp
+> Product Development
+> Miralink Corp.PDX
+> Portland OR
+> 503-223-3140
+>
+
+------- Message 11
+
+Date: Thu, 09 Nov 2000 23:03:38 PST
+From: Vern Paxson <vern>
+Subject: Re: Standard C++ compatibility for flex++
+To: Volker Simonis <simonis@informatik.uni-tuebingen.de>
+Cc: help-flex@gnu.org, flex@2xtreme.net
+In-reply-to: Your message of Wed, 08 Nov 2000 15:50:36 +0100.
+
+> Is there any chance for a new release of flex? Is there a maintainer right now?
+> Is it possible to submit some bug-fixes or to contribute in some way?
+
+Dick King has taken over flex development and maintenance. You can
+reach him at flex@2xtreme.net (cc'd).
+
+ Vern
+
+------- Message 12
+
+Date: Wed, 14 Feb 2001 12:57:37 PST
+From: Vern Paxson <vern>
+Subject: Re: Bug#84780: Fix for info documentation (fwd)
+To: Santiago Vila <sanvila@unex.es>
+Cc: Gordon Sadler <gbsadler1@lcisp.com>, flex@2xtreme.net
+In-reply-to: Your message of Wed, 14 Feb 2001 15:40:30 PST.
+
+Please note, Dick King has taken over flex maintenance and development,
+and has set up the address flex@2xtreme.net for flex correspondence.
+
+ Vern
+
+
+> Hello.
+>
+> I received this from the Debian Bug System.
+>
+> ---------- Forwarded message ----------
+> Date: Sun, 4 Feb 2001 02:41:30 -0600
+> From: Gordon Sadler <gbsadler1@lcisp.com>
+> To: Debian Bug Tracking System <submit@bugs.debian.org>
+> Subject: #84780: Fix for info documentation
+>
+> Package: flex
+> Version: 2.5.4a-9
+> Severity: wishlist
+>
+> Attached find a diff to MISC/texinfo/flex.texi
+> I noticed during the texi2html run it complains of first section not
+> being toplevel. I opened the texi file and changed the toplevel
+> sections to chapters. While I was there noticed the comment about
+> fixing all of the See... to make them @xref, so I did.
+>
+> Looks like upstream is pretty much done ... but you seem to be in
+> touch, last changelog mentions manpage patch from author?
+>
+> If you use this texi to regen the info the x-refs make it a little more
+> useable. Maybe I'll add the index in next -)
+>
+> Gordon Sadler
+> ------------------------------------------------------------------------
+> This is the patch in unified format:
+>
+> diff -r -u flex-2.5.4.orig/MISC/texinfo/flex.texi flex-2.5.4/MISC/texinfo/flex.texi
+> --- flex-2.5.4.orig/MISC/texinfo/flex.texi Sun Jul 27 04:47:21 1997
+> +++ flex-2.5.4/MISC/texinfo/flex.texi Wed Feb 14 15:34:49 2001
+> @@ -151,12 +151,12 @@
+> @end ifinfo
+>
+> @node Name, Synopsis, Top, Top
+> -@section Name
+> +@chapter Name
+>
+> flex - fast lexical analyzer generator
+>
+> @node Synopsis, Overview, Name, Top
+> -@section Synopsis
+> +@chapter Synopsis
+>
+> @example
+> flex [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -ooutput -Pprefix -Sskeleton]
+> @@ -164,7 +164,7 @@
+> @end example
+>
+> @node Overview, Description, Synopsis, Top
+> -@section Overview
+> +@chapter Overview
+>
+> This manual describes @code{flex}, a tool for generating programs
+> that perform pattern-matching on text. The manual
+> @@ -244,7 +244,7 @@
+> @end table
+>
+> @node Description, Examples, Overview, Top
+> -@section Description
+> +@chapter Description
+>
+> @code{flex} is a tool for generating @dfn{scanners}: programs which
+> recognized lexical patterns in text. @code{flex} reads the given
+> @@ -260,7 +260,7 @@
+> corresponding C code.
+>
+> @node Examples, Format, Description, Top
+> -@section Some simple examples
+> +@chapter Some simple examples
+>
+> First some simple examples to get the flavor of how one
+> uses @code{flex}. The following @code{flex} input specifies a scanner
+> @@ -371,7 +371,7 @@
+> following sections.
+>
+> @node Format, Patterns, Examples, Top
+> -@section Format of the input file
+> +@chapter Format of the input file
+>
+> The @code{flex} input file consists of three sections, separated
+> by a line with just @samp{%%} in it:
+> @@ -439,7 +439,7 @@
+> where the pattern must be unindented and the action must
+> begin on the same line.
+>
+> -See below for a further description of patterns and
+> +@xref{Patterns}, for a further description of patterns and
+> actions.
+>
+> Finally, the user code section is simply copied to
+> @@ -468,7 +468,7 @@
+> is also copied verbatim to the output up to the next "*/".
+>
+> @node Patterns, Matching, Format, Top
+> -@section Patterns
+> +@chapter Patterns
+>
+> The patterns in the input are written using an extended
+> set of regular expressions. These are:
+> @@ -697,7 +697,7 @@
+> @end itemize
+>
+> @node Matching, Actions, Patterns, Top
+> -@section How the input is matched
+> +@chapter 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
+> @@ -773,7 +773,7 @@
+> classes (the @code{c++} option; see below).
+>
+> @node Actions, Generated scanner, Matching, Top
+> -@section Actions
+> +@chapter Actions
+>
+> Each pattern in a rule has a corresponding action, which
+> can be any arbitrary C statement. The pattern ends at the
+> @@ -1035,7 +1035,7 @@
+> @end itemize
+>
+> @node Generated scanner, Start conditions, Actions, Top
+> -@section The generated scanner
+> +@chapter The generated scanner
+>
+> The output of @code{flex} is the file @file{lex.yy.c}, which contains
+> the scanning routine @samp{yylex()}, a number of tables used by
+> @@ -1136,15 +1136,15 @@
+>
+> Three routines are available for scanning from in-memory
+> buffers rather than files: @samp{yy_scan_string()},
+> -@samp{yy_scan_bytes()}, and @samp{yy_scan_buffer()}. See the discussion
+> -of them below in the section Multiple Input Buffers.
+> +@samp{yy_scan_bytes()}, and @samp{yy_scan_buffer()}.
+> +@xref{Multiple buffers, ,Multiple Input Buffers}.
+>
+> The scanner writes its @samp{ECHO} output to the @code{yyout} global
+> (default, stdout), which may be redefined by the user
+> simply by assigning it to some other @code{FILE} pointer.
+>
+> @node Start conditions, Multiple buffers, Generated scanner, Top
+> -@section Start conditions
+> +@chapter Start conditions
+>
+> @code{flex} provides a mechanism for conditionally activating
+> rules. Any rule whose pattern is prefixed with "<sc>"
+> @@ -1500,7 +1500,7 @@
+> @samp{%option stack} directive (see Options below).
+>
+> @node Multiple buffers, End-of-file rules, Start conditions, Top
+> -@section Multiple input buffers
+> +@chapter Multiple input buffers
+>
+> Some scanners (such as those which support "include"
+> files) require reading from several input streams. As
+> @@ -1675,7 +1675,7 @@
+> @end table
+>
+> @node End-of-file rules, Miscellaneous, Multiple buffers, Top
+> -@section End-of-file rules
+> +@chapter End-of-file rules
+>
+> The special rule "<<EOF>>" indicates actions which are to
+> be taken when an end-of-file is encountered and yywrap()
+> @@ -1735,7 +1735,7 @@
+> @end example
+>
+> @node Miscellaneous, User variables, End-of-file rules, Top
+> -@section Miscellaneous macros
+> +@chapter Miscellaneous macros
+>
+> The macro @code{YY_USER_ACTION} can be defined to provide an
+> action which is always executed prior to the matched
+> @@ -1800,7 +1800,7 @@
+> the @code{YY_BREAK} is inaccessible.
+>
+> @node User variables, YACC interface, Miscellaneous, Top
+> -@section Values available to the user
+> +@chapter Values available to the user
+>
+> This section summarizes the various values available to
+> the user in the rule actions.
+> @@ -1865,7 +1865,7 @@
+> @end itemize
+>
+> @node YACC interface, Options, User variables, Top
+> -@section Interfacing with @code{yacc}
+> +@chapter Interfacing with @code{yacc}
+>
+> One of the main uses of @code{flex} is as a companion to the @code{yacc}
+> parser-generator. @code{yacc} parsers expect to call a routine
+> @@ -1890,7 +1890,7 @@
+> @end example
+>
+> @node Options, Performance, YACC interface, Top
+> -@section Options
+> +@chapter Options
+> @code{flex} has the following options:
+>
+> @table @samp
+> @@ -1903,8 +1903,8 @@
+> and @samp{-Cf} or @samp{-CF} is used, the generated scanner will
+> run faster (see the @samp{-p} flag). Only users who wish
+> to squeeze every last cycle out of their scanners
+> -need worry about this option. (See the section on
+> -Performance Considerations below.)
+> +need worry about this option. (@pxref{Performance, ,
+> +Performance Considerations})
+>
+> @item -c
+> is a do-nothing, deprecated option included for
+> @@ -2138,8 +2138,7 @@
+>
+> @item -+
+> specifies that you want flex to generate a C++
+> -scanner class. See the section on Generating C++
+> -Scanners below for details.
+> +scanner class. @xref{C++, ,Generating C++ Scanners}.
+>
+> @item -C[aefFmr]
+> controls the degree of table compression and, more
+> @@ -2419,8 +2418,7 @@
+> function @samp{foo::yylex()} instead of @samp{yyFlexLexer::yylex()}.
+> It also generates a @samp{yyFlexLexer::yylex()} member function that
+> emits a run-time error (by invoking @samp{yyFlexLexer::LexerError()})
+> -if called. See Generating C++ Scanners, below, for additional
+> -information.
+> +if called. @xref{C++, ,Generating C++ Scanners}.
+>
+> A number of options are available for lint purists who
+> want to suppress the appearance of unneeded routines in
+> @@ -2439,7 +2437,7 @@
+> unless you use @samp{%option stack}).
+>
+> @node Performance, C++, Options, Top
+> -@section Performance considerations
+> +@chapter Performance considerations
+>
+> The main design goal of @code{flex} is that it generate
+> high-performance scanners. It has been optimized for dealing
+> @@ -2756,7 +2754,7 @@
+> the two is at about 8K characters/token.
+>
+> @node C++, Incompatibilities, Performance, Top
+> -@section Generating C++ scanners
+> +@chapter Generating C++ scanners
+>
+> @code{flex} provides two different ways to generate scanners for
+> use with C++. The first way is to simply compile a
+> @@ -2975,7 +2973,7 @@
+> releases.
+>
+> @node Incompatibilities, Diagnostics, C++, Top
+> -@section Incompatibilities with @code{lex} and POSIX
+> +@chapter Incompatibilities with @code{lex} and POSIX
+>
+> @code{flex} is a rewrite of the AT&T Unix @code{lex} tool (the two
+> implementations do not share any code, though), with some
+> @@ -3051,8 +3049,8 @@
+>
+> Also note that flex C++ scanner classes @emph{are}
+> reentrant, so if using C++ is an option for you, you
+> -should use them instead. See "Generating C++
+> -Scanners" above for details.
+> +should use them instead. @xref{C++, ,Generating C++
+> +Scanners}.
+>
+> @item
+> @samp{output()} is not supported. Output from the @samp{ECHO}
+> @@ -3198,7 +3196,7 @@
+> line.
+>
+> @node Diagnostics, Files, Incompatibilities, Top
+> -@section Diagnostics
+> +@chapter Diagnostics
+>
+> @table @samp
+> @item warning, rule cannot be matched
+> @@ -3251,8 +3249,7 @@
+> scanner specification includes recognizing the 8-bit
+> character @var{x} and you did not specify the -8 flag, and your
+> scanner defaulted to 7-bit because you used the @samp{-Cf} or @samp{-CF}
+> -table compression options. See the discussion of the @samp{-7}
+> -flag for details.
+> +table compression options. @xref{Options, ,@samp{-7}flag}.
+>
+> @item flex scanner push-back overflow
+> you used @samp{unput()} to push
+> @@ -3285,7 +3282,7 @@
+> @end table
+>
+> @node Files, Deficiencies, Diagnostics, Top
+> -@section Files
+> +@chapter Files
+>
+> @table @file
+> @item -lfl
+> @@ -3311,7 +3308,7 @@
+> @end table
+>
+> @node Deficiencies, See also, Files, Top
+> -@section Deficiencies / Bugs
+> +@chapter Deficiencies / Bugs
+>
+> Some trailing context patterns cannot be properly matched
+> and generate warning messages ("dangerous trailing
+> @@ -3365,7 +3362,7 @@
+> The @code{flex} internal algorithms need documentation.
+>
+> @node See also, Author, Deficiencies, Top
+> -@section See also
+> +@chapter See also
+>
+> @code{lex}(1), @code{yacc}(1), @code{sed}(1), @code{awk}(1).
+>
+> @@ -3380,7 +3377,7 @@
+> (deterministic finite automata).
+>
+> @node Author, , See also, Top
+> -@section Author
+> +@chapter Author
+>
+> Vern Paxson, with the help of many ideas and much inspiration from
+> Van Jacobson. Original version by Jef Poskanzer. The fast table
+>
+
+------- End of Forwarded Messages
+
+
+1, answered,,
+X-Coding-System: nil
+Mail-from: From vern@daffy.ee.lbl.gov Mon Mar 26 18:48:05 2001
+Return-Path: <vern@daffy.ee.lbl.gov>
+Received: from localhost (localhost [127.0.0.1])
+ by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id SAA00754
+ for <wlestes@localhost>; Mon, 26 Mar 2001 18:48:05 -0500
+Received: from imap.uncg.edu
+ by localhost with IMAP (fetchmail-5.1.0)
+ for wlestes@localhost (single-drop); Mon, 26 Mar 2001 18:48:05 -0500 (EST)
+Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70])
+ by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f2QNVUe03862
+ for <wlestes@hermes.email.uncg.edu>; Mon, 26 Mar 2001 18:31:30 -0500 (EST)
+Received: from daffy.ee.lbl.gov (daffy.ee.lbl.gov [131.243.1.31])
+ by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id SAA18856
+ for <wlestes@uncg.edu>; Mon, 26 Mar 2001 18:31:28 -0500 (EST)
+Received: (from vern@localhost)
+ by daffy.ee.lbl.gov (8.10.0/8.10.0) id f2QNVPc23647;
+ Mon, 26 Mar 2001 15:31:25 -0800 (PST)
+Message-Id: <200103262331.f2QNVPc23647@daffy.ee.lbl.gov>
+To: wlestes@uncg.edu
+Subject: Fwd: release 2.5 of flex...
+Date: Mon, 26 Mar 2001 15:31:25 PST
+From: Vern Paxson <vern@ee.lbl.gov>
+
+*** EOOH ***
+To: wlestes@uncg.edu
+Subject: Fwd: release 2.5 of flex...
+Date: Mon, 26 Mar 2001 15:31:25 PST
+From: Vern Paxson <vern@ee.lbl.gov>
+
+(Any luck finding some flex cycles?)
+
+------- Forwarded Message
+
+Date: Mon, 26 Mar 2001 00:06:31 +0200
+From: Kai Hennig <khennig@pobox.com>
+Subject: release 2.5 of flex...
+To: vern@ee.lbl.gov
+X-Spam-Filter: check_local@studserv.stud.uni-hannover.de by digitalanswers.org
+Reply-To: khennig@pobox.com
+Organization: TRI Systems
+X-Mailer: Mozilla 4.76 (Macintosh; U; PPC)
+X-Accept-Language: en
+MIME-Version: 1.0
+Content-Type: text/plain; charset=iso-8859-1
+Content-Transfer-Encoding: 8bit
+
+> Extract from file 'INSTALL' from flex-2.5.4
+>
+> ...
+> If you need to do unusual things to compile the package, we encourage
+> you to figure out how `configure' could check whether to do them, and
+> mail diffs or instructions to the address given in the README so we
+> can include them in the next release.
+> ...
+
+Hi Vern,
+
+I'm using your flex package 2.5.4 on a Macintosh with Apple's Macintosh
+Programmers Workshop 3.5 (MPW). There is a description comming along
+with your package for the THINK C version 6.0 from Scott Hofmann
+(23-JUL-94) which is not helpfull for using the package with MPW. I
+enclosed a brief instruction for using the flex package with MPW which
+might be more helpfull since Think C is no longer officially available
+(as far as I know).
+
+greetings,
+Kai
+
+
+
+
+Notes on the MPW 3.5 version of Flex 2.5.4
+Kai Hennig 25-Mar-2001
+Internet: khennig@pobox.com
+
+To compile and run Flex 2.5.4 as an MPW Tool no changes to any file have
+to be done. Instead add a file called 'config.h' to the files listed in
+the command lines given below with the content listed below the
+commands. To compile and link all necessary files execute the following
+commands in the MPW shell:
+
+MrC -noMapCR -alloca -ansi strict main.c
+MrC -noMapCR -alloca -ansi strict ccl.c
+MrC -noMapCR -alloca -ansi strict dfa.c
+MrC -noMapCR -alloca -ansi strict ecs.c
+MrC -noMapCR -alloca -ansi strict gen.c
+MrC -noMapCR -alloca -ansi strict misc.c
+MrC -noMapCR -alloca -ansi strict nfa.c
+MrC -noMapCR -alloca -ansi strict -w off parse.c
+MrC -noMapCR -alloca -ansi strict initscan.c
+MrC -noMapCR -alloca -ansi strict tblcmp.c
+MrC -noMapCR -alloca -ansi strict sym.c
+MrC -noMapCR -alloca -ansi strict skel.c
+MrC -noMapCR -alloca -ansi strict yylex.c
+PPCLink -t 'MPST' -c 'MPS ' -o flex *
+main.c.o *
+ccl.c.o *
+dfa.c.o *
+ecs.c.o *
+gen.c.o *
+misc.c.o *
+nfa.c.o *
+parse.c.o *
+initscan.c.o *
+tblcmp.c.o *
+sym.c.o *
+skel.c.o *
+yylex.c.o *
+"{SharedLibraries}InterfaceLib" *
+"{SharedLibraries}StdCLib" *
+"{SharedLibraries}MathLib" *
+"{PPCLibraries}StdCRuntime.o" *
+"{PPCLibraries}PPCCRuntime.o" *
+"{PPCLibraries}MrCIOStreams.o" *
+"{PPCLibraries}PPCToolLibs.o"
+
+
+/* File 'config.h' */
+/* Define to `unsigned' if <sys/types.h> doesn't define. */
+#undef size_t
+
+/* Define if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define if you have <alloca.h> and it should be used (not on
+Ultrix). */
+#define HAVE_ALLOCA_H 1
+
+/* Define if you use FAT file system, leave undefined for NTFS */
+#undef SHORT_FILE_NAMES
+
+/* Never do interactive input */
+#define YY_NEVER_INTERACTIVE 1
+/* EOF File 'config.h' */
+
+------- End of Forwarded Message
+
+
+1,,
+X-Coding-System: nil
+Mail-from: From vern@daffy.ee.lbl.gov Wed Mar 28 04:07:49 2001
+Return-Path: <vern@daffy.ee.lbl.gov>
+Received: from localhost (localhost [127.0.0.1])
+ by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id EAA02765
+ for <wlestes@localhost>; Wed, 28 Mar 2001 04:07:49 -0500
+Received: from imap.uncg.edu
+ by localhost with IMAP (fetchmail-5.1.0)
+ for wlestes@localhost (single-drop); Wed, 28 Mar 2001 04:07:49 -0500 (EST)
+Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70])
+ by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f2S8o2e15934
+ for <wlestes@hermes.email.uncg.edu>; Wed, 28 Mar 2001 03:50:02 -0500 (EST)
+Received: from daffy.ee.lbl.gov (daffy.ee.lbl.gov [131.243.1.31])
+ by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id DAA23213
+ for <wlestes@uncg.edu>; Wed, 28 Mar 2001 03:50:00 -0500 (EST)
+Received: (from vern@localhost)
+ by daffy.ee.lbl.gov (8.10.0/8.10.0) id f2S8nr529885;
+ Wed, 28 Mar 2001 00:49:53 -0800 (PST)
+Message-Id: <200103280849.f2S8nr529885@daffy.ee.lbl.gov>
+To: "John W. Millaway" <johnmillaway@yahoo.com>
+Cc: help-flex@gnu.org, wlestes@uncg.edu
+Subject: Re: reentrant C scanner
+In-reply-to: Your message of Tue, 27 Mar 2001 12:49:46 PST.
+Date: Wed, 28 Mar 2001 00:49:53 PST
+From: Vern Paxson <vern@ee.lbl.gov>
+
+*** EOOH ***
+To: "John W. Millaway" <johnmillaway@yahoo.com>
+Cc: help-flex@gnu.org, wlestes@uncg.edu
+Subject: Re: reentrant C scanner
+In-reply-to: Your message of Tue, 27 Mar 2001 12:49:46 PST.
+Date: Wed, 28 Mar 2001 00:49:53 PST
+From: Vern Paxson <vern@ee.lbl.gov>
+
+> I contacted you (or someone there at flex H.Q.) about modifying flex to generate a
+> reentrant scanner. I found some time recently, and the modifications are nearly
+> complete. It wasn't as bad as I had originally thought it would be.
+>
+> I have two questions for you:
+>
+> 1. What is the procedure for regression testing?
+> 2. What is the procedure for merging my modifications with the current
+> distribution?
+
+Both of these are not well defined at the moment. Will Estes (cc'd) has
+volunteered to give taking over flex maintenance/development a try, and
+we're right now in a preliminary period during which he's gauging whether
+he'll indeed have the cycles for doing so.
+
+ Vern
+
+
+1,,
+X-Coding-System: nil
+Mail-from: From vern@daffy.ee.lbl.gov Thu Mar 29 18:05:46 2001
+Return-Path: <vern@daffy.ee.lbl.gov>
+Received: from localhost (localhost [127.0.0.1])
+ by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id SAA02631
+ for <wlestes@localhost>; Thu, 29 Mar 2001 18:05:46 -0500
+Received: from imap.uncg.edu
+ by localhost with IMAP (fetchmail-5.1.0)
+ for wlestes@localhost (single-drop); Thu, 29 Mar 2001 18:05:46 -0500 (EST)
+Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70])
+ by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f2TMmHe28250
+ for <wlestes@hermes.email.uncg.edu>; Thu, 29 Mar 2001 17:48:17 -0500 (EST)
+Received: from daffy.ee.lbl.gov (daffy.ee.lbl.gov [131.243.1.31])
+ by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id RAA02561
+ for <wlestes@uncg.edu>; Thu, 29 Mar 2001 17:48:16 -0500 (EST)
+Received: (from vern@localhost)
+ by daffy.ee.lbl.gov (8.10.0/8.10.0) id f2TMmCD10050;
+ Thu, 29 Mar 2001 14:48:12 -0800 (PST)
+Message-Id: <200103292248.f2TMmCD10050@daffy.ee.lbl.gov>
+To: John Tupper <john_tupper@tenornetworks.com>
+Subject: Re: flex bug
+Cc: wlestes@uncg.edu
+In-reply-to: Your message of Thu, 29 Mar 2001 13:52:38 PST.
+Date: Thu, 29 Mar 2001 14:48:12 PST
+From: Vern Paxson <vern@ee.lbl.gov>
+
+*** EOOH ***
+To: John Tupper <john_tupper@tenornetworks.com>
+Subject: Re: flex bug
+Cc: wlestes@uncg.edu
+In-reply-to: Your message of Thu, 29 Mar 2001 13:52:38 PST.
+Date: Thu, 29 Mar 2001 14:48:12 PST
+From: Vern Paxson <vern@ee.lbl.gov>
+
+Argh, yes, you're right. This is (mis)feature interaction between
+%option yylineno and trailing context.
+
+I've cc'd Will Estes, who is trying out taking over flex maintenance /
+development. Will, I think the place to fix this is in finish_rule() in
+nfa.c, making it generate extra code to loop through the characters being
+put back and decrement yylineno accordingly.
+
+ Vern
+
+
+>
+> --------------DC4CBAA5BA86BA0906373DD6
+> Content-Type: text/plain; charset=us-ascii
+> Content-Transfer-Encoding: 7bit
+>
+> Vern,
+> Are you the right person to send this to? It's a groaner. . .
+>
+> If you define a rule with a trailing context and the trailing context
+> matches a newline, the newline gets counted twice (in yylineno), once in
+> the trailing context and once when its matched for real.
+>
+> Sample grammer:
+>
+> \/\* { begin(Comment); }
+> <Comment>\*/[^/] { ; /* this rule is problematic */ }
+> <Comment>[^\*]+ { ; }
+> <Comment>\*\/ { begin(0); }
+>
+> The above grammer strips out C style comments. If a comment contains a
+> star at the end of a line, yylineno gets incremented twice.
+>
+> We used the obvious work around by adding a seperate rule to explicitly
+> match *\n without any trailing context, so we're not waiting for a fix.
+>
+> Oh yeah, we're using version 2.5.4.
+>
+> Thanks,
+> John Tupper
+> (john_tupper@tenornetworks.com)
+>
+>
+> --------------DC4CBAA5BA86BA0906373DD6
+> Content-Type: text/html; charset=us-ascii
+> Content-Transfer-Encoding: 7bit
+>
+> <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+> <html>
+> Vern,
+> <br>&nbsp; Are you the right person to send this to?&nbsp; It's a groaner.
+> . .
+> <p>If you define a rule with a trailing context and the trailing context
+> matches a newline, the newline gets counted twice (in yylineno), once in
+> the trailing context and once when its matched for real.
+> <p>Sample grammer:
+> <p><tt>\/\*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+> { begin(Comment); }</tt>
+> <br><tt>&lt;Comment>\*/[^/]&nbsp;&nbsp; { ; /* this rule is problematic
+> */ }</tt>
+> <br><tt>&lt;Comment>[^\*]+&nbsp;&nbsp;&nbsp; { ; }</tt>
+> <br><tt>&lt;Comment>\*\/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { begin(0); }</tt>
+> <p>The above grammer strips out C style comments.&nbsp; If a comment contains
+> a star at the end of a line, yylineno gets incremented twice.
+> <p>We used the obvious work around by adding a seperate rule to explicitly
+> match *\n without any trailing context, so we're not waiting for a fix.
+> <p>Oh yeah, we're using version 2.5.4.
+> <p>Thanks,
+> <br>John Tupper
+> <br>(john_tupper@tenornetworks.com)
+> <br>&nbsp;</html>
+>
+> --------------DC4CBAA5BA86BA0906373DD6--
+>
+
+
+1, answered,,
+X-Coding-System: nil
+Mail-from: From johnmillaway@yahoo.com Sun Apr 8 18:10:46 2001
+Return-Path: <johnmillaway@yahoo.com>
+Received: from localhost (localhost [127.0.0.1])
+ by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id SAA06099
+ for <wlestes@localhost>; Sun, 8 Apr 2001 18:10:46 -0400
+Received: from imap.uncg.edu
+ by localhost with IMAP (fetchmail-5.1.0)
+ for wlestes@localhost (single-drop); Sun, 08 Apr 2001 18:10:46 -0400 (EDT)
+Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70])
+ by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f38Lr7e10030
+ for <wlestes@hermes.email.uncg.edu>; Sun, 8 Apr 2001 17:53:07 -0400 (EDT)
+Received: from web9407.mail.yahoo.com (web9407.mail.yahoo.com [216.136.129.23])
+ by external-gw.uncg.edu (8.9.3/8.9.3) with SMTP id RAA28292
+ for <wlestes@uncg.edu>; Sun, 8 Apr 2001 17:53:05 -0400 (EDT)
+Message-ID: <20010408215303.56462.qmail@web9407.mail.yahoo.com>
+Received: from [216.254.82.102] by web9407.mail.yahoo.com; Sun, 08 Apr 2001 14:53:03 PDT
+Date: Sun, 8 Apr 2001 14:53:03 -0700 (PDT)
+From: "John W. Millaway" <johnmillaway@yahoo.com>
+Subject: Re: reentrant C scanner
+To: "W. L. Estes" <wlestes@uncg.edu>
+In-Reply-To: <200104082000.QAA05847@michael.uncg.edu>
+MIME-Version: 1.0
+Content-Type: text/plain; charset=us-ascii
+
+*** EOOH ***
+Date: Sun, 8 Apr 2001 14:53:03 -0700 (PDT)
+From: "John W. Millaway" <johnmillaway@yahoo.com>
+Subject: Re: reentrant C scanner
+To: "W. L. Estes" <wlestes@uncg.edu>
+In-Reply-To: <200104082000.QAA05847@michael.uncg.edu>
+
+Hi,
+
+(Sorry it took a while, my DSL went down again.)
+
+Here is a link to the diff, because my browser (Opera) doesn't do file-uploads
+properly.
+
+http://astro.temple.edu/~john43/flex_r.diff.gz
+
+I did not include a diff of skel.c, because it is built from flex.skl. I did a GNU
+diff, instead of CVS diff, because I had already modified flex before importing it
+into CVS... which means `cvs diff' won't work without some massaging. I'm no CVS
+expert, let me know if you have a solution.
+
+This all works, but is not finished. I want to test it with as many scanners as I
+can dig up. At some point, I'll submit a test directory and a "README.reenrant" as
+well as a modification of the texinfo docs.
+
+Briefly, the changes are these:
+
+1. Added option "reentrant" (-R).
+2. Added preprocessor directive: YY_REENTRANT. (and a few more related to this).
+3. Added internal "struct yy_globals_t"; user-visible as "void*".
+4. All global variables are conditionally eliminated and placed in the struct.
+5. Nearly all functions conditionally take an additional argument.
+6. yylex() is now yylex_r(void*)
+7. All access to globals must be wrapped in YY_G() macro.
+8. User may attach arbitrary data (void*) to the scanner, to maintain state.
+9. New functions for using scanner: yy_init_r, yy_free_r;
+10. Accessor functions to extract values from struct or globals.
+11. Frequently accessed variables (yytext, yyleng, etc..) have macro shortcuts,
+(yytext_r, yyleng_r, etc.) which hide the internals from users building reentrant
+scanners.
+
+-John Millaway
+
+
+__________________________________________________
+Do You Yahoo!?
+Get email at your own domain with Yahoo! Mail.
+http://personal.mail.yahoo.com/
+
+
+1,,
+X-Coding-System: nil
+Mail-from: From johnmillaway@yahoo.com Sun Apr 8 19:16:58 2001
+Return-Path: <johnmillaway@yahoo.com>
+Received: from localhost (localhost [127.0.0.1])
+ by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id TAA06140
+ for <wlestes@localhost>; Sun, 8 Apr 2001 19:16:58 -0400
+Received: from imap.uncg.edu
+ by localhost with IMAP (fetchmail-5.1.0)
+ for wlestes@localhost (single-drop); Sun, 08 Apr 2001 19:16:58 -0400 (EDT)
+Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70])
+ by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f38MwXe18411
+ for <wlestes@hermes.email.uncg.edu>; Sun, 8 Apr 2001 18:58:33 -0400 (EDT)
+Received: from web9402.mail.yahoo.com (web9402.mail.yahoo.com [216.136.129.108])
+ by external-gw.uncg.edu (8.9.3/8.9.3) with SMTP id SAA01092
+ for <wlestes@uncg.edu>; Sun, 8 Apr 2001 18:58:32 -0400 (EDT)
+Message-ID: <20010408225832.81903.qmail@web9402.mail.yahoo.com>
+Received: from [216.254.82.102] by web9402.mail.yahoo.com; Sun, 08 Apr 2001 15:58:32 PDT
+Date: Sun, 8 Apr 2001 15:58:32 -0700 (PDT)
+From: "John W. Millaway" <johnmillaway@yahoo.com>
+Subject: Re: reentrant C scanner
+To: "W. L. Estes" <wlestes@uncg.edu>
+In-Reply-To: <200104082224.SAA06112@michael.uncg.edu>
+MIME-Version: 1.0
+Content-Type: text/plain; charset=us-ascii
+
+*** EOOH ***
+Date: Sun, 8 Apr 2001 15:58:32 -0700 (PDT)
+From: "John W. Millaway" <johnmillaway@yahoo.com>
+Subject: Re: reentrant C scanner
+To: "W. L. Estes" <wlestes@uncg.edu>
+In-Reply-To: <200104082224.SAA06112@michael.uncg.edu>
+
+> have downloaded this and will set aside time to read your patch this
+> week.
+Please download again, I fixed another bug.
+
+> > I did not include a diff of skel.c, because it is built from flex.skl. I did a
+> GNU>
+> ok. will remember this...
+
+Just do `./mkskel.sh <flex.skl >skel.c` to rebuild it.
+
+> tag your current sources.
+> import the standard sources and give them another tag/branch name.
+> do a cvs diff explicitly between the two above.
+
+Will do.
+
+
+> that's the gut reaction. let me know if that works or if you have
+> troubles. But I need to prepare a publicly readable cvs archive anyway.
+
+Have you thought about sourceforge?
+
+> the scanner stuff is finished, yes? (sure, there will be bugs and
+> things to work out, but i am asking if the reentrant stuff is in place.)
+Yes, finished. But the changes were so widespread and there are so many options and
+directives that I'm sure something will break very soon. That's why a
+regression-test directory would be nice.
+
+> Go ahead and write the README. This is a good exercise--and usually
+> fairly easy to knock off. It can serve as a guide later on down the
+> road.
+OK.
+
+> To clarify, reentrant should probably not be a default behavior for
+> now.
+It is not. In fact, yacc/bison parsers won't call yylex_r()... something I'll work
+on later.
+
+
+> If it's ok with you, I'm going to forward your post on to
+> help-flex@gnu.org so the "community" can dig in too.
+
+Great. Please include my email address.
+
+Also, the community should really decide on the new API. I am wide open to
+suggestions. Currently, the new API allows a lexer to be backwards compatible, so
+that a working reentrant scanner should be able to be recompiled as a non-reentrant
+scanner, and everything will work just dandy on the inside. However, the syntax is
+not so pretty for the user. On the other hand, a reentrant scanner that is not
+meant to be backwards compatible has a cleaner API (fewer oddball macros).
+
+An example to illustrate:
+
+%option reentrant
+%s FOOBAR
+
+%%
+
+ /* The line in each pair below do the same thing.
+ But second of each pair is backwards-compatible. */
+
+"call-func" { yy_push_state ( FOOBAR , yy_globals ); }
+"call-func" { yy_push_state ( FOOBAR YYCALL_LAST_ARG ); }
+
+"user-data" { printf( (char*) yyusr_r );}
+"user-data" { printf( (char*) yy_get_usr(YYCALL_ONLY_ARG));}
+
+"yyleng" { printf( "%s %d" , yy_text_r, yyleng_r ); }
+"yyleng" { printf( "%s %d" , YY_G(yy_text), YY_G(yyleng)); }
+
+%%
+main()
+{
+ char* stuff = "user specific data.";
+ void * mylexer;
+
+ yy_init_r ( & mylexer ); /* Create the scanner. */
+ yy_set_usr( stuff, mylexer ); /* set user-defined stuff. */
+
+ while( 1 )
+ yylex_r ( lexer );
+
+ yy_free_r ( lexer );
+}
+
+-John Millaway
+
+
+__________________________________________________
+Do You Yahoo!?
+Get email at your own domain with Yahoo! Mail.
+http://personal.mail.yahoo.com/
+
+
+1,,
+X-Coding-System: nil
+Mail-from: From johnmillaway@yahoo.com Sun Apr 8 20:12:39 2001
+Return-Path: <johnmillaway@yahoo.com>
+Received: from localhost (localhost [127.0.0.1])
+ by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id UAA06162
+ for <wlestes@localhost>; Sun, 8 Apr 2001 20:12:39 -0400
+Received: from imap.uncg.edu
+ by localhost with IMAP (fetchmail-5.1.0)
+ for wlestes@localhost (single-drop); Sun, 08 Apr 2001 20:12:39 -0400 (EDT)
+Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70])
+ by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f38NsQe25613
+ for <wlestes@hermes.email.uncg.edu>; Sun, 8 Apr 2001 19:54:26 -0400 (EDT)
+Received: from web9406.mail.yahoo.com (web9406.mail.yahoo.com [216.136.129.22])
+ by external-gw.uncg.edu (8.9.3/8.9.3) with SMTP id TAA03391
+ for <wlestes@uncg.edu>; Sun, 8 Apr 2001 19:54:24 -0400 (EDT)
+Message-ID: <20010408235423.12509.qmail@web9406.mail.yahoo.com>
+Received: from [216.254.82.102] by web9406.mail.yahoo.com; Sun, 08 Apr 2001 16:54:23 PDT
+Date: Sun, 8 Apr 2001 16:54:23 -0700 (PDT)
+From: "John W. Millaway" <johnmillaway@yahoo.com>
+Subject: Re: reentrant C scanner
+To: "W. L. Estes" <wlestes@uncg.edu>
+In-Reply-To: <200104082224.SAA06112@michael.uncg.edu>
+MIME-Version: 1.0
+Content-Type: text/plain; charset=us-ascii
+
+*** EOOH ***
+Date: Sun, 8 Apr 2001 16:54:23 -0700 (PDT)
+From: "John W. Millaway" <johnmillaway@yahoo.com>
+Subject: Re: reentrant C scanner
+To: "W. L. Estes" <wlestes@uncg.edu>
+In-Reply-To: <200104082224.SAA06112@michael.uncg.edu>
+
+I'm sure you haven't had time to look at it yet, but there are two other points I
+wanted to mention:
+
+1. Once the reentrant scanner is working, there is no need for the non-reentrant
+scanner. The non-reentrant API can be built as a wrapper around the reentrant
+scanner. Much, much less code maintenance. I will happily do the conversion.
+
+2. The reentrancy can be verified, in part, by running `nm -A -l' on a compiled
+scanner. `nm` is part of binutils and shows, among other things, the global
+variables. In the reentrant scanner, there should be none.
+
+-John Millaway
+
+PS - What is the mailing list? I guess I should subscribe! The gnu site says that
+there is currently no list for flex:
+http://www.gnu.org/software/flex/flex.html#lists
+
+
+__________________________________________________
+Do You Yahoo!?
+Get email at your own domain with Yahoo! Mail.
+http://personal.mail.yahoo.com/
+
+
+1, answered,,
+X-Coding-System: nil
+Mail-from: From vern@daffy.ee.lbl.gov Tue Apr 17 04:00:22 2001
+Return-Path: <vern@daffy.ee.lbl.gov>
+Received: from localhost (localhost [127.0.0.1])
+ by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id EAA31012
+ for <wlestes@localhost>; Tue, 17 Apr 2001 04:00:21 -0400
+Received: from imap.uncg.edu
+ by localhost with IMAP (fetchmail-5.1.0)
+ for wlestes@localhost (single-drop); Tue, 17 Apr 2001 04:00:21 -0400 (EDT)
+Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70])
+ by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f3H7eqe08321
+ for <wlestes@hermes.email.uncg.edu>; Tue, 17 Apr 2001 03:40:52 -0400 (EDT)
+Received: from daffy.ee.lbl.gov (daffy.ee.lbl.gov [131.243.1.31])
+ by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id DAA08895
+ for <wlestes@uncg.edu>; Tue, 17 Apr 2001 03:40:50 -0400 (EDT)
+Received: (from vern@localhost)
+ by daffy.ee.lbl.gov (8.10.0/8.10.0) id f3H7eoW18946;
+ Tue, 17 Apr 2001 00:40:50 -0700 (PDT)
+Message-Id: <200104170740.f3H7eoW18946@daffy.ee.lbl.gov>
+To: "Yuri Victorovich" <yurivict@hotmail.com>
+Subject: Re: Flex comments
+Cc: wlestes@uncg.edu
+In-reply-to: Your message of Sun, 15 Apr 2001 22:47:37 PDT.
+Date: Tue, 17 Apr 2001 00:40:50 PDT
+From: Vern Paxson <vern@ee.lbl.gov>
+
+*** EOOH ***
+To: "Yuri Victorovich" <yurivict@hotmail.com>
+Subject: Re: Flex comments
+Cc: wlestes@uncg.edu
+In-reply-to: Your message of Sun, 15 Apr 2001 22:47:37 PDT.
+Date: Tue, 17 Apr 2001 00:40:50 PDT
+From: Vern Paxson <vern@ee.lbl.gov>
+
+> One problem: how to eliminate the static variables without making it C++
+> scanner with option -+? I do not want to introduce any of C++ into my
+> project and at the same time I use pthreads on FreeBSD.
+>
+> That would be a nice feature to have such an option.
+
+I agree it would be nice. I've cc'd Will Estes, who is trying out taking
+over flex maintenance / development.
+
+ Vern
+
+
+1, answered,,
+X-Coding-System: nil
+Mail-from: From yurivict@hotmail.com Tue Apr 17 10:42:56 2001
+Return-Path: <yurivict@hotmail.com>
+Received: from localhost (localhost [127.0.0.1])
+ by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id KAA01266
+ for <wlestes@localhost>; Tue, 17 Apr 2001 10:42:56 -0400
+Received: from imap.uncg.edu
+ by localhost with IMAP (fetchmail-5.1.0)
+ for wlestes@localhost (single-drop); Tue, 17 Apr 2001 10:42:56 -0400 (EDT)
+Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70])
+ by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f3HENMe01358
+ for <wlestes@hermes.email.uncg.edu>; Tue, 17 Apr 2001 10:23:22 -0400 (EDT)
+Received: from hotmail.com (f210.law12.hotmail.com [64.4.19.210])
+ by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id KAA06325
+ for <wlestes@uncg.edu>; Tue, 17 Apr 2001 10:23:21 -0400 (EDT)
+Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;
+ Tue, 17 Apr 2001 07:22:51 -0700
+Received: from 194.158.212.99 by lw12fd.law12.hotmail.msn.com with HTTP; Tue, 17 Apr 2001 14:22:51 GMT
+X-Originating-IP: [194.158.212.99]
+From: "Yuri Victorovich" <yurivict@hotmail.com>
+To: wlestes@uncg.edu
+Subject: Re: Flex comments
+Date: Tue, 17 Apr 2001 07:22:51 -0700
+Mime-Version: 1.0
+Content-Type: text/plain; format=flowed
+Message-ID: <F210b98KtdhQYZkxOjm00009556@hotmail.com>
+X-OriginalArrivalTime: 17 Apr 2001 14:22:51.0694 (UTC) FILETIME=[E2BCD4E0:01C0C749]
+
+*** EOOH ***
+From: "Yuri Victorovich" <yurivict@hotmail.com>
+To: wlestes@uncg.edu
+Subject: Re: Flex comments
+Date: Tue, 17 Apr 2001 07:22:51 -0700
+
+Will, Thank you for reply!
+
+I spent the whole day yesterday writing awk script to
+convert normal flex output to thread-safe form.
+
+If you do not have time or will need help with this
+work on flex -- I can do anything from research, programming
+to testing. Just let me know -- I digged into it to some
+extent already and will have some time in the coming weeks.
+
+Kind Regards,
+Yuri.
+
+
+
+
+
+>From: "W. L. Estes" <wlestes@uncg.edu>
+>To: vern@ee.lbl.gov
+>CC: yurivict@hotmail.com
+>Subject: Re: Flex comments
+>Date: Tue, 17 Apr 2001 08:33:35 -0400
+>
+> > > One problem: how to eliminate the static variables without making it
+>C++
+> > > scanner with option -+? I do not want to introduce any of C++ into my
+> > > project and at the same time I use pthreads on FreeBSD.
+> > >
+> > > That would be a nice feature to have such an option.
+> >
+> > I agree it would be nice. I've cc'd Will Estes, who is trying out
+>taking
+> > over flex maintenance / development.
+>
+>Thanks for the suggestion. I'll look into what it will take to do
+>this.
+>
+>--Will
+
+_________________________________________________________________
+Get your FREE download of MSN Explorer at http://explorer.msn.com
+
+
+1, answered,,
+X-Coding-System: nil
+Mail-from: From vern@daffy.ee.lbl.gov Tue Apr 17 12:34:26 2001
+Return-Path: <vern@daffy.ee.lbl.gov>
+Received: from localhost (localhost [127.0.0.1])
+ by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id MAA01409
+ for <wlestes@localhost>; Tue, 17 Apr 2001 12:34:26 -0400
+Received: from imap.uncg.edu
+ by localhost with IMAP (fetchmail-5.1.0)
+ for wlestes@localhost (single-drop); Tue, 17 Apr 2001 12:34:26 -0400 (EDT)
+Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70])
+ by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f3HGFpe27457
+ for <wlestes@hermes.email.uncg.edu>; Tue, 17 Apr 2001 12:15:51 -0400 (EDT)
+Received: from daffy.ee.lbl.gov (daffy.ee.lbl.gov [131.243.1.31])
+ by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id MAA20041
+ for <wlestes@uncg.edu>; Tue, 17 Apr 2001 12:15:49 -0400 (EDT)
+Received: (from vern@localhost)
+ by daffy.ee.lbl.gov (8.10.0/8.10.0) id f3HGFoP19785;
+ Tue, 17 Apr 2001 09:15:50 -0700 (PDT)
+Message-Id: <200104171615.f3HGFoP19785@daffy.ee.lbl.gov>
+To: "W. L. Estes" <wlestes@uncg.edu>
+Subject: Re: Flex comments
+In-reply-to: Your message of Tue, 17 Apr 2001 08:57:41 PDT.
+Date: Tue, 17 Apr 2001 09:15:50 PDT
+From: Vern Paxson <vern@ee.lbl.gov>
+
+*** EOOH ***
+To: "W. L. Estes" <wlestes@uncg.edu>
+Subject: Re: Flex comments
+In-reply-to: Your message of Tue, 17 Apr 2001 08:57:41 PDT.
+Date: Tue, 17 Apr 2001 09:15:50 PDT
+From: Vern Paxson <vern@ee.lbl.gov>
+
+> If there is more detail in the original message, could you forward it
+> to me?
+
+That was the whole message. The basic problem that people run into
+is they want reentrant scanners, so no statics or global variables.
+The general strategy for this is to have a new yylex() interface in
+which the caller passes in a struct that has all of the otherwise-global
+variables. This is a bit tricky to do cleanly because you can't switch
+to that as *the* interface, of course, because it would break the
+existing API; which means you have to be able to generate two forms of
+the skeleton file, one for the existing API with the statics/globals,
+and one without them and the struct definition instead.
+
+There's probably some more discussion on this in the mail tarball I sent
+you - search for "reentrant".
+
+ Vern
+
+
+1,,
+X-Coding-System: nil
+Mail-from: From help-flex-admin@gnu.org Wed Apr 25 00:20:40 2001
+Return-Path: <help-flex-admin@gnu.org>
+Received: from localhost (localhost [127.0.0.1])
+ by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id AAA22703
+ for <wlestes@localhost>; Wed, 25 Apr 2001 00:20:40 -0400
+Received: from imap.uncg.edu
+ by localhost with IMAP (fetchmail-5.1.0)
+ for wlestes@localhost (single-drop); Wed, 25 Apr 2001 00:20:40 -0400 (EDT)
+Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70])
+ by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f3P403e01034
+ for <wlestes@hermes.email.uncg.edu>; Wed, 25 Apr 2001 00:00:03 -0400 (EDT)
+Received: from fencepost.gnu.org (we-refuse-to-spy-on-our-users@fencepost.gnu.org [199.232.76.164])
+ by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id AAA05202
+ for <wlestes@uncg.edu>; Wed, 25 Apr 2001 00:00:02 -0400 (EDT)
+Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org)
+ by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
+ id 14sGTC-0006Tm-00
+ for <wlestes@uncg.edu>; Wed, 25 Apr 2001 00:00:02 -0400
+Received: from [203.199.199.50] (helo=banyannetworks.com)
+ by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
+ id 14sGRt-0006Sr-00
+ for <help-flex@gnu.org>; Tue, 24 Apr 2001 23:58:44 -0400
+Received: from localhost (arasi@localhost) by banyannetworks.com (8.9.3/8.8.3) with ESMTP id JAA03208 for <help-flex@gnu.org>; Wed, 25 Apr 2001 09:25:36 +0530
+From: Avai Arasi <arasi@banyanNetworks.com>
+To: help-flex@gnu.org
+Subject: Clarification Regarding Porting Flex and Bison to RTOS
+Message-ID: <Pine.LNX.4.10.10104250920140.3092-100000@banyannetworks.com>
+MIME-Version: 1.0
+Content-Type: TEXT/PLAIN; charset=US-ASCII
+Sender: help-flex-admin@gnu.org
+Errors-To: help-flex-admin@gnu.org
+X-BeenThere: help-flex@gnu.org
+X-Mailman-Version: 2.0.3
+Precedence: bulk
+List-Help: <mailto:help-flex-request@gnu.org?subject=help>
+List-Post: <mailto:help-flex@gnu.org>
+List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=subscribe>
+List-Id: Users list for Flex,
+ the GNU lexical analyser generator <help-flex.gnu.org>
+List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=unsubscribe>
+List-Archive: <http://mail.gnu.org/pipermail/help-flex/>
+Date: Wed, 25 Apr 2001 09:25:36 +0530 (IST)
+
+*** EOOH ***
+From: Avai Arasi <arasi@banyanNetworks.com>
+To: help-flex@gnu.org
+Subject: Clarification Regarding Porting Flex and Bison to RTOS
+Sender: help-flex-admin@gnu.org
+Precedence: bulk
+List-Help: <mailto:help-flex-request@gnu.org?subject=help>
+List-Post: <mailto:help-flex@gnu.org>
+List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=subscribe>
+List-Id: Users list for Flex,
+ the GNU lexical analyser generator <help-flex.gnu.org>
+List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=unsubscribe>
+List-Archive: <http://mail.gnu.org/pipermail/help-flex/>
+Date: Wed, 25 Apr 2001 09:25:36 +0530 (IST)
+
+Hello,
+
+ I am trying to port both Flex and Bison to a Real Time OS. I don't have
+the device options like the file which the Flex expects as input. In the
+place of the file i have a character pointer. How should I proceed with
+the parsing ?
+
+ Is there any standard procedure for this porting ? If somebody has
+already done such a work can i have some hints please.
+
+Thank You.
+
+Regards,
+Avaiarasi
+Senior Engineer R & D
+Banyan Networks Pvt. Ltd.
+Chennai.
+
+
+_______________________________________________
+Help-flex mailing list
+Help-flex@gnu.org
+http://mail.gnu.org/mailman/listinfo/help-flex
+
+
+1,,
+X-Coding-System: nil
+Mail-from: From help-flex-admin@gnu.org Wed Apr 25 13:17:31 2001
+Return-Path: <help-flex-admin@gnu.org>
+Received: from localhost (localhost [127.0.0.1])
+ by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id NAA23790
+ for <wlestes@localhost>; Wed, 25 Apr 2001 13:17:31 -0400
+Received: from imap.uncg.edu
+ by localhost with IMAP (fetchmail-5.1.0)
+ for wlestes@localhost (single-drop); Wed, 25 Apr 2001 13:17:31 -0400 (EDT)
+Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70])
+ by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f3PGv2e04258
+ for <wlestes@hermes.email.uncg.edu>; Wed, 25 Apr 2001 12:57:02 -0400 (EDT)
+Received: from fencepost.gnu.org (fencepost.gnu.org [199.232.76.164])
+ by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id MAA11157
+ for <wlestes@uncg.edu>; Wed, 25 Apr 2001 12:57:01 -0400 (EDT)
+Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org)
+ by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
+ id 14sSb8-00056g-00
+ for <wlestes@uncg.edu>; Wed, 25 Apr 2001 12:57:02 -0400
+Received: from web9403.mail.yahoo.com ([216.136.129.109])
+ by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
+ id 14sSYq-00053W-00
+ for <help-flex@gnu.org>; Wed, 25 Apr 2001 12:54:41 -0400
+Message-ID: <20010425165439.64856.qmail@web9403.mail.yahoo.com>
+Received: from [216.254.82.102] by web9403.mail.yahoo.com; Wed, 25 Apr 2001 09:54:39 PDT
+From: "John W. Millaway" <johnmillaway@yahoo.com>
+Subject: Bug: %option main overrides %option yywrap
+To: help-flex@gnu.org
+In-Reply-To: <200104251228.IAA23213@michael.uncg.edu>
+MIME-Version: 1.0
+Content-Type: text/plain; charset=us-ascii
+Sender: help-flex-admin@gnu.org
+Errors-To: help-flex-admin@gnu.org
+X-BeenThere: help-flex@gnu.org
+X-Mailman-Version: 2.0.3
+Precedence: bulk
+List-Help: <mailto:help-flex-request@gnu.org?subject=help>
+List-Post: <mailto:help-flex@gnu.org>
+List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=subscribe>
+List-Id: Users list for Flex,
+ the GNU lexical analyser generator <help-flex.gnu.org>
+List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=unsubscribe>
+List-Archive: <http://mail.gnu.org/pipermail/help-flex/>
+Date: Wed, 25 Apr 2001 09:54:39 -0700 (PDT)
+
+*** EOOH ***
+From: "John W. Millaway" <johnmillaway@yahoo.com>
+Subject: Bug: %option main overrides %option yywrap
+To: help-flex@gnu.org
+In-Reply-To: <200104251228.IAA23213@michael.uncg.edu>
+Sender: help-flex-admin@gnu.org
+Precedence: bulk
+List-Help: <mailto:help-flex-request@gnu.org?subject=help>
+List-Post: <mailto:help-flex@gnu.org>
+List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=subscribe>
+List-Id: Users list for Flex,
+ the GNU lexical analyser generator <help-flex.gnu.org>
+List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=unsubscribe>
+List-Archive: <http://mail.gnu.org/pipermail/help-flex/>
+Date: Wed, 25 Apr 2001 09:54:39 -0700 (PDT)
+
+Hello,
+
+There is a "bug" in the current version of flex (2.5.4) in which the %option
+[no]main unconditionally sets the %option [no]yywrap. I use the term "bug"
+hesitantly, because this behavior appears to be intentional. However, I can't think
+of any use for it other than to cause unexpected link errors when yywrap() is not
+found.
+
+Example:
+
+ %option noyywrap /* Disable option yywrap. */
+ %option nomain /* Option yywrap is now enabled! */
+
+One workaround is to always specify %option yywrap AFTER %option main. In general,
+if the user explicitly sets an option, then flex should either honor that setting,
+or report a conflict.
+
+The bug is in "scan.l" at line 247, and is undocumented.
+
+244: lex-compat lex_compat = option_sense;
+245: main {
+246: action_define( "YY_MAIN", option_sense );
+247: do_yywrap = ! option_sense;
+248: }
+249: meta-ecs usemecs = option_sense;
+
+-John Millaway
+
+
+__________________________________________________
+Do You Yahoo!?
+Yahoo! Auctions - buy the things you want at great prices
+http://auctions.yahoo.com/
+
+_______________________________________________
+Help-flex mailing list
+Help-flex@gnu.org
+http://mail.gnu.org/mailman/listinfo/help-flex
+
+
+1,,
+X-Coding-System: nil
+Mail-from: From help-flex-admin@gnu.org Wed Apr 25 14:11:45 2001
+Return-Path: <help-flex-admin@gnu.org>
+Received: from localhost (localhost [127.0.0.1])
+ by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id OAA23826
+ for <wlestes@localhost>; Wed, 25 Apr 2001 14:11:44 -0400
+Received: from imap.uncg.edu
+ by localhost with IMAP (fetchmail-5.1.0)
+ for wlestes@localhost (single-drop); Wed, 25 Apr 2001 14:11:44 -0400 (EDT)
+Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70])
+ by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f3PHp7e27019
+ for <wlestes@hermes.email.uncg.edu>; Wed, 25 Apr 2001 13:51:07 -0400 (EDT)
+Received: from fencepost.gnu.org (fencepost.gnu.org [199.232.76.164])
+ by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id NAA17880
+ for <wlestes@uncg.edu>; Wed, 25 Apr 2001 13:51:08 -0400 (EDT)
+Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org)
+ by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
+ id 14sTRT-0003QA-00
+ for <wlestes@uncg.edu>; Wed, 25 Apr 2001 13:51:07 -0400
+Received: from web9404.mail.yahoo.com ([216.136.129.110])
+ by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
+ id 14sTQy-0003Pm-00
+ for <help-flex@gnu.org>; Wed, 25 Apr 2001 13:50:36 -0400
+Message-ID: <20010425175036.43329.qmail@web9404.mail.yahoo.com>
+Received: from [216.254.82.102] by web9404.mail.yahoo.com; Wed, 25 Apr 2001 10:50:36 PDT
+From: "John W. Millaway" <johnmillaway@yahoo.com>
+Subject: Re: scaning from memory
+To: "alexandre.gouraud" <alexandre.gouraud@laposte.net>, help-flex@gnu.org
+In-Reply-To: <GCCZ8R$IiFF_2Id0FNAO2kAXNPACqX5slPk_GQyEsHVyKKjYXVpqFi3j4Ntc@laposte.net>
+MIME-Version: 1.0
+Content-Type: text/plain; charset=us-ascii
+Sender: help-flex-admin@gnu.org
+Errors-To: help-flex-admin@gnu.org
+X-BeenThere: help-flex@gnu.org
+X-Mailman-Version: 2.0.3
+Precedence: bulk
+List-Help: <mailto:help-flex-request@gnu.org?subject=help>
+List-Post: <mailto:help-flex@gnu.org>
+List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=subscribe>
+List-Id: Users list for Flex,
+ the GNU lexical analyser generator <help-flex.gnu.org>
+List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=unsubscribe>
+List-Archive: <http://mail.gnu.org/pipermail/help-flex/>
+Date: Wed, 25 Apr 2001 10:50:36 -0700 (PDT)
+
+*** EOOH ***
+From: "John W. Millaway" <johnmillaway@yahoo.com>
+Subject: Re: scaning from memory
+To: "alexandre.gouraud" <alexandre.gouraud@laposte.net>, help-flex@gnu.org
+In-Reply-To: <GCCZ8R$IiFF_2Id0FNAO2kAXNPACqX5slPk_GQyEsHVyKKjYXVpqFi3j4Ntc@laposte.net>
+Sender: help-flex-admin@gnu.org
+Precedence: bulk
+List-Help: <mailto:help-flex-request@gnu.org?subject=help>
+List-Post: <mailto:help-flex@gnu.org>
+List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=subscribe>
+List-Id: Users list for Flex,
+ the GNU lexical analyser generator <help-flex.gnu.org>
+List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=unsubscribe>
+List-Archive: <http://mail.gnu.org/pipermail/help-flex/>
+Date: Wed, 25 Apr 2001 10:50:36 -0700 (PDT)
+
+> I am trying to write a parser with flex/bison scaning strings
+> in memory, but I can't make it work. I am pretty sure it's a
+> common way of using flex, but I didn't find any example on the
+> web. (I have read the manual, of course). I have found several
+> times this question, but no answer.
+> I don't know where to put the yy_scan_string() statement. I
+> use the <<EOF>> rule as last rule. And I have also modified
+> the prototype of the yylex function with
+> #define YY_DECL int yylex(YYSTYPE *lvalp,char *name)
+> where name is the string I want to parse.
+
+You should call yy_scan_string before calling yylex. Here are two examples:
+
+1. In general:
+
+ YY_BUFFER_STATE buf_state = yy_scan_string( str );
+ while( yylex() != 0 )
+ ;
+ yy_delete_buffer(buf_state);
+
+
+2. Your particular scanner:
+
+%{
+#define YY_USER_INIT buf_state = yy_scan_string( name );
+%}
+%%
+ static YY_BUFFER_STATE buf_state;
+
+<<EOF>> { yy_buffer_delete( buf_state ); yyterminate(); }
+%%
+
+-John
+
+
+__________________________________________________
+Do You Yahoo!?
+Yahoo! Auctions - buy the things you want at great prices
+http://auctions.yahoo.com/
+
+_______________________________________________
+Help-flex mailing list
+Help-flex@gnu.org
+http://mail.gnu.org/mailman/listinfo/help-flex
+
+
+1,,
+X-Coding-System: nil
+Mail-from: From help-flex-admin@gnu.org Wed Apr 25 14:41:58 2001
+Return-Path: <help-flex-admin@gnu.org>
+Received: from localhost (localhost [127.0.0.1])
+ by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id OAA23852
+ for <wlestes@localhost>; Wed, 25 Apr 2001 14:41:58 -0400
+Received: from imap.uncg.edu
+ by localhost with IMAP (fetchmail-5.1.0)
+ for wlestes@localhost (single-drop); Wed, 25 Apr 2001 14:41:58 -0400 (EDT)
+Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70])
+ by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f3PILLe10211
+ for <wlestes@hermes.email.uncg.edu>; Wed, 25 Apr 2001 14:21:21 -0400 (EDT)
+Received: from fencepost.gnu.org (fencepost.gnu.org [199.232.76.164])
+ by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id OAA21692
+ for <wlestes@uncg.edu>; Wed, 25 Apr 2001 14:21:21 -0400 (EDT)
+Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org)
+ by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
+ id 14sTuj-0007Yw-00
+ for <wlestes@uncg.edu>; Wed, 25 Apr 2001 14:21:21 -0400
+Received: from daffy.ee.lbl.gov ([131.243.1.31])
+ by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
+ id 14sTtm-0007Xg-00
+ for <help-flex@gnu.org>; Wed, 25 Apr 2001 14:20:22 -0400
+Received: (from vern@localhost)
+ by daffy.ee.lbl.gov (8.10.0/8.10.0) id f3PIKJa19998;
+ Wed, 25 Apr 2001 11:20:19 -0700 (PDT)
+Message-Id: <200104251820.f3PIKJa19998@daffy.ee.lbl.gov>
+To: "John W. Millaway" <johnmillaway@yahoo.com>
+Cc: help-flex@gnu.org
+Subject: Re: Bug: %option main overrides %option yywrap
+In-reply-to: Your message of Wed, 25 Apr 2001 09:54:39 PDT.
+From: Vern Paxson <vern@ee.lbl.gov>
+Sender: help-flex-admin@gnu.org
+Errors-To: help-flex-admin@gnu.org
+X-BeenThere: help-flex@gnu.org
+X-Mailman-Version: 2.0.3
+Precedence: bulk
+List-Help: <mailto:help-flex-request@gnu.org?subject=help>
+List-Post: <mailto:help-flex@gnu.org>
+List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=subscribe>
+List-Id: Users list for Flex,
+ the GNU lexical analyser generator <help-flex.gnu.org>
+List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=unsubscribe>
+List-Archive: <http://mail.gnu.org/pipermail/help-flex/>
+Date: Wed, 25 Apr 2001 11:20:19 PDT
+
+*** EOOH ***
+To: "John W. Millaway" <johnmillaway@yahoo.com>
+Cc: help-flex@gnu.org
+Subject: Re: Bug: %option main overrides %option yywrap
+In-reply-to: Your message of Wed, 25 Apr 2001 09:54:39 PDT.
+From: Vern Paxson <vern@ee.lbl.gov>
+Sender: help-flex-admin@gnu.org
+Precedence: bulk
+List-Help: <mailto:help-flex-request@gnu.org?subject=help>
+List-Post: <mailto:help-flex@gnu.org>
+List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=subscribe>
+List-Id: Users list for Flex,
+ the GNU lexical analyser generator <help-flex.gnu.org>
+List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=unsubscribe>
+List-Archive: <http://mail.gnu.org/pipermail/help-flex/>
+Date: Wed, 25 Apr 2001 11:20:19 PDT
+
+> 245: main {
+> 246: action_define( "YY_MAIN", option_sense );
+> 247: do_yywrap = ! option_sense;
+> 248: }
+
+I think I did that (which is documented in the manual, by the way) so that
+"%option main" would be a quick way to specify you want a bare-bones
+program for which you don't have to define any additional routines.
+I'd be disinclined to change it (though it's Will's call) because it's
+so easy to work around - just don't use "%option main", which is only
+saving you a few lines of code anyway.
+
+ Vern
+
+_______________________________________________
+Help-flex mailing list
+Help-flex@gnu.org
+http://mail.gnu.org/mailman/listinfo/help-flex
+
+
+1,,
+X-Coding-System: nil
+Mail-from: From help-flex-admin@gnu.org Wed Apr 25 16:28:59 2001
+Return-Path: <help-flex-admin@gnu.org>
+Received: from localhost (localhost [127.0.0.1])
+ by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id QAA23955
+ for <wlestes@localhost>; Wed, 25 Apr 2001 16:28:59 -0400
+Received: from imap.uncg.edu
+ by localhost with IMAP (fetchmail-5.1.0)
+ for wlestes@localhost (single-drop); Wed, 25 Apr 2001 16:28:59 -0400 (EDT)
+Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70])
+ by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f3PK99e25951
+ for <wlestes@hermes.email.uncg.edu>; Wed, 25 Apr 2001 16:09:09 -0400 (EDT)
+Received: from fencepost.gnu.org (fencepost.gnu.org [199.232.76.164])
+ by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id QAA05277
+ for <wlestes@uncg.edu>; Wed, 25 Apr 2001 16:09:08 -0400 (EDT)
+Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org)
+ by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
+ id 14sVb1-0005jV-00
+ for <wlestes@uncg.edu>; Wed, 25 Apr 2001 16:09:07 -0400
+Received: from michael.uncg.edu ([152.13.5.20])
+ by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
+ id 14sVaJ-0005iu-00
+ for <help-flex@gnu.org>; Wed, 25 Apr 2001 16:08:23 -0400
+Received: (from wlestes@localhost)
+ by michael.uncg.edu (8.9.3/8.9.3) id QAA23947;
+ Wed, 25 Apr 2001 16:27:46 -0400
+Message-Id: <200104252027.QAA23947@michael.uncg.edu>
+X-Authentication-Warning: michael.uncg.edu: wlestes set sender to wlestes@michael.uncg.edu using -f
+From: "W. L. Estes" <wlestes@uncg.edu>
+To: vern@ee.lbl.gov
+CC: johnmillaway@yahoo.com, help-flex@gnu.org
+In-reply-to: <200104251820.f3PIKJa19998@daffy.ee.lbl.gov> (message from Vern
+ Paxson on Wed, 25 Apr 2001 11:20:19 PDT)
+Subject: Re: Bug: %option main overrides %option yywrap
+References: <200104251820.f3PIKJa19998@daffy.ee.lbl.gov>
+Sender: help-flex-admin@gnu.org
+Errors-To: help-flex-admin@gnu.org
+X-BeenThere: help-flex@gnu.org
+X-Mailman-Version: 2.0.3
+Precedence: bulk
+List-Help: <mailto:help-flex-request@gnu.org?subject=help>
+List-Post: <mailto:help-flex@gnu.org>
+List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=subscribe>
+List-Id: Users list for Flex,
+ the GNU lexical analyser generator <help-flex.gnu.org>
+List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=unsubscribe>
+List-Archive: <http://mail.gnu.org/pipermail/help-flex/>
+Date: Wed, 25 Apr 2001 16:27:46 -0400
+
+*** EOOH ***
+From: "W. L. Estes" <wlestes@uncg.edu>
+To: vern@ee.lbl.gov
+CC: johnmillaway@yahoo.com, help-flex@gnu.org
+In-reply-to: <200104251820.f3PIKJa19998@daffy.ee.lbl.gov> (message from Vern
+ Paxson on Wed, 25 Apr 2001 11:20:19 PDT)
+Subject: Re: Bug: %option main overrides %option yywrap
+Sender: help-flex-admin@gnu.org
+Precedence: bulk
+List-Help: <mailto:help-flex-request@gnu.org?subject=help>
+List-Post: <mailto:help-flex@gnu.org>
+List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=subscribe>
+List-Id: Users list for Flex,
+ the GNU lexical analyser generator <help-flex.gnu.org>
+List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=unsubscribe>
+List-Archive: <http://mail.gnu.org/pipermail/help-flex/>
+Date: Wed, 25 Apr 2001 16:27:46 -0400
+
+> I think I did that (which is documented in the manual, by the way) so that
+> "%option main" would be a quick way to specify you want a bare-bones
+> program for which you don't have to define any additional routines.
+> I'd be disinclined to change it (though it's Will's call) because it's
+> so easy to work around - just don't use "%option main", which is only
+> saving you a few lines of code anyway.
+
+Additionally, flex.1 says the following:
+
+ main directs flex to provide a default main() program
+ for the scanner, which simply calls yylex(). This
+ option implies noyywrap (see below).
+
+My sense is that Vern is correct: The right thing to do is to not use
+%option main if you want yywrap() to be under your control.
+
+Thanks,
+
+--Will
+
+_______________________________________________
+Help-flex mailing list
+Help-flex@gnu.org
+http://mail.gnu.org/mailman/listinfo/help-flex
+
+
+1,,
+X-Coding-System: nil
+Mail-from: From help-flex-admin@gnu.org Thu Apr 26 12:11:23 2001
+Return-Path: <help-flex-admin@gnu.org>
+Received: from localhost (localhost [127.0.0.1])
+ by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id MAA25162
+ for <wlestes@localhost>; Thu, 26 Apr 2001 12:11:22 -0400
+Received: from imap.uncg.edu
+ by localhost with IMAP (fetchmail-5.1.0)
+ for wlestes@localhost (single-drop); Thu, 26 Apr 2001 12:11:22 -0400 (EDT)
+Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70])
+ by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f3QFp6e21203
+ for <wlestes@hermes.email.uncg.edu>; Thu, 26 Apr 2001 11:51:06 -0400 (EDT)
+Received: from fencepost.gnu.org (fencepost.gnu.org [199.232.76.164])
+ by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id LAA21348
+ for <wlestes@uncg.edu>; Thu, 26 Apr 2001 11:51:05 -0400 (EDT)
+Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org)
+ by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
+ id 14so2r-00043k-00
+ for <wlestes@uncg.edu>; Thu, 26 Apr 2001 11:51:05 -0400
+Received: from [208.155.173.144] (helo=symbology.com)
+ by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
+ id 14so2e-0003Dl-00
+ for <help-flex@gnu.org>; Thu, 26 Apr 2001 11:50:53 -0400
+Received: from Spooler by symbology.com (Mercury/32 v3.21c) ID MO003737;
+ 26 Apr 01 10:52:43 -0500
+Received: from spooler by symbology.com (Mercury/32 v3.21c); 26 Apr 01 10:52:29 -0500
+Received: from grommit (10.0.0.74) by Symbology (Mercury/32 v3.21c) ID MG003736;
+ 26 Apr 01 10:52:22 -0500
+From: "Dave Dutcher" <ddutcher@symbology.com>
+To: <help-flex@gnu.org>
+Subject: Suppress copying characters to yytext?
+Message-ID: <002501c0ce68$99b3ec40$4a00000a@symbology.com>
+MIME-Version: 1.0
+Content-Type: text/plain;
+ charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+X-Priority: 3 (Normal)
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2910.0)
+X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
+Importance: Normal
+Sender: help-flex-admin@gnu.org
+Errors-To: help-flex-admin@gnu.org
+X-BeenThere: help-flex@gnu.org
+X-Mailman-Version: 2.0.3
+Precedence: bulk
+List-Help: <mailto:help-flex-request@gnu.org?subject=help>
+List-Post: <mailto:help-flex@gnu.org>
+List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=subscribe>
+List-Id: Users list for Flex,
+ the GNU lexical analyser generator <help-flex.gnu.org>
+List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=unsubscribe>
+List-Archive: <http://mail.gnu.org/pipermail/help-flex/>
+Date: Thu, 26 Apr 2001 10:50:20 -0500
+
+*** EOOH ***
+From: "Dave Dutcher" <ddutcher@symbology.com>
+To: <help-flex@gnu.org>
+Subject: Suppress copying characters to yytext?
+Importance: Normal
+Sender: help-flex-admin@gnu.org
+Precedence: bulk
+List-Help: <mailto:help-flex-request@gnu.org?subject=help>
+List-Post: <mailto:help-flex@gnu.org>
+List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=subscribe>
+List-Id: Users list for Flex,
+ the GNU lexical analyser generator <help-flex.gnu.org>
+List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=unsubscribe>
+List-Archive: <http://mail.gnu.org/pipermail/help-flex/>
+Date: Thu, 26 Apr 2001 10:50:20 -0500
+
+Hi,
+
+First off I was wondering if there is an official web site for Flex?
+
+Second, I would like to be able to have Flex use certain characters in a
+regular expression to match the expression but suppress copying the
+characters to yytext. A simple example would be if I was trying to match
+text surrounded by quotes, but I don't want to use the quotes. i.e.
+
+\"[^\n]\" { yylval = strdup(yytext); //This gives me the text and quotes. }
+
+or
+
+\"[^\n]\" { yylval = strdup(yytext+1); yylval[strlen(yylval)-1] = '\0';
+//Now I've removed the quotes. }
+
+But since I'm lazy ;) I would like to be able to tell Flex not to copy the
+quotes. What I would like is an operator that would tell flex to match an
+expression but to not copy it to yytext. Off the top of my head maybe the #
+symbol could work for such an operator, so I could then do:
+
+\"#[^\n]\"# { yylval = strdup(yytext); //This would give me the text without
+the quotes. }
+
+Does anyone know if such a feature or something similar exists? If this
+doesn't exists would it be practical?
+
+Thanks,
+
+Dave Dutcher
+Software Engineer
+Symbology, Inc.
+Minneapolis, MN
+
+
+_______________________________________________
+Help-flex mailing list
+Help-flex@gnu.org
+http://mail.gnu.org/mailman/listinfo/help-flex
+
+
+1,,
+X-Coding-System: nil
+Mail-from: From help-flex-admin@gnu.org Thu Apr 26 12:26:26 2001
+Return-Path: <help-flex-admin@gnu.org>
+Received: from localhost (localhost [127.0.0.1])
+ by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id MAA25203
+ for <wlestes@localhost>; Thu, 26 Apr 2001 12:26:26 -0400
+Received: from imap.uncg.edu
+ by localhost with IMAP (fetchmail-5.1.0)
+ for wlestes@localhost (single-drop); Thu, 26 Apr 2001 12:26:26 -0400 (EDT)
+Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70])
+ by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f3QG63e27511
+ for <wlestes@hermes.email.uncg.edu>; Thu, 26 Apr 2001 12:06:03 -0400 (EDT)
+Received: from fencepost.gnu.org (fencepost.gnu.org [199.232.76.164])
+ by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id MAA23192
+ for <wlestes@uncg.edu>; Thu, 26 Apr 2001 12:06:02 -0400 (EDT)
+Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org)
+ by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
+ id 14soHK-0004gM-00
+ for <wlestes@uncg.edu>; Thu, 26 Apr 2001 12:06:02 -0400
+Received: from acp3bf.physik.rwth-aachen.de ([137.226.32.75])
+ by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
+ id 14soFe-0004cw-00
+ for <help-flex@gnu.org>; Thu, 26 Apr 2001 12:04:18 -0400
+Received: from localhost (broeker@localhost) by acp3bf.physik.rwth-aachen.de (8.7.5/v3.2) with ESMTP id SAA00797; Thu, 26 Apr 2001 18:04:09 +0200
+X-Authentication-Warning: acp3bf.physik.rwth-aachen.de: broeker owned process doing -bs
+From: Hans-Bernhard Broeker <broeker@physik.rwth-aachen.de>
+X-Sender: broeker@acp3bf
+To: Dave Dutcher <ddutcher@symbology.com>
+cc: help-flex@gnu.org
+Subject: Re: Suppress copying characters to yytext?
+In-Reply-To: <002501c0ce68$99b3ec40$4a00000a@symbology.com>
+Message-ID: <Pine.LNX.4.10.10104261759540.592-100000@acp3bf>
+MIME-Version: 1.0
+Content-Type: TEXT/PLAIN; charset=US-ASCII
+Sender: help-flex-admin@gnu.org
+Errors-To: help-flex-admin@gnu.org
+X-BeenThere: help-flex@gnu.org
+X-Mailman-Version: 2.0.3
+Precedence: bulk
+List-Help: <mailto:help-flex-request@gnu.org?subject=help>
+List-Post: <mailto:help-flex@gnu.org>
+List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=subscribe>
+List-Id: Users list for Flex,
+ the GNU lexical analyser generator <help-flex.gnu.org>
+List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=unsubscribe>
+List-Archive: <http://mail.gnu.org/pipermail/help-flex/>
+Date: Thu, 26 Apr 2001 18:04:06 +0200 (MET DST)
+
+*** EOOH ***
+From: Hans-Bernhard Broeker <broeker@physik.rwth-aachen.de>
+To: Dave Dutcher <ddutcher@symbology.com>
+cc: help-flex@gnu.org
+Subject: Re: Suppress copying characters to yytext?
+In-Reply-To: <002501c0ce68$99b3ec40$4a00000a@symbology.com>
+Sender: help-flex-admin@gnu.org
+Precedence: bulk
+List-Help: <mailto:help-flex-request@gnu.org?subject=help>
+List-Post: <mailto:help-flex@gnu.org>
+List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=subscribe>
+List-Id: Users list for Flex,
+ the GNU lexical analyser generator <help-flex.gnu.org>
+List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=unsubscribe>
+List-Archive: <http://mail.gnu.org/pipermail/help-flex/>
+Date: Thu, 26 Apr 2001 18:04:06 +0200 (MET DST)
+
+On Thu, 26 Apr 2001, Dave Dutcher wrote:
+
+> Second, I would like to be able to have Flex use certain characters in a
+> regular expression to match the expression but suppress copying the
+> characters to yytext.
+
+You can do that with a start condition and trailing context rules. I.e.
+roughly like this:
+
+<INITIAL>\" BEGIN(IN_STRING)
+
+<IN_STRING>[^\n]*/\" {
+ /* yytext is the interior of the string, now */
+ BEGIN(INITIAL)
+ }
+
+--
+Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de)
+Even if all the snow were burnt, ashes would remain.
+
+
+_______________________________________________
+Help-flex mailing list
+Help-flex@gnu.org
+http://mail.gnu.org/mailman/listinfo/help-flex
+
+
+1, answered,,
+X-Coding-System: nil
+Mail-from: From johnmillaway@yahoo.com Wed Apr 25 18:52:08 2001
+Return-Path: <johnmillaway@yahoo.com>
+Received: from localhost (localhost [127.0.0.1])
+ by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id SAA24103
+ for <wlestes@localhost>; Wed, 25 Apr 2001 18:52:08 -0400
+Received: from imap.uncg.edu
+ by localhost with IMAP (fetchmail-5.1.0)
+ for wlestes@localhost (single-drop); Wed, 25 Apr 2001 18:52:08 -0400 (EDT)
+Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70])
+ by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f3PMWQe07299
+ for <wlestes@hermes.email.uncg.edu>; Wed, 25 Apr 2001 18:32:26 -0400 (EDT)
+Received: from web9404.mail.yahoo.com (web9404.mail.yahoo.com [216.136.129.110])
+ by external-gw.uncg.edu (8.9.3/8.9.3) with SMTP id SAA23019
+ for <wlestes@uncg.edu>; Wed, 25 Apr 2001 18:32:24 -0400 (EDT)
+Message-ID: <20010425223059.65780.qmail@web9404.mail.yahoo.com>
+Received: from [216.254.82.102] by web9404.mail.yahoo.com; Wed, 25 Apr 2001 15:30:59 PDT
+Date: Wed, 25 Apr 2001 15:30:59 -0700 (PDT)
+From: "John W. Millaway" <johnmillaway@yahoo.com>
+Subject: Re: Bug: %option main overrides %option yywrap
+To: "W. L. Estes" <wlestes@uncg.edu>, vern@ee.lbl.gov
+Cc: help-flex@gnu.org
+In-Reply-To: <200104252027.QAA23947@michael.uncg.edu>
+MIME-Version: 1.0
+Content-Type: text/plain; charset=us-ascii
+
+*** EOOH ***
+Date: Wed, 25 Apr 2001 15:30:59 -0700 (PDT)
+From: "John W. Millaway" <johnmillaway@yahoo.com>
+Subject: Re: Bug: %option main overrides %option yywrap
+To: "W. L. Estes" <wlestes@uncg.edu>, vern@ee.lbl.gov
+Cc: help-flex@gnu.org
+In-Reply-To: <200104252027.QAA23947@michael.uncg.edu>
+
+> Additionally, flex.1 says the following:
+>
+> main directs flex to provide a default main() program
+> for the scanner, which simply calls yylex(). This
+> option implies noyywrap (see below).
+
+I understand, and it makes sense. Just be aware that the inverse of this rule is
+also true -- %option nomain implies yywrap -- which makes much less sense.
+
+Of course, I only complain because it had me on one heck of a bug hunt. I had
+specified %option noyywrap and %option nomain, yet the linker complained that it
+couldn't find yywrap. I thought I had broken something! :)
+
+-John
+
+
+__________________________________________________
+Do You Yahoo!?
+Yahoo! Auctions - buy the things you want at great prices
+http://auctions.yahoo.com/
+
+
+1, answered,,
+X-Coding-System: nil
+Mail-from: From johnmillaway@yahoo.com Thu May 3 14:16:31 2001
+Return-Path: <johnmillaway@yahoo.com>
+Received: from localhost (localhost [127.0.0.1])
+ by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id OAA09489
+ for <wlestes@localhost>; Thu, 3 May 2001 14:16:31 -0400
+Received: from imap.uncg.edu
+ by localhost with IMAP (fetchmail-5.1.0)
+ for wlestes@localhost (single-drop); Thu, 03 May 2001 14:16:31 -0400 (EDT)
+Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70])
+ by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f43Hv6q26933
+ for <wlestes@hermes.email.uncg.edu>; Thu, 3 May 2001 13:57:06 -0400 (EDT)
+Received: from web9406.mail.yahoo.com (web9406.mail.yahoo.com [216.136.129.22])
+ by external-gw.uncg.edu (8.9.3/8.9.3) with SMTP id NAA14179
+ for <wlestes@uncg.edu>; Thu, 3 May 2001 13:57:04 -0400 (EDT)
+Message-ID: <20010503175704.85520.qmail@web9406.mail.yahoo.com>
+Received: from [155.247.207.90] by web9406.mail.yahoo.com; Thu, 03 May 2001 10:57:04 PDT
+Date: Thu, 3 May 2001 10:57:04 -0700 (PDT)
+From: "John W. Millaway" <johnmillaway@yahoo.com>
+Subject: Reentrant flex - progress update.
+To: "W. L. Estes" <wlestes@uncg.edu>
+In-Reply-To: <200105011710.NAA02531@michael.uncg.edu>
+MIME-Version: 1.0
+Content-Type: text/plain; charset=us-ascii
+
+*** EOOH ***
+Date: Thu, 3 May 2001 10:57:04 -0700 (PDT)
+From: "John W. Millaway" <johnmillaway@yahoo.com>
+Subject: Reentrant flex - progress update.
+To: "W. L. Estes" <wlestes@uncg.edu>
+In-Reply-To: <200105011710.NAA02531@michael.uncg.edu>
+
+Will,
+Progress update: This week is finals week. I'll send the tarballs soon.
+
+I made another, very minor, adjustment a few days ago: The integer yylineno will
+always be present in reentrant scanners, but only modified by flex if %option
+yylineno is enabled. Many scanners I have seen and built will disable %option
+yylineno, then declare an integer "lineno" to keep a line count anyway, (because
+the man page warns about the performance penalty of %option yylineno.) This way,
+reentrant flex provides support for users who wish to maintain their own linecount.
+
+ /* just like 'wc -l' */
+ %option reentrant noyylineno main
+ %%
+ yylineno_r = 1;
+
+ \n yylineno_r++;
+ . { }
+ <<EOF>> printf( "%7d", yylineno_r);
+
+Another important note: As far as I know, none of my modifications should have any
+effect on NON-reentrant scanners. In fact, I believe compiled scanners generated
+with the previous version should be binary equivalent to non-reentrant scanners
+generated with the new version. I have not verified this, but if they are not, then
+I may have made an oversight.
+
+-John Millaway
+
+
+__________________________________________________
+Do You Yahoo!?
+Yahoo! Auctions - buy the things you want at great prices
+http://auctions.yahoo.com/
+
+
+1,,
+X-Coding-System: nil
+Mail-from: From help-flex-admin@gnu.org Fri May 4 14:36:27 2001
+Return-Path: <help-flex-admin@gnu.org>
+Received: from localhost (localhost [127.0.0.1])
+ by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id OAA13535
+ for <wlestes@localhost>; Fri, 4 May 2001 14:36:27 -0400
+Received: from imap.uncg.edu
+ by localhost with IMAP (fetchmail-5.1.0)
+ for wlestes@localhost (single-drop); Fri, 04 May 2001 14:36:27 -0400 (EDT)
+Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70])
+ by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f44II5q04369
+ for <wlestes@hermes.email.uncg.edu>; Fri, 4 May 2001 14:18:05 -0400 (EDT)
+Received: from fencepost.gnu.org (fencepost.gnu.org [199.232.76.164])
+ by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id OAA14696
+ for <wlestes@uncg.edu>; Fri, 4 May 2001 14:18:04 -0400 (EDT)
+Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org)
+ by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
+ id 14vk9T-00065Q-00
+ for <wlestes@uncg.edu>; Fri, 04 May 2001 14:18:03 -0400
+Received: from web9401.mail.yahoo.com ([216.136.129.107])
+ by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
+ id 14vk7I-0005Hj-00
+ for <help-flex@gnu.org>; Fri, 04 May 2001 14:15:48 -0400
+Message-ID: <20010504181547.55844.qmail@web9401.mail.yahoo.com>
+Received: from [155.247.207.90] by web9401.mail.yahoo.com; Fri, 04 May 2001 11:15:47 PDT
+From: "John W. Millaway" <johnmillaway@yahoo.com>
+Subject: Why is YY_BUF_SIZE not override-able?
+To: help-flex@gnu.org
+In-Reply-To: <20010430181855.46942.qmail@web9407.mail.yahoo.com>
+MIME-Version: 1.0
+Content-Type: text/plain; charset=us-ascii
+Sender: help-flex-admin@gnu.org
+Errors-To: help-flex-admin@gnu.org
+X-BeenThere: help-flex@gnu.org
+X-Mailman-Version: 2.0.3
+Precedence: bulk
+List-Help: <mailto:help-flex-request@gnu.org?subject=help>
+List-Post: <mailto:help-flex@gnu.org>
+List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=subscribe>
+List-Id: Users list for Flex,
+ the GNU lexical analyser generator <help-flex.gnu.org>
+List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=unsubscribe>
+List-Archive: <http://mail.gnu.org/pipermail/help-flex/>
+Date: Fri, 4 May 2001 11:15:47 -0700 (PDT)
+
+*** EOOH ***
+From: "John W. Millaway" <johnmillaway@yahoo.com>
+Subject: Why is YY_BUF_SIZE not override-able?
+To: help-flex@gnu.org
+In-Reply-To: <20010430181855.46942.qmail@web9407.mail.yahoo.com>
+Sender: help-flex-admin@gnu.org
+Precedence: bulk
+List-Help: <mailto:help-flex-request@gnu.org?subject=help>
+List-Post: <mailto:help-flex@gnu.org>
+List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=subscribe>
+List-Id: Users list for Flex,
+ the GNU lexical analyser generator <help-flex.gnu.org>
+List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=unsubscribe>
+List-Archive: <http://mail.gnu.org/pipermail/help-flex/>
+Date: Fri, 4 May 2001 11:15:47 -0700 (PDT)
+
+Hi,
+
+Most everything can be overridden by the user. However the size of the input
+buffer, YY_BUF_SIZE, is fixed. Is there a reason why YY_BUF_SIZE can't be
+overridden?
+
+Let's say I knew that all my tokens will match under 80 characters plus newlines,
+plus nulls, plus flex-flags... I might decide to set YY_BUF_SIZE to 100.
+
+-John
+
+
+__________________________________________________
+Do You Yahoo!?
+Yahoo! Auctions - buy the things you want at great prices
+http://auctions.yahoo.com/
+
+_______________________________________________
+Help-flex mailing list
+Help-flex@gnu.org
+http://mail.gnu.org/mailman/listinfo/help-flex
+
+
+1, answered,,
+X-Coding-System: nil
+Mail-from: From johnmillaway@yahoo.com Fri May 4 15:44:19 2001
+Return-Path: <johnmillaway@yahoo.com>
+Received: from localhost (localhost [127.0.0.1])
+ by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id PAA13788
+ for <wlestes@localhost>; Fri, 4 May 2001 15:44:19 -0400
+Received: from imap.uncg.edu
+ by localhost with IMAP (fetchmail-5.1.0)
+ for wlestes@localhost (single-drop); Fri, 04 May 2001 15:44:19 -0400 (EDT)
+Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70])
+ by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f44JPXq26400
+ for <wlestes@hermes.email.uncg.edu>; Fri, 4 May 2001 15:25:33 -0400 (EDT)
+Received: from web9407.mail.yahoo.com (web9407.mail.yahoo.com [216.136.129.23])
+ by external-gw.uncg.edu (8.9.3/8.9.3) with SMTP id PAA21302
+ for <wlestes@uncg.edu>; Fri, 4 May 2001 15:25:31 -0400 (EDT)
+Message-ID: <20010504192531.73966.qmail@web9407.mail.yahoo.com>
+Received: from [155.247.207.90] by web9407.mail.yahoo.com; Fri, 04 May 2001 12:25:31 PDT
+Date: Fri, 4 May 2001 12:25:31 -0700 (PDT)
+From: "John W. Millaway" <johnmillaway@yahoo.com>
+Subject: Reentrant flex - test results.
+To: "W. L. Estes" <wlestes@uncg.edu>
+In-Reply-To: <200105031914.PAA09683@michael.uncg.edu>
+MIME-Version: 1.0
+Content-Type: text/plain; charset=us-ascii
+
+*** EOOH ***
+Date: Fri, 4 May 2001 12:25:31 -0700 (PDT)
+From: "John W. Millaway" <johnmillaway@yahoo.com>
+Subject: Reentrant flex - test results.
+To: "W. L. Estes" <wlestes@uncg.edu>
+In-Reply-To: <200105031914.PAA09683@michael.uncg.edu>
+
+My concerns are this:
+1. The build relies on bison or yacc. Is this intentional? Why not include the
+parse.c and parse.h in the dist?
+
+2. The TESTS/ "make check" stops at the first error. I'm thinking it may not be
+what we want. The change is simple: Omit the "|| exit -1" part from the commands in
+TESTS/Makefile.in.
+
+3. Since I'm not the autoconf guru, I couldn't find a cleaner way to do all the
+tests. So I just used a /bin/sh loop in the TESTS/Makefile.in.
+
+
+
+__________________________________________________
+Do You Yahoo!?
+Yahoo! Auctions - buy the things you want at great prices
+http://auctions.yahoo.com/
+
+
+1,,
+X-Coding-System: nil
+Mail-from: From johnmillaway@yahoo.com Fri May 4 15:56:22 2001
+Return-Path: <johnmillaway@yahoo.com>
+Received: from localhost (localhost [127.0.0.1])
+ by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id PAA13813
+ for <wlestes@localhost>; Fri, 4 May 2001 15:56:22 -0400
+Received: from imap.uncg.edu
+ by localhost with IMAP (fetchmail-5.1.0)
+ for wlestes@localhost (single-drop); Fri, 04 May 2001 15:56:22 -0400 (EDT)
+Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70])
+ by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f44JbZq00252
+ for <wlestes@hermes.email.uncg.edu>; Fri, 4 May 2001 15:37:35 -0400 (EDT)
+Received: from web9406.mail.yahoo.com (web9406.mail.yahoo.com [216.136.129.22])
+ by external-gw.uncg.edu (8.9.3/8.9.3) with SMTP id PAA22444
+ for <wlestes@uncg.edu>; Fri, 4 May 2001 15:37:33 -0400 (EDT)
+Message-ID: <20010504193731.93040.qmail@web9406.mail.yahoo.com>
+Received: from [155.247.207.90] by web9406.mail.yahoo.com; Fri, 04 May 2001 12:37:31 PDT
+Date: Fri, 4 May 2001 12:37:31 -0700 (PDT)
+From: "John W. Millaway" <johnmillaway@yahoo.com>
+Subject: Re: Reentrant flex - progress update.
+To: "W. L. Estes" <wlestes@uncg.edu>
+In-Reply-To: <200105041912.PAA13694@michael.uncg.edu>
+MIME-Version: 1.0
+Content-Type: text/plain; charset=us-ascii
+
+*** EOOH ***
+Date: Fri, 4 May 2001 12:37:31 -0700 (PDT)
+From: "John W. Millaway" <johnmillaway@yahoo.com>
+Subject: Re: Reentrant flex - progress update.
+To: "W. L. Estes" <wlestes@uncg.edu>
+In-Reply-To: <200105041912.PAA13694@michael.uncg.edu>
+
+> Do you think your test suite is complete? or is it just reasonably
+> thorough? (i.e. if someone thinks a feature isn't tested, should that
+> be a bug?)
+
+No, it is by no means complete. Yes, missing feature tests are bugs of a sort. The
+test suite was designed to cope with all the possible build configurations of a
+generated scanner, while developing flex itself. I didn't want to modify or add one
+feature, but break another. The breakage would easily go unnoticed.
+
+>From the top of my head, I didn't test %array, REJECT, and yy_set_bol, because I
+plain forgot about them. I didn't test the C++ option because it is broken AFAIK.
+All of the tests came in handy at one point or another during the past month,
+though.
+
+
+__________________________________________________
+Do You Yahoo!?
+Yahoo! Auctions - buy the things you want at great prices
+http://auctions.yahoo.com/
+
+
+1, answered,,
+X-Coding-System: nil
+Mail-from: From help-flex-admin@gnu.org Sat May 5 03:45:30 2001
+Return-Path: <help-flex-admin@gnu.org>
+Received: from localhost (localhost [127.0.0.1])
+ by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id DAA14343
+ for <wlestes@localhost>; Sat, 5 May 2001 03:45:30 -0400
+Received: from imap.uncg.edu
+ by localhost with IMAP (fetchmail-5.1.0)
+ for wlestes@localhost (single-drop); Sat, 05 May 2001 03:45:30 -0400 (EDT)
+Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70])
+ by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f457R2q28664
+ for <wlestes@hermes.email.uncg.edu>; Sat, 5 May 2001 03:27:02 -0400 (EDT)
+Received: from fencepost.gnu.org (we-refuse-to-spy-on-our-users@fencepost.gnu.org [199.232.76.164])
+ by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id DAA13852
+ for <wlestes@uncg.edu>; Sat, 5 May 2001 03:27:02 -0400 (EDT)
+Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org)
+ by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
+ id 14vwT0-0007qN-00
+ for <wlestes@uncg.edu>; Sat, 05 May 2001 03:27:02 -0400
+Received: from daffy.ee.lbl.gov ([131.243.1.31])
+ by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
+ id 14vwQr-0007nj-00
+ for <help-flex@gnu.org>; Sat, 05 May 2001 03:24:49 -0400
+Received: (from vern@localhost)
+ by daffy.ee.lbl.gov (8.10.0/8.10.0) id f457Ol523882;
+ Sat, 5 May 2001 00:24:47 -0700 (PDT)
+Message-Id: <200105050724.f457Ol523882@daffy.ee.lbl.gov>
+To: "John W. Millaway" <johnmillaway@yahoo.com>
+Cc: help-flex@gnu.org
+Subject: Re: Why is YY_BUF_SIZE not override-able?
+In-reply-to: Your message of Fri, 04 May 2001 11:15:47 PDT.
+From: Vern Paxson <vern@ee.lbl.gov>
+Sender: help-flex-admin@gnu.org
+Errors-To: help-flex-admin@gnu.org
+X-BeenThere: help-flex@gnu.org
+X-Mailman-Version: 2.0.3
+Precedence: bulk
+List-Help: <mailto:help-flex-request@gnu.org?subject=help>
+List-Post: <mailto:help-flex@gnu.org>
+List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=subscribe>
+List-Id: Users list for Flex,
+ the GNU lexical analyser generator <help-flex.gnu.org>
+List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=unsubscribe>
+List-Archive: <http://mail.gnu.org/pipermail/help-flex/>
+Date: Sat, 05 May 2001 00:24:46 PDT
+
+*** EOOH ***
+To: "John W. Millaway" <johnmillaway@yahoo.com>
+Cc: help-flex@gnu.org
+Subject: Re: Why is YY_BUF_SIZE not override-able?
+In-reply-to: Your message of Fri, 04 May 2001 11:15:47 PDT.
+From: Vern Paxson <vern@ee.lbl.gov>
+Sender: help-flex-admin@gnu.org
+Precedence: bulk
+List-Help: <mailto:help-flex-request@gnu.org?subject=help>
+List-Post: <mailto:help-flex@gnu.org>
+List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=subscribe>
+List-Id: Users list for Flex,
+ the GNU lexical analyser generator <help-flex.gnu.org>
+List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=unsubscribe>
+List-Archive: <http://mail.gnu.org/pipermail/help-flex/>
+Date: Sat, 05 May 2001 00:24:46 PDT
+
+> Most everything can be overridden by the user. However the size of the input
+> buffer, YY_BUF_SIZE, is fixed. Is there a reason why YY_BUF_SIZE can't be
+> overridden?
+
+I don't remember offhand why I didn't make it redefinable, but note that
+you can effect smaller buffer sizes using yy_create_buffer().
+
+ Vern
+
+_______________________________________________
+Help-flex mailing list
+Help-flex@gnu.org
+http://mail.gnu.org/mailman/listinfo/help-flex
+
+
+1,,
+X-Coding-System: nil
+Mail-from: From help-flex-admin@gnu.org Mon May 21 05:59:38 2001
+Return-Path: <help-flex-admin@gnu.org>
+Received: from localhost (localhost [127.0.0.1])
+ by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id FAA13870
+ for <wlestes@localhost>; Mon, 21 May 2001 05:59:38 -0400
+Received: from imap.uncg.edu
+ by localhost with IMAP (fetchmail-5.1.0)
+ for wlestes@localhost (single-drop); Mon, 21 May 2001 05:59:38 -0400 (EDT)
+Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70])
+ by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f4L9d5q15741
+ for <wlestes@hermes.email.uncg.edu>; Mon, 21 May 2001 05:39:05 -0400 (EDT)
+Received: from fencepost.gnu.org (we-refuse-to-spy-on-our-users@fencepost.gnu.org [199.232.76.164])
+ by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id FAA22405
+ for <wlestes@uncg.edu>; Mon, 21 May 2001 05:39:06 -0400 (EDT)
+Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org)
+ by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
+ id 151m9W-000616-00
+ for <wlestes@uncg.edu>; Mon, 21 May 2001 05:39:02 -0400
+Received: from [202.54.26.202] (helo=hindon.hss.co.in)
+ by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
+ id 151m7z-0005xX-00
+ for <help-flex@gnu.org>; Mon, 21 May 2001 05:37:27 -0400
+Received: from hsssun01.hss.hns.com (localhost [127.0.0.1])
+ by hindon.hss.co.in (8.10.0/8.10.0) with ESMTP id f4L9cb501756
+ for <help-flex@gnu.org>; Mon, 21 May 2001 15:08:38 +0530 (IST)
+Received: from sampark.hss.hns.com (sampark [139.85.229.22])
+ by hsssun01.hss.hns.com (8.10.0/8.10.0) with SMTP id f4L9kWY10057
+ for <help-flex@gnu.org>; Mon, 21 May 2001 15:16:45 +0530 (IST)
+Received: by sampark.hss.hns.com(Lotus SMTP MTA Internal build v4.6.2 (651.2 6-10-1998)) id 65256A53.0034A297 ; Mon, 21 May 2001 15:04:54 +0530
+X-Lotus-FromDomain: HSSBLR
+From: kbinu@hss.hns.com
+To: help-flex@gnu.org
+cc: crajasri@hss.hns.com
+Message-ID: <65256A53.0034A096.00@sampark.hss.hns.com>
+Subject: Enhancements in flex for error handling
+Mime-Version: 1.0
+Content-type: text/plain; charset=us-ascii
+Content-Disposition: inline
+Sender: help-flex-admin@gnu.org
+Errors-To: help-flex-admin@gnu.org
+X-BeenThere: help-flex@gnu.org
+X-Mailman-Version: 2.0.3
+Precedence: bulk
+List-Help: <mailto:help-flex-request@gnu.org?subject=help>
+List-Post: <mailto:help-flex@gnu.org>
+List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=subscribe>
+List-Id: Users list for Flex,
+ the GNU lexical analyser generator <help-flex.gnu.org>
+List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=unsubscribe>
+List-Archive: <http://mail.gnu.org/pipermail/help-flex/>
+Date: Mon, 21 May 2001 14:55:56 +0530
+
+*** EOOH ***
+From: kbinu@hss.hns.com
+To: help-flex@gnu.org
+cc: crajasri@hss.hns.com
+Subject: Enhancements in flex for error handling
+Sender: help-flex-admin@gnu.org
+Precedence: bulk
+List-Help: <mailto:help-flex-request@gnu.org?subject=help>
+List-Post: <mailto:help-flex@gnu.org>
+List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=subscribe>
+List-Id: Users list for Flex,
+ the GNU lexical analyser generator <help-flex.gnu.org>
+List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=unsubscribe>
+List-Archive: <http://mail.gnu.org/pipermail/help-flex/>
+Date: Mon, 21 May 2001 14:55:56 +0530
+
+
+
+
+Hi
+ We have been using flex generated scanners for a project. In our
+application, we need to ensure that the application does not exit on system
+errors including memory allocation failures. For errors that might occur
+while the scanner allocates memory, we thought we would re-define
+YY_FATAL_ERROR to something like
+#define YY_FATAL_ERROR(x) return (error_indication=x, 0)
+where error_indication is a global that I would check after the lexer
+returns. This however is not feasible since YY_FATAL_ERROR is used in
+functions called within yylex. Some of these do not return values. Also
+yylex doesn't check if the called function encountered errors.
+Is there any plan to enhance flex to return cleanly from yylex instead of
+using exit() ? If not, any references on how to go about modifying the
+skeleton scanner for this feature ?
+
+-Binu
+
+
+
+_______________________________________________
+Help-flex mailing list
+Help-flex@gnu.org
+http://mail.gnu.org/mailman/listinfo/help-flex
+
+
+1,,
+X-Coding-System: nil
+Mail-from: From help-flex-admin@gnu.org Mon May 21 12:35:41 2001
+Return-Path: <help-flex-admin@gnu.org>
+Received: from localhost (localhost [127.0.0.1])
+ by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id MAA14455
+ for <wlestes@localhost>; Mon, 21 May 2001 12:35:41 -0400
+Received: from imap.uncg.edu
+ by localhost with IMAP (fetchmail-5.1.0)
+ for wlestes@localhost (single-drop); Mon, 21 May 2001 12:35:41 -0400 (EDT)
+Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70])
+ by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f4LGF4q14830
+ for <wlestes@hermes.email.uncg.edu>; Mon, 21 May 2001 12:15:05 -0400 (EDT)
+Received: from fencepost.gnu.org (we-refuse-to-spy-on-our-users@fencepost.gnu.org [199.232.76.164])
+ by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id MAA05855
+ for <wlestes@uncg.edu>; Mon, 21 May 2001 12:15:04 -0400 (EDT)
+Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org)
+ by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
+ id 151sKm-0003HU-00
+ for <wlestes@uncg.edu>; Mon, 21 May 2001 12:15:04 -0400
+Received: from web9407.mail.yahoo.com ([216.136.129.23])
+ by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
+ id 151sIL-0003CL-00
+ for <help-flex@gnu.org>; Mon, 21 May 2001 12:12:33 -0400
+Message-ID: <20010521161232.55864.qmail@web9407.mail.yahoo.com>
+Received: from [216.254.82.102] by web9407.mail.yahoo.com; Mon, 21 May 2001 09:12:32 PDT
+From: "John W. Millaway" <johnmillaway@yahoo.com>
+Subject: Re: Enhancements in flex for error handling
+To: kbinu@hss.hns.com, help-flex@gnu.org
+Cc: crajasri@hss.hns.com
+In-Reply-To: <65256A53.0034A096.00@sampark.hss.hns.com>
+MIME-Version: 1.0
+Content-Type: text/plain; charset=us-ascii
+Sender: help-flex-admin@gnu.org
+Errors-To: help-flex-admin@gnu.org
+X-BeenThere: help-flex@gnu.org
+X-Mailman-Version: 2.0.3
+Precedence: bulk
+List-Help: <mailto:help-flex-request@gnu.org?subject=help>
+List-Post: <mailto:help-flex@gnu.org>
+List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=subscribe>
+List-Id: Users list for Flex,
+ the GNU lexical analyser generator <help-flex.gnu.org>
+List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=unsubscribe>
+List-Archive: <http://mail.gnu.org/pipermail/help-flex/>
+Date: Mon, 21 May 2001 09:12:32 -0700 (PDT)
+
+*** EOOH ***
+From: "John W. Millaway" <johnmillaway@yahoo.com>
+Subject: Re: Enhancements in flex for error handling
+To: kbinu@hss.hns.com, help-flex@gnu.org
+Cc: crajasri@hss.hns.com
+In-Reply-To: <65256A53.0034A096.00@sampark.hss.hns.com>
+Sender: help-flex-admin@gnu.org
+Precedence: bulk
+List-Help: <mailto:help-flex-request@gnu.org?subject=help>
+List-Post: <mailto:help-flex@gnu.org>
+List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=subscribe>
+List-Id: Users list for Flex,
+ the GNU lexical analyser generator <help-flex.gnu.org>
+List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=unsubscribe>
+List-Archive: <http://mail.gnu.org/pipermail/help-flex/>
+Date: Mon, 21 May 2001 09:12:32 -0700 (PDT)
+
+> using exit() ? If not, any references on how to go about modifying the
+> skeleton scanner for this feature ?
+
+You might get away with something like this (without having to modify the skeleton
+code): yyerror sets a flag, then resets the scanner, pointing the input to
+/dev/null.
+The parser will have to check the error flag, of course.
+
+-John
+
+
+
+
+__________________________________________________
+Do You Yahoo!?
+Yahoo! Auctions - buy the things you want at great prices
+http://auctions.yahoo.com/
+
+_______________________________________________
+Help-flex mailing list
+Help-flex@gnu.org
+http://mail.gnu.org/mailman/listinfo/help-flex
+
+
+1,,
+X-Coding-System: nil
+Mail-from: From help-flex-admin@gnu.org Mon Jun 4 11:26:56 2001
+Return-Path: <help-flex-admin@gnu.org>
+Received: from localhost (localhost [127.0.0.1])
+ by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id LAA07669
+ for <wlestes@localhost>; Mon, 4 Jun 2001 11:26:55 -0400
+Received: from imap.uncg.edu
+ by localhost with IMAP (fetchmail-5.1.0)
+ for wlestes@localhost (single-drop); Mon, 04 Jun 2001 11:26:55 -0400 (EDT)
+Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70])
+ by hermes.email.uncg.edu (8.11.0/8.11.0) with ESMTP id f54F63q16735
+ for <wlestes@hermes.email.uncg.edu>; Mon, 4 Jun 2001 11:06:03 -0400 (EDT)
+Received: from fencepost.gnu.org (we-refuse-to-spy-on-our-users@fencepost.gnu.org [199.232.76.164])
+ by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id LAA00743
+ for <wlestes@uncg.edu>; Mon, 4 Jun 2001 11:06:02 -0400 (EDT)
+Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org)
+ by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
+ id 156vve-0003bF-00
+ for <wlestes@uncg.edu>; Mon, 04 Jun 2001 11:06:02 -0400
+Received: from mx1.thebiz.net ([216.238.0.20])
+ by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
+ id 156vtP-0003Xd-00
+ for <help-flex@gnu.org>; Mon, 04 Jun 2001 11:03:43 -0400
+Received: (qmail 14188 invoked from network); 4 Jun 2001 11:03:40 -0400
+Received: from mail2.backend.thebiz.net (HELO mail2.thebiz.net) (172.16.0.129)
+ by mx1.backend.thebiz.net with SMTP; 4 Jun 2001 11:03:40 -0400
+Received: (qmail 26039 invoked by uid 0); 4 Jun 2001 11:03:39 -0400
+Received: from unknown (HELO abit) (216.238.78.51)
+ by mail.ulster.net with SMTP; 4 Jun 2001 11:03:39 -0400
+Message-ID: <006701c0ed07$fcefc5a0$0400a8c0@abit>
+From: "Bill Fenlason" <BillFen@Ulster.Net>
+To: <help-flex@gnu.org>
+Subject: FLEX <<EOF>> with yymore() token
+MIME-Version: 1.0
+Content-Type: text/plain;
+ charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+X-Priority: 3
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook Express 5.00.3018.1300
+X-MimeOLE: Produced By Microsoft MimeOLE V5.00.3018.1300
+Sender: help-flex-admin@gnu.org
+Errors-To: help-flex-admin@gnu.org
+X-BeenThere: help-flex@gnu.org
+X-Mailman-Version: 2.0.3
+Precedence: bulk
+List-Help: <mailto:help-flex-request@gnu.org?subject=help>
+List-Post: <mailto:help-flex@gnu.org>
+List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=subscribe>
+List-Id: Users list for Flex,
+ the GNU lexical analyser generator <help-flex.gnu.org>
+List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=unsubscribe>
+List-Archive: <http://mail.gnu.org/pipermail/help-flex/>
+Date: Mon, 4 Jun 2001 11:06:52 -0400
+
+*** EOOH ***
+From: "Bill Fenlason" <BillFen@Ulster.Net>
+To: <help-flex@gnu.org>
+Subject: FLEX <<EOF>> with yymore() token
+Sender: help-flex-admin@gnu.org
+Precedence: bulk
+List-Help: <mailto:help-flex-request@gnu.org?subject=help>
+List-Post: <mailto:help-flex@gnu.org>
+List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=subscribe>
+List-Id: Users list for Flex,
+ the GNU lexical analyser generator <help-flex.gnu.org>
+List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=unsubscribe>
+List-Archive: <http://mail.gnu.org/pipermail/help-flex/>
+Date: Mon, 4 Jun 2001 11:06:52 -0400
+
+I posted part of this question to comp.compilers, and John Millaway pointed
+me here. Thanks John. I've read the archives but did not see this topic
+discussed.
+
+In FLEX, the current buffer is flushed immediately when EOF is encountered,
+even if it contains a token pushed by yymore(). That means that something
+like:
+ <start_cond><<EOF>>{If (yyleng > 0) return(A_TOKEN) .... }
+fails, because yyleng may be non-zero but yytext is null. The token is
+copied to the start of the buffer but is then overwritten by the buffer
+flush (via yyrestart).
+
+I modified the skeleton to check this out. If the call to yyrestart is
+bypassed (OK in my case), the problem partly goes away. Is this a bug or an
+unintended byproduct?
+
+The core issue relates to <<EOF>> and what actions after <<EOF>> are
+allowed. <<EOF>> is logically a state rather than a token, and the null
+return (after yywrap) makes perfect sense to me. The comment in the code
+about a repeated call returning null again also makes sense, but it seems to
+me that allowing the return of a residual token (pushed by yymore) would be
+appropriate. I realize the difficulty in trying to allow <<EOF>> as right
+context in a pattern, and I had hoped to accomplish the same thing via the
+<<EOF>> rules.
+
+Currently at <<EOF>> yyleng is set to 1 plus the yymore length, and I would
+propose that it should be set to the yymore length only (usually 0). The
+scan has to rely on the trailing null in the buffer to identify the <<EOF>>
+state, but should it be treated as an actual token? (In the case above I
+needed to use --yyleng.)
+
+I understand the need to reset the buffer in case the user has changed yyin.
+
+The man page specifies that repeated calls after EOF are undefined. Would
+defining them such that zero additional characters are matched and that null
+is returned be an improvement? Should the calculation of yyleng at <<EOF>>
+be changed? Should there be a change regarding the buffer flush to allow
+the residual token to be returned?
+
+My case involves recognizing identifiers which may contain extralingual
+characters defined at runtime.
+
+Thank you.
+
+Bill Fenlason
+
+
+
+
+_______________________________________________
+Help-flex mailing list
+Help-flex@gnu.org
+http://mail.gnu.org/mailman/listinfo/help-flex
+
+
+1, answered,,
+X-Coding-System: nil
+Mail-from: From BillFen@Ulster.Net Sun Jun 10 13:20:00 2001
+Return-Path: <BillFen@Ulster.Net>
+Received: from localhost (localhost [127.0.0.1])
+ by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id NAA02104
+ for <wlestes@localhost>; Sun, 10 Jun 2001 13:20:00 -0400
+Received: from imap.uncg.edu
+ by localhost with IMAP (fetchmail-5.1.0)
+ for wlestes@localhost (single-drop); Sun, 10 Jun 2001 13:20:00 -0400 (EDT)
+Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70])
+ by hermes.uncg.edu (8.11.0/8.11.0) with ESMTP id f5AHIPs03250
+ for <wlestes@hermes.email.uncg.edu>; Sun, 10 Jun 2001 13:18:25 -0400 (EDT)
+Received: from mx1.thebiz.net (mx1.thebiz.net [216.238.0.20])
+ by external-gw.uncg.edu (8.9.3/8.9.3) with SMTP id NAA27551
+ for <wlestes@uncg.edu>; Sun, 10 Jun 2001 13:18:24 -0400 (EDT)
+Received: (qmail 24543 invoked from network); 10 Jun 2001 13:18:24 -0400
+Received: from unknown (HELO mail2.thebiz.net) (172.16.0.129)
+ by mx1.backend.thebiz.net with SMTP; 10 Jun 2001 13:18:24 -0400
+Received: (qmail 29926 invoked by uid 0); 10 Jun 2001 13:18:23 -0400
+Received: from unknown (HELO abit) (216.238.78.51)
+ by mail.ulster.net with SMTP; 10 Jun 2001 13:18:23 -0400
+Message-ID: <00f301c0f1d1$bb1ef140$0400a8c0@abit>
+From: "Bill Fenlason" <BillFen@Ulster.Net>
+To: <wlestes@uncg.edu>
+Subject: FLEX modifications
+Date: Sun, 10 Jun 2001 13:21:02 -0400
+MIME-Version: 1.0
+Content-Type: text/plain;
+ charset="iso-8859-1"
+Content-Transfer-Encoding: 7bit
+X-Priority: 3
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook Express 5.00.3018.1300
+X-MimeOLE: Produced By Microsoft MimeOLE V5.00.3018.1300
+
+*** EOOH ***
+From: "Bill Fenlason" <BillFen@Ulster.Net>
+To: <wlestes@uncg.edu>
+Subject: FLEX modifications
+Date: Sun, 10 Jun 2001 13:21:02 -0400
+
+Hello Will,
+
+Are you currently the one responsible for FLEX development and maint? I saw
+you pointed to in the FLEX help archives.
+
+Since no one has commented on my recent message regarding yymore() and
+<<EOF>>, I though I would send you a note directly.
+
+Are you interested in a patch and documentation changes? I'll be happy to
+develop them and send them to you. It will be some work for me since I
+would want to be sure that everything is bulletproof. But I don't want to
+spend the time on it if there is no agreement that the change is both needed
+and wanted.
+
+The reason I'm implementing this is that the parser interface routine I'm
+developing builds a token chain that includes tokens for missing ending
+delimiters (comment ends, quotes, parens, etc, as well as include file end
+identifiers. It is convenient to keep generating zero length tokens at
+<<EOF>> to handle this, with the final YY_NULL being delayed until nothing
+is outstanding or pushed with yymore(). Leaving repeated calls after EOF as
+undefined and undocumented seems to me to be a loose end that might well be
+clarified. I think that my approach makes sense in general, and had hoped
+that others more experienced with FLEX would point out some pros and cons.
+
+I have some other topics to ask about along with some suggestions, and it
+will be helpful to know if you are interested in this or other changes and
+additions to FLEX.
+
+I'll be using a modified skeleton in any event so I'm not dependent (or
+asking for) any "official" changes. But FLEX is a wonderful tool, and I
+wouldn't mind contributing something to it if I am able to.
+
+Thanks.
+
+Bill Fenlason
+
+ps I assume that Vern is a very busy guy so I have not written to him. But
+feel free to forward this to him if you think it appropriate.
+
+
+
+
+
+1, answered,,
+Summary-line: 10-Jun BillFen@Ulster.Net [121] #Re: FLEX modifications
+X-Coding-System: nil
+Mail-from: From BillFen@Ulster.Net Sun Jun 10 20:30:13 2001
+Return-Path: <BillFen@Ulster.Net>
+Received: from localhost (localhost [127.0.0.1])
+ by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id UAA02667
+ for <wlestes@localhost>; Sun, 10 Jun 2001 20:30:13 -0400
+Received: from imap.uncg.edu
+ by localhost with IMAP (fetchmail-5.1.0)
+ for wlestes@localhost (single-drop); Sun, 10 Jun 2001 20:30:13 -0400 (EDT)
+Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70])
+ by hermes.uncg.edu (8.11.0/8.11.0) with ESMTP id f5B0SGs07342
+ for <wlestes@hermes.email.uncg.edu>; Sun, 10 Jun 2001 20:28:16 -0400 (EDT)
+Received: from mx1.thebiz.net (mx1.thebiz.net [216.238.0.20])
+ by external-gw.uncg.edu (8.9.3/8.9.3) with SMTP id UAA12568
+ for <wlestes@uncg.edu>; Sun, 10 Jun 2001 20:28:17 -0400 (EDT)
+Received: (qmail 24345 invoked from network); 10 Jun 2001 20:28:15 -0400
+Received: from unknown (HELO mail2.thebiz.net) (172.16.0.129)
+ by mx1.backend.thebiz.net with SMTP; 10 Jun 2001 20:28:15 -0400
+Received: (qmail 3989 invoked by uid 0); 10 Jun 2001 20:28:13 -0400
+Received: from unknown (HELO abit) (216.238.78.51)
+ by mail.ulster.net with SMTP; 10 Jun 2001 20:28:13 -0400
+Message-ID: <001201c0f20d$eb553360$0400a8c0@abit>
+From: "Bill Fenlason" <BillFen@Ulster.Net>
+To: "W. L. Estes" <wlestes@uncg.edu>
+References: <00f301c0f1d1$bb1ef140$0400a8c0@abit> <200106101934.PAA02280@michael.uncg.edu>
+Subject: Re: FLEX modifications
+Date: Sun, 10 Jun 2001 20:31:55 -0400
+MIME-Version: 1.0
+Content-Type: text/plain;
+ charset="Windows-1252"
+Content-Transfer-Encoding: 7bit
+X-Priority: 3
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook Express 5.00.3018.1300
+X-MimeOLE: Produced By Microsoft MimeOLE V5.00.3018.1300
+
+*** EOOH ***
+From: "Bill Fenlason" <BillFen@Ulster.Net>
+To: "W. L. Estes" <wlestes@uncg.edu>
+Subject: Re: FLEX modifications
+Date: Sun, 10 Jun 2001 20:31:55 -0400
+
+Will,
+
+Thanks for responding, and for pointing out that I could keep track of the
+paired delimiter state in the calling program - certainly a reasonable
+question.
+
+I decided against that approach primarily because I didn't want to
+complicate the calling program unnecessarily. I found that treating this as
+a scanning function allowed the overall coding to be smaller and more
+reasonable. For example, I handle nested comments, and the scanner needs to
+use separate start conditions. The nesting level needs to be maintained for
+that any way, so using additional calls after eof makes it really simple - I
+just return the zero length "missing delimeter" tokens and decrease the
+nesting level. When it reaches zero I go back to the base state and YY_NULL
+is returned. All in all, trying to keep track in both places is a
+duplication.
+
+But that does not explain the yymore() issue. The language I'm scanning
+(PL/I) allows identifier name characters to be specified at runtime. The
+feature is to support foreign language keyboards etc. So the problem is how
+to scan them? I don't want to force the calling program to paste parts of a
+word together, and I have to test any non conventional character (i.e.
+128-255) to determine if it is a name character or not. My solution is to
+yymore() each word, and either append a valid extralingual character or
+return the word. Works great, except at EOF. I don't want to depend on a
+trailing NL character, although it would be present almost all of the time.
+(After 35 years of programming, I've learned the value of making things
+bulletproof 8:-).
+
+Finally, the actions at eof I'm proposing just "feel right". I hope after
+some reflection you come to the same conclusion. I'll be glad to go into
+lots more detail in case you have any fine points to consider.
+
+The next few issues I have relate to providing assistance for unlimied
+include file nesting, and how to assist with token location information
+(yylineno and offset) without having the performance robbing rescan for NL.
+Also I'd like to kick around some ideas related to gen.c and skeletons.
+
+Would you rather that I discuss these things with you directly, or should I
+use the list? I don't know the balance between knowledgeable programmers
+and developers, and users in the list membership. I would like a healthy
+discussion on these ideas and questions but I wouldn't want to add
+inappropriate things to the list.
+
+Thanks again - hope this is not taking too much of your time.
+
+Bill Fenlason
+
+ps. a snapshot would be great!
+
+----- Original Message -----
+From: W. L. Estes
+To: BillFen@Ulster.Net
+Sent: Sunday, June 10, 2001 3:34 PM
+Subject: Re: FLEX modifications
+
+
+> Are you currently the one responsible for FLEX development and maint? I
+saw
+> you pointed to in the FLEX help archives.
+
+yes. :)
+
+> Since no one has commented on my recent message regarding yymore() and
+> <<EOF>>, I though I would send you a note directly.
+>
+> Are you interested in a patch and documentation changes? I'll be happy to
+> develop them and send them to you. It will be some work for me since I
+> would want to be sure that everything is bulletproof. But I don't want to
+> spend the time on it if there is no agreement that the change is both
+needed
+> and wanted.
+
+On first reading of your message, I thought that I needed to think
+about what you were asking. Unfortunately, you got put way down in the
+queue.
+
+> The reason I'm implementing this is that the parser interface routine I'm
+> developing builds a token chain that includes tokens for missing ending
+> delimiters (comment ends, quotes, parens, etc, as well as include file end
+> identifiers. It is convenient to keep generating zero length tokens at
+> <<EOF>> to handle this, with the final YY_NULL being delayed until nothing
+> is outstanding or pushed with yymore(). Leaving repeated calls after EOF
+as
+> undefined and undocumented seems to me to be a loose end that might well
+be
+> clarified. I think that my approach makes sense in general, and had hoped
+
+> that others more experienced with FLEX would point out some pros and cons.
+
+devil's advocate question: why not just keep track of your state and
+compare: e.g. if (eof && !closed_delim_state)...
+
+> I have some other topics to ask about along with some suggestions, and it
+> will be helpful to know if you are interested in this or other changes and
+> additions to FLEX.
+
+I'm always interested in suggestions, patches etc. please note: i'm
+not saying no to your idea above, i'm just asking you to explain it to
+me better--because i'm not quite getting what you're saying.
+
+> I'll be using a modified skeleton in any event so I'm not dependent (or
+> asking for) any "official" changes. But FLEX is a wonderful tool, and I
+> wouldn't mind contributing something to it if I am able to.
+
+Certainly. If you'd like my current sources (which have migrated quite
+a bit since Vern's last 2.5.4 release), let me know. you can have a
+copy of the cvs repository or a snapshot of the current tree.
+
+and what is your need for a modified skeleton? (i.e. is that something
+which might be of use to the general flex user?)
+
+> Thanks.
+
+--Will
+
+
+1, answered,,
+Summary-line: 15-Jun BillFen@Ulster.Net [66] #Re: FLEX modifications
+X-Coding-System: nil
+Mail-from: From BillFen@Ulster.Net Fri Jun 15 15:22:34 2001
+Return-Path: <BillFen@Ulster.Net>
+Received: from localhost (localhost [127.0.0.1])
+ by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id PAA05265
+ for <wlestes@localhost>; Fri, 15 Jun 2001 15:22:33 -0400
+Received: from imap.uncg.edu
+ by localhost with IMAP (fetchmail-5.1.0)
+ for wlestes@localhost (single-drop); Fri, 15 Jun 2001 15:22:33 -0400 (EDT)
+Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70])
+ by hermes.uncg.edu (8.11.0/8.11.0) with ESMTP id f5FJKjs04809
+ for <wlestes@hermes.email.uncg.edu>; Fri, 15 Jun 2001 15:20:45 -0400 (EDT)
+Received: from mx3.thebiz.net (mx3.thebiz.net [216.238.0.22])
+ by external-gw.uncg.edu (8.9.3/8.9.3) with SMTP id PAA05329
+ for <wlestes@uncg.edu>; Fri, 15 Jun 2001 15:20:45 -0400 (EDT)
+Received: (qmail 34351 invoked from network); 15 Jun 2001 15:19:39 -0400
+Received: from unknown (172.16.0.72)
+ by mx3.backend.thebiz.net with QMQP; 15 Jun 2001 15:19:39 -0400
+Received: from unknown (HELO abit) (216.238.78.36)
+ by mail.ulster.net with SMTP; 15 Jun 2001 15:19:39 -0400
+Message-ID: <001901c0f5d0$a7080fe0$0400a8c0@abit>
+From: "Bill Fenlason" <BillFen@Ulster.Net>
+To: "W. L. Estes" <wlestes@uncg.edu>
+References: <00f301c0f1d1$bb1ef140$0400a8c0@abit> <200106101934.PAA02280@michael.uncg.edu>
+Subject: Re: FLEX modifications
+Date: Fri, 15 Jun 2001 15:23:25 -0400
+MIME-Version: 1.0
+Content-Type: text/plain;
+ charset="Windows-1252"
+Content-Transfer-Encoding: 7bit
+X-Priority: 3
+X-MSMail-Priority: Normal
+X-Mailer: Microsoft Outlook Express 5.00.3018.1300
+X-MimeOLE: Produced By Microsoft MimeOLE V5.00.3018.1300
+
+*** EOOH ***
+From: "Bill Fenlason" <BillFen@Ulster.Net>
+To: "W. L. Estes" <wlestes@uncg.edu>
+Subject: Re: FLEX modifications
+Date: Fri, 15 Jun 2001 15:23:25 -0400
+
+Hello Will,
+
+I assume that you have not had time to get to my last note, or perhaps it is
+just too far down in the queue. This one will keep it company 8-).
+
+There are two lines of code that I've added to the skeleton which seem to
+solve the problem of repeated calls at end of file and the yymore()
+situation. I'll briefly describe them so you can decide if you would like
+to consider including them.
+
+This is below the yywrap() test, near:
+ case EOB_ACT_END_OF_FILE:
+
+ yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
+
+ yyleng = YY_MORE_ADJ; /* <== Added Line */
+
+As the related comment described, yytext was carefully set up. This line
+sets up yyleng as for a normal token. The value will be the length of any
+yymore() token (normally zero), which is the difference between the
+current buffer pointer and the current text pointer. The code after the
+match
+is made sets he length to one greater because of the double null EOB
+marker. --yyleng will work as well.
+
+The second change is in the yy_get_next_buffer routine:
+
+ ret_val = EOB_ACT_END_OF_FILE;
+
+ /* <== Inserted if condition ==> */
+ if ( yyin != yy_current_buffer->yy_input_file
+ || yy_current_buffer-> yy_buffer_status == YY_BUFFER_NEW)
+
+ yyrestart( yyin );
+
+It makes the restart conditional on a change of the yyin address or a newly
+created buffer. It is not exactly the way I would like it, but it is not
+unreasonable.
+
+I can understand the desire to allow the user to just reassign yyin within
+an <<EOF>> rule, but I think the earlier version approach of requiring the
+user to issue YY_NEW_FILE is more orderly. The philosophical issue is
+if EOF is a persistent state or if a recall after it should automatically
+imply that a new file is being provided. Both sides of the argument can
+have
+advantages for the user and I had hoped for some discussion of the point
+in case there is something that I don't understand about it.
+
+I'm still testing and researching the code and will let you know if I find
+anything else necessary - I need to more fully check the input() routine. I
+spent a while checking both the skeleton logic and the various alternatives
+generated within gen.c. Hopefully I didn't miss anything. .
+
+Bill Fenlason
+
+
+
+
+
+
+
+
+1, answered,,
+X-Coding-System: nil
+Mail-from: From vern@daffy.ee.lbl.gov Sun Jun 17 03:08:59 2001
+Return-Path: <vern@daffy.ee.lbl.gov>
+Received: from localhost (localhost [127.0.0.1])
+ by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id DAA06939
+ for <wlestes@localhost>; Sun, 17 Jun 2001 03:08:58 -0400
+Received: from imap.uncg.edu
+ by localhost with IMAP (fetchmail-5.1.0)
+ for wlestes@localhost (single-drop); Sun, 17 Jun 2001 03:08:58 -0400 (EDT)
+Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70])
+ by hermes.uncg.edu (8.11.0/8.11.0) with ESMTP id f5H76cs21638
+ for <wlestes@hermes.email.uncg.edu>; Sun, 17 Jun 2001 03:06:38 -0400 (EDT)
+Received: from daffy.ee.lbl.gov (daffy.ee.lbl.gov [131.243.1.31])
+ by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id DAA19164
+ for <wlestes@uncg.edu>; Sun, 17 Jun 2001 03:06:38 -0400 (EDT)
+Received: (from vern@localhost)
+ by daffy.ee.lbl.gov (8.10.0/8.10.0) id f5H76So24900;
+ Sun, 17 Jun 2001 00:06:28 -0700 (PDT)
+Message-Id: <200106170706.f5H76So24900@daffy.ee.lbl.gov>
+To: Theo de Raadt <deraadt@cvs.openbsd.org>
+Subject: Re: lex license
+Cc: wlestes@uncg.edu
+In-reply-to: Your message of Sat, 02 Jun 2001 13:15:37 PDT.
+Date: Sun, 17 Jun 2001 00:06:28 PDT
+From: Vern Paxson <vern@ee.lbl.gov>
+
+*** EOOH ***
+To: Theo de Raadt <deraadt@cvs.openbsd.org>
+Subject: Re: lex license
+Cc: wlestes@uncg.edu
+In-reply-to: Your message of Sat, 02 Jun 2001 13:15:37 PDT.
+Date: Sun, 17 Jun 2001 00:06:28 PDT
+From: Vern Paxson <vern@ee.lbl.gov>
+
+> Specifically, this license does not grant modification
+> rights -- which must be explicitly granted under copyright law.
+
+Yes, this came up a while ago, and I put together a flex release with
+a modified copyright that begins:
+
+ Redistribution and use in source and binary forms, with or
+ without modification, are permitted provided that:
+
+However, that version didn't get fully integrated into the sources I sent
+to Will. It's in the COPYING file but not in the individual source files,
+just because I hadn't gotten around to it.
+
+Will, feel free to update the copyrights in each of the files with the
+one in COPYING.
+
+ Vern
+
+
+1,,
+X-Coding-System: nil
+Mail-from: From help-flex-admin@gnu.org Sun Jun 17 13:08:17 2001
+Return-Path: <help-flex-admin@gnu.org>
+Received: from localhost (localhost [127.0.0.1])
+ by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id NAA08097
+ for <wlestes@localhost>; Sun, 17 Jun 2001 13:08:17 -0400
+Received: from imap.uncg.edu
+ by localhost with IMAP (fetchmail-5.1.0)
+ for wlestes@localhost (single-drop); Sun, 17 Jun 2001 13:08:17 -0400 (EDT)
+Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70])
+ by hermes.uncg.edu (8.11.0/8.11.0) with ESMTP id f5HH62s28053
+ for <wlestes@hermes.email.uncg.edu>; Sun, 17 Jun 2001 13:06:02 -0400 (EDT)
+Received: from fencepost.gnu.org (we-refuse-to-spy-on-our-users@fencepost.gnu.org [199.232.76.164])
+ by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id NAA09353
+ for <wlestes@uncg.edu>; Sun, 17 Jun 2001 13:06:02 -0400 (EDT)
+Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org)
+ by fencepost.gnu.org with esmtp (Exim 3.16 #1 (Debian))
+ id 15Bfzu-0005ly-00
+ for <wlestes@uncg.edu>; Sun, 17 Jun 2001 13:06:02 -0400
+Received: from web9406.mail.yahoo.com ([216.136.129.22])
+ by fencepost.gnu.org with smtp (Exim 3.16 #1 (Debian))
+ id 15BfxJ-0005iZ-00
+ for <help-flex@gnu.org>; Sun, 17 Jun 2001 13:03:21 -0400
+Message-ID: <20010617170320.76960.qmail@web9406.mail.yahoo.com>
+Received: from [205.197.108.252] by web9406.mail.yahoo.com; Sun, 17 Jun 2001 10:03:20 PDT
+From: "John W. Millaway" <johnmillaway@yahoo.com>
+Subject: Re: yylineno
+To: Bill Fenlason <BillFen@Ulster.Net>
+Cc: help-flex@gnu.org
+In-Reply-To: <001601c0f6ce$b174eda0$0400a8c0@abit>
+MIME-Version: 1.0
+Content-Type: text/plain; charset=us-ascii
+Sender: help-flex-admin@gnu.org
+Errors-To: help-flex-admin@gnu.org
+X-BeenThere: help-flex@gnu.org
+X-Mailman-Version: 2.0.5
+Precedence: bulk
+List-Help: <mailto:help-flex-request@gnu.org?subject=help>
+List-Post: <mailto:help-flex@gnu.org>
+List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=subscribe>
+List-Id: Users list for Flex,
+ the GNU lexical analyser generator <help-flex.gnu.org>
+List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=unsubscribe>
+List-Archive: <http://mail.gnu.org/pipermail/help-flex/>
+Date: Sun, 17 Jun 2001 10:03:20 -0700 (PDT)
+
+*** EOOH ***
+From: "John W. Millaway" <johnmillaway@yahoo.com>
+Subject: Re: yylineno
+To: Bill Fenlason <BillFen@Ulster.Net>
+Cc: help-flex@gnu.org
+In-Reply-To: <001601c0f6ce$b174eda0$0400a8c0@abit>
+Sender: help-flex-admin@gnu.org
+Precedence: bulk
+List-Help: <mailto:help-flex-request@gnu.org?subject=help>
+List-Post: <mailto:help-flex@gnu.org>
+List-Subscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=subscribe>
+List-Id: Users list for Flex,
+ the GNU lexical analyser generator <help-flex.gnu.org>
+List-Unsubscribe: <http://mail.gnu.org/mailman/listinfo/help-flex>,
+ <mailto:help-flex-request@gnu.org?subject=unsubscribe>
+List-Archive: <http://mail.gnu.org/pipermail/help-flex/>
+Date: Sun, 17 Jun 2001 10:03:20 -0700 (PDT)
+
+> How do you (or would you) keep track of the token offset within the line?
+>
+
+By this, do you mean the "column"? If your tokens do not span lines,
+then you can use yyleng. If the tokens do span lines,
+then you have to rescan the token. Yuk!
+
+%%
+ /* This is untested code. But in the right spirit ! */
+ static int yycol=0, next_col=0;
+ char* _p;
+
+ /* Update yycol for tokens that do not contain '\n' */
+ #define COL() yycol=next_col; next_col += yyleng
+
+ /* Update yycol for tokens that may possibly contain '\n' */
+ #define COLN() do{ \
+ yycol=next_col; \
+ for(_p=yytext; *_p; _p++,next_col++) \
+ if( *_p == '\n' ) \
+ next_col = -1; \
+ }while(0)
+
+ #define NEWL() yycol = next_col= 0
+
+foo|bar { COL(); printf("%d: %s\n" , yycol, yytext); }
+\n { NEWL(); printf("%d: NEWL\n", yycol); }
+foo\nbar { COLN(); printf("%d: %s\n" , yycol, yytext); }
+
+%%
+
+-John
+
+
+
+__________________________________________________
+Do You Yahoo!?
+Spot the hottest trends in music, movies, and more.
+http://buzz.yahoo.com/
+
+_______________________________________________
+Help-flex mailing list
+Help-flex@gnu.org
+http://mail.gnu.org/mailman/listinfo/help-flex
+
+
+1, answered,,
+X-Coding-System: nil
+Mail-from: From avn@any.ru Sun Jun 24 03:10:57 2001
+Return-Path: <avn@any.ru>
+Received: from localhost (localhost [127.0.0.1])
+ by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id DAA10135
+ for <wlestes@localhost>; Sun, 24 Jun 2001 03:10:57 -0400
+Received: from imap.uncg.edu
+ by localhost with IMAP (fetchmail-5.1.0)
+ for wlestes@localhost (single-drop); Sun, 24 Jun 2001 03:10:57 -0400 (EDT)
+Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70])
+ by hermes.uncg.edu (8.11.0/8.11.0) with ESMTP id f5O78ts09193
+ for <wlestes@hermes.email.uncg.edu>; Sun, 24 Jun 2001 03:08:55 -0400 (EDT)
+Received: from ajax2.sovam.com (ajax2.sovam.com [194.67.1.173])
+ by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id DAA15567
+ for <wlestes@uncg.edu>; Sun, 24 Jun 2001 03:08:54 -0400 (EDT)
+Received: from ts11-a1.dial.sovam.com ([195.239.68.1]:2044 "EHLO srv2.any"
+ ident: "TIMEDOUT" whoson: "-unregistered-" smtp-auth: <none> TLS-CIPHER:
+ <none> TLS-PEER: <none>) by ajax2.sovam.com with ESMTP
+ id <S426173AbRFXHIs>; Sun, 24 Jun 2001 11:08:48 +0400
+Received: from localhost (avn@localhost)
+ by srv2.any (8.11.3/8.11.3) with ESMTP id f5O7Adg89096
+ for <wlestes@uncg.edu>; Sun, 24 Jun 2001 11:10:39 +0400 (MSD)
+ (envelope-from avn@any.ru)
+Date: Sun, 24 Jun 2001 11:10:39 +0400 (MSD)
+From: "Alexey V. Neyman" <avn@any.ru>
+X-X-Sender: <avn@srv2.any>
+To: <wlestes@uncg.edu>
+Subject: lex generates files that give warnings with gcc
+Message-ID: <20010624111019.R89058-100000@srv2.any>
+MIME-Version: 1.0
+Content-Type: TEXT/PLAIN; charset=US-ASCII
+
+*** EOOH ***
+Date: Sun, 24 Jun 2001 11:10:39 +0400 (MSD)
+From: "Alexey V. Neyman" <avn@any.ru>
+To: <wlestes@uncg.edu>
+Subject: lex generates files that give warnings with gcc
+
+Hello!
+
+I compiled lex-produced files with 'gcc -Wconversion', and it gives
+warnings about passing arguments to fread/fwrite as unsigned due to
+function prototypes. This produces warnings when program is compiled
+under suggested 'strict warnings' in FreeBSD, ${BDECFLAGS}. More, these
+warnings point to .l file that was fed to lex.
+
+You can see detailed problem report, samples of failing code and a
+proposed fix at:
+
+http://www.freebsd.org/cgi/query-pr.cgi?pr=28364
+
+Regards, Alexey.
+PS. Waiting for fix and for FreeBSD to import fixed :)
+
+--
+-------------------------------------------------+---------------------------
+ We chose to leave when there was | Regards, Alexey V. Neyman
+ no longer a reason to stay. | mailto: avn@any.ru
+---------------------------------( Arilou, SC2 )-+---------------------------
+
+
+
+
+1, answered,,
+X-Coding-System: nil
+Mail-from: From ashalper@usgs.gov Mon Jul 23 20:31:28 2001
+Return-Path: <ashalper@usgs.gov>
+Received: from localhost (localhost [127.0.0.1])
+ by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id UAA31191
+ for <wlestes@localhost>; Mon, 23 Jul 2001 20:31:28 -0400
+Received: from imap.uncg.edu
+ by localhost with IMAP (fetchmail-5.1.0)
+ for wlestes@localhost (single-drop); Mon, 23 Jul 2001 20:31:28 -0400 (EDT)
+Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70])
+ by hermes.uncg.edu (8.11.0/8.11.0) with ESMTP id f6O0QmW26609
+ for <wlestes@hermes.email.uncg.edu>; Mon, 23 Jul 2001 20:26:48 -0400 (EDT)
+Received: from gsazflgm01.wr.usgs.gov (gsazflgm01.wr.usgs.gov [130.118.164.152])
+ by external-gw.uncg.edu (8.9.3/8.9.3) with ESMTP id UAA17843
+ for <wlestes@uncg.edu>; Mon, 23 Jul 2001 20:26:47 -0400 (EDT)
+Subject: Re: shared object libfl?
+To: wlestes@uncg.edu
+X-Mailer: Lotus Notes Release 5.0.1b September 30, 1999
+Message-ID: <OF7BEDABA3.AFD35C13-ON07256A92.00837F9F@wr.usgs.gov>
+From: "Andrew S Halper" <ashalper@usgs.gov>
+Date: Mon, 23 Jul 2001 16:56:52 -0700
+X-MIMETrack: Serialize by Router on gsazflgm01/SERVER/USGS/DOI(Release 5.0.7 |March 21, 2001) at
+ 07/23/2001 05:26:49 PM
+MIME-Version: 1.0
+Content-type: text/plain; charset=us-ascii
+
+*** EOOH ***
+Subject: Re: shared object libfl?
+To: wlestes@uncg.edu
+From: "Andrew S Halper" <ashalper@usgs.gov>
+Date: Mon, 23 Jul 2001 16:56:52 -0700
+
+
+----- Forwarded by Andrew S Halper/WRD/USGS/DOI on 07/23/01 04:56 PM -----
+
+ Vern Paxson
+ <vern@ee.lbl. To: "Andrew S Halper" <ashalper@usgs.gov>
+ gov> cc:
+ Subject: Re: shared object libfl?
+ 07/23/01
+ 05:15 PM
+
+
+
+
+
+> Is there any special reason a shared object library is not built by the
+> flex source? Is there a 'configure' option to make one?
+
+Please send this to Will Estes (wlestes@uncg.edu), who has now taken over
+flex maintenance and development.
+
+ Thanks,
+
+ Vern
+
+
+
+
+1,,
+X-Coding-System: nil
+Mail-from: From johnmillaway@yahoo.com Thu Aug 16 11:11:13 2001
+Return-Path: <johnmillaway@yahoo.com>
+Received: from localhost (localhost [127.0.0.1])
+ by michael.uncg.edu (8.9.3/8.9.3) with ESMTP id LAA22070
+ for <wlestes@localhost>; Thu, 16 Aug 2001 11:11:13 -0400
+Received: from imap.uncg.edu
+ by localhost with IMAP (fetchmail-5.1.0)
+ for wlestes@localhost (single-drop); Thu, 16 Aug 2001 11:11:13 -0400 (EDT)
+Received: from external-gw.uncg.edu (external-gw.uncg.edu [152.13.2.70])
+ by hermes.uncg.edu (8.11.0/8.11.0) with ESMTP id f7GF5xW19868
+ for <wlestes@hermes.email.uncg.edu>; Thu, 16 Aug 2001 11:05:59 -0400 (EDT)
+Received: from web9405.mail.yahoo.com (web9405.mail.yahoo.com [216.136.129.111])
+ by external-gw.uncg.edu (8.9.3/8.9.3) with SMTP id LAA07077
+ for <wlestes@uncg.edu>; Thu, 16 Aug 2001 11:05:57 -0400 (EDT)
+Message-ID: <20010816150558.37014.qmail@web9405.mail.yahoo.com>
+Received: from [216.254.82.102] by web9405.mail.yahoo.com; Thu, 16 Aug 2001 08:05:58 PDT
+Date: Thu, 16 Aug 2001 08:05:58 -0700 (PDT)
+From: "John W. Millaway" <johnmillaway@yahoo.com>
+Subject: Re: comments in lexical definitions
+To: Tobias Ostgathe <ostgathe@tesionmail.de>
+Cc: help-flex@gnu.org, Hans-Bernhard Broeker <broeker@physik.rwth-aachen.de>,
+ "W. L. Estes" <wlestes@uncg.edu>
+In-Reply-To: <003301c1264e$0677bea0$2465e2c3@wuschtbix>
+MIME-Version: 1.0
+Content-Type: text/plain; charset=us-ascii
+
+*** EOOH ***
+Date: Thu, 16 Aug 2001 08:05:58 -0700 (PDT)
+From: "John W. Millaway" <johnmillaway@yahoo.com>
+Subject: Re: comments in lexical definitions
+To: Tobias Ostgathe <ostgathe@tesionmail.de>
+Cc: help-flex@gnu.org, Hans-Bernhard Broeker <broeker@physik.rwth-aachen.de>,
+ "W. L. Estes" <wlestes@uncg.edu>
+In-Reply-To: <003301c1264e$0677bea0$2465e2c3@wuschtbix>
+
+> > > I'm missing the possibility to include comments in lexical definition
+
+Flex does allow comments everywhere you could possibly need them. This
+discussion suggests a failure in the flex docs to make the syntax clear. What's
+the trick, then?
+
+1. Use traditional C comments, not '//' comments.
+2. INDENT THE COMMENT.
+
+-John
+(Exhaustive example follows)
+
+%{
+ /* 1 */
+%}
+ /* 2 */
+%option reentrant
+%x STATE_X
+
+%%
+ /* 3 */
+ruleA /* 4 */ { /* 5 */}
+ruleB /* 6 */ ECHO; /* 7 */
+ /* 8 */
+<STATE_X>{
+ruleC ECHO;
+ /* 9 */
+ruleD ECHO;
+}
+
+%%
+/* 10 */
+
+
+
+__________________________________________________
+Do You Yahoo!?
+Make international calls for as low as $.04/minute with Yahoo! Messenger
+http://phonecard.yahoo.com/
+
+ \ No newline at end of file
diff --git a/to.do/streams.mail b/to.do/streams.mail
new file mode 100644
index 0000000..0e6a093
--- /dev/null
+++ b/to.do/streams.mail
@@ -0,0 +1,194 @@
+Received: from 204.33.249.66 by ee.lbl.gov for <vern@ee.lbl.gov> (8.8.2/1.43r)
+ id SAA22776; Sun, 17 Nov 1996 18:18:35 -0800 (PST)
+Received: by paradigm.webvision.com (940816.SGI.8.6.9/940406.SGI)
+ id SAA10316; Sun, 17 Nov 1996 18:18:10 -0800
+Date: Sun, 17 Nov 1996 18:18:10 -0800
+Message-Id: <199611180218.SAA10316@paradigm.webvision.com>
+From: dave madden <dhm@paradigm.webvision.com>
+To: vern@ee.lbl.gov
+CC: jebossom@cognos.com
+In-reply-to: <199611130423.UAA10645@daffy.ee.lbl.gov> (message from Vern
+ Paxson on Tue, 12 Nov 1996 20:23:35 PST)
+Subject: Re: flex-2.5.3: wedging streams
+Status: U
+
+ =>Date: Tue, 12 Nov 1996 20:23:35 PST
+ =>From: Vern Paxson <vern@ee.lbl.gov>
+ =>
+[=>>from dhm@webvision.com]
+ =>> After poking around in the generated scanner, it looks like I need to
+ =>> be able to return a new code from yy_get_next_buffer (say
+ =>> EOB_ACT_TRY_AGAIN) that'll cause yylex() to remember where it is
+ =>> and return to its caller with a "no-token-available" indication. The
+ =>> next call of yylex( ) should recover the saved state and consequently
+ =>> retry yy_get_next_buffer( ) immediately.
+ =>
+ =>This would be a nice feature to have. No one is working on it as far
+ =>as I know. John Bossom (jebossom@Cognos.COM) is working on reentrant
+ =>scanners, though, which have the entire scanning state encapsulated in
+ =>a single struct.
+ =>...
+ =>The trick of
+ =>course is in getting the state reset correctly. This is already done for
+ =>EOB_ACT_CONTINUE_SCAN (which then also advances the state machine using
+ =>yy_get_previous_state()), so you should be able to follow what it does.
+
+Well, I got it working. I added a flag and some state in the
+yy_buffer_state structure to hold yy_bp and start_state, and some code
+in gen.c and flex.skl to test the flag and do [what I hope is] the
+right thing. The patches are appended. I wish I had time to do a
+cleaner job of it (and thoroughly test it -- I dunno if it'll work
+right when faced with strange buffer switching) but I'm in a bit of a
+hurry... I did try it with both C and C++, though. If you're
+interested, I'll clean up my test progs and send them as well.
+
+To use it, just define YY_WEDGE to be the token you want returned if
+the input stream blocks, and (optionally) YY_IS_WEDGED( ) to be a
+function returning a boolean. If you don't define YY_IS_WEDGED, the
+default is to do "(errno==EWOULDBLOCK)". Then, if YY_INPUT returns 0
+and YY_IS_WEDGED( ) is true, yylex( ) will return YY_WEDGE. If
+YY_WEDGE is not defined, almost all my code gets #ifdef'd out and you
+get a regular parser.
+
+Regards,
+d.
+
+diff -c flex-2.5.4.orig/flex.skl flex-2.5.4/flex.skl
+*** flex-2.5.4.orig/flex.skl Tue Sep 10 16:58:54 1996
+--- flex-2.5.4/flex.skl Sun Nov 17 17:44:12 1996
+***************
+*** 111,116 ****
+--- 111,117 ----
+ #define EOB_ACT_CONTINUE_SCAN 0
+ #define EOB_ACT_END_OF_FILE 1
+ #define EOB_ACT_LAST_MATCH 2
++ #define EOB_ACT_INPUT_BLOCKED 3
+
+ /* The funky do-while in the following #define is used to turn the definition
+ * int a single C statement (which needs a semi-colon terminator). This
+***************
+*** 182,187 ****
+--- 183,199 ----
+ */
+ int yy_is_interactive;
+
++ /*
++ * Whether this input source returned EWOULDBLOCK on the last
++ * read, indicating that it's not finished, but that there are no
++ * data available now. (If this is set, the scanner will load its
++ * state from the yy_b_buf_p and yy_state rather than from
++ * its normal sources)
++ */
++ int yy_blocked;
++ char *yy_b_buf_p;
++ void *yy_continue_state;
++
+ /* Whether we're considered to be at the beginning of a line.
+ * If so, '^' rules will be active on the next match, otherwise
+ * not.
+***************
+*** 634,639 ****
+--- 646,660 ----
+ yy_cp = yy_c_buf_p;
+ yy_bp = yytext_ptr + YY_MORE_ADJ;
+ goto yy_find_action;
++ #ifdef YY_WEDGE
++ case EOB_ACT_INPUT_BLOCKED:
++ yy_current_buffer->yy_blocked = 1;
++ yy_current_buffer->yy_continue_state = (void *)(yy_start);
++ yy_current_buffer->yy_b_buf_p = yytext_ptr + YY_MORE_ADJ;
++ yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
++ yy_hold_char = *yy_c_buf_p;
++ return YY_WEDGE;
++ #endif /* defined(YY_WEDGE) */
+ }
+ break;
+ }
+***************
+*** 735,740 ****
+--- 756,762 ----
+ * EOB_ACT_LAST_MATCH -
+ * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ * EOB_ACT_END_OF_FILE - end of file
++ * EOB_ACT_INPUT_BLOCKED - YY_INPUT returned 0 and errno == EWOULDBLOCK
+ */
+
+ %-
+***************
+*** 844,849 ****
+--- 866,880 ----
+
+ if ( yy_n_chars == 0 )
+ {
++ #ifdef YY_WEDGE
++ #ifndef YY_IS_WEDGED
++ #include <sys/errno.h>
++ #define YY_IS_WEDGED() (errno == EWOULDBLOCK)
++ #endif /* !defined(YY_IS_WEDGED) */
++ if (YY_IS_WEDGED( )) {
++ ret_val = EOB_ACT_INPUT_BLOCKED;
++ } else
++ #endif /* defined(YY_WEDGE) */
+ if ( number_to_move == YY_MORE_ADJ )
+ {
+ ret_val = EOB_ACT_END_OF_FILE;
+***************
+*** 881,886 ****
+--- 912,918 ----
+ {
+ register yy_state_type yy_current_state;
+ register char *yy_cp;
++ char *yy_bp;
+
+ %% code to get the start state into yy_current_state goes here
+
+***************
+*** 1215,1220 ****
+--- 1247,1253 ----
+ %+
+ b->yy_is_interactive = 0;
+ %*
++ b->yy_blocked = 0;
+ }
+
+
+diff -c flex-2.5.4.orig/gen.c flex-2.5.4/gen.c
+*** flex-2.5.4.orig/gen.c Sat May 25 20:43:44 1996
+--- flex-2.5.4/gen.c Sun Nov 17 17:40:55 1996
+***************
+*** 750,755 ****
+--- 750,770 ----
+
+ void gen_start_state()
+ {
++ outn( "#ifdef YY_WEDGE" );
++ indent_puts( "if (yy_current_buffer->yy_blocked)" );
++ indent_up( );
++ indent_puts( "{" );
++ indent_puts( "yy_current_buffer->yy_blocked = 0;" );
++ indent_puts(
++ "yy_current_state = (yy_state_type)(yy_current_buffer->yy_continue_state);" );
++ indent_puts( "yy_bp = yy_current_buffer->yy_b_buf_p;" );
++ indent_puts( "}" );
++ indent_down( );
++ indent_puts( "else" );
++ indent_up( );
++ indent_puts( "{" );
++ outn( "#endif /* defined(YY_WEDGE) */" );
++
+ if ( fullspd )
+ {
+ if ( bol_needed )
+***************
+*** 776,781 ****
+--- 791,800 ----
+ indent_puts( "*yy_state_ptr++ = yy_current_state;" );
+ }
+ }
++ outn( "#ifdef YY_WEDGE" );
++ indent_puts( "}" );
++ indent_down( );
++ outn( "#endif /* defined(YY_WEDGE) */" );
+ }
+
+
diff --git a/to.do/unicode/FlexLexer.h b/to.do/unicode/FlexLexer.h
new file mode 100644
index 0000000..1764112
--- /dev/null
+++ b/to.do/unicode/FlexLexer.h
@@ -0,0 +1,195 @@
+// $Header$
+
+// FlexLexer.h -- define interfaces for lexical analyzer classes generated
+// by flex
+
+// Copyright (c) 1993 The Regents of the University of California.
+// All rights reserved.
+//
+// This code is derived from software contributed to Berkeley by
+// Kent Williams and Tom Epperly.
+//
+// Redistribution and use in source and binary forms are permitted provided
+// that: (1) source distributions retain this entire copyright notice and
+// comment, and (2) distributions including binaries display the following
+// acknowledgement: ``This product includes software developed by the
+// University of California, Berkeley and its contributors'' in the
+// documentation or other materials provided with the distribution and in
+// all advertising materials mentioning features or use of this software.
+// 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.
+
+// This file defines FlexLexer, an abstract class which specifies the
+// external interface provided to flex C++ lexer objects, and yyFlexLexer,
+// which defines a particular lexer class.
+//
+// If you want to create multiple lexer classes, you use the -P flag
+// to rename each yyFlexLexer to some other xxFlexLexer. You then
+// include <FlexLexer.h> in your other sources once per lexer class:
+//
+// #undef yyFlexLexer
+// #define yyFlexLexer xxFlexLexer
+// #include <FlexLexer.h>
+//
+// #undef yyFlexLexer
+// #define yyFlexLexer zzFlexLexer
+// #include <FlexLexer.h>
+// ...
+//
+// Since this header is generic for all sizes of flex scanners, you must
+// define the type YY_CHAR before including it:
+//
+// typedef xxx YY_CHAR;
+// #include <FlexLexer.h>
+// ...
+//
+// where xxx = char for 7-bit scanners, unsigned char for 8-bit, and
+// wchar_t for 16-bit.
+
+#ifndef __FLEX_LEXER_H
+// Never included before - need to define base class.
+#define __FLEX_LEXER_H
+#include <iostream.h>
+
+extern "C++" {
+
+struct yy_buffer_state;
+typedef int yy_state_type;
+
+class FlexLexer {
+public:
+ virtual ~FlexLexer() { }
+
+ const YY_CHAR* YYText() { return yytext; }
+ int YYLeng() { return yyleng; }
+
+ virtual void
+ yy_switch_to_buffer( struct yy_buffer_state* new_buffer ) = 0;
+ virtual struct yy_buffer_state*
+ yy_create_buffer( istream* s, int size ) = 0;
+ virtual void yy_delete_buffer( struct yy_buffer_state* b ) = 0;
+ virtual void yyrestart( istream* s ) = 0;
+
+ virtual int yylex() = 0;
+
+ // Call yylex with new input/output sources.
+ int yylex( istream* new_in, ostream* new_out = 0 )
+ {
+ switch_streams( new_in, new_out );
+ return yylex();
+ }
+
+ // Switch to new input/output streams. A nil stream pointer
+ // indicates "keep the current one".
+ virtual void switch_streams( istream* new_in = 0,
+ ostream* new_out = 0 ) = 0;
+
+ int lineno() const { return yylineno; }
+
+ int debug() const { return yy_flex_debug; }
+ void set_debug( int flag ) { yy_flex_debug = flag; }
+
+protected:
+ YY_CHAR* yytext;
+ int yyleng;
+ int yylineno; // only maintained if you use %option yylineno
+ int yy_flex_debug; // only has effect with -d or "%option debug"
+};
+
+}
+#endif
+
+#if defined(yyFlexLexer) || ! defined(yyFlexLexerOnce)
+// Either this is the first time through (yyFlexLexerOnce not defined),
+// or this is a repeated include to define a different flavor of
+// yyFlexLexer, as discussed in the flex man page.
+#define yyFlexLexerOnce
+
+class yyFlexLexer : public FlexLexer {
+public:
+ // arg_yyin and arg_yyout default to the cin and cout, but we
+ // only make that assignment when initializing in yylex().
+ yyFlexLexer( istream* arg_yyin = 0, ostream* arg_yyout = 0 );
+
+ virtual ~yyFlexLexer();
+
+ void yy_switch_to_buffer( struct yy_buffer_state* new_buffer );
+ struct yy_buffer_state* yy_create_buffer( istream* s, int size );
+ void yy_delete_buffer( struct yy_buffer_state* b );
+ void yyrestart( istream* s );
+
+ virtual int yylex();
+ virtual void switch_streams( istream* new_in, ostream* new_out );
+
+protected:
+ virtual int LexerInput( YY_CHAR* buf, int max_size );
+ virtual void LexerOutput( const YY_CHAR* buf, int size );
+ virtual void LexerError( const char* msg );
+
+ void yyunput( int c, YY_CHAR* buf_ptr );
+ int yyinput();
+
+ void yy_load_buffer_state();
+ void yy_init_buffer( struct yy_buffer_state* b, istream* s );
+ void yy_flush_buffer( struct yy_buffer_state* b );
+
+ int yy_start_stack_ptr;
+ int yy_start_stack_depth;
+ int* yy_start_stack;
+
+ void yy_push_state( int new_state );
+ void yy_pop_state();
+ int yy_top_state();
+
+ yy_state_type yy_get_previous_state();
+ yy_state_type yy_try_NUL_trans( yy_state_type current_state );
+ int yy_get_next_buffer();
+
+ istream* yyin; // input source for default LexerInput
+ ostream* yyout; // output sink for default LexerOutput
+
+ struct yy_buffer_state* yy_current_buffer;
+
+ // yy_hold_char holds the character lost when yytext is formed.
+ YY_CHAR yy_hold_char;
+
+ // Number of characters read into yy_ch_buf.
+ int yy_n_chars;
+
+ // Points to current character in buffer.
+ YY_CHAR* yy_c_buf_p;
+
+ int yy_init; // whether we need to initialize
+ int yy_start; // 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 ...
+ int yy_did_buffer_switch_on_eof;
+
+ // The following are not always needed, but may be depending
+ // on use of certain flex features (like REJECT or yymore()).
+
+ yy_state_type yy_last_accepting_state;
+ YY_CHAR* yy_last_accepting_cpos;
+
+ yy_state_type* yy_state_buf;
+ yy_state_type* yy_state_ptr;
+
+ YY_CHAR* yy_full_match;
+ int* yy_full_state;
+ int yy_full_lp;
+
+ int yy_lp;
+ int yy_looking_for_trail_begin;
+
+ int yy_more_flag;
+ int yy_more_len;
+ int yy_more_offset;
+ int yy_prev_more_offset;
+};
+
+#endif
diff --git a/to.do/unicode/ccl.c b/to.do/unicode/ccl.c
new file mode 100644
index 0000000..1bfc1d5
--- /dev/null
+++ b/to.do/unicode/ccl.c
@@ -0,0 +1,149 @@
+/* ccl - routines for character classes */
+
+/*-
+ * 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 are permitted provided
+ * that: (1) source distributions retain this entire copyright notice and
+ * comment, and (2) distributions including binaries display the following
+ * acknowledgement: ``This product includes software developed by the
+ * University of California, Berkeley and its contributors'' in the
+ * documentation or other materials provided with the distribution and in
+ * all advertising materials mentioning features or use of this software.
+ * 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.
+ */
+
+/* $Header$ */
+
+#include "flexdef.h"
+
+/* ccladd - add a single character to a ccl */
+
+void ccladd( cclp, ch )
+int cclp;
+int ch;
+ {
+ int ind, len, newpos, i;
+
+ check_char( ch );
+
+ len = ccllen[cclp];
+ ind = cclmap[cclp];
+
+ /* check to see if the character is already in the ccl */
+
+ for ( i = 0; i < len; ++i )
+ if ( ccltbl[ind + i] == ch )
+ return;
+
+ newpos = ind + len;
+
+ if ( newpos >= current_max_ccl_tbl_size )
+ {
+ current_max_ccl_tbl_size += MAX_CCL_TBL_SIZE_INCREMENT;
+
+ ++num_reallocs;
+
+ ccltbl = reallocate_wchar_array( ccltbl,
+ current_max_ccl_tbl_size );
+ }
+
+ ccllen[cclp] = len + 1;
+ ccltbl[newpos] = ch;
+ }
+
+
+/* cclinit - return an empty ccl */
+
+int cclinit()
+ {
+ if ( ++lastccl >= current_maxccls )
+ {
+ current_maxccls += MAX_CCLS_INCREMENT;
+
+ ++num_reallocs;
+
+ cclmap = reallocate_integer_array( cclmap, current_maxccls );
+ ccllen = reallocate_integer_array( ccllen, current_maxccls );
+ cclng = reallocate_integer_array( cclng, current_maxccls );
+ }
+
+ if ( lastccl == 1 )
+ /* we're making the first ccl */
+ cclmap[lastccl] = 0;
+
+ else
+ /* The new pointer is just past the end of the last ccl.
+ * Since the cclmap points to the \first/ character of a
+ * ccl, adding the length of the ccl to the cclmap pointer
+ * will produce a cursor to the first free space.
+ */
+ cclmap[lastccl] = cclmap[lastccl - 1] + ccllen[lastccl - 1];
+
+ ccllen[lastccl] = 0;
+ cclng[lastccl] = 0; /* ccl's start out life un-negated */
+
+ return lastccl;
+ }
+
+
+/* cclnegate - negate the given ccl */
+
+void cclnegate( cclp )
+int cclp;
+ {
+ cclng[cclp] = 1;
+ }
+
+
+/* list_character_set - list the members of a set of characters in CCL form
+ *
+ * Writes to the given file a character-class representation of those
+ * characters present in the given CCL. A character is present if it
+ * has a non-zero value in the cset array.
+ */
+
+void list_character_set( file, cset )
+FILE *file;
+int cset[];
+ {
+ register int i;
+
+ putc( '[', file );
+
+ for ( i = 0; i < csize; ++i )
+ {
+ if ( cset[i] )
+ {
+ register int start_char = i;
+
+ putc( ' ', file );
+
+ fputs( readable_form( i ), file );
+
+ while ( ++i < csize && cset[i] )
+ ;
+
+ if ( i - 1 > start_char )
+ /* this was a run */
+ fprintf( file, "-%s", readable_form( i - 1 ) );
+
+ putc( ' ', file );
+ }
+ }
+
+ putc( ']', file );
+ }
diff --git a/to.do/unicode/changes.txt b/to.do/unicode/changes.txt
new file mode 100644
index 0000000..4d8ab37
--- /dev/null
+++ b/to.do/unicode/changes.txt
@@ -0,0 +1,102 @@
+Summary of changes for flex Unicode support
+
+- ccl.c
+ - ccladd()
+ - changed call to reallocate_Character_array to reallocate_wchar_array
+
+- ecs.c
+ - mkeccl()
+ - changed type of ccls from Char to wchar_t
+
+- flex.1
+ - added description of -U option
+ - added extra qualifier to -Ca option regarding usage with -U
+ - modified -C, -Cf, and -CF options regarding usage with -U
+
+- flex.skl
+ - changed all references of char (except error messages) to YY_CHAR
+ - added new insertion point for defining YY_CHAR and YY_SC_TO_UI()
+ - yy_scan_bytes()
+ - renamed to yy_scan_chars to avoid confusion with 2-byte chars
+ - renamed param bytes to chars
+ - ECHO
+ - redefined C version as fwrite(yytext, sizeof(YY_CHAR), yyleng, yyout)
+ - YY_INPUT
+ - removed char* cast on param buf of C++ version
+ - yyFlexLexer::LexerInput()
+ - changed get() call to read((unsigned char *) buf, sizeof(YY_CHAR))
+ - changed read() call to read((unsigned char *) buf, max_size *
+ sizeof(YY_CHAR))
+ - changed gcount() call to gcount() / sizeof(YY_CHAR)
+ - yyFlexLexer::LexerOutput()
+ - changed write() call to write((unsigned char *) buf, size *
+ sizeof(YY_CHAR))
+ - yy_get_next_buffer()
+ - yy_flex_realloc() call
+ - changed param b->yy_buf_size + 2 to
+ (b->yy_buf_size + 2) * sizeof(YY_CHAR)
+ - input() and yyFlexLexer::yyinput()
+ - changed line c = *(unsigned char *) yy_c_buf_p; to
+ c = YY_SC_TO_UI(*yy_c_buf_p);
+
+- flexdef.h
+ - defined CSIZE as 65536
+ - changed myesc() proto to return int
+ - changed type of ccltbl from Char * to wchar_t *
+ - added allocate_wchar_array() and reallocate_wchar_array() macros
+ - changed mkeccl() proto's first param to wchar_t[]
+ - changed cshell() proto's first param to wchar_t[]
+
+
+- FlexLexer.h
+ - changed all references of char (except error messages) to YY_CHAR
+ - added description about typedef'ing YY_CHAR before inclusion
+
+- gen.c
+ - changed appropriate references of char in output strings to YY_CHAR
+ - added C_uchar_decl and C_ushort_decl for 16-bit yy_ec type bump-down
+ - genecs()
+ - added code for 16-bit yy_ec type bump; -Ca bumps type to long
+ - make_tables()
+ - YY_INPUT
+ - read redefined as read(..., max_size * sizeof(YY_CHAR))
+ - added code to use getwc() and WEOF for 16-bit interactive
+ - fread redefined as fread(buf, sizeof(YY_CHAR), max_size, yyin)
+
+- main.c
+ - changed type of ccltbl from Char * to wchar_t *
+ - check_options()
+ - changed default csize from CSIZE to 256 due to redef of CSIZE
+ - added code to check for options incompatible with -U
+ - added code to ouput typedef of YY_CHAR to skeleton, plus extra call to
+ skelout() to get down to original insertion point
+ - flexend()
+ - added code to print "U" when printing stats
+ - flexinit()
+ - added code set csize for option -U
+ - changed assignment of csize in option -8 from CSIZE to 256 due to redef
+ of CSIZE
+ - readin()
+ - changed appropriate references of char in output strings to YY_CHAR
+ - removed output of YY_CHAR typedef; now located in check_options()
+ - usage()
+ - added fprintf for -U usage
+
+- misc.c
+ - check_char()
+ - added code to distinguish chars needing -8 and -U flags
+ - cshell()
+ - changed type of v from Char to wchar_t
+ - changed type of k from Char to wchar_t
+ - myesc()
+ - now returns an int to handle 16-bit escape sequences
+ - changed esc_char from Char to unsigned int as per htoi() and otoi()
+
+- scan.l
+ - changed ESCSEQ to accept 6 digit octal escapes and 4 digit hex escapes
+ - removed myesc() and ndlookup() protos
+ - added option "16bit"
+
+- tblcmp.c
+ - mktemplate
+ - changed type of transset from Char to wchar_t
diff --git a/to.do/unicode/ecs.c b/to.do/unicode/ecs.c
new file mode 100644
index 0000000..5c70191
--- /dev/null
+++ b/to.do/unicode/ecs.c
@@ -0,0 +1,225 @@
+/* ecs - equivalence class routines */
+
+/*-
+ * 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 are permitted provided
+ * that: (1) source distributions retain this entire copyright notice and
+ * comment, and (2) distributions including binaries display the following
+ * acknowledgement: ``This product includes software developed by the
+ * University of California, Berkeley and its contributors'' in the
+ * documentation or other materials provided with the distribution and in
+ * all advertising materials mentioning features or use of this software.
+ * 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.
+ */
+
+/* $Header$ */
+
+#include "flexdef.h"
+
+/* ccl2ecl - convert character classes to set of equivalence classes */
+
+void ccl2ecl()
+ {
+ int i, ich, newlen, cclp, ccls, cclmec;
+
+ for ( i = 1; i <= lastccl; ++i )
+ {
+ /* We loop through each character class, and for each character
+ * in the class, add the character's equivalence class to the
+ * new "character" class we are creating. Thus when we are all
+ * done, character classes will really consist of collections
+ * of equivalence classes
+ */
+
+ newlen = 0;
+ cclp = cclmap[i];
+
+ for ( ccls = 0; ccls < ccllen[i]; ++ccls )
+ {
+ ich = ccltbl[cclp + ccls];
+ cclmec = ecgroup[ich];
+
+ if ( cclmec > 0 )
+ {
+ ccltbl[cclp + newlen] = cclmec;
+ ++newlen;
+ }
+ }
+
+ ccllen[i] = newlen;
+ }
+ }
+
+
+/* cre8ecs - associate equivalence class numbers with class members
+ *
+ * fwd is the forward linked-list of equivalence class members. bck
+ * is the backward linked-list, and num is the number of class members.
+ *
+ * Returned is the number of classes.
+ */
+
+int cre8ecs( fwd, bck, num )
+int fwd[], bck[], num;
+ {
+ int i, j, numcl;
+
+ numcl = 0;
+
+ /* Create equivalence class numbers. From now on, ABS( bck(x) )
+ * is the equivalence class number for object x. If bck(x)
+ * is positive, then x is the representative of its equivalence
+ * class.
+ */
+ for ( i = 1; i <= num; ++i )
+ if ( bck[i] == NIL )
+ {
+ bck[i] = ++numcl;
+ for ( j = fwd[i]; j != NIL; j = fwd[j] )
+ bck[j] = -numcl;
+ }
+
+ return numcl;
+ }
+
+
+/* mkeccl - update equivalence classes based on character class xtions
+ *
+ * synopsis
+ * Char ccls[];
+ * int lenccl, fwd[llsiz], bck[llsiz], llsiz, NUL_mapping;
+ * void mkeccl( Char ccls[], int lenccl, int fwd[llsiz], int bck[llsiz],
+ * int llsiz, int NUL_mapping );
+ *
+ * ccls contains the elements of the character class, lenccl is the
+ * number of elements in the ccl, fwd is the forward link-list of equivalent
+ * characters, bck is the backward link-list, and llsiz size of the link-list.
+ *
+ * NUL_mapping is the value which NUL (0) should be mapped to.
+ */
+
+void mkeccl( ccls, lenccl, fwd, bck, llsiz, NUL_mapping )
+wchar_t ccls[];
+int lenccl, fwd[], bck[], llsiz, NUL_mapping;
+ {
+ int cclp, oldec, newec;
+ int cclm, i, j;
+ static unsigned char cclflags[CSIZE]; /* initialized to all '\0' */
+
+ /* Note that it doesn't matter whether or not the character class is
+ * negated. The same results will be obtained in either case.
+ */
+
+ cclp = 0;
+
+ while ( cclp < lenccl )
+ {
+ cclm = ccls[cclp];
+
+ if ( NUL_mapping && cclm == 0 )
+ cclm = NUL_mapping;
+
+ oldec = bck[cclm];
+ newec = cclm;
+
+ j = cclp + 1;
+
+ for ( i = fwd[cclm]; i != NIL && i <= llsiz; i = fwd[i] )
+ { /* look for the symbol in the character class */
+ for ( ; j < lenccl; ++j )
+ {
+ register int ccl_char;
+
+ if ( NUL_mapping && ccls[j] == 0 )
+ ccl_char = NUL_mapping;
+ else
+ ccl_char = ccls[j];
+
+ if ( ccl_char > i )
+ break;
+
+ if ( ccl_char == i && ! cclflags[j] )
+ {
+ /* We found an old companion of cclm
+ * in the ccl. Link it into the new
+ * equivalence class and flag it as
+ * having been processed.
+ */
+
+ bck[i] = newec;
+ fwd[newec] = i;
+ newec = i;
+ /* Set flag so we don't reprocess. */
+ cclflags[j] = 1;
+
+ /* Get next equivalence class member. */
+ /* continue 2 */
+ goto next_pt;
+ }
+ }
+
+ /* Symbol isn't in character class. Put it in the old
+ * equivalence class.
+ */
+
+ bck[i] = oldec;
+
+ if ( oldec != NIL )
+ fwd[oldec] = i;
+
+ oldec = i;
+
+ next_pt: ;
+ }
+
+ if ( bck[cclm] != NIL || oldec != bck[cclm] )
+ {
+ bck[cclm] = NIL;
+ fwd[oldec] = NIL;
+ }
+
+ fwd[newec] = NIL;
+
+ /* Find next ccl member to process. */
+
+ for ( ++cclp; cclflags[cclp] && cclp < lenccl; ++cclp )
+ {
+ /* Reset "doesn't need processing" flag. */
+ cclflags[cclp] = 0;
+ }
+ }
+ }
+
+
+/* mkechar - create equivalence class for single character */
+
+void mkechar( tch, fwd, bck )
+int tch, fwd[], bck[];
+ {
+ /* If until now the character has been a proper subset of
+ * an equivalence class, break it away to create a new ec
+ */
+
+ if ( fwd[tch] != NIL )
+ bck[fwd[tch]] = bck[tch];
+
+ if ( bck[tch] != NIL )
+ fwd[bck[tch]] = fwd[tch];
+
+ fwd[tch] = NIL;
+ bck[tch] = NIL;
+ }
diff --git a/to.do/unicode/flex.1 b/to.do/unicode/flex.1
new file mode 100644
index 0000000..545c58f
--- /dev/null
+++ b/to.do/unicode/flex.1
@@ -0,0 +1,4099 @@
+.TH FLEX 1 "April 1995" "Version 2.5"
+.SH NAME
+flex \- fast lexical analyzer generator
+.SH SYNOPSIS
+.B flex
+.B [\-bcdfhilnpstvwBFILTV78+? \-C[aefFmr] \-ooutput \-Pprefix \-Sskeleton]
+.B [\-\-help \-\-version]
+.I [filename ...]
+.SH OVERVIEW
+This manual describes
+.I flex,
+a tool for generating programs that perform pattern-matching on text. The
+manual includes both tutorial and reference sections:
+.nf
+
+ Description
+ a brief overview of the tool
+
+ Some Simple Examples
+
+ Format Of The Input File
+
+ Patterns
+ the extended regular expressions used by flex
+
+ How The Input Is Matched
+ the rules for determining what has been matched
+
+ Actions
+ how to specify what to do when a pattern is matched
+
+ The Generated Scanner
+ details regarding the scanner that flex produces;
+ how to control the input source
+
+ Start Conditions
+ introducing context into your scanners, and
+ managing "mini-scanners"
+
+ Multiple Input Buffers
+ how to manipulate multiple input sources; how to
+ scan from strings instead of files
+
+ End-of-file Rules
+ special rules for matching the end of the input
+
+ Miscellaneous Macros
+ a summary of macros available to the actions
+
+ Values Available To The User
+ a summary of values available to the actions
+
+ Interfacing With Yacc
+ connecting flex scanners together with yacc parsers
+
+ Options
+ flex command-line options, and the "%option"
+ directive
+
+ Performance Considerations
+ how to make your scanner go as fast as possible
+
+ Generating C++ Scanners
+ the (experimental) facility for generating C++
+ scanner classes
+
+ Incompatibilities With Lex And POSIX
+ how flex differs from AT&T lex and the POSIX lex
+ standard
+
+ Diagnostics
+ those error messages produced by flex (or scanners
+ it generates) whose meanings might not be apparent
+
+ Files
+ files used by flex
+
+ Deficiencies / Bugs
+ known problems with flex
+
+ See Also
+ other documentation, related tools
+
+ Author
+ includes contact information
+
+.fi
+.SH DESCRIPTION
+.I flex
+is a tool for generating
+.I scanners:
+programs which recognized lexical patterns in text.
+.I flex
+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
+.I rules. flex
+generates as output a C source file,
+.B lex.yy.c,
+which defines a routine
+.B yylex().
+This file is compiled and linked with the
+.B \-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.
+.SH SOME SIMPLE EXAMPLES
+.PP
+First some simple examples to get the flavor of how one uses
+.I flex.
+The following
+.I flex
+input specifies a scanner which whenever it encounters the string
+"username" will replace it with the user's login name:
+.nf
+
+ %%
+ username printf( "%s", getlogin() );
+
+.fi
+By default, any text not matched by a
+.I flex
+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 "username" expanded.
+In this input, there is just one rule. "username" is the
+.I pattern
+and the "printf" is the
+.I action.
+The "%%" marks the beginning of the rules.
+.PP
+Here's another simple example:
+.nf
+
+ int num_lines = 0, num_chars = 0;
+
+ %%
+ \\n ++num_lines; ++num_chars;
+ . ++num_chars;
+
+ %%
+ main()
+ {
+ yylex();
+ printf( "# of lines = %d, # of chars = %d\\n",
+ num_lines, num_chars );
+ }
+
+.fi
+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, "num_lines" and "num_chars", which are accessible
+both inside
+.B yylex()
+and in the
+.B main()
+routine declared after the second "%%". There are two rules, one
+which matches a newline ("\\n") and increments both the line count and
+the character count, and one which matches any character other than
+a newline (indicated by the "." regular expression).
+.PP
+A somewhat more complicated example:
+.nf
+
+ /* 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)\\n", yytext,
+ atoi( yytext ) );
+ }
+
+ {DIGIT}+"."{DIGIT}* {
+ printf( "A float: %s (%g)\\n", yytext,
+ atof( yytext ) );
+ }
+
+ if|then|begin|end|procedure|function {
+ printf( "A keyword: %s\\n", yytext );
+ }
+
+ {ID} printf( "An identifier: %s\\n", yytext );
+
+ "+"|"-"|"*"|"/" printf( "An operator: %s\\n", yytext );
+
+ "{"[^}\\n]*"}" /* eat up one-line comments */
+
+ [ \\t\\n]+ /* eat up whitespace */
+
+ . printf( "Unrecognized character: %s\\n", yytext );
+
+ %%
+
+ main( argc, argv )
+ int argc;
+ char **argv;
+ {
+ ++argv, --argc; /* skip over program name */
+ if ( argc > 0 )
+ yyin = fopen( argv[0], "r" );
+ else
+ yyin = stdin;
+
+ yylex();
+ }
+
+.fi
+This is the beginnings of a simple scanner for a language like
+Pascal. It identifies different types of
+.I 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
+.I flex
+input file consists of three sections, separated by a line with just
+.B %%
+in it:
+.nf
+
+ definitions
+ %%
+ rules
+ %%
+ user code
+
+.fi
+The
+.I definitions
+section contains declarations of simple
+.I name
+definitions to simplify the scanner specification, and declarations of
+.I start conditions,
+which are explained in a later section.
+.PP
+Name definitions have the form:
+.nf
+
+ name definition
+
+.fi
+The "name" is a word beginning with a letter or an underscore ('_')
+followed by zero or more letters, digits, '_', or '-' (dash).
+The definition is taken to begin at the first non-white-space character
+following the name and continuing to the end of the line.
+The definition can subsequently be referred to using "{name}", which
+will expand to "(definition)". For example,
+.nf
+
+ DIGIT [0-9]
+ ID [a-z][a-z0-9]*
+
+.fi
+defines "DIGIT" to be a regular expression which matches a
+single digit, and
+"ID" to be a regular expression which matches a letter
+followed by zero-or-more letters-or-digits.
+A subsequent reference to
+.nf
+
+ {DIGIT}+"."{DIGIT}*
+
+.fi
+is identical to
+.nf
+
+ ([0-9])+"."([0-9])*
+
+.fi
+and matches one-or-more digits followed by a '.' followed
+by zero-or-more digits.
+.PP
+The
+.I rules
+section of the
+.I flex
+input contains a series of rules of the form:
+.nf
+
+ pattern action
+
+.fi
+where 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
+.B 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
+.B %%
+in the input file may be skipped, too.
+.PP
+In the definitions and rules sections, any
+.I indented
+text or text enclosed in
+.B %{
+and
+.B %}
+is copied verbatim to the output (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 (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
+.I POSIX
+compliance; see below for other such features).
+.PP
+In the definitions section (but not in the rules section),
+an unindented comment (i.e., a line
+beginning with "/*") is also copied verbatim to the output up
+to the next "*/".
+.SH PATTERNS
+The patterns in the input are written using an extended set of regular
+expressions. These are:
+.nf
+
+ x match the character 'x'
+ . any character (byte) except newline
+ [xyz] a "character class"; in this case, the pattern
+ matches either an 'x', a 'y', or a 'z'
+ [abj-oZ] a "character class" with a range in it; matches
+ an 'a', a 'b', any letter from 'j' through 'o',
+ or a 'Z'
+ [^A-Z] a "negated character class", i.e., any character
+ but those in the class. In this case, any
+ character EXCEPT an uppercase letter.
+ [^A-Z\\n] any character EXCEPT an uppercase letter or
+ a newline
+ r* zero or more r's, where r is any regular expression
+ r+ one or more r's
+ r? zero or one r's (that is, "an optional r")
+ r{2,5} anywhere from two to five r's
+ r{2,} two or more r's
+ r{4} exactly 4 r's
+ {name} the expansion of the "name" definition
+ (see above)
+ "[xyz]\\"foo"
+ the literal string: [xyz]"foo
+ \\X if X is an 'a', 'b', 'f', 'n', 'r', 't', or 'v',
+ then the ANSI-C interpretation of \\x.
+ Otherwise, a literal 'X' (used to escape
+ operators such as '*')
+ \\0 a NUL character (ASCII code 0)
+ \\123 the character with octal value 123
+ \\x2a the character with hexadecimal value 2a
+ (r) match an r; parentheses are used to override
+ precedence (see below)
+
+
+ rs the regular expression r followed by the
+ regular expression s; called "concatenation"
+
+
+ r|s either an r or an s
+
+
+ r/s an r but only if it is followed by an s. The
+ text matched by s is included when determining
+ whether this rule is the "longest match",
+ but is then returned to the input before
+ the action is executed. So the action only
+ sees the text matched by r. This type
+ of pattern is called trailing context".
+ (There are some combinations of r/s that flex
+ cannot match correctly; see notes in the
+ Deficiencies / Bugs section below regarding
+ "dangerous trailing context".)
+ ^r an r, but only at the beginning of a line (i.e.,
+ which just starting to scan, or right after a
+ newline has been scanned).
+ r$ an r, but only at the end of a line (i.e., just
+ before a newline). Equivalent to "r/\\n".
+
+ Note that flex's notion of "newline" is exactly
+ whatever the C compiler used to compile flex
+ interprets '\\n' as; in particular, on some DOS
+ systems you must either filter out \\r's in the
+ input yourself, or explicitly use r/\\r\\n for "r$".
+
+
+ <s>r an r, but only in start condition s (see
+ below for discussion of start conditions)
+ <s1,s2,s3>r
+ same, but in any of start conditions s1,
+ s2, or s3
+ <*>r an r in any start condition, even an exclusive one.
+
+
+ <<EOF>> an end-of-file
+ <s1,s2><<EOF>>
+ an end-of-file when in start condition s1 or s2
+
+.fi
+Note that inside of a character class, all regular expression operators
+lose their special meaning except escape ('\\') and the character class
+operators, '-', ']', and, at the beginning of the class, '^'.
+.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,
+.nf
+
+ foo|bar*
+
+.fi
+is the same as
+.nf
+
+ (foo)|(ba(r*))
+
+.fi
+since the '*' operator has higher precedence than concatenation,
+and concatenation higher than alternation ('|'). This pattern
+therefore matches
+.I either
+the string "foo"
+.I or
+the string "ba" followed by zero-or-more r's.
+To match "foo" or zero-or-more "bar"'s, use:
+.nf
+
+ foo|(bar)*
+
+.fi
+and to match zero-or-more "foo"'s-or-"bar"'s:
+.nf
+
+ (foo|bar)*
+
+.fi
+.PP
+In addition to characters and ranges of characters, character classes
+can also contain character class
+.I expressions.
+These are expressions enclosed inside
+.B [:
+and
+.B :]
+delimiters (which themselves must appear between the '[' and ']' of the
+character class; other elements may occur inside the character class, too).
+The valid expressions are:
+.nf
+
+ [:alnum:] [:alpha:] [:blank:]
+ [:cntrl:] [:digit:] [:graph:]
+ [:lower:] [:print:] [:punct:]
+ [:space:] [:upper:] [:xdigit:]
+
+.fi
+These expressions all designate a set of characters equivalent to
+the corresponding standard C
+.B isXXX
+function. For example,
+.B [:alnum:]
+designates those characters for which
+.B isalnum()
+returns true - i.e., any alphabetic or numeric.
+Some systems don't provide
+.B isblank(),
+so flex defines
+.B [:blank:]
+as a blank or a tab.
+.PP
+For example, the following character classes are all equivalent:
+.nf
+
+ [[:alnum:]]
+ [[:alpha:][:digit:]
+ [[:alpha:]0-9]
+ [a-zA-Z0-9]
+
+.fi
+If your scanner is case-insensitive (the
+.B \-i
+flag), then
+.B [:upper:]
+and
+.B [:lower:]
+are equivalent to
+.B [:alpha:].
+.PP
+Some notes on patterns:
+.IP -
+A negated character class such as the example "[^A-Z]"
+above
+.I will match a newline
+unless "\\n" (or an equivalent escape sequence) is one of the
+characters explicitly present in the negated character class
+(e.g., "[^A-Z\\n]"). 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 [^"]* can match the entire
+input unless there's another quote in the input.
+.IP -
+A rule can have at most one instance of trailing context (the '/' operator
+or the '$' operator). The start condition, '^', and "<<EOF>>" patterns
+can only occur at the beginning of a pattern, and, as well as with '/' and '$',
+cannot be grouped inside parentheses. A '^' which does not occur at
+the beginning of a rule or a '$' which does not occur at the end of
+a rule loses its special properties and is treated as a normal character.
+.IP
+The following are illegal:
+.nf
+
+ foo/bar$
+ <sc1>foo<sc2>bar
+
+.fi
+Note that the first of these, can be written "foo/bar\\n".
+.IP
+The following will result in '$' or '^' being treated as a normal character:
+.nf
+
+ foo|(bar$)
+ foo|^bar
+
+.fi
+If what's wanted is a "foo" or a bar-followed-by-a-newline, the following
+could be used (the special '|' action is explained below):
+.nf
+
+ foo |
+ bar$ /* action goes here */
+
+.fi
+A similar trick will work for matching a foo or a
+bar-at-the-beginning-of-a-line.
+.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
+.I flex
+input file is chosen.
+.PP
+Once the match is determined, the text corresponding to the match
+(called the
+.I token)
+is made available in the global character pointer
+.B yytext,
+and its length in the global integer
+.B yyleng.
+The
+.I action
+corresponding to the matched pattern is then executed (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
+.I default rule
+is executed: the next character in the input is considered matched and
+copied to the standard output. Thus, the simplest legal
+.I flex
+input is:
+.nf
+
+ %%
+
+.fi
+which generates a scanner that simply copies its input (one character
+at a time) to its output.
+.PP
+Note that
+.B yytext
+can be defined in two different ways: either as a character
+.I pointer
+or as a character
+.I array.
+You can control which definition
+.I flex
+uses by including one of the special directives
+.B %pointer
+or
+.B %array
+in the first (definitions) section of your flex input. The default is
+.B %pointer,
+unless you use the
+.B -l
+lex compatibility option, in which case
+.B yytext
+will be an array.
+The advantage of using
+.B %pointer
+is substantially faster scanning and no buffer overflow when matching
+very large tokens (unless you run out of dynamic memory). The disadvantage
+is that you are restricted in how your actions can modify
+.B yytext
+(see the next section), and calls to the
+.B unput()
+function destroys the present contents of
+.B yytext,
+which can be a considerable porting headache when moving between different
+.I lex
+versions.
+.PP
+The advantage of
+.B %array
+is that you can then modify
+.B yytext
+to your heart's content, and calls to
+.B unput()
+do not destroy
+.B yytext
+(see below). Furthermore, existing
+.I lex
+programs sometimes access
+.B yytext
+externally using declarations of the form:
+.nf
+ extern char yytext[];
+.fi
+This definition is erroneous when used with
+.B %pointer,
+but correct for
+.B %array.
+.PP
+.B %array
+defines
+.B yytext
+to be an array of
+.B YYLMAX
+characters, which defaults to a fairly large value. You can change
+the size by simply #define'ing
+.B YYLMAX
+to a different value in the first section of your
+.I flex
+input. As mentioned above, with
+.B %pointer
+yytext grows dynamically to accommodate large tokens. While this means your
+.B %pointer
+scanner can accommodate very large tokens (such as matching entire blocks
+of comments), bear in mind that each time the scanner must resize
+.B yytext
+it also must rescan the entire token from the beginning, so matching such
+tokens can prove slow.
+.B yytext
+presently does
+.I not
+dynamically grow if a call to
+.B unput()
+results in too much text being pushed back; instead, a run-time error results.
+.PP
+Also note that you cannot use
+.B %array
+with C++ scanner classes
+(the
+.B 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 "zap me" from its input:
+.nf
+
+ %%
+ "zap me"
+
+.fi
+(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:
+.nf
+
+ %%
+ [ \\t]+ putchar( ' ' );
+ [ \\t]+$ /* ignore this token */
+
+.fi
+.PP
+If the action contains a '{', then the action spans till the balancing '}'
+is found, and the action may cross multiple lines.
+.I flex
+knows about C strings and comments and won't be fooled by braces found
+within them, but also allows actions to begin with
+.B %{
+and will consider the action to be all the text up to the next
+.B %}
+(regardless of ordinary braces inside the action).
+.PP
+An action consisting solely of a vertical bar ('|') means "same as
+the action for the next rule." See below for an illustration.
+.PP
+Actions can include arbitrary C code, including
+.B return
+statements to return a value to whatever routine called
+.B yylex().
+Each time
+.B 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
+.B 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
+.B %array
+(see above); in that case,
+.B yytext
+may be freely modified in any way.
+.PP
+Actions are free to modify
+.B yyleng
+except they should not do so if the action also includes use of
+.B yymore()
+(see below).
+.PP
+There are a number of special directives which can be included within
+an action:
+.IP -
+.B ECHO
+copies yytext to the scanner's output.
+.IP -
+.B BEGIN
+followed by the name of a start condition places the scanner in the
+corresponding start condition (see below).
+.IP -
+.B REJECT
+directs the scanner to proceed on to the "second best" rule which matched the
+input (or a prefix of the input). The rule is chosen as described
+above in "How the Input is Matched", and
+.B yytext
+and
+.B yyleng
+set up appropriately.
+It may either be one which matched as much text
+as the originally chosen rule but came later in the
+.I flex
+input file, or one which matched less text.
+For example, the following will both count the
+words in the input and call the routine special() whenever "frob" is seen:
+.nf
+
+ int word_count = 0;
+ %%
+
+ frob special(); REJECT;
+ [^ \\t\\n]+ ++word_count;
+
+.fi
+Without the
+.B REJECT,
+any "frob"'s in the input would not be counted as words, since the
+scanner normally executes only one action per token.
+Multiple
+.B REJECT's
+are allowed, each one finding the next best choice to the currently
+active rule. For example, when the following scanner scans the token
+"abcd", it will write "abcdabcaba" to the output:
+.nf
+
+ %%
+ a |
+ ab |
+ abc |
+ abcd ECHO; REJECT;
+ .|\\n /* eat up any unmatched character */
+
+.fi
+(The first three rules share the fourth's action since they use
+the special '|' action.)
+.B REJECT
+is a particularly expensive feature in terms of scanner performance;
+if it is used in
+.I any
+of the scanner's actions it will slow down
+.I all
+of the scanner's matching. Furthermore,
+.B REJECT
+cannot be used with the
+.I -Cf
+or
+.I -CF
+options (see below).
+.IP
+Note also that unlike the other special actions,
+.B REJECT
+is a
+.I branch;
+code immediately following it in the action will
+.I not
+be executed.
+.IP -
+.B yymore()
+tells the scanner that the next time it matches a rule, the corresponding
+token should be
+.I appended
+onto the current value of
+.B yytext
+rather than replacing it. For example, given the input "mega-kludge"
+the following will write "mega-mega-kludge" to the output:
+.nf
+
+ %%
+ mega- ECHO; yymore();
+ kludge ECHO;
+
+.fi
+First "mega-" is matched and echoed to the output. Then "kludge"
+is matched, but the previous "mega-" is still hanging around at the
+beginning of
+.B yytext
+so the
+.B ECHO
+for the "kludge" rule will actually write "mega-kludge".
+.PP
+Two notes regarding use of
+.B yymore().
+First,
+.B yymore()
+depends on the value of
+.I yyleng
+correctly reflecting the size of the current token, so you must not
+modify
+.I yyleng
+if you are using
+.B yymore().
+Second, the presence of
+.B yymore()
+in the scanner's action entails a minor performance penalty in the
+scanner's matching speed.
+.IP -
+.B yyless(n)
+returns all but the first
+.I n
+characters of the current token back to the input stream, where they
+will be rescanned when the scanner looks for the next match.
+.B yytext
+and
+.B yyleng
+are adjusted appropriately (e.g.,
+.B yyleng
+will now be equal to
+.I n
+). For example, on the input "foobar" the following will write out
+"foobarbar":
+.nf
+
+ %%
+ foobar ECHO; yyless(3);
+ [a-z]+ ECHO;
+
+.fi
+An argument of 0 to
+.B yyless
+will cause the entire current input string to be scanned again. Unless you've
+changed how the scanner will subsequently process its input (using
+.B BEGIN,
+for example), this will result in an endless loop.
+.PP
+Note that
+.B yyless
+is a macro and can only be used in the flex input file, not from
+other source files.
+.IP -
+.B unput(c)
+puts the character
+.I c
+back onto 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.
+.nf
+
+ {
+ int i;
+ /* Copy yytext because unput() trashes yytext */
+ char *yycopy = strdup( yytext );
+ unput( ')' );
+ for ( i = yyleng - 1; i >= 0; --i )
+ unput( yycopy[i] );
+ unput( '(' );
+ free( yycopy );
+ }
+
+.fi
+Note that since each
+.B unput()
+puts the given character back at the
+.I beginning
+of the input stream, pushing back strings must be done back-to-front.
+.PP
+An important potential problem when using
+.B unput()
+is that if you are using
+.B %pointer
+(the default), a call to
+.B unput()
+.I destroys
+the contents of
+.I yytext,
+starting with its rightmost character and devouring one character to
+the left with each call. If you need the value of yytext preserved
+after a call to
+.B unput()
+(as in the above example),
+you must either first copy it elsewhere, or build your scanner using
+.B %array
+instead (see How The Input Is Matched).
+.PP
+Finally, note that you cannot put back
+.B EOF
+to attempt to mark the input stream with an end-of-file.
+.IP -
+.B input()
+reads the next character from the input stream. For example,
+the following is one way to eat up C comments:
+.nf
+
+ %%
+ "/*" {
+ register 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 )
+ {
+ error( "EOF in comment" );
+ break;
+ }
+ }
+ }
+
+.fi
+(Note that if the scanner is compiled using
+.B C++,
+then
+.B input()
+is instead referred to as
+.B yyinput(),
+in order to avoid a name clash with the
+.B C++
+stream by the name of
+.I input.)
+.IP -
+.B 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
+.B YY_INPUT
+(see The Generated Scanner, below). This action is a special case
+of the more general
+.B yy_flush_buffer()
+function, described below in the section Multiple Input Buffers.
+.IP -
+.B 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 "all done".
+By default,
+.B yyterminate()
+is also called when an end-of-file is encountered. It is a macro and
+may be redefined.
+.SH THE GENERATED SCANNER
+The output of
+.I flex
+is the file
+.B lex.yy.c,
+which contains the scanning routine
+.B yylex(),
+a number of tables used by it for matching tokens, and a number
+of auxiliary routines and macros. By default,
+.B yylex()
+is declared as follows:
+.nf
+
+ int yylex()
+ {
+ ... various definitions and the actions in here ...
+ }
+
+.fi
+(If your environment supports function prototypes, then it will
+be "int yylex( void )".) This definition may be changed by defining
+the "YY_DECL" macro. For example, you could use:
+.nf
+
+ #define YY_DECL float lexscan( a, b ) float a, b;
+
+.fi
+to give the scanning routine the name
+.I lexscan,
+returning a float, and taking two floats as arguments. Note that
+if you give arguments to the scanning routine using a
+K&R-style/non-prototyped function declaration, you must terminate
+the definition with a semi-colon (;).
+.PP
+Whenever
+.B yylex()
+is called, it scans tokens from the global input file
+.I yyin
+(which defaults to stdin). It continues until it either reaches
+an end-of-file (at which point it returns the value 0) or
+one of its actions executes a
+.I return
+statement.
+.PP
+If the scanner reaches an end-of-file, subsequent calls are undefined
+unless either
+.I yyin
+is pointed at a new input file (in which case scanning continues from
+that file), or
+.B yyrestart()
+is called.
+.B yyrestart()
+takes one argument, a
+.B FILE *
+pointer (which can be nil, if you've set up
+.B YY_INPUT
+to scan from a source other than
+.I yyin),
+and initializes
+.I yyin
+for scanning from that file. Essentially there is no difference between
+just assigning
+.I yyin
+to a new input file or using
+.B yyrestart()
+to do so; the latter is available for compatibility with previous versions
+of
+.I flex,
+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
+.I yyin;
+but better is to use
+.B YY_FLUSH_BUFFER
+(see above).
+Note that
+.B yyrestart()
+does
+.I not
+reset the start condition to
+.B INITIAL
+(see Start Conditions, below).
+.PP
+If
+.B yylex()
+stops scanning due to executing a
+.I 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 (and for purposes of efficiency), the scanner uses
+block-reads rather than simple
+.I getc()
+calls to read characters from
+.I yyin.
+The nature of how it gets its input can be controlled by defining the
+.B YY_INPUT
+macro.
+YY_INPUT's calling sequence is "YY_INPUT(buf,result,max_size)". Its
+action is to place up to
+.I max_size
+characters in the character array
+.I buf
+and return in the integer variable
+.I result
+either the
+number of characters read or the constant YY_NULL (0 on Unix systems)
+to indicate EOF. The default YY_INPUT reads from the
+global file-pointer "yyin".
+.PP
+A sample definition of YY_INPUT (in the definitions
+section of the input file):
+.nf
+
+ %{
+ #define YY_INPUT(buf,result,max_size) \\
+ { \\
+ int c = getchar(); \\
+ result = (c == EOF) ? YY_NULL : (buf[0] = c, 1); \\
+ }
+ %}
+
+.fi
+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 YY_INPUT,
+it then checks the
+.B yywrap()
+function. If
+.B yywrap()
+returns false (zero), then it is assumed that the
+function has gone ahead and set up
+.I yyin
+to point to another input file, and scanning continues. If it returns
+true (non-zero), then the scanner terminates, returning 0 to its
+caller. Note that in either case, the start condition remains unchanged;
+it does
+.I not
+revert to
+.B INITIAL.
+.PP
+If you do not supply your own version of
+.B yywrap(),
+then you must either use
+.B %option noyywrap
+(in which case the scanner behaves as though
+.B yywrap()
+returned 1), or you must link with
+.B \-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:
+.B yy_scan_string(), yy_scan_bytes(),
+and
+.B yy_scan_buffer().
+See the discussion of them below in the section Multiple Input Buffers.
+.PP
+The scanner writes its
+.B ECHO
+output to the
+.I yyout
+global (default, stdout), which may be redefined by the user simply
+by assigning it to some other
+.B FILE
+pointer.
+.SH START CONDITIONS
+.I flex
+provides a mechanism for conditionally activating rules. Any rule
+whose pattern is prefixed with "<sc>" will only be active when
+the scanner is in the start condition named "sc". For example,
+.nf
+
+ <STRING>[^"]* { /* eat up the string body ... */
+ ...
+ }
+
+.fi
+will be active only when the scanner is in the "STRING" start
+condition, and
+.nf
+
+ <INITIAL,STRING,QUOTE>\\. { /* handle an escape ... */
+ ...
+ }
+
+.fi
+will be active only when the current start condition is
+either "INITIAL", "STRING", or "QUOTE".
+.PP
+Start conditions
+are declared in the definitions (first) section of the input
+using unindented lines beginning with either
+.B %s
+or
+.B %x
+followed by a list of names.
+The former declares
+.I inclusive
+start conditions, the latter
+.I exclusive
+start conditions. A start condition is activated using the
+.B BEGIN
+action. Until the next
+.B 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
+.I inclusive,
+then rules with no start conditions at all will also be active.
+If it is
+.I exclusive,
+then
+.I 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
+.I flex
+input. Because of this,
+exclusive start conditions make it easy to specify "mini-scanners"
+which scan portions of the input that are syntactically different
+from the rest (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:
+.nf
+
+ %s example
+ %%
+
+ <example>foo do_something();
+
+ bar something_else();
+
+.fi
+is equivalent to
+.nf
+
+ %x example
+ %%
+
+ <example>foo do_something();
+
+ <INITIAL,example>bar something_else();
+
+.fi
+Without the
+.B <INITIAL,example>
+qualifier, the
+.I bar
+pattern in the second example wouldn't be active (i.e., couldn't match)
+when in start condition
+.B example.
+If we just used
+.B <example>
+to qualify
+.I bar,
+though, then it would only be active in
+.B example
+and not in
+.B INITIAL,
+while in the first example it's active in both, because in the first
+example the
+.B example
+startion condition is an
+.I inclusive
+.B (%s)
+start condition.
+.PP
+Also note that the special start-condition specifier
+.B <*>
+matches every start condition. Thus, the above example could also
+have been written;
+.nf
+
+ %x example
+ %%
+
+ <example>foo do_something();
+
+ <*>bar something_else();
+
+.fi
+.PP
+The default rule (to
+.B ECHO
+any unmatched character) remains active in start conditions. It
+is equivalent to:
+.nf
+
+ <*>.|\\n ECHO;
+
+.fi
+.PP
+.B 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 "INITIAL", so
+.B BEGIN(INITIAL)
+is equivalent to
+.B BEGIN(0).
+(The parentheses around the start condition name are not required but
+are considered good style.)
+.PP
+.B 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 "SPECIAL" start condition whenever
+.B yylex()
+is called and the global variable
+.I enter_special
+is true:
+.nf
+
+ int enter_special;
+
+ %x SPECIAL
+ %%
+ if ( enter_special )
+ BEGIN(SPECIAL);
+
+ <SPECIAL>blahblahblah
+ ...more rules follow...
+
+.fi
+.PP
+To illustrate the uses of start conditions,
+here is a scanner which provides two different interpretations
+of a string like "123.456". By default it will treat it as
+three tokens, the integer "123", a dot ('.'), and the integer "456".
+But if the string is preceded earlier in the line by the string
+"expect-floats"
+it will treat it as a single token, the floating-point number
+123.456:
+.nf
+
+ %{
+ #include <math.h>
+ %}
+ %s expect
+
+ %%
+ expect-floats BEGIN(expect);
+
+ <expect>[0-9]+"."[0-9]+ {
+ printf( "found a float, = %f\\n",
+ atof( yytext ) );
+ }
+ <expect>\\n {
+ /* 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\\n",
+ atoi( yytext ) );
+ }
+
+ "." printf( "found a dot\\n" );
+
+.fi
+Here is a scanner which recognizes (and discards) C comments while
+maintaining a count of the current input line.
+.nf
+
+ %x comment
+ %%
+ int line_num = 1;
+
+ "/*" BEGIN(comment);
+
+ <comment>[^*\\n]* /* eat anything that's not a '*' */
+ <comment>"*"+[^*/\\n]* /* eat up '*'s not followed by '/'s */
+ <comment>\\n ++line_num;
+ <comment>"*"+"/" BEGIN(INITIAL);
+
+.fi
+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 possible in each rule, as
+it's a big win.
+.PP
+Note that start-conditions names are really integer values and
+can be stored as such. Thus, the above could be extended in the
+following fashion:
+.nf
+
+ %x comment foo
+ %%
+ int line_num = 1;
+ int comment_caller;
+
+ "/*" {
+ comment_caller = INITIAL;
+ BEGIN(comment);
+ }
+
+ ...
+
+ <foo>"/*" {
+ comment_caller = foo;
+ BEGIN(comment);
+ }
+
+ <comment>[^*\\n]* /* eat anything that's not a '*' */
+ <comment>"*"+[^*/\\n]* /* eat up '*'s not followed by '/'s */
+ <comment>\\n ++line_num;
+ <comment>"*"+"/" BEGIN(comment_caller);
+
+.fi
+Furthermore, you can access the current start condition using
+the integer-valued
+.B YY_START
+macro. For example, the above assignments to
+.I comment_caller
+could instead be written
+.nf
+
+ comment_caller = YY_START;
+
+.fi
+Flex provides
+.B YYSTATE
+as an alias for
+.B YY_START
+(since that is what's used by AT&T
+.I 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):
+.nf
+
+ %x str
+
+ %%
+ char string_buf[MAX_STR_CONST];
+ char *string_buf_ptr;
+
+
+ \\" string_buf_ptr = string_buf; BEGIN(str);
+
+ <str>\\" { /* saw closing quote - all done */
+ BEGIN(INITIAL);
+ *string_buf_ptr = '\\0';
+ /* return string constant token type and
+ * value to parser
+ */
+ }
+
+ <str>\\n {
+ /* error - unterminated string constant */
+ /* generate error message */
+ }
+
+ <str>\\\\[0-7]{1,3} {
+ /* octal escape sequence */
+ int result;
+
+ (void) sscanf( yytext + 1, "%o", &result );
+
+ if ( result > 0xff )
+ /* error, constant is out-of-bounds */
+
+ *string_buf_ptr++ = result;
+ }
+
+ <str>\\\\[0-9]+ {
+ /* generate error - bad escape sequence; something
+ * like '\\48' or '\\0777777'
+ */
+ }
+
+ <str>\\\\n *string_buf_ptr++ = '\\n';
+ <str>\\\\t *string_buf_ptr++ = '\\t';
+ <str>\\\\r *string_buf_ptr++ = '\\r';
+ <str>\\\\b *string_buf_ptr++ = '\\b';
+ <str>\\\\f *string_buf_ptr++ = '\\f';
+
+ <str>\\\\(.|\\n) *string_buf_ptr++ = yytext[1];
+
+ <str>[^\\\\\\n\\"]+ {
+ char *yptr = yytext;
+
+ while ( *yptr )
+ *string_buf_ptr++ = *yptr++;
+ }
+
+.fi
+.PP
+Often, such as in some of the examples above, you wind up writing a
+whole bunch of rules all preceded by the same start condition(s). Flex
+makes this a little easier and cleaner by introducing a notion of
+start condition
+.I scope.
+A start condition scope is begun with:
+.nf
+
+ <SCs>{
+
+.fi
+where
+.I SCs
+is a list of one or more start conditions. Inside the start condition
+scope, every rule automatically has the prefix
+.I <SCs>
+applied to it, until a
+.I '}'
+which matches the initial
+.I '{'.
+So, for example,
+.nf
+
+ <ESC>{
+ "\\\\n" return '\\n';
+ "\\\\r" return '\\r';
+ "\\\\f" return '\\f';
+ "\\\\0" return '\\0';
+ }
+
+.fi
+is equivalent to:
+.nf
+
+ <ESC>"\\\\n" return '\\n';
+ <ESC>"\\\\r" return '\\r';
+ <ESC>"\\\\f" return '\\f';
+ <ESC>"\\\\0" return '\\0';
+
+.fi
+Start condition scopes may be nested.
+.PP
+Three routines are available for manipulating stacks of start conditions:
+.TP
+.B void yy_push_state(int new_state)
+pushes the current start condition onto the top of the start condition
+stack and switches to
+.I new_state
+as though you had used
+.B BEGIN new_state
+(recall that start condition names are also integers).
+.TP
+.B void yy_pop_state()
+pops the top of the stack and switches to it via
+.B BEGIN.
+.TP
+.B int yy_top_state()
+returns the top of the stack without altering the stack's contents.
+.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, your scanner must include a
+.B %option stack
+directive (see Options below).
+.SH MULTIPLE INPUT BUFFERS
+Some scanners (such as those which support "include" files)
+require reading from several input streams. As
+.I flex
+scanners do a large amount of buffering, one cannot control
+where the next input will be read from by simply writing a
+.B YY_INPUT
+which is sensitive to the scanning context.
+.B 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 "include"
+which requires switching the input source.
+.PP
+To negotiate these sorts of problems,
+.I flex
+provides a mechanism for creating and switching between multiple
+input buffers. An input buffer is created by using:
+.nf
+
+ YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
+
+.fi
+which takes a
+.I FILE
+pointer and a size and creates a buffer associated with the given
+file and large enough to hold
+.I size
+characters (when in doubt, use
+.B YY_BUF_SIZE
+for the size). It returns a
+.B YY_BUFFER_STATE
+handle, which may then be passed to other routines (see below). The
+.B YY_BUFFER_STATE
+type is a pointer to an opaque
+.B struct yy_buffer_state
+structure, so you may safely initialize YY_BUFFER_STATE variables to
+.B ((YY_BUFFER_STATE) 0)
+if you wish, and also refer to the opaque structure in order to
+correctly declare input buffers in source files other than that
+of your scanner. Note that the
+.I FILE
+pointer in the call to
+.B yy_create_buffer
+is only used as the value of
+.I yyin
+seen by
+.B YY_INPUT;
+if you redefine
+.B YY_INPUT
+so it no longer uses
+.I yyin,
+then you can safely pass a nil
+.I FILE
+pointer to
+.B yy_create_buffer.
+You select a particular buffer to scan from using:
+.nf
+
+ void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
+
+.fi
+switches the scanner's input buffer so subsequent tokens will
+come from
+.I new_buffer.
+Note that
+.B yy_switch_to_buffer()
+may be used by yywrap() to set things up for continued scanning, instead
+of opening a new file and pointing
+.I yyin
+at it. Note also that switching input sources via either
+.B yy_switch_to_buffer()
+or
+.B yywrap()
+does
+.I not
+change the start condition.
+.nf
+
+ void yy_delete_buffer( YY_BUFFER_STATE buffer )
+
+.fi
+is used to reclaim the storage associated with a buffer. (
+.B buffer
+can be nil, in which case the routine does nothing.)
+You can also clear the current contents of a buffer using:
+.nf
+
+ void yy_flush_buffer( YY_BUFFER_STATE buffer )
+
+.fi
+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
+.B YY_INPUT.
+.PP
+.B yy_new_buffer()
+is an alias for
+.B yy_create_buffer(),
+provided for compatibility with the C++ use of
+.I new
+and
+.I delete
+for creating and destroying dynamic objects.
+.PP
+Finally, the
+.B YY_CURRENT_BUFFER
+macro returns a
+.B 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
+.B <<EOF>>
+feature is discussed below):
+.nf
+
+ /* 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\\n]*\\n? ECHO;
+
+ <incl>[ \\t]* /* eat the whitespace */
+ <incl>[^ \\t\\n]+ { /* got the include file name */
+ if ( include_stack_ptr >= MAX_INCLUDE_DEPTH )
+ {
+ fprintf( stderr, "Includes nested too deeply" );
+ exit( 1 );
+ }
+
+ include_stack[include_stack_ptr++] =
+ YY_CURRENT_BUFFER;
+
+ yyin = fopen( yytext, "r" );
+
+ if ( ! yyin )
+ error( ... );
+
+ 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] );
+ }
+ }
+
+.fi
+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
+.B YY_BUFFER_STATE
+handle (which you should delete with
+.B yy_delete_buffer()
+when done with it). They also switch to the new buffer using
+.B yy_switch_to_buffer(),
+so the next call to
+.B yylex()
+will start scanning the string.
+.TP
+.B yy_scan_string(const char *str)
+scans a NUL-terminated string.
+.TP
+.B yy_scan_bytes(const char *bytes, int len)
+scans
+.I len
+bytes (including possibly NUL's)
+starting at location
+.I bytes.
+.PP
+Note that both of these functions create and scan a
+.I copy
+of the string or bytes. (This may be desirable, since
+.B yylex()
+modifies the contents of the buffer it is scanning.) You can avoid the
+copy by using:
+.TP
+.B yy_scan_buffer(char *base, yy_size_t size)
+which scans in place the buffer starting at
+.I base,
+consisting of
+.I size
+bytes, the last two bytes of which
+.I must
+be
+.B YY_END_OF_BUFFER_CHAR
+(ASCII NUL).
+These last two bytes are not scanned; thus, scanning
+consists of
+.B base[0]
+through
+.B base[size-2],
+inclusive.
+.IP
+If you fail to set up
+.I base
+in this manner (i.e., forget the final two
+.B YY_END_OF_BUFFER_CHAR
+bytes), then
+.B yy_scan_buffer()
+returns a nil pointer instead of creating a new input buffer.
+.IP
+The type
+.B yy_size_t
+is an integral type to which you can cast an integer expression
+reflecting the size of the buffer.
+.SH END-OF-FILE RULES
+The special rule "<<EOF>>" indicates
+actions which are to be taken when an end-of-file is
+encountered and yywrap() returns non-zero (i.e., indicates
+no further files to process). The action must finish
+by doing one of four things:
+.IP -
+assigning
+.I yyin
+to a new input file (in previous versions of flex, after doing the
+assignment you had to call the special action
+.B YY_NEW_FILE;
+this is no longer necessary);
+.IP -
+executing a
+.I return
+statement;
+.IP -
+executing the special
+.B yyterminate()
+action;
+.IP -
+or, switching to a new buffer using
+.B yy_switch_to_buffer()
+as shown in the example above.
+.PP
+<<EOF>> rules may not be used with other
+patterns; they may only be qualified with a list of start
+conditions. If an unqualified <<EOF>> rule is given, it
+applies to
+.I all
+start conditions which do not already have <<EOF>> actions. To
+specify an <<EOF>> rule for only the initial start condition, use
+.nf
+
+ <INITIAL><<EOF>>
+
+.fi
+.PP
+These rules are useful for catching things like unclosed comments.
+An example:
+.nf
+
+ %x quote
+ %%
+
+ ...other rules for dealing with quotes...
+
+ <quote><<EOF>> {
+ error( "unterminated quote" );
+ yyterminate();
+ }
+ <<EOF>> {
+ if ( *++filelist )
+ yyin = fopen( *filelist, "r" );
+ else
+ yyterminate();
+ }
+
+.fi
+.SH MISCELLANEOUS MACROS
+The macro
+.B 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
+.B YY_USER_ACTION
+is invoked, the variable
+.I yy_act
+gives the number of the matched rule (rules are numbered starting with 1).
+Suppose you want to profile how often each of your rules is matched. The
+following would do the trick:
+.nf
+
+ #define YY_USER_ACTION ++ctr[yy_act]
+
+.fi
+where
+.I ctr
+is an array to hold the counts for the different rules. Note that
+the macro
+.B YY_NUM_RULES
+gives the total number of rules (including the default rule, even if
+you use
+.B \-s),
+so a correct declaration for
+.I ctr
+is:
+.nf
+
+ int ctr[YY_NUM_RULES];
+
+.fi
+.PP
+The macro
+.B YY_USER_INIT
+may be defined to provide an action which is always executed before
+the first scan (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
+.B yy_set_interactive(is_interactive)
+can be used to control whether the current buffer is considered
+.I 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
+.B \-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
+.B %option always-interactive
+or
+.B %option never-interactive
+(see Options below).
+.B yy_set_interactive()
+must be invoked prior to beginning to scan the buffer that is
+(or is not) to be considered interactive.
+.PP
+The macro
+.B 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
+'^' active, while a zero argument makes '^' rules inactive.
+.PP
+The macro
+.B YY_AT_BOL()
+returns true if the next token scanned from the current buffer
+will have '^' rules active, false otherwise.
+.PP
+In the generated scanner, the actions are all gathered in one large
+switch statement and separated using
+.B YY_BREAK,
+which may be redefined. By default, it is simply a "break", to separate
+each rule's action from the following rule's.
+Redefining
+.B YY_BREAK
+allows, for example, C++ users to
+#define YY_BREAK to do nothing (while being very careful that every
+rule ends with a "break" or a "return"!) to avoid suffering from
+unreachable statement warnings where because a rule's action ends with
+"return", the
+.B YY_BREAK
+is inaccessible.
+.SH VALUES AVAILABLE TO THE USER
+This section summarizes the various values available to the user
+in the rule actions.
+.IP -
+.B char *yytext
+holds the text of the current token. It may be modified but not lengthened
+(you cannot append characters to the end).
+.IP
+If the special directive
+.B %array
+appears in the first section of the scanner description, then
+.B yytext
+is instead declared
+.B char yytext[YYLMAX],
+where
+.B YYLMAX
+is a macro definition that you can redefine in the first section
+if you don't like the default value (generally 8KB). Using
+.B %array
+results in somewhat slower scanners, but the value of
+.B yytext
+becomes immune to calls to
+.I input()
+and
+.I unput(),
+which potentially destroy its value when
+.B yytext
+is a character pointer. The opposite of
+.B %array
+is
+.B %pointer,
+which is the default.
+.IP
+You cannot use
+.B %array
+when generating C++ scanner classes
+(the
+.B \-+
+flag).
+.IP -
+.B int yyleng
+holds the length of the current token.
+.IP -
+.B FILE *yyin
+is the file which by default
+.I flex
+reads from. It may be redefined but doing so only makes sense before
+scanning begins or after an EOF has been encountered. Changing it in
+the midst of scanning will have unexpected results since
+.I flex
+buffers its input; use
+.B yyrestart()
+instead.
+Once scanning terminates because an end-of-file
+has been seen, you can assign
+.I yyin
+at the new input file and then call the scanner again to continue scanning.
+.IP -
+.B void yyrestart( FILE *new_file )
+may be called to point
+.I yyin
+at the new input file. The switch-over to the new file is immediate
+(any previously buffered-up input is lost). Note that calling
+.B yyrestart()
+with
+.I yyin
+as an argument thus throws away the current input buffer and continues
+scanning the same input file.
+.IP -
+.B FILE *yyout
+is the file to which
+.B ECHO
+actions are done. It can be reassigned by the user.
+.IP -
+.B YY_CURRENT_BUFFER
+returns a
+.B YY_BUFFER_STATE
+handle to the current buffer.
+.IP -
+.B YY_START
+returns an integer value corresponding to the current start
+condition. You can subsequently use this value with
+.B BEGIN
+to return to that start condition.
+.SH INTERFACING WITH YACC
+One of the main uses of
+.I flex
+is as a companion to the
+.I yacc
+parser-generator.
+.I yacc
+parsers expect to call a routine named
+.B 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
+.B yylval.
+To use
+.I flex
+with
+.I yacc,
+one specifies the
+.B \-d
+option to
+.I yacc
+to instruct it to generate the file
+.B y.tab.h
+containing definitions of all the
+.B %tokens
+appearing in the
+.I yacc
+input. This file is then included in the
+.I flex
+scanner. For example, if one of the tokens is "TOK_NUMBER",
+part of the scanner might look like:
+.nf
+
+ %{
+ #include "y.tab.h"
+ %}
+
+ %%
+
+ [0-9]+ yylval = atoi( yytext ); return TOK_NUMBER;
+
+.fi
+.SH OPTIONS
+.I flex
+has the following options:
+.TP
+.B \-b
+Generate backing-up information to
+.I 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
+.I all
+backing-up states are eliminated and
+.B \-Cf
+or
+.B \-CF
+is used, the generated scanner will run faster (see the
+.B \-p
+flag). Only users who wish to squeeze every last cycle out of their
+scanners need worry about this option. (See the section on Performance
+Considerations below.)
+.TP
+.B \-c
+is a do-nothing, deprecated option included for POSIX compliance.
+.TP
+.B \-d
+makes the generated scanner run in
+.I debug
+mode. Whenever a pattern is recognized and the global
+.B yy_flex_debug
+is non-zero (which is the default),
+the scanner will write to
+.I stderr
+a line of the form:
+.nf
+
+ --accepting rule at line 53 ("the matched text")
+
+.fi
+The line number refers to the location of the rule in the file
+defining the scanner (i.e., the file that was fed to flex). 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.
+.TP
+.B \-f
+specifies
+.I fast scanner.
+No table compression is done and stdio is bypassed.
+The result is large but fast. This option is equivalent to
+.B \-Cfr
+(see below).
+.TP
+.B \-h
+generates a "help" summary of
+.I flex's
+options to
+.I stdout
+and then exits.
+.B \-?
+and
+.B \-\-help
+are synonyms for
+.B \-h.
+.TP
+.B \-i
+instructs
+.I flex
+to generate a
+.I case-insensitive
+scanner. The case of letters given in the
+.I flex
+input patterns will
+be ignored, and tokens in the input will be matched regardless of case. The
+matched text given in
+.I yytext
+will have the preserved case (i.e., it will not be folded).
+.TP
+.B \-l
+turns on maximum compatibility with the original AT&T
+.I lex
+implementation. Note that this does not mean
+.I full
+compatibility. Use of this option costs a considerable amount of
+performance, and it cannot be used with the
+.B \-+, -f, -F, -Cf,
+or
+.B -CF
+options. For details on the compatibilities it provides, see the section
+"Incompatibilities With Lex And POSIX" below. This option also results
+in the name
+.B YY_FLEX_LEX_COMPAT
+being #define'd in the generated scanner.
+.TP
+.B \-n
+is another do-nothing, deprecated option included only for
+POSIX compliance.
+.TP
+.B \-p
+generates a performance report to stderr. The report
+consists of comments regarding features of the
+.I flex
+input file which will cause a serious loss of performance in the resulting
+scanner. If you give the flag twice, you will also get comments regarding
+features that lead to minor performance losses.
+.IP
+Note that the use of
+.B REJECT,
+.B %option yylineno,
+and variable trailing context (see the Deficiencies / Bugs section below)
+entails a substantial performance penalty; use of
+.I yymore(),
+the
+.B ^
+operator,
+and the
+.B \-I
+flag entail minor performance penalties.
+.TP
+.B \-s
+causes the
+.I default rule
+(that unmatched scanner input is echoed to
+.I 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.
+.TP
+.B \-t
+instructs
+.I flex
+to write the scanner it generates to standard output instead
+of
+.B lex.yy.c.
+.TP
+.B \-v
+specifies that
+.I flex
+should write to
+.I stderr
+a summary of statistics regarding the scanner it generates.
+Most of the statistics are meaningless to the casual
+.I flex
+user, but the first line identifies the version of
+.I flex
+(same as reported by
+.B \-V),
+and the next line the flags used when generating the scanner, including
+those that are on by default.
+.TP
+.B \-w
+suppresses warning messages.
+.TP
+.B \-B
+instructs
+.I flex
+to generate a
+.I batch
+scanner, the opposite of
+.I interactive
+scanners generated by
+.B \-I
+(see below). In general, you use
+.B \-B
+when you are
+.I certain
+that your scanner will never be used interactively, and you want to
+squeeze a
+.I little
+more performance out of it. If your goal is instead to squeeze out a
+.I lot
+more performance, you should be using the
+.B \-Cf
+or
+.B \-CF
+options (discussed below), which turn on
+.B \-B
+automatically anyway.
+.TP
+.B \-F
+specifies that the
+.ul
+fast
+scanner table representation should be used (and stdio
+bypassed). This representation is
+about as fast as the full table representation
+.B (-f),
+and for some sets of patterns will be considerably smaller (and for
+others, larger). In general, if the pattern set contains both "keywords"
+and a catch-all, "identifier" rule, such as in the set:
+.nf
+
+ "case" return TOK_CASE;
+ "switch" return TOK_SWITCH;
+ ...
+ "default" return TOK_DEFAULT;
+ [a-z]+ return TOK_ID;
+
+.fi
+then you're better off using the full table representation. If only
+the "identifier" rule is present and you then use a hash table or some such
+to detect the keywords, you're better off using
+.B -F.
+.IP
+This option is equivalent to
+.B \-CFr
+(see below). It cannot be used with
+.B \-+.
+.TP
+.B \-I
+instructs
+.I flex
+to generate an
+.I 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
+.I another
+token, which often means typing in another whole line.
+.IP
+.I Flex
+scanners default to
+.I interactive
+unless you use the
+.B \-Cf
+or
+.B \-CF
+table-compression options (see below). That's because if you're looking
+for high-performance you should be using one of these options, so if you
+didn't,
+.I flex
+assumes you'd rather trade off a bit of run-time performance for intuitive
+interactive behavior. Note also that you
+.I cannot
+use
+.B \-I
+in conjunction with
+.B \-Cf
+or
+.B \-CF.
+Thus, this option is not really needed; it is on by default for all those
+cases in which it is allowed.
+.IP
+You can force a scanner to
+.I not
+be interactive by using
+.B \-B
+(see above).
+.TP
+.B \-L
+instructs
+.I flex
+not to generate
+.B #line
+directives. Without this option,
+.I flex
+peppers the generated scanner
+with #line directives so error messages in the actions will be correctly
+located with respect to either the original
+.I flex
+input file (if the errors are due to code in the input file), or
+.B lex.yy.c
+(if the errors are
+.I flex's
+fault -- you should report these sorts of errors to the email address
+given below).
+.TP
+.B \-T
+makes
+.I flex
+run in
+.I trace
+mode. It will generate a lot of messages to
+.I stderr
+concerning
+the form of the input and the resultant non-deterministic and deterministic
+finite automata. This option is mostly for use in maintaining
+.I flex.
+.TP
+.B \-V
+prints the version number to
+.I stdout
+and exits.
+.B \-\-version
+is a synonym for
+.B \-V.
+.TP
+.B \-7
+instructs
+.I flex
+to generate a 7-bit scanner, i.e., one which can only recognized 7-bit
+characters in its input. The advantage of using
+.B \-7
+is that the scanner's tables can be up to half the size of those generated
+using the
+.B \-8
+option (see below). The disadvantage is that such scanners often hang
+or crash if their input contains an 8-bit character.
+.IP
+Note, however, that unless you generate your scanner using the
+.B \-Cf
+or
+.B \-CF
+table compression options, use of
+.B \-7
+will save only a small amount of table space, and make your scanner
+considerably less portable.
+.I Flex's
+default behavior is to generate an 8-bit scanner unless you use the
+.B \-Cf
+or
+.B \-CF,
+in which case
+.I flex
+defaults to generating 7-bit scanners unless your site was always
+configured to generate 8-bit scanners (as will often be the case
+with non-USA sites). You can tell whether flex generated a 7-bit
+or an 8-bit scanner by inspecting the flag summary in the
+.B \-v
+output as described above.
+.IP
+Note that if you use
+.B \-Cfe
+or
+.B \-CFe
+(those table compression options, but also using equivalence classes as
+discussed see below), flex 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.
+.TP
+.B \-8
+instructs
+.I flex
+to generate an 8-bit scanner, i.e., one which can recognize 8-bit
+characters. This flag is only needed for scanners generated using
+.B \-Cf
+or
+.B \-CF,
+as otherwise flex defaults to generating an 8-bit scanner anyway.
+.IP
+See the discussion of
+.B \-7
+above for flex's default behavior and the tradeoffs between 7-bit
+and 8-bit scanners.
+.TP
+.B \-U
+instructs
+.I flex
+to generate a 16-bit scanner, i.e., one which can recognize Unicode
+characters. The tables of a scanner generated with
+.B \-U
+are always substantially larger than those of a 7- or 8-bit scanner, but there
+are three significant benefits if you need to scan Unicode. First, a 16-bit
+Unicode scanner is much faster than an equivalent 8-bit because it does not
+have to match NULs. Second, the generated scanner is portable - 8-bit Unicode
+scanners are non-portable because their patterns reflect the endianness of the
+platform on which they were written. Third, 16-bit patterns use the standard
+syntax of regular expressions with one small addition: escape sequences can
+specify 16-bit characters. For example, the patterns \177377 and \xFEFF both
+match the Unicode byte-order mark. Note the following related issues:
+.IP
+If your operating system distinguishes between text and binary file I/O,
+.I yyin
+and
+.I yyout
+should be opened in binary mode.
+.IP
+C++ support of Unicode varies. This currently limits 16-bit C++
+scanners to file I/O.
+.IP
+The
+.B \-C, -Cf,
+and
+.B \-CF
+table compression options are not available with
+.B \-U
+in order to keep table sizes within reason.
+.TP
+.B \-+
+specifies that you want flex to generate a C++
+scanner class. See the section on Generating C++ Scanners below for
+details.
+.TP
+.B \-C[aefFmr]
+controls the degree of table compression and, more generally, trade-offs
+between small scanners and fast scanners.
+.IP
+.B \-Ca
+("align") instructs flex 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
+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 a 7- or 8-bit scanner, and can
+quadruple those of a 16-bit scanner.
+.IP
+.B \-Ce
+directs
+.I flex
+to construct
+.I equivalence classes,
+i.e., sets of characters
+which have identical lexical properties (for example, if the only
+appearance of digits in the
+.I flex
+input is in the character class
+"[0-9]" then the digits '0', '1', ..., '9' will all be put
+in the same equivalence class). Equivalence classes usually give
+dramatic reductions in the final table/object file sizes (typically
+a factor of 2-5) and are pretty cheap performance-wise (one array
+look-up per character scanned).
+.IP
+.B \-Cf
+specifies that the
+.I full
+scanner tables should be generated -
+.I flex
+should not compress the
+tables by taking advantages of similar transition functions for
+different states. This option cannot be used with
+.B \-U.
+.IP
+.B \-CF
+specifies that the alternate fast scanner representation (described
+above under the
+.B \-F
+flag)
+should be used. This option cannot be used with
+.B \-+
+or
+.B \-U.
+.IP
+.B \-Cm
+directs
+.I flex
+to construct
+.I 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 "if" tests and one
+array look-up per character scanned).
+.IP
+.B \-Cr
+causes the generated scanner to
+.I bypass
+use of the standard I/O library (stdio) for input. Instead of calling
+.B fread()
+or
+.B getc(),
+the scanner will use the
+.B read()
+system call, resulting in a performance gain which varies from system
+to system, but in general is probably negligible unless you are also using
+.B \-Cf
+or
+.B \-CF.
+Using
+.B \-Cr
+can cause strange behavior if, for example, you read from
+.I yyin
+using stdio prior to calling the scanner (because the scanner will miss
+whatever text your previous reads left in the stdio input buffer).
+.IP
+.B \-Cr
+has no effect if you define
+.B YY_INPUT
+(see The Generated Scanner above).
+.IP
+A lone
+.B \-C
+specifies that the scanner tables should be compressed but neither
+equivalence classes nor meta-equivalence classes should be used.
+This option cannot be used with
+.B \-U.
+.IP
+The options
+.B \-Cf
+or
+.B \-CF
+and
+.B \-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.
+.IP
+The default setting is
+.B \-Cem,
+which specifies that
+.I flex
+should generate equivalence classes
+and meta-equivalence classes. This setting provides the highest
+degree of table compression. You can trade off
+faster-executing scanners at the cost of larger tables with
+the following generally being true:
+.nf
+
+ slowest & smallest
+ -Cem
+ -Cm
+ -Ce
+ -C
+ -C{f,F}e
+ -C{f,F}
+ -C{f,F}a
+ fastest & largest
+
+.fi
+Note that scanners with the smallest tables are usually generated and
+compiled the quickest, so
+during development you will usually want to use the default, maximal
+compression.
+.IP
+.B \-Cfe
+is often a good compromise between speed and size for production
+scanners.
+.TP
+.B \-ooutput
+directs flex to write the scanner to the file
+.B output
+instead of
+.B lex.yy.c.
+If you combine
+.B \-o
+with the
+.B \-t
+option, then the scanner is written to
+.I stdout
+but its
+.B #line
+directives (see the
+.B \\-L
+option above) refer to the file
+.B output.
+.TP
+.B \-Pprefix
+changes the default
+.I "yy"
+prefix used by
+.I flex
+for all globally-visible variable and function names to instead be
+.I prefix.
+For example,
+.B \-Pfoo
+changes the name of
+.B yytext
+to
+.B footext.
+It also changes the name of the default output file from
+.B lex.yy.c
+to
+.B lex.foo.c.
+Here are all of the names affected:
+.nf
+
+ 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
+
+.fi
+(If you are using a C++ scanner, then only
+.B yywrap
+and
+.B yyFlexLexer
+are affected.)
+Within your scanner itself, you can still refer to the global variables
+and functions using either version of their name; but externally, they
+have the modified name.
+.IP
+This option lets you easily link together multiple
+.I flex
+programs into the same executable. Note, though, that using this
+option also renames
+.B yywrap(),
+so you now
+.I must
+either
+provide your own (appropriately-named) version of the routine for your
+scanner, or use
+.B %option noyywrap,
+as linking with
+.B \-lfl
+no longer provides one for you by default.
+.TP
+.B \-Sskeleton_file
+overrides the default skeleton file from which
+.I flex
+constructs its scanners. You'll never need this option unless you are doing
+.I flex
+maintenance or development.
+.PP
+.I flex
+also provides a mechanism for controlling options within the
+scanner specification itself, rather than from the flex command-line.
+This is done by including
+.B %option
+directives in the first section of the scanner specification.
+You can specify multiple options with a single
+.B %option
+directive, and multiple directives in the first section of your flex input
+file.
+.PP
+Most options are given simply as names, optionally preceded by the
+word "no" (with no intervening whitespace) to negate their meaning.
+A number are equivalent to flex flags or their negation:
+.nf
+
+ 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)
+
+.fi
+Some
+.B %option's
+provide features otherwise not available:
+.TP
+.B always-interactive
+instructs flex to generate a scanner which always considers its input
+"interactive". Normally, on each new input file the scanner calls
+.B 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, then no
+such call is made.
+.TP
+.B main
+directs flex to provide a default
+.B main()
+program for the scanner, which simply calls
+.B yylex().
+This option implies
+.B noyywrap
+(see below).
+.TP
+.B never-interactive
+instructs flex to generate a scanner which never considers its input
+"interactive" (again, no call made to
+.B isatty()).
+This is the opposite of
+.B always-interactive.
+.TP
+.B stack
+enables the use of start condition stacks (see Start Conditions above).
+.TP
+.B stdinit
+if set (i.e.,
+.B %option stdinit)
+initializes
+.I yyin
+and
+.I yyout
+to
+.I stdin
+and
+.I stdout,
+instead of the default of
+.I nil.
+Some existing
+.I lex
+programs depend on this behavior, even though it is not compliant with
+ANSI C, which does not require
+.I stdin
+and
+.I stdout
+to be compile-time constant.
+.TP
+.B yylineno
+directs
+.I flex
+to generate a scanner that maintains the number of the current line
+read from its input in the global variable
+.B yylineno.
+This option is implied by
+.B %option lex-compat.
+.TP
+.B yywrap
+if unset (i.e.,
+.B %option noyywrap),
+makes the scanner not call
+.B yywrap()
+upon an end-of-file, but simply assume that there are no more
+files to scan (until the user points
+.I yyin
+at a new file and calls
+.B yylex()
+again).
+.PP
+.I flex
+scans your rule actions to determine whether you use the
+.B REJECT
+or
+.B yymore()
+features. The
+.B reject
+and
+.B yymore
+options are available to override its decision as to whether you use the
+options, either by setting them (e.g.,
+.B %option reject)
+to indicate the feature is indeed used, or
+unsetting them to indicate it actually is not used
+(e.g.,
+.B %option noyymore).
+.PP
+Three options take string-delimited values, offset with '=':
+.nf
+
+ %option outfile="ABC"
+
+.fi
+is equivalent to
+.B -oABC,
+and
+.nf
+
+ %option prefix="XYZ"
+
+.fi
+is equivalent to
+.B -PXYZ.
+Finally,
+.nf
+
+ %option yyclass="foo"
+
+.fi
+only applies when generating a C++ scanner (
+.B \-+
+option). It informs
+.I flex
+that you have derived
+.B foo
+as a subclass of
+.B yyFlexLexer,
+so
+.I flex
+will place your actions in the member function
+.B foo::yylex()
+instead of
+.B yyFlexLexer::yylex().
+It also generates a
+.B yyFlexLexer::yylex()
+member function that emits a run-time error (by invoking
+.B yyFlexLexer::LexerError())
+if called.
+See 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.,
+.B %option nounput
+), results in the corresponding routine not appearing in
+the generated scanner:
+.nf
+
+ input, unput
+ yy_push_state, yy_pop_state, yy_top_state
+ yy_scan_buffer, yy_scan_bytes, yy_scan_string
+
+.fi
+(though
+.B yy_push_state()
+and friends won't appear anyway unless you use
+.B %option stack).
+.SH PERFORMANCE CONSIDERATIONS
+The main design goal of
+.I flex
+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
+.B \-C
+options outlined above,
+there are a number of options/actions which degrade performance. These
+are, from most expensive to least:
+.nf
+
+ REJECT
+ %option yylineno
+ arbitrary trailing context
+
+ pattern sets that require backing up
+ %array
+ %option interactive
+ %option always-interactive
+
+ '^' beginning-of-line operator
+ yymore()
+
+.fi
+with the first three all being quite expensive and the last two
+being quite cheap. Note also that
+.B unput()
+is implemented as a routine call that potentially does quite a bit of
+work, while
+.B yyless()
+is a quite-cheap macro; so if just putting back some excess text you
+scanned, use
+.B yyless().
+.PP
+.B 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
+.B \-b
+flag to generate a
+.I lex.backup
+file. For example, on the input
+.nf
+
+ %%
+ foo return TOK_KEYWORD;
+ foobar return TOK_KEYWORD;
+
+.fi
+the file looks like:
+.nf
+
+ State #6 is non-accepting -
+ associated rule line numbers:
+ 2 3
+ out-transitions: [ o ]
+ jam-transitions: EOF [ \\001-n p-\\177 ]
+
+ State #8 is non-accepting -
+ associated rule line numbers:
+ 3
+ out-transitions: [ a ]
+ jam-transitions: EOF [ \\001-` b-\\177 ]
+
+ State #9 is non-accepting -
+ associated rule line numbers:
+ 3
+ out-transitions: [ r ]
+ jam-transitions: EOF [ \\001-q s-\\177 ]
+
+ Compressed tables always back up.
+
+.fi
+The first few lines tell us that there's a scanner state in
+which it can make a transition on an '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 '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 "fo". When this has happened,
+if anything other than another 'o' is seen, the scanner will
+have to back up to simply match the 'f' (by the default rule).
+.PP
+The comment regarding State #8 indicates there's a problem
+when "foob" has been scanned. Indeed, on any character other
+than an 'a', the scanner will have to back up to accept "foo".
+Similarly, the comment for State #9 concerns when "fooba" has
+been scanned and an '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
+.B \-Cf
+or
+.B \-CF,
+since there's no performance gain doing so with compressed scanners.
+.PP
+The way to remove the backing up is to add "error" rules:
+.nf
+
+ %%
+ foo return TOK_KEYWORD;
+ foobar return TOK_KEYWORD;
+
+ fooba |
+ foob |
+ fo {
+ /* false alarm, not really a keyword */
+ return TOK_ID;
+ }
+
+.fi
+.PP
+Eliminating backing up among a list of keywords can also be
+done using a "catch-all" rule:
+.nf
+
+ %%
+ foo return TOK_KEYWORD;
+ foobar return TOK_KEYWORD;
+
+ [a-z]+ return TOK_ID;
+
+.fi
+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
+.I flex
+feature will be to automatically add rules to eliminate backing up).
+.PP
+It's important to keep in mind that you gain the benefits of eliminating
+backing up only if you eliminate
+.I every
+instance of backing up. Leaving just one means you gain nothing.
+.PP
+.I Variable
+trailing context (where both the leading and trailing parts do not have
+a fixed length) entails almost the same performance loss as
+.B REJECT
+(i.e., substantial). So when possible a rule like:
+.nf
+
+ %%
+ mouse|rat/(cat|dog) run();
+
+.fi
+is better written:
+.nf
+
+ %%
+ mouse/cat|dog run();
+ rat/cat|dog run();
+
+.fi
+or as
+.nf
+
+ %%
+ mouse|rat/cat run();
+ mouse|rat/dog run();
+
+.fi
+Note that here the special '|' action does
+.I not
+provide any savings, and can even make things worse (see
+Deficiencies / Bugs below).
+.LP
+Another area where the user can increase a scanner's performance
+(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 (short) inner scanning loop, and
+does not often have to go through the additional work of setting up
+the scanning environment (e.g.,
+.B yytext)
+for the action. Recall the scanner for C comments:
+.nf
+
+ %x comment
+ %%
+ int line_num = 1;
+
+ "/*" BEGIN(comment);
+
+ <comment>[^*\\n]*
+ <comment>"*"+[^*/\\n]*
+ <comment>\\n ++line_num;
+ <comment>"*"+"/" BEGIN(INITIAL);
+
+.fi
+This could be sped up by writing it as:
+.nf
+
+ %x comment
+ %%
+ int line_num = 1;
+
+ "/*" BEGIN(comment);
+
+ <comment>[^*\\n]*
+ <comment>[^*\\n]*\\n ++line_num;
+ <comment>"*"+[^*/\\n]*
+ <comment>"*"+[^*/\\n]*\\n ++line_num;
+ <comment>"*"+"/" BEGIN(INITIAL);
+
+.fi
+Now instead of each newline requiring the processing of another
+action, recognizing the newlines is "distributed" over the other rules
+to keep the matched text as long as possible. Note that
+.I adding
+rules does
+.I 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 '*' and '|'.
+.PP
+A final example in speeding up a scanner: suppose you want to 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:
+.nf
+
+ %%
+ asm |
+ auto |
+ break |
+ ... etc ...
+ volatile |
+ while /* it's a keyword */
+
+ .|\\n /* it's not a keyword */
+
+.fi
+To eliminate the back-tracking, introduce a catch-all rule:
+.nf
+
+ %%
+ asm |
+ auto |
+ break |
+ ... etc ...
+ volatile |
+ while /* it's a keyword */
+
+ [a-z]+ |
+ .|\\n /* it's not a keyword */
+
+.fi
+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:
+.nf
+
+ %%
+ asm\\n |
+ auto\\n |
+ break\\n |
+ ... etc ...
+ volatile\\n |
+ while\\n /* it's a keyword */
+
+ [a-z]+\\n |
+ .|\\n /* it's not a keyword */
+
+.fi
+One has to be careful here, as we have now reintroduced backing up
+into the scanner. In particular, while
+.I we
+know that there will never be any characters in the input stream
+other than letters or newlines,
+.I flex
+can't figure this out, and it will plan for possibly needing to back up
+when it has scanned a token like "auto" and then the next character
+is something other than a newline or a letter. Previously it would
+then just match the "auto" rule and be done, but now it has no "auto"
+rule, only a "auto\\n" 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:
+.nf
+
+ %%
+ asm\\n |
+ auto\\n |
+ break\\n |
+ ... etc ...
+ volatile\\n |
+ while\\n /* it's a keyword */
+
+ [a-z]+\\n |
+ [a-z]+ |
+ .|\\n /* it's not a keyword */
+
+.fi
+Compiled with
+.B \-Cf,
+this is about as fast as one can get a
+.I flex
+scanner to go for this particular problem.
+.PP
+A final note:
+.I flex
+is slow when matching NUL's, particularly when a token contains
+multiple NUL's.
+It's best to write rules which match
+.I 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
+How the Input is Matched, dynamically resizing
+.B yytext
+to accommodate huge tokens is a slow process because it presently requires that
+the (huge) token be rescanned from the beginning. Thus if performance is
+vital, you should attempt to match "large" quantities of text but not
+"huge" quantities, where the cutoff between the two is at about 8K
+characters/token.
+.SH GENERATING C++ SCANNERS
+.I flex
+provides two different ways to generate scanners for use with C++. The
+first way is to simply compile a scanner generated by
+.I flex
+using a C++ compiler instead of a C compiler. You should not encounter
+any compilations errors (please report any you find to the email address
+given in the Author section below). You can then use C++ code in your
+rule actions instead of C code. Note that the default input source for
+your scanner remains
+.I yyin,
+and default echoing is still done to
+.I yyout.
+Both of these remain
+.I FILE *
+variables and not C++
+.I streams.
+.PP
+You can also use
+.I flex
+to generate a C++ scanner class, using the
+.B \-+
+option (or, equivalently,
+.B %option c++),
+which is automatically specified if the name of the flex
+executable ends in a '+', such as
+.I flex++.
+When using this option, flex defaults to generating the scanner to the file
+.B lex.yy.cc
+instead of
+.B lex.yy.c.
+The generated scanner includes the header file
+.I FlexLexer.h,
+which defines the interface to two C++ classes.
+.PP
+The first class,
+.B FlexLexer,
+provides an abstract base class defining the general scanner class
+interface. It provides the following member functions:
+.TP
+.B const char* YYText()
+returns the text of the most recently matched token, the equivalent of
+.B yytext.
+.TP
+.B int YYLeng()
+returns the length of the most recently matched token, the equivalent of
+.B yyleng.
+.TP
+.B int lineno() const
+returns the current input line number
+(see
+.B %option yylineno),
+or
+.B 1
+if
+.B %option yylineno
+was not used.
+.TP
+.B void set_debug( int flag )
+sets the debugging flag for the scanner, equivalent to assigning to
+.B yy_flex_debug
+(see the Options section above). Note that you must build the scanner
+using
+.B %option debug
+to include debugging information in it.
+.TP
+.B int debug() const
+returns the current setting of the debugging flag.
+.PP
+Also provided are member functions equivalent to
+.B yy_switch_to_buffer(),
+.B yy_create_buffer()
+(though the first argument is an
+.B istream*
+object pointer and not a
+.B FILE*),
+.B yy_flush_buffer(),
+.B yy_delete_buffer(),
+and
+.B yyrestart()
+(again, the first argument is a
+.B istream*
+object pointer).
+.PP
+The second class defined in
+.I FlexLexer.h
+is
+.B yyFlexLexer,
+which is derived from
+.B FlexLexer.
+It defines the following additional member functions:
+.TP
+.B
+yyFlexLexer( istream* arg_yyin = 0, ostream* arg_yyout = 0 )
+constructs a
+.B yyFlexLexer
+object using the given streams for input and output. If not specified,
+the streams default to
+.B cin
+and
+.B cout,
+respectively.
+.TP
+.B virtual int yylex()
+performs the same role is
+.B yylex()
+does for ordinary flex scanners: it scans the input stream, consuming
+tokens, until a rule's action returns a value. If you derive a subclass
+.B S
+from
+.B yyFlexLexer
+and want to access the member functions and variables of
+.B S
+inside
+.B yylex(),
+then you need to use
+.B %option yyclass="S"
+to inform
+.I flex
+that you will be using that subclass instead of
+.B yyFlexLexer.
+In this case, rather than generating
+.B yyFlexLexer::yylex(),
+.I flex
+generates
+.B S::yylex()
+(and also generates a dummy
+.B yyFlexLexer::yylex()
+that calls
+.B yyFlexLexer::LexerError()
+if called).
+.TP
+.B
+virtual void switch_streams(istream* new_in = 0,
+.B
+ostream* new_out = 0)
+reassigns
+.B yyin
+to
+.B new_in
+(if non-nil)
+and
+.B yyout
+to
+.B new_out
+(ditto), deleting the previous input buffer if
+.B yyin
+is reassigned.
+.TP
+.B
+int yylex( istream* new_in, ostream* new_out = 0 )
+first switches the input streams via
+.B switch_streams( new_in, new_out )
+and then returns the value of
+.B yylex().
+.PP
+In addition,
+.B yyFlexLexer
+defines the following protected virtual functions which you can redefine
+in derived classes to tailor the scanner:
+.TP
+.B
+virtual int LexerInput( char* buf, int max_size )
+reads up to
+.B max_size
+characters into
+.B buf
+and returns the number of characters read. To indicate end-of-input,
+return 0 characters. Note that "interactive" scanners (see the
+.B \-B
+and
+.B \-I
+flags) define the macro
+.B YY_INTERACTIVE.
+If you redefine
+.B LexerInput()
+and need to take different actions depending on whether or not
+the scanner might be scanning an interactive input source, you can
+test for the presence of this name via
+.B #ifdef.
+.TP
+.B
+virtual void LexerOutput( const char* buf, int size )
+writes out
+.B size
+characters from the buffer
+.B buf,
+which, while NUL-terminated, may also contain "internal" NUL's if
+the scanner's rules can match text with NUL's in them.
+.TP
+.B
+virtual void LexerError( const char* msg )
+reports a fatal error message. The default version of this function
+writes the message to the stream
+.B cerr
+and exits.
+.PP
+Note that a
+.B yyFlexLexer
+object contains its
+.I entire
+scanning state. Thus you can use such objects to create reentrant
+scanners. You can instantiate multiple instances of the same
+.B yyFlexLexer
+class, and you can also combine multiple C++ scanner classes together
+in the same program using the
+.B \-P
+option discussed above.
+.PP
+Finally, note that the
+.B %array
+feature is not available to C++ scanner classes; you must use
+.B %pointer
+(the default).
+.PP
+Here is an example of a simple C++ scanner:
+.nf
+
+ // An example of using the flex C++ scanner class.
+
+ %{
+ int mylineno = 0;
+ %}
+
+ string \\"[^\\n"]+\\"
+
+ ws [ \\t]+
+
+ alpha [A-Za-z]
+ dig [0-9]
+ name ({alpha}|{dig}|\\$)({alpha}|{dig}|[_.\\-/$])*
+ num1 [-+]?{dig}+\\.?([eE][-+]?{dig}+)?
+ num2 [-+]?{dig}*\\.{dig}+([eE][-+]?{dig}+)?
+ number {num1}|{num2}
+
+ %%
+
+ {ws} /* skip blanks and tabs */
+
+ "/*" {
+ int c;
+
+ while((c = yyinput()) != 0)
+ {
+ if(c == '\\n')
+ ++mylineno;
+
+ else if(c == '*')
+ {
+ if((c = yyinput()) == '/')
+ break;
+ else
+ unput(c);
+ }
+ }
+ }
+
+ {number} cout << "number " << YYText() << '\\n';
+
+ \\n mylineno++;
+
+ {name} cout << "name " << YYText() << '\\n';
+
+ {string} cout << "string " << YYText() << '\\n';
+
+ %%
+
+ int main( int /* argc */, char** /* argv */ )
+ {
+ FlexLexer* lexer = new yyFlexLexer;
+ while(lexer->yylex() != 0)
+ ;
+ return 0;
+ }
+.fi
+If you want to create multiple (different) lexer classes, you use the
+.B \-P
+flag (or the
+.B prefix=
+option) to rename each
+.B yyFlexLexer
+to some other
+.B xxFlexLexer.
+You then can include
+.B <FlexLexer.h>
+in your other sources once per lexer class, first renaming
+.B yyFlexLexer
+as follows:
+.nf
+
+ #undef yyFlexLexer
+ #define yyFlexLexer xxFlexLexer
+ #include <FlexLexer.h>
+
+ #undef yyFlexLexer
+ #define yyFlexLexer zzFlexLexer
+ #include <FlexLexer.h>
+
+.fi
+if, for example, you used
+.B %option prefix="xx"
+for one of your scanners and
+.B %option prefix="zz"
+for the other.
+.PP
+IMPORTANT: the present form of the scanning class is
+.I experimental
+and may change considerably between major releases.
+.SH INCOMPATIBILITIES WITH LEX AND POSIX
+.I flex
+is a rewrite of the AT&T Unix
+.I 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. Flex is fully compliant with the POSIX
+.I lex
+specification, except that when using
+.B %pointer
+(the default), a call to
+.B unput()
+destroys the contents of
+.B yytext,
+which is counter to the POSIX specification.
+.PP
+In this section we discuss all of the known areas of incompatibility
+between flex, AT&T lex, and the POSIX specification.
+.PP
+.I flex's
+.B \-l
+option turns on maximum compatibility with the original AT&T
+.I 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
+.B \-l
+option.
+.PP
+.I flex
+is fully compatible with
+.I lex
+with the following exceptions:
+.IP -
+The undocumented
+.I lex
+scanner internal variable
+.B yylineno
+is not supported unless
+.B \-l
+or
+.B %option yylineno
+is used.
+.IP
+.B yylineno
+should be maintained on a per-buffer basis, rather than a per-scanner
+(single global variable) basis.
+.IP
+.B yylineno
+is not part of the POSIX specification.
+.IP -
+The
+.B input()
+routine is not redefinable, though it may be called to read characters
+following whatever has been matched by a rule. If
+.B input()
+encounters an end-of-file the normal
+.B yywrap()
+processing is done. A ``real'' end-of-file is returned by
+.B input()
+as
+.I EOF.
+.IP
+Input is instead controlled by defining the
+.B YY_INPUT
+macro.
+.IP
+The
+.I flex
+restriction that
+.B input()
+cannot be redefined is in accordance with the POSIX specification,
+which simply does not specify any way of controlling the
+scanner's input other than by making an initial assignment to
+.I yyin.
+.IP -
+The
+.B unput()
+routine is not redefinable. This restriction is in accordance with POSIX.
+.IP -
+.I flex
+scanners are not as reentrant as
+.I lex
+scanners. In particular, if you have an interactive scanner and
+an interrupt handler which long-jumps out of the scanner, and
+the scanner is subsequently called again, you may get the following
+message:
+.nf
+
+ fatal flex scanner internal error--end of buffer missed
+
+.fi
+To reenter the scanner, first use
+.nf
+
+ yyrestart( yyin );
+
+.fi
+Note that this call will throw away any buffered input; usually this
+isn't a problem with an interactive scanner.
+.IP
+Also note that flex C++ scanner classes
+.I are
+reentrant, so if using C++ is an option for you, you should use
+them instead. See "Generating C++ Scanners" above for details.
+.IP -
+.B output()
+is not supported.
+Output from the
+.B ECHO
+macro is done to the file-pointer
+.I yyout
+(default
+.I stdout).
+.IP
+.B output()
+is not part of the POSIX specification.
+.IP -
+.I lex
+does not support exclusive start conditions (%x), though they
+are in the POSIX specification.
+.IP -
+When definitions are expanded,
+.I flex
+encloses them in parentheses.
+With lex, the following:
+.nf
+
+ NAME [A-Z][A-Z0-9]*
+ %%
+ foo{NAME}? printf( "Found it\\n" );
+ %%
+
+.fi
+will not match the string "foo" because when the macro
+is expanded the rule is equivalent to "foo[A-Z][A-Z0-9]*?"
+and the precedence is such that the '?' is associated with
+"[A-Z0-9]*". With
+.I flex,
+the rule will be expanded to
+"foo([A-Z][A-Z0-9]*)?" and so the string "foo" will match.
+.IP
+Note that if the definition begins with
+.B ^
+or ends with
+.B $
+then it is
+.I not
+expanded with parentheses, to allow these operators to appear in
+definitions without losing their special meanings. But the
+.B <s>, /,
+and
+.B <<EOF>>
+operators cannot be used in a
+.I flex
+definition.
+.IP
+Using
+.B \-l
+results in the
+.I lex
+behavior of no parentheses around the definition.
+.IP
+The POSIX specification is that the definition be enclosed in parentheses.
+.IP -
+Some implementations of
+.I lex
+allow a rule's action to begin on a separate line, if the rule's pattern
+has trailing whitespace:
+.nf
+
+ %%
+ foo|bar<space here>
+ { foobar_action(); }
+
+.fi
+.I flex
+does not support this feature.
+.IP -
+The
+.I lex
+.B %r
+(generate a Ratfor scanner) option is not supported. It is not part
+of the POSIX specification.
+.IP -
+After a call to
+.B unput(),
+.I yytext
+is undefined until the next token is matched, unless the scanner
+was built using
+.B %array.
+This is not the case with
+.I lex
+or the POSIX specification. The
+.B \-l
+option does away with this incompatibility.
+.IP -
+The precedence of the
+.B {}
+(numeric range) operator is different.
+.I lex
+interprets "abc{1,3}" as "match one, two, or
+three occurrences of 'abc'", whereas
+.I flex
+interprets it as "match 'ab'
+followed by one, two, or three occurrences of 'c'". The latter is
+in agreement with the POSIX specification.
+.IP -
+The precedence of the
+.B ^
+operator is different.
+.I lex
+interprets "^foo|bar" as "match either 'foo' at the beginning of a line,
+or 'bar' anywhere", whereas
+.I flex
+interprets it as "match either 'foo' or 'bar' if they come at the beginning
+of a line". The latter is in agreement with the POSIX specification.
+.IP -
+The special table-size declarations such as
+.B %a
+supported by
+.I lex
+are not required by
+.I flex
+scanners;
+.I flex
+ignores them.
+.IP -
+The name
+.B
+FLEX_SCANNER
+is #define'd so scanners may be written for use with either
+.I flex
+or
+.I lex.
+Scanners also include
+.B YY_FLEX_MAJOR_VERSION
+and
+.B YY_FLEX_MINOR_VERSION
+indicating which version of
+.I flex
+generated the scanner
+(for example, for the 2.5 release, these defines would be 2 and 5
+respectively).
+.PP
+The following
+.I flex
+features are not included in
+.I lex
+or the POSIX specification:
+.nf
+
+ 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
+
+.fi
+plus almost all of the flex flags.
+The last feature in the list refers to the fact that with
+.I flex
+you can put multiple actions on the same line, separated with
+semi-colons, while with
+.I lex,
+the following
+.nf
+
+ foo handle_foo(); ++num_foos_seen;
+
+.fi
+is (rather surprisingly) truncated to
+.nf
+
+ foo handle_foo();
+
+.fi
+.I flex
+does not truncate the action. Actions that are not enclosed in
+braces are simply terminated at the end of the line.
+.SH DIAGNOSTICS
+.PP
+.I 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 "foo" cannot be matched because it comes after
+an identifier "catch-all" rule:
+.nf
+
+ [a-z]+ got_identifier();
+ foo got_foo();
+
+.fi
+Using
+.B REJECT
+in a scanner suppresses this warning.
+.PP
+.I warning,
+.B \-s
+.I
+option given but default rule can be matched
+means that it is possible (perhaps only in a particular start condition)
+that the default rule (match any single character) is the only one
+that will match a particular input. Since
+.B \-s
+was given, presumably this is not intended.
+.PP
+.I reject_used_but_not_detected undefined
+or
+.I yymore_used_but_not_detected undefined -
+These errors can occur at compile time. They indicate that the
+scanner uses
+.B REJECT
+or
+.B yymore()
+but that
+.I flex
+failed to notice the fact, meaning that
+.I flex
+scanned the first two sections looking for occurrences of these actions
+and failed to find any, but somehow you snuck some in (via a #include
+file, for example). Use
+.B %option reject
+or
+.B %option yymore
+to indicate to flex that you really do use these features.
+.PP
+.I flex scanner jammed -
+a scanner compiled with
+.B \-s
+has encountered an input string which wasn't matched by
+any of its rules. This error can also occur due to internal problems.
+.PP
+.I token too large, exceeds YYLMAX -
+your scanner uses
+.B %array
+and one of its rules matched a string longer than the
+.B YYLMAX
+constant (8K bytes by default). You can increase the value by
+#define'ing
+.B YYLMAX
+in the definitions section of your
+.I flex
+input.
+.PP
+.I scanner requires \-8 flag to
+.I use the character 'x' -
+Your scanner specification includes recognizing the 8-bit character
+.I 'x'
+and you did not specify the \-8 flag, and your scanner defaulted to 7-bit
+because you used the
+.B \-Cf
+or
+.B \-CF
+table compression options. See the discussion of the
+.B \-7
+flag for details.
+.PP
+.I flex scanner push-back overflow -
+you used
+.B unput()
+to push back so much text that the scanner's buffer could not hold
+both the pushed-back text and the current token in
+.B yytext.
+Ideally the scanner should dynamically resize the buffer in this case, but at
+present it does not.
+.PP
+.I
+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
+.B
+REJECT.
+.PP
+.I
+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 (or over) the scanner's activation frame. Before
+reentering the scanner, use:
+.nf
+
+ yyrestart( yyin );
+
+.fi
+or, as noted above, switch to using the C++ scanner class.
+.PP
+.I too many start conditions in <> construct! -
+you listed more start conditions in a <> construct than exist (so
+you must have listed at least one of them twice).
+.SH FILES
+.TP
+.B \-lfl
+library with which scanners must be linked.
+.TP
+.I lex.yy.c
+generated scanner (called
+.I lexyy.c
+on some systems).
+.TP
+.I lex.yy.cc
+generated C++ scanner class, when using
+.B -+.
+.TP
+.I <FlexLexer.h>
+header file defining the C++ scanner base class,
+.B FlexLexer,
+and its derived class,
+.B yyFlexLexer.
+.TP
+.I flex.skl
+skeleton scanner. This file is only used when building flex, not when
+flex executes.
+.TP
+.I lex.backup
+backing-up information for
+.B \-b
+flag (called
+.I lex.bck
+on some systems).
+.SH DEFICIENCIES / BUGS
+.PP
+Some trailing context
+patterns cannot be properly matched and generate
+warning messages ("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 "zx*/xy*", where the 'x*' matches the '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 abovementioned performance loss.
+In particular, parts using '|' or {n} (such as "foo{3}") are always
+considered variable-length.
+.PP
+Combining trailing context with the special '|' action can result in
+.I fixed
+trailing context being turned into the more expensive
+.I variable
+trailing context. For example, in the following:
+.nf
+
+ %%
+ abc |
+ xyz/def
+
+.fi
+.PP
+Use of
+.B unput()
+invalidates yytext and yyleng, unless the
+.B %array
+directive
+or the
+.B \-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 (generally huge) token.
+.PP
+Due to both buffering of input and read-ahead, you cannot intermix
+calls to <stdio.h> routines, such as, for example,
+.B getchar(),
+with
+.I flex
+rules and expect it to work. Call
+.B input()
+instead.
+.PP
+The total table entries listed by the
+.B \-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
+.B REJECT,
+and somewhat greater than the number of states if it does.
+.PP
+.B REJECT
+cannot be used with the
+.B \-f
+or
+.B \-F
+options.
+.PP
+The
+.I flex
+internal algorithms need documentation.
+.SH SEE ALSO
+.PP
+lex(1), yacc(1), sed(1), awk(1).
+.PP
+John Levine, Tony Mason, and Doug Brown,
+.I Lex & Yacc,
+O'Reilly and Associates. Be sure to get the 2nd edition.
+.PP
+M. E. Lesk and E. Schmidt,
+.I LEX \- Lexical Analyzer Generator
+.PP
+Alfred Aho, Ravi Sethi and Jeffrey Ullman,
+.I Compilers: Principles, Techniques and Tools,
+Addison-Wesley (1986). Describes the pattern-matching techniques used by
+.I flex
+(deterministic finite automata).
+.SH AUTHOR
+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
+.I flex
+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, benson@odi.com,
+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 Deraadt,
+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, ken@ken.hilco.com, 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 vern@ee.lbl.gov.
diff --git a/to.do/unicode/flex.skl b/to.do/unicode/flex.skl
new file mode 100644
index 0000000..9b527ec
--- /dev/null
+++ b/to.do/unicode/flex.skl
@@ -0,0 +1,1542 @@
+/* A lexical scanner generated by flex */
+
+/* Scanner skeleton version:
+ * $Header$
+ */
+
+#define FLEX_SCANNER
+#define YY_FLEX_MAJOR_VERSION 2
+#define YY_FLEX_MINOR_VERSION 5
+
+%-
+#include <stdio.h>
+%*
+
+
+/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
+#ifdef c_plusplus
+#ifndef __cplusplus
+#define __cplusplus
+#endif
+#endif
+
+
+#ifdef __cplusplus
+
+#include <stdlib.h>
+%+
+class istream;
+%*
+#include <unistd.h>
+
+/* Use prototypes in function declarations. */
+#define YY_USE_PROTOS
+
+/* The "const" storage-class-modifier is valid. */
+#define YY_USE_CONST
+
+#else /* ! __cplusplus */
+
+#if __STDC__
+
+#define YY_USE_PROTOS
+#define YY_USE_CONST
+
+#endif /* __STDC__ */
+#endif /* ! __cplusplus */
+
+#ifdef __TURBOC__
+ #pragma warn -rch
+ #pragma warn -use
+#include <io.h>
+#include <stdlib.h>
+#define YY_USE_CONST
+#define YY_USE_PROTOS
+#endif
+
+#ifdef YY_USE_CONST
+#define yyconst const
+#else
+#define yyconst
+#endif
+
+
+#ifdef YY_USE_PROTOS
+#define YY_PROTO(proto) proto
+#else
+#define YY_PROTO(proto) ()
+#endif
+
+%% YY_CHAR and YY_SC_TO_UI() go here
+
+/* Returned upon end-of-file. */
+#define YY_NULL 0
+
+/* 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. */
+#define YY_BUF_SIZE 16384
+
+typedef struct yy_buffer_state *YY_BUFFER_STATE;
+
+extern int yyleng;
+%-
+extern FILE *yyin, *yyout;
+%*
+
+#define EOB_ACT_CONTINUE_SCAN 0
+#define EOB_ACT_END_OF_FILE 1
+#define EOB_ACT_LAST_MATCH 2
+
+/* The funky do-while in the following #define is used to turn the definition
+ * int a single C statement (which needs a semi-colon terminator). This
+ * avoids problems with code like:
+ *
+ * if ( condition_holds )
+ * yyless( 5 );
+ * else
+ * do_something_else();
+ *
+ * Prior to using the do-while the compiler would get upset at the
+ * "else" because it interpreted the "if" statement as being all
+ * done when it reached the ';' after the yyless() call.
+ */
+
+/* Return all but the first 'n' matched characters back to the input stream. */
+
+#define yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up yytext. */ \
+ *yy_cp = yy_hold_char; \
+ YY_RESTORE_YY_MORE_OFFSET \
+ yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
+ YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+ } \
+ while ( 0 )
+
+#define unput(c) yyunput( c, yytext_ptr )
+
+/* The following is because we cannot portably get our hands on size_t
+ * (without autoconf's help, which isn't available because we want
+ * flex-generated scanners to compile on their own).
+ */
+typedef unsigned int yy_size_t;
+
+
+struct yy_buffer_state
+ {
+%-
+ FILE *yy_input_file;
+%+
+ istream* yy_input_file;
+%*
+
+ YY_CHAR *yy_ch_buf; /* input buffer */
+ YY_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.
+ */
+ int 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;
+
+ /* 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
+ };
+
+%- Standard (non-C++) definition
+static YY_BUFFER_STATE yy_current_buffer = 0;
+%*
+
+/* 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".
+ */
+#define YY_CURRENT_BUFFER yy_current_buffer
+
+
+%- Standard (non-C++) definition
+/* yy_hold_char holds the character lost when yytext is formed. */
+static YY_CHAR yy_hold_char;
+
+static int yy_n_chars; /* number of characters read into yy_ch_buf */
+
+
+int yyleng;
+
+/* Points to current character in buffer. */
+static YY_CHAR *yy_c_buf_p = (YY_CHAR *) 0;
+static int yy_init = 1; /* 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 YY_PROTO(( FILE *input_file ));
+
+void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
+void yy_load_buffer_state YY_PROTO(( void ));
+YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
+void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
+void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
+void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
+#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
+
+YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( YY_CHAR *base, yy_size_t size ));
+YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst YY_CHAR *yy_str ));
+
+/* This is the old yy_scan_bytes function - renamed to avoid
+ * confusion since a character may now be 1 or 2 bytes.
+ */
+YY_BUFFER_STATE yy_scan_chars YY_PROTO(( yyconst YY_CHAR *chars, int len ));
+%*
+
+static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
+static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
+static void yy_flex_free YY_PROTO(( void * ));
+
+#define yy_new_buffer yy_create_buffer
+
+#define yy_set_interactive(is_interactive) \
+ { \
+ if ( ! yy_current_buffer ) \
+ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+ yy_current_buffer->yy_is_interactive = is_interactive; \
+ }
+
+#define yy_set_bol(at_bol) \
+ { \
+ if ( ! yy_current_buffer ) \
+ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
+ yy_current_buffer->yy_at_bol = at_bol; \
+ }
+
+#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
+
+%% yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here
+
+%- Standard (non-C++) definition
+static yy_state_type yy_get_previous_state YY_PROTO(( void ));
+static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
+static int yy_get_next_buffer YY_PROTO(( void ));
+static void yy_fatal_error YY_PROTO(( 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; \
+%% code to fiddle yytext and yyleng for yymore() goes here
+ yy_hold_char = *yy_cp; \
+ *yy_cp = (YY_CHAR) '\0'; \
+%% code to copy yytext_ptr to yytext[] goes here, if %array
+ yy_c_buf_p = yy_cp;
+
+%% data tables for the DFA and the user's section 1 definitions go here
+
+/* Macros after this point can all be overridden by user definitions in
+ * section 1.
+ */
+
+#ifndef YY_SKIP_YYWRAP
+#ifdef __cplusplus
+extern "C" int yywrap YY_PROTO(( void ));
+#else
+extern int yywrap YY_PROTO(( void ));
+#endif
+#endif
+
+%-
+#ifndef YY_NO_UNPUT
+static void yyunput YY_PROTO(( int c, YY_CHAR *buf_ptr ));
+#endif
+%*
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy YY_PROTO(( YY_CHAR *, yyconst YY_CHAR *, int ));
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen YY_PROTO(( yyconst YY_CHAR * ));
+#endif
+
+#ifndef YY_NO_INPUT
+%- Standard (non-C++) definition
+#ifdef __cplusplus
+static int yyinput YY_PROTO(( void ));
+#else
+static int input YY_PROTO(( void ));
+#endif
+%*
+#endif
+
+#if YY_STACK_USED
+static int yy_start_stack_ptr = 0;
+static int yy_start_stack_depth = 0;
+static int *yy_start_stack = 0;
+#ifndef YY_NO_PUSH_STATE
+static void yy_push_state YY_PROTO(( int new_state ));
+#endif
+#ifndef YY_NO_POP_STATE
+static void yy_pop_state YY_PROTO(( void ));
+#endif
+#ifndef YY_NO_TOP_STATE
+static int yy_top_state YY_PROTO(( void ));
+#endif
+
+#else
+#define YY_NO_PUSH_STATE 1
+#define YY_NO_POP_STATE 1
+#define YY_NO_TOP_STATE 1
+#endif
+
+#ifdef YY_MALLOC_DECL
+YY_MALLOC_DECL
+#else
+#if __STDC__
+#ifndef __cplusplus
+#include <stdlib.h>
+#endif
+#else
+/* Just try to get by without declaring the routines. This will fail
+ * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
+ * or sizeof(void*) != sizeof(int).
+ */
+#endif
+#endif
+
+/* 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
+%- Standard (non-C++) definition
+/* This used to be an fputs(), but since the string might contain NUL's,
+ * we now use fwrite().
+ */
+#define ECHO (void) fwrite( yytext, sizeof( YY_CHAR ), yyleng, yyout )
+%+ C++ definition
+#define ECHO LexerOutput( yytext, yyleng )
+%*
+#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) \
+%% fread()/read() definition of YY_INPUT goes here unless we're doing C++
+%+ C++ definition
+ if ( (result = LexerInput( buf, max_size )) < 0 ) \
+ YY_FATAL_ERROR( "input in flex scanner failed" );
+%*
+#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 )
+%+
+#define YY_FATAL_ERROR(msg) LexerError( msg )
+%*
+#endif
+
+/* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+#ifndef YY_DECL
+%- Standard (non-C++) definition
+#define YY_DECL int yylex YY_PROTO(( void ))
+%+ C++ definition
+#define YY_DECL int yyFlexLexer::yylex()
+%*
+#endif
+
+/* 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
+
+%% YY_RULE_SETUP definition goes here
+
+YY_DECL
+ {
+ register yy_state_type yy_current_state;
+ register YY_CHAR *yy_cp, *yy_bp;
+ register int yy_act;
+
+%% user's declarations go here
+
+ if ( yy_init )
+ {
+ yy_init = 0;
+
+#ifdef YY_USER_INIT
+ YY_USER_INIT;
+#endif
+
+ if ( ! yy_start )
+ yy_start = 1; /* first start state */
+
+ if ( ! yyin )
+%-
+ yyin = stdin;
+%+
+ yyin = &cin;
+%*
+
+ if ( ! yyout )
+%-
+ yyout = stdout;
+%+
+ yyout = &cout;
+%*
+
+ if ( ! yy_current_buffer )
+ yy_current_buffer =
+ yy_create_buffer( yyin, YY_BUF_SIZE );
+
+ yy_load_buffer_state();
+ }
+
+ while ( 1 ) /* loops until end-of-file is reached */
+ {
+%% yymore()-related code goes here
+ 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;
+
+%% code to set up and find next match goes here
+
+yy_find_action:
+%% code to find the action number goes here
+
+ YY_DO_BEFORE_ACTION;
+
+%% code for yylineno update goes here
+
+do_action: /* This label is used only to access EOF actions. */
+
+%% debug code goes here
+
+ switch ( yy_act )
+ { /* beginning of action switch */
+%% 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 - 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->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->yy_n_chars;
+ yy_current_buffer->yy_input_file = yyin;
+ yy_current_buffer->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->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
+ {
+%% 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() )
+ {
+ 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->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 yylex */
+
+%+
+yyFlexLexer::yyFlexLexer( istream* arg_yyin, ostream* arg_yyout )
+ {
+ yyin = arg_yyin;
+ yyout = arg_yyout;
+ yy_c_buf_p = 0;
+ yy_init = 1;
+ 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 = 0;
+
+ yy_current_buffer = 0;
+
+#ifdef YY_USES_REJECT
+ yy_state_buf = new yy_state_type[YY_BUF_SIZE + 2];
+#else
+ yy_state_buf = 0;
+#endif
+ }
+
+yyFlexLexer::~yyFlexLexer()
+ {
+ delete yy_state_buf;
+ yy_delete_buffer( yy_current_buffer );
+ }
+
+void yyFlexLexer::switch_streams( istream* new_in, ostream* new_out )
+ {
+ if ( new_in )
+ {
+ yy_delete_buffer( yy_current_buffer );
+ yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE ) );
+ }
+
+ if ( new_out )
+ yyout = new_out;
+ }
+
+#ifdef YY_INTERACTIVE
+int yyFlexLexer::LexerInput( YY_CHAR* buf, int /* max_size */ )
+#else
+int yyFlexLexer::LexerInput( YY_CHAR* buf, int max_size )
+#endif
+ {
+ if ( yyin->eof() || yyin->fail() )
+ return 0;
+
+#ifdef YY_INTERACTIVE
+ (void) yyin->read((unsigned char *) buf, sizeof( YY_CHAR ) );
+
+ if ( yyin->eof() )
+ return 0;
+
+ if ( yyin->bad() )
+ return -1;
+
+ return 1;
+
+#else
+ (void) yyin->read((unsigned char *) buf, max_size * sizeof( YY_CHAR ) );
+
+ if ( yyin->bad() )
+ return -1;
+ else
+ return ( yyin->gcount() / sizeof( YY_CHAR ) );
+#endif
+ }
+
+void yyFlexLexer::LexerOutput( const YY_CHAR* buf, int size )
+ {
+ (void) yyout->write((unsigned char *) buf, size * sizeof( YY_CHAR ) );
+ }
+%*
+
+/* 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()
+%+
+int yyFlexLexer::yy_get_next_buffer()
+%*
+ {
+ register YY_CHAR *dest = yy_current_buffer->yy_ch_buf;
+ register YY_CHAR *source = yytext_ptr;
+ register int number_to_move, i;
+ int ret_val;
+
+ if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--end of buffer missed" );
+
+ if ( yy_current_buffer->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->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->yy_n_chars = yy_n_chars = 0;
+
+ else
+ {
+ int num_to_read =
+ yy_current_buffer->yy_buf_size - number_to_move - 1;
+
+ while ( num_to_read <= 0 )
+ { /* Not enough room in the buffer - grow it. */
+#ifdef YY_USES_REJECT
+ YY_FATAL_ERROR(
+"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
+#else
+
+ /* just a shorter name for the current buffer */
+ YY_BUFFER_STATE b = yy_current_buffer;
+
+ int yy_c_buf_p_offset =
+ (int) (yy_c_buf_p - b->yy_ch_buf);
+
+ if ( b->yy_is_our_buffer )
+ {
+ int 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 = (YY_CHAR *)
+ /* Include room in for 2 EOB chars. */
+ yy_flex_realloc( (void *) b->yy_ch_buf,
+ ( b->yy_buf_size + 2 ) *
+ sizeof( YY_CHAR ) );
+ }
+ 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_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+ num_to_read = yy_current_buffer->yy_buf_size -
+ number_to_move - 1;
+#endif
+ }
+
+ if ( num_to_read > YY_READ_BUF_SIZE )
+ num_to_read = YY_READ_BUF_SIZE;
+
+ /* Read in more data. */
+ YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
+ yy_n_chars, num_to_read );
+
+ yy_current_buffer->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->yy_buffer_status =
+ YY_BUFFER_EOF_PENDING;
+ }
+ }
+
+ else
+ ret_val = EOB_ACT_CONTINUE_SCAN;
+
+ yy_n_chars += number_to_move;
+ yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
+ yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
+
+ yytext_ptr = &yy_current_buffer->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()
+%+
+yy_state_type yyFlexLexer::yy_get_previous_state()
+%*
+ {
+ register yy_state_type yy_current_state;
+ register YY_CHAR *yy_cp;
+
+%% code to get the start state into yy_current_state goes here
+
+ for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
+ {
+%% 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 );
+ */
+
+%-
+#ifdef YY_USE_PROTOS
+static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
+#else
+static yy_state_type yy_try_NUL_trans( yy_current_state )
+yy_state_type yy_current_state;
+#endif
+%+
+yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state )
+%*
+ {
+ register int yy_is_jam;
+%% code to find the next state, and perhaps do backing up, goes here
+
+ return yy_is_jam ? 0 : yy_current_state;
+ }
+
+
+%-
+#ifndef YY_NO_UNPUT
+#ifdef YY_USE_PROTOS
+static void yyunput( int c, register YY_CHAR *yy_bp )
+#else
+static void yyunput( c, yy_bp )
+int c;
+register YY_CHAR *yy_bp;
+#endif
+%+
+void yyFlexLexer::yyunput( int c, register YY_CHAR* yy_bp )
+%*
+ {
+ register YY_CHAR *yy_cp = yy_c_buf_p;
+
+ /* undo effects of setting up yytext */
+ *yy_cp = yy_hold_char;
+
+ if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+ { /* need to shift things up to make room */
+ /* +2 for EOB chars. */
+ register int number_to_move = yy_n_chars + 2;
+ register YY_CHAR *dest = &yy_current_buffer->yy_ch_buf[
+ yy_current_buffer->yy_buf_size + 2];
+ register YY_CHAR *source =
+ &yy_current_buffer->yy_ch_buf[number_to_move];
+
+ while ( source > yy_current_buffer->yy_ch_buf )
+ *--dest = *--source;
+
+ yy_cp += (int) (dest - source);
+ yy_bp += (int) (dest - source);
+ yy_current_buffer->yy_n_chars =
+ yy_n_chars = yy_current_buffer->yy_buf_size;
+
+ if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+ YY_FATAL_ERROR( "flex scanner push-back overflow" );
+ }
+
+ *--yy_cp = (YY_CHAR) c;
+
+%% update yylineno here
+
+ yytext_ptr = yy_bp;
+ yy_hold_char = *yy_cp;
+ yy_c_buf_p = yy_cp;
+ }
+%-
+#endif /* ifndef YY_NO_UNPUT */
+%*
+
+
+%-
+#ifdef __cplusplus
+static int yyinput()
+#else
+static int input()
+#endif
+%+
+int yyFlexLexer::yyinput()
+%*
+ {
+ 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->yy_ch_buf[yy_n_chars] )
+ /* This was really a NUL. */
+ *yy_c_buf_p = (YY_CHAR) '\0';
+
+ else
+ { /* need more input */
+ int 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 );
+
+ /* fall through */
+
+ 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 = YY_SC_TO_UI(*yy_c_buf_p);
+ *yy_c_buf_p = (YY_CHAR) '\0'; /* preserve yytext */
+ yy_hold_char = *++yy_c_buf_p;
+
+%% update BOL and yylineno
+
+ return c;
+ }
+
+
+%-
+#ifdef YY_USE_PROTOS
+void yyrestart( FILE *input_file )
+#else
+void yyrestart( input_file )
+FILE *input_file;
+#endif
+%+
+void yyFlexLexer::yyrestart( istream* input_file )
+%*
+ {
+ if ( ! yy_current_buffer )
+ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
+
+ yy_init_buffer( yy_current_buffer, input_file );
+ yy_load_buffer_state();
+ }
+
+
+%-
+#ifdef YY_USE_PROTOS
+void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
+#else
+void yy_switch_to_buffer( new_buffer )
+YY_BUFFER_STATE new_buffer;
+#endif
+%+
+void yyFlexLexer::yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
+%*
+ {
+ 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->yy_buf_pos = yy_c_buf_p;
+ yy_current_buffer->yy_n_chars = yy_n_chars;
+ }
+
+ yy_current_buffer = 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;
+ }
+
+
+%-
+#ifdef YY_USE_PROTOS
+void yy_load_buffer_state( void )
+#else
+void yy_load_buffer_state()
+#endif
+%+
+void yyFlexLexer::yy_load_buffer_state()
+%*
+ {
+ yy_n_chars = yy_current_buffer->yy_n_chars;
+ yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
+ yyin = yy_current_buffer->yy_input_file;
+ yy_hold_char = *yy_c_buf_p;
+ }
+
+
+%-
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
+#else
+YY_BUFFER_STATE yy_create_buffer( file, size )
+FILE *file;
+int size;
+#endif
+%+
+YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( istream* file, int size )
+%*
+ {
+ YY_BUFFER_STATE b;
+
+ b = (YY_BUFFER_STATE) yy_flex_alloc( 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 = (YY_CHAR *) yy_flex_alloc(
+ ( b->yy_buf_size + 2 ) * sizeof( YY_CHAR ) );
+ 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;
+ }
+
+
+%-
+#ifdef YY_USE_PROTOS
+void yy_delete_buffer( YY_BUFFER_STATE b )
+#else
+void yy_delete_buffer( b )
+YY_BUFFER_STATE b;
+#endif
+%+
+void yyFlexLexer::yy_delete_buffer( YY_BUFFER_STATE b )
+%*
+ {
+ if ( ! b )
+ return;
+
+ if ( b == yy_current_buffer )
+ yy_current_buffer = (YY_BUFFER_STATE) 0;
+
+ if ( b->yy_is_our_buffer )
+ yy_flex_free( (void *) b->yy_ch_buf );
+
+ yy_flex_free( (void *) b );
+ }
+
+
+%-
+#ifndef YY_ALWAYS_INTERACTIVE
+#ifndef YY_NEVER_INTERACTIVE
+extern int isatty YY_PROTO(( int ));
+#endif
+#endif
+
+#ifdef YY_USE_PROTOS
+void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
+#else
+void yy_init_buffer( b, file )
+YY_BUFFER_STATE b;
+FILE *file;
+#endif
+
+%+
+extern "C" int isatty YY_PROTO(( int ));
+void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, istream* file )
+%*
+
+ {
+ yy_flush_buffer( b );
+
+ b->yy_input_file = file;
+ b->yy_fill_buffer = 1;
+
+%-
+#if YY_ALWAYS_INTERACTIVE
+ b->yy_is_interactive = 1;
+#else
+#if YY_NEVER_INTERACTIVE
+ b->yy_is_interactive = 0;
+#else
+ b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
+#endif
+#endif
+%+
+ b->yy_is_interactive = 0;
+%*
+ }
+
+
+%-
+#ifdef YY_USE_PROTOS
+void yy_flush_buffer( YY_BUFFER_STATE b )
+#else
+void yy_flush_buffer( b )
+YY_BUFFER_STATE b;
+#endif
+
+%+
+void yyFlexLexer::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();
+ }
+%*
+
+
+#ifndef YY_NO_SCAN_BUFFER
+%-
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_buffer( YY_CHAR *base, yy_size_t size )
+#else
+YY_BUFFER_STATE yy_scan_buffer( base, size )
+YY_CHAR *base;
+yy_size_t size;
+#endif
+ {
+ 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) yy_flex_alloc( 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;
+ }
+%*
+#endif
+
+
+#ifndef YY_NO_SCAN_STRING
+%-
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_string( yyconst YY_CHAR *yy_str )
+#else
+YY_BUFFER_STATE yy_scan_string( yy_str )
+yyconst YY_CHAR *yy_str;
+#endif
+ {
+ int len;
+ for ( len = 0; yy_str[len]; ++len )
+ ;
+
+ return yy_scan_chars( yy_str, len );
+ }
+%*
+#endif
+
+
+#ifndef YY_NO_SCAN_BYTES
+%-
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_scan_chars( yyconst YY_CHAR *chars, int len )
+#else
+YY_BUFFER_STATE yy_scan_chars( chars, len )
+yyconst YY_CHAR *chars;
+int len;
+#endif
+ {
+ YY_BUFFER_STATE b;
+ YY_CHAR *buf;
+ yy_size_t n;
+ int i;
+
+ /* Get memory for full buffer, including space for trailing EOB's. */
+ n = len + 2;
+ buf = (YY_CHAR *) yy_flex_alloc( n * sizeof( YY_CHAR ) );
+ if ( ! buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_chars()" );
+
+ for ( i = 0; i < len; ++i )
+ buf[i] = chars[i];
+
+ buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
+
+ b = yy_scan_buffer( buf, n );
+ if ( ! b )
+ YY_FATAL_ERROR( "bad buffer in yy_scan_chars()" );
+
+ /* 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
+
+
+#ifndef YY_NO_PUSH_STATE
+%-
+#ifdef YY_USE_PROTOS
+static void yy_push_state( int new_state )
+#else
+static void yy_push_state( new_state )
+int new_state;
+#endif
+%+
+void yyFlexLexer::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 *) yy_flex_alloc( new_size );
+
+ else
+ yy_start_stack = (int *) yy_flex_realloc(
+ (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);
+ }
+#endif
+
+
+#ifndef YY_NO_POP_STATE
+%-
+static void yy_pop_state()
+%+
+void yyFlexLexer::yy_pop_state()
+%*
+ {
+ if ( --yy_start_stack_ptr < 0 )
+ YY_FATAL_ERROR( "start-condition stack underflow" );
+
+ BEGIN(yy_start_stack[yy_start_stack_ptr]);
+ }
+#endif
+
+
+#ifndef YY_NO_TOP_STATE
+%-
+static int yy_top_state()
+%+
+int yyFlexLexer::yy_top_state()
+%*
+ {
+ return yy_start_stack[yy_start_stack_ptr - 1];
+ }
+#endif
+
+#ifndef YY_EXIT_FAILURE
+#define YY_EXIT_FAILURE 2
+#endif
+
+%-
+#ifdef YY_USE_PROTOS
+static void yy_fatal_error( yyconst char msg[] )
+#else
+static void yy_fatal_error( msg )
+YY_CHAR msg[];
+#endif
+ {
+ (void) fprintf( stderr, "%s\n", msg );
+ exit( YY_EXIT_FAILURE );
+ }
+
+%+
+
+void yyFlexLexer::LexerError( yyconst char msg[] )
+ {
+ cerr << msg << '\n';
+ 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. */ \
+ yytext[yyleng] = yy_hold_char; \
+ yy_c_buf_p = yytext + n; \
+ yy_hold_char = *yy_c_buf_p; \
+ *yy_c_buf_p = (YY_CHAR) '\0'; \
+ yyleng = n; \
+ } \
+ while ( 0 )
+
+
+/* Internal utility routines. */
+
+#ifndef yytext_ptr
+#ifdef YY_USE_PROTOS
+static void yy_flex_strncpy( YY_CHAR *s1, yyconst YY_CHAR *s2, int n )
+#else
+static void yy_flex_strncpy( s1, s2, n )
+YY_CHAR *s1;
+yyconst YY_CHAR *s2;
+int n;
+#endif
+ {
+ register int i;
+ for ( i = 0; i < n; ++i )
+ s1[i] = s2[i];
+ }
+#endif
+
+#ifdef YY_NEED_STRLEN
+#ifdef YY_USE_PROTOS
+static int yy_flex_strlen( yyconst YY_CHAR *s )
+#else
+static int yy_flex_strlen( s )
+yyconst YY_CHAR *s;
+#endif
+ {
+ register int n;
+ for ( n = 0; s[n]; ++n )
+ ;
+
+ return n;
+ }
+#endif
+
+
+#ifdef YY_USE_PROTOS
+static void *yy_flex_alloc( yy_size_t size )
+#else
+static void *yy_flex_alloc( size )
+yy_size_t size;
+#endif
+ {
+ return (void *) malloc( size );
+ }
+
+#ifdef YY_USE_PROTOS
+static void *yy_flex_realloc( void *ptr, yy_size_t size )
+#else
+static void *yy_flex_realloc( ptr, size )
+void *ptr;
+yy_size_t size;
+#endif
+ {
+ /* 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 );
+ }
+
+#ifdef YY_USE_PROTOS
+static void yy_flex_free( void *ptr )
+#else
+static void yy_flex_free( ptr )
+void *ptr;
+#endif
+ {
+ free( ptr );
+ }
+
+#if YY_MAIN
+int main()
+ {
+ yylex();
+ return 0;
+ }
+#endif
diff --git a/to.do/unicode/flexdef.h b/to.do/unicode/flexdef.h
new file mode 100644
index 0000000..4fd3f7e
--- /dev/null
+++ b/to.do/unicode/flexdef.h
@@ -0,0 +1,1062 @@
+/* flexdef - definitions file for flex */
+
+/*-
+ * 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 are permitted provided
+ * that: (1) source distributions retain this entire copyright notice and
+ * comment, and (2) distributions including binaries display the following
+ * acknowledgement: ``This product includes software developed by the
+ * University of California, Berkeley and its contributors'' in the
+ * documentation or other materials provided with the distribution and in
+ * all advertising materials mentioning features or use of this software.
+ * 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.
+ */
+
+/* @(#) $Header$ (LBL) */
+
+#include <stdio.h>
+#include <ctype.h>
+
+#include "config.h"
+
+#ifdef __TURBOC__
+#define HAVE_STRING_H 1
+#define MS_DOS 1
+#ifndef __STDC__
+#define __STDC__ 1
+#endif
+ #pragma warn -pro
+ #pragma warn -rch
+ #pragma warn -use
+ #pragma warn -aus
+ #pragma warn -par
+ #pragma warn -pia
+#endif
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef HAVE_MALLOC_H
+#include <malloc.h>
+#endif
+
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#endif
+
+/* As an aid for the internationalization patch to flex, which
+ * is maintained outside this distribution for copyright reasons.
+ */
+#define _(String) (String)
+
+/* Always be prepared to generate an 16-bit scanner. */
+#define CSIZE 65536
+#define Char unsigned char
+
+/* Size of input alphabet - should be size of ASCII set. */
+#ifndef DEFAULT_CSIZE
+#define DEFAULT_CSIZE 128
+#endif
+
+#ifndef PROTO
+#if __STDC__
+#define PROTO(proto) proto
+#else
+#define PROTO(proto) ()
+#endif
+#endif
+
+#ifdef VMS
+#ifndef __VMS_POSIX
+#define unlink remove
+#define SHORT_FILE_NAMES
+#endif
+#endif
+
+#ifdef MS_DOS
+#define SHORT_FILE_NAMES
+#endif
+
+#ifdef _WIN32
+#if __STDC__
+#define unlink _unlink
+#define isatty _isatty
+#define fileno _fileno
+#endif
+#endif
+
+
+/* Maximum line length we'll have to deal with. */
+#define MAXLINE 2048
+
+#ifndef MIN
+#define MIN(x,y) ((x) < (y) ? (x) : (y))
+#endif
+#ifndef MAX
+#define MAX(x,y) ((x) > (y) ? (x) : (y))
+#endif
+#ifndef ABS
+#define ABS(x) ((x) < 0 ? -(x) : (x))
+#endif
+
+
+/* ANSI C does not guarantee that isascii() is defined */
+#ifndef isascii
+#define isascii(c) ((c) <= 0177)
+#endif
+
+
+#define true 1
+#define false 0
+#define unspecified -1
+
+
+/* Special chk[] values marking the slots taking by end-of-buffer and action
+ * numbers.
+ */
+#define EOB_POSITION -1
+#define ACTION_POSITION -2
+
+/* Number of data items per line for -f output. */
+#define NUMDATAITEMS 10
+
+/* Number of lines of data in -f output before inserting a blank line for
+ * readability.
+ */
+#define NUMDATALINES 10
+
+/* transition_struct_out() definitions. */
+#define TRANS_STRUCT_PRINT_LENGTH 14
+
+/* Returns true if an nfa state has an epsilon out-transition slot
+ * that can be used. This definition is currently not used.
+ */
+#define FREE_EPSILON(state) \
+ (transchar[state] == SYM_EPSILON && \
+ trans2[state] == NO_TRANSITION && \
+ finalst[state] != state)
+
+/* Returns true if an nfa state has an epsilon out-transition character
+ * and both slots are free
+ */
+#define SUPER_FREE_EPSILON(state) \
+ (transchar[state] == SYM_EPSILON && \
+ trans1[state] == NO_TRANSITION) \
+
+/* Maximum number of NFA states that can comprise a DFA state. It's real
+ * big because if there's a lot of rules, the initial state will have a
+ * huge epsilon closure.
+ */
+#define INITIAL_MAX_DFA_SIZE 750
+#define MAX_DFA_SIZE_INCREMENT 750
+
+
+/* A note on the following masks. They are used to mark accepting numbers
+ * as being special. As such, they implicitly limit the number of accepting
+ * numbers (i.e., rules) because if there are too many rules the rule numbers
+ * will overload the mask bits. Fortunately, this limit is \large/ (0x2000 ==
+ * 8192) so unlikely to actually cause any problems. A check is made in
+ * new_rule() to ensure that this limit is not reached.
+ */
+
+/* Mask to mark a trailing context accepting number. */
+#define YY_TRAILING_MASK 0x2000
+
+/* Mask to mark the accepting number of the "head" of a trailing context
+ * rule.
+ */
+#define YY_TRAILING_HEAD_MASK 0x4000
+
+/* Maximum number of rules, as outlined in the above note. */
+#define MAX_RULE (YY_TRAILING_MASK - 1)
+
+
+/* NIL must be 0. If not, its special meaning when making equivalence classes
+ * (it marks the representative of a given e.c.) will be unidentifiable.
+ */
+#define NIL 0
+
+#define JAM -1 /* to mark a missing DFA transition */
+#define NO_TRANSITION NIL
+#define UNIQUE -1 /* marks a symbol as an e.c. representative */
+#define INFINITY -1 /* for x{5,} constructions */
+
+#define INITIAL_MAX_CCLS 100 /* max number of unique character classes */
+#define MAX_CCLS_INCREMENT 100
+
+/* Size of table holding members of character classes. */
+#define INITIAL_MAX_CCL_TBL_SIZE 500
+#define MAX_CCL_TBL_SIZE_INCREMENT 250
+
+#define INITIAL_MAX_RULES 100 /* default maximum number of rules */
+#define MAX_RULES_INCREMENT 100
+
+#define INITIAL_MNS 2000 /* default maximum number of nfa states */
+#define MNS_INCREMENT 1000 /* amount to bump above by if it's not enough */
+
+#define INITIAL_MAX_DFAS 1000 /* default maximum number of dfa states */
+#define MAX_DFAS_INCREMENT 1000
+
+#define JAMSTATE -32766 /* marks a reference to the state that always jams */
+
+/* Maximum number of NFA states. */
+#define MAXIMUM_MNS 31999
+
+/* Enough so that if it's subtracted from an NFA state number, the result
+ * is guaranteed to be negative.
+ */
+#define MARKER_DIFFERENCE (MAXIMUM_MNS+2)
+
+/* Maximum number of nxt/chk pairs for non-templates. */
+#define INITIAL_MAX_XPAIRS 2000
+#define MAX_XPAIRS_INCREMENT 2000
+
+/* Maximum number of nxt/chk pairs needed for templates. */
+#define INITIAL_MAX_TEMPLATE_XPAIRS 2500
+#define MAX_TEMPLATE_XPAIRS_INCREMENT 2500
+
+#define SYM_EPSILON (CSIZE + 1) /* to mark transitions on the symbol epsilon */
+
+#define INITIAL_MAX_SCS 40 /* maximum number of start conditions */
+#define MAX_SCS_INCREMENT 40 /* amount to bump by if it's not enough */
+
+#define ONE_STACK_SIZE 500 /* stack of states with only one out-transition */
+#define SAME_TRANS -1 /* transition is the same as "default" entry for state */
+
+/* The following percentages are used to tune table compression:
+
+ * The percentage the number of out-transitions a state must be of the
+ * number of equivalence classes in order to be considered for table
+ * compaction by using protos.
+ */
+#define PROTO_SIZE_PERCENTAGE 15
+
+/* The percentage the number of homogeneous out-transitions of a state
+ * must be of the number of total out-transitions of the state in order
+ * that the state's transition table is first compared with a potential
+ * template of the most common out-transition instead of with the first
+ * proto in the proto queue.
+ */
+#define CHECK_COM_PERCENTAGE 50
+
+/* The percentage the number of differences between a state's transition
+ * table and the proto it was first compared with must be of the total
+ * number of out-transitions of the state in order to keep the first
+ * proto as a good match and not search any further.
+ */
+#define FIRST_MATCH_DIFF_PERCENTAGE 10
+
+/* The percentage the number of differences between a state's transition
+ * table and the most similar proto must be of the state's total number
+ * of out-transitions to use the proto as an acceptable close match.
+ */
+#define ACCEPTABLE_DIFF_PERCENTAGE 50
+
+/* The percentage the number of homogeneous out-transitions of a state
+ * must be of the number of total out-transitions of the state in order
+ * to consider making a template from the state.
+ */
+#define TEMPLATE_SAME_PERCENTAGE 60
+
+/* The percentage the number of differences between a state's transition
+ * table and the most similar proto must be of the state's total number
+ * of out-transitions to create a new proto from the state.
+ */
+#define NEW_PROTO_DIFF_PERCENTAGE 20
+
+/* The percentage the total number of out-transitions of a state must be
+ * of the number of equivalence classes in order to consider trying to
+ * fit the transition table into "holes" inside the nxt/chk table.
+ */
+#define INTERIOR_FIT_PERCENTAGE 15
+
+/* Size of region set aside to cache the complete transition table of
+ * protos on the proto queue to enable quick comparisons.
+ */
+#define PROT_SAVE_SIZE 2000
+
+#define MSP 50 /* maximum number of saved protos (protos on the proto queue) */
+
+/* Maximum number of out-transitions a state can have that we'll rummage
+ * around through the interior of the internal fast table looking for a
+ * spot for it.
+ */
+#define MAX_XTIONS_FULL_INTERIOR_FIT 4
+
+/* Maximum number of rules which will be reported as being associated
+ * with a DFA state.
+ */
+#define MAX_ASSOC_RULES 100
+
+/* Number that, if used to subscript an array, has a good chance of producing
+ * an error; should be small enough to fit into a short.
+ */
+#define BAD_SUBSCRIPT -32767
+
+/* Absolute value of largest number that can be stored in a short, with a
+ * bit of slop thrown in for general paranoia.
+ */
+#define MAX_SHORT 32700
+
+
+/* Declarations for global variables. */
+
+/* Variables for symbol tables:
+ * sctbl - start-condition symbol table
+ * ndtbl - name-definition symbol table
+ * ccltab - character class text symbol table
+ */
+
+struct hash_entry
+ {
+ struct hash_entry *prev, *next;
+ char *name;
+ char *str_val;
+ int int_val;
+ } ;
+
+typedef struct hash_entry **hash_table;
+
+#define NAME_TABLE_HASH_SIZE 101
+#define START_COND_HASH_SIZE 101
+#define CCL_HASH_SIZE 101
+
+extern struct hash_entry *ndtbl[NAME_TABLE_HASH_SIZE];
+extern struct hash_entry *sctbl[START_COND_HASH_SIZE];
+extern struct hash_entry *ccltab[CCL_HASH_SIZE];
+
+
+/* Variables for flags:
+ * printstats - if true (-v), dump statistics
+ * syntaxerror - true if a syntax error has been found
+ * eofseen - true if we've seen an eof in the input file
+ * ddebug - if true (-d), make a "debug" scanner
+ * trace - if true (-T), trace processing
+ * nowarn - if true (-w), do not generate warnings
+ * spprdflt - if true (-s), suppress the default rule
+ * interactive - if true (-I), generate an interactive scanner
+ * caseins - if true (-i), generate a case-insensitive scanner
+ * lex_compat - if true (-l), maximize compatibility with AT&T lex
+ * do_yylineno - if true, generate code to maintain yylineno
+ * useecs - if true (-Ce flag), use equivalence classes
+ * fulltbl - if true (-Cf flag), don't compress the DFA state table
+ * usemecs - if true (-Cm flag), use meta-equivalence classes
+ * fullspd - if true (-F flag), use Jacobson method of table representation
+ * gen_line_dirs - if true (i.e., no -L flag), generate #line directives
+ * performance_report - if > 0 (i.e., -p flag), generate a report relating
+ * to scanner performance; if > 1 (-p -p), report on minor performance
+ * problems, too
+ * backing_up_report - if true (i.e., -b flag), generate "lex.backup" file
+ * listing backing-up states
+ * C_plus_plus - if true (i.e., -+ flag), generate a C++ scanner class;
+ * otherwise, a standard C scanner
+ * long_align - if true (-Ca flag), favor long-word alignment.
+ * use_read - if true (-f, -F, or -Cr) then use read() for scanner input;
+ * otherwise, use fread().
+ * yytext_is_array - if true (i.e., %array directive), then declare
+ * yytext as a array instead of a character pointer. Nice and inefficient.
+ * do_yywrap - do yywrap() processing on EOF. If false, EOF treated as
+ * "no more files".
+ * csize - size of character set for the scanner we're generating;
+ * 128 for 7-bit chars and 256 for 8-bit
+ * yymore_used - if true, yymore() is used in input rules
+ * reject - if true, generate back-up tables for REJECT macro
+ * real_reject - if true, scanner really uses REJECT (as opposed to just
+ * having "reject" set for variable trailing context)
+ * continued_action - true if this rule's action is to "fall through" to
+ * the next rule's action (i.e., the '|' action)
+ * in_rule - true if we're inside an individual rule, false if not.
+ * yymore_really_used - whether to treat yymore() as really used, regardless
+ * of what we think based on references to it in the user's actions.
+ * reject_really_used - same for REJECT
+ */
+
+extern int printstats, syntaxerror, eofseen, ddebug, trace, nowarn, spprdflt;
+extern int interactive, caseins, lex_compat, do_yylineno;
+extern int useecs, fulltbl, usemecs, fullspd;
+extern int gen_line_dirs, performance_report, backing_up_report;
+extern int C_plus_plus, long_align, use_read, yytext_is_array, do_yywrap;
+extern int csize;
+extern int yymore_used, reject, real_reject, continued_action, in_rule;
+
+extern int yymore_really_used, reject_really_used;
+
+
+/* Variables used in the flex input routines:
+ * datapos - characters on current output line
+ * dataline - number of contiguous lines of data in current data
+ * statement. Used to generate readable -f output
+ * linenum - current input line number
+ * out_linenum - current output line number
+ * skelfile - the skeleton file
+ * skel - compiled-in skeleton array
+ * skel_ind - index into "skel" array, if skelfile is nil
+ * yyin - input file
+ * backing_up_file - file to summarize backing-up states to
+ * infilename - name of input file
+ * outfilename - name of output file
+ * did_outfilename - whether outfilename was explicitly set
+ * prefix - the prefix used for externally visible names ("yy" by default)
+ * yyclass - yyFlexLexer subclass to use for YY_DECL
+ * do_stdinit - whether to initialize yyin/yyout to stdin/stdout
+ * use_stdout - the -t flag
+ * input_files - array holding names of input files
+ * num_input_files - size of input_files array
+ * program_name - name with which program was invoked
+ *
+ * action_array - array to hold the rule actions
+ * action_size - size of action_array
+ * defs1_offset - index where the user's section 1 definitions start
+ * in action_array
+ * prolog_offset - index where the prolog starts in action_array
+ * action_offset - index where the non-prolog starts in action_array
+ * action_index - index where the next action should go, with respect
+ * to "action_array"
+ */
+
+extern int datapos, dataline, linenum, out_linenum;
+extern FILE *skelfile, *yyin, *backing_up_file;
+extern const char *skel[];
+extern int skel_ind;
+extern char *infilename, *outfilename;
+extern int did_outfilename;
+extern char *prefix, *yyclass;
+extern int do_stdinit, use_stdout;
+extern char **input_files;
+extern int num_input_files;
+extern char *program_name;
+
+extern char *action_array;
+extern int action_size;
+extern int defs1_offset, prolog_offset, action_offset, action_index;
+
+
+/* Variables for stack of states having only one out-transition:
+ * onestate - state number
+ * onesym - transition symbol
+ * onenext - target state
+ * onedef - default base entry
+ * onesp - stack pointer
+ */
+
+extern int onestate[ONE_STACK_SIZE], onesym[ONE_STACK_SIZE];
+extern int onenext[ONE_STACK_SIZE], onedef[ONE_STACK_SIZE], onesp;
+
+
+/* Variables for nfa machine data:
+ * current_mns - current maximum on number of NFA states
+ * num_rules - number of the last accepting state; also is number of
+ * rules created so far
+ * num_eof_rules - number of <<EOF>> rules
+ * default_rule - number of the default rule
+ * current_max_rules - current maximum number of rules
+ * lastnfa - last nfa state number created
+ * firstst - physically the first state of a fragment
+ * lastst - last physical state of fragment
+ * finalst - last logical state of fragment
+ * transchar - transition character
+ * trans1 - transition state
+ * trans2 - 2nd transition state for epsilons
+ * accptnum - accepting number
+ * assoc_rule - rule associated with this NFA state (or 0 if none)
+ * state_type - a STATE_xxx type identifying whether the state is part
+ * of a normal rule, the leading state in a trailing context
+ * rule (i.e., the state which marks the transition from
+ * recognizing the text-to-be-matched to the beginning of
+ * the trailing context), or a subsequent state in a trailing
+ * context rule
+ * rule_type - a RULE_xxx type identifying whether this a ho-hum
+ * normal rule or one which has variable head & trailing
+ * context
+ * rule_linenum - line number associated with rule
+ * rule_useful - true if we've determined that the rule can be matched
+ */
+
+extern int current_mns, current_max_rules;
+extern int num_rules, num_eof_rules, default_rule, lastnfa;
+extern int *firstst, *lastst, *finalst, *transchar, *trans1, *trans2;
+extern int *accptnum, *assoc_rule, *state_type;
+extern int *rule_type, *rule_linenum, *rule_useful;
+
+/* Different types of states; values are useful as masks, as well, for
+ * routines like check_trailing_context().
+ */
+#define STATE_NORMAL 0x1
+#define STATE_TRAILING_CONTEXT 0x2
+
+/* Global holding current type of state we're making. */
+
+extern int current_state_type;
+
+/* Different types of rules. */
+#define RULE_NORMAL 0
+#define RULE_VARIABLE 1
+
+/* True if the input rules include a rule with both variable-length head
+ * and trailing context, false otherwise.
+ */
+extern int variable_trailing_context_rules;
+
+
+/* Variables for protos:
+ * numtemps - number of templates created
+ * numprots - number of protos created
+ * protprev - backlink to a more-recently used proto
+ * protnext - forward link to a less-recently used proto
+ * prottbl - base/def table entry for proto
+ * protcomst - common state of proto
+ * firstprot - number of the most recently used proto
+ * lastprot - number of the least recently used proto
+ * protsave contains the entire state array for protos
+ */
+
+extern int numtemps, numprots, protprev[MSP], protnext[MSP], prottbl[MSP];
+extern int protcomst[MSP], firstprot, lastprot, protsave[PROT_SAVE_SIZE];
+
+
+/* Variables for managing equivalence classes:
+ * numecs - number of equivalence classes
+ * nextecm - forward link of Equivalence Class members
+ * ecgroup - class number or backward link of EC members
+ * nummecs - number of meta-equivalence classes (used to compress
+ * templates)
+ * tecfwd - forward link of meta-equivalence classes members
+ * tecbck - backward link of MEC's
+ */
+
+/* Reserve enough room in the equivalence class arrays so that we
+ * can use the CSIZE'th element to hold equivalence class information
+ * for the NUL character. Later we'll move this information into
+ * the 0th element.
+ */
+extern int numecs, nextecm[CSIZE + 1], ecgroup[CSIZE + 1], nummecs;
+
+/* Meta-equivalence classes are indexed starting at 1, so it's possible
+ * that they will require positions from 1 .. CSIZE, i.e., CSIZE + 1
+ * slots total (since the arrays are 0-based). nextecm[] and ecgroup[]
+ * don't require the extra position since they're indexed from 1 .. CSIZE - 1.
+ */
+extern int tecfwd[CSIZE + 1], tecbck[CSIZE + 1];
+
+
+/* Variables for start conditions:
+ * lastsc - last start condition created
+ * current_max_scs - current limit on number of start conditions
+ * scset - set of rules active in start condition
+ * scbol - set of rules active only at the beginning of line in a s.c.
+ * scxclu - true if start condition is exclusive
+ * sceof - true if start condition has EOF rule
+ * scname - start condition name
+ */
+
+extern int lastsc, *scset, *scbol, *scxclu, *sceof;
+extern int current_max_scs;
+extern char **scname;
+
+
+/* Variables for dfa machine data:
+ * current_max_dfa_size - current maximum number of NFA states in DFA
+ * current_max_xpairs - current maximum number of non-template xtion pairs
+ * current_max_template_xpairs - current maximum number of template pairs
+ * current_max_dfas - current maximum number DFA states
+ * lastdfa - last dfa state number created
+ * nxt - state to enter upon reading character
+ * chk - check value to see if "nxt" applies
+ * tnxt - internal nxt table for templates
+ * base - offset into "nxt" for given state
+ * def - where to go if "chk" disallows "nxt" entry
+ * nultrans - NUL transition for each state
+ * NUL_ec - equivalence class of the NUL character
+ * tblend - last "nxt/chk" table entry being used
+ * firstfree - first empty entry in "nxt/chk" table
+ * dss - nfa state set for each dfa
+ * dfasiz - size of nfa state set for each dfa
+ * dfaacc - accepting set for each dfa state (if using REJECT), or accepting
+ * number, if not
+ * accsiz - size of accepting set for each dfa state
+ * dhash - dfa state hash value
+ * numas - number of DFA accepting states created; note that this
+ * is not necessarily the same value as num_rules, which is the analogous
+ * value for the NFA
+ * numsnpairs - number of state/nextstate transition pairs
+ * jambase - position in base/def where the default jam table starts
+ * jamstate - state number corresponding to "jam" state
+ * end_of_buffer_state - end-of-buffer dfa state number
+ */
+
+extern int current_max_dfa_size, current_max_xpairs;
+extern int current_max_template_xpairs, current_max_dfas;
+extern int lastdfa, *nxt, *chk, *tnxt;
+extern int *base, *def, *nultrans, NUL_ec, tblend, firstfree, **dss, *dfasiz;
+extern union dfaacc_union
+ {
+ int *dfaacc_set;
+ int dfaacc_state;
+ } *dfaacc;
+extern int *accsiz, *dhash, numas;
+extern int numsnpairs, jambase, jamstate;
+extern int end_of_buffer_state;
+
+/* Variables for ccl information:
+ * lastccl - ccl index of the last created ccl
+ * current_maxccls - current limit on the maximum number of unique ccl's
+ * cclmap - maps a ccl index to its set pointer
+ * ccllen - gives the length of a ccl
+ * cclng - true for a given ccl if the ccl is negated
+ * cclreuse - counts how many times a ccl is re-used
+ * current_max_ccl_tbl_size - current limit on number of characters needed
+ * to represent the unique ccl's
+ * ccltbl - holds the characters in each ccl - indexed by cclmap
+ */
+
+extern int lastccl, *cclmap, *ccllen, *cclng, cclreuse;
+extern int current_maxccls, current_max_ccl_tbl_size;
+extern wchar_t *ccltbl;
+
+
+/* Variables for miscellaneous information:
+ * nmstr - last NAME scanned by the scanner
+ * sectnum - section number currently being parsed
+ * nummt - number of empty nxt/chk table entries
+ * hshcol - number of hash collisions detected by snstods
+ * dfaeql - number of times a newly created dfa was equal to an old one
+ * numeps - number of epsilon NFA states created
+ * eps2 - number of epsilon states which have 2 out-transitions
+ * num_reallocs - number of times it was necessary to realloc() a group
+ * of arrays
+ * tmpuses - number of DFA states that chain to templates
+ * totnst - total number of NFA states used to make DFA states
+ * peakpairs - peak number of transition pairs we had to store internally
+ * numuniq - number of unique transitions
+ * numdup - number of duplicate transitions
+ * hshsave - number of hash collisions saved by checking number of states
+ * num_backing_up - number of DFA states requiring backing up
+ * bol_needed - whether scanner needs beginning-of-line recognition
+ */
+
+extern char nmstr[MAXLINE];
+extern int sectnum, nummt, hshcol, dfaeql, numeps, eps2, num_reallocs;
+extern int tmpuses, totnst, peakpairs, numuniq, numdup, hshsave;
+extern int num_backing_up, bol_needed;
+
+void *allocate_array PROTO((int, size_t));
+void *reallocate_array PROTO((void*, int, size_t));
+
+void *flex_alloc PROTO((size_t));
+void *flex_realloc PROTO((void*, size_t));
+void flex_free PROTO((void*));
+
+#define allocate_integer_array(size) \
+ (int *) allocate_array( size, sizeof( int ) )
+
+#define reallocate_integer_array(array,size) \
+ (int *) reallocate_array( (void *) array, size, sizeof( int ) )
+
+#define allocate_int_ptr_array(size) \
+ (int **) allocate_array( size, sizeof( int * ) )
+
+#define allocate_char_ptr_array(size) \
+ (char **) allocate_array( size, sizeof( char * ) )
+
+#define allocate_dfaacc_union(size) \
+ (union dfaacc_union *) \
+ allocate_array( size, sizeof( union dfaacc_union ) )
+
+#define reallocate_int_ptr_array(array,size) \
+ (int **) reallocate_array( (void *) array, size, sizeof( int * ) )
+
+#define reallocate_char_ptr_array(array,size) \
+ (char **) reallocate_array( (void *) array, size, sizeof( char * ) )
+
+#define reallocate_dfaacc_union(array, size) \
+ (union dfaacc_union *) \
+ reallocate_array( (void *) array, size, sizeof( union dfaacc_union ) )
+
+#define allocate_character_array(size) \
+ (char *) allocate_array( size, sizeof( char ) )
+
+#define reallocate_character_array(array,size) \
+ (char *) reallocate_array( (void *) array, size, sizeof( char ) )
+
+#define allocate_Character_array(size) \
+ (Char *) allocate_array( size, sizeof( Char ) )
+
+#define reallocate_Character_array(array,size) \
+ (Char *) reallocate_array( (void *) array, size, sizeof( Char ) )
+
+#define allocate_wchar_array(size) \
+ (wchar_t *) allocate_array( size, sizeof( wchar_t ) )
+
+#define reallocate_wchar_array(array,size) \
+ (wchar_t *) reallocate_array( (void *) array, size, sizeof( wchar_t ) )
+
+
+/* Used to communicate between scanner and parser. The type should really
+ * be YYSTYPE, but we can't easily get our hands on it.
+ */
+extern int yylval;
+
+
+/* External functions that are cross-referenced among the flex source files. */
+
+
+/* from file ccl.c */
+
+extern void ccladd PROTO((int, int)); /* add a single character to a ccl */
+extern int cclinit PROTO((void)); /* make an empty ccl */
+extern void cclnegate PROTO((int)); /* negate a ccl */
+
+/* List the members of a set of characters in CCL form. */
+extern void list_character_set PROTO((FILE*, int[]));
+
+
+/* from file dfa.c */
+
+/* Check a DFA state for backing up. */
+extern void check_for_backing_up PROTO((int, int[]));
+
+/* Check to see if NFA state set constitutes "dangerous" trailing context. */
+extern void check_trailing_context PROTO((int*, int, int*, int));
+
+/* Construct the epsilon closure of a set of ndfa states. */
+extern int *epsclosure PROTO((int*, int*, int[], int*, int*));
+
+/* Increase the maximum number of dfas. */
+extern void increase_max_dfas PROTO((void));
+
+extern void ntod PROTO((void)); /* convert a ndfa to a dfa */
+
+/* Converts a set of ndfa states into a dfa state. */
+extern int snstods PROTO((int[], int, int[], int, int, int*));
+
+
+/* from file ecs.c */
+
+/* Convert character classes to set of equivalence classes. */
+extern void ccl2ecl PROTO((void));
+
+/* Associate equivalence class numbers with class members. */
+extern int cre8ecs PROTO((int[], int[], int));
+
+/* Update equivalence classes based on character class transitions. */
+extern void mkeccl PROTO((wchar_t[], int, int[], int[], int, int));
+
+/* Create equivalence class for single character. */
+extern void mkechar PROTO((int, int[], int[]));
+
+
+/* from file gen.c */
+
+extern void do_indent PROTO((void)); /* indent to the current level */
+
+/* Generate the code to keep backing-up information. */
+extern void gen_backing_up PROTO((void));
+
+/* Generate the code to perform the backing up. */
+extern void gen_bu_action PROTO((void));
+
+/* Generate full speed compressed transition table. */
+extern void genctbl PROTO((void));
+
+/* Generate the code to find the action number. */
+extern void gen_find_action PROTO((void));
+
+extern void genftbl PROTO((void)); /* generate full transition table */
+
+/* Generate the code to find the next compressed-table state. */
+extern void gen_next_compressed_state PROTO((char*));
+
+/* Generate the code to find the next match. */
+extern void gen_next_match PROTO((void));
+
+/* Generate the code to find the next state. */
+extern void gen_next_state PROTO((int));
+
+/* Generate the code to make a NUL transition. */
+extern void gen_NUL_trans PROTO((void));
+
+/* Generate the code to find the start state. */
+extern void gen_start_state PROTO((void));
+
+/* Generate data statements for the transition tables. */
+extern void gentabs PROTO((void));
+
+/* Write out a formatted string at the current indentation level. */
+extern void indent_put2s PROTO((char[], char[]));
+
+/* Write out a string + newline at the current indentation level. */
+extern void indent_puts PROTO((char[]));
+
+extern void make_tables PROTO((void)); /* generate transition tables */
+
+
+/* from file main.c */
+
+extern void check_options PROTO((void));
+extern void flexend PROTO((int));
+extern void usage PROTO((void));
+
+
+/* from file misc.c */
+
+/* Add a #define to the action file. */
+extern void action_define PROTO(( char *defname, int value ));
+
+/* Add the given text to the stored actions. */
+extern void add_action PROTO(( char *new_text ));
+
+/* True if a string is all lower case. */
+extern int all_lower PROTO((register char *));
+
+/* True if a string is all upper case. */
+extern int all_upper PROTO((register char *));
+
+/* Bubble sort an integer array. */
+extern void bubble PROTO((int [], int));
+
+/* Check a character to make sure it's in the expected range. */
+extern void check_char PROTO((int c));
+
+/* Replace upper-case letter to lower-case. */
+extern Char clower PROTO((int));
+
+/* Returns a dynamically allocated copy of a string. */
+extern char *copy_string PROTO((register const char *));
+
+/* Returns a dynamically allocated copy of a (potentially) unsigned string. */
+extern Char *copy_unsigned_string PROTO((register Char *));
+
+/* Shell sort a character array. */
+extern void cshell PROTO((wchar_t[], int, int));
+
+/* Finish up a block of data declarations. */
+extern void dataend PROTO((void));
+
+/* Flush generated data statements. */
+extern void dataflush PROTO((void));
+
+/* Report an error message and terminate. */
+extern void flexerror PROTO((const char[]));
+
+/* Report a fatal error message and terminate. */
+extern void flexfatal PROTO((const char[]));
+
+/* Convert a hexadecimal digit string to an integer value. */
+extern int htoi PROTO((Char[]));
+
+/* Report an error message formatted with one integer argument. */
+extern void lerrif PROTO((const char[], int));
+
+/* Report an error message formatted with one string argument. */
+extern void lerrsf PROTO((const char[], const char[]));
+
+/* Spit out a "#line" statement. */
+extern void line_directive_out PROTO((FILE*, int));
+
+/* Mark the current position in the action array as the end of the section 1
+ * user defs.
+ */
+extern void mark_defs1 PROTO((void));
+
+/* Mark the current position in the action array as the end of the prolog. */
+extern void mark_prolog PROTO((void));
+
+/* Generate a data statment for a two-dimensional array. */
+extern void mk2data PROTO((int));
+
+extern void mkdata PROTO((int)); /* generate a data statement */
+
+/* Return the integer represented by a string of digits. */
+extern int myctoi PROTO((char []));
+
+/* Return character corresponding to escape sequence. */
+extern int myesc PROTO((Char[]));
+
+/* Convert an octal digit string to an integer value. */
+extern int otoi PROTO((Char [] ));
+
+/* Output a (possibly-formatted) string to the generated scanner. */
+extern void out PROTO((const char []));
+extern void out_dec PROTO((const char [], int));
+extern void out_dec2 PROTO((const char [], int, int));
+extern void out_hex PROTO((const char [], unsigned int));
+extern void out_line_count PROTO((const char []));
+extern void out_str PROTO((const char [], const char []));
+extern void out_str3
+ PROTO((const char [], const char [], const char [], const char []));
+extern void out_str_dec PROTO((const char [], const char [], int));
+extern void outc PROTO((int));
+extern void outn PROTO((const char []));
+
+/* Return a printable version of the given character, which might be
+ * 8-bit.
+ */
+extern char *readable_form PROTO((int));
+
+/* Write out one section of the skeleton file. */
+extern void skelout PROTO((void));
+
+/* Output a yy_trans_info structure. */
+extern void transition_struct_out PROTO((int, int));
+
+/* Only needed when using certain broken versions of bison to build parse.c. */
+extern void *yy_flex_xmalloc PROTO(( int ));
+
+/* Set a region of memory to 0. */
+extern void zero_out PROTO((char *, size_t));
+
+
+/* from file nfa.c */
+
+/* Add an accepting state to a machine. */
+extern void add_accept PROTO((int, int));
+
+/* Make a given number of copies of a singleton machine. */
+extern int copysingl PROTO((int, int));
+
+/* Debugging routine to write out an nfa. */
+extern void dumpnfa PROTO((int));
+
+/* Finish up the processing for a rule. */
+extern void finish_rule PROTO((int, int, int, int));
+
+/* Connect two machines together. */
+extern int link_machines PROTO((int, int));
+
+/* Mark each "beginning" state in a machine as being a "normal" (i.e.,
+ * not trailing context associated) state.
+ */
+extern void mark_beginning_as_normal PROTO((register int));
+
+/* Make a machine that branches to two machines. */
+extern int mkbranch PROTO((int, int));
+
+extern int mkclos PROTO((int)); /* convert a machine into a closure */
+extern int mkopt PROTO((int)); /* make a machine optional */
+
+/* Make a machine that matches either one of two machines. */
+extern int mkor PROTO((int, int));
+
+/* Convert a machine into a positive closure. */
+extern int mkposcl PROTO((int));
+
+extern int mkrep PROTO((int, int, int)); /* make a replicated machine */
+
+/* Create a state with a transition on a given symbol. */
+extern int mkstate PROTO((int));
+
+extern void new_rule PROTO((void)); /* initialize for a new rule */
+
+
+/* from file parse.y */
+
+/* Build the "<<EOF>>" action for the active start conditions. */
+extern void build_eof_action PROTO((void));
+
+/* Write out a message formatted with one string, pinpointing its location. */
+extern void format_pinpoint_message PROTO((char[], char[]));
+
+/* Write out a message, pinpointing its location. */
+extern void pinpoint_message PROTO((char[]));
+
+/* Write out a warning, pinpointing it at the given line. */
+extern void line_warning PROTO(( char[], int ));
+
+/* Write out a message, pinpointing it at the given line. */
+extern void line_pinpoint PROTO(( char[], int ));
+
+/* Report a formatted syntax error. */
+extern void format_synerr PROTO((char [], char[]));
+extern void synerr PROTO((char [])); /* report a syntax error */
+extern void format_warn PROTO((char [], char[]));
+extern void warn PROTO((char [])); /* report a warning */
+extern void yyerror PROTO((char [])); /* report a parse error */
+extern int yyparse PROTO((void)); /* the YACC parser */
+
+
+/* from file scan.l */
+
+/* The Flex-generated scanner for flex. */
+extern int flexscan PROTO((void));
+
+/* Open the given file (if NULL, stdin) for scanning. */
+extern void set_input_file PROTO((char*));
+
+/* Wrapup a file in the lexical analyzer. */
+extern int yywrap PROTO((void));
+
+
+/* from file sym.c */
+
+/* Add symbol and definitions to symbol table. */
+extern int addsym PROTO((register char[], char*, int, hash_table, int));
+
+/* Save the text of a character class. */
+extern void cclinstal PROTO ((Char [], int));
+
+/* Lookup the number associated with character class. */
+extern int ccllookup PROTO((Char []));
+
+/* Find symbol in symbol table. */
+extern struct hash_entry *findsym PROTO((register char[], hash_table, int ));
+
+extern void ndinstal PROTO((char[], Char[])); /* install a name definition */
+extern Char *ndlookup PROTO((char[])); /* lookup a name definition */
+
+/* Increase maximum number of SC's. */
+extern void scextend PROTO((void));
+extern void scinstal PROTO((char[], int)); /* make a start condition */
+
+/* Lookup the number associated with a start condition. */
+extern int sclookup PROTO((char[]));
+
+
+/* from file tblcmp.c */
+
+/* Build table entries for dfa state. */
+extern void bldtbl PROTO((int[], int, int, int, int));
+
+extern void cmptmps PROTO((void)); /* compress template table entries */
+extern void expand_nxt_chk PROTO((void)); /* increase nxt/chk arrays */
+/* Finds a space in the table for a state to be placed. */
+extern int find_table_space PROTO((int*, int));
+extern void inittbl PROTO((void)); /* initialize transition tables */
+/* Make the default, "jam" table entries. */
+extern void mkdeftbl PROTO((void));
+
+/* Create table entries for a state (or state fragment) which has
+ * only one out-transition.
+ */
+extern void mk1tbl PROTO((int, int, int, int));
+
+/* Place a state into full speed transition table. */
+extern void place_state PROTO((int*, int, int));
+
+/* Save states with only one out-transition to be processed later. */
+extern void stack1 PROTO((int, int, int, int));
+
+
+/* from file yylex.c */
+
+extern int yylex PROTO((void));
diff --git a/to.do/unicode/gen.c b/to.do/unicode/gen.c
new file mode 100644
index 0000000..d9db93a
--- /dev/null
+++ b/to.do/unicode/gen.c
@@ -0,0 +1,1650 @@
+/* gen - actual generation (writing) of flex scanners */
+
+/*-
+ * 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 are permitted provided
+ * that: (1) source distributions retain this entire copyright notice and
+ * comment, and (2) distributions including binaries display the following
+ * acknowledgement: ``This product includes software developed by the
+ * University of California, Berkeley and its contributors'' in the
+ * documentation or other materials provided with the distribution and in
+ * all advertising materials mentioning features or use of this software.
+ * 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.
+ */
+
+/* $Header$ */
+
+#include "flexdef.h"
+
+
+/* declare functions that have forward references */
+
+void gen_next_state PROTO((int));
+void genecs PROTO((void));
+void indent_put2s PROTO((char [], char []));
+void indent_puts PROTO((char []));
+
+
+static int indent_level = 0; /* each level is 8 spaces */
+
+#define indent_up() (++indent_level)
+#define indent_down() (--indent_level)
+#define set_indent(indent_val) indent_level = indent_val
+
+/* Almost everything is done in terms of arrays starting at 1, so provide
+ * a null entry for the zero element of all C arrays. (The exception
+ * to this is that the fast table representation generally uses the
+ * 0 elements of its arrays, too.)
+ */
+static char C_int_decl[] = "static yyconst int %s[%d] =\n { 0,\n";
+static char C_short_decl[] = "static yyconst short int %s[%d] =\n { 0,\n";
+static char C_long_decl[] = "static yyconst long int %s[%d] =\n { 0,\n";
+static char C_state_decl[] =
+ "static yyconst yy_state_type %s[%d] =\n { 0,\n";
+static char C_uchar_decl[] =
+ "static yyconst unsigned char %s[%d] =\n { 0,\n";
+static char C_ushort_decl[] =
+ "static yyconst unsigned short %s[%d] =\n { 0,\n";
+
+
+/* Indent to the current level. */
+
+void do_indent()
+ {
+ register int i = indent_level * 8;
+
+ while ( i >= 8 )
+ {
+ outc( '\t' );
+ i -= 8;
+ }
+
+ while ( i > 0 )
+ {
+ outc( ' ' );
+ --i;
+ }
+ }
+
+
+/* Generate the code to keep backing-up information. */
+
+void gen_backing_up()
+ {
+ if ( reject || num_backing_up == 0 )
+ return;
+
+ if ( fullspd )
+ indent_puts( "if ( yy_current_state[-1].yy_nxt )" );
+ else
+ indent_puts( "if ( yy_accept[yy_current_state] )" );
+
+ indent_up();
+ indent_puts( "{" );
+ indent_puts( "yy_last_accepting_state = yy_current_state;" );
+ indent_puts( "yy_last_accepting_cpos = yy_cp;" );
+ indent_puts( "}" );
+ indent_down();
+ }
+
+
+/* Generate the code to perform the backing up. */
+
+void gen_bu_action()
+ {
+ if ( reject || num_backing_up == 0 )
+ return;
+
+ set_indent( 3 );
+
+ indent_puts( "case 0: /* must back up */" );
+ indent_puts( "/* undo the effects of YY_DO_BEFORE_ACTION */" );
+ indent_puts( "*yy_cp = yy_hold_char;" );
+
+ if ( fullspd || fulltbl )
+ indent_puts( "yy_cp = yy_last_accepting_cpos + 1;" );
+ else
+ /* Backing-up info for compressed tables is taken \after/
+ * yy_cp has been incremented for the next state.
+ */
+ indent_puts( "yy_cp = yy_last_accepting_cpos;" );
+
+ indent_puts( "yy_current_state = yy_last_accepting_state;" );
+ indent_puts( "goto yy_find_action;" );
+ outc( '\n' );
+
+ set_indent( 0 );
+ }
+
+
+/* genctbl - generates full speed compressed transition table */
+
+void genctbl()
+ {
+ register int i;
+ int end_of_buffer_action = num_rules + 1;
+
+ /* Table of verify for transition and offset to next state. */
+ out_dec( "static yyconst struct yy_trans_info yy_transition[%d] =\n",
+ tblend + numecs + 1 );
+ outn( " {" );
+
+ /* We want the transition to be represented as the offset to the
+ * next state, not the actual state number, which is what it currently
+ * is. The offset is base[nxt[i]] - (base of current state)]. That's
+ * just the difference between the starting points of the two involved
+ * states (to - from).
+ *
+ * First, though, we need to find some way to put in our end-of-buffer
+ * flags and states. We do this by making a state with absolutely no
+ * transitions. We put it at the end of the table.
+ */
+
+ /* We need to have room in nxt/chk for two more slots: One for the
+ * action and one for the end-of-buffer transition. We now *assume*
+ * that we're guaranteed the only character we'll try to index this
+ * nxt/chk pair with is EOB, i.e., 0, so we don't have to make sure
+ * there's room for jam entries for other characters.
+ */
+
+ while ( tblend + 2 >= current_max_xpairs )
+ expand_nxt_chk();
+
+ while ( lastdfa + 1 >= current_max_dfas )
+ increase_max_dfas();
+
+ base[lastdfa + 1] = tblend + 2;
+ nxt[tblend + 1] = end_of_buffer_action;
+ chk[tblend + 1] = numecs + 1;
+ chk[tblend + 2] = 1; /* anything but EOB */
+
+ /* So that "make test" won't show arb. differences. */
+ nxt[tblend + 2] = 0;
+
+ /* Make sure every state has an end-of-buffer transition and an
+ * action #.
+ */
+ for ( i = 0; i <= lastdfa; ++i )
+ {
+ int anum = dfaacc[i].dfaacc_state;
+ int offset = base[i];
+
+ chk[offset] = EOB_POSITION;
+ chk[offset - 1] = ACTION_POSITION;
+ nxt[offset - 1] = anum; /* action number */
+ }
+
+ for ( i = 0; i <= tblend; ++i )
+ {
+ if ( chk[i] == EOB_POSITION )
+ transition_struct_out( 0, base[lastdfa + 1] - i );
+
+ else if ( chk[i] == ACTION_POSITION )
+ transition_struct_out( 0, nxt[i] );
+
+ else if ( chk[i] > numecs || chk[i] == 0 )
+ transition_struct_out( 0, 0 ); /* unused slot */
+
+ else /* verify, transition */
+ transition_struct_out( chk[i],
+ base[nxt[i]] - (i - chk[i]) );
+ }
+
+
+ /* Here's the final, end-of-buffer state. */
+ transition_struct_out( chk[tblend + 1], nxt[tblend + 1] );
+ transition_struct_out( chk[tblend + 2], nxt[tblend + 2] );
+
+ outn( " };\n" );
+
+ /* Table of pointers to start states. */
+ out_dec(
+ "static yyconst struct yy_trans_info *yy_start_state_list[%d] =\n",
+ lastsc * 2 + 1 );
+ outn( " {" ); /* } so vi doesn't get confused */
+
+ for ( i = 0; i <= lastsc * 2; ++i )
+ out_dec( " &yy_transition[%d],\n", base[i] );
+
+ dataend();
+
+ if ( useecs )
+ genecs();
+ }
+
+
+/* Generate equivalence-class tables. */
+
+void genecs()
+ {
+ register int i, j;
+ int numrows;
+
+ if ( csize == 65536 && long_align )
+ out_str_dec( C_long_decl, "yy_ec", csize );
+ else if ( csize == 65536 && numecs < 256 )
+ out_str_dec( C_uchar_decl, "yy_ec", csize );
+ else if ( csize == 65536 && numecs < 65536 )
+ out_str_dec( C_ushort_decl, "yy_ec", csize );
+ else
+ out_str_dec( C_int_decl, "yy_ec", csize );
+
+ for ( i = 1; i < csize; ++i )
+ {
+ if ( caseins && (i >= 'A') && (i <= 'Z') )
+ ecgroup[i] = ecgroup[clower( i )];
+
+ ecgroup[i] = ABS( ecgroup[i] );
+ mkdata( ecgroup[i] );
+ }
+
+ dataend();
+
+ if ( trace )
+ {
+ fputs( _( "\n\nEquivalence Classes:\n\n" ), stderr );
+
+ numrows = csize / 8;
+
+ for ( j = 0; j < numrows; ++j )
+ {
+ for ( i = j; i < csize; i = i + numrows )
+ {
+ fprintf( stderr, "%4s = %-2d",
+ readable_form( i ), ecgroup[i] );
+
+ putc( ' ', stderr );
+ }
+
+ putc( '\n', stderr );
+ }
+ }
+ }
+
+
+/* Generate the code to find the action number. */
+
+void gen_find_action()
+ {
+ if ( fullspd )
+ indent_puts( "yy_act = yy_current_state[-1].yy_nxt;" );
+
+ else if ( fulltbl )
+ indent_puts( "yy_act = yy_accept[yy_current_state];" );
+
+ else if ( reject )
+ {
+ indent_puts( "yy_current_state = *--yy_state_ptr;" );
+ indent_puts( "yy_lp = yy_accept[yy_current_state];" );
+
+ outn(
+ "find_rule: /* we branch to this label when backing up */" );
+
+ indent_puts(
+ "for ( ; ; ) /* until we find what rule we matched */" );
+
+ indent_up();
+
+ indent_puts( "{" );
+
+ indent_puts(
+ "if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] )" );
+ indent_up();
+ indent_puts( "{" );
+ indent_puts( "yy_act = yy_acclist[yy_lp];" );
+
+ if ( variable_trailing_context_rules )
+ {
+ indent_puts( "if ( yy_act & YY_TRAILING_HEAD_MASK ||" );
+ indent_puts( " yy_looking_for_trail_begin )" );
+ indent_up();
+ indent_puts( "{" );
+
+ indent_puts(
+ "if ( yy_act == yy_looking_for_trail_begin )" );
+ indent_up();
+ indent_puts( "{" );
+ indent_puts( "yy_looking_for_trail_begin = 0;" );
+ indent_puts( "yy_act &= ~YY_TRAILING_HEAD_MASK;" );
+ indent_puts( "break;" );
+ indent_puts( "}" );
+ indent_down();
+
+ indent_puts( "}" );
+ indent_down();
+
+ indent_puts( "else if ( yy_act & YY_TRAILING_MASK )" );
+ indent_up();
+ indent_puts( "{" );
+ indent_puts(
+ "yy_looking_for_trail_begin = yy_act & ~YY_TRAILING_MASK;" );
+ indent_puts(
+ "yy_looking_for_trail_begin |= YY_TRAILING_HEAD_MASK;" );
+
+ if ( real_reject )
+ {
+ /* Remember matched text in case we back up
+ * due to REJECT.
+ */
+ indent_puts( "yy_full_match = yy_cp;" );
+ indent_puts( "yy_full_state = yy_state_ptr;" );
+ indent_puts( "yy_full_lp = yy_lp;" );
+ }
+
+ indent_puts( "}" );
+ indent_down();
+
+ indent_puts( "else" );
+ indent_up();
+ indent_puts( "{" );
+ indent_puts( "yy_full_match = yy_cp;" );
+ indent_puts( "yy_full_state = yy_state_ptr;" );
+ indent_puts( "yy_full_lp = yy_lp;" );
+ indent_puts( "break;" );
+ indent_puts( "}" );
+ indent_down();
+
+ indent_puts( "++yy_lp;" );
+ indent_puts( "goto find_rule;" );
+ }
+
+ else
+ {
+ /* Remember matched text in case we back up due to
+ * trailing context plus REJECT.
+ */
+ indent_up();
+ indent_puts( "{" );
+ indent_puts( "yy_full_match = yy_cp;" );
+ indent_puts( "break;" );
+ indent_puts( "}" );
+ indent_down();
+ }
+
+ indent_puts( "}" );
+ indent_down();
+
+ indent_puts( "--yy_cp;" );
+
+ /* We could consolidate the following two lines with those at
+ * the beginning, but at the cost of complaints that we're
+ * branching inside a loop.
+ */
+ indent_puts( "yy_current_state = *--yy_state_ptr;" );
+ indent_puts( "yy_lp = yy_accept[yy_current_state];" );
+
+ indent_puts( "}" );
+
+ indent_down();
+ }
+
+ else
+ { /* compressed */
+ indent_puts( "yy_act = yy_accept[yy_current_state];" );
+
+ if ( interactive && ! reject )
+ {
+ /* Do the guaranteed-needed backing up to figure out
+ * the match.
+ */
+ indent_puts( "if ( yy_act == 0 )" );
+ indent_up();
+ indent_puts( "{ /* have to back up */" );
+ indent_puts( "yy_cp = yy_last_accepting_cpos;" );
+ indent_puts(
+ "yy_current_state = yy_last_accepting_state;" );
+ indent_puts( "yy_act = yy_accept[yy_current_state];" );
+ indent_puts( "}" );
+ indent_down();
+ }
+ }
+ }
+
+
+/* genftbl - generate full transition table */
+
+void genftbl()
+ {
+ register int i;
+ int end_of_buffer_action = num_rules + 1;
+
+ out_str_dec( long_align ? C_long_decl : C_short_decl,
+ "yy_accept", lastdfa + 1 );
+
+ dfaacc[end_of_buffer_state].dfaacc_state = end_of_buffer_action;
+
+ for ( i = 1; i <= lastdfa; ++i )
+ {
+ register int anum = dfaacc[i].dfaacc_state;
+
+ mkdata( anum );
+
+ if ( trace && anum )
+ fprintf( stderr, _( "state # %d accepts: [%d]\n" ),
+ i, anum );
+ }
+
+ dataend();
+
+ if ( useecs )
+ genecs();
+
+ /* Don't have to dump the actual full table entries - they were
+ * created on-the-fly.
+ */
+ }
+
+
+/* Generate the code to find the next compressed-table state. */
+
+void gen_next_compressed_state( char_map )
+char *char_map;
+ {
+ indent_put2s( "register YY_CHAR yy_c = %s;", char_map );
+
+ /* Save the backing-up info \before/ computing the next state
+ * because we always compute one more state than needed - we
+ * always proceed until we reach a jam state
+ */
+ gen_backing_up();
+
+ indent_puts(
+"while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )" );
+ indent_up();
+ indent_puts( "{" );
+ indent_puts( "yy_current_state = (int) yy_def[yy_current_state];" );
+
+ if ( usemecs )
+ {
+ /* We've arrange it so that templates are never chained
+ * to one another. This means we can afford to make a
+ * very simple test to see if we need to convert to
+ * yy_c's meta-equivalence class without worrying
+ * about erroneously looking up the meta-equivalence
+ * class twice
+ */
+ do_indent();
+
+ /* lastdfa + 2 is the beginning of the templates */
+ out_dec( "if ( yy_current_state >= %d )\n", lastdfa + 2 );
+
+ indent_up();
+ indent_puts( "yy_c = yy_meta[(unsigned int) yy_c];" );
+ indent_down();
+ }
+
+ indent_puts( "}" );
+ indent_down();
+
+ indent_puts(
+"yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];" );
+ }
+
+
+/* Generate the code to find the next match. */
+
+void gen_next_match()
+ {
+ /* NOTE - changes in here should be reflected in gen_next_state() and
+ * gen_NUL_trans().
+ */
+ char *char_map = useecs ?
+ "yy_ec[YY_SC_TO_UI(*yy_cp)]" :
+ "YY_SC_TO_UI(*yy_cp)";
+
+ char *char_map_2 = useecs ?
+ "yy_ec[YY_SC_TO_UI(*++yy_cp)]" :
+ "YY_SC_TO_UI(*++yy_cp)";
+
+ if ( fulltbl )
+ {
+ indent_put2s(
+ "while ( (yy_current_state = yy_nxt[yy_current_state][%s]) > 0 )",
+ char_map );
+
+ indent_up();
+
+ if ( num_backing_up > 0 )
+ {
+ indent_puts( "{" ); /* } for vi */
+ gen_backing_up();
+ outc( '\n' );
+ }
+
+ indent_puts( "++yy_cp;" );
+
+ if ( num_backing_up > 0 )
+ /* { for vi */
+ indent_puts( "}" );
+
+ indent_down();
+
+ outc( '\n' );
+ indent_puts( "yy_current_state = -yy_current_state;" );
+ }
+
+ else if ( fullspd )
+ {
+ indent_puts( "{" ); /* } for vi */
+ indent_puts(
+ "register yyconst struct yy_trans_info *yy_trans_info;\n" );
+ indent_puts( "register YY_CHAR yy_c;\n" );
+ indent_put2s( "for ( yy_c = %s;", char_map );
+ indent_puts(
+ " (yy_trans_info = &yy_current_state[(unsigned int) yy_c])->" );
+ indent_puts( "yy_verify == yy_c;" );
+ indent_put2s( " yy_c = %s )", char_map_2 );
+
+ indent_up();
+
+ if ( num_backing_up > 0 )
+ indent_puts( "{" ); /* } for vi */
+
+ indent_puts( "yy_current_state += yy_trans_info->yy_nxt;" );
+
+ if ( num_backing_up > 0 )
+ {
+ outc( '\n' );
+ gen_backing_up(); /* { for vi */
+ indent_puts( "}" );
+ }
+
+ indent_down(); /* { for vi */
+ indent_puts( "}" );
+ }
+
+ else
+ { /* compressed */
+ indent_puts( "do" );
+
+ indent_up();
+ indent_puts( "{" ); /* } for vi */
+
+ gen_next_state( false );
+
+ indent_puts( "++yy_cp;" );
+
+ /* { for vi */
+ indent_puts( "}" );
+ indent_down();
+
+ do_indent();
+
+ if ( interactive )
+ out_dec( "while ( yy_base[yy_current_state] != %d );\n",
+ jambase );
+ else
+ out_dec( "while ( yy_current_state != %d );\n",
+ jamstate );
+
+ if ( ! reject && ! interactive )
+ {
+ /* Do the guaranteed-needed backing up to figure out
+ * the match.
+ */
+ indent_puts( "yy_cp = yy_last_accepting_cpos;" );
+ indent_puts(
+ "yy_current_state = yy_last_accepting_state;" );
+ }
+ }
+ }
+
+
+/* Generate the code to find the next state. */
+
+void gen_next_state( worry_about_NULs )
+int worry_about_NULs;
+ { /* NOTE - changes in here should be reflected in gen_next_match() */
+ char char_map[256];
+
+ if ( worry_about_NULs && ! nultrans )
+ {
+ if ( useecs )
+ (void) sprintf( char_map,
+ "(*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : %d)",
+ NUL_ec );
+ else
+ (void) sprintf( char_map,
+ "(*yy_cp ? YY_SC_TO_UI(*yy_cp) : %d)", NUL_ec );
+ }
+
+ else
+ strcpy( char_map, useecs ?
+ "yy_ec[YY_SC_TO_UI(*yy_cp)]" : "YY_SC_TO_UI(*yy_cp)" );
+
+ if ( worry_about_NULs && nultrans )
+ {
+ if ( ! fulltbl && ! fullspd )
+ /* Compressed tables back up *before* they match. */
+ gen_backing_up();
+
+ indent_puts( "if ( *yy_cp )" );
+ indent_up();
+ indent_puts( "{" ); /* } for vi */
+ }
+
+ if ( fulltbl )
+ indent_put2s(
+ "yy_current_state = yy_nxt[yy_current_state][%s];",
+ char_map );
+
+ else if ( fullspd )
+ indent_put2s(
+ "yy_current_state += yy_current_state[%s].yy_nxt;",
+ char_map );
+
+ else
+ gen_next_compressed_state( char_map );
+
+ if ( worry_about_NULs && nultrans )
+ {
+ /* { for vi */
+ indent_puts( "}" );
+ indent_down();
+ indent_puts( "else" );
+ indent_up();
+ indent_puts(
+ "yy_current_state = yy_NUL_trans[yy_current_state];" );
+ indent_down();
+ }
+
+ if ( fullspd || fulltbl )
+ gen_backing_up();
+
+ if ( reject )
+ indent_puts( "*yy_state_ptr++ = yy_current_state;" );
+ }
+
+
+/* Generate the code to make a NUL transition. */
+
+void gen_NUL_trans()
+ { /* NOTE - changes in here should be reflected in gen_next_match() */
+ /* Only generate a definition for "yy_cp" if we'll generate code
+ * that uses it. Otherwise lint and the like complain.
+ */
+ int need_backing_up = (num_backing_up > 0 && ! reject);
+
+ if ( need_backing_up && (! nultrans || fullspd || fulltbl) )
+ /* We're going to need yy_cp lying around for the call
+ * below to gen_backing_up().
+ */
+ indent_puts( "register YY_CHAR *yy_cp = yy_c_buf_p;" );
+
+ outc( '\n' );
+
+ if ( nultrans )
+ {
+ indent_puts(
+ "yy_current_state = yy_NUL_trans[yy_current_state];" );
+ indent_puts( "yy_is_jam = (yy_current_state == 0);" );
+ }
+
+ else if ( fulltbl )
+ {
+ do_indent();
+ out_dec( "yy_current_state = yy_nxt[yy_current_state][%d];\n",
+ NUL_ec );
+ indent_puts( "yy_is_jam = (yy_current_state <= 0);" );
+ }
+
+ else if ( fullspd )
+ {
+ do_indent();
+ out_dec( "register int yy_c = %d;\n", NUL_ec );
+
+ indent_puts(
+ "register yyconst struct yy_trans_info *yy_trans_info;\n" );
+ indent_puts(
+ "yy_trans_info = &yy_current_state[(unsigned int) yy_c];" );
+ indent_puts( "yy_current_state += yy_trans_info->yy_nxt;" );
+
+ indent_puts(
+ "yy_is_jam = (yy_trans_info->yy_verify != yy_c);" );
+ }
+
+ else
+ {
+ char NUL_ec_str[20];
+
+ (void) sprintf( NUL_ec_str, "%d", NUL_ec );
+ gen_next_compressed_state( NUL_ec_str );
+
+ do_indent();
+ out_dec( "yy_is_jam = (yy_current_state == %d);\n", jamstate );
+
+ if ( reject )
+ {
+ /* Only stack this state if it's a transition we
+ * actually make. If we stack it on a jam, then
+ * the state stack and yy_c_buf_p get out of sync.
+ */
+ indent_puts( "if ( ! yy_is_jam )" );
+ indent_up();
+ indent_puts( "*yy_state_ptr++ = yy_current_state;" );
+ indent_down();
+ }
+ }
+
+ /* If we've entered an accepting state, back up; note that
+ * compressed tables have *already* done such backing up, so
+ * we needn't bother with it again.
+ */
+ if ( need_backing_up && (fullspd || fulltbl) )
+ {
+ outc( '\n' );
+ indent_puts( "if ( ! yy_is_jam )" );
+ indent_up();
+ indent_puts( "{" );
+ gen_backing_up();
+ indent_puts( "}" );
+ indent_down();
+ }
+ }
+
+
+/* Generate the code to find the start state. */
+
+void gen_start_state()
+ {
+ if ( fullspd )
+ {
+ if ( bol_needed )
+ {
+ indent_puts(
+ "yy_current_state = yy_start_state_list[yy_start + YY_AT_BOL()];" );
+ }
+ else
+ indent_puts(
+ "yy_current_state = yy_start_state_list[yy_start];" );
+ }
+
+ else
+ {
+ indent_puts( "yy_current_state = yy_start;" );
+
+ if ( bol_needed )
+ indent_puts( "yy_current_state += YY_AT_BOL();" );
+
+ if ( reject )
+ {
+ /* Set up for storing up states. */
+ indent_puts( "yy_state_ptr = yy_state_buf;" );
+ indent_puts( "*yy_state_ptr++ = yy_current_state;" );
+ }
+ }
+ }
+
+
+/* gentabs - generate data statements for the transition tables */
+
+void gentabs()
+ {
+ int i, j, k, *accset, nacc, *acc_array, total_states;
+ int end_of_buffer_action = num_rules + 1;
+
+ acc_array = allocate_integer_array( current_max_dfas );
+ nummt = 0;
+
+ /* The compressed table format jams by entering the "jam state",
+ * losing information about the previous state in the process.
+ * In order to recover the previous state, we effectively need
+ * to keep backing-up information.
+ */
+ ++num_backing_up;
+
+ if ( reject )
+ {
+ /* Write out accepting list and pointer list.
+ *
+ * First we generate the "yy_acclist" array. In the process,
+ * we compute the indices that will go into the "yy_accept"
+ * array, and save the indices in the dfaacc array.
+ */
+ int EOB_accepting_list[2];
+
+ /* Set up accepting structures for the End Of Buffer state. */
+ EOB_accepting_list[0] = 0;
+ EOB_accepting_list[1] = end_of_buffer_action;
+ accsiz[end_of_buffer_state] = 1;
+ dfaacc[end_of_buffer_state].dfaacc_set = EOB_accepting_list;
+
+ out_str_dec( long_align ? C_long_decl : C_short_decl,
+ "yy_acclist", MAX( numas, 1 ) + 1 );
+
+ j = 1; /* index into "yy_acclist" array */
+
+ for ( i = 1; i <= lastdfa; ++i )
+ {
+ acc_array[i] = j;
+
+ if ( accsiz[i] != 0 )
+ {
+ accset = dfaacc[i].dfaacc_set;
+ nacc = accsiz[i];
+
+ if ( trace )
+ fprintf( stderr,
+ _( "state # %d accepts: " ),
+ i );
+
+ for ( k = 1; k <= nacc; ++k )
+ {
+ int accnum = accset[k];
+
+ ++j;
+
+ if ( variable_trailing_context_rules &&
+ ! (accnum & YY_TRAILING_HEAD_MASK) &&
+ accnum > 0 && accnum <= num_rules &&
+ rule_type[accnum] == RULE_VARIABLE )
+ {
+ /* Special hack to flag
+ * accepting number as part
+ * of trailing context rule.
+ */
+ accnum |= YY_TRAILING_MASK;
+ }
+
+ mkdata( accnum );
+
+ if ( trace )
+ {
+ fprintf( stderr, "[%d]",
+ accset[k] );
+
+ if ( k < nacc )
+ fputs( ", ", stderr );
+ else
+ putc( '\n', stderr );
+ }
+ }
+ }
+ }
+
+ /* add accepting number for the "jam" state */
+ acc_array[i] = j;
+
+ dataend();
+ }
+
+ else
+ {
+ dfaacc[end_of_buffer_state].dfaacc_state = end_of_buffer_action;
+
+ for ( i = 1; i <= lastdfa; ++i )
+ acc_array[i] = dfaacc[i].dfaacc_state;
+
+ /* add accepting number for jam state */
+ acc_array[i] = 0;
+ }
+
+ /* Spit out "yy_accept" array. If we're doing "reject", it'll be
+ * pointers into the "yy_acclist" array. Otherwise it's actual
+ * accepting numbers. In either case, we just dump the numbers.
+ */
+
+ /* "lastdfa + 2" is the size of "yy_accept"; includes room for C arrays
+ * beginning at 0 and for "jam" state.
+ */
+ k = lastdfa + 2;
+
+ if ( reject )
+ /* We put a "cap" on the table associating lists of accepting
+ * numbers with state numbers. This is needed because we tell
+ * where the end of an accepting list is by looking at where
+ * the list for the next state starts.
+ */
+ ++k;
+
+ out_str_dec( long_align ? C_long_decl : C_short_decl, "yy_accept", k );
+
+ for ( i = 1; i <= lastdfa; ++i )
+ {
+ mkdata( acc_array[i] );
+
+ if ( ! reject && trace && acc_array[i] )
+ fprintf( stderr, _( "state # %d accepts: [%d]\n" ),
+ i, acc_array[i] );
+ }
+
+ /* Add entry for "jam" state. */
+ mkdata( acc_array[i] );
+
+ if ( reject )
+ /* Add "cap" for the list. */
+ mkdata( acc_array[i] );
+
+ dataend();
+
+ if ( useecs )
+ genecs();
+
+ if ( usemecs )
+ {
+ /* Write out meta-equivalence classes (used to index
+ * templates with).
+ */
+
+ if ( trace )
+ fputs( _( "\n\nMeta-Equivalence Classes:\n" ),
+ stderr );
+
+ out_str_dec( C_int_decl, "yy_meta", numecs + 1 );
+
+ for ( i = 1; i <= numecs; ++i )
+ {
+ if ( trace )
+ fprintf( stderr, "%d = %d\n",
+ i, ABS( tecbck[i] ) );
+
+ mkdata( ABS( tecbck[i] ) );
+ }
+
+ dataend();
+ }
+
+ total_states = lastdfa + numtemps;
+
+ out_str_dec( (tblend >= MAX_SHORT || long_align) ?
+ C_long_decl : C_short_decl,
+ "yy_base", total_states + 1 );
+
+ for ( i = 1; i <= lastdfa; ++i )
+ {
+ register int d = def[i];
+
+ if ( base[i] == JAMSTATE )
+ base[i] = jambase;
+
+ if ( d == JAMSTATE )
+ def[i] = jamstate;
+
+ else if ( d < 0 )
+ {
+ /* Template reference. */
+ ++tmpuses;
+ def[i] = lastdfa - d + 1;
+ }
+
+ mkdata( base[i] );
+ }
+
+ /* Generate jam state's base index. */
+ mkdata( base[i] );
+
+ for ( ++i /* skip jam state */; i <= total_states; ++i )
+ {
+ mkdata( base[i] );
+ def[i] = jamstate;
+ }
+
+ dataend();
+
+ out_str_dec( (total_states >= MAX_SHORT || long_align) ?
+ C_long_decl : C_short_decl,
+ "yy_def", total_states + 1 );
+
+ for ( i = 1; i <= total_states; ++i )
+ mkdata( def[i] );
+
+ dataend();
+
+ out_str_dec( (total_states >= MAX_SHORT || long_align) ?
+ C_long_decl : C_short_decl,
+ "yy_nxt", tblend + 1 );
+
+ for ( i = 1; i <= tblend; ++i )
+ {
+ /* Note, the order of the following test is important.
+ * If chk[i] is 0, then nxt[i] is undefined.
+ */
+ if ( chk[i] == 0 || nxt[i] == 0 )
+ nxt[i] = jamstate; /* new state is the JAM state */
+
+ mkdata( nxt[i] );
+ }
+
+ dataend();
+
+ out_str_dec( (total_states >= MAX_SHORT || long_align) ?
+ C_long_decl : C_short_decl,
+ "yy_chk", tblend + 1 );
+
+ for ( i = 1; i <= tblend; ++i )
+ {
+ if ( chk[i] == 0 )
+ ++nummt;
+
+ mkdata( chk[i] );
+ }
+
+ dataend();
+ }
+
+
+/* Write out a formatted string (with a secondary string argument) at the
+ * current indentation level, adding a final newline.
+ */
+
+void indent_put2s( fmt, arg )
+char fmt[], arg[];
+ {
+ do_indent();
+ out_str( fmt, arg );
+ outn( "" );
+ }
+
+
+/* Write out a string at the current indentation level, adding a final
+ * newline.
+ */
+
+void indent_puts( str )
+char str[];
+ {
+ do_indent();
+ outn( str );
+ }
+
+
+/* make_tables - generate transition tables and finishes generating output file
+ */
+
+void make_tables()
+ {
+ register int i;
+ int did_eof_rule = false;
+
+ skelout();
+
+ /* First, take care of YY_DO_BEFORE_ACTION depending on yymore
+ * being used.
+ */
+ set_indent( 1 );
+
+ if ( yymore_used && ! yytext_is_array )
+ {
+ indent_puts( "yytext_ptr -= yy_more_len; \\" );
+ indent_puts( "yyleng = (int) (yy_cp - yytext_ptr); \\" );
+ }
+
+ else
+ indent_puts( "yyleng = (int) (yy_cp - yy_bp); \\" );
+
+ /* Now also deal with copying yytext_ptr to yytext if needed. */
+ skelout();
+ if ( yytext_is_array )
+ {
+ if ( yymore_used )
+ indent_puts(
+ "if ( yyleng + yy_more_offset >= YYLMAX ) \\" );
+ else
+ indent_puts( "if ( yyleng >= YYLMAX ) \\" );
+
+ indent_up();
+ indent_puts(
+ "YY_FATAL_ERROR( \"token too large, exceeds YYLMAX\" ); \\" );
+ indent_down();
+
+ if ( yymore_used )
+ {
+ indent_puts(
+"yy_flex_strncpy( &yytext[yy_more_offset], yytext_ptr, yyleng + 1 ); \\" );
+ indent_puts( "yyleng += yy_more_offset; \\" );
+ indent_puts(
+ "yy_prev_more_offset = yy_more_offset; \\" );
+ indent_puts( "yy_more_offset = 0; \\" );
+ }
+ else
+ {
+ indent_puts(
+ "yy_flex_strncpy( yytext, yytext_ptr, yyleng + 1 ); \\" );
+ }
+ }
+
+ set_indent( 0 );
+
+ skelout();
+
+
+ out_dec( "#define YY_NUM_RULES %d\n", num_rules );
+ out_dec( "#define YY_END_OF_BUFFER %d\n", num_rules + 1 );
+
+ if ( fullspd )
+ {
+ /* Need to define the transet type as a size large
+ * enough to hold the biggest offset.
+ */
+ int total_table_size = tblend + numecs + 1;
+ char *trans_offset_type =
+ (total_table_size >= MAX_SHORT || long_align) ?
+ "long" : "short";
+
+ set_indent( 0 );
+ indent_puts( "struct yy_trans_info" );
+ indent_up();
+ indent_puts( "{" ); /* } for vi */
+
+ if ( long_align )
+ indent_puts( "long yy_verify;" );
+ else
+ indent_puts( "short yy_verify;" );
+
+ /* In cases where its sister yy_verify *is* a "yes, there is
+ * a transition", yy_nxt is the offset (in records) to the
+ * next state. In most cases where there is no transition,
+ * the value of yy_nxt is irrelevant. If yy_nxt is the -1th
+ * record of a state, though, then yy_nxt is the action number
+ * for that state.
+ */
+
+ indent_put2s( "%s yy_nxt;", trans_offset_type );
+ indent_puts( "};" );
+ indent_down();
+ }
+
+ if ( fullspd )
+ genctbl();
+ else if ( fulltbl )
+ genftbl();
+ else
+ gentabs();
+
+ /* Definitions for backing up. We don't need them if REJECT
+ * is being used because then we use an alternative backin-up
+ * technique instead.
+ */
+ if ( num_backing_up > 0 && ! reject )
+ {
+ if ( ! C_plus_plus )
+ {
+ indent_puts(
+ "static yy_state_type yy_last_accepting_state;" );
+ indent_puts(
+ "static YY_CHAR *yy_last_accepting_cpos;\n" );
+ }
+ }
+
+ if ( nultrans )
+ {
+ out_str_dec( C_state_decl, "yy_NUL_trans", lastdfa + 1 );
+
+ for ( i = 1; i <= lastdfa; ++i )
+ {
+ if ( fullspd )
+ out_dec( " &yy_transition[%d],\n", base[i] );
+ else
+ mkdata( nultrans[i] );
+ }
+
+ dataend();
+ }
+
+ if ( ddebug )
+ { /* Spit out table mapping rules to line numbers. */
+ if ( ! C_plus_plus )
+ {
+ indent_puts( "extern int yy_flex_debug;" );
+ indent_puts( "int yy_flex_debug = 1;\n" );
+ }
+
+ out_str_dec( long_align ? C_long_decl : C_short_decl,
+ "yy_rule_linenum", num_rules );
+ for ( i = 1; i < num_rules; ++i )
+ mkdata( rule_linenum[i] );
+ dataend();
+ }
+
+ if ( reject )
+ {
+ /* Declare state buffer variables. */
+ if ( ! C_plus_plus )
+ {
+ outn(
+ "static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr;" );
+ outn( "static YY_CHAR *yy_full_match;" );
+ outn( "static int yy_lp;" );
+ }
+
+ if ( variable_trailing_context_rules )
+ {
+ if ( ! C_plus_plus )
+ {
+ outn(
+ "static int yy_looking_for_trail_begin = 0;" );
+ outn( "static int yy_full_lp;" );
+ outn( "static int *yy_full_state;" );
+ }
+
+ out_hex( "#define YY_TRAILING_MASK 0x%x\n",
+ (unsigned int) YY_TRAILING_MASK );
+ out_hex( "#define YY_TRAILING_HEAD_MASK 0x%x\n",
+ (unsigned int) YY_TRAILING_HEAD_MASK );
+ }
+
+ outn( "#define REJECT \\" );
+ outn( "{ \\" ); /* } for vi */
+ outn(
+ "*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \\" );
+ outn(
+ "yy_cp = yy_full_match; /* restore poss. backed-over text */ \\" );
+
+ if ( variable_trailing_context_rules )
+ {
+ outn(
+ "yy_lp = yy_full_lp; /* restore orig. accepting pos. */ \\" );
+ outn(
+ "yy_state_ptr = yy_full_state; /* restore orig. state */ \\" );
+ outn(
+ "yy_current_state = *yy_state_ptr; /* restore curr. state */ \\" );
+ }
+
+ outn( "++yy_lp; \\" );
+ outn( "goto find_rule; \\" );
+ /* { for vi */
+ outn( "}" );
+ }
+
+ else
+ {
+ outn(
+ "/* The intent behind this definition is that it'll catch" );
+ outn( " * any uses of REJECT which flex missed." );
+ outn( " */" );
+ outn( "#define REJECT reject_used_but_not_detected" );
+ }
+
+ if ( yymore_used )
+ {
+ if ( ! C_plus_plus )
+ {
+ if ( yytext_is_array )
+ {
+ indent_puts( "static int yy_more_offset = 0;" );
+ indent_puts(
+ "static int yy_prev_more_offset = 0;" );
+ }
+ else
+ {
+ indent_puts( "static int yy_more_flag = 0;" );
+ indent_puts( "static int yy_more_len = 0;" );
+ }
+ }
+
+ if ( yytext_is_array )
+ {
+ indent_puts(
+ "#define yymore() (yy_more_offset = yy_flex_strlen( yytext ))" );
+ indent_puts( "#define YY_NEED_STRLEN" );
+ indent_puts( "#define YY_MORE_ADJ 0" );
+ indent_puts( "#define YY_RESTORE_YY_MORE_OFFSET \\" );
+ indent_up();
+ indent_puts( "{ \\" );
+ indent_puts( "yy_more_offset = yy_prev_more_offset; \\" );
+ indent_puts( "yyleng -= yy_more_offset; \\" );
+ indent_puts( "}" );
+ indent_down();
+ }
+ else
+ {
+ indent_puts( "#define yymore() (yy_more_flag = 1)" );
+ indent_puts( "#define YY_MORE_ADJ yy_more_len" );
+ indent_puts( "#define YY_RESTORE_YY_MORE_OFFSET" );
+ }
+ }
+
+ else
+ {
+ indent_puts( "#define yymore() yymore_used_but_not_detected" );
+ indent_puts( "#define YY_MORE_ADJ 0" );
+ indent_puts( "#define YY_RESTORE_YY_MORE_OFFSET" );
+ }
+
+ if ( ! C_plus_plus )
+ {
+ if ( yytext_is_array )
+ {
+ outn( "#ifndef YYLMAX" );
+ outn( "#define YYLMAX 8192" );
+ outn( "#endif\n" );
+ outn( "YY_CHAR yytext[YYLMAX];" );
+ outn( "YY_CHAR *yytext_ptr;" );
+ }
+
+ else
+ outn( "YY_CHAR *yytext;" );
+ }
+
+ out( &action_array[defs1_offset] );
+
+ line_directive_out( stdout, 0 );
+
+ skelout();
+
+ if ( ! C_plus_plus )
+ {
+ if ( use_read )
+ {
+ outn(
+"\tif ( (result = read( fileno(yyin), (char *) buf, max_size * sizeof( YY_CHAR ) ) ) < 0 ) \\" );
+ outn(
+ "\t\tYY_FATAL_ERROR( \"input in flex scanner failed\" );" );
+ }
+
+ else
+ {
+ outn(
+ "\tif ( yy_current_buffer->yy_is_interactive ) \\" );
+ outn( "\t\t{ \\" );
+ outn( "\t\tint c = '*', n; \\" );
+ outn( "\t\tfor ( n = 0; n < max_size && \\" );
+
+ if ( csize == 65536 )
+ outn(
+ "\t\t\t (c = getwc( yyin )) != WEOF && c != '\\n'; ++n ) \\" );
+ else
+ outn(
+ "\t\t\t (c = getc( yyin )) != EOF && c != '\\n'; ++n ) \\" );
+
+ outn( "\t\t\tbuf[n] = (YY_CHAR) c; \\" );
+ outn( "\t\tif ( c == '\\n' ) \\" );
+ outn( "\t\t\tbuf[n++] = (YY_CHAR) c; \\" );
+
+ if ( csize == 65536 )
+ outn(
+ "\t\tif ( c == WEOF && ferror( yyin ) ) \\" );
+ else
+ outn(
+ "\t\tif ( c == EOF && ferror( yyin ) ) \\" );
+
+ outn(
+ "\t\t\tYY_FATAL_ERROR( \"input in flex scanner failed\" ); \\" );
+ outn( "\t\tresult = n; \\" );
+ outn( "\t\t} \\" );
+ outn(
+"\telse if ( ((result = fread( buf, sizeof( YY_CHAR ), max_size, yyin )) \\" );
+ outn( "\t\t == 0) && ferror( yyin ) ) \\" );
+ outn(
+ "\t\tYY_FATAL_ERROR( \"input in flex scanner failed\" );" );
+ }
+ }
+
+ skelout();
+
+ indent_puts( "#define YY_RULE_SETUP \\" );
+ indent_up();
+ if ( bol_needed )
+ {
+ indent_puts( "if ( yyleng > 0 ) \\" );
+ indent_up();
+ indent_puts( "yy_current_buffer->yy_at_bol = \\" );
+ indent_puts( "\t\t(yytext[yyleng - 1] == '\\n'); \\" );
+ indent_down();
+ }
+ indent_puts( "YY_USER_ACTION" );
+ indent_down();
+
+ skelout();
+
+ /* Copy prolog to output file. */
+ out( &action_array[prolog_offset] );
+
+ line_directive_out( stdout, 0 );
+
+ skelout();
+
+ set_indent( 2 );
+
+ if ( yymore_used && ! yytext_is_array )
+ {
+ indent_puts( "yy_more_len = 0;" );
+ indent_puts( "if ( yy_more_flag )" );
+ indent_up();
+ indent_puts( "{" );
+ indent_puts( "yy_more_len = yy_c_buf_p - yytext_ptr;" );
+ indent_puts( "yy_more_flag = 0;" );
+ indent_puts( "}" );
+ indent_down();
+ }
+
+ skelout();
+
+ gen_start_state();
+
+ /* Note, don't use any indentation. */
+ outn( "yy_match:" );
+ gen_next_match();
+
+ skelout();
+ set_indent( 2 );
+ gen_find_action();
+
+ skelout();
+ if ( do_yylineno )
+ {
+ indent_puts( "if ( yy_act != YY_END_OF_BUFFER )" );
+ indent_up();
+ indent_puts( "{" );
+ indent_puts( "int yyl;" );
+ indent_puts( "for ( yyl = 0; yyl < yyleng; ++yyl )" );
+ indent_up();
+ indent_puts( "if ( yytext[yyl] == '\\n' )" );
+ indent_up();
+ indent_puts( "++yylineno;" );
+ indent_down();
+ indent_down();
+ indent_puts( "}" );
+ indent_down();
+ }
+
+ skelout();
+ if ( ddebug )
+ {
+ indent_puts( "if ( yy_flex_debug )" );
+ indent_up();
+
+ indent_puts( "{" );
+ indent_puts( "if ( yy_act == 0 )" );
+ indent_up();
+ indent_puts( C_plus_plus ?
+ "cerr << \"--scanner backing up\\n\";" :
+ "fprintf( stderr, \"--scanner backing up\\n\" );" );
+ indent_down();
+
+ do_indent();
+ out_dec( "else if ( yy_act < %d )\n", num_rules );
+ indent_up();
+
+ if ( C_plus_plus )
+ {
+ indent_puts(
+ "cerr << \"--accepting rule at line \" << yy_rule_linenum[yy_act] <<" );
+ indent_puts(
+ " \"(\\\"\" << yytext << \"\\\")\\n\";" );
+ }
+ else
+ {
+ indent_puts(
+ "fprintf( stderr, \"--accepting rule at line %d (\\\"%s\\\")\\n\"," );
+
+ indent_puts(
+ " yy_rule_linenum[yy_act], yytext );" );
+ }
+
+ indent_down();
+
+ do_indent();
+ out_dec( "else if ( yy_act == %d )\n", num_rules );
+ indent_up();
+
+ if ( C_plus_plus )
+ {
+ indent_puts(
+"cerr << \"--accepting default rule (\\\"\" << yytext << \"\\\")\\n\";" );
+ }
+ else
+ {
+ indent_puts(
+ "fprintf( stderr, \"--accepting default rule (\\\"%s\\\")\\n\"," );
+ indent_puts( " yytext );" );
+ }
+
+ indent_down();
+
+ do_indent();
+ out_dec( "else if ( yy_act == %d )\n", num_rules + 1 );
+ indent_up();
+
+ indent_puts( C_plus_plus ?
+ "cerr << \"--(end of buffer or a NUL)\\n\";" :
+ "fprintf( stderr, \"--(end of buffer or a NUL)\\n\" );" );
+
+ indent_down();
+
+ do_indent();
+ outn( "else" );
+ indent_up();
+
+ if ( C_plus_plus )
+ {
+ indent_puts(
+ "cerr << \"--EOF (start condition \" << YY_START << \")\\n\";" );
+ }
+ else
+ {
+ indent_puts(
+ "fprintf( stderr, \"--EOF (start condition %d)\\n\", YY_START );" );
+ }
+
+ indent_down();
+
+ indent_puts( "}" );
+ indent_down();
+ }
+
+ /* Copy actions to output file. */
+ skelout();
+ indent_up();
+ gen_bu_action();
+ out( &action_array[action_offset] );
+
+ line_directive_out( stdout, 0 );
+
+ /* generate cases for any missing EOF rules */
+ for ( i = 1; i <= lastsc; ++i )
+ if ( ! sceof[i] )
+ {
+ do_indent();
+ out_str( "case YY_STATE_EOF(%s):\n", scname[i] );
+ did_eof_rule = true;
+ }
+
+ if ( did_eof_rule )
+ {
+ indent_up();
+ indent_puts( "yyterminate();" );
+ indent_down();
+ }
+
+
+ /* Generate code for handling NUL's, if needed. */
+
+ /* First, deal with backing up and setting up yy_cp if the scanner
+ * finds that it should JAM on the NUL.
+ */
+ skelout();
+ set_indent( 4 );
+
+ if ( fullspd || fulltbl )
+ indent_puts( "yy_cp = yy_c_buf_p;" );
+
+ else
+ { /* compressed table */
+ if ( ! reject && ! interactive )
+ {
+ /* Do the guaranteed-needed backing up to figure
+ * out the match.
+ */
+ indent_puts( "yy_cp = yy_last_accepting_cpos;" );
+ indent_puts(
+ "yy_current_state = yy_last_accepting_state;" );
+ }
+
+ else
+ /* Still need to initialize yy_cp, though
+ * yy_current_state was set up by
+ * yy_get_previous_state().
+ */
+ indent_puts( "yy_cp = yy_c_buf_p;" );
+ }
+
+
+ /* Generate code for yy_get_previous_state(). */
+ set_indent( 1 );
+ skelout();
+
+ gen_start_state();
+
+ set_indent( 2 );
+ skelout();
+ gen_next_state( true );
+
+ set_indent( 1 );
+ skelout();
+ gen_NUL_trans();
+
+ skelout();
+ if ( do_yylineno )
+ { /* update yylineno inside of unput() */
+ indent_puts( "if ( c == '\\n' )" );
+ indent_up();
+ indent_puts( "--yylineno;" );
+ indent_down();
+ }
+
+ skelout();
+ /* Update BOL and yylineno inside of input(). */
+ if ( bol_needed )
+ {
+ indent_puts( "yy_current_buffer->yy_at_bol = (c == '\\n');" );
+ if ( do_yylineno )
+ {
+ indent_puts( "if ( yy_current_buffer->yy_at_bol )" );
+ indent_up();
+ indent_puts( "++yylineno;" );
+ indent_down();
+ }
+ }
+
+ else if ( do_yylineno )
+ {
+ indent_puts( "if ( c == '\\n' )" );
+ indent_up();
+ indent_puts( "++yylineno;" );
+ indent_down();
+ }
+
+ skelout();
+
+ /* Copy remainder of input to output. */
+
+ line_directive_out( stdout, 1 );
+
+ if ( sectnum == 3 )
+ (void) flexscan(); /* copy remainder of input to output */
+ }
diff --git a/to.do/unicode/main.c b/to.do/unicode/main.c
new file mode 100644
index 0000000..eee3c3e
--- /dev/null
+++ b/to.do/unicode/main.c
@@ -0,0 +1,1228 @@
+/* flex - tool to generate fast lexical analyzers */
+
+/*-
+ * 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 are permitted provided
+ * that: (1) source distributions retain this entire copyright notice and
+ * comment, and (2) distributions including binaries display the following
+ * acknowledgement: ``This product includes software developed by the
+ * University of California, Berkeley and its contributors'' in the
+ * documentation or other materials provided with the distribution and in
+ * all advertising materials mentioning features or use of this software.
+ * 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.
+ */
+
+#ifndef lint
+char copyright[] =
+"@(#) Copyright (c) 1990 The Regents of the University of California.\n\
+ All rights reserved.\n";
+#endif /* not lint */
+
+/* $Header$ */
+
+
+#include "flexdef.h"
+#include "version.h"
+
+static char flex_version[] = FLEX_VERSION;
+
+
+/* declare functions that have forward references */
+
+void flexinit PROTO((int, char**));
+void readin PROTO((void));
+void set_up_initial_allocations PROTO((void));
+
+#ifdef NEED_ARGV_FIXUP
+extern void argv_fixup PROTO((int *, char ***));
+#endif
+
+
+/* these globals are all defined and commented in flexdef.h */
+int printstats, syntaxerror, eofseen, ddebug, trace, nowarn, spprdflt;
+int interactive, caseins, lex_compat, do_yylineno, useecs, fulltbl, usemecs;
+int fullspd, gen_line_dirs, performance_report, backing_up_report;
+int C_plus_plus, long_align, use_read, yytext_is_array, do_yywrap, csize;
+int yymore_used, reject, real_reject, continued_action, in_rule;
+int yymore_really_used, reject_really_used;
+int datapos, dataline, linenum, out_linenum;
+FILE *skelfile = NULL;
+int skel_ind = 0;
+char *action_array;
+int action_size, defs1_offset, prolog_offset, action_offset, action_index;
+char *infilename = NULL, *outfilename = NULL;
+int did_outfilename;
+char *prefix, *yyclass;
+int do_stdinit, use_stdout;
+int onestate[ONE_STACK_SIZE], onesym[ONE_STACK_SIZE];
+int onenext[ONE_STACK_SIZE], onedef[ONE_STACK_SIZE], onesp;
+int current_mns, current_max_rules;
+int num_rules, num_eof_rules, default_rule, lastnfa;
+int *firstst, *lastst, *finalst, *transchar, *trans1, *trans2;
+int *accptnum, *assoc_rule, *state_type;
+int *rule_type, *rule_linenum, *rule_useful;
+int current_state_type;
+int variable_trailing_context_rules;
+int numtemps, numprots, protprev[MSP], protnext[MSP], prottbl[MSP];
+int protcomst[MSP], firstprot, lastprot, protsave[PROT_SAVE_SIZE];
+int numecs, nextecm[CSIZE + 1], ecgroup[CSIZE + 1], nummecs, tecfwd[CSIZE + 1];
+int tecbck[CSIZE + 1];
+int lastsc, *scset, *scbol, *scxclu, *sceof;
+int current_max_scs;
+char **scname;
+int current_max_dfa_size, current_max_xpairs;
+int current_max_template_xpairs, current_max_dfas;
+int lastdfa, *nxt, *chk, *tnxt;
+int *base, *def, *nultrans, NUL_ec, tblend, firstfree, **dss, *dfasiz;
+union dfaacc_union *dfaacc;
+int *accsiz, *dhash, numas;
+int numsnpairs, jambase, jamstate;
+int lastccl, *cclmap, *ccllen, *cclng, cclreuse;
+int current_maxccls, current_max_ccl_tbl_size;
+wchar_t *ccltbl;
+char nmstr[MAXLINE];
+int sectnum, nummt, hshcol, dfaeql, numeps, eps2, num_reallocs;
+int tmpuses, totnst, peakpairs, numuniq, numdup, hshsave;
+int num_backing_up, bol_needed;
+FILE *backing_up_file;
+int end_of_buffer_state;
+char **input_files;
+int num_input_files;
+
+/* Make sure program_name is initialized so we don't crash if writing
+ * out an error message before getting the program name from argv[0].
+ */
+char *program_name = "flex";
+
+#ifndef SHORT_FILE_NAMES
+static char *outfile_template = "lex.%s.%s";
+static char *backing_name = "lex.backup";
+#else
+static char *outfile_template = "lex%s.%s";
+static char *backing_name = "lex.bck";
+#endif
+
+#ifdef THINK_C
+#include <console.h>
+#endif
+
+#ifdef MS_DOS
+extern unsigned _stklen = 16384;
+#endif
+
+static char outfile_path[MAXLINE];
+static int outfile_created = 0;
+static char *skelname = NULL;
+
+
+int main( argc, argv )
+int argc;
+char **argv;
+ {
+ int i;
+
+#ifdef THINK_C
+ argc = ccommand( &argv );
+#endif
+#ifdef NEED_ARGV_FIXUP
+ argv_fixup( &argc, &argv );
+#endif
+
+ flexinit( argc, argv );
+
+ readin();
+
+ ntod();
+
+ for ( i = 1; i <= num_rules; ++i )
+ if ( ! rule_useful[i] && i != default_rule )
+ line_warning( _( "rule cannot be matched" ),
+ rule_linenum[i] );
+
+ if ( spprdflt && ! reject && rule_useful[default_rule] )
+ line_warning(
+ _( "-s option given but default rule can be matched" ),
+ rule_linenum[default_rule] );
+
+ /* Generate the C state transition tables from the DFA. */
+ make_tables();
+
+ /* Note, flexend does not return. It exits with its argument
+ * as status.
+ */
+ flexend( 0 );
+
+ return 0; /* keep compilers/lint happy */
+ }
+
+
+/* check_options - check user-specified options */
+
+void check_options()
+ {
+ int i;
+
+ if ( lex_compat )
+ {
+ if ( C_plus_plus )
+ flexerror( _( "Can't use -+ with -l option" ) );
+
+ if ( fulltbl || fullspd )
+ flexerror( _( "Can't use -f or -F with -l option" ) );
+
+ /* Don't rely on detecting use of yymore() and REJECT,
+ * just assume they'll be used.
+ */
+ yymore_really_used = reject_really_used = true;
+
+ yytext_is_array = true;
+ do_yylineno = true;
+ use_read = false;
+ }
+
+ if ( do_yylineno )
+ /* This should really be "maintain_backup_tables = true" */
+ reject_really_used = true;
+
+ if ( csize == unspecified )
+ {
+ if ( (fulltbl || fullspd) && ! useecs )
+ csize = DEFAULT_CSIZE;
+ else
+ csize = 256;
+ }
+
+ if ( interactive == unspecified )
+ {
+ if ( fulltbl || fullspd )
+ interactive = false;
+ else
+ interactive = true;
+ }
+
+ if ( fulltbl || fullspd )
+ {
+ if ( usemecs )
+ flexerror(
+ _( "-Cf/-CF and -Cm don't make sense together" ) );
+
+ if ( interactive )
+ flexerror( _( "-Cf/-CF and -I are incompatible" ) );
+
+ if ( lex_compat )
+ flexerror(
+ _( "-Cf/-CF are incompatible with lex-compatibility mode" ) );
+
+ if ( do_yylineno )
+ flexerror(
+ _( "-Cf/-CF and %option yylineno are incompatible" ) );
+
+ if ( fulltbl && fullspd )
+ flexerror( _( "-Cf and -CF are mutually exclusive" ) );
+ }
+
+ if ( C_plus_plus && fullspd )
+ flexerror( _( "Can't use -+ with -CF option" ) );
+
+ if ( C_plus_plus && yytext_is_array )
+ {
+ warn( _( "%array incompatible with -+ option" ) );
+ yytext_is_array = false;
+ }
+
+ if ( csize == 65536 )
+ {
+ if ( fulltbl )
+ {
+ if ( use_read )
+ flexerror( _( "Can't use -f with -U" ) );
+ else
+ flexerror( _( "Can't use -Cf with -U" ) );
+ }
+ else if ( fullspd )
+ {
+ if ( use_read )
+ flexerror( _( "Can't use -F with -U" ) );
+ else
+ flexerror( _( "Can't use -CF with -U" ) );
+ }
+ else if ( ! useecs && ! usemecs )
+ flexerror( _( "Can't use -C with -U" ) );
+ }
+
+ if ( useecs )
+ { /* Set up doubly-linked equivalence classes. */
+
+ /* We loop all the way up to csize, since ecgroup[csize] is
+ * the position used for NUL characters.
+ */
+ ecgroup[1] = NIL;
+
+ for ( i = 2; i <= csize; ++i )
+ {
+ ecgroup[i] = i - 1;
+ nextecm[i - 1] = i;
+ }
+
+ nextecm[csize] = NIL;
+ }
+
+ else
+ {
+ /* Put everything in its own equivalence class. */
+ for ( i = 1; i <= csize; ++i )
+ {
+ ecgroup[i] = i;
+ nextecm[i] = BAD_SUBSCRIPT; /* to catch errors */
+ }
+ }
+
+ if ( ! use_stdout )
+ {
+ FILE *prev_stdout;
+
+ if ( ! did_outfilename )
+ {
+ char *suffix;
+
+ if ( C_plus_plus )
+ suffix = "cc";
+ else
+ suffix = "c";
+
+ sprintf( outfile_path, outfile_template,
+ prefix, suffix );
+
+ outfilename = outfile_path;
+ }
+
+ prev_stdout = freopen( outfilename, "w", stdout );
+
+ if ( prev_stdout == NULL )
+ lerrsf( _( "could not create %s" ), outfilename );
+
+ outfile_created = 1;
+ }
+
+ if ( skelname && (skelfile = fopen( skelname, "r" )) == NULL )
+ lerrsf( _( "can't open skeleton file %s" ), skelname );
+
+ if ( strcmp( prefix, "yy" ) )
+ {
+#define GEN_PREFIX(name) out_str3( "#define yy%s %s%s\n", name, prefix, name )
+ if ( C_plus_plus )
+ GEN_PREFIX( "FlexLexer" );
+ else
+ {
+ GEN_PREFIX( "_create_buffer" );
+ GEN_PREFIX( "_delete_buffer" );
+ GEN_PREFIX( "_scan_buffer" );
+ GEN_PREFIX( "_scan_string" );
+ GEN_PREFIX( "_scan_bytes" );
+ GEN_PREFIX( "_flex_debug" );
+ GEN_PREFIX( "_init_buffer" );
+ GEN_PREFIX( "_flush_buffer" );
+ GEN_PREFIX( "_load_buffer_state" );
+ GEN_PREFIX( "_switch_to_buffer" );
+ GEN_PREFIX( "in" );
+ GEN_PREFIX( "leng" );
+ GEN_PREFIX( "lex" );
+ GEN_PREFIX( "out" );
+ GEN_PREFIX( "restart" );
+ GEN_PREFIX( "text" );
+
+ if ( do_yylineno )
+ GEN_PREFIX( "lineno" );
+ }
+
+ if ( do_yywrap )
+ GEN_PREFIX( "wrap" );
+
+ outn( "" );
+ }
+
+ if ( did_outfilename )
+ line_directive_out( stdout, 0 );
+
+ skelout();
+
+ outn( "/* Define the YY_CHAR type. */" );
+
+ switch (csize) {
+ case 65536:
+ outn( "typedef wchar_t YY_CHAR;" );
+ break;
+ case 256:
+ outn( "typedef unsigned char YY_CHAR;" );
+ break;
+ default:
+ outn( "typedef char YY_CHAR;" );
+ break;
+ }
+
+ outn( "\n/* Promotes a YY_CHAR to an unsigned integer for use as an array index. */");
+
+ switch (csize) {
+ case 65536:
+ case 256:
+ outn( "#define YY_SC_TO_UI(c) ((unsigned int) c)" );
+ break;
+ default:
+ outn(
+ "#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)" );
+ break;
+ }
+
+ skelout();
+ }
+
+
+/* flexend - terminate flex
+ *
+ * note
+ * This routine does not return.
+ */
+
+void flexend( exit_status )
+int exit_status;
+
+ {
+ int tblsiz;
+ int unlink();
+
+ if ( skelfile != NULL )
+ {
+ if ( ferror( skelfile ) )
+ lerrsf( _( "input error reading skeleton file %s" ),
+ skelname );
+
+ else if ( fclose( skelfile ) )
+ lerrsf( _( "error closing skeleton file %s" ),
+ skelname );
+ }
+
+ if ( exit_status != 0 && outfile_created )
+ {
+ if ( ferror( stdout ) )
+ lerrsf( _( "error writing output file %s" ),
+ outfilename );
+
+ else if ( fclose( stdout ) )
+ lerrsf( _( "error closing output file %s" ),
+ outfilename );
+
+ else if ( unlink( outfilename ) )
+ lerrsf( _( "error deleting output file %s" ),
+ outfilename );
+ }
+
+ if ( backing_up_report && backing_up_file )
+ {
+ if ( num_backing_up == 0 )
+ fprintf( backing_up_file, _( "No backing up.\n" ) );
+ else if ( fullspd || fulltbl )
+ fprintf( backing_up_file,
+ _( "%d backing up (non-accepting) states.\n" ),
+ num_backing_up );
+ else
+ fprintf( backing_up_file,
+ _( "Compressed tables always back up.\n" ) );
+
+ if ( ferror( backing_up_file ) )
+ lerrsf( _( "error writing backup file %s" ),
+ backing_name );
+
+ else if ( fclose( backing_up_file ) )
+ lerrsf( _( "error closing backup file %s" ),
+ backing_name );
+ }
+
+ if ( printstats )
+ {
+ fprintf( stderr, _( "%s version %s usage statistics:\n" ),
+ program_name, flex_version );
+
+ fprintf( stderr, _( " scanner options: -" ) );
+
+ if ( C_plus_plus )
+ putc( '+', stderr );
+ if ( backing_up_report )
+ putc( 'b', stderr );
+ if ( ddebug )
+ putc( 'd', stderr );
+ if ( caseins )
+ putc( 'i', stderr );
+ if ( lex_compat )
+ putc( 'l', stderr );
+ if ( performance_report > 0 )
+ putc( 'p', stderr );
+ if ( performance_report > 1 )
+ putc( 'p', stderr );
+ if ( spprdflt )
+ putc( 's', stderr );
+ if ( use_stdout )
+ putc( 't', stderr );
+ if ( printstats )
+ putc( 'v', stderr ); /* always true! */
+ if ( nowarn )
+ putc( 'w', stderr );
+ if ( interactive == false )
+ putc( 'B', stderr );
+ if ( interactive == true )
+ putc( 'I', stderr );
+ if ( ! gen_line_dirs )
+ putc( 'L', stderr );
+ if ( trace )
+ putc( 'T', stderr );
+
+ if ( csize == unspecified )
+ /* We encountered an error fairly early on, so csize
+ * never got specified. Define it now, to prevent
+ * bogus table sizes being written out below.
+ */
+ csize = 256;
+
+ if ( csize == 128 )
+ putc( '7', stderr );
+ else if ( csize == 256 )
+ putc( '8', stderr );
+ else
+ putc( 'U', stderr );
+
+ fprintf( stderr, " -C" );
+
+ if ( long_align )
+ putc( 'a', stderr );
+ if ( fulltbl )
+ putc( 'f', stderr );
+ if ( fullspd )
+ putc( 'F', stderr );
+ if ( useecs )
+ putc( 'e', stderr );
+ if ( usemecs )
+ putc( 'm', stderr );
+ if ( use_read )
+ putc( 'r', stderr );
+
+ if ( did_outfilename )
+ fprintf( stderr, " -o%s", outfilename );
+
+ if ( skelname )
+ fprintf( stderr, " -S%s", skelname );
+
+ if ( strcmp( prefix, "yy" ) )
+ fprintf( stderr, " -P%s", prefix );
+
+ putc( '\n', stderr );
+
+ fprintf( stderr, _( " %d/%d NFA states\n" ),
+ lastnfa, current_mns );
+ fprintf( stderr, _( " %d/%d DFA states (%d words)\n" ),
+ lastdfa, current_max_dfas, totnst );
+ fprintf( stderr, _( " %d rules\n" ),
+ num_rules + num_eof_rules - 1 /* - 1 for def. rule */ );
+
+ if ( num_backing_up == 0 )
+ fprintf( stderr, _( " No backing up\n" ) );
+ else if ( fullspd || fulltbl )
+ fprintf( stderr,
+ _( " %d backing-up (non-accepting) states\n" ),
+ num_backing_up );
+ else
+ fprintf( stderr,
+ _( " Compressed tables always back-up\n" ) );
+
+ if ( bol_needed )
+ fprintf( stderr,
+ _( " Beginning-of-line patterns used\n" ) );
+
+ fprintf( stderr, _( " %d/%d start conditions\n" ), lastsc,
+ current_max_scs );
+ fprintf( stderr,
+ _( " %d epsilon states, %d double epsilon states\n" ),
+ numeps, eps2 );
+
+ if ( lastccl == 0 )
+ fprintf( stderr, _( " no character classes\n" ) );
+ else
+ fprintf( stderr,
+_( " %d/%d character classes needed %d/%d words of storage, %d reused\n" ),
+ lastccl, current_maxccls,
+ cclmap[lastccl] + ccllen[lastccl],
+ current_max_ccl_tbl_size, cclreuse );
+
+ fprintf( stderr, _( " %d state/nextstate pairs created\n" ),
+ numsnpairs );
+ fprintf( stderr, _( " %d/%d unique/duplicate transitions\n" ),
+ numuniq, numdup );
+
+ if ( fulltbl )
+ {
+ tblsiz = lastdfa * numecs;
+ fprintf( stderr, _( " %d table entries\n" ), tblsiz );
+ }
+
+ else
+ {
+ tblsiz = 2 * (lastdfa + numtemps) + 2 * tblend;
+
+ fprintf( stderr,
+ _( " %d/%d base-def entries created\n" ),
+ lastdfa + numtemps, current_max_dfas );
+ fprintf( stderr,
+ _( " %d/%d (peak %d) nxt-chk entries created\n" ),
+ tblend, current_max_xpairs, peakpairs );
+ fprintf( stderr,
+ _( " %d/%d (peak %d) template nxt-chk entries created\n" ),
+ numtemps * nummecs,
+ current_max_template_xpairs,
+ numtemps * numecs );
+ fprintf( stderr, _( " %d empty table entries\n" ),
+ nummt );
+ fprintf( stderr, _( " %d protos created\n" ),
+ numprots );
+ fprintf( stderr,
+ _( " %d templates created, %d uses\n" ),
+ numtemps, tmpuses );
+ }
+
+ if ( useecs )
+ {
+ tblsiz = tblsiz + csize;
+ fprintf( stderr,
+ _( " %d/%d equivalence classes created\n" ),
+ numecs, csize );
+ }
+
+ if ( usemecs )
+ {
+ tblsiz = tblsiz + numecs;
+ fprintf( stderr,
+ _( " %d/%d meta-equivalence classes created\n" ),
+ nummecs, csize );
+ }
+
+ fprintf( stderr,
+ _( " %d (%d saved) hash collisions, %d DFAs equal\n" ),
+ hshcol, hshsave, dfaeql );
+ fprintf( stderr, _( " %d sets of reallocations needed\n" ),
+ num_reallocs );
+ fprintf( stderr, _( " %d total table entries needed\n" ),
+ tblsiz );
+ }
+
+ exit( exit_status );
+ }
+
+
+/* flexinit - initialize flex */
+
+void flexinit( argc, argv )
+int argc;
+char **argv;
+ {
+ int i, sawcmpflag;
+ char *arg;
+
+ printstats = syntaxerror = trace = spprdflt = caseins = false;
+ lex_compat = C_plus_plus = backing_up_report = ddebug = fulltbl = false;
+ fullspd = long_align = nowarn = yymore_used = continued_action = false;
+ do_yylineno = yytext_is_array = in_rule = reject = do_stdinit = false;
+ yymore_really_used = reject_really_used = unspecified;
+ interactive = csize = unspecified;
+ do_yywrap = gen_line_dirs = usemecs = useecs = true;
+ performance_report = 0;
+ did_outfilename = 0;
+ prefix = "yy";
+ yyclass = 0;
+ use_read = use_stdout = false;
+
+ sawcmpflag = false;
+
+ /* Initialize dynamic array for holding the rule actions. */
+ action_size = 2048; /* default size of action array in bytes */
+ action_array = allocate_character_array( action_size );
+ defs1_offset = prolog_offset = action_offset = action_index = 0;
+ action_array[0] = '\0';
+
+ program_name = argv[0];
+
+ if ( program_name[0] != '\0' &&
+ program_name[strlen( program_name ) - 1] == '+' )
+ C_plus_plus = true;
+
+ /* read flags */
+ for ( --argc, ++argv; argc ; --argc, ++argv )
+ {
+ arg = argv[0];
+
+ if ( arg[0] != '-' || arg[1] == '\0' )
+ break;
+
+ if ( arg[1] == '-' )
+ { /* --option */
+ if ( ! strcmp( arg, "--help" ) )
+ arg = "-h";
+
+ else if ( ! strcmp( arg, "--version" ) )
+ arg = "-V";
+
+ else if ( ! strcmp( arg, "--" ) )
+ { /* end of options */
+ --argc;
+ ++argv;
+ break;
+ }
+ }
+
+ for ( i = 1; arg[i] != '\0'; ++i )
+ switch ( arg[i] )
+ {
+ case '+':
+ C_plus_plus = true;
+ break;
+
+ case 'B':
+ interactive = false;
+ break;
+
+ case 'b':
+ backing_up_report = true;
+ break;
+
+ case 'c':
+ break;
+
+ case 'C':
+ if ( i != 1 )
+ flexerror(
+ _( "-C flag must be given separately" ) );
+
+ if ( ! sawcmpflag )
+ {
+ useecs = false;
+ usemecs = false;
+ fulltbl = false;
+ sawcmpflag = true;
+ }
+
+ for ( ++i; arg[i] != '\0'; ++i )
+ switch ( arg[i] )
+ {
+ case 'a':
+ long_align =
+ true;
+ break;
+
+ case 'e':
+ useecs = true;
+ break;
+
+ case 'F':
+ fullspd = true;
+ break;
+
+ case 'f':
+ fulltbl = true;
+ break;
+
+ case 'm':
+ usemecs = true;
+ break;
+
+ case 'r':
+ use_read = true;
+ break;
+
+ default:
+ lerrif(
+ _( "unknown -C option '%c'" ),
+ (int) arg[i] );
+ break;
+ }
+
+ goto get_next_arg;
+
+ case 'd':
+ ddebug = true;
+ break;
+
+ case 'f':
+ useecs = usemecs = false;
+ use_read = fulltbl = true;
+ break;
+
+ case 'F':
+ useecs = usemecs = false;
+ use_read = fullspd = true;
+ break;
+
+ case '?':
+ case 'h':
+ usage();
+ exit( 0 );
+
+ case 'I':
+ interactive = true;
+ break;
+
+ case 'i':
+ caseins = true;
+ break;
+
+ case 'l':
+ lex_compat = true;
+ break;
+
+ case 'L':
+ gen_line_dirs = false;
+ break;
+
+ case 'n':
+ /* Stupid do-nothing deprecated
+ * option.
+ */
+ break;
+
+ case 'o':
+ if ( i != 1 )
+ flexerror(
+ _( "-o flag must be given separately" ) );
+
+ outfilename = arg + i + 1;
+ did_outfilename = 1;
+ goto get_next_arg;
+
+ case 'P':
+ if ( i != 1 )
+ flexerror(
+ _( "-P flag must be given separately" ) );
+
+ prefix = arg + i + 1;
+ goto get_next_arg;
+
+ case 'p':
+ ++performance_report;
+ break;
+
+ case 'S':
+ if ( i != 1 )
+ flexerror(
+ _( "-S flag must be given separately" ) );
+
+ skelname = arg + i + 1;
+ goto get_next_arg;
+
+ case 's':
+ spprdflt = true;
+ break;
+
+ case 't':
+ use_stdout = true;
+ break;
+
+ case 'T':
+ trace = true;
+ break;
+
+ case 'U':
+ csize = 65536;
+ break;
+
+ case 'v':
+ printstats = true;
+ break;
+
+ case 'V':
+ printf( _( "%s version %s\n" ),
+ program_name, flex_version );
+ exit( 0 );
+
+ case 'w':
+ nowarn = true;
+ break;
+
+ case '7':
+ csize = 128;
+ break;
+
+ case '8':
+ csize = 256;
+ break;
+
+ default:
+ fprintf( stderr,
+ _( "%s: unknown flag '%c'. For usage, try\n\t%s --help\n" ),
+ program_name, (int) arg[i],
+ program_name );
+ exit( 1 );
+ }
+
+ /* Used by -C, -S, -o, and -P flags in lieu of a "continue 2"
+ * control.
+ */
+ get_next_arg: ;
+ }
+
+ num_input_files = argc;
+ input_files = argv;
+ set_input_file( num_input_files > 0 ? input_files[0] : NULL );
+
+ lastccl = lastsc = lastdfa = lastnfa = 0;
+ num_rules = num_eof_rules = default_rule = 0;
+ numas = numsnpairs = tmpuses = 0;
+ numecs = numeps = eps2 = num_reallocs = hshcol = dfaeql = totnst = 0;
+ numuniq = numdup = hshsave = eofseen = datapos = dataline = 0;
+ num_backing_up = onesp = numprots = 0;
+ variable_trailing_context_rules = bol_needed = false;
+
+ out_linenum = linenum = sectnum = 1;
+ firstprot = NIL;
+
+ /* Used in mkprot() so that the first proto goes in slot 1
+ * of the proto queue.
+ */
+ lastprot = 1;
+
+ set_up_initial_allocations();
+ }
+
+
+/* readin - read in the rules section of the input file(s) */
+
+void readin()
+ {
+ static char yy_stdinit[] = "FILE *yyin = stdin, *yyout = stdout;";
+ static char yy_nostdinit[] =
+ "FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;";
+
+ line_directive_out( (FILE *) 0, 1 );
+
+ if ( yyparse() )
+ {
+ pinpoint_message( _( "fatal parse error" ) );
+ flexend( 1 );
+ }
+
+ if ( syntaxerror )
+ flexend( 1 );
+
+ if ( backing_up_report )
+ {
+ backing_up_file = fopen( backing_name, "w" );
+ if ( backing_up_file == NULL )
+ lerrsf(
+ _( "could not create backing-up info file %s" ),
+ backing_name );
+ }
+
+ else
+ backing_up_file = NULL;
+
+ if ( yymore_really_used == true )
+ yymore_used = true;
+ else if ( yymore_really_used == false )
+ yymore_used = false;
+
+ if ( reject_really_used == true )
+ reject = true;
+ else if ( reject_really_used == false )
+ reject = false;
+
+ if ( performance_report > 0 )
+ {
+ if ( lex_compat )
+ {
+ fprintf( stderr,
+_( "-l AT&T lex compatibility option entails a large performance penalty\n" ) );
+ fprintf( stderr,
+_( " and may be the actual source of other reported performance penalties\n" ) );
+ }
+
+ else if ( do_yylineno )
+ {
+ fprintf( stderr,
+ _( "%%option yylineno entails a large performance penalty\n" ) );
+ }
+
+ if ( performance_report > 1 )
+ {
+ if ( interactive )
+ fprintf( stderr,
+ _( "-I (interactive) entails a minor performance penalty\n" ) );
+
+ if ( yymore_used )
+ fprintf( stderr,
+ _( "yymore() entails a minor performance penalty\n" ) );
+ }
+
+ if ( reject )
+ fprintf( stderr,
+ _( "REJECT entails a large performance penalty\n" ) );
+
+ if ( variable_trailing_context_rules )
+ fprintf( stderr,
+_( "Variable trailing context rules entail a large performance penalty\n" ) );
+ }
+
+ if ( reject )
+ real_reject = true;
+
+ if ( variable_trailing_context_rules )
+ reject = true;
+
+ if ( (fulltbl || fullspd) && reject )
+ {
+ if ( real_reject )
+ flexerror(
+ _( "REJECT cannot be used with -f or -F" ) );
+ else if ( do_yylineno )
+ flexerror(
+ _( "%option yylineno cannot be used with -f or -F" ) );
+ else
+ flexerror(
+ _( "variable trailing context rules cannot be used with -f or -F" ) );
+ }
+
+ if ( reject )
+ outn( "\n#define YY_USES_REJECT" );
+
+ if ( ! do_yywrap )
+ {
+ outn( "\n#define yywrap() 1" );
+ outn( "#define YY_SKIP_YYWRAP" );
+ }
+
+ if ( ddebug )
+ outn( "\n#define FLEX_DEBUG" );
+
+ if ( C_plus_plus )
+ {
+ outn( "#define yytext_ptr yytext" );
+
+ if ( interactive )
+ outn( "#define YY_INTERACTIVE" );
+ }
+
+ else
+ {
+ if ( do_stdinit )
+ {
+ outn( "#ifdef VMS" );
+ outn( "#ifndef __VMS_POSIX" );
+ outn( yy_nostdinit );
+ outn( "#else" );
+ outn( yy_stdinit );
+ outn( "#endif" );
+ outn( "#else" );
+ outn( yy_stdinit );
+ outn( "#endif" );
+ }
+
+ else
+ outn( yy_nostdinit );
+ }
+
+ if ( fullspd )
+ outn( "typedef yyconst struct yy_trans_info *yy_state_type;" );
+ else if ( ! C_plus_plus )
+ outn( "typedef int yy_state_type;" );
+
+ if ( ddebug )
+ outn( "\n#define FLEX_DEBUG" );
+
+ if ( lex_compat )
+ outn( "#define YY_FLEX_LEX_COMPAT" );
+
+ if ( do_yylineno && ! C_plus_plus )
+ {
+ outn( "extern int yylineno;" );
+ outn( "int yylineno = 1;" );
+ }
+
+ if ( C_plus_plus )
+ {
+ outn( "\n#include <FlexLexer.h>" );
+
+ if ( yyclass )
+ {
+ outn( "int yyFlexLexer::yylex()" );
+ outn( "\t{" );
+ outn(
+"\tLexerError( \"yyFlexLexer::yylex invoked but %option yyclass used\" );" );
+ outn( "\treturn 0;" );
+ outn( "\t}" );
+
+ out_str( "\n#define YY_DECL int %s::yylex()\n",
+ yyclass );
+ }
+ }
+
+ else
+ {
+ if ( yytext_is_array )
+ outn( "extern YY_CHAR yytext[];\n" );
+
+ else
+ {
+ outn( "extern YY_CHAR *yytext;" );
+ outn( "#define yytext_ptr yytext" );
+ }
+
+ if ( yyclass )
+ flexerror(
+ _( "%option yyclass only meaningful for C++ scanners" ) );
+ }
+
+ if ( useecs )
+ numecs = cre8ecs( nextecm, ecgroup, csize );
+ else
+ numecs = csize;
+
+ /* Now map the equivalence class for NUL to its expected place. */
+ ecgroup[0] = ecgroup[csize];
+ NUL_ec = ABS( ecgroup[0] );
+
+ if ( useecs )
+ ccl2ecl();
+ }
+
+
+/* set_up_initial_allocations - allocate memory for internal tables */
+
+void set_up_initial_allocations()
+ {
+ current_mns = INITIAL_MNS;
+ firstst = allocate_integer_array( current_mns );
+ lastst = allocate_integer_array( current_mns );
+ finalst = allocate_integer_array( current_mns );
+ transchar = allocate_integer_array( current_mns );
+ trans1 = allocate_integer_array( current_mns );
+ trans2 = allocate_integer_array( current_mns );
+ accptnum = allocate_integer_array( current_mns );
+ assoc_rule = allocate_integer_array( current_mns );
+ state_type = allocate_integer_array( current_mns );
+
+ current_max_rules = INITIAL_MAX_RULES;
+ rule_type = allocate_integer_array( current_max_rules );
+ rule_linenum = allocate_integer_array( current_max_rules );
+ rule_useful = allocate_integer_array( current_max_rules );
+
+ current_max_scs = INITIAL_MAX_SCS;
+ scset = allocate_integer_array( current_max_scs );
+ scbol = allocate_integer_array( current_max_scs );
+ scxclu = allocate_integer_array( current_max_scs );
+ sceof = allocate_integer_array( current_max_scs );
+ scname = allocate_char_ptr_array( current_max_scs );
+
+ current_maxccls = INITIAL_MAX_CCLS;
+ cclmap = allocate_integer_array( current_maxccls );
+ ccllen = allocate_integer_array( current_maxccls );
+ cclng = allocate_integer_array( current_maxccls );
+
+ current_max_ccl_tbl_size = INITIAL_MAX_CCL_TBL_SIZE;
+ ccltbl = allocate_wchar_array( current_max_ccl_tbl_size );
+
+ current_max_dfa_size = INITIAL_MAX_DFA_SIZE;
+
+ current_max_xpairs = INITIAL_MAX_XPAIRS;
+ nxt = allocate_integer_array( current_max_xpairs );
+ chk = allocate_integer_array( current_max_xpairs );
+
+ current_max_template_xpairs = INITIAL_MAX_TEMPLATE_XPAIRS;
+ tnxt = allocate_integer_array( current_max_template_xpairs );
+
+ current_max_dfas = INITIAL_MAX_DFAS;
+ base = allocate_integer_array( current_max_dfas );
+ def = allocate_integer_array( current_max_dfas );
+ dfasiz = allocate_integer_array( current_max_dfas );
+ accsiz = allocate_integer_array( current_max_dfas );
+ dhash = allocate_integer_array( current_max_dfas );
+ dss = allocate_int_ptr_array( current_max_dfas );
+ dfaacc = allocate_dfaacc_union( current_max_dfas );
+
+ nultrans = (int *) 0;
+ }
+
+
+void usage()
+ {
+ FILE *f = stdout;
+
+ fprintf( f,
+_( "%s [-bcdfhilnpstvwBFILTV78+? -C[aefFmr] -ooutput -Pprefix -Sskeleton]\n" ),
+ program_name );
+ fprintf( f, _( "\t[--help --version] [file ...]\n" ) );
+
+ fprintf( f, _( "\t-b generate backing-up information to %s\n" ),
+ backing_name );
+ fprintf( f, _( "\t-c do-nothing POSIX option\n" ) );
+ fprintf( f, _( "\t-d turn on debug mode in generated scanner\n" ) );
+ fprintf( f, _( "\t-f generate fast, large scanner\n" ) );
+ fprintf( f, _( "\t-h produce this help message\n" ) );
+ fprintf( f, _( "\t-i generate case-insensitive scanner\n" ) );
+ fprintf( f, _( "\t-l maximal compatibility with original lex\n" ) );
+ fprintf( f, _( "\t-n do-nothing POSIX option\n" ) );
+ fprintf( f, _( "\t-p generate performance report to stderr\n" ) );
+ fprintf( f,
+ _( "\t-s suppress default rule to ECHO unmatched text\n" ) );
+
+ if ( ! did_outfilename )
+ {
+ sprintf( outfile_path, outfile_template,
+ prefix, C_plus_plus ? "cc" : "c" );
+ outfilename = outfile_path;
+ }
+
+ fprintf( f,
+ _( "\t-t write generated scanner on stdout instead of %s\n" ),
+ outfilename );
+
+ fprintf( f,
+ _( "\t-v write summary of scanner statistics to f\n" ) );
+ fprintf( f, _( "\t-w do not generate warnings\n" ) );
+ fprintf( f, _( "\t-B generate batch scanner (opposite of -I)\n" ) );
+ fprintf( f,
+ _( "\t-F use alternative fast scanner representation\n" ) );
+ fprintf( f,
+ _( "\t-I generate interactive scanner (opposite of -B)\n" ) );
+ fprintf( f, _( "\t-L suppress #line directives in scanner\n" ) );
+ fprintf( f, _( "\t-T %s should run in trace mode\n" ), program_name );
+ fprintf( f, _( "\t-V report %s version\n" ), program_name );
+ fprintf( f, _( "\t-7 generate 7-bit scanner\n" ) );
+ fprintf( f, _( "\t-8 generate 8-bit scanner\n" ) );
+ fprintf( f, _( "\t-U generate 16-bit (Unicode) scanner\n" ) );
+ fprintf( f, _( "\t-+ generate C++ scanner class\n" ) );
+ fprintf( f, _( "\t-? produce this help message\n" ) );
+ fprintf( f,
+_( "\t-C specify degree of table compression (default is -Cem):\n" ) );
+ fprintf( f,
+_( "\t\t-Ca trade off larger tables for better memory alignment\n" ) );
+ fprintf( f, _( "\t\t-Ce construct equivalence classes\n" ) );
+ fprintf( f,
+_( "\t\t-Cf do not compress scanner tables; use -f representation\n" ) );
+ fprintf( f,
+_( "\t\t-CF do not compress scanner tables; use -F representation\n" ) );
+ fprintf( f, _( "\t\t-Cm construct meta-equivalence classes\n" ) );
+ fprintf( f,
+ _( "\t\t-Cr use read() instead of stdio for scanner input\n" ) );
+ fprintf( f, _( "\t-o specify output filename\n" ) );
+ fprintf( f, _( "\t-P specify scanner prefix other than \"yy\"\n" ) );
+ fprintf( f, _( "\t-S specify skeleton file\n" ) );
+ fprintf( f, _( "\t--help produce this help message\n" ) );
+ fprintf( f, _( "\t--version report %s version\n" ), program_name );
+ }
diff --git a/to.do/unicode/misc.c b/to.do/unicode/misc.c
new file mode 100644
index 0000000..60d4e44
--- /dev/null
+++ b/to.do/unicode/misc.c
@@ -0,0 +1,894 @@
+/* misc - miscellaneous flex routines */
+
+/*-
+ * 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 are permitted provided
+ * that: (1) source distributions retain this entire copyright notice and
+ * comment, and (2) distributions including binaries display the following
+ * acknowledgement: ``This product includes software developed by the
+ * University of California, Berkeley and its contributors'' in the
+ * documentation or other materials provided with the distribution and in
+ * all advertising materials mentioning features or use of this software.
+ * 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.
+ */
+
+/* $Header$ */
+
+#include "flexdef.h"
+
+
+void action_define( defname, value )
+char *defname;
+int value;
+ {
+ char buf[MAXLINE];
+
+ if ( (int) strlen( defname ) > MAXLINE / 2 )
+ {
+ format_pinpoint_message( _( "name \"%s\" ridiculously long" ),
+ defname );
+ return;
+ }
+
+ sprintf( buf, "#define %s %d\n", defname, value );
+ add_action( buf );
+ }
+
+
+void add_action( new_text )
+char *new_text;
+ {
+ int len = strlen( new_text );
+
+ while ( len + action_index >= action_size - 10 /* slop */ )
+ {
+ int new_size = action_size * 2;
+
+ if ( new_size <= 0 )
+ /* Increase just a little, to try to avoid overflow
+ * on 16-bit machines.
+ */
+ action_size += action_size / 8;
+ else
+ action_size = new_size;
+
+ action_array =
+ reallocate_character_array( action_array, action_size );
+ }
+
+ strcpy( &action_array[action_index], new_text );
+
+ action_index += len;
+ }
+
+
+/* allocate_array - allocate memory for an integer array of the given size */
+
+void *allocate_array( size, element_size )
+int size;
+size_t element_size;
+ {
+ register void *mem;
+ size_t num_bytes = element_size * size;
+
+ mem = flex_alloc( num_bytes );
+ if ( ! mem )
+ flexfatal(
+ _( "memory allocation failed in allocate_array()" ) );
+
+ return mem;
+ }
+
+
+/* all_lower - true if a string is all lower-case */
+
+int all_lower( str )
+register char *str;
+ {
+ while ( *str )
+ {
+ if ( ! isascii( (Char) *str ) || ! islower( *str ) )
+ return 0;
+ ++str;
+ }
+
+ return 1;
+ }
+
+
+/* all_upper - true if a string is all upper-case */
+
+int all_upper( str )
+register char *str;
+ {
+ while ( *str )
+ {
+ if ( ! isascii( (Char) *str ) || ! isupper( *str ) )
+ return 0;
+ ++str;
+ }
+
+ return 1;
+ }
+
+
+/* bubble - bubble sort an integer array in increasing order
+ *
+ * synopsis
+ * int v[n], n;
+ * void bubble( v, n );
+ *
+ * description
+ * sorts the first n elements of array v and replaces them in
+ * increasing order.
+ *
+ * passed
+ * v - the array to be sorted
+ * n - the number of elements of 'v' to be sorted
+ */
+
+void bubble( v, n )
+int v[], n;
+ {
+ register int i, j, k;
+
+ for ( i = n; i > 1; --i )
+ for ( j = 1; j < i; ++j )
+ if ( v[j] > v[j + 1] ) /* compare */
+ {
+ k = v[j]; /* exchange */
+ v[j] = v[j + 1];
+ v[j + 1] = k;
+ }
+ }
+
+
+/* check_char - checks a character to make sure it's within the range
+ * we're expecting. If not, generates fatal error message
+ * and exits.
+ */
+
+void check_char( c )
+int c;
+ {
+ if ( c >= CSIZE )
+ lerrsf( _( "bad character '%s' detected in check_char()" ),
+ readable_form( c ) );
+
+ if ( c >= csize )
+ {
+ if ( c < 256 )
+ lerrsf(
+ _( "scanner requires -8 flag to use the character %s" ),
+ readable_form( c ) );
+ else
+ lerrsf(
+ _( "scanner requires -U flag to use the character %s" ),
+ readable_form( c ) );
+ }
+ }
+
+
+
+/* clower - replace upper-case letter to lower-case */
+
+Char clower( c )
+register int c;
+ {
+ return (Char) ((isascii( c ) && isupper( c )) ? tolower( c ) : c);
+ }
+
+
+/* copy_string - returns a dynamically allocated copy of a string */
+
+char *copy_string( str )
+register const char *str;
+ {
+ register const char *c1;
+ register char *c2;
+ char *copy;
+ unsigned int size;
+
+ /* find length */
+ for ( c1 = str; *c1; ++c1 )
+ ;
+
+ size = (c1 - str + 1) * sizeof( char );
+ copy = (char *) flex_alloc( size );
+
+ if ( copy == NULL )
+ flexfatal( _( "dynamic memory failure in copy_string()" ) );
+
+ for ( c2 = copy; (*c2++ = *str++) != 0; )
+ ;
+
+ return copy;
+ }
+
+
+/* copy_unsigned_string -
+ * returns a dynamically allocated copy of a (potentially) unsigned string
+ */
+
+Char *copy_unsigned_string( str )
+register Char *str;
+ {
+ register Char *c;
+ Char *copy;
+
+ /* find length */
+ for ( c = str; *c; ++c )
+ ;
+
+ copy = allocate_Character_array( c - str + 1 );
+
+ for ( c = copy; (*c++ = *str++) != 0; )
+ ;
+
+ return copy;
+ }
+
+
+/* cshell - shell sort a character array in increasing order
+ *
+ * synopsis
+ *
+ * Char v[n];
+ * int n, special_case_0;
+ * cshell( v, n, special_case_0 );
+ *
+ * description
+ * Does a shell sort of the first n elements of array v.
+ * If special_case_0 is true, then any element equal to 0
+ * is instead assumed to have infinite weight.
+ *
+ * passed
+ * v - array to be sorted
+ * n - number of elements of v to be sorted
+ */
+
+void cshell( v, n, special_case_0 )
+wchar_t v[];
+int n, special_case_0;
+ {
+ int gap, i, j, jg;
+ wchar_t k;
+
+ for ( gap = n / 2; gap > 0; gap = gap / 2 )
+ for ( i = gap; i < n; ++i )
+ for ( j = i - gap; j >= 0; j = j - gap )
+ {
+ jg = j + gap;
+
+ if ( special_case_0 )
+ {
+ if ( v[jg] == 0 )
+ break;
+
+ else if ( v[j] != 0 && v[j] <= v[jg] )
+ break;
+ }
+
+ else if ( v[j] <= v[jg] )
+ break;
+
+ k = v[j];
+ v[j] = v[jg];
+ v[jg] = k;
+ }
+ }
+
+
+/* dataend - finish up a block of data declarations */
+
+void dataend()
+ {
+ if ( datapos > 0 )
+ dataflush();
+
+ /* add terminator for initialization; { for vi */
+ outn( " } ;\n" );
+
+ dataline = 0;
+ datapos = 0;
+ }
+
+
+/* dataflush - flush generated data statements */
+
+void dataflush()
+ {
+ outc( '\n' );
+
+ if ( ++dataline >= NUMDATALINES )
+ {
+ /* Put out a blank line so that the table is grouped into
+ * large blocks that enable the user to find elements easily.
+ */
+ outc( '\n' );
+ dataline = 0;
+ }
+
+ /* Reset the number of characters written on the current line. */
+ datapos = 0;
+ }
+
+
+/* flexerror - report an error message and terminate */
+
+void flexerror( msg )
+const char msg[];
+ {
+ fprintf( stderr, "%s: %s\n", program_name, msg );
+ flexend( 1 );
+ }
+
+
+/* flexfatal - report a fatal error message and terminate */
+
+void flexfatal( msg )
+const char msg[];
+ {
+ fprintf( stderr, _( "%s: fatal internal error, %s\n" ),
+ program_name, msg );
+ exit( 1 );
+ }
+
+
+/* htoi - convert a hexadecimal digit string to an integer value */
+
+int htoi( str )
+Char str[];
+ {
+ unsigned int result;
+
+ (void) sscanf( (char *) str, "%x", &result );
+
+ return result;
+ }
+
+
+/* lerrif - report an error message formatted with one integer argument */
+
+void lerrif( msg, arg )
+const char msg[];
+int arg;
+ {
+ char errmsg[MAXLINE];
+ (void) sprintf( errmsg, msg, arg );
+ flexerror( errmsg );
+ }
+
+
+/* lerrsf - report an error message formatted with one string argument */
+
+void lerrsf( msg, arg )
+const char msg[], arg[];
+ {
+ char errmsg[MAXLINE];
+
+ (void) sprintf( errmsg, msg, arg );
+ flexerror( errmsg );
+ }
+
+
+/* line_directive_out - spit out a "#line" statement */
+
+void line_directive_out( output_file, do_infile )
+FILE *output_file;
+int do_infile;
+ {
+ char directive[MAXLINE], filename[MAXLINE];
+ char *s1, *s2, *s3;
+ static char line_fmt[] = "#line %d \"%s\"\n";
+
+ if ( ! gen_line_dirs )
+ return;
+
+ if ( (do_infile && ! infilename) || (! do_infile && ! outfilename) )
+ /* don't know the filename to use, skip */
+ return;
+
+ s1 = do_infile ? infilename : outfilename;
+ s2 = filename;
+ s3 = &filename[sizeof( filename ) - 2];
+
+ while ( s2 < s3 && *s1 )
+ {
+ if ( *s1 == '\\' )
+ /* Escape the '\' */
+ *s2++ = '\\';
+
+ *s2++ = *s1++;
+ }
+
+ *s2 = '\0';
+
+ if ( do_infile )
+ sprintf( directive, line_fmt, linenum, filename );
+ else
+ {
+ if ( output_file == stdout )
+ /* Account for the line directive itself. */
+ ++out_linenum;
+
+ sprintf( directive, line_fmt, out_linenum, filename );
+ }
+
+ /* If output_file is nil then we should put the directive in
+ * the accumulated actions.
+ */
+ if ( output_file )
+ {
+ fputs( directive, output_file );
+ }
+ else
+ add_action( directive );
+ }
+
+
+/* mark_defs1 - mark the current position in the action array as
+ * representing where the user's section 1 definitions end
+ * and the prolog begins
+ */
+void mark_defs1()
+ {
+ defs1_offset = 0;
+ action_array[action_index++] = '\0';
+ action_offset = prolog_offset = action_index;
+ action_array[action_index] = '\0';
+ }
+
+
+/* mark_prolog - mark the current position in the action array as
+ * representing the end of the action prolog
+ */
+void mark_prolog()
+ {
+ action_array[action_index++] = '\0';
+ action_offset = action_index;
+ action_array[action_index] = '\0';
+ }
+
+
+/* mk2data - generate a data statement for a two-dimensional array
+ *
+ * Generates a data statement initializing the current 2-D array to "value".
+ */
+void mk2data( value )
+int value;
+ {
+ if ( datapos >= NUMDATAITEMS )
+ {
+ outc( ',' );
+ dataflush();
+ }
+
+ if ( datapos == 0 )
+ /* Indent. */
+ out( " " );
+
+ else
+ outc( ',' );
+
+ ++datapos;
+
+ out_dec( "%5d", value );
+ }
+
+
+/* mkdata - generate a data statement
+ *
+ * Generates a data statement initializing the current array element to
+ * "value".
+ */
+void mkdata( value )
+int value;
+ {
+ if ( datapos >= NUMDATAITEMS )
+ {
+ outc( ',' );
+ dataflush();
+ }
+
+ if ( datapos == 0 )
+ /* Indent. */
+ out( " " );
+ else
+ outc( ',' );
+
+ ++datapos;
+
+ out_dec( "%5d", value );
+ }
+
+
+/* myctoi - return the integer represented by a string of digits */
+
+int myctoi( array )
+char array[];
+ {
+ int val = 0;
+
+ (void) sscanf( array, "%d", &val );
+
+ return val;
+ }
+
+
+/* myesc - return character corresponding to escape sequence */
+
+int myesc( array )
+Char array[];
+ {
+ Char c;
+ unsigned int esc_char;
+
+ switch ( array[1] )
+ {
+ case 'b': return '\b';
+ case 'f': return '\f';
+ case 'n': return '\n';
+ case 'r': return '\r';
+ case 't': return '\t';
+
+#if __STDC__
+ case 'a': return '\a';
+ case 'v': return '\v';
+#else
+ case 'a': return '\007';
+ case 'v': return '\013';
+#endif
+
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ { /* \<octal> */
+ int sptr = 1;
+
+ while ( isascii( array[sptr] ) &&
+ isdigit( array[sptr] ) )
+ /* Don't increment inside loop control
+ * because if isdigit() is a macro it might
+ * expand into multiple increments ...
+ */
+ ++sptr;
+
+ c = array[sptr];
+ array[sptr] = '\0';
+
+ esc_char = otoi( array + 1 );
+
+ array[sptr] = c;
+
+ return esc_char;
+ }
+
+ case 'x':
+ { /* \x<hex> */
+ int sptr = 2;
+
+ while ( isascii( array[sptr] ) &&
+ isxdigit( (char) array[sptr] ) )
+ /* Don't increment inside loop control
+ * because if isdigit() is a macro it might
+ * expand into multiple increments ...
+ */
+ ++sptr;
+
+ c = array[sptr];
+ array[sptr] = '\0';
+
+ esc_char = htoi( array + 2 );
+
+ array[sptr] = c;
+
+ return esc_char;
+ }
+
+ default:
+ return array[1];
+ }
+ }
+
+
+/* otoi - convert an octal digit string to an integer value */
+
+int otoi( str )
+Char str[];
+ {
+ unsigned int result;
+
+ (void) sscanf( (char *) str, "%o", &result );
+ return result;
+ }
+
+
+/* out - various flavors of outputing a (possibly formatted) string for the
+ * generated scanner, keeping track of the line count.
+ */
+
+void out( str )
+const char str[];
+ {
+ fputs( str, stdout );
+ out_line_count( str );
+ }
+
+void out_dec( fmt, n )
+const char fmt[];
+int n;
+ {
+ printf( fmt, n );
+ out_line_count( fmt );
+ }
+
+void out_dec2( fmt, n1, n2 )
+const char fmt[];
+int n1, n2;
+ {
+ printf( fmt, n1, n2 );
+ out_line_count( fmt );
+ }
+
+void out_hex( fmt, x )
+const char fmt[];
+unsigned int x;
+ {
+ printf( fmt, x );
+ out_line_count( fmt );
+ }
+
+void out_line_count( str )
+const char str[];
+ {
+ register int i;
+
+ for ( i = 0; str[i]; ++i )
+ if ( str[i] == '\n' )
+ ++out_linenum;
+ }
+
+void out_str( fmt, str )
+const char fmt[], str[];
+ {
+ printf( fmt, str );
+ out_line_count( fmt );
+ out_line_count( str );
+ }
+
+void out_str3( fmt, s1, s2, s3 )
+const char fmt[], s1[], s2[], s3[];
+ {
+ printf( fmt, s1, s2, s3 );
+ out_line_count( fmt );
+ out_line_count( s1 );
+ out_line_count( s2 );
+ out_line_count( s3 );
+ }
+
+void out_str_dec( fmt, str, n )
+const char fmt[], str[];
+int n;
+ {
+ printf( fmt, str, n );
+ out_line_count( fmt );
+ out_line_count( str );
+ }
+
+void outc( c )
+int c;
+ {
+ putc( c, stdout );
+
+ if ( c == '\n' )
+ ++out_linenum;
+ }
+
+void outn( str )
+const char str[];
+ {
+ puts( str );
+ out_line_count( str );
+ ++out_linenum;
+ }
+
+
+/* readable_form - return the the human-readable form of a character
+ *
+ * The returned string is in static storage.
+ */
+
+char *readable_form( c )
+register int c;
+ {
+ static char rform[10];
+
+ if ( (c >= 0 && c < 32) || c >= 127 )
+ {
+ switch ( c )
+ {
+ case '\b': return "\\b";
+ case '\f': return "\\f";
+ case '\n': return "\\n";
+ case '\r': return "\\r";
+ case '\t': return "\\t";
+
+#if __STDC__
+ case '\a': return "\\a";
+ case '\v': return "\\v";
+#endif
+
+ default:
+ (void) sprintf( rform, "\\%.3o",
+ (unsigned int) c );
+ return rform;
+ }
+ }
+
+ else if ( c == ' ' )
+ return "' '";
+
+ else
+ {
+ rform[0] = c;
+ rform[1] = '\0';
+
+ return rform;
+ }
+ }
+
+
+/* reallocate_array - increase the size of a dynamic array */
+
+void *reallocate_array( array, size, element_size )
+void *array;
+int size;
+size_t element_size;
+ {
+ register void *new_array;
+ size_t num_bytes = element_size * size;
+
+ new_array = flex_realloc( array, num_bytes );
+ if ( ! new_array )
+ flexfatal( _( "attempt to increase array size failed" ) );
+
+ return new_array;
+ }
+
+
+/* skelout - write out one section of the skeleton file
+ *
+ * Description
+ * Copies skelfile or skel array to stdout until a line beginning with
+ * "%%" or EOF is found.
+ */
+void skelout()
+ {
+ char buf_storage[MAXLINE];
+ char *buf = buf_storage;
+ int do_copy = 1;
+
+ /* Loop pulling lines either from the skelfile, if we're using
+ * one, or from the skel[] array.
+ */
+ while ( skelfile ?
+ (fgets( buf, MAXLINE, skelfile ) != NULL) :
+ ((buf = (char *) skel[skel_ind++]) != 0) )
+ { /* copy from skel array */
+ if ( buf[0] == '%' )
+ { /* control line */
+ switch ( buf[1] )
+ {
+ case '%':
+ return;
+
+ case '+':
+ do_copy = C_plus_plus;
+ break;
+
+ case '-':
+ do_copy = ! C_plus_plus;
+ break;
+
+ case '*':
+ do_copy = 1;
+ break;
+
+ default:
+ flexfatal(
+ _( "bad line in skeleton file" ) );
+ }
+ }
+
+ else if ( do_copy )
+ {
+ if ( skelfile )
+ /* Skeleton file reads include final
+ * newline, skel[] array does not.
+ */
+ out( buf );
+ else
+ outn( buf );
+ }
+ }
+ }
+
+
+/* transition_struct_out - output a yy_trans_info structure
+ *
+ * outputs the yy_trans_info structure with the two elements, element_v and
+ * element_n. Formats the output with spaces and carriage returns.
+ */
+
+void transition_struct_out( element_v, element_n )
+int element_v, element_n;
+ {
+ out_dec2( " {%4d,%4d },", element_v, element_n );
+
+ datapos += TRANS_STRUCT_PRINT_LENGTH;
+
+ if ( datapos >= 79 - TRANS_STRUCT_PRINT_LENGTH )
+ {
+ outc( '\n' );
+
+ if ( ++dataline % 10 == 0 )
+ outc( '\n' );
+
+ datapos = 0;
+ }
+ }
+
+
+/* The following is only needed when building flex's parser using certain
+ * broken versions of bison.
+ */
+void *yy_flex_xmalloc( size )
+int size;
+ {
+ void *result = flex_alloc( (size_t) size );
+
+ if ( ! result )
+ flexfatal(
+ _( "memory allocation failed in yy_flex_xmalloc()" ) );
+
+ return result;
+ }
+
+
+/* zero_out - set a region of memory to 0
+ *
+ * Sets region_ptr[0] through region_ptr[size_in_bytes - 1] to zero.
+ */
+
+void zero_out( region_ptr, size_in_bytes )
+char *region_ptr;
+size_t size_in_bytes;
+ {
+ register char *rp, *rp_end;
+
+ rp = region_ptr;
+ rp_end = region_ptr + size_in_bytes;
+
+ while ( rp < rp_end )
+ *rp++ = 0;
+ }
diff --git a/to.do/unicode/scan.l b/to.do/unicode/scan.l
new file mode 100644
index 0000000..0864068
--- /dev/null
+++ b/to.do/unicode/scan.l
@@ -0,0 +1,710 @@
+/* scan.l - scanner for flex input */
+
+%{
+/*-
+ * 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 are permitted provided
+ * that: (1) source distributions retain this entire copyright notice and
+ * comment, and (2) distributions including binaries display the following
+ * acknowledgement: ``This product includes software developed by the
+ * University of California, Berkeley and its contributors'' in the
+ * documentation or other materials provided with the distribution and in
+ * all advertising materials mentioning features or use of this software.
+ * 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.
+ */
+
+/* $Header$ */
+
+#include "flexdef.h"
+#include "parse.h"
+
+#define ACTION_ECHO add_action( yytext )
+#define ACTION_IFDEF(def, should_define) \
+ { \
+ if ( should_define ) \
+ action_define( def, 1 ); \
+ }
+
+#define MARK_END_OF_PROLOG mark_prolog();
+
+#define YY_DECL \
+ int flexscan()
+
+#define RETURNCHAR \
+ yylval = (unsigned char) yytext[0]; \
+ return CHAR;
+
+#define RETURNNAME \
+ strcpy( nmstr, yytext ); \
+ 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;
+%}
+
+%option caseless nodefault outfile="scan.c" stack noyy_top_state
+%option nostdinit
+
+%x SECT2 SECT2PROLOG SECT3 CODEBLOCK PICKUPDEF SC CARETISBOL NUM QUOTE
+%x FIRSTCCL CCL ACTION RECOVER COMMENT ACTION_STRING PERCENT_BRACE_ACTION
+%x OPTION LINEDIR
+
+WS [[:blank:]]+
+OPTWS [[:blank:]]*
+NOT_WS [^[:blank:]\n]
+
+NL \r?\n
+
+NAME ([[:alpha:]_][[:alnum:]_-]*)
+NOT_NAME [^[:alpha:]_*\n]+
+
+SCNAME {NAME}
+
+ESCSEQ (\\([^\n]|[0-7]{1,6}|x[[:xdigit:]]{1,4}))
+
+FIRST_CCL_CHAR ([^\\\n]|{ESCSEQ})
+CCL_CHAR ([^\\\n\]]|{ESCSEQ})
+CCL_EXPR ("[:"[[:alpha:]]+":]")
+
+LEXOPT [aceknopr]
+
+%%
+ static int bracelevel, didadef, indented_code;
+ static int doing_rule_action = false;
+ static int option_sense;
+
+ int doing_codeblock = false;
+ int i;
+ Char nmdef[MAXLINE];
+
+
+<INITIAL>{
+ ^{WS} indented_code = true; BEGIN(CODEBLOCK);
+ ^"/*" ACTION_ECHO; yy_push_state( COMMENT );
+ ^#{OPTWS}line{WS} yy_push_state( LINEDIR );
+ ^"%s"{NAME}? return SCDECL;
+ ^"%x"{NAME}? return XSCDECL;
+ ^"%{".*{NL} {
+ ++linenum;
+ line_directive_out( (FILE *) 0, 1 );
+ indented_code = false;
+ BEGIN(CODEBLOCK);
+ }
+
+ {WS} /* discard */
+
+ ^"%%".* {
+ sectnum = 2;
+ bracelevel = 0;
+ mark_defs1();
+ line_directive_out( (FILE *) 0, 1 );
+ BEGIN(SECT2PROLOG);
+ return SECTEND;
+ }
+
+ ^"%pointer".*{NL} yytext_is_array = false; ++linenum;
+ ^"%array".*{NL} yytext_is_array = true; ++linenum;
+
+ ^"%option" BEGIN(OPTION); return OPTION_OP;
+
+ ^"%"{LEXOPT}{OPTWS}[[:digit:]]*{OPTWS}{NL} ++linenum; /* ignore */
+ ^"%"{LEXOPT}{WS}.*{NL} ++linenum; /* ignore */
+
+ ^"%"[^sxaceknopr{}].* synerr( _( "unrecognized '%' directive" ) );
+
+ ^{NAME} {
+ strcpy( nmstr, yytext );
+ didadef = false;
+ BEGIN(PICKUPDEF);
+ }
+
+ {SCNAME} RETURNNAME;
+ ^{OPTWS}{NL} ++linenum; /* allows blank lines in section 1 */
+ {OPTWS}{NL} ACTION_ECHO; ++linenum; /* maybe end of comment line */
+}
+
+
+<COMMENT>{
+ "*/" ACTION_ECHO; yy_pop_state();
+ "*" ACTION_ECHO;
+ [^*\n]+ ACTION_ECHO;
+ [^*\n]*{NL} ++linenum; ACTION_ECHO;
+}
+
+<LINEDIR>{
+ \n yy_pop_state();
+ [[:digit:]]+ linenum = myctoi( yytext );
+
+ \"[^"\n]*\" {
+ flex_free( (void *) infilename );
+ infilename = copy_string( yytext + 1 );
+ infilename[strlen( infilename ) - 1] = '\0';
+ }
+ . /* ignore spurious characters */
+}
+
+<CODEBLOCK>{
+ ^"%}".*{NL} ++linenum; BEGIN(INITIAL);
+
+ {NAME}|{NOT_NAME}|. ACTION_ECHO;
+
+ {NL} {
+ ++linenum;
+ ACTION_ECHO;
+ if ( indented_code )
+ BEGIN(INITIAL);
+ }
+}
+
+
+<PICKUPDEF>{
+ {WS} /* separates name and definition */
+
+ {NOT_WS}.* {
+ strcpy( (char *) nmdef, yytext );
+
+ /* 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;
+ }
+
+ {NL} {
+ if ( ! didadef )
+ synerr( _( "incomplete name definition" ) );
+ BEGIN(INITIAL);
+ ++linenum;
+ }
+}
+
+
+<OPTION>{
+ {NL} ++linenum; BEGIN(INITIAL);
+ {WS} option_sense = true;
+
+ "=" return '=';
+
+ no option_sense = ! option_sense;
+
+ 7bit csize = option_sense ? 128 : 256;
+ 8bit csize = option_sense ? 256 : 128;
+ 16bit csize = option_sense ? 65536 : 256;
+
+ align long_align = option_sense;
+ always-interactive {
+ action_define( "YY_ALWAYS_INTERACTIVE", option_sense );
+ }
+ array yytext_is_array = option_sense;
+ backup backing_up_report = option_sense;
+ batch interactive = ! option_sense;
+ "c++" C_plus_plus = option_sense;
+ caseful|case-sensitive caseins = ! option_sense;
+ caseless|case-insensitive caseins = option_sense;
+ debug ddebug = option_sense;
+ default spprdflt = ! option_sense;
+ ecs useecs = option_sense;
+ fast {
+ useecs = usemecs = false;
+ use_read = fullspd = true;
+ }
+ full {
+ useecs = usemecs = false;
+ use_read = fulltbl = true;
+ }
+ input ACTION_IFDEF("YY_NO_INPUT", ! option_sense);
+ interactive interactive = option_sense;
+ lex-compat lex_compat = option_sense;
+ main {
+ action_define( "YY_MAIN", option_sense );
+ do_yywrap = ! option_sense;
+ }
+ meta-ecs usemecs = option_sense;
+ never-interactive {
+ action_define( "YY_NEVER_INTERACTIVE", option_sense );
+ }
+ perf-report performance_report += option_sense ? 1 : -1;
+ pointer yytext_is_array = ! option_sense;
+ read use_read = option_sense;
+ reject reject_really_used = option_sense;
+ stack action_define( "YY_STACK_USED", option_sense );
+ stdinit do_stdinit = option_sense;
+ stdout use_stdout = option_sense;
+ unput ACTION_IFDEF("YY_NO_UNPUT", ! option_sense);
+ verbose printstats = option_sense;
+ warn nowarn = ! option_sense;
+ yylineno do_yylineno = option_sense;
+ yymore yymore_really_used = option_sense;
+ yywrap do_yywrap = option_sense;
+
+ yy_push_state ACTION_IFDEF("YY_NO_PUSH_STATE", ! option_sense);
+ yy_pop_state ACTION_IFDEF("YY_NO_POP_STATE", ! option_sense);
+ yy_top_state ACTION_IFDEF("YY_NO_TOP_STATE", ! option_sense);
+
+ yy_scan_buffer ACTION_IFDEF("YY_NO_SCAN_BUFFER", ! option_sense);
+ yy_scan_bytes ACTION_IFDEF("YY_NO_SCAN_BYTES", ! option_sense);
+ yy_scan_string ACTION_IFDEF("YY_NO_SCAN_STRING", ! option_sense);
+
+ outfile return OPT_OUTFILE;
+ prefix return OPT_PREFIX;
+ yyclass return OPT_YYCLASS;
+
+ \"[^"\n]*\" {
+ strcpy( nmstr, yytext + 1 );
+ nmstr[strlen( nmstr ) - 1] = '\0';
+ return NAME;
+ }
+
+ (([a-mo-z]|n[a-np-z])[[:alpha:]\-+]*)|. {
+ format_synerr( _( "unrecognized %%option: %s" ),
+ yytext );
+ BEGIN(RECOVER);
+ }
+}
+
+<RECOVER>.*{NL} ++linenum; BEGIN(INITIAL);
+
+
+<SECT2PROLOG>{
+ ^"%{".* ++bracelevel; yyless( 2 ); /* eat only %{ */
+ ^"%}".* --bracelevel; yyless( 2 ); /* eat only %} */
+
+ ^{WS}.* ACTION_ECHO; /* indented code in prolog */
+
+ ^{NOT_WS}.* { /* 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;
+ }
+
+ .* ACTION_ECHO;
+ {NL} ++linenum; ACTION_ECHO;
+
+ <<EOF>> {
+ mark_prolog();
+ sectnum = 0;
+ yyterminate(); /* to stop the parser */
+ }
+}
+
+<SECT2>{
+ ^{OPTWS}{NL} ++linenum; /* allow blank lines in section 2 */
+
+ ^{OPTWS}"%{" {
+ indented_code = false;
+ doing_codeblock = true;
+ bracelevel = 1;
+ BEGIN(PERCENT_BRACE_ACTION);
+ }
+
+ ^{OPTWS}"<" BEGIN(SC); return '<';
+ ^{OPTWS}"^" return '^';
+ \" BEGIN(QUOTE); return '"';
+ "{"/[[:digit:]] BEGIN(NUM); return '{';
+ "$"/([[:blank:]]|{NL}) return '$';
+
+ {WS}"%{" {
+ bracelevel = 1;
+ BEGIN(PERCENT_BRACE_ACTION);
+
+ if ( in_rule )
+ {
+ doing_rule_action = true;
+ in_rule = false;
+ return '\n';
+ }
+ }
+ {WS}"|".*{NL} continued_action = true; ++linenum; return '\n';
+
+ ^{WS}"/*" {
+ yyless( yyleng - 2 ); /* put back '/', '*' */
+ bracelevel = 0;
+ continued_action = false;
+ BEGIN(ACTION);
+ }
+
+ ^{WS} /* allow indented rules */
+
+ {WS} {
+ /* 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';
+ }
+ }
+
+ {OPTWS}{NL} {
+ 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';
+ }
+ }
+
+ ^{OPTWS}"<<EOF>>" |
+ "<<EOF>>" return EOF_OP;
+
+ ^"%%".* {
+ sectnum = 3;
+ BEGIN(SECT3);
+ yyterminate(); /* to stop the parser */
+ }
+
+ "["({FIRST_CCL_CHAR}|{CCL_EXPR})({CCL_CHAR}|{CCL_EXPR})* {
+ int cclval;
+
+ strcpy( nmstr, yytext );
+
+ /* Check to see if we've already encountered this
+ * ccl.
+ */
+ if ( (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 '[';
+ }
+ }
+
+ "{"{NAME}"}" {
+ register Char *nmdefptr;
+
+ strcpy( nmstr, yytext + 1 );
+ nmstr[yyleng - 2] = '\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 ( lex_compat || nmdefptr[0] == '^' ||
+ (len > 0 && nmdefptr[len - 1] == '$') )
+ { /* 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('(');
+ }
+ }
+ }
+
+ [/|*+?.(){}] return (unsigned char) yytext[0];
+ . RETURNCHAR;
+}
+
+
+<SC>{
+ [,*] return (unsigned char) yytext[0];
+ ">" BEGIN(SECT2); return '>';
+ ">"/^ BEGIN(CARETISBOL); return '>';
+ {SCNAME} RETURNNAME;
+ . {
+ format_synerr( _( "bad <start condition>: %s" ),
+ yytext );
+ }
+}
+
+<CARETISBOL>"^" BEGIN(SECT2); return '^';
+
+
+<QUOTE>{
+ [^"\n] RETURNCHAR;
+ \" BEGIN(SECT2); return '"';
+
+ {NL} {
+ synerr( _( "missing quote" ) );
+ BEGIN(SECT2);
+ ++linenum;
+ return '"';
+ }
+}
+
+
+<FIRSTCCL>{
+ "^"/[^-\]\n] BEGIN(CCL); return '^';
+ "^"/("-"|"]") return '^';
+ . BEGIN(CCL); RETURNCHAR;
+}
+
+<CCL>{
+ -/[^\]\n] return '-';
+ [^\]\n] RETURNCHAR;
+ "]" BEGIN(SECT2); return ']';
+ .|{NL} {
+ synerr( _( "bad character class" ) );
+ BEGIN(SECT2);
+ return ']';
+ }
+}
+
+<FIRSTCCL,CCL>{
+ "[:alnum:]" BEGIN(CCL); return CCE_ALNUM;
+ "[:alpha:]" BEGIN(CCL); return CCE_ALPHA;
+ "[:blank:]" BEGIN(CCL); return CCE_BLANK;
+ "[:cntrl:]" BEGIN(CCL); return CCE_CNTRL;
+ "[:digit:]" BEGIN(CCL); return CCE_DIGIT;
+ "[:graph:]" BEGIN(CCL); return CCE_GRAPH;
+ "[:lower:]" BEGIN(CCL); return CCE_LOWER;
+ "[:print:]" BEGIN(CCL); return CCE_PRINT;
+ "[:punct:]" BEGIN(CCL); return CCE_PUNCT;
+ "[:space:]" BEGIN(CCL); return CCE_SPACE;
+ "[:upper:]" BEGIN(CCL); return CCE_UPPER;
+ "[:xdigit:]" BEGIN(CCL); return CCE_XDIGIT;
+ {CCL_EXPR} {
+ format_synerr(
+ _( "bad character class expression: %s" ),
+ yytext );
+ BEGIN(CCL); return CCE_ALNUM;
+ }
+}
+
+<NUM>{
+ [[:digit:]]+ {
+ yylval = myctoi( yytext );
+ return NUMBER;
+ }
+
+ "," return ',';
+ "}" BEGIN(SECT2); return '}';
+
+ . {
+ synerr( _( "bad character inside {}'s" ) );
+ BEGIN(SECT2);
+ return '}';
+ }
+
+ {NL} {
+ synerr( _( "missing }" ) );
+ BEGIN(SECT2);
+ ++linenum;
+ return '}';
+ }
+}
+
+
+<PERCENT_BRACE_ACTION>{
+ {OPTWS}"%}".* bracelevel = 0;
+
+ <ACTION>"/*" ACTION_ECHO; yy_push_state( COMMENT );
+
+ <CODEBLOCK,ACTION>{
+ "reject" {
+ ACTION_ECHO;
+ CHECK_REJECT(yytext);
+ }
+ "yymore" {
+ ACTION_ECHO;
+ CHECK_YYMORE(yytext);
+ }
+ }
+
+ {NAME}|{NOT_NAME}|. ACTION_ECHO;
+ {NL} {
+ ++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);
+ }
+ }
+}
+
+
+ /* Reject and YYmore() are checked for above, in PERCENT_BRACE_ACTION */
+<ACTION>{
+ "{" ACTION_ECHO; ++bracelevel;
+ "}" ACTION_ECHO; --bracelevel;
+ [^[:alpha:]_{}"'/\n]+ ACTION_ECHO;
+ {NAME} ACTION_ECHO;
+ "'"([^'\\\n]|\\.)*"'" ACTION_ECHO; /* character constant */
+ \" ACTION_ECHO; BEGIN(ACTION_STRING);
+ {NL} {
+ ++linenum;
+ ACTION_ECHO;
+ if ( bracelevel == 0 )
+ {
+ if ( doing_rule_action )
+ add_action( "\tYY_BREAK\n" );
+
+ doing_rule_action = false;
+ BEGIN(SECT2);
+ }
+ }
+ . ACTION_ECHO;
+}
+
+<ACTION_STRING>{
+ [^"\\\n]+ ACTION_ECHO;
+ \\. ACTION_ECHO;
+ {NL} ++linenum; ACTION_ECHO;
+ \" ACTION_ECHO; BEGIN(ACTION);
+ . ACTION_ECHO;
+}
+
+<COMMENT,ACTION,ACTION_STRING><<EOF>> {
+ synerr( _( "EOF encountered inside an action" ) );
+ yyterminate();
+ }
+
+
+<SECT2,QUOTE,FIRSTCCL,CCL>{ESCSEQ} {
+ yylval = myesc( (Char *) yytext );
+
+ if ( YY_START == FIRSTCCL )
+ BEGIN(CCL);
+
+ return CHAR;
+ }
+
+
+<SECT3>{
+ .*(\n?) ECHO;
+ <<EOF>> sectnum = 0; yyterminate();
+}
+
+<*>.|\n format_synerr( _( "bad character: %s" ), yytext );
+
+%%
+
+
+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 --git a/to.do/unicode/tblcmp.c b/to.do/unicode/tblcmp.c
new file mode 100644
index 0000000..c21d9be
--- /dev/null
+++ b/to.do/unicode/tblcmp.c
@@ -0,0 +1,887 @@
+/* tblcmp - table compression routines */
+
+/*-
+ * 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 are permitted provided
+ * that: (1) source distributions retain this entire copyright notice and
+ * comment, and (2) distributions including binaries display the following
+ * acknowledgement: ``This product includes software developed by the
+ * University of California, Berkeley and its contributors'' in the
+ * documentation or other materials provided with the distribution and in
+ * all advertising materials mentioning features or use of this software.
+ * 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.
+ */
+
+/* $Header$ */
+
+#include "flexdef.h"
+
+
+/* declarations for functions that have forward references */
+
+void mkentry PROTO((register int*, int, int, int, int));
+void mkprot PROTO((int[], int, int));
+void mktemplate PROTO((int[], int, int));
+void mv2front PROTO((int));
+int tbldiff PROTO((int[], int, int[]));
+
+
+/* bldtbl - build table entries for dfa state
+ *
+ * synopsis
+ * int state[numecs], statenum, totaltrans, comstate, comfreq;
+ * bldtbl( state, statenum, totaltrans, comstate, comfreq );
+ *
+ * State is the statenum'th dfa state. It is indexed by equivalence class and
+ * gives the number of the state to enter for a given equivalence class.
+ * totaltrans is the total number of transitions out of the state. Comstate
+ * is that state which is the destination of the most transitions out of State.
+ * Comfreq is how many transitions there are out of State to Comstate.
+ *
+ * A note on terminology:
+ * "protos" are transition tables which have a high probability of
+ * either being redundant (a state processed later will have an identical
+ * transition table) or nearly redundant (a state processed later will have
+ * many of the same out-transitions). A "most recently used" queue of
+ * protos is kept around with the hope that most states will find a proto
+ * which is similar enough to be usable, and therefore compacting the
+ * output tables.
+ * "templates" are a special type of proto. If a transition table is
+ * homogeneous or nearly homogeneous (all transitions go to the same
+ * destination) then the odds are good that future states will also go
+ * to the same destination state on basically the same character set.
+ * These homogeneous states are so common when dealing with large rule
+ * sets that they merit special attention. If the transition table were
+ * simply made into a proto, then (typically) each subsequent, similar
+ * state will differ from the proto for two out-transitions. One of these
+ * out-transitions will be that character on which the proto does not go
+ * to the common destination, and one will be that character on which the
+ * state does not go to the common destination. Templates, on the other
+ * hand, go to the common state on EVERY transition character, and therefore
+ * cost only one difference.
+ */
+
+void bldtbl( state, statenum, totaltrans, comstate, comfreq )
+int state[], statenum, totaltrans, comstate, comfreq;
+ {
+ int extptr, extrct[2][CSIZE + 1];
+ int mindiff, minprot, i, d;
+
+ /* If extptr is 0 then the first array of extrct holds the result
+ * of the "best difference" to date, which is those transitions
+ * which occur in "state" but not in the proto which, to date,
+ * has the fewest differences between itself and "state". If
+ * extptr is 1 then the second array of extrct hold the best
+ * difference. The two arrays are toggled between so that the
+ * best difference to date can be kept around and also a difference
+ * just created by checking against a candidate "best" proto.
+ */
+
+ extptr = 0;
+
+ /* If the state has too few out-transitions, don't bother trying to
+ * compact its tables.
+ */
+
+ if ( (totaltrans * 100) < (numecs * PROTO_SIZE_PERCENTAGE) )
+ mkentry( state, numecs, statenum, JAMSTATE, totaltrans );
+
+ else
+ {
+ /* "checkcom" is true if we should only check "state" against
+ * protos which have the same "comstate" value.
+ */
+ int checkcom =
+ comfreq * 100 > totaltrans * CHECK_COM_PERCENTAGE;
+
+ minprot = firstprot;
+ mindiff = totaltrans;
+
+ if ( checkcom )
+ {
+ /* Find first proto which has the same "comstate". */
+ for ( i = firstprot; i != NIL; i = protnext[i] )
+ if ( protcomst[i] == comstate )
+ {
+ minprot = i;
+ mindiff = tbldiff( state, minprot,
+ extrct[extptr] );
+ break;
+ }
+ }
+
+ else
+ {
+ /* Since we've decided that the most common destination
+ * out of "state" does not occur with a high enough
+ * frequency, we set the "comstate" to zero, assuring
+ * that if this state is entered into the proto list,
+ * it will not be considered a template.
+ */
+ comstate = 0;
+
+ if ( firstprot != NIL )
+ {
+ minprot = firstprot;
+ mindiff = tbldiff( state, minprot,
+ extrct[extptr] );
+ }
+ }
+
+ /* We now have the first interesting proto in "minprot". If
+ * it matches within the tolerances set for the first proto,
+ * we don't want to bother scanning the rest of the proto list
+ * to see if we have any other reasonable matches.
+ */
+
+ if ( mindiff * 100 > totaltrans * FIRST_MATCH_DIFF_PERCENTAGE )
+ {
+ /* Not a good enough match. Scan the rest of the
+ * protos.
+ */
+ for ( i = minprot; i != NIL; i = protnext[i] )
+ {
+ d = tbldiff( state, i, extrct[1 - extptr] );
+ if ( d < mindiff )
+ {
+ extptr = 1 - extptr;
+ mindiff = d;
+ minprot = i;
+ }
+ }
+ }
+
+ /* Check if the proto we've decided on as our best bet is close
+ * enough to the state we want to match to be usable.
+ */
+
+ if ( mindiff * 100 > totaltrans * ACCEPTABLE_DIFF_PERCENTAGE )
+ {
+ /* No good. If the state is homogeneous enough,
+ * we make a template out of it. Otherwise, we
+ * make a proto.
+ */
+
+ if ( comfreq * 100 >=
+ totaltrans * TEMPLATE_SAME_PERCENTAGE )
+ mktemplate( state, statenum, comstate );
+
+ else
+ {
+ mkprot( state, statenum, comstate );
+ mkentry( state, numecs, statenum,
+ JAMSTATE, totaltrans );
+ }
+ }
+
+ else
+ { /* use the proto */
+ mkentry( extrct[extptr], numecs, statenum,
+ prottbl[minprot], mindiff );
+
+ /* If this state was sufficiently different from the
+ * proto we built it from, make it, too, a proto.
+ */
+
+ if ( mindiff * 100 >=
+ totaltrans * NEW_PROTO_DIFF_PERCENTAGE )
+ mkprot( state, statenum, comstate );
+
+ /* Since mkprot added a new proto to the proto queue,
+ * it's possible that "minprot" is no longer on the
+ * proto queue (if it happened to have been the last
+ * entry, it would have been bumped off). If it's
+ * not there, then the new proto took its physical
+ * place (though logically the new proto is at the
+ * beginning of the queue), so in that case the
+ * following call will do nothing.
+ */
+
+ mv2front( minprot );
+ }
+ }
+ }
+
+
+/* cmptmps - compress template table entries
+ *
+ * Template tables are compressed by using the 'template equivalence
+ * classes', which are collections of transition character equivalence
+ * classes which always appear together in templates - really meta-equivalence
+ * classes.
+ */
+
+void cmptmps()
+ {
+ int tmpstorage[CSIZE + 1];
+ register int *tmp = tmpstorage, i, j;
+ int totaltrans, trans;
+
+ peakpairs = numtemps * numecs + tblend;
+
+ if ( usemecs )
+ {
+ /* Create equivalence classes based on data gathered on
+ * template transitions.
+ */
+ nummecs = cre8ecs( tecfwd, tecbck, numecs );
+ }
+
+ else
+ nummecs = numecs;
+
+ while ( lastdfa + numtemps + 1 >= current_max_dfas )
+ increase_max_dfas();
+
+ /* Loop through each template. */
+
+ for ( i = 1; i <= numtemps; ++i )
+ {
+ /* Number of non-jam transitions out of this template. */
+ totaltrans = 0;
+
+ for ( j = 1; j <= numecs; ++j )
+ {
+ trans = tnxt[numecs * i + j];
+
+ if ( usemecs )
+ {
+ /* The absolute value of tecbck is the
+ * meta-equivalence class of a given
+ * equivalence class, as set up by cre8ecs().
+ */
+ if ( tecbck[j] > 0 )
+ {
+ tmp[tecbck[j]] = trans;
+
+ if ( trans > 0 )
+ ++totaltrans;
+ }
+ }
+
+ else
+ {
+ tmp[j] = trans;
+
+ if ( trans > 0 )
+ ++totaltrans;
+ }
+ }
+
+ /* It is assumed (in a rather subtle way) in the skeleton
+ * that if we're using meta-equivalence classes, the def[]
+ * entry for all templates is the jam template, i.e.,
+ * templates never default to other non-jam table entries
+ * (e.g., another template)
+ */
+
+ /* Leave room for the jam-state after the last real state. */
+ mkentry( tmp, nummecs, lastdfa + i + 1, JAMSTATE, totaltrans );
+ }
+ }
+
+
+
+/* expand_nxt_chk - expand the next check arrays */
+
+void expand_nxt_chk()
+ {
+ register int old_max = current_max_xpairs;
+
+ current_max_xpairs += MAX_XPAIRS_INCREMENT;
+
+ ++num_reallocs;
+
+ nxt = reallocate_integer_array( nxt, current_max_xpairs );
+ chk = reallocate_integer_array( chk, current_max_xpairs );
+
+ zero_out( (char *) (chk + old_max),
+ (size_t) (MAX_XPAIRS_INCREMENT * sizeof( int )) );
+ }
+
+
+/* find_table_space - finds a space in the table for a state to be placed
+ *
+ * synopsis
+ * int *state, numtrans, block_start;
+ * int find_table_space();
+ *
+ * block_start = find_table_space( state, numtrans );
+ *
+ * State is the state to be added to the full speed transition table.
+ * Numtrans is the number of out-transitions for the state.
+ *
+ * find_table_space() returns the position of the start of the first block (in
+ * chk) able to accommodate the state
+ *
+ * In determining if a state will or will not fit, find_table_space() must take
+ * into account the fact that an end-of-buffer state will be added at [0],
+ * and an action number will be added in [-1].
+ */
+
+int find_table_space( state, numtrans )
+int *state, numtrans;
+ {
+ /* Firstfree is the position of the first possible occurrence of two
+ * consecutive unused records in the chk and nxt arrays.
+ */
+ register int i;
+ register int *state_ptr, *chk_ptr;
+ register int *ptr_to_last_entry_in_state;
+
+ /* If there are too many out-transitions, put the state at the end of
+ * nxt and chk.
+ */
+ if ( numtrans > MAX_XTIONS_FULL_INTERIOR_FIT )
+ {
+ /* If table is empty, return the first available spot in
+ * chk/nxt, which should be 1.
+ */
+ if ( tblend < 2 )
+ return 1;
+
+ /* Start searching for table space near the end of
+ * chk/nxt arrays.
+ */
+ i = tblend - numecs;
+ }
+
+ else
+ /* Start searching for table space from the beginning
+ * (skipping only the elements which will definitely not
+ * hold the new state).
+ */
+ i = firstfree;
+
+ while ( 1 ) /* loops until a space is found */
+ {
+ while ( i + numecs >= current_max_xpairs )
+ expand_nxt_chk();
+
+ /* Loops until space for end-of-buffer and action number
+ * are found.
+ */
+ while ( 1 )
+ {
+ /* Check for action number space. */
+ if ( chk[i - 1] == 0 )
+ {
+ /* Check for end-of-buffer space. */
+ if ( chk[i] == 0 )
+ break;
+
+ else
+ /* Since i != 0, there is no use
+ * checking to see if (++i) - 1 == 0,
+ * because that's the same as i == 0,
+ * so we skip a space.
+ */
+ i += 2;
+ }
+
+ else
+ ++i;
+
+ while ( i + numecs >= current_max_xpairs )
+ expand_nxt_chk();
+ }
+
+ /* If we started search from the beginning, store the new
+ * firstfree for the next call of find_table_space().
+ */
+ if ( numtrans <= MAX_XTIONS_FULL_INTERIOR_FIT )
+ firstfree = i + 1;
+
+ /* Check to see if all elements in chk (and therefore nxt)
+ * that are needed for the new state have not yet been taken.
+ */
+
+ state_ptr = &state[1];
+ ptr_to_last_entry_in_state = &chk[i + numecs + 1];
+
+ for ( chk_ptr = &chk[i + 1];
+ chk_ptr != ptr_to_last_entry_in_state; ++chk_ptr )
+ if ( *(state_ptr++) != 0 && *chk_ptr != 0 )
+ break;
+
+ if ( chk_ptr == ptr_to_last_entry_in_state )
+ return i;
+
+ else
+ ++i;
+ }
+ }
+
+
+/* inittbl - initialize transition tables
+ *
+ * Initializes "firstfree" to be one beyond the end of the table. Initializes
+ * all "chk" entries to be zero.
+ */
+void inittbl()
+ {
+ register int i;
+
+ zero_out( (char *) chk, (size_t) (current_max_xpairs * sizeof( int )) );
+
+ tblend = 0;
+ firstfree = tblend + 1;
+ numtemps = 0;
+
+ if ( usemecs )
+ {
+ /* Set up doubly-linked meta-equivalence classes; these
+ * are sets of equivalence classes which all have identical
+ * transitions out of TEMPLATES.
+ */
+
+ tecbck[1] = NIL;
+
+ for ( i = 2; i <= numecs; ++i )
+ {
+ tecbck[i] = i - 1;
+ tecfwd[i - 1] = i;
+ }
+
+ tecfwd[numecs] = NIL;
+ }
+ }
+
+
+/* mkdeftbl - make the default, "jam" table entries */
+
+void mkdeftbl()
+ {
+ int i;
+
+ jamstate = lastdfa + 1;
+
+ ++tblend; /* room for transition on end-of-buffer character */
+
+ while ( tblend + numecs >= current_max_xpairs )
+ expand_nxt_chk();
+
+ /* Add in default end-of-buffer transition. */
+ nxt[tblend] = end_of_buffer_state;
+ chk[tblend] = jamstate;
+
+ for ( i = 1; i <= numecs; ++i )
+ {
+ nxt[tblend + i] = 0;
+ chk[tblend + i] = jamstate;
+ }
+
+ jambase = tblend;
+
+ base[jamstate] = jambase;
+ def[jamstate] = 0;
+
+ tblend += numecs;
+ ++numtemps;
+ }
+
+
+/* mkentry - create base/def and nxt/chk entries for transition array
+ *
+ * synopsis
+ * int state[numchars + 1], numchars, statenum, deflink, totaltrans;
+ * mkentry( state, numchars, statenum, deflink, totaltrans );
+ *
+ * "state" is a transition array "numchars" characters in size, "statenum"
+ * is the offset to be used into the base/def tables, and "deflink" is the
+ * entry to put in the "def" table entry. If "deflink" is equal to
+ * "JAMSTATE", then no attempt will be made to fit zero entries of "state"
+ * (i.e., jam entries) into the table. It is assumed that by linking to
+ * "JAMSTATE" they will be taken care of. In any case, entries in "state"
+ * marking transitions to "SAME_TRANS" are treated as though they will be
+ * taken care of by whereever "deflink" points. "totaltrans" is the total
+ * number of transitions out of the state. If it is below a certain threshold,
+ * the tables are searched for an interior spot that will accommodate the
+ * state array.
+ */
+
+void mkentry( state, numchars, statenum, deflink, totaltrans )
+register int *state;
+int numchars, statenum, deflink, totaltrans;
+ {
+ register int minec, maxec, i, baseaddr;
+ int tblbase, tbllast;
+
+ if ( totaltrans == 0 )
+ { /* there are no out-transitions */
+ if ( deflink == JAMSTATE )
+ base[statenum] = JAMSTATE;
+ else
+ base[statenum] = 0;
+
+ def[statenum] = deflink;
+ return;
+ }
+
+ for ( minec = 1; minec <= numchars; ++minec )
+ {
+ if ( state[minec] != SAME_TRANS )
+ if ( state[minec] != 0 || deflink != JAMSTATE )
+ break;
+ }
+
+ if ( totaltrans == 1 )
+ {
+ /* There's only one out-transition. Save it for later to fill
+ * in holes in the tables.
+ */
+ stack1( statenum, minec, state[minec], deflink );
+ return;
+ }
+
+ for ( maxec = numchars; maxec > 0; --maxec )
+ {
+ if ( state[maxec] != SAME_TRANS )
+ if ( state[maxec] != 0 || deflink != JAMSTATE )
+ break;
+ }
+
+ /* Whether we try to fit the state table in the middle of the table
+ * entries we have already generated, or if we just take the state
+ * table at the end of the nxt/chk tables, we must make sure that we
+ * have a valid base address (i.e., non-negative). Note that
+ * negative base addresses dangerous at run-time (because indexing
+ * the nxt array with one and a low-valued character will access
+ * memory before the start of the array.
+ */
+
+ /* Find the first transition of state that we need to worry about. */
+ if ( totaltrans * 100 <= numchars * INTERIOR_FIT_PERCENTAGE )
+ {
+ /* Attempt to squeeze it into the middle of the tables. */
+ baseaddr = firstfree;
+
+ while ( baseaddr < minec )
+ {
+ /* Using baseaddr would result in a negative base
+ * address below; find the next free slot.
+ */
+ for ( ++baseaddr; chk[baseaddr] != 0; ++baseaddr )
+ ;
+ }
+
+ while ( baseaddr + maxec - minec + 1 >= current_max_xpairs )
+ expand_nxt_chk();
+
+ for ( i = minec; i <= maxec; ++i )
+ if ( state[i] != SAME_TRANS &&
+ (state[i] != 0 || deflink != JAMSTATE) &&
+ chk[baseaddr + i - minec] != 0 )
+ { /* baseaddr unsuitable - find another */
+ for ( ++baseaddr;
+ baseaddr < current_max_xpairs &&
+ chk[baseaddr] != 0; ++baseaddr )
+ ;
+
+ while ( baseaddr + maxec - minec + 1 >=
+ current_max_xpairs )
+ expand_nxt_chk();
+
+ /* Reset the loop counter so we'll start all
+ * over again next time it's incremented.
+ */
+
+ i = minec - 1;
+ }
+ }
+
+ else
+ {
+ /* Ensure that the base address we eventually generate is
+ * non-negative.
+ */
+ baseaddr = MAX( tblend + 1, minec );
+ }
+
+ tblbase = baseaddr - minec;
+ tbllast = tblbase + maxec;
+
+ while ( tbllast + 1 >= current_max_xpairs )
+ expand_nxt_chk();
+
+ base[statenum] = tblbase;
+ def[statenum] = deflink;
+
+ for ( i = minec; i <= maxec; ++i )
+ if ( state[i] != SAME_TRANS )
+ if ( state[i] != 0 || deflink != JAMSTATE )
+ {
+ nxt[tblbase + i] = state[i];
+ chk[tblbase + i] = statenum;
+ }
+
+ if ( baseaddr == firstfree )
+ /* Find next free slot in tables. */
+ for ( ++firstfree; chk[firstfree] != 0; ++firstfree )
+ ;
+
+ tblend = MAX( tblend, tbllast );
+ }
+
+
+/* mk1tbl - create table entries for a state (or state fragment) which
+ * has only one out-transition
+ */
+
+void mk1tbl( state, sym, onenxt, onedef )
+int state, sym, onenxt, onedef;
+ {
+ if ( firstfree < sym )
+ firstfree = sym;
+
+ while ( chk[firstfree] != 0 )
+ if ( ++firstfree >= current_max_xpairs )
+ expand_nxt_chk();
+
+ base[state] = firstfree - sym;
+ def[state] = onedef;
+ chk[firstfree] = state;
+ nxt[firstfree] = onenxt;
+
+ if ( firstfree > tblend )
+ {
+ tblend = firstfree++;
+
+ if ( firstfree >= current_max_xpairs )
+ expand_nxt_chk();
+ }
+ }
+
+
+/* mkprot - create new proto entry */
+
+void mkprot( state, statenum, comstate )
+int state[], statenum, comstate;
+ {
+ int i, slot, tblbase;
+
+ if ( ++numprots >= MSP || numecs * numprots >= PROT_SAVE_SIZE )
+ {
+ /* Gotta make room for the new proto by dropping last entry in
+ * the queue.
+ */
+ slot = lastprot;
+ lastprot = protprev[lastprot];
+ protnext[lastprot] = NIL;
+ }
+
+ else
+ slot = numprots;
+
+ protnext[slot] = firstprot;
+
+ if ( firstprot != NIL )
+ protprev[firstprot] = slot;
+
+ firstprot = slot;
+ prottbl[slot] = statenum;
+ protcomst[slot] = comstate;
+
+ /* Copy state into save area so it can be compared with rapidly. */
+ tblbase = numecs * (slot - 1);
+
+ for ( i = 1; i <= numecs; ++i )
+ protsave[tblbase + i] = state[i];
+ }
+
+
+/* mktemplate - create a template entry based on a state, and connect the state
+ * to it
+ */
+
+void mktemplate( state, statenum, comstate )
+int state[], statenum, comstate;
+ {
+ int i, numdiff, tmpbase, tmp[CSIZE + 1];
+ wchar_t transset[CSIZE + 1];
+ int tsptr;
+
+ ++numtemps;
+
+ tsptr = 0;
+
+ /* Calculate where we will temporarily store the transition table
+ * of the template in the tnxt[] array. The final transition table
+ * gets created by cmptmps().
+ */
+
+ tmpbase = numtemps * numecs;
+
+ if ( tmpbase + numecs >= current_max_template_xpairs )
+ {
+ current_max_template_xpairs += MAX_TEMPLATE_XPAIRS_INCREMENT;
+
+ ++num_reallocs;
+
+ tnxt = reallocate_integer_array( tnxt,
+ current_max_template_xpairs );
+ }
+
+ for ( i = 1; i <= numecs; ++i )
+ if ( state[i] == 0 )
+ tnxt[tmpbase + i] = 0;
+ else
+ {
+ transset[tsptr++] = i;
+ tnxt[tmpbase + i] = comstate;
+ }
+
+ if ( usemecs )
+ mkeccl( transset, tsptr, tecfwd, tecbck, numecs, 0 );
+
+ mkprot( tnxt + tmpbase, -numtemps, comstate );
+
+ /* We rely on the fact that mkprot adds things to the beginning
+ * of the proto queue.
+ */
+
+ numdiff = tbldiff( state, firstprot, tmp );
+ mkentry( tmp, numecs, statenum, -numtemps, numdiff );
+ }
+
+
+/* mv2front - move proto queue element to front of queue */
+
+void mv2front( qelm )
+int qelm;
+ {
+ if ( firstprot != qelm )
+ {
+ if ( qelm == lastprot )
+ lastprot = protprev[lastprot];
+
+ protnext[protprev[qelm]] = protnext[qelm];
+
+ if ( protnext[qelm] != NIL )
+ protprev[protnext[qelm]] = protprev[qelm];
+
+ protprev[qelm] = NIL;
+ protnext[qelm] = firstprot;
+ protprev[firstprot] = qelm;
+ firstprot = qelm;
+ }
+ }
+
+
+/* place_state - place a state into full speed transition table
+ *
+ * State is the statenum'th state. It is indexed by equivalence class and
+ * gives the number of the state to enter for a given equivalence class.
+ * Transnum is the number of out-transitions for the state.
+ */
+
+void place_state( state, statenum, transnum )
+int *state, statenum, transnum;
+ {
+ register int i;
+ register int *state_ptr;
+ int position = find_table_space( state, transnum );
+
+ /* "base" is the table of start positions. */
+ base[statenum] = position;
+
+ /* Put in action number marker; this non-zero number makes sure that
+ * find_table_space() knows that this position in chk/nxt is taken
+ * and should not be used for another accepting number in another
+ * state.
+ */
+ chk[position - 1] = 1;
+
+ /* Put in end-of-buffer marker; this is for the same purposes as
+ * above.
+ */
+ chk[position] = 1;
+
+ /* Place the state into chk and nxt. */
+ state_ptr = &state[1];
+
+ for ( i = 1; i <= numecs; ++i, ++state_ptr )
+ if ( *state_ptr != 0 )
+ {
+ chk[position + i] = i;
+ nxt[position + i] = *state_ptr;
+ }
+
+ if ( position + numecs > tblend )
+ tblend = position + numecs;
+ }
+
+
+/* stack1 - save states with only one out-transition to be processed later
+ *
+ * If there's room for another state on the "one-transition" stack, the
+ * state is pushed onto it, to be processed later by mk1tbl. If there's
+ * no room, we process the sucker right now.
+ */
+
+void stack1( statenum, sym, nextstate, deflink )
+int statenum, sym, nextstate, deflink;
+ {
+ if ( onesp >= ONE_STACK_SIZE - 1 )
+ mk1tbl( statenum, sym, nextstate, deflink );
+
+ else
+ {
+ ++onesp;
+ onestate[onesp] = statenum;
+ onesym[onesp] = sym;
+ onenext[onesp] = nextstate;
+ onedef[onesp] = deflink;
+ }
+ }
+
+
+/* tbldiff - compute differences between two state tables
+ *
+ * "state" is the state array which is to be extracted from the pr'th
+ * proto. "pr" is both the number of the proto we are extracting from
+ * and an index into the save area where we can find the proto's complete
+ * state table. Each entry in "state" which differs from the corresponding
+ * entry of "pr" will appear in "ext".
+ *
+ * Entries which are the same in both "state" and "pr" will be marked
+ * as transitions to "SAME_TRANS" in "ext". The total number of differences
+ * between "state" and "pr" is returned as function value. Note that this
+ * number is "numecs" minus the number of "SAME_TRANS" entries in "ext".
+ */
+
+int tbldiff( state, pr, ext )
+int state[], pr, ext[];
+ {
+ register int i, *sp = state, *ep = ext, *protp;
+ register int numdiff = 0;
+
+ protp = &protsave[numecs * (pr - 1)];
+
+ for ( i = numecs; i > 0; --i )
+ {
+ if ( *++protp == *++sp )
+ *++ep = SAME_TRANS;
+ else
+ {
+ *++ep = *sp;
+ ++numdiff;
+ }
+ }
+
+ return numdiff;
+ }
diff --git a/tools/Makefile.am b/tools/Makefile.am
new file mode 100644
index 0000000..46743a6
--- /dev/null
+++ b/tools/Makefile.am
@@ -0,0 +1,2 @@
+EXTRA_DIST = \
+ git2cl
diff --git a/tools/git2cl b/tools/git2cl
new file mode 100755
index 0000000..1c2ab3f
--- /dev/null
+++ b/tools/git2cl
@@ -0,0 +1,372 @@
+#!/usr/bin/perl
+
+# Copyright (C) 2007, 2008 Simon Josefsson <simon@josefsson.org>
+# Copyright (C) 2007 Luis Mondesi <lemsx1@gmail.com>
+# * calls git directly. To use it just:
+# cd ~/Project/my_git_repo; git2cl > ChangeLog
+# * implements strptime()
+# * fixes bugs in $comment parsing
+# - copy input before we remove leading spaces
+# - skip "merge branch" statements as they don't
+# have information about files (i.e. we never
+# go into $state 2)
+# - behaves like a pipe/filter if input is given from the CLI
+# else it calls git log by itself
+#
+# The functions mywrap, last_line_len, wrap_log_entry are derived from
+# the cvs2cl tool, see <http://www.red-bean.com/cvs2cl/>:
+# Copyright (C) 2001,2002,2003,2004 Martyn J. Pearce <fluffy@cpan.org>
+# Copyright (C) 1999 Karl Fogel <kfogel@red-bean.com>
+#
+# git2cl 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 2, or (at your option)
+# any later version.
+#
+# git2cl 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 git2cl; see the file COPYING. If not, write to the Free
+# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+use strict;
+use POSIX qw(strftime);
+use Text::Wrap qw(wrap);
+use FileHandle;
+
+use constant EMPTY_LOG_MESSAGE => '*** empty log message ***';
+
+# this is a helper hash for stptime.
+# Assumes you are calling 'git log ...' with LC_ALL=C
+my %month = (
+ 'Jan'=>0,
+ 'Feb'=>1,
+ 'Mar'=>2,
+ 'Apr'=>3,
+ 'May'=>4,
+ 'Jun'=>5,
+ 'Jul'=>6,
+ 'Aug'=>7,
+ 'Sep'=>8,
+ 'Oct'=>9,
+ 'Nov'=>10,
+ 'Dec'=>11,
+);
+
+my $fh = new FileHandle;
+
+sub key_ready
+{
+ my ($rin, $nfd);
+ vec($rin, fileno(STDIN), 1) = 1;
+ return $nfd = select($rin, undef, undef, 0);
+}
+
+sub strptime {
+ my $str = shift;
+ return undef if not defined $str;
+
+ # we are parsing this format
+ # Fri Oct 26 00:42:56 2007 -0400
+ # to these fields
+ # sec, min, hour, mday, mon, year, wday = -1, yday = -1, isdst = -1
+ # Luis Mondesi <lemsx1@gmail.com>
+ my @date;
+ if ($str =~ /([[:alpha:]]{3})\s+([[:alpha:]]{3})\s+([[:digit:]]{1,2})\s+([[:digit:]]{1,2}):([[:digit:]]{1,2}):([[:digit:]]{1,2})\s+([[:digit:]]{4})/){
+ push(@date,$6,$5,$4,$3,$month{$2},($7 - 1900),-1,-1,-1);
+ } else {
+ die ("Cannot parse date '$str'\n'");
+ }
+ return @date;
+}
+
+sub mywrap {
+ my ($indent1, $indent2, @text) = @_;
+ # If incoming text looks preformatted, don't get clever
+ my $text = Text::Wrap::wrap($indent1, $indent2, @text);
+ if ( grep /^\s+/m, @text ) {
+ return $text;
+ }
+ my @lines = split /\n/, $text;
+ $indent2 =~ s!^((?: {8})+)!"\t" x (length($1)/8)!e;
+ $lines[0] =~ s/^$indent1\s+/$indent1/;
+ s/^$indent2\s+/$indent2/
+ for @lines[1..$#lines];
+ my $newtext = join "\n", @lines;
+ $newtext .= "\n"
+ if substr($text, -1) eq "\n";
+ return $newtext;
+}
+
+sub last_line_len {
+ my $files_list = shift;
+ my @lines = split (/\n/, $files_list);
+ my $last_line = pop (@lines);
+ return length ($last_line);
+}
+
+# A custom wrap function, sensitive to some common constructs used in
+# log entries.
+sub wrap_log_entry {
+ my $text = shift; # The text to wrap.
+ my $left_pad_str = shift; # String to pad with on the left.
+
+ # These do NOT take left_pad_str into account:
+ my $length_remaining = shift; # Amount left on current line.
+ my $max_line_length = shift; # Amount left for a blank line.
+
+ my $wrapped_text = ''; # The accumulating wrapped entry.
+ my $user_indent = ''; # Inherited user_indent from prev line.
+
+ my $first_time = 1; # First iteration of the loop?
+ my $suppress_line_start_match = 0; # Set to disable line start checks.
+
+ my @lines = split (/\n/, $text);
+ while (@lines) # Don't use `foreach' here, it won't work.
+ {
+ my $this_line = shift (@lines);
+ chomp $this_line;
+
+ if ($this_line =~ /^(\s+)/) {
+ $user_indent = $1;
+ }
+ else {
+ $user_indent = '';
+ }
+
+ # If it matches any of the line-start regexps, print a newline now...
+ if ($suppress_line_start_match)
+ {
+ $suppress_line_start_match = 0;
+ }
+ elsif (($this_line =~ /^(\s*)\*\s+[a-zA-Z0-9]/)
+ || ($this_line =~ /^(\s*)\* [a-zA-Z0-9_\.\/\+-]+/)
+ || ($this_line =~ /^(\s*)\([a-zA-Z0-9_\.\/\+-]+(\)|,\s*)/)
+ || ($this_line =~ /^(\s+)(\S+)/)
+ || ($this_line =~ /^(\s*)- +/)
+ || ($this_line =~ /^()\s*$/)
+ || ($this_line =~ /^(\s*)\*\) +/)
+ || ($this_line =~ /^(\s*)[a-zA-Z0-9](\)|\.|\:) +/))
+ {
+ $length_remaining = $max_line_length - (length ($user_indent));
+ }
+
+ # Now that any user_indent has been preserved, strip off leading
+ # whitespace, so up-folding has no ugly side-effects.
+ $this_line =~ s/^\s*//;
+
+ # Accumulate the line, and adjust parameters for next line.
+ my $this_len = length ($this_line);
+ if ($this_len == 0)
+ {
+ # Blank lines should cancel any user_indent level.
+ $user_indent = '';
+ $length_remaining = $max_line_length;
+ }
+ elsif ($this_len >= $length_remaining) # Line too long, try breaking it.
+ {
+ # Walk backwards from the end. At first acceptable spot, break
+ # a new line.
+ my $idx = $length_remaining - 1;
+ if ($idx < 0) { $idx = 0 };
+ while ($idx > 0)
+ {
+ if (substr ($this_line, $idx, 1) =~ /\s/)
+ {
+ my $line_now = substr ($this_line, 0, $idx);
+ my $next_line = substr ($this_line, $idx);
+ $this_line = $line_now;
+
+ # Clean whitespace off the end.
+ chomp $this_line;
+
+ # The current line is ready to be printed.
+ $this_line .= "\n${left_pad_str}";
+
+ # Make sure the next line is allowed full room.
+ $length_remaining = $max_line_length - (length ($user_indent));
+
+ # Strip next_line, but then preserve any user_indent.
+ $next_line =~ s/^\s*//;
+
+ # Sneak a peek at the user_indent of the upcoming line, so
+ # $next_line (which will now precede it) can inherit that
+ # indent level. Otherwise, use whatever user_indent level
+ # we currently have, which might be none.
+ my $next_next_line = shift (@lines);
+ if ((defined ($next_next_line)) && ($next_next_line =~ /^(\s+)/)) {
+ $next_line = $1 . $next_line if (defined ($1));
+ # $length_remaining = $max_line_length - (length ($1));
+ $next_next_line =~ s/^\s*//;
+ }
+ else {
+ $next_line = $user_indent . $next_line;
+ }
+ if (defined ($next_next_line)) {
+ unshift (@lines, $next_next_line);
+ }
+ unshift (@lines, $next_line);
+
+ # Our new next line might, coincidentally, begin with one of
+ # the line-start regexps, so we temporarily turn off
+ # sensitivity to that until we're past the line.
+ $suppress_line_start_match = 1;
+
+ last;
+ }
+ else
+ {
+ $idx--;
+ }
+ }
+
+ if ($idx == 0)
+ {
+ # We bottomed out because the line is longer than the
+ # available space. But that could be because the space is
+ # small, or because the line is longer than even the maximum
+ # possible space. Handle both cases below.
+
+ if ($length_remaining == ($max_line_length - (length ($user_indent))))
+ {
+ # The line is simply too long -- there is no hope of ever
+ # breaking it nicely, so just insert it verbatim, with
+ # appropriate padding.
+ $this_line = "\n${left_pad_str}${this_line}";
+ }
+ else
+ {
+ # Can't break it here, but may be able to on the next round...
+ unshift (@lines, $this_line);
+ $length_remaining = $max_line_length - (length ($user_indent));
+ $this_line = "\n${left_pad_str}";
+ }
+ }
+ }
+ else # $this_len < $length_remaining, so tack on what we can.
+ {
+ # Leave a note for the next iteration.
+ $length_remaining = $length_remaining - $this_len;
+
+ if ($this_line =~ /\.$/)
+ {
+ $this_line .= " ";
+ $length_remaining -= 2;
+ }
+ else # not a sentence end
+ {
+ $this_line .= " ";
+ $length_remaining -= 1;
+ }
+ }
+
+ # Unconditionally indicate that loop has run at least once.
+ $first_time = 0;
+
+ $wrapped_text .= "${user_indent}${this_line}";
+ }
+
+ # One last bit of padding.
+ $wrapped_text .= "\n";
+
+ return $wrapped_text;
+}
+
+# main
+
+my @date;
+my $author;
+my @files;
+my $comment;
+
+my $state; # 0-header 1-comment 2-files
+my $done = 0;
+
+$state = 0;
+
+# if reading from STDIN, we assume that we are
+# getting git log as input
+if (key_ready())
+{
+
+ #my $dummyfh; # don't care about writing
+ #($fh,$dummyfh) = FileHandle::pipe;
+ $fh->fdopen(*STDIN, 'r');
+}
+else
+{
+ $fh->open("LC_ALL=C git log --pretty --numstat --summary|")
+ or die("Cannot execute git log...$!\n");
+}
+
+while (my $_l = <$fh>) {
+ #print STDERR "debug ($state, " . (@date ? (strftime "%Y-%m-%d", @date) : "") . "): `$_'\n";
+ if ($state == 0) {
+ if ($_l =~ m,^Author: (.*),) {
+ $author = $1;
+ }
+ if ($_l =~ m,^Date: (.*),) {
+ @date = strptime($1);
+ }
+ $state = 1 if ($_l =~ m,^$, and $author and (@date+0>0));
+ } elsif ($state == 1) {
+ # * modifying our input text is a bad choice
+ # let's make a copy of it first, then we remove spaces
+ # * if we meet a "merge branch" statement, we need to start
+ # over and find a real entry
+ # Luis Mondesi <lemsx1@gmail.com>
+ my $_s = $_l;
+ $_s =~ s/^ //g;
+ if ($_s =~ m/^Merge branch/)
+ {
+ $state=0;
+ next;
+ }
+ $comment = $comment . $_s;
+ $state = 2 if ($_l =~ m,^$,);
+ } elsif ($state == 2) {
+ if ($_l =~ m,^([0-9]+)\t([0-9]+)\t(.*)$,) {
+ push @files, $3;
+ }
+ $done = 1 if ($_l =~ m,^$,);
+ }
+
+ if ($done) {
+ print (strftime "%Y-%m-%d $author\n\n", @date);
+
+ my $files = join (", ", @files);
+ $files = mywrap ("\t", "\t", "* $files"), ": ";
+
+ if (index($comment, EMPTY_LOG_MESSAGE) > -1 ) {
+ $comment = "[no log message]\n";
+ }
+
+ my $files_last_line_len = 0;
+ $files_last_line_len = last_line_len($files) + 1;
+ my $msg = wrap_log_entry($comment, "\t", 69-$files_last_line_len, 69);
+
+ $msg =~ s/[ \t]+\n/\n/g;
+
+ print "$files: $msg\n";
+
+ @date = ();
+ $author = "";
+ @files = ();
+ $comment = "";
+
+ $state = 0;
+ $done = 0;
+ }
+}
+
+if (@date + 0)
+{
+ print (strftime "%Y-%m-%d $author\n\n", @date);
+ my $msg = wrap_log_entry($comment, "\t", 69, 69);
+ $msg =~ s/[ \t]+\n/\n/g;
+ print "\t* $msg\n";
+}