-*.o
-re2c
-re2c.1
-re2c.ad
-re2c.spec
-.deps
-autom4te.cache
+autom4te.cache/
+Makefile.in
+aclocal.m4
configure
install-sh
-/README
-aclocal.m4
-Makefile
-Makefile.in
config.h.in
-config.status
-config.log
-config.sub
-config.guess
-config_w32.h
-config.h
depcomp
-compile
-makerpm
missing
-mkinstalldirs
-stamp-h
-stamp-h1
-stamp-h.in
-parser.cc
-scanner.cc
-y.tab.h
-run_tests.sh
+test-driver
# $Id$
+AM_CXXFLAGS = -W -Wall -Wextra -pedantic -Wredundant-decls -DPEDANTIC -O2
+AM_YFLAGS = -y -d --no-lines
+RE2CFLAGS = -bi
+
bin_PROGRAMS = re2c
-win_BINARIES = $(WINBUILDDIR)/re2c.exe
-re2c_SOURCES = code.cc code_names.cc dfa.cc go_construct.cc go_destruct.cc go_emit.cc go_used_labels.cc \
- main.cc parser.cc actions.cc scanner.re substr.cc range.cc \
- translate.cc scanner.cc skeleton.cc mbo_getopt.cc print.cc input.cc input_api.cc output.cc \
- enc.cc utf8.cc utf8_range.cc utf8_regexp.cc utf16.cc utf16_range.cc utf16_regexp.cc range_suffix.cc \
- code.h code_names.h dfa.h go.h enc.h indent.h input.h input_api.h free_list.h globals.h ins.h \
- mbo_getopt.h parser.h print.h range.h range_suffix.h re.h \
- scanner.h skeleton.h smart_ptr.h substr.h token.h output.h \
- utf16.h utf16_range.h utf16_regexp.h utf8.h utf8_range.h utf8_regexp.h
-BUILT_SOURCES = parser.cc scanner.cc
-
-#CXXFLAGS = -O2 -Wall -Wno-unused -Wno-parentheses -Wno-deprecated
-#CXXFLAGS = -ggdb -fno-inline -O2 -Wall -Wextra -pedantic -Wconversion -Wpointer-arith -Wwrite-strings -Wredundant-decls -Werror -Wunused-function -DPEDANTIC
-CXXFLAGS += -O2
-CXXFLAGS += -W -Wall -Wextra -pedantic -Wredundant-decls -DPEDANTIC
-YFLAGS = -y -d --no-lines
-
-RE2C = re2c$(EXEEXT)
-RE2CFLAGS = -bi
-
-CLEANFILES = parser.cc y.tab.c y.tab.h scanner.cc .version
-
-DISTCLEANFILES = makerpm re2c.spec README scanner.cc re2c$(EXEEXT)
-
-man_MANS = re2c.1
-DOCS = $(man_MANS) htdocs/manual.html
-
-EXTRA_SRC = README parser.y scanner.re y.tab.h CHANGELOG NO_WARRANTY \
- doc examples test bootstrap/*.cc bootstrap/*.h bootstrap/re2c.1 lessons \
- $(DOCS)
-EXTRA_DIST = $(EXTRA_SRC) makerpm.in re2c.spec.in re2c.spec README.in config_w32.h.in
-EXTRA_ZIP = $(EXTRA_SRC) config_w32.h re2c.rules
-
-dist-hook: re2c.spec
- rm -rf `find $(distdir)/doc -name .git`
- rm -rf `find $(distdir)/examples -name .git`
- rm -rf `find $(distdir)/test -name .git -o -name .gitignore`
- rm -rf `find $(distdir)/lessons -name .git -o -name .gitignore`
-
-rpm-files: $(bin_PROGRAMS) $(EXTRA_DIST)
-
-rpm: dist
- cp -f re2c-$(PACKAGE_VERSION).tar.gz `rpm --eval "%{_sourcedir}"`
- cp -f re2c.spec `rpm --eval "%{_specdir}"`
- rpmbuild -ba re2c.spec
-
-src-rpm: dist
- cp -f re2c-$(PACKAGE_VERSION).tar.gz `rpm --eval "%{_sourcedir}"`
- cp -f re2c.spec `rpm --eval "%{_specdir}"`
- rpmbuild -bs re2c.spec
- cp -f `rpm --eval "%{_srcrpmdir}"`/re2c-$(PACKAGE_VERSION)-$(PACKAGE_RELEASE).src.rpm .
-
-zip: $(bin_PROGRAMS) $(EXTRA_ZIP)
- if test -f re2c-$(PACKAGE_VERSION)-src.zip; then rm -f re2c-$(PACKAGE_VERSION)-src.zip; fi
- zip -q -o -9 -r re2c-$(PACKAGE_VERSION)-src.zip $(re2c_SOURCES) $(EXTRA_ZIP)
- zipinfo -1 re2c-$(PACKAGE_VERSION)-src.zip | grep .git | xargs zip -d re2c-$(PACKAGE_VERSION)-src.zip >/dev/null
- if test -f re2c-$(PACKAGE_VERSION)-bin.zip; then rm -f re2c-$(PACKAGE_VERSION)-bin.zip; fi
- if test -f $(WINBUILDDIR)/re2c.exe; then \
- zip -q -o -9 -j re2c-$(PACKAGE_VERSION)-bin.zip $(win_BINARIES); \
- fi;
-
-release: dist zip src-rpm
-
-parser.cc: $(top_srcdir)/parser.y
- @if test $(BISON) = "yes"; then \
- bison $(YFLAGS) --output=$(top_srcdir)/parser.cc --defines=$(top_srcdir)/y.tab.h $(top_srcdir)/parser.y && \
- cp -f $(top_srcdir)/parser.cc $(top_srcdir)/bootstrap/parser.cc; \
- cp -f $(top_srcdir)/y.tab.h $(top_srcdir)/bootstrap/y.tab.h; \
+RE2C = $(builddir)/re2c$(EXEEXT)
+
+# scanner
+SRC_SCANNER = $(srcdir)/src/scanner.re
+AUTOGEN_SCANNER = $(builddir)/scanner.cc
+BOOTSTRAP_SCANNER = $(srcdir)/bootstrap/scanner.cc
+
+# parser
+SRC_PARSER = $(srcdir)/src/parser.ypp
+AUTOGEN_PARSER = $(builddir)/parser.cc
+AUTOGEN_PARSER_HDR = $(builddir)/y.tab.h
+BOOTSTRAP_PARSER = $(srcdir)/bootstrap/parser.cc
+BOOTSTRAP_PARSER_HDR = $(srcdir)/bootstrap/y.tab.h
+
+# docs
+DOC_MAN = $(builddir)/doc/re2c.1
+DOC_HTML = $(builddir)/doc/manual.html
+SRC_DOC = $(builddir)/doc/re2c.ad
+BOOTSTRAP_DOC_MAN = $(srcdir)/bootstrap/re2c.1
+BOOTSTRAP_DOC_HTML = $(srcdir)/bootstrap/manual.html
+
+SRC_HDR = \
+ $(srcdir)/src/c99_stdint.h \
+ $(srcdir)/src/code.h \
+ $(srcdir)/src/code_names.h \
+ $(srcdir)/src/dfa.h \
+ $(srcdir)/src/enc.h \
+ $(srcdir)/src/globals.h \
+ $(srcdir)/src/go.h \
+ $(srcdir)/src/indent.h \
+ $(srcdir)/src/input.h \
+ $(srcdir)/src/input_api.h \
+ $(srcdir)/src/ins.h \
+ $(srcdir)/src/free_list.h \
+ $(srcdir)/src/mbo_getopt.h \
+ $(srcdir)/src/output.h \
+ $(srcdir)/src/parser.h \
+ $(srcdir)/src/print.h \
+ $(srcdir)/src/range.h \
+ $(srcdir)/src/range_suffix.h \
+ $(srcdir)/src/re.h \
+ $(srcdir)/src/scanner.h \
+ $(srcdir)/src/skeleton.h \
+ $(srcdir)/src/smart_ptr.h \
+ $(srcdir)/src/substr.h \
+ $(srcdir)/src/token.h \
+ $(srcdir)/src/utf16.h \
+ $(srcdir)/src/utf16_range.h \
+ $(srcdir)/src/utf16_regexp.h \
+ $(srcdir)/src/utf8.h \
+ $(srcdir)/src/utf8_range.h \
+ $(srcdir)/src/utf8_regexp.h
+
+SRC = \
+ $(SRC_SCANNER) \
+ $(srcdir)/src/actions.cc \
+ $(srcdir)/src/code.cc \
+ $(srcdir)/src/code_names.cc \
+ $(srcdir)/src/dfa.cc \
+ $(srcdir)/src/enc.cc \
+ $(srcdir)/src/go_construct.cc \
+ $(srcdir)/src/go_destruct.cc \
+ $(srcdir)/src/go_emit.cc \
+ $(srcdir)/src/go_used_labels.cc \
+ $(srcdir)/src/input.cc \
+ $(srcdir)/src/input_api.cc \
+ $(srcdir)/src/main.cc \
+ $(srcdir)/src/mbo_getopt.cc \
+ $(srcdir)/src/output.cc \
+ $(srcdir)/src/print.cc \
+ $(srcdir)/src/range.cc \
+ $(srcdir)/src/range_suffix.cc \
+ $(srcdir)/src/skeleton.cc \
+ $(srcdir)/src/substr.cc \
+ $(srcdir)/src/translate.cc \
+ $(srcdir)/src/utf8.cc \
+ $(srcdir)/src/utf8_range.cc \
+ $(srcdir)/src/utf8_regexp.cc \
+ $(srcdir)/src/utf16.cc \
+ $(srcdir)/src/utf16_range.cc \
+ $(srcdir)/src/utf16_regexp.cc
+# omit SRC_PARSER here; include it in EXTRA_DIST instead
+# (automake generates standard build rules for all YACC-ish
+# sources, they will conflict with our custom build rule).
+
+AUTOGEN = \
+ $(AUTOGEN_PARSER) \
+ $(AUTOGEN_PARSER_HDR) \
+ $(AUTOGEN_SCANNER)
+
+BOOTSTRAP = \
+ $(BOOTSTRAP_DOC_HTML) \
+ $(BOOTSTRAP_DOC_MAN) \
+ $(BOOTSTRAP_PARSER) \
+ $(BOOTSTRAP_PARSER_HDR) \
+ $(BOOTSTRAP_SCANNER)
+
+re2c_SOURCES = \
+ $(SRC_HDR) \
+ $(SRC)
+nodist_re2c_SOURCES = $(AUTOGEN)
+
+EXTRA_DIST = \
+ $(BOOTSTRAP) \
+ $(SRC_PARSER) \
+ $(srcdir)/CHANGELOG \
+ $(srcdir)/NO_WARRANTY \
+ $(srcdir)/README \
+ $(srcdir)/autogen.sh \
+ $(srcdir)/doc/index.html \
+ $(srcdir)/doc/loplas.ps \
+ $(srcdir)/doc/sample.bib \
+ $(srcdir)/examples \
+ $(srcdir)/test
+
+CLEANFILES = \
+ $(AUTOGEN) \
+ $(DOC_HTML) \
+ $(DOC_MAN)
+
+TESTS = $(builddir)/run_tests.sh
+
+man_MANS = $(DOC_MAN)
+
+$(AUTOGEN_PARSER): $(SRC_PARSER)
+ @if test $(BISON) = "yes"; \
+ then \
+ bison $(YFLAGS) --output=$(AUTOGEN_PARSER) --defines=$(AUTOGEN_PARSER_HDR) $(SRC_PARSER) && \
+ cp $(AUTOGEN_PARSER) $(BOOTSTRAP_PARSER) && \
+ cp $(AUTOGEN_PARSER_HDR) $(BOOTSTRAP_PARSER_HDR); \
else \
- cp -f $(top_srcdir)/bootstrap/parser.cc $(top_srcdir)/parser.cc; \
- cp -f $(top_srcdir)/bootstrap/y.tab.h $(top_srcdir)/y.tab.h; \
+ cp $(BOOTSTRAP_PARSER) $(AUTOGEN_PARSER) && \
+ cp $(BOOTSTRAP_PARSER_HDR) $(AUTOGEN_PARSER_HDR); \
fi
-scanner.cc: $(top_srcdir)/scanner.re
- @if test -x ./re2c$(EXEEXT); then \
- echo "re2c $(RE2CFLAGS) -o $@ $(top_srcdir)/scanner.re"; \
- ./re2c $(RE2CFLAGS) -o $@ $(top_srcdir)/scanner.re && cp $@ $(top_srcdir)/bootstrap/; \
+$(AUTOGEN_SCANNER): $(SRC_SCANNER)
+ @if test -x $(RE2C); \
+ then \
+ $(RE2C) $(RE2CFLAGS) -o $(AUTOGEN_SCANNER) $(SRC_SCANNER) && \
+ cp $(AUTOGEN_SCANNER) $(BOOTSTRAP_SCANNER); \
else \
- echo "cp -f $(top_srcdir)/bootstrap/$@ $@"; \
- cp -f $(top_srcdir)/bootstrap/$@ $@; \
+ cp $(BOOTSTRAP_SCANNER) $(AUTOGEN_SCANNER); \
fi
-.version:
- echo $(PACKAGE_VERSION) > .version
-
-TESTS = run_tests.sh
+# rebuild lexer (just in case it was bootstrapped) and rebuild re2c
+.PHONY: bootstrap
+bootstrap: all
+ rm $(AUTOGEN_SCANNER)
+ $(RE2C) $(RE2CFLAGS) -o $(AUTOGEN_SCANNER) $(SRC_SCANNER)
+ cp $(AUTOGEN_SCANNER) $(BOOTSTRAP_SCANNER)
+ make all
+.PHONY: tests
tests: all $(TESTS)
- test -x $(TESTS) || chmod +x $(TESTS)
./$(TESTS)
-
+.PHONY: vtests
vtests: all $(TESTS)
- test -x $(TESTS) || chmod +x $(TESTS)
./$(TESTS) --valgrind
+.PHONY: docs
if REBUILD_DOCS
-docs: $(DOCS)
-$(DOCS): re2c.ad
- a2x -f manpage re2c.ad
- mkdir -p htdocs
- asciidoc -o htdocs/manual.html re2c.ad
+docs: $(DOC_MAN) $(DOC_HTML)
+$(DOC_MAN): $(SRC_DOC)
+ a2x -f manpage $(SRC_DOC)
+ cp $(DOC_MAN) $(BOOTSTRAP_DOC_MAN)
+$(DOC_HTML): $(SRC_DOC)
+ asciidoc -o $(DOC_HTML) $(SRC_DOC)
+ cp $(DOC_HTML) $(BOOTSTRAP_DOC_HTML)
else
-docs: $(DOCS)
-$(DOCS): $(top_srcdir)/bootstrap/re2c.1
+docs: $(DOC_MAN) $(DOC_HTML)
@echo "Reconfigure to rebuild docs: ./configure --enable-docs"
- cp $(top_srcdir)/bootstrap/re2c.1 $(top_srcdir)/re2c.1
+$(DOC_MAN): $(BOOTSTRAP_DOC_MAN)
+ cp $(BOOTSTRAP_DOC_MAN) $(DOC_MAN)
+$(DOC_HTML): $(BOOTSTRAP_DOC_HTML)
+ cp $(BOOTSTRAP_DOC_HTML) $(DOC_HTML)
endif
+
+all-local: docs
--- /dev/null
+re2c
+--------------------------------------------------------------------------------
+
+
+DESCRIPTION
+--------------------------------------------------------------------------------
+re2c is a tool for generating C-based recognizers from regular expressions.
+re2c-based scanners are efficient: for programming languages, given similar
+specifications, a re2c-based scanner is typically almost twice as fast as a
+flex-based scanner with little or no increase in size (possibly a decrease
+on cisc architectures). Indeed, re2c-based scanners are quite competitive with
+hand-crafted ones.
+
+Unlike flex, re2c does not generate complete scanners: the user must supply some
+interface code. While this code is not bulky (about 50-100 lines for a
+flex-like scanner; see the man page and examples in the distribution) careful
+coding is required for efficiency (and correctness). One advantage of this
+arrangement is that the generated code is not tied to any particular input
+model.
+--------------------------------------------------------------------------------
+
+
+DOWNLOAD
+--------------------------------------------------------------------------------
+The re2c distribution can be found at:
+ https://sourceforge.net/projects/re2c/
+
+Download the latest tarball:
+ https://sourceforge.net/projects/re2c/files/latest/download
+
+Clone git repo:
+ git clone git://git.code.sf.net/p/re2c/code-git
+--------------------------------------------------------------------------------
+
+
+BUILD
+--------------------------------------------------------------------------------
+Simplest possible build:
+ $ ./configure [--prefix=<prefix>]
+ $ make
+ $ make install
+This will build re2c and install it (binary and man page) to <prefix> (defaults
+to /usr/local).
+
+Bootstrap and rebuild:
+ $ ./configure [--prefix=<prefix>]
+ $ make bootstrap
+ $ make install
+Usual bootstrap procedure: re2c uses re2c to compile its lexer.
+1. build lexer (if make finds re2c binary in build directory, it will build lexer
+ from source, otherwize it will use prebuilt lexer 'bootstrap/scanner.cc')
+2. build re2c
+3. build lexer from source using re2c binary in build directory
+4. rebuild re2c
+
+Out-of-source build:
+ $ mkdir <build-directory>
+ $ cd <build-directory>
+ $ <path-to-configure>/configure [--prefix=<prefix>]
+ $ make
+ $ make install
+
+Testing:
+ $ make check
+This will redirect test script output to file. If you want to see progress:
+ $ make tests
+Testing under valgrind (takes a long time):
+ $ make vtests
+
+Rebuild documentation (requires asciidoc and a2x):
+ $ ./configure --enable-docs [--prefix=<prefix>]
+ $ make docs
+ $ make install
+
+If you want to build from git, you'll first need to generate autotools files:
+ $ ./autogen.sh
+--------------------------------------------------------------------------------
+
+
+INFO
+--------------------------------------------------------------------------------
+ $ man re2c
+
+re2c home page:
+ re2c.org
+
+re2c manual:
+ re2c.org/manual.html
+
+Ulya Trofimovich's blog on re2c:
+ skvadrik.github.io/aleph_null/re2c.html
+
+Original paper on re2c: "RE2C: a More Versatile Parser Generator" (1994, Peter
+Bumbulis and Donald D. Cowan).
+
+Examples can be found in 'examples' directory.
+--------------------------------------------------------------------------------
+
+
+MAILING LISTS
+--------------------------------------------------------------------------------
+re2c-general:
+ re2c-general@lists.sourceforge.net
+re2c-devel:
+ re2c-devel@lists.sourceforge.net
+
+You are welcome to ask for help or share your thoughts and ideas about re2c :)
+--------------------------------------------------------------------------------
+
+
+BUGS
+--------------------------------------------------------------------------------
+Please report any bugs and send feature requests to:
+ https://sourceforge.net/p/re2c/_list/tickets
+--------------------------------------------------------------------------------
+
+
+AUTHORS
+--------------------------------------------------------------------------------
+Originally written by Peter Bumbulis (peter@csg.uwaterloo.ca)
+Currently maintained by:
+ Ulya Trofimovich <skvadrik@gmail.com>
+ Dan Nuffer <nuffer@users.sourceforge.net>
+ Marcus Boerger <helly@users.sourceforge.net>
+ Hartmut Kaiser <hkaiser@users.sourceforge.net>
+--------------------------------------------------------------------------------
+
+
+LICENSE
+--------------------------------------------------------------------------------
+re2c is distributed with no warranty whatever. The code is certain to contain
+errors. Neither the author nor any contributor takes responsibility for any
+consequences of its use.
+
+re2c is in the public domain. The data structures and algorithms used in re2c
+are all either taken from documents available to the general public or are
+inventions of the authors. Programs generated by re2c may be distributed freely.
+re2c itself may be distributed freely, in source or binary, unchanged or
+modified. Distributors may charge whatever fees they can obtain for re2c.
+
+If you do make use of re2c, or incorporate it into a larger project an
+acknowledgement somewhere (documentation, research report, etc.) would be
+appreciated.
+--------------------------------------------------------------------------------
+++ /dev/null
-re2c Version @PACKAGE_VERSION@
-------------------
-
-Originally written by Peter Bumbulis (peter@csg.uwaterloo.ca)
-
-Currently maintained by:
- Dan Nuffer <nuffer at users.sourceforge.net>
- Marcus Boerger <helly at users.sourceforge.net>
- Hartmut Kaiser <hkaiser at users.sourceforge.net>
-
-The re2c distribution can be found at:
-
- http://sourceforge.net/projects/re2c/
-
-re2c has been developed and tested with the following compilers on various
-platforms in 32 bit and 64 bit mode:
-- GCC 3.3 ... 4.1
-- Microsoft VC 7, 7.1, 8
-- Intel 9.0
-- Sun C++ 5.8 (CXXFLAGS='-library=stlport4')
-- MIPSpro Compilers: Version 7.4.4m
-
-GCC 2.x and Microsoft VC 6 are not capable of compiling re2c.
-
-Building re2c on unix like platforms requires autoconf 2.57 and bison (tested
-with 1.875 and later). Under windows you don't need autoconf or bison
-and can use the pregenerated files.
-
-You can build this software by simply typing the following commands:
- ./configure
- make
-
-The above version will be based on the pregenerated scanner.cc file.
-If you want to build that file yourself (recommended when installing
-re2c) you need the following steps:
- ./configure
- make
- rm -f scanner.cc
- make install
-
-Or you can create a rpm package and install it by the following commands:
- ./configure
- make rpm
- rpm -Uhv <packagedir>/re2c-@PACKAGE_VERSION@-@PACKAGE_RELEASE@.rpm
-
-If you want to build from CVS then the first thing you should do is
-regenerating all build files using the following command:
- ./autogen.sh
-and then continue with one of the above described build methods. Or if you
-need to generate RPM packages for cvs builds use these commands:
- ./autogen.sh
- ./configure
- ./makerpm <release>
- rpm -Uhv <packagedir>/re2c-@PACKAGE_VERSION@-<release>.rpm
-
-Here <realease> should be a number like 1. And <packagedir> must equal
-the directory where the makerpm step has written the generated rpm to.
-
-If you are on a debian system you can use the tool 'alien' to convert rpms
-to debian packages.
-
-When building with native SUN compilers you need to set the following compiler
-flags: CXXFLAGS='-g -compat5 -library=stlport4'.
-
-If you want to build re2c on a windows system you can either use cygwin and one
-of the methods described above or use Microsoft Visual C .NET 2002 or later
-with the solution files provided (re2c.sln for 2002/2003 and re2c-2005.sln for
-version 2005). re2c cannot be built with Microsoft Visual C 6.0 or earlier.
-
-Using Visual Studio 2005 you can automate handling of .re files by adding the
-custom build rules file (re2c.rules) to your project. Just load your Visual
-C++ project in Visual Studio, select "Custom Build Rules..." from its context
-menu, and add re2c.rules to the list with the "Find Existing..." button.
-Activate the check mark, and you are done! Any .re files you add to the project
-will now automatically be built with re2c. Of course, re2c.exe also has to be
-available in your environment for this to work. With the rules active Visual
-Studio will automatically recognize .re files and compile then with re2c. The
-output file has the same name as the input file but with the .cpp extension.
-This, and all other re2c compiler settings, are fully configurable from within
-the Visual Studio IDE. Just right-click on the .re file in Visual Studio, go
-to the properties dialog, and pick your options.
-
-To build documentation you'll need 'asciidoc':
- make docs
-
-re2c is a great tool for writing fast and flexible lexers. It has
-served many people well for many years. re2c is on the order of 2-3
-times faster than a flex based scanner, and its input model is much
-more flexible.
-
-For an introduction to re2c refer to the lessons sub directory.
-
-Peter's original version 0.5 ANNOUNCE and README follows.
-
---
-
-re2c is a tool for generating C-based recognizers from regular
-expressions. re2c-based scanners are efficient: for programming
-languages, given similar specifications, an re2c-based scanner is
-typically almost twice as fast as a flex-based scanner with little or no
-increase in size (possibly a decrease on cisc architectures). Indeed,
-re2c-based scanners are quite competitive with hand-crafted ones.
-
-Unlike flex, re2c does not generate complete scanners: the user must
-supply some interface code. While this code is not bulky (about 50-100
-lines for a flex-like scanner; see the man page and examples in the
-distribution) careful coding is required for efficiency (and
-correctness). One advantage of this arrangement is that the generated
-code is not tied to any particular input model. For example, re2c
-generated code can be used to scan data from a null-byte terminated
-buffer as illustrated below.
-
-Given the following source
-
- #define NULL ((char*) 0)
- char *scan(char *p)
- {
- #define YYCTYPE char
- #define YYCURSOR p
- #define YYLIMIT p
- #define YYFILL(n)
- /*!re2c
- [0-9]+ {return YYCURSOR;}
- [\000-\377] {return NULL;}
- */
- }
-
-re2c will generate
-
- /* Generated by re2c on Sat Apr 16 11:40:58 1994 */
- #line 1 "simple.re"
- #define NULL ((char*) 0)
- char *scan(char *p)
- {
- #define YYCTYPE char
- #define YYCURSOR p
- #define YYLIMIT p
- #define YYFILL(n)
- {
- YYCTYPE yych;
- unsigned int yyaccept;
-
- if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
- yych = *YYCURSOR;
- if(yych <= '/') goto yy4;
- if(yych >= ':') goto yy4;
- yy2: yych = *++YYCURSOR;
- goto yy7;
- yy3:
- #line 9
- {return YYCURSOR;}
- yy4: yych = *++YYCURSOR;
- yy5:
- #line 10
- {return NULL;}
- yy6: ++YYCURSOR;
- if(YYLIMIT == YYCURSOR) YYFILL(1);
- yych = *YYCURSOR;
- yy7: if(yych <= '/') goto yy3;
- if(yych <= '9') goto yy6;
- goto yy3;
- }
- #line 11
-
- }
-
-Note that most compilers will perform dead-code elimination to remove
-all YYCURSOR, YYLIMIT comparisions.
-
-re2c was developed for a particular project (constructing a fast REXX
-scanner of all things!) and so while it has some rough edges, it should
-be quite usable. More information about re2c can be found in the
-(admittedly skimpy) man page; the algorithms and heuristics used are
-described in an upcoming LOPLAS article (included in the distribution).
-Probably the best way to find out more about re2c is to try the supplied
-examples. re2c is written in C++, and is currently being developed
-under Linux using gcc 2.5.8.
-
-Peter
-
---
-
-re2c is distributed with no warranty whatever. The code is certain to
-contain errors. Neither the author nor any contributor takes
-responsibility for any consequences of its use.
-
-re2c is in the public domain. The data structures and algorithms used
-in re2c are all either taken from documents available to the general
-public or are inventions of the author. Programs generated by re2c may
-be distributed freely. re2c itself may be distributed freely, in source
-or binary, unchanged or modified. Distributors may charge whatever fees
-they can obtain for re2c.
-
-If you do make use of re2c, or incorporate it into a larger project an
-acknowledgement somewhere (documentation, research report, etc.) would
-be appreciated.
-
-Please send bug reports and feedback (including suggestions for
-improving the distribution) to
-
- peter@csg.uwaterloo.ca
-
-Include a small example and the banner from parser.y with bug reports.
-
#!/bin/sh
+
git clean -fXd
-aclocal
-autoheader
-automake -a -c --foreign
-autoconf
+
+aclocal -W all
+autoheader -W all
+automake -W all -a -c --foreign
+autoconf -W all
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"\r
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">\r
+<head>\r
+<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />\r
+<meta name="generator" content="AsciiDoc 8.6.9" />\r
+<title>RE2C (1)</title>\r
+<style type="text/css">\r
+/* Shared CSS for AsciiDoc xhtml11 and html5 backends */\r
+\r
+/* Default font. */\r
+body {\r
+ font-family: Georgia,serif;\r
+}\r
+\r
+/* Title font. */\r
+h1, h2, h3, h4, h5, h6,\r
+div.title, caption.title,\r
+thead, p.table.header,\r
+#toctitle,\r
+#author, #revnumber, #revdate, #revremark,\r
+#footer {\r
+ font-family: Arial,Helvetica,sans-serif;\r
+}\r
+\r
+body {\r
+ margin: 1em 5% 1em 5%;\r
+}\r
+\r
+a {\r
+ color: blue;\r
+ text-decoration: underline;\r
+}\r
+a:visited {\r
+ color: fuchsia;\r
+}\r
+\r
+em {\r
+ font-style: italic;\r
+ color: navy;\r
+}\r
+\r
+strong {\r
+ font-weight: bold;\r
+ color: #083194;\r
+}\r
+\r
+h1, h2, h3, h4, h5, h6 {\r
+ color: #527bbd;\r
+ margin-top: 1.2em;\r
+ margin-bottom: 0.5em;\r
+ line-height: 1.3;\r
+}\r
+\r
+h1, h2, h3 {\r
+ border-bottom: 2px solid silver;\r
+}\r
+h2 {\r
+ padding-top: 0.5em;\r
+}\r
+h3 {\r
+ float: left;\r
+}\r
+h3 + * {\r
+ clear: left;\r
+}\r
+h5 {\r
+ font-size: 1.0em;\r
+}\r
+\r
+div.sectionbody {\r
+ margin-left: 0;\r
+}\r
+\r
+hr {\r
+ border: 1px solid silver;\r
+}\r
+\r
+p {\r
+ margin-top: 0.5em;\r
+ margin-bottom: 0.5em;\r
+}\r
+\r
+ul, ol, li > p {\r
+ margin-top: 0;\r
+}\r
+ul > li { color: #aaa; }\r
+ul > li > * { color: black; }\r
+\r
+.monospaced, code, pre {\r
+ font-family: "Courier New", Courier, monospace;\r
+ font-size: inherit;\r
+ color: navy;\r
+ padding: 0;\r
+ margin: 0;\r
+}\r
+pre {\r
+ white-space: pre-wrap;\r
+}\r
+\r
+#author {\r
+ color: #527bbd;\r
+ font-weight: bold;\r
+ font-size: 1.1em;\r
+}\r
+#email {\r
+}\r
+#revnumber, #revdate, #revremark {\r
+}\r
+\r
+#footer {\r
+ font-size: small;\r
+ border-top: 2px solid silver;\r
+ padding-top: 0.5em;\r
+ margin-top: 4.0em;\r
+}\r
+#footer-text {\r
+ float: left;\r
+ padding-bottom: 0.5em;\r
+}\r
+#footer-badges {\r
+ float: right;\r
+ padding-bottom: 0.5em;\r
+}\r
+\r
+#preamble {\r
+ margin-top: 1.5em;\r
+ margin-bottom: 1.5em;\r
+}\r
+div.imageblock, div.exampleblock, div.verseblock,\r
+div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,\r
+div.admonitionblock {\r
+ margin-top: 1.0em;\r
+ margin-bottom: 1.5em;\r
+}\r
+div.admonitionblock {\r
+ margin-top: 2.0em;\r
+ margin-bottom: 2.0em;\r
+ margin-right: 10%;\r
+ color: #606060;\r
+}\r
+\r
+div.content { /* Block element content. */\r
+ padding: 0;\r
+}\r
+\r
+/* Block element titles. */\r
+div.title, caption.title {\r
+ color: #527bbd;\r
+ font-weight: bold;\r
+ text-align: left;\r
+ margin-top: 1.0em;\r
+ margin-bottom: 0.5em;\r
+}\r
+div.title + * {\r
+ margin-top: 0;\r
+}\r
+\r
+td div.title:first-child {\r
+ margin-top: 0.0em;\r
+}\r
+div.content div.title:first-child {\r
+ margin-top: 0.0em;\r
+}\r
+div.content + div.title {\r
+ margin-top: 0.0em;\r
+}\r
+\r
+div.sidebarblock > div.content {\r
+ background: #ffffee;\r
+ border: 1px solid #dddddd;\r
+ border-left: 4px solid #f0f0f0;\r
+ padding: 0.5em;\r
+}\r
+\r
+div.listingblock > div.content {\r
+ border: 1px solid #dddddd;\r
+ border-left: 5px solid #f0f0f0;\r
+ background: #f8f8f8;\r
+ padding: 0.5em;\r
+}\r
+\r
+div.quoteblock, div.verseblock {\r
+ padding-left: 1.0em;\r
+ margin-left: 1.0em;\r
+ margin-right: 10%;\r
+ border-left: 5px solid #f0f0f0;\r
+ color: #888;\r
+}\r
+\r
+div.quoteblock > div.attribution {\r
+ padding-top: 0.5em;\r
+ text-align: right;\r
+}\r
+\r
+div.verseblock > pre.content {\r
+ font-family: inherit;\r
+ font-size: inherit;\r
+}\r
+div.verseblock > div.attribution {\r
+ padding-top: 0.75em;\r
+ text-align: left;\r
+}\r
+/* DEPRECATED: Pre version 8.2.7 verse style literal block. */\r
+div.verseblock + div.attribution {\r
+ text-align: left;\r
+}\r
+\r
+div.admonitionblock .icon {\r
+ vertical-align: top;\r
+ font-size: 1.1em;\r
+ font-weight: bold;\r
+ text-decoration: underline;\r
+ color: #527bbd;\r
+ padding-right: 0.5em;\r
+}\r
+div.admonitionblock td.content {\r
+ padding-left: 0.5em;\r
+ border-left: 3px solid #dddddd;\r
+}\r
+\r
+div.exampleblock > div.content {\r
+ border-left: 3px solid #dddddd;\r
+ padding-left: 0.5em;\r
+}\r
+\r
+div.imageblock div.content { padding-left: 0; }\r
+span.image img { border-style: none; vertical-align: text-bottom; }\r
+a.image:visited { color: white; }\r
+\r
+dl {\r
+ margin-top: 0.8em;\r
+ margin-bottom: 0.8em;\r
+}\r
+dt {\r
+ margin-top: 0.5em;\r
+ margin-bottom: 0;\r
+ font-style: normal;\r
+ color: navy;\r
+}\r
+dd > *:first-child {\r
+ margin-top: 0.1em;\r
+}\r
+\r
+ul, ol {\r
+ list-style-position: outside;\r
+}\r
+ol.arabic {\r
+ list-style-type: decimal;\r
+}\r
+ol.loweralpha {\r
+ list-style-type: lower-alpha;\r
+}\r
+ol.upperalpha {\r
+ list-style-type: upper-alpha;\r
+}\r
+ol.lowerroman {\r
+ list-style-type: lower-roman;\r
+}\r
+ol.upperroman {\r
+ list-style-type: upper-roman;\r
+}\r
+\r
+div.compact ul, div.compact ol,\r
+div.compact p, div.compact p,\r
+div.compact div, div.compact div {\r
+ margin-top: 0.1em;\r
+ margin-bottom: 0.1em;\r
+}\r
+\r
+tfoot {\r
+ font-weight: bold;\r
+}\r
+td > div.verse {\r
+ white-space: pre;\r
+}\r
+\r
+div.hdlist {\r
+ margin-top: 0.8em;\r
+ margin-bottom: 0.8em;\r
+}\r
+div.hdlist tr {\r
+ padding-bottom: 15px;\r
+}\r
+dt.hdlist1.strong, td.hdlist1.strong {\r
+ font-weight: bold;\r
+}\r
+td.hdlist1 {\r
+ vertical-align: top;\r
+ font-style: normal;\r
+ padding-right: 0.8em;\r
+ color: navy;\r
+}\r
+td.hdlist2 {\r
+ vertical-align: top;\r
+}\r
+div.hdlist.compact tr {\r
+ margin: 0;\r
+ padding-bottom: 0;\r
+}\r
+\r
+.comment {\r
+ background: yellow;\r
+}\r
+\r
+.footnote, .footnoteref {\r
+ font-size: 0.8em;\r
+}\r
+\r
+span.footnote, span.footnoteref {\r
+ vertical-align: super;\r
+}\r
+\r
+#footnotes {\r
+ margin: 20px 0 20px 0;\r
+ padding: 7px 0 0 0;\r
+}\r
+\r
+#footnotes div.footnote {\r
+ margin: 0 0 5px 0;\r
+}\r
+\r
+#footnotes hr {\r
+ border: none;\r
+ border-top: 1px solid silver;\r
+ height: 1px;\r
+ text-align: left;\r
+ margin-left: 0;\r
+ width: 20%;\r
+ min-width: 100px;\r
+}\r
+\r
+div.colist td {\r
+ padding-right: 0.5em;\r
+ padding-bottom: 0.3em;\r
+ vertical-align: top;\r
+}\r
+div.colist td img {\r
+ margin-top: 0.3em;\r
+}\r
+\r
+@media print {\r
+ #footer-badges { display: none; }\r
+}\r
+\r
+#toc {\r
+ margin-bottom: 2.5em;\r
+}\r
+\r
+#toctitle {\r
+ color: #527bbd;\r
+ font-size: 1.1em;\r
+ font-weight: bold;\r
+ margin-top: 1.0em;\r
+ margin-bottom: 0.1em;\r
+}\r
+\r
+div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {\r
+ margin-top: 0;\r
+ margin-bottom: 0;\r
+}\r
+div.toclevel2 {\r
+ margin-left: 2em;\r
+ font-size: 0.9em;\r
+}\r
+div.toclevel3 {\r
+ margin-left: 4em;\r
+ font-size: 0.9em;\r
+}\r
+div.toclevel4 {\r
+ margin-left: 6em;\r
+ font-size: 0.9em;\r
+}\r
+\r
+span.aqua { color: aqua; }\r
+span.black { color: black; }\r
+span.blue { color: blue; }\r
+span.fuchsia { color: fuchsia; }\r
+span.gray { color: gray; }\r
+span.green { color: green; }\r
+span.lime { color: lime; }\r
+span.maroon { color: maroon; }\r
+span.navy { color: navy; }\r
+span.olive { color: olive; }\r
+span.purple { color: purple; }\r
+span.red { color: red; }\r
+span.silver { color: silver; }\r
+span.teal { color: teal; }\r
+span.white { color: white; }\r
+span.yellow { color: yellow; }\r
+\r
+span.aqua-background { background: aqua; }\r
+span.black-background { background: black; }\r
+span.blue-background { background: blue; }\r
+span.fuchsia-background { background: fuchsia; }\r
+span.gray-background { background: gray; }\r
+span.green-background { background: green; }\r
+span.lime-background { background: lime; }\r
+span.maroon-background { background: maroon; }\r
+span.navy-background { background: navy; }\r
+span.olive-background { background: olive; }\r
+span.purple-background { background: purple; }\r
+span.red-background { background: red; }\r
+span.silver-background { background: silver; }\r
+span.teal-background { background: teal; }\r
+span.white-background { background: white; }\r
+span.yellow-background { background: yellow; }\r
+\r
+span.big { font-size: 2em; }\r
+span.small { font-size: 0.6em; }\r
+\r
+span.underline { text-decoration: underline; }\r
+span.overline { text-decoration: overline; }\r
+span.line-through { text-decoration: line-through; }\r
+\r
+div.unbreakable { page-break-inside: avoid; }\r
+\r
+\r
+/*\r
+ * xhtml11 specific\r
+ *\r
+ * */\r
+\r
+div.tableblock {\r
+ margin-top: 1.0em;\r
+ margin-bottom: 1.5em;\r
+}\r
+div.tableblock > table {\r
+ border: 3px solid #527bbd;\r
+}\r
+thead, p.table.header {\r
+ font-weight: bold;\r
+ color: #527bbd;\r
+}\r
+p.table {\r
+ margin-top: 0;\r
+}\r
+/* Because the table frame attribute is overriden by CSS in most browsers. */\r
+div.tableblock > table[frame="void"] {\r
+ border-style: none;\r
+}\r
+div.tableblock > table[frame="hsides"] {\r
+ border-left-style: none;\r
+ border-right-style: none;\r
+}\r
+div.tableblock > table[frame="vsides"] {\r
+ border-top-style: none;\r
+ border-bottom-style: none;\r
+}\r
+\r
+\r
+/*\r
+ * html5 specific\r
+ *\r
+ * */\r
+\r
+table.tableblock {\r
+ margin-top: 1.0em;\r
+ margin-bottom: 1.5em;\r
+}\r
+thead, p.tableblock.header {\r
+ font-weight: bold;\r
+ color: #527bbd;\r
+}\r
+p.tableblock {\r
+ margin-top: 0;\r
+}\r
+table.tableblock {\r
+ border-width: 3px;\r
+ border-spacing: 0px;\r
+ border-style: solid;\r
+ border-color: #527bbd;\r
+ border-collapse: collapse;\r
+}\r
+th.tableblock, td.tableblock {\r
+ border-width: 1px;\r
+ padding: 4px;\r
+ border-style: solid;\r
+ border-color: #527bbd;\r
+}\r
+\r
+table.tableblock.frame-topbot {\r
+ border-left-style: hidden;\r
+ border-right-style: hidden;\r
+}\r
+table.tableblock.frame-sides {\r
+ border-top-style: hidden;\r
+ border-bottom-style: hidden;\r
+}\r
+table.tableblock.frame-none {\r
+ border-style: hidden;\r
+}\r
+\r
+th.tableblock.halign-left, td.tableblock.halign-left {\r
+ text-align: left;\r
+}\r
+th.tableblock.halign-center, td.tableblock.halign-center {\r
+ text-align: center;\r
+}\r
+th.tableblock.halign-right, td.tableblock.halign-right {\r
+ text-align: right;\r
+}\r
+\r
+th.tableblock.valign-top, td.tableblock.valign-top {\r
+ vertical-align: top;\r
+}\r
+th.tableblock.valign-middle, td.tableblock.valign-middle {\r
+ vertical-align: middle;\r
+}\r
+th.tableblock.valign-bottom, td.tableblock.valign-bottom {\r
+ vertical-align: bottom;\r
+}\r
+\r
+\r
+/*\r
+ * manpage specific\r
+ *\r
+ * */\r
+\r
+body.manpage h1 {\r
+ padding-top: 0.5em;\r
+ padding-bottom: 0.5em;\r
+ border-top: 2px solid silver;\r
+ border-bottom: 2px solid silver;\r
+}\r
+body.manpage h2 {\r
+ border-style: none;\r
+}\r
+body.manpage div.sectionbody {\r
+ margin-left: 3em;\r
+}\r
+\r
+@media print {\r
+ body.manpage div#toc { display: none; }\r
+}\r
+\r
+\r
+</style>\r
+<script type="text/javascript">\r
+/*<![CDATA[*/\r
+var asciidoc = { // Namespace.\r
+\r
+/////////////////////////////////////////////////////////////////////\r
+// Table Of Contents generator\r
+/////////////////////////////////////////////////////////////////////\r
+\r
+/* Author: Mihai Bazon, September 2002\r
+ * http://students.infoiasi.ro/~mishoo\r
+ *\r
+ * Table Of Content generator\r
+ * Version: 0.4\r
+ *\r
+ * Feel free to use this script under the terms of the GNU General Public\r
+ * License, as long as you do not remove or alter this notice.\r
+ */\r
+\r
+ /* modified by Troy D. Hanson, September 2006. License: GPL */\r
+ /* modified by Stuart Rackham, 2006, 2009. License: GPL */\r
+\r
+// toclevels = 1..4.\r
+toc: function (toclevels) {\r
+\r
+ function getText(el) {\r
+ var text = "";\r
+ for (var i = el.firstChild; i != null; i = i.nextSibling) {\r
+ if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.\r
+ text += i.data;\r
+ else if (i.firstChild != null)\r
+ text += getText(i);\r
+ }\r
+ return text;\r
+ }\r
+\r
+ function TocEntry(el, text, toclevel) {\r
+ this.element = el;\r
+ this.text = text;\r
+ this.toclevel = toclevel;\r
+ }\r
+\r
+ function tocEntries(el, toclevels) {\r
+ var result = new Array;\r
+ var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');\r
+ // Function that scans the DOM tree for header elements (the DOM2\r
+ // nodeIterator API would be a better technique but not supported by all\r
+ // browsers).\r
+ var iterate = function (el) {\r
+ for (var i = el.firstChild; i != null; i = i.nextSibling) {\r
+ if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {\r
+ var mo = re.exec(i.tagName);\r
+ if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {\r
+ result[result.length] = new TocEntry(i, getText(i), mo[1]-1);\r
+ }\r
+ iterate(i);\r
+ }\r
+ }\r
+ }\r
+ iterate(el);\r
+ return result;\r
+ }\r
+\r
+ var toc = document.getElementById("toc");\r
+ if (!toc) {\r
+ return;\r
+ }\r
+\r
+ // Delete existing TOC entries in case we're reloading the TOC.\r
+ var tocEntriesToRemove = [];\r
+ var i;\r
+ for (i = 0; i < toc.childNodes.length; i++) {\r
+ var entry = toc.childNodes[i];\r
+ if (entry.nodeName.toLowerCase() == 'div'\r
+ && entry.getAttribute("class")\r
+ && entry.getAttribute("class").match(/^toclevel/))\r
+ tocEntriesToRemove.push(entry);\r
+ }\r
+ for (i = 0; i < tocEntriesToRemove.length; i++) {\r
+ toc.removeChild(tocEntriesToRemove[i]);\r
+ }\r
+\r
+ // Rebuild TOC entries.\r
+ var entries = tocEntries(document.getElementById("content"), toclevels);\r
+ for (var i = 0; i < entries.length; ++i) {\r
+ var entry = entries[i];\r
+ if (entry.element.id == "")\r
+ entry.element.id = "_toc_" + i;\r
+ var a = document.createElement("a");\r
+ a.href = "#" + entry.element.id;\r
+ a.appendChild(document.createTextNode(entry.text));\r
+ var div = document.createElement("div");\r
+ div.appendChild(a);\r
+ div.className = "toclevel" + entry.toclevel;\r
+ toc.appendChild(div);\r
+ }\r
+ if (entries.length == 0)\r
+ toc.parentNode.removeChild(toc);\r
+},\r
+\r
+\r
+/////////////////////////////////////////////////////////////////////\r
+// Footnotes generator\r
+/////////////////////////////////////////////////////////////////////\r
+\r
+/* Based on footnote generation code from:\r
+ * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html\r
+ */\r
+\r
+footnotes: function () {\r
+ // Delete existing footnote entries in case we're reloading the footnodes.\r
+ var i;\r
+ var noteholder = document.getElementById("footnotes");\r
+ if (!noteholder) {\r
+ return;\r
+ }\r
+ var entriesToRemove = [];\r
+ for (i = 0; i < noteholder.childNodes.length; i++) {\r
+ var entry = noteholder.childNodes[i];\r
+ if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")\r
+ entriesToRemove.push(entry);\r
+ }\r
+ for (i = 0; i < entriesToRemove.length; i++) {\r
+ noteholder.removeChild(entriesToRemove[i]);\r
+ }\r
+\r
+ // Rebuild footnote entries.\r
+ var cont = document.getElementById("content");\r
+ var spans = cont.getElementsByTagName("span");\r
+ var refs = {};\r
+ var n = 0;\r
+ for (i=0; i<spans.length; i++) {\r
+ if (spans[i].className == "footnote") {\r
+ n++;\r
+ var note = spans[i].getAttribute("data-note");\r
+ if (!note) {\r
+ // Use [\s\S] in place of . so multi-line matches work.\r
+ // Because JavaScript has no s (dotall) regex flag.\r
+ note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];\r
+ spans[i].innerHTML =\r
+ "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +\r
+ "' title='View footnote' class='footnote'>" + n + "</a>]";\r
+ spans[i].setAttribute("data-note", note);\r
+ }\r
+ noteholder.innerHTML +=\r
+ "<div class='footnote' id='_footnote_" + n + "'>" +\r
+ "<a href='#_footnoteref_" + n + "' title='Return to text'>" +\r
+ n + "</a>. " + note + "</div>";\r
+ var id =spans[i].getAttribute("id");\r
+ if (id != null) refs["#"+id] = n;\r
+ }\r
+ }\r
+ if (n == 0)\r
+ noteholder.parentNode.removeChild(noteholder);\r
+ else {\r
+ // Process footnoterefs.\r
+ for (i=0; i<spans.length; i++) {\r
+ if (spans[i].className == "footnoteref") {\r
+ var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");\r
+ href = href.match(/#.*/)[0]; // Because IE return full URL.\r
+ n = refs[href];\r
+ spans[i].innerHTML =\r
+ "[<a href='#_footnote_" + n +\r
+ "' title='View footnote' class='footnote'>" + n + "</a>]";\r
+ }\r
+ }\r
+ }\r
+},\r
+\r
+install: function(toclevels) {\r
+ var timerId;\r
+\r
+ function reinstall() {\r
+ asciidoc.footnotes();\r
+ if (toclevels) {\r
+ asciidoc.toc(toclevels);\r
+ }\r
+ }\r
+\r
+ function reinstallAndRemoveTimer() {\r
+ clearInterval(timerId);\r
+ reinstall();\r
+ }\r
+\r
+ timerId = setInterval(reinstall, 500);\r
+ if (document.addEventListener)\r
+ document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);\r
+ else\r
+ window.onload = reinstallAndRemoveTimer;\r
+}\r
+\r
+}\r
+asciidoc.install();\r
+/*]]>*/\r
+</script>\r
+</head>\r
+<body class="manpage">\r
+<div id="header">\r
+<h1>\r
+RE2C (1) Manual Page\r
+</h1>\r
+<h2>NAME</h2>\r
+<div class="sectionbody">\r
+<p>re2c -\r
+ convert regular expressions to C/C++\r
+</p>\r
+</div>\r
+</div>\r
+<div id="content">\r
+<div class="sect1">\r
+<h2 id="_synopsis">SYNOPSIS</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p><strong>re2c</strong> [<em>OPTIONS</em>] <em>FILE</em></p></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_description">DESCRIPTION</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p><strong>re2c</strong> is a lexer generator for C/C++.\r
+It finds regular expression specifications inside of C/C++ comments and replaces them with a hard-coded DFA.\r
+The user must supply some interface code in order to control and customize the generated DFA.</p></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_example">EXAMPLE</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>Given the following code:</p></div>\r
+<div class="listingblock">\r
+<div class="content"><!-- Generator: GNU source-highlight 3.1.7\r
+by Lorenzo Bettini\r
+http://www.lorenzobettini.it\r
+http://www.gnu.org/software/src-highlite -->\r
+<pre><tt><span style="color: #009900">unsigned</span> <span style="color: #009900">int</span> <span style="font-weight: bold"><span style="color: #000000">stou</span></span> <span style="color: #990000">(</span><span style="font-weight: bold"><span style="color: #0000FF">const</span></span> <span style="color: #009900">char</span> <span style="color: #990000">*</span> s<span style="color: #990000">)</span>\r
+<span style="color: #FF0000">{</span>\r
+<span style="font-weight: bold"><span style="color: #000080"># define</span></span> YYCTYPE <span style="color: #009900">char</span>\r
+ <span style="font-weight: bold"><span style="color: #0000FF">const</span></span> YYCTYPE <span style="color: #990000">*</span> YYCURSOR <span style="color: #990000">=</span> s<span style="color: #990000">;</span>\r
+ <span style="color: #009900">unsigned</span> <span style="color: #009900">int</span> result <span style="color: #990000">=</span> <span style="color: #993399">0</span><span style="color: #990000">;</span>\r
+\r
+ <span style="font-weight: bold"><span style="color: #0000FF">for</span></span> <span style="color: #990000">(;;)</span>\r
+ <span style="color: #FF0000">{</span>\r
+ <span style="font-style: italic"><span style="color: #9A1900">/*!re2c</span></span>\r
+<span style="font-style: italic"><span style="color: #9A1900"> re2c:yyfill:enable = 0;</span></span>\r
+\r
+<span style="font-style: italic"><span style="color: #9A1900"> "\x00" { return result; }</span></span>\r
+<span style="font-style: italic"><span style="color: #9A1900"> [0-9] { result = result * 10 + c; continue; }</span></span>\r
+<span style="font-style: italic"><span style="color: #9A1900"> */</span></span>\r
+ <span style="color: #FF0000">}</span>\r
+<span style="color: #FF0000">}</span></tt></pre></div></div>\r
+<div class="paragraph"><p><code>re2c -is</code> will generate:</p></div>\r
+<div class="listingblock">\r
+<div class="content"><!-- Generator: GNU source-highlight 3.1.7\r
+by Lorenzo Bettini\r
+http://www.lorenzobettini.it\r
+http://www.gnu.org/software/src-highlite -->\r
+<pre><tt><span style="font-style: italic"><span style="color: #9A1900">/* Generated by re2c 0.13.7.dev on Mon Jul 14 13:37:46 2014 */</span></span>\r
+<span style="color: #009900">unsigned</span> <span style="color: #009900">int</span> <span style="font-weight: bold"><span style="color: #000000">stou</span></span> <span style="color: #990000">(</span><span style="font-weight: bold"><span style="color: #0000FF">const</span></span> <span style="color: #009900">char</span> <span style="color: #990000">*</span> s<span style="color: #990000">)</span>\r
+<span style="color: #FF0000">{</span>\r
+<span style="font-weight: bold"><span style="color: #000080"># define</span></span> YYCTYPE <span style="color: #009900">char</span>\r
+ <span style="font-weight: bold"><span style="color: #0000FF">const</span></span> YYCTYPE <span style="color: #990000">*</span> YYCURSOR <span style="color: #990000">=</span> s<span style="color: #990000">;</span>\r
+ <span style="color: #009900">unsigned</span> <span style="color: #009900">int</span> result <span style="color: #990000">=</span> <span style="color: #993399">0</span><span style="color: #990000">;</span>\r
+\r
+ <span style="font-weight: bold"><span style="color: #0000FF">for</span></span> <span style="color: #990000">(;;)</span>\r
+ <span style="color: #FF0000">{</span>\r
+\r
+<span style="color: #FF0000">{</span>\r
+ <span style="color: #008080">YYCTYPE</span> yych<span style="color: #990000">;</span>\r
+\r
+ yych <span style="color: #990000">=</span> <span style="color: #990000">*</span>YYCURSOR<span style="color: #990000">;</span>\r
+ <span style="font-weight: bold"><span style="color: #0000FF">if</span></span> <span style="color: #990000">(</span>yych <span style="color: #990000"><=</span> <span style="color: #993399">0x00</span><span style="color: #990000">)</span> <span style="font-weight: bold"><span style="color: #0000FF">goto</span></span> yy3<span style="color: #990000">;</span>\r
+ <span style="font-weight: bold"><span style="color: #0000FF">if</span></span> <span style="color: #990000">(</span>yych <span style="color: #990000"><=</span> <span style="color: #FF0000">'/'</span><span style="color: #990000">)</span> <span style="font-weight: bold"><span style="color: #0000FF">goto</span></span> yy2<span style="color: #990000">;</span>\r
+ <span style="font-weight: bold"><span style="color: #0000FF">if</span></span> <span style="color: #990000">(</span>yych <span style="color: #990000"><=</span> <span style="color: #FF0000">'9'</span><span style="color: #990000">)</span> <span style="font-weight: bold"><span style="color: #0000FF">goto</span></span> yy5<span style="color: #990000">;</span>\r
+<span style="font-weight: bold"><span style="color: #008080">yy2:</span></span>\r
+<span style="font-weight: bold"><span style="color: #008080">yy3:</span></span>\r
+ <span style="color: #990000">++</span>YYCURSOR<span style="color: #990000">;</span>\r
+ <span style="color: #FF0000">{</span> <span style="font-weight: bold"><span style="color: #0000FF">return</span></span> result<span style="color: #990000">;</span> <span style="color: #FF0000">}</span>\r
+<span style="font-weight: bold"><span style="color: #008080">yy5:</span></span>\r
+ <span style="color: #990000">++</span>YYCURSOR<span style="color: #990000">;</span>\r
+ <span style="color: #FF0000">{</span> result <span style="color: #990000">=</span> result <span style="color: #990000">*</span> <span style="color: #993399">10</span> <span style="color: #990000">+</span> c<span style="color: #990000">;</span> <span style="font-weight: bold"><span style="color: #0000FF">continue</span></span><span style="color: #990000">;</span> <span style="color: #FF0000">}</span>\r
+<span style="color: #FF0000">}</span>\r
+\r
+ <span style="color: #FF0000">}</span>\r
+<span style="color: #FF0000">}</span></tt></pre></div></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_options">OPTIONS</h2>\r
+<div class="sectionbody">\r
+<div class="dlist"><dl>\r
+<dt class="hdlist1">\r
+<strong>-?</strong>, <strong>-h</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+ Invoke a short help.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>-b</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+ Implies <strong>-s</strong>. Use bit vectors as well in the attempt to coax better\r
+ code out of the compiler. Most useful for specifications with more than a\r
+ few keywords (e.g. for most programming languages).\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>-c</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+ Used to support (f)lex-like condition support.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>-d</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+ Creates a parser that dumps information about the current position and in\r
+ which state the parser is while parsing the input. This is useful to debug\r
+ parser issues and states. If you use this switch you need to define a macro\r
+ <strong>YYDEBUG</strong> that is called like a function with two parameters:\r
+ <strong>void YYDEBUG (int state, char current)</strong>. The first parameter receives the\r
+ state or -1 and the second parameter receives the input at the current cursor.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>-D</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+ Emit Graphviz dot data. It can then be processed with e.g.\r
+ <code>dot -Tpng input.dot > output.png</code>. Please note that scanners with many states\r
+ may crash dot.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>-e</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+ Generate a parser that supports EBCDIC. The generated code can deal with any\r
+ character up to 0xFF. In this mode <strong>re2c</strong> assumes that input character size is\r
+ 1 byte. This switch is incompatible with <strong>-w</strong>, <strong>-x</strong>, <strong>-u</strong> and <strong>-8</strong>.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>-f</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+ Generate a scanner with support for storable state.\r
+ For details see below at <strong>SCANNER WITH STORABLE STATES</strong>.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>-F</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+ Partial support for flex syntax. When this flag is active then named\r
+ definitions must be surrounded by curly braces and can be defined without an\r
+ equal sign and the terminating semi colon. Instead names are treated as direct\r
+ double quoted strings.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>-g</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+ Generate a scanner that utilizes GCC’s computed goto feature. That is <strong>re2c</strong>\r
+ generates jump tables whenever a decision is of a certain complexity (e.g. a\r
+ lot of if conditions are otherwise necessary). This is only useable with GCC\r
+ and produces output that cannot be compiled with any other compiler. Note that\r
+ this implies <strong>-b</strong> and that the complexity threshold can be configured using the\r
+ inplace configuration <strong>cgoto:threshold</strong>.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>-i</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+ Do not output <strong>#line</strong> information. This is usefull when you want use a CMS tool\r
+ with the <strong>re2c</strong> output which you might want if you do not require your users to\r
+ have <strong>re2c</strong> themselves when building from your source.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>-o OUTPUT</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+ Specify the output file.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>-r</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+ Allows reuse of scanner definitions with <strong>/*!use:re2c</strong> after\r
+ <strong>/*!rules:re2c</strong>. In this mode no <strong>/*!re2c</strong> block and exactly one\r
+ <strong>/*!rules:re2c</strong> must be present. The rules are being saved and used by\r
+ every <strong>/*!use:re2c</strong> block that follows. These blocks can contain\r
+ inplace configurations, especially <strong>re2c:flags:e</strong>, <strong>re2c:flags:w</strong>,\r
+ <strong>re2c:flags:x</strong>, <strong>re2c:flags:u</strong> and <strong>re2c:flags:8</strong>.\r
+ That way it is possible to create the same scanner multiple times for different\r
+ character types, different input mechanisms or different output mechanisms.\r
+ The <strong>/*!use:re2c</strong> blocks can also contain additional rules that will be\r
+ appended to the set of rules in <strong>/*!rules:re2c</strong>.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>-s</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+ Generate nested ifs for some switches. Many compilers need this\r
+ assist to generate better code.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>-t</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+ Create a header file that contains types for the (f)lex-like condition support.\r
+ This can only be activated when <strong>-c</strong> is in use.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>-u</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+ Generate a parser that supports UTF-32. The generated code can deal with any\r
+ valid Unicode character up to 0x10FFFF. In this mode <strong>re2c</strong> assumes that input\r
+ character size is 4 bytes. This switch is incompatible with <strong>-e</strong>, <strong>-w</strong>, <strong>-x</strong>\r
+ and <strong>-8</strong>. This implies <strong>-s</strong>.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>-v</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+ Show version information.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>-V</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+ Show the version as a number XXYYZZ.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>-w</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+ Generate a parser that supports UCS-2. The generated code can deal with any\r
+ valid Unicode character up to 0xFFFF. In this mode <strong>re2c</strong> assumes that input\r
+ character size is 2 bytes. This switch is incompatible with <strong>-e</strong>, <strong>-x</strong>, <strong>-u</strong>\r
+ and <strong>-8</strong>. This implies <strong>-s</strong>.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>-x</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+ Generate a parser that supports UTF-16. The generated code can deal with any\r
+ valid Unicode character up to 0x10FFFF. In this mode <strong>re2c</strong> assumes that input\r
+ character size is 2 bytes. This switch is incompatible with <strong>-e</strong>, <strong>-w</strong>, <strong>-u</strong>\r
+ and <strong>-8</strong>. This implies <strong>-s</strong>.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>-1</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+ Force single pass generation, this cannot be combined with -f and disables\r
+ <strong>YYMAXFILL</strong> generation prior to last <strong>re2c</strong> block.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>-8</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+ Generate a parser that supports UTF-8. The generated code can deal with any\r
+ valid Unicode character up to 0x10FFFF. In this mode <strong>re2c</strong> assumes that input\r
+ character size is 1 byte. This switch is incompatible with <strong>-e</strong>, <strong>-w</strong>, <strong>-x</strong>\r
+ and <strong>-u</strong>.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>--case-insensitive</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+ All strings are case insensitive, so all "-expressions are treated\r
+ in the same way '-expressions are.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>--case-inverted</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+ Invert the meaning of single and double quoted strings.\r
+ With this switch single quotes are case sensitive and\r
+ double quotes are case insensitive.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>--no-generation-date</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+ Suppress date output in the generated output so that it only shows the re2c\r
+ version.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>--encoding-policy POLICY</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+ Specify how <strong>re2c</strong> must treat Unicode surrogates. <strong>POLICY</strong> can be one of the following:\r
+ <strong>fail</strong> (abort with error when surrogate encountered),\r
+ <strong>substitute</strong> (silently substitute surrogate with error code point 0xFFFD),\r
+ <strong>ignore</strong> (treat surrogates as normal code points).\r
+ By default <strong>re2c</strong> ignores surrogates (for backward compatibility).\r
+ Unicode standard says that standalone surrogates are invalid code points,\r
+ but different libraries and programs treat them differently.\r
+</p>\r
+</dd>\r
+</dl></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_interface_code">INTERFACE CODE</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>The user must supply interface code either in the form of C/C++ code\r
+(macros, functions, variables, etc.) or in the form of <em>inplace configurations</em>.\r
+Which symbols must be defined and which are optional depends on a particular use case.</p></div>\r
+<div class="dlist"><dl>\r
+<dt class="hdlist1">\r
+<strong>YYCONDTYPE</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+ In <strong>-c</strong> mode you can use <strong>-t</strong> to generate a file that contains the\r
+ enumeration used as conditions. Each of the values refers to a condition of\r
+ a rule set.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>YYCTXMARKER</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+ l-value of type <strong>* YYCTYPE</strong>.\r
+ The generated code saves trailing context backtracking information in <strong>YYCTXMARKER</strong>.\r
+ The user only needs to define this macro if a scanner specification uses trailing\r
+ context in one or more of its regular expressions.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>YYCTYPE</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+ Type used to hold an input symbol (code unit).\r
+ Usually <strong>char</strong> or <strong>unsigned char</strong> for ASCII, EBCDIC and UTF-8, <strong>unsigned short</strong> for UTF-16 or UCS-2 and <strong>unsigned int</strong> for UTF-32.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>YYCURSOR</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+ l-value of type <strong>* YYCTYPE</strong> that points to the current input symbol.\r
+ The generated code advances <strong>YYCURSOR</strong> as symbols are matched.\r
+ On entry, <strong>YYCURSOR</strong> is assumed to point to the first character of the\r
+ current token. On exit, <strong>YYCURSOR</strong> will point to the first character of\r
+ the following token.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>YYDEBUG (state, current)</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+ This is only needed if the <strong>-d</strong> flag was specified. It allows to easily debug\r
+ the generated parser by calling a user defined function for every state. The function\r
+ should have the following signature: <strong>void YYDEBUG (int state, char current)</strong>.\r
+ The first parameter receives the state or -1 and the second parameter receives the\r
+ input at the current cursor.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>YYFILL (n)</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+ The generated code “calls” <strong>YYFILL (n)</strong> when the buffer needs\r
+ (re)filling: at least <strong>n</strong> additional characters should\r
+ be provided. <strong>YYFILL (n)</strong> should adjust <strong>YYCURSOR</strong>, <strong>YYLIMIT</strong>,\r
+ <strong>YYMARKER</strong> and <strong>YYCTXMARKER</strong> as needed. Note that for typical\r
+ programming languages <strong>n</strong> will be the length of the longest keyword plus one.\r
+ The user can place a comment of the form <strong>/*!max:re2c*/</strong> once to insert\r
+ a <strong>YYMAXFILL (n)</strong> definition that is set to the maximum length value. If -1\r
+ switch is used then <strong>YYMAXFILL</strong> can be triggered only once after the\r
+ last <strong>/*!re2c ... */</strong> block.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>YYGETCONDITION ()</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+ This define is used to get the condition prior to entering the scanner code\r
+ when using <strong>-c</strong> switch. The value must be initialized with a value from\r
+ the enumeration <strong>YYCONDTYPE</strong> type.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>YYGETSTATE ()</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+ The user only needs to define this macro if the <strong>-f</strong> flag was specified.\r
+ In that case, the generated code “calls” <strong>YYGETSTATE ()</strong> at the very beginning\r
+ of the scanner in order to obtain the saved state. <strong>YYGETSTATE ()</strong> must return a signed\r
+ integer. The value must be either -1, indicating that the scanner is entered for the\r
+ first time, or a value previously saved by <strong>YYSETSTATE (s)</strong>. In the second case, the\r
+ scanner will resume operations right after where the last <strong>YYFILL (n)</strong> was called.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>YYLIMIT</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+ Expression of type <strong>* YYCTYPE</strong> that marks the end of the buffer\r
+ (<strong>YYLIMIT[-1]</strong> is the last character in the buffer).\r
+ The generated code repeatedly compares <strong>YYCURSOR</strong> to <strong>YYLIMIT</strong>\r
+ to determine when the buffer needs (re)filling.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>YYMARKER</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+ l-value of type <strong>* YYCTYPE</strong>.\r
+ The generated code saves backtracking information in <strong>YYMARKER</strong>. Some easy\r
+ scanners might not use this.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>YYMAXFILL</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+ This will be automatically defined by <strong>/*!max:re2c*/</strong> blocks as explained above.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>YYSETCONDITION (c)</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+ This define is used to set the condition in transition rules. This is only\r
+ being used when <strong>-c</strong> is active and transition rules are being used.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>YYSETSTATE (s)</strong>\r
+</dt>\r
+<dd>\r
+<p>\r
+ The user only needs to define this macro if the <strong>-f</strong> flag was specified.\r
+ In that case, the generated code “calls” <strong>YYSETSTATE</strong> just before calling\r
+ <strong>YYFILL (n)</strong>. The parameter to <strong>YYSETSTATE</strong> is a signed integer that uniquely\r
+ identifies the specific instance of <strong>YYFILL (n)</strong> that is about to be called.\r
+ Should the user wish to save the state of the scanner and have <strong>YYFILL (n)</strong> return\r
+ to the caller, all he has to do is store that unique identifer in a variable.\r
+ Later, when the scannered is called again, it will call <strong>YYGETSTATE ()</strong> and\r
+ resume execution right where it left off. The generated code will contain\r
+ both <strong>YYSETSTATE (s)</strong> and <strong>YYGETSTATE</strong> even if <strong>YYFILL (n)</strong> is being disabled.\r
+</p>\r
+</dd>\r
+</dl></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_syntax">SYNTAX</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>Code for <strong>re2c</strong> consists of a set of <em>rules</em>, <em>named definitions</em> and <em>inplace configurations</em>.</p></div>\r
+<div class="paragraph"><p><em>rules</em> consist of a <em>regular-expressions</em> along with a block of <em>C/C++ code</em> that\r
+is to be executed when the associated <em>regular-expression</em> is matched. You can either\r
+start the code with an opening curly brace or the sequence <strong>:=</strong>. When\r
+the code with a curly brace then <strong>re2c</strong> counts the brace depth and stops looking\r
+for code automatically. Otherwise curly braces are not allowed and <strong>re2c</strong> stops\r
+looking for code at the first line that does not begin with whitespace. If two\r
+or more rules overlap, the first rule is preferred.</p></div>\r
+<div class="sidebarblock">\r
+<div class="content">\r
+<div class="paragraph"><p><em>regular-expression</em> { <em>C/C++ code</em> }</p></div>\r
+<div class="paragraph"><p><em>regular-expression</em> := <em>C/C++ code</em></p></div>\r
+</div></div>\r
+<div class="paragraph"><p>There is one special rule: default rule <strong>*</strong>:</p></div>\r
+<div class="sidebarblock">\r
+<div class="content">\r
+<div class="paragraph"><p>* { <em>C/C++ code</em> }</p></div>\r
+<div class="paragraph"><p>* := <em>C/C++ code</em></p></div>\r
+</div></div>\r
+<div class="admonitionblock">\r
+<table><tr>\r
+<td class="icon">\r
+<div class="title">Note</div>\r
+</td>\r
+<td class="content">\r
+<div class="paragraph"><p><strong>[^]</strong> differs from <strong>*</strong>:\r
+<strong>*</strong> has the lowest priority, matches any code unit (either valid or invalid) and always consumes one character;\r
+<strong>[^]</strong> matches any valid code point (not code unit) and can consume multiple characters.\r
+In fact, when variable-length encoding is used, <strong>*</strong> is the only possible way to match invalid input character.</p></div>\r
+</td>\r
+</tr></table>\r
+</div>\r
+<div class="paragraph"><p>If <strong>-c</strong> is active then each <em>regular-expression</em> is preceeded by a list of\r
+comma separated condition names. Besides normal naming rules there are two\r
+special cases. A rule may contain the single condition name <strong>*</strong> and no contition\r
+name at all. In the latter case the rule cannot have a <em>regular-expression</em>. Non\r
+empty rules may further more specify the new condition. In that case <strong>re2c</strong> will\r
+generated the necessary code to change the condition automatically. Just as above\r
+code can be started with a curly brace of the sequence <strong>:=</strong>. Further more\r
+rules can use <strong>:=></strong> as a shortcut to automatically generate code that not only\r
+sets the new condition state but also continues execution with the new state. A\r
+shortcut rule should not be used in a loop where there is code between the start\r
+of the loop and the <strong>re2c</strong> block unless <strong>re2c:cond:goto</strong> is changed\r
+to <strong>continue</strong>. If code is necessary before all rule (though not simple\r
+jumps) you can doso by using <strong><!</strong> pseudo-rules.</p></div>\r
+<div class="sidebarblock">\r
+<div class="content">\r
+<div class="paragraph"><p><<em>condition-list</em>> <em>regular-expression</em> { <em>C/C++ code</em> }</p></div>\r
+<div class="paragraph"><p><<em>condition-list</em>> <em>regular-expression</em> := <em>C/C++ code</em></p></div>\r
+<div class="paragraph"><p><<em>condition-list</em>> * { <em>C/C++ code</em> }</p></div>\r
+<div class="paragraph"><p><<em>condition-list</em>> * := <em>C/C++ code</em></p></div>\r
+<div class="paragraph"><p><<em>condition-list</em>> <em>regular-expression</em> => <em>condition</em> { <em>C/C++ code</em> }</p></div>\r
+<div class="paragraph"><p><<em>condition-list</em>> <em>regular-expression</em> => <em>condition</em> := <em>C/C++ code</em></p></div>\r
+<div class="paragraph"><p><<em>condition-list</em>> <em>regular-expression</em> :=> <em>condition</em></p></div>\r
+<div class="paragraph"><p><*> <em>regular-expression</em> { <em>C/C++ code</em> }</p></div>\r
+<div class="paragraph"><p><*> <em>regular-expression</em> := <em>C/C++ code</em></p></div>\r
+<div class="paragraph"><p><*> * { <em>C/C++ code</em> }</p></div>\r
+<div class="paragraph"><p><*> * := <em>C/C++ code</em></p></div>\r
+<div class="paragraph"><p><*> <em>regular-expression</em> => <em>condition</em> { <em>C/C++ code</em> }</p></div>\r
+<div class="paragraph"><p><*> <em>regular-expression</em> => <em>condition</em> := <em>C/C++ code</em></p></div>\r
+<div class="paragraph"><p><*> <em>regular-expression</em> :=> <em>condition</em></p></div>\r
+<div class="paragraph"><p><> { <em>C/C++ code</em> }</p></div>\r
+<div class="paragraph"><p><> := <em>C/C++ code</em></p></div>\r
+<div class="paragraph"><p><> => <em>condition</em> { <em>C/C++ code</em> }</p></div>\r
+<div class="paragraph"><p><> => <em>condition</em> := <em>C/C++ code</em></p></div>\r
+<div class="paragraph"><p><> :=> <em>condition</em></p></div>\r
+<div class="paragraph"><p><!<em>condition-list</em>> { <em>C/C++ code</em> }</p></div>\r
+<div class="paragraph"><p><!<em>condition-list</em>> := <em>C/C++ code</em></p></div>\r
+<div class="paragraph"><p><!*> { <em>C/C++ code</em> }</p></div>\r
+<div class="paragraph"><p><!*> := <em>C/C++ code</em></p></div>\r
+</div></div>\r
+<div class="paragraph"><p><em>named definitions</em> are of the form:</p></div>\r
+<div class="sidebarblock">\r
+<div class="content">\r
+<div class="paragraph"><p><em>name</em> = <em>regular-expression</em>;</p></div>\r
+</div></div>\r
+<div class="paragraph"><p>If <strong>-F</strong> is active, then named definitions are also of the form:</p></div>\r
+<div class="sidebarblock">\r
+<div class="content">\r
+<div class="paragraph"><p><em>name</em> <em>regular-expression</em></p></div>\r
+</div></div>\r
+<div class="paragraph"><p><em>inplace configurations</em> are of the form:</p></div>\r
+<div class="sidebarblock">\r
+<div class="content">\r
+<div class="paragraph"><p>re2c:<em>name</em> = <em>value</em>;</p></div>\r
+<div class="paragraph"><p>re2c:<em>name</em> = “_value_”;</p></div>\r
+</div></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_regular_expressions">REGULAR EXPRESSIONS</h2>\r
+<div class="sectionbody">\r
+<div class="dlist"><dl>\r
+<dt class="hdlist1">\r
+“foo” \r
+</dt>\r
+<dd>\r
+<p>\r
+ literal string “foo”. ANSI-C escape sequences can be used.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+‘foo’ \r
+</dt>\r
+<dd>\r
+<p>\r
+ literal string “foo” (characters [a-zA-Z] treated case-insensitive). ANSI-C escape sequences can be used.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+[xyz] \r
+</dt>\r
+<dd>\r
+<p>\r
+ character class; in this case, <em>regular-expression</em> matches either ‘x’, ‘y’, or ‘z’.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+[abj-oZ] \r
+</dt>\r
+<dd>\r
+<p>\r
+ character class with a range in it; matches ‘a’, ‘b’, any letter from ‘j’ through ‘o’ or ‘Z’.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+[^<em>class</em>] \r
+</dt>\r
+<dd>\r
+<p>\r
+ inverted character class.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<em>r</em> \ <em>s</em> \r
+</dt>\r
+<dd>\r
+<p>\r
+ match any <em>r</em> which isn’t <em>s</em>. <em>r</em> and <em>s</em> must be <em>regular-expression</em>s which can be expressed as character classes.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<em>r</em> * \r
+</dt>\r
+<dd>\r
+<p>\r
+ zero or more <em>r</em>'s, where <em>r</em> is any <em>regular-expression</em>.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<em>r</em> + \r
+</dt>\r
+<dd>\r
+<p>\r
+ one or more <em>r</em>'s.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<em>r</em> ? \r
+</dt>\r
+<dd>\r
+<p>\r
+ zero or one <em>r</em>'s (that is, an optional <em>r</em>).\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<em>name</em> \r
+</dt>\r
+<dd>\r
+<p>\r
+ the expansion of the <em>named definition</em>.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+( <em>r</em> ) \r
+</dt>\r
+<dd>\r
+<p>\r
+ <em>r</em>; parentheses are used to override precedence.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<em>r</em> <em>s</em> \r
+</dt>\r
+<dd>\r
+<p>\r
+ <em>r</em> followed by <em>s</em> (concatenation).\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<em>r</em> | <em>s</em> \r
+</dt>\r
+<dd>\r
+<p>\r
+ either <em>r</em> or <em>s</em> (alternative).\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<em>r</em> / <em>s</em> \r
+</dt>\r
+<dd>\r
+<p>\r
+ <em>r</em> but only if it is followed by <em>s</em>. Note that <em>s</em> is not part of the matched text.\r
+ This type of <em>regular-expression</em> is called “trailing context”.\r
+ Trailing context can only be the end of a rule and not part of a named definition.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<em>r</em> { <em>n</em> } \r
+</dt>\r
+<dd>\r
+<p>\r
+ matches <em>r</em> exactly <em>n</em> times.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<em>r</em> { <em>n</em> , } \r
+</dt>\r
+<dd>\r
+<p>\r
+ matches <em>r</em> at least <em>n</em> times.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<em>r</em> { <em>n</em> , <em>m</em> } \r
+</dt>\r
+<dd>\r
+<p>\r
+ matches <em>r</em> at least <em>n</em> times, but not more than <em>m</em> times.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+. \r
+</dt>\r
+<dd>\r
+<p>\r
+ match any character except newline.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<em>def</em> \r
+</dt>\r
+<dd>\r
+<p>\r
+ matches named definition as specified by <em>def</em> only if <strong>-F</strong> is off.\r
+ If <strong>-F</strong> is active then this behaves like it was enclosed in double quotes and matches the string “def”.\r
+</p>\r
+</dd>\r
+</dl></div>\r
+<div class="paragraph"><p>Character classes and string literals may contain octal or hexadecimal\r
+character definitions and the following set of escape sequences:\r
+<strong>\a</strong>, <strong>\b</strong>, <strong>\f</strong>, <strong>\n</strong>, <strong>\r</strong>, <strong>\t</strong>, <strong>\v</strong>, <strong>\\</strong>.\r
+An octal character is defined by a backslash followed by its three octal digits (e.g. <strong>\377</strong>).\r
+Hexadecimal characters from 0 to 0xFF are defined by backslash, a lower cased ‘x’ and two hexadecimal digits (e.g. <strong>\x12</strong>).\r
+Hexadecimal characters from 0x100 to 0xFFFF are defined by backslash, a lower cased ‘u’ (or an upper cased ‘X’) and four hexadecimal digits (e.g. <strong>\u1234</strong>).\r
+Hexadecimal characters from 0x10000 to 0xFFFFffff are defined by backslash, an upper cased ‘U’ and eight hexadecimal digits (e.g. <strong>\U12345678</strong>).</p></div>\r
+<div class="paragraph"><p>The only portable “any” rule is the default rule <strong>*</strong>.</p></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_inplace_configurations">INPLACE CONFIGURATIONS</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>It is possible to configure code generation inside <strong>re2c</strong> blocks. The following lists the available configurations:</p></div>\r
+<div class="dlist"><dl>\r
+<dt class="hdlist1">\r
+<strong>re2c:condprefix</strong> = yyc_; \r
+</dt>\r
+<dd>\r
+<p>\r
+Allows to specify the prefix used for condition labels. That is this text is\r
+prepended to any condition label in the generated output file.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:condenumprefix</strong> = yyc; \r
+</dt>\r
+<dd>\r
+<p>\r
+Allows to specify the prefix used for condition values. That is this text is\r
+prepended to any condition enum value in the generated output file.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:cond:divider</strong> = “/* *********************************** */”; \r
+</dt>\r
+<dd>\r
+<p>\r
+Allows to customize the devider for condition blocks. You can use ‘@@’ to\r
+put the name of the condition or ustomize the placeholder\r
+using <strong>re2c:cond:divider@cond</strong>.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:cond:divider@cond</strong> = @@; \r
+</dt>\r
+<dd>\r
+<p>\r
+Specifies the placeholder that will be replaced with the condition name\r
+in <strong>re2c:cond:divider</strong>.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:cond:goto</strong> = “goto @@;”; \r
+</dt>\r
+<dd>\r
+<p>\r
+Allows to customize the condition goto statements used with <strong>:=></strong> style rules.\r
+You can use ‘@@’ to put the name of the condition or ustomize the placeholder\r
+using <strong>re2c:cond:goto@cond</strong>. You can also change this to ‘continue;’,\r
+which would allow you to continue with the next loop cycle including any code\r
+between loop start and re2c block.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:cond:goto@cond</strong> = @@; \r
+</dt>\r
+<dd>\r
+<p>\r
+Spcifies the placeholder that will be replaced with the condition label\r
+in <strong>re2c:cond:goto</strong>.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:indent:top</strong> = 0; \r
+</dt>\r
+<dd>\r
+<p>\r
+Specifies the minimum number of indendation to use. Requires a numeric value\r
+greater than or equal zero.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:indent:string</strong> = “\t”; \r
+</dt>\r
+<dd>\r
+<p>\r
+Specifies the string to use for indendation. Requires a string that should\r
+contain only whitespace unless you need this for external tools. The easiest\r
+way to specify spaces is to enclude them in single or double quotes. If you do\r
+not want any indendation at all you can simply set this to “”.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:yych:conversion</strong> = 0; \r
+</dt>\r
+<dd>\r
+<p>\r
+When this setting is non zero, then <strong>re2c</strong> automatically generates conversion\r
+code whenever yych gets read. In this case the type must be defined using\r
+<strong>re2c:define:YYCTYPE</strong>.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:yych:emit</strong> = 1; \r
+</dt>\r
+<dd>\r
+<p>\r
+Generation of <strong>yych</strong> can be suppressed by setting this to 0.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:yybm:hex</strong> = 0; \r
+</dt>\r
+<dd>\r
+<p>\r
+If set to zero then a decimal table is being used else a hexadecimal table\r
+will be generated.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:yyfill:enable</strong> = 1; \r
+</dt>\r
+<dd>\r
+<p>\r
+Set this to zero to suppress generation of <strong>YYFILL (n)</strong>. When using this be sure\r
+to verify that the generated scanner does not read behind input. Allowing\r
+this behavior might introduce sever security issues to you programs.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:yyfill:check</strong> = 1; \r
+</dt>\r
+<dd>\r
+<p>\r
+This can be set 0 to suppress output of the pre condition using <strong>YYCURSOR</strong> and\r
+<strong>YYLIMIT</strong> which becomes usefull when <strong>YYLIMIT + max (YYFILL)</strong> is always accessible.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:yyfill:parameter</strong> = 1; \r
+</dt>\r
+<dd>\r
+<p>\r
+Allows to suppress parameter passing to <strong>YYFILL</strong> calls. If set to zero\r
+then no parameter is passed to <strong>YYFILL</strong>. However <strong>define:YYFILL@LEN</strong>\r
+allows to specify a replacement string for the actual length value. If set to\r
+a non zero value then <strong>YYFILL</strong> usage will be followed by the number of\r
+requested characters in braces unless <strong>re2c:define:YYFILL:naked</strong> is set.\r
+Also look at <strong>re2c:define:YYFILL:naked</strong> and <strong>re2c:define:YYFILL@LEN</strong>.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:startlabel</strong> = 0; \r
+</dt>\r
+<dd>\r
+<p>\r
+If set to a non zero integer then the start label of the next scanner blocks\r
+will be generated even if not used by the scanner itself. Otherwise the normal\r
+<strong>yy0</strong> like start label is only being generated if needed. If set to a text\r
+value then a label with that text will be generated regardless of whether the\r
+normal start label is being used or not. This setting is being reset to <strong>0</strong>\r
+after a start label has been generated.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:labelprefix</strong> = yy; \r
+</dt>\r
+<dd>\r
+<p>\r
+Allows to change the prefix of numbered labels. The default is <strong>yy</strong> and\r
+can be set any string that is a valid label.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:state:abort</strong> = 0; \r
+</dt>\r
+<dd>\r
+<p>\r
+When not zero and switch <strong>-f</strong> is active then the <strong>YYGETSTATE</strong> block will\r
+contain a default case that aborts and a -1 case is used for initialization.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:state:nextlabel</strong> = 0; \r
+</dt>\r
+<dd>\r
+<p>\r
+Used when <strong>-f</strong> is active to control whether the <strong>YYGETSTATE</strong> block is\r
+followed by a <strong>yyNext:</strong> label line. Instead of using <strong>yyNext</strong> you can\r
+usually also use configuration <strong>startlabel</strong> to force a specific start label\r
+or default to <strong>yy0</strong> as start label. Instead of using a dedicated label it\r
+is often better to separate the <strong>YYGETSTATE</strong> code from the actual scanner code by\r
+placing a <strong>/*!getstate:re2c*/</strong> comment.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:cgoto:threshold</strong> = 9; \r
+</dt>\r
+<dd>\r
+<p>\r
+When <strong>-g</strong> is active this value specifies the complexity threshold that triggers\r
+generation of jump tables rather than using nested if’s and decision bitfields.\r
+The threshold is compared against a calculated estimation of if-s needed where\r
+every used bitmap divides the threshold by 2.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:yych:conversion</strong> = 0; \r
+</dt>\r
+<dd>\r
+<p>\r
+When the input uses signed characters and <strong>-s</strong> or <strong>-b</strong> switches are\r
+in effect re2c allows to automatically convert to the unsigned character type\r
+that is then necessary for its internal single character. When this setting\r
+is zero or an empty string the conversion is disabled. Using a non zero number\r
+the conversion is taken from <strong>YYCTYPE</strong>. If that is given by an inplace\r
+configuration that value is being used. Otherwise it will be <strong>(YYCTYPE)</strong>\r
+and changes to that configuration are no longer possible. When this setting is\r
+a string the braces must be specified. Now assuming your input is a <strong>char *</strong>\r
+buffer and you are using above mentioned switches you can set <strong>YYCTYPE</strong> to\r
+<strong>unsigned char</strong> and this setting to either <strong>1</strong> or <strong>(unsigned char)</strong>.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:define:YYCONDTYPE</strong> = <strong>YYCONDTYPE</strong>; \r
+</dt>\r
+<dd>\r
+<p>\r
+Enumeration used for condition support with <strong>-c</strong> mode.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:define:YYCTXMARKER</strong> = <strong>YYCTXMARKER</strong>; \r
+</dt>\r
+<dd>\r
+<p>\r
+Allows to overwrite the define <strong>YYCTXMARKER</strong> and thus avoiding it by setting the\r
+value to the actual code needed.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:define:YYCTYPE</strong> = <strong>YYCTYPE</strong>; \r
+</dt>\r
+<dd>\r
+<p>\r
+Allows to overwrite the define <strong>YYCTYPE</strong> and thus avoiding it by setting the\r
+value to the actual code needed.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:define:YYCURSOR</strong> = <strong>YYCURSOR</strong>; \r
+</dt>\r
+<dd>\r
+<p>\r
+Allows to overwrite the define <strong>YYCURSOR</strong> and thus avoiding it by setting the\r
+value to the actual code needed.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:define:YYDEBUG</strong> = <strong>YYDEBUG</strong>; \r
+</dt>\r
+<dd>\r
+<p>\r
+Allows to overwrite the define <strong>YYDEBUG</strong> and thus avoiding it by setting the\r
+value to the actual code needed.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:define:YYFILL</strong> = <strong>YYFILL</strong>; \r
+</dt>\r
+<dd>\r
+<p>\r
+Allows to overwrite the define <strong>YYFILL</strong> and thus avoiding it by setting the\r
+value to the actual code needed.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:define:YYFILL:naked</strong> = <strong>0</strong>; \r
+</dt>\r
+<dd>\r
+<p>\r
+When set to 1 neither braces, parameter nor semicolon gets emitted.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:define:YYFILL@len</strong> = @@; \r
+</dt>\r
+<dd>\r
+<p>\r
+When using <strong>re2c:define:YYFILL</strong> and <strong>re2c:yyfill:parameter</strong> is 0 then\r
+any occurence of this text inside <strong>YYFILL</strong> will be replaced with the actual\r
+length value.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:define:YYGETCONDITION</strong> = <strong>YYGETCONDITION</strong>; \r
+</dt>\r
+<dd>\r
+<p>\r
+Allows to overwrite the define <strong>YYGETCONDITION</strong>.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:define:YYGETCONDITION:naked</strong> = <strong>0</strong>; \r
+</dt>\r
+<dd>\r
+<p>\r
+When set to 1 neither braces, parameter nor semicolon gets emitted.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:define:YYGETSTATE</strong> = <strong>YYGETSTATE</strong>; \r
+</dt>\r
+<dd>\r
+<p>\r
+Allows to overwrite the define <strong>YYGETSTATE</strong> and thus avoiding it by setting the\r
+value to the actual code needed.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:define:YYGETSTATE:naked</strong> = <strong>0</strong>; \r
+</dt>\r
+<dd>\r
+<p>\r
+When set to 1 neither braces, parameter nor semicolon gets emitted.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:define:YYLIMIT</strong> = <strong>YYLIMIT</strong>; \r
+</dt>\r
+<dd>\r
+<p>\r
+Allows to overwrite the define <strong>YYLIMIT</strong> and thus avoiding it by setting the\r
+value to the actual code needed.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:define:YYMARKER</strong> = <strong>YYMARKER</strong>; \r
+</dt>\r
+<dd>\r
+<p>\r
+Allows to overwrite the define <strong>YYMARKER</strong> and thus avoiding it by setting the\r
+value to the actual code needed.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:define:YYSETCONDITION</strong> = <strong>YYSETCONDITION</strong>; \r
+</dt>\r
+<dd>\r
+<p>\r
+Allows to overwrite the define <strong>YYSETCONDITION</strong>.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:define:YYSETCONDITION@cond</strong> = @@; \r
+</dt>\r
+<dd>\r
+<p>\r
+When using <strong>re2c:define:YYSETCONDITION</strong> then any occurence of this text\r
+inside <strong>YYSETCONDITION</strong> will be replaced with the actual new condition value.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:define:YYSETSTATE</strong> = <strong>YYSETSTATE</strong>; \r
+</dt>\r
+<dd>\r
+<p>\r
+Allows to overwrite the define <strong>YYSETSTATE</strong> and thus avoiding it by setting the\r
+value to the actual code needed.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:define:YYSETSTATE:naked</strong> = <strong>0</strong>; \r
+</dt>\r
+<dd>\r
+<p>\r
+When set to 1 neither braces, parameter nor semicolon gets emitted.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:define:YYSETSTATE@state</strong> = @@; \r
+</dt>\r
+<dd>\r
+<p>\r
+When using <strong>re2c:define:YYSETSTATE</strong> then any occurence of this text\r
+inside <strong>YYSETSTATE</strong> will be replaced with the actual new state value.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:label:yyFillLabel</strong> = <strong>yyFillLabel</strong>; \r
+</dt>\r
+<dd>\r
+<p>\r
+Allows to overwrite the name of the label <strong>yyFillLabel</strong>.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:label:yyNext</strong> = <strong>yyNext</strong>; \r
+</dt>\r
+<dd>\r
+<p>\r
+Allows to overwrite the name of the label <strong>yyNext</strong>.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:variable:yyaccept</strong> = <strong>yyaccept</strong>; \r
+</dt>\r
+<dd>\r
+<p>\r
+Allows to overwrite the name of the variable <strong>yyaccept</strong>.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:variable:yybm</strong> = <strong>yybm</strong>; \r
+</dt>\r
+<dd>\r
+<p>\r
+Allows to overwrite the name of the variable <strong>yybm</strong>.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:variable:yych</strong> = <strong>yych</strong>; \r
+</dt>\r
+<dd>\r
+<p>\r
+Allows to overwrite the name of the variable <strong>yych</strong>.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:variable:yyctable</strong> = <strong>yyctable</strong>; \r
+</dt>\r
+<dd>\r
+<p>\r
+When both <strong>-c</strong> and <strong>-g</strong> are active then <strong>re2c</strong> uses this variable to\r
+generate a static jump table for <strong>YYGETCONDITION</strong>.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:variable:yystable</strong> = <strong>yystable</strong>; \r
+</dt>\r
+<dd>\r
+<p>\r
+When both <strong>-f</strong> and <strong>-g</strong> are active then <strong>re2c</strong> uses this variable to\r
+generate a static jump table for <strong>YYGETSTATE</strong>.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>re2c:variable:yytarget</strong> = <strong>yytarget</strong>; \r
+</dt>\r
+<dd>\r
+<p>\r
+Allows to overwrite the name of the variable <strong>yytarget</strong>.\r
+</p>\r
+</dd>\r
+</dl></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_scanner_with_storable_states">SCANNER WITH STORABLE STATES</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>When the <strong>-f</strong> flag is specified, <strong>re2c</strong> generates a scanner that\r
+can store its current state, return to the caller, and later resume\r
+operations exactly where it left off.</p></div>\r
+<div class="paragraph"><p>The default operation of <strong>re2c</strong> is a “pull” model, where the scanner asks\r
+for extra input whenever it needs it. However, this mode of operation\r
+assumes that the scanner is the “owner” the parsing loop, and that may\r
+not always be convenient.</p></div>\r
+<div class="paragraph"><p>Typically, if there is a preprocessor ahead of the scanner in the stream,\r
+or for that matter any other procedural source of data, the scanner cannot\r
+“ask” for more data unless both scanner and source live in a separate threads.</p></div>\r
+<div class="paragraph"><p>The <strong>-f</strong> flag is useful for just this situation: it lets users design\r
+scanners that work in a “push” model, i.e. where data is fed to the scanner\r
+chunk by chunk. When the scanner runs out of data to consume, it just stores\r
+its state, and return to the caller. When more input data is fed to the scanner,\r
+it resumes operations exactly where it left off.</p></div>\r
+<div class="paragraph"><p>When using the <strong>-f</strong> option <strong>re2c</strong> does not accept stdin because it has to do the\r
+full generation process twice which means it has to read the input twice. That\r
+means <strong>re2c</strong> would fail in case it cannot open the input twice or reading the\r
+input for the first time influences the second read attempt.</p></div>\r
+<div class="paragraph"><p>Changes needed compared to the “pull” model:</p></div>\r
+<div class="olist arabic"><ol class="arabic">\r
+<li>\r
+<p>\r
+User has to supply macros <strong>YYSETSTATE ()</strong> and <strong>YYGETSTATE (state)</strong>.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+The <strong>-f</strong> option inhibits declaration of <strong>yych</strong> and\r
+<strong>yyaccept</strong>. So the user has to declare these. Also the user has\r
+to save and restore these. In the example <strong>examples/push.re</strong> these\r
+are declared as fields of the (C\++) class of which the scanner is a\r
+method, so they do not need to be saved/restored explicitly. For C\r
+they could e.g. be made macros that select fields from a structure\r
+passed in as parameter. Alternatively, they could be declared as local\r
+variables, saved with <strong>YYFILL (n)</strong> when it decides to return and restored\r
+at entry to the function. Also, it could be more efficient to save the\r
+state from <strong>YYFILL (n)</strong> because <strong>YYSETSTATE (state)</strong> is called\r
+unconditionally. <strong>YYFILL (n)</strong> however does not get <strong>state</strong> as\r
+parameter, so we would have to store state in a local variable by\r
+<strong>YYSETSTATE (state)</strong>.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Modify <strong>YYFILL (n)</strong> to return (from the function calling it) if more input is needed.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Modify caller to recognise “more input is needed” and respond appropriately.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+The generated code will contain a switch block that is used to restores\r
+the last state by jumping behind the corrspoding <strong>YYFILL (n)</strong> call. This code is\r
+automatically generated in the epilog of the first <strong>/*!re2c */</strong> block.\r
+It is possible to trigger generation of the <strong>YYGETSTATE ()</strong> block earlier by\r
+placing a <strong>/*!getstate:re2c*/</strong> comment. This is especially useful when\r
+the scanner code should be wrapped inside a loop.\r
+</p>\r
+</li>\r
+</ol></div>\r
+<div class="paragraph"><p>Please see <strong>examples/push.re</strong> for push-model scanner. The generated code can be\r
+tweaked using inplace configurations <strong>state:abort</strong> and <strong>state:nextlabel</strong>.</p></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_scanner_with_condition_support">SCANNER WITH CONDITION SUPPORT</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>You can preceed regular expressions with a list of condition names when using the <strong>-c</strong>\r
+switch. In this case <strong>re2c</strong> generates scanner blocks for each conditon. Where each of the\r
+generated blocks has its own precondition. The precondition is given by the\r
+interface define <strong>YYGETCONDITON()</strong> and must be of type <strong>YYCONDTYPE</strong>.</p></div>\r
+<div class="paragraph"><p>There are two special rule types. First, the rules of the condition <strong>*</strong> are\r
+merged to all conditions. And second the empty condition list allows to\r
+provide a code block that does not have a scanner part. Meaning it does not\r
+allow any regular expression. The condition value referring to this special\r
+block is always the one with the enumeration value 0. This way the code of this\r
+special rule can be used to initialize a scanner. It is in no way necessary to\r
+have these rules: but sometimes it is helpful to have a dedicated uninitialized\r
+condition state.</p></div>\r
+<div class="paragraph"><p>Non empty rules allow to specify the new condition, which makes them\r
+transition rules. Besides generating calls for the define <strong>YYSETCONDTITION</strong>\r
+no other special code is generated.</p></div>\r
+<div class="paragraph"><p>There is another kind of special rules that allow to prepend code to any code\r
+block of all rules of a certain set of conditions or to all code blocks to all\r
+rules. This can be helpful when some operation is common among rules. For\r
+instance this can be used to store the length of the scanned string. These\r
+special setup rules start with an exclamation mark followed by either a list\r
+of conditions <strong><! condition, ... ></strong> or a star <strong><!*></strong>.\r
+When <strong>re2c</strong> generates the code for a rule whose state does not have a\r
+setup rule and a star’d setup rule is present, than that code will be used\r
+as setup code.</p></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_encodings">ENCODINGS</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p><strong>re2c</strong> supports the following encodings: ASCII (default), EBCDIC (<strong>-e</strong>), UCS-2 (<strong>-w</strong>),\r
+UTF-16 (<strong>-x</strong>), UTF-32 (<strong>-u</strong>) and UTF-8 (<strong>-8</strong>). ASCII is default. You can\r
+either pass cmd flag or use <em>inplace configuration</em> in the form <strong>re2c:flags</strong>.</p></div>\r
+<div class="paragraph"><p>The following concepts should be clarified when talking about encoding. <em>Code point</em>\r
+is an abstract number, which represents single encoding symbol. <em>Code unit</em> is the\r
+smallest unit of memory, which is used in the encoded text (it corresponds to one\r
+character in the input stream). One or more code units can be needed to represent\r
+a single code point, depending on the encoding. In <em>fixed-length</em> encoding, each\r
+code point is represented with equal number of code units. In <em>variable-length</em>\r
+encoding, different code points can be represented with different number of code units.</p></div>\r
+<div class="dlist"><dl>\r
+<dt class="hdlist1">\r
+<strong>ASCII</strong> \r
+</dt>\r
+<dd>\r
+<p>\r
+is a fixed-length encoding. Its code space includes 0x100 code points, from 0\r
+to 0xFF (note that this is <strong>re2c</strong>-specific understanding of ASCII). One code point\r
+is represented with exactly one 1-byte code unit, which has the same value as the\r
+code point. Size of <strong>YYCTYPE</strong> must be 1 byte.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>EBCDIC</strong> \r
+</dt>\r
+<dd>\r
+<p>\r
+is a fixed-length encoding. Its code space includes 0x100 code points, from 0\r
+to 0xFF. One code point is represented with exactly one 1-byte code unit, which has\r
+the same value as the code point. Size of <strong>YYCTYPE</strong> must be 1 byte.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>UCS-2</strong> \r
+</dt>\r
+<dd>\r
+<p>\r
+is a fixed-length encoding. Its code space includes 0x10000 code points, from 0\r
+to 0xFFFF. One code point is represented with exactly one 2-byte code unit, which has\r
+the same value as the code point. Size of <strong>YYCTYPE</strong> must be 2 bytes.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>UTF-16</strong> \r
+</dt>\r
+<dd>\r
+<p>\r
+is a variable-length encoding. Its code space includes all Unicode code points,\r
+from 0 to 0xD7FF and from 0xE000 to 0x10FFFF. One code point is represented with one or\r
+two 2-byte code units. Size of <strong>YYCTYPE</strong> must be 2 bytes.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>UTF-32</strong> \r
+</dt>\r
+<dd>\r
+<p>\r
+is a fixed-length encoding. Its code space includes all Unicode code points,\r
+from 0 to 0xD7FF and from 0xE000 to 0x10FFFF. One code point is represented with exactly\r
+one 4-byte code unit. Size of <strong>YYCTYPE</strong> must be 4 bytes.\r
+</p>\r
+</dd>\r
+<dt class="hdlist1">\r
+<strong>UTF-8</strong> \r
+</dt>\r
+<dd>\r
+<p>\r
+is a variable-length encoding. Its code space includes all\r
+Unicode code points, from 0 to 0xD7FF and from 0xE000 to 0x10FFFF. One code point\r
+is represented with sequence of one, two, three or four 1-byte code units. Size of\r
+<strong>YYCTYPE</strong> must be 1 bytes.\r
+</p>\r
+</dd>\r
+</dl></div>\r
+<div class="paragraph"><p>In Unicode, values from range 0xD800 to 0xDFFF (surrogates) are not valid Unicode\r
+code points, any encoded sequence of code units, that would map to Unicode code points\r
+in the range 0xD800-0xDFFF, is ill-formed.\r
+The user can control how <strong>re2c</strong> treats such ill-formed sequences with <strong>--encoding-policy</strong> <em>policy</em>\r
+flag (see <strong>OPTIONS</strong> section for full explanation).</p></div>\r
+<div class="paragraph"><p>For some encodings, there are code units, that never occur in valid encoded stream\r
+(e.g. 0xFF byte in UTF-8). If the generated scanner must check for invalid input,\r
+the only true way to do so is to use default rule <strong>*</strong>.\r
+Note, that full range rule <strong>[^]</strong> won’t catch invalid code units when variable-length encoding is used\r
+(<strong>[^]</strong> means “all valid code points”, while default rule <strong>*</strong> means “all possible code units”:\r
+see <strong>Note</strong> about default rule in <strong>SYNTAX</strong> section).</p></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_generic_input_api">GENERIC INPUT API</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p><strong>re2c</strong> usually operates on input using pointer-like primitives <strong>YYCURSOR</strong>, <strong>YYMARKER</strong>, <strong>YYCTXMARKER</strong> and <strong>YYLIMIT</strong>.</p></div>\r
+<div class="paragraph"><p>Generic input API (enabled with <strong>--input custom</strong> switch) allows to customize input operations.\r
+In this mode, <strong>re2c</strong> will express all operations on input in terms of the following primitives:</p></div>\r
+<div class="olist arabic"><ol class="arabic">\r
+<li>\r
+<p>\r
+<strong>YYPEEK ()</strong> --- get current input character\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+<strong>YYSKIP ()</strong> --- advance to the next character\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+<strong>YYBACKUP ()</strong> --- backup current input position\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+<strong>YYBACKUPCTX ()</strong> --- backup current input position for trailing context\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+<strong>YYRESTORE ()</strong> --- restore current input position\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+<strong>YYRESTORECTX ()</strong> --- restore current input position for trailing context\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+<strong>YYLESSTHAN (n)</strong> --- check if less than <strong>n</strong> input characters are left\r
+</p>\r
+</li>\r
+</ol></div>\r
+<div class="paragraph"><p>This article (<a href="http://skvadrik.github.io/aleph_null/posts/re2c/2015-01-13-input_model.html">http://skvadrik.github.io/aleph_null/posts/re2c/2015-01-13-input_model.html</a>)\r
+has more details, and you can find some usage examples:\r
+<a href="http://skvadrik.github.io/aleph_null/posts/re2c/2015-01-15-input_model_custom.html">http://skvadrik.github.io/aleph_null/posts/re2c/2015-01-15-input_model_custom.html</a> .</p></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_understanding_re2c">UNDERSTANDING RE2C</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>The subdirectory examples of the <strong>re2c</strong> distribution contains a few step by step\r
+examples to get you started with <strong>re2c</strong>. All examples in the lessons subdirectory\r
+can be compiled and actually work.</p></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_bugs">BUGS</h2>\r
+<div class="sectionbody">\r
+<div class="olist arabic"><ol class="arabic">\r
+<li>\r
+<p>\r
+Difference only works for character sets, and not in UTF-8 mode.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+The generated DFA is not minimal.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Features, that are naturally orthogonal (such as reusable rules, conditions,\r
+setup rules and default rules), cannot always be combined. E.g., one cannot set\r
+setup/default rule for condition in scanner with reusable rules.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+<strong>re2c</strong> does too much unnecessary work: e.g., if <strong>/*!use:re2c ... */</strong> block has\r
+additional rules, these rules are parsed 4 times, while they should be parsed only once.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+The <strong>re2c</strong> internal algorithms need documentation.\r
+</p>\r
+</li>\r
+</ol></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_see_also">SEE ALSO</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>flex(1), lex(1), quex (<a href="http://quex.sourceforge.net">http://quex.sourceforge.net</a>)</p></div>\r
+<div class="paragraph"><p>More information on <strong>re2c</strong> can be found here: <a href="http://re2c.org/">http://re2c.org/</a>.</p></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_authors">AUTHORS</h2>\r
+<div class="sectionbody">\r
+<div class="olist arabic"><ol class="arabic">\r
+<li>\r
+<p>\r
+Peter Bumbulis <a href="mailto:peter@csg.uwaterloo.ca">peter@csg.uwaterloo.ca</a>\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Brian Young <a href="mailto:bayoung@acm.org">bayoung@acm.org</a>\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Dan Nuffer <a href="mailto:nuffer@users.sourceforge.net">nuffer@users.sourceforge.net</a>\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Marcus Boerger <a href="mailto:helly@users.sourceforge.net">helly@users.sourceforge.net</a>\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Hartmut Kaiser <a href="mailto:hkaiser@users.sourceforge.net">hkaiser@users.sourceforge.net</a>\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Emmanuel Mogenet <a href="mailto:mgix@mgix.com">mgix@mgix.com</a> (added storable state)\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Ulya Trofimovich <a href="mailto:skvadrik@gmail.com">skvadrik@gmail.com</a>\r
+</p>\r
+</li>\r
+</ol></div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
+<h2 id="_version_information">VERSION INFORMATION</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>This manpage describes <strong>re2c</strong>, version 0.14.1.dev, package date 08 May 2015.</p></div>\r
+</div>\r
+</div>\r
+</div>\r
+<div id="footnotes"><hr /></div>\r
+<div id="footer">\r
+<div id="footer-text">\r
+Last updated 2015-05-08 22:17:12 BST\r
+</div>\r
+</div>\r
+</body>\r
+</html>\r
/* Copy the first part of user declarations. */
+/* Line 189 of yacc.c */
+#line 1 "../src/parser.ypp"
/* $Id$ */
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
#include <assert.h>
#include <time.h>
#include <string.h>
#include <iostream>
#include <set>
-#include "globals.h"
-#include "parser.h"
-#include "c99_stdint.h"
-#include "dfa.h"
-#include "smart_ptr.h"
+#include "config.h"
+#include "src/c99_stdint.h"
+#include "src/dfa.h"
+#include "src/globals.h"
+#include "src/parser.h"
+#include "src/smart_ptr.h"
#define YYMALLOC malloc
#define YYFREE free
+/* Line 189 of yacc.c */
+#line 219 "./parser.cc"
/* Enabling traces. */
#ifndef YYDEBUG
FID = 270
};
#endif
-/* Tokens. */
-#define CLOSESIZE 258
-#define CLOSE 259
-#define STAR 260
-#define NOCOND 261
-#define ID 262
-#define CODE 263
-#define RANGE 264
-#define STRING 265
-#define CONFIG 266
-#define VALUE 267
-#define NUMBER 268
-#define SETUP 269
-#define FID 270
-
typedef union YYSTYPE
{
+/* Line 214 of yacc.c */
+#line 149 "../src/parser.ypp"
re2c::Symbol *symbol;
re2c::RegExp *regexp;
+/* Line 214 of yacc.c */
+#line 283 "./parser.cc"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
/* Copy the second part of user declarations. */
+/* Line 264 of yacc.c */
+#line 295 "./parser.cc"
#ifdef short
# undef short
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 181, 181, 183, 187, 191, 200, 209, 213, 217,
- 223, 231, 240, 249, 253, 258, 263, 269, 273, 281,
- 289, 294, 300, 306, 318, 330, 336, 344, 347, 354,
- 359, 368, 371, 379, 382, 389, 393, 400, 404, 415,
- 419, 426, 430, 445, 452, 456, 460, 464, 471, 479,
- 483, 487
+ 0, 178, 178, 180, 184, 188, 197, 206, 210, 214,
+ 220, 228, 237, 246, 250, 255, 260, 266, 270, 278,
+ 286, 291, 297, 303, 315, 327, 333, 341, 344, 351,
+ 356, 365, 368, 376, 379, 386, 390, 397, 401, 412,
+ 416, 423, 427, 442, 449, 453, 457, 461, 468, 476,
+ 480, 484
};
#endif
{
case 2:
+/* Line 1464 of yacc.c */
+#line 178 "../src/parser.ypp"
{
- }
+ ;}
break;
case 3:
+/* Line 1464 of yacc.c */
+#line 181 "../src/parser.ypp"
{
foundRules = true;
- }
+ ;}
break;
case 5:
+/* Line 1464 of yacc.c */
+#line 189 "../src/parser.ypp"
{
if ((yyvsp[(1) - (4)].symbol)->re)
{
}
(yyvsp[(3) - (4)].regexp)->ins_access = RegExp::PRIVATE;
(yyvsp[(1) - (4)].symbol)->re = (yyvsp[(3) - (4)].regexp);
- }
+ ;}
break;
case 6:
+/* Line 1464 of yacc.c */
+#line 198 "../src/parser.ypp"
{
if ((yyvsp[(1) - (2)].symbol)->re)
{
}
(yyvsp[(2) - (2)].regexp)->ins_access = RegExp::PRIVATE;
(yyvsp[(1) - (2)].symbol)->re = (yyvsp[(2) - (2)].regexp);
- }
+ ;}
break;
case 7:
+/* Line 1464 of yacc.c */
+#line 207 "../src/parser.ypp"
{
in->fatal("trailing contexts are not allowed in named definitions");
- }
+ ;}
break;
case 8:
+/* Line 1464 of yacc.c */
+#line 211 "../src/parser.ypp"
{
in->fatal("trailing contexts are not allowed in named definitions");
- }
+ ;}
break;
case 9:
+/* Line 1464 of yacc.c */
+#line 215 "../src/parser.ypp"
{
in->config(*(yyvsp[(1) - (4)].str), *(yyvsp[(3) - (4)].str));
delete (yyvsp[(1) - (4)].str);
delete (yyvsp[(3) - (4)].str);
- }
+ ;}
break;
case 10:
+/* Line 1464 of yacc.c */
+#line 221 "../src/parser.ypp"
{
in->config(*(yyvsp[(1) - (4)].str), (yyvsp[(3) - (4)].number));
delete (yyvsp[(1) - (4)].str);
- }
+ ;}
break;
case 11:
+/* Line 1464 of yacc.c */
+#line 229 "../src/parser.ypp"
{
if (cFlag)
{
}
(yyval.regexp) = new RuleOp((yyvsp[(1) - (3)].regexp), (yyvsp[(2) - (3)].regexp), (yyvsp[(3) - (3)].token), accept++, RegExp::SHARED);
spec = spec? mkAlt(spec, (yyval.regexp)) : (yyval.regexp);
- }
+ ;}
break;
case 12:
+/* Line 1464 of yacc.c */
+#line 238 "../src/parser.ypp"
{
if (cFlag)
in->fatal("condition or '<*>' required when using -c switch");
in->fatal("code to default rule is already defined");
else
ruleDefault = (yyvsp[(2) - (2)].token);
- }
+ ;}
break;
case 13:
+/* Line 1464 of yacc.c */
+#line 247 "../src/parser.ypp"
{
context_rule((yyvsp[(2) - (7)].clist), (yyvsp[(4) - (7)].regexp), (yyvsp[(5) - (7)].regexp), (yyvsp[(6) - (7)].str), (yyvsp[(7) - (7)].token));
- }
+ ;}
break;
case 14:
+/* Line 1464 of yacc.c */
+#line 251 "../src/parser.ypp"
{
assert((yyvsp[(7) - (7)].str));
context_rule((yyvsp[(2) - (7)].clist), (yyvsp[(4) - (7)].regexp), (yyvsp[(5) - (7)].regexp), (yyvsp[(7) - (7)].str), NULL);
- }
+ ;}
break;
case 15:
+/* Line 1464 of yacc.c */
+#line 256 "../src/parser.ypp"
{
context_none((yyvsp[(2) - (6)].clist));
delete (yyvsp[(5) - (6)].str);
- }
+ ;}
break;
case 16:
+/* Line 1464 of yacc.c */
+#line 261 "../src/parser.ypp"
{
assert((yyvsp[(6) - (6)].str));
context_none((yyvsp[(2) - (6)].clist));
delete (yyvsp[(6) - (6)].str);
- }
+ ;}
break;
case 17:
+/* Line 1464 of yacc.c */
+#line 267 "../src/parser.ypp"
{
default_rule((yyvsp[(2) - (5)].clist), (yyvsp[(5) - (5)].token));
- }
+ ;}
break;
case 18:
+/* Line 1464 of yacc.c */
+#line 271 "../src/parser.ypp"
{
context_check(NULL);
Token *token = new Token((yyvsp[(7) - (7)].token), (yyvsp[(7) - (7)].token)->source, (yyvsp[(7) - (7)].token)->line, (yyvsp[(6) - (7)].str));
delete (yyvsp[(7) - (7)].token);
delete (yyvsp[(6) - (7)].str);
specStar.push_back(new RuleOp((yyvsp[(4) - (7)].regexp), (yyvsp[(5) - (7)].regexp), token, accept++, RegExp::PRIVATE));
- }
+ ;}
break;
case 19:
+/* Line 1464 of yacc.c */
+#line 279 "../src/parser.ypp"
{
assert((yyvsp[(7) - (7)].str));
context_check(NULL);
Token *token = new Token(NULL, in->get_fname (), in->get_cline (), (yyvsp[(7) - (7)].str));
delete (yyvsp[(7) - (7)].str);
specStar.push_back(new RuleOp((yyvsp[(4) - (7)].regexp), (yyvsp[(5) - (7)].regexp), token, accept++, RegExp::PRIVATE));
- }
+ ;}
break;
case 20:
+/* Line 1464 of yacc.c */
+#line 287 "../src/parser.ypp"
{
context_none(NULL);
delete (yyvsp[(5) - (6)].str);
- }
+ ;}
break;
case 21:
+/* Line 1464 of yacc.c */
+#line 292 "../src/parser.ypp"
{
assert((yyvsp[(6) - (6)].str));
context_none(NULL);
delete (yyvsp[(6) - (6)].str);
- }
+ ;}
break;
case 22:
+/* Line 1464 of yacc.c */
+#line 298 "../src/parser.ypp"
{
CondList *clist = new CondList();
clist->insert("*");
default_rule(clist, (yyvsp[(5) - (5)].token));
- }
+ ;}
break;
case 23:
+/* Line 1464 of yacc.c */
+#line 304 "../src/parser.ypp"
{
context_check(NULL);
if (specNone)
delete (yyvsp[(2) - (3)].str);
delete (yyvsp[(3) - (3)].token);
(yyval.regexp) = specNone = new RuleOp(new NullOp(), new NullOp(), token, accept++, RegExp::SHARED);
- }
+ ;}
break;
case 24:
+/* Line 1464 of yacc.c */
+#line 316 "../src/parser.ypp"
{
assert((yyvsp[(3) - (3)].str));
context_check(NULL);
Token *token = new Token(NULL, in->get_fname (), in->get_cline (), (yyvsp[(3) - (3)].str));
delete (yyvsp[(3) - (3)].str);
(yyval.regexp) = specNone = new RuleOp(new NullOp(), new NullOp(), token, accept++, RegExp::SHARED);
- }
+ ;}
break;
case 25:
+/* Line 1464 of yacc.c */
+#line 328 "../src/parser.ypp"
{
CondList *clist = new CondList();
clist->insert("*");
setup_rule(clist, (yyvsp[(4) - (4)].token));
- }
+ ;}
break;
case 26:
+/* Line 1464 of yacc.c */
+#line 334 "../src/parser.ypp"
{
setup_rule((yyvsp[(2) - (4)].clist), (yyvsp[(4) - (4)].token));
- }
+ ;}
break;
case 27:
+/* Line 1464 of yacc.c */
+#line 341 "../src/parser.ypp"
{
in->fatal("unnamed condition not supported");
- }
+ ;}
break;
case 28:
+/* Line 1464 of yacc.c */
+#line 345 "../src/parser.ypp"
{
(yyval.clist) = (yyvsp[(1) - (1)].clist);
- }
+ ;}
break;
case 29:
+/* Line 1464 of yacc.c */
+#line 352 "../src/parser.ypp"
{
(yyval.clist) = new CondList();
(yyval.clist)->insert((yyvsp[(1) - (1)].symbol)->GetName().to_string());
- }
+ ;}
break;
case 30:
+/* Line 1464 of yacc.c */
+#line 357 "../src/parser.ypp"
{
(yyvsp[(1) - (3)].clist)->insert((yyvsp[(3) - (3)].symbol)->GetName().to_string());
(yyval.clist) = (yyvsp[(1) - (3)].clist);
- }
+ ;}
break;
case 31:
+/* Line 1464 of yacc.c */
+#line 365 "../src/parser.ypp"
{
(yyval.str) = NULL;
- }
+ ;}
break;
case 32:
+/* Line 1464 of yacc.c */
+#line 369 "../src/parser.ypp"
{
(yyval.str) = new Str((yyvsp[(3) - (3)].symbol)->GetName().to_string().c_str());
- }
+ ;}
break;
case 33:
+/* Line 1464 of yacc.c */
+#line 376 "../src/parser.ypp"
{
(yyval.regexp) = new NullOp;
- }
+ ;}
break;
case 34:
+/* Line 1464 of yacc.c */
+#line 380 "../src/parser.ypp"
{
(yyval.regexp) = (yyvsp[(2) - (2)].regexp);
- }
+ ;}
break;
case 35:
+/* Line 1464 of yacc.c */
+#line 387 "../src/parser.ypp"
{
(yyval.regexp) = (yyvsp[(1) - (1)].regexp);
- }
+ ;}
break;
case 36:
+/* Line 1464 of yacc.c */
+#line 391 "../src/parser.ypp"
{
(yyval.regexp) = mkAlt((yyvsp[(1) - (3)].regexp), (yyvsp[(3) - (3)].regexp));
- }
+ ;}
break;
case 37:
+/* Line 1464 of yacc.c */
+#line 398 "../src/parser.ypp"
{
(yyval.regexp) = (yyvsp[(1) - (1)].regexp);
- }
+ ;}
break;
case 38:
+/* Line 1464 of yacc.c */
+#line 402 "../src/parser.ypp"
{
(yyval.regexp) = mkDiff((yyvsp[(1) - (3)].regexp), (yyvsp[(3) - (3)].regexp));
if(!(yyval.regexp))
{
in->fatal("can only difference char sets");
}
- }
+ ;}
break;
case 39:
+/* Line 1464 of yacc.c */
+#line 413 "../src/parser.ypp"
{
(yyval.regexp) = (yyvsp[(1) - (1)].regexp);
- }
+ ;}
break;
case 40:
+/* Line 1464 of yacc.c */
+#line 417 "../src/parser.ypp"
{
(yyval.regexp) = new CatOp((yyvsp[(1) - (2)].regexp), (yyvsp[(2) - (2)].regexp));
- }
+ ;}
break;
case 41:
+/* Line 1464 of yacc.c */
+#line 424 "../src/parser.ypp"
{
(yyval.regexp) = (yyvsp[(1) - (1)].regexp);
- }
+ ;}
break;
case 42:
+/* Line 1464 of yacc.c */
+#line 428 "../src/parser.ypp"
{
switch((yyvsp[(2) - (2)].op))
{
(yyval.regexp) = mkAlt((yyvsp[(1) - (2)].regexp), new NullOp());
break;
}
- }
+ ;}
break;
case 43:
+/* Line 1464 of yacc.c */
+#line 443 "../src/parser.ypp"
{
(yyval.regexp) = new CloseVOp((yyvsp[(1) - (2)].regexp), (yyvsp[(2) - (2)].extop).minsize, (yyvsp[(2) - (2)].extop).maxsize);
- }
+ ;}
break;
case 44:
+/* Line 1464 of yacc.c */
+#line 450 "../src/parser.ypp"
{
(yyval.op) = (yyvsp[(1) - (1)].op);
- }
+ ;}
break;
case 45:
+/* Line 1464 of yacc.c */
+#line 454 "../src/parser.ypp"
{
(yyval.op) = (yyvsp[(1) - (1)].op);
- }
+ ;}
break;
case 46:
+/* Line 1464 of yacc.c */
+#line 458 "../src/parser.ypp"
{
(yyval.op) = ((yyvsp[(1) - (2)].op) == (yyvsp[(2) - (2)].op)) ? (yyvsp[(1) - (2)].op) : '*';
- }
+ ;}
break;
case 47:
+/* Line 1464 of yacc.c */
+#line 462 "../src/parser.ypp"
{
(yyval.op) = ((yyvsp[(1) - (2)].op) == (yyvsp[(2) - (2)].op)) ? (yyvsp[(1) - (2)].op) : '*';
- }
+ ;}
break;
case 48:
+/* Line 1464 of yacc.c */
+#line 469 "../src/parser.ypp"
{
if(!(yyvsp[(1) - (1)].symbol)->re)
{
in->fatal("can't find symbol");
}
(yyval.regexp) = (yyvsp[(1) - (1)].symbol)->re;
- }
+ ;}
break;
case 49:
+/* Line 1464 of yacc.c */
+#line 477 "../src/parser.ypp"
{
(yyval.regexp) = (yyvsp[(1) - (1)].regexp);
- }
+ ;}
break;
case 50:
+/* Line 1464 of yacc.c */
+#line 481 "../src/parser.ypp"
{
(yyval.regexp) = (yyvsp[(1) - (1)].regexp);
- }
+ ;}
break;
case 51:
+/* Line 1464 of yacc.c */
+#line 485 "../src/parser.ypp"
{
(yyval.regexp) = (yyvsp[(2) - (3)].regexp);
- }
+ ;}
break;
+/* Line 1464 of yacc.c */
+#line 2095 "./parser.cc"
default: break;
}
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
+/* Line 1684 of yacc.c */
+#line 490 "../src/parser.ypp"
extern "C" {
.\" Title: re2c
.\" Author: [see the "AUTHORS" section]
.\" Generator: DocBook XSL Stylesheets v1.78.0 <http://docbook.sf.net/>
-.\" Date: 02/23/2015
+.\" Date: 05/08/2015
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "RE2C" "1" "02/23/2015" "\ \&" "\ \&"
+.TH "RE2C" "1" "05/08/2015" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
\fB(unsigned char)\fR\&.
.RE
.PP
-\fBre2c:define:define:YYCONDTYPE\fR = \fBYYCONDTYPE\fR;
+\fBre2c:define:YYCONDTYPE\fR = \fBYYCONDTYPE\fR;
.RS 4
Enumeration used for condition support with
\fB\-c\fR
This article (http://skvadrik\&.github\&.io/aleph_null/posts/re2c/2015\-01\-13\-input_model\&.html) has more details, and you can find some usage examples: http://skvadrik\&.github\&.io/aleph_null/posts/re2c/2015\-01\-15\-input_model_custom\&.html \&.
.SH "UNDERSTANDING RE2C"
.sp
-The subdirectory lessons of the \fBre2c\fR distribution contains a few step by step lessons to get you started with \fBre2c\fR\&. All examples in the lessons subdirectory can be compiled and actually work\&.
+The subdirectory examples of the \fBre2c\fR distribution contains a few step by step examples to get you started with \fBre2c\fR\&. All examples in the lessons subdirectory can be compiled and actually work\&.
.SH "BUGS"
.sp
.RS 4
.RE
.SH "VERSION INFORMATION"
.sp
-This manpage describes \fBre2c\fR, version 0\&.14, package date 23 Feb 2015\&.
+This manpage describes \fBre2c\fR, version 0\&.14\&.1\&.dev, package date 08 May 2015\&.
-/* Generated by re2c 0.14.1.dev on Mon Apr 20 23:30:58 2015*/
+/* Generated by re2c 0.14.1.dev on Fri May 8 22:17:28 2015*/
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <sstream>
-#include "scanner.h"
-#include "parser.h"
+
+#include "src/dfa.h"
+#include "src/globals.h"
+#include "src/parser.h"
+#include "src/print.h"
+#include "src/scanner.h"
#include "y.tab.h"
-#include "globals.h"
-#include "dfa.h"
-#include "print.h"
extern YYSTYPE yylval;
FID = 270
};
#endif
-/* Tokens. */
-#define CLOSESIZE 258
-#define CLOSE 259
-#define STAR 260
-#define NOCOND 261
-#define ID 262
-#define CODE 263
-#define RANGE 264
-#define STRING 265
-#define CONFIG 266
-#define VALUE 267
-#define NUMBER 268
-#define SETUP 269
-#define FID 270
-
typedef union YYSTYPE
{
+/* Line 1685 of yacc.c */
+#line 149 "../src/parser.ypp"
re2c::Symbol *symbol;
re2c::RegExp *regexp;
+/* Line 1685 of yacc.c */
+#line 79 "./y.tab.h"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+++ /dev/null
-#!/bin/sh
-
-make && \
-for n in $(find test -name '*2102138*.re'|sed 's,.re,,'); do
- ./run_tests.sh ${n}.re
- test -f ${n}.c.temp && mv -f ${n}.c.temp ${n}.c
- gcc ${n}.c -o ${n}.o
- ./${n}.o >${n}.out
- if $(diff -du ${n}.txt ${n}.out >${n}.out.diff); then
- echo "OK"
- rm -f ${n}.out ${n}.out.diff
- else
- echo "FAIL"
- fi
-done
\ No newline at end of file
--- /dev/null
+#!/bin/sh
+
+builddir=.build
+rm -rf $builddir
+mkdir $builddir
+
+cd $builddir
+../configure --enable-docs --enable-silent-rules && \
+make bootstrap -j5
+cd ..
+++ /dev/null
-// taken from:
-// http://groups.csail.mit.edu/cis/md6/submitted-2008-10-27/Optimized_64bit/
-
-// ISO C9x compliant stdint.h for Microsoft Visual Studio
-// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
-//
-// Copyright (c) 2006 Alexander Chemeris
-//
-// 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.
-//
-// 3. The name of the author may be used to endorse or promote products
-// derived from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
-// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
-// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-///////////////////////////////////////////////////////////////////////////////
-
-#ifdef __GNUC__
-# define __STDINT_H_IS_PRESENT
-#endif /* __GNUC__ */
-
-#ifdef _MSC_VER
-# if _MSC_VER >= 1600
-# define __STDINT_H_IS_PRESENT
-# endif
-#endif /* _MSC_VER */
-
-#ifdef __STDINT_H_IS_PRESENT // [
-// c99 compliant compiler
-#include <stdint.h>
-#else
-
-#ifndef _MSC_STDINT_H_ // [
-#define _MSC_STDINT_H_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif
-
-#include <limits.h>
-
-// For Visual Studio 6 in C++ mode wrap <wchar.h> include with 'extern "C++" {}'
-// or compiler give many errors like this:
-// error C2733: second C linkage of overloaded function 'wmemchr' not allowed
-#if (_MSC_VER < 1300) && defined(__cplusplus)
- extern "C++" {
-#endif
-# include <wchar.h>
-#if (_MSC_VER < 1300) && defined(__cplusplus)
- }
-#endif
-
-// 7.18.1 Integer types
-
-// 7.18.1.1 Exact-width integer types
-typedef signed __int8 int8_t;
-typedef signed __int16 int16_t;
-typedef signed __int32 int32_t;
-typedef signed __int64 int64_t;
-typedef unsigned __int8 uint8_t;
-typedef unsigned __int16 uint16_t;
-typedef unsigned __int32 uint32_t;
-typedef unsigned __int64 uint64_t;
-
-// 7.18.1.2 Minimum-width integer types
-typedef int8_t int_least8_t;
-typedef int16_t int_least16_t;
-typedef int32_t int_least32_t;
-typedef int64_t int_least64_t;
-typedef uint8_t uint_least8_t;
-typedef uint16_t uint_least16_t;
-typedef uint32_t uint_least32_t;
-typedef uint64_t uint_least64_t;
-
-// 7.18.1.3 Fastest minimum-width integer types
-typedef int8_t int_fast8_t;
-typedef int16_t int_fast16_t;
-typedef int32_t int_fast32_t;
-typedef int64_t int_fast64_t;
-typedef uint8_t uint_fast8_t;
-typedef uint16_t uint_fast16_t;
-typedef uint32_t uint_fast32_t;
-typedef uint64_t uint_fast64_t;
-
-// 7.18.1.4 Integer types capable of holding object pointers
-#ifdef _WIN64 // [
- typedef __int64 intptr_t;
- typedef unsigned __int64 uintptr_t;
-#else // _WIN64 ][
- typedef int intptr_t;
- typedef unsigned int uintptr_t;
-#endif // _WIN64 ]
-
-// 7.18.1.5 Greatest-width integer types
-typedef int64_t intmax_t;
-typedef uint64_t uintmax_t;
-
-
-// 7.18.2 Limits of specified-width integer types
-
-#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259
-
-// 7.18.2.1 Limits of exact-width integer types
-#define INT8_MIN ((int8_t)_I8_MIN)
-#define INT8_MAX _I8_MAX
-#define INT16_MIN ((int16_t)_I16_MIN)
-#define INT16_MAX _I16_MAX
-#define INT32_MIN ((int32_t)_I32_MIN)
-#define INT32_MAX _I32_MAX
-#define INT64_MIN ((int64_t)_I64_MIN)
-#define INT64_MAX _I64_MAX
-#define UINT8_MAX _UI8_MAX
-#define UINT16_MAX _UI16_MAX
-#define UINT32_MAX _UI32_MAX
-#define UINT64_MAX _UI64_MAX
-
-// 7.18.2.2 Limits of minimum-width integer types
-#define INT_LEAST8_MIN INT8_MIN
-#define INT_LEAST8_MAX INT8_MAX
-#define INT_LEAST16_MIN INT16_MIN
-#define INT_LEAST16_MAX INT16_MAX
-#define INT_LEAST32_MIN INT32_MIN
-#define INT_LEAST32_MAX INT32_MAX
-#define INT_LEAST64_MIN INT64_MIN
-#define INT_LEAST64_MAX INT64_MAX
-#define UINT_LEAST8_MAX UINT8_MAX
-#define UINT_LEAST16_MAX UINT16_MAX
-#define UINT_LEAST32_MAX UINT32_MAX
-#define UINT_LEAST64_MAX UINT64_MAX
-
-// 7.18.2.3 Limits of fastest minimum-width integer types
-#define INT_FAST8_MIN INT8_MIN
-#define INT_FAST8_MAX INT8_MAX
-#define INT_FAST16_MIN INT16_MIN
-#define INT_FAST16_MAX INT16_MAX
-#define INT_FAST32_MIN INT32_MIN
-#define INT_FAST32_MAX INT32_MAX
-#define INT_FAST64_MIN INT64_MIN
-#define INT_FAST64_MAX INT64_MAX
-#define UINT_FAST8_MAX UINT8_MAX
-#define UINT_FAST16_MAX UINT16_MAX
-#define UINT_FAST32_MAX UINT32_MAX
-#define UINT_FAST64_MAX UINT64_MAX
-
-// 7.18.2.4 Limits of integer types capable of holding object pointers
-#ifdef _WIN64 // [
-# define INTPTR_MIN INT64_MIN
-# define INTPTR_MAX INT64_MAX
-# define UINTPTR_MAX UINT64_MAX
-#else // _WIN64 ][
-# define INTPTR_MIN INT32_MIN
-# define INTPTR_MAX INT32_MAX
-# define UINTPTR_MAX UINT32_MAX
-#endif // _WIN64 ]
-
-// 7.18.2.5 Limits of greatest-width integer types
-#define INTMAX_MIN INT64_MIN
-#define INTMAX_MAX INT64_MAX
-#define UINTMAX_MAX UINT64_MAX
-
-// 7.18.3 Limits of other integer types
-
-#ifdef _WIN64 // [
-# define PTRDIFF_MIN _I64_MIN
-# define PTRDIFF_MAX _I64_MAX
-#else // _WIN64 ][
-# define PTRDIFF_MIN _I32_MIN
-# define PTRDIFF_MAX _I32_MAX
-#endif // _WIN64 ]
-
-#define SIG_ATOMIC_MIN INT_MIN
-#define SIG_ATOMIC_MAX INT_MAX
-
-#ifndef SIZE_MAX // [
-# ifdef _WIN64 // [
-# define SIZE_MAX _UI64_MAX
-# else // _WIN64 ][
-# define SIZE_MAX _UI32_MAX
-# endif // _WIN64 ]
-#endif // SIZE_MAX ]
-
-// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h>
-#ifndef WCHAR_MIN // [
-# define WCHAR_MIN 0
-#endif // WCHAR_MIN ]
-#ifndef WCHAR_MAX // [
-# define WCHAR_MAX _UI16_MAX
-#endif // WCHAR_MAX ]
-
-#define WINT_MIN 0
-#define WINT_MAX _UI16_MAX
-
-#endif // __STDC_LIMIT_MACROS ]
-
-
-// 7.18.4 Limits of other integer types
-
-#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260
-
-// 7.18.4.1 Macros for minimum-width integer constants
-
-#define INT8_C(val) val##i8
-#define INT16_C(val) val##i16
-#define INT32_C(val) val##i32
-#define INT64_C(val) val##i64
-
-#define UINT8_C(val) val##ui8
-#define UINT16_C(val) val##ui16
-#define UINT32_C(val) val##ui32
-#define UINT64_C(val) val##ui64
-
-// 7.18.4.2 Macros for greatest-width integer constants
-#define INTMAX_C INT64_C
-#define UINTMAX_C UINT64_C
-
-#endif // __STDC_CONSTANT_MACROS ]
-
-
-#endif // _MSC_STDINT_H_ ]
-#endif
+++ /dev/null
-/* config.h. Generated by configure. */
-/* config.h.in. Generated from configure.in by autoheader. */
-
-/* Define to 1 if you have the `getpagesize' function. */
-#define HAVE_GETPAGESIZE 1
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#define HAVE_INTTYPES_H 1
-
-/* Define to 1 if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define to 1 if you have the `memset' function. */
-#define HAVE_MEMSET 1
-
-/* Define to 1 if you have a working `mmap' system call. */
-/* #undef HAVE_MMAP */
-
-/* Define to 1 if you have the `munmap' function. */
-#define HAVE_MUNMAP 1
-
-/* Define to 1 if stdbool.h conforms to C99. */
-#define HAVE_STDBOOL_H 1
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#define HAVE_STDINT_H 1
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define to 1 if you have the `strdup' function. */
-#define HAVE_STRDUP 1
-
-/* Define to 1 if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define to 1 if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#define HAVE_SYS_STAT_H 1
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#define HAVE_SYS_TYPES_H 1
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define to 1 if the system has the type `_Bool'. */
-#define HAVE__BOOL 1
-
-/* Name of package */
-#define PACKAGE "re2c"
-
-/* Define to the address where bug reports for this package should be sent. */
-#define PACKAGE_BUGREPORT "re2c-general@lists.sourceforge.net"
-
-/* Define to the full name of this package. */
-#define PACKAGE_NAME "re2c"
-
-/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "re2c 0.14.1.dev"
-
-/* Define to the one symbol short name of this package. */
-#define PACKAGE_TARNAME "re2c"
-
-/* Define to the version of this package. */
-#define PACKAGE_VERSION "0.14.1.dev"
-
-/* The size of a `char', as computed by sizeof. */
-#define SIZEOF_CHAR 1
-
-/* The size of a `int', as computed by sizeof. */
-#define SIZEOF_INT 4
-
-/* The size of a `long', as computed by sizeof. */
-#define SIZEOF_LONG 4
-
-/* The size of a `short', as computed by sizeof. */
-#define SIZEOF_SHORT 2
-
-/* Define to 1 if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Version number of package */
-#define VERSION "0.14.1.dev"
-
-/* Define to empty if `const' does not conform to ANSI C. */
-/* #undef const */
-
-/* Define to `__inline__' or `__inline' if that's what the C compiler
- calls it, or to nothing if 'inline' is not supported under any name. */
-#ifndef __cplusplus
-/* #undef inline */
-#endif
-
-/* Define to `unsigned' if <sys/types.h> does not define. */
-/* #undef size_t */
-
-/* Define to empty if the keyword `volatile' does not work. Warning: valid
- code using `volatile' can become incorrect without. Disable with care. */
-/* #undef volatile */
+++ /dev/null
-/* config.h. Generated by configure. */
-/* config.h.in. Generated from configure.in by autoheader. */
-
-/* Define to 1 if you have the `getpagesize' function. */
-#define HAVE_GETPAGESIZE 1
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#define HAVE_INTTYPES_H 1
-
-/* Define to 1 if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define to 1 if you have the `memset' function. */
-#define HAVE_MEMSET 1
-
-/* Define to 1 if you have a working `mmap' system call. */
-/* #undef HAVE_MMAP */
-
-/* Define to 1 if you have the `munmap' function. */
-#define HAVE_MUNMAP 1
-
-/* Define to 1 if stdbool.h conforms to C99. */
-#define HAVE_STDBOOL_H 1
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#define HAVE_STDINT_H 1
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define to 1 if you have the `strdup' function. */
-#define HAVE_STRDUP 1
-
-/* Define to 1 if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define to 1 if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#define HAVE_SYS_STAT_H 1
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#define HAVE_SYS_TYPES_H 1
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Define to 1 if the system has the type `_Bool'. */
-#define HAVE__BOOL 1
-
-/* Name of package */
-#define PACKAGE "re2c"
-
-/* Define to the address where bug reports for this package should be sent. */
-#define PACKAGE_BUGREPORT "re2c-general@lists.sourceforge.net"
-
-/* Define to the full name of this package. */
-#define PACKAGE_NAME "re2c"
-
-/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "re2c @PACKAGE_VERSION@"
-
-/* Define to the one symbol short name of this package. */
-#define PACKAGE_TARNAME "re2c"
-
-/* Define to the version of this package. */
-#define PACKAGE_VERSION "@PACKAGE_VERSION@"
-
-/* The size of a `char', as computed by sizeof. */
-#define SIZEOF_CHAR 1
-
-/* The size of a `int', as computed by sizeof. */
-#define SIZEOF_INT 4
-
-/* The size of a `long', as computed by sizeof. */
-#define SIZEOF_LONG 4
-
-/* The size of a `short', as computed by sizeof. */
-#define SIZEOF_SHORT 2
-
-/* Define to 1 if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* Version number of package */
-#define VERSION "@PACKAGE_VERSION@"
-
-/* Define to empty if `const' does not conform to ANSI C. */
-/* #undef const */
-
-/* Define to `__inline__' or `__inline' if that's what the C compiler
- calls it, or to nothing if 'inline' is not supported under any name. */
-#ifndef __cplusplus
-/* #undef inline */
-#endif
-
-/* Define to `unsigned' if <sys/types.h> does not define. */
-/* #undef size_t */
-
-/* Define to empty if the keyword `volatile' does not work. Warning: valid
- code using `volatile' can become incorrect without. Disable with care. */
-/* #undef volatile */
-AC_PREREQ([2.57])
-AC_INIT(re2c, 0.14.1.dev, re2c-general@lists.sourceforge.net)
-AM_INIT_AUTOMAKE(re2c, $PACKAGE_VERSION)
-AC_CONFIG_SRCDIR(actions.cc)
-AM_CONFIG_HEADER(config.h)
+AC_INIT([re2c],[0.14.1.dev],[re2c-general@lists.sourceforge.net])
+AM_INIT_AUTOMAKE([-Wall -Werror foreign])
+
+
+AC_CONFIG_SRCDIR([src/actions.cc])
+AC_CONFIG_HEADERS([config.h])
+
AC_SUBST(PACKAGE_DATE, `date +'%d %b %Y'`)
AC_SUBST(PACKAGE_VERSION)
AC_SUBST(PACKAGE_NAME)
AC_SUBST(PACKAGE_TARNAME)
AC_SUBST(PACKAGE_RELEASE, ${PACKAGE_RELEASE:-1})
-AC_SUBST(WINBUILDDIR, Release-2005)
-# Checks for programs.
-AC_CHECK_PROG(BISON, bison, yes, no)
-AC_PROG_CXX
-AC_PROG_CC
-AC_PROG_INSTALL
-dnl --enable-docs
+# --enable-docs
AC_ARG_ENABLE([docs], [AS_HELP_STRING([--enable-docs], [regenerate man page and online documentation])])
AM_CONDITIONAL([REBUILD_DOCS], [test "x$enable_docs" = "xyes"])
AM_COND_IF([REBUILD_DOCS], [
- AC_CHECK_PROG(ASCIIDOC, asciidoc, yes, no)
- AC_CHECK_PROG(A2X, a2x, yes, no)
- AS_IF([test "x$ASCIIDOC" = "xno" -o "x$A2X" = "xno"], [
- AC_MSG_ERROR([need asciidoc and a2x for --enable-docs])
- ])
+ AC_CHECK_PROG(ASCIIDOC, asciidoc, yes, no)
+ AC_CHECK_PROG(A2X, a2x, yes, no)
+ AS_IF([test "x$ASCIIDOC" = "xno" -o "x$A2X" = "xno"], [
+ AC_MSG_ERROR([need asciidoc and a2x for --enable-docs])
+ ])
])
-if test "$GCC" = "yes"; then
- AC_MSG_CHECKING([Testing GCC version])
- GCCVERSION=`$CXX -dumpversion 2>/dev/null`
- if test -z "$GCCVERSION"; then
- AC_MSG_ERROR([GCC version 3 or above required])
- fi
- AC_MSG_RESULT([found version $GCCVERSION])
-fi
-
-# Checks for libraries.
-
-# Checks for header files.
-AC_HEADER_STDC
-
-# We only rely on standard C/C++ headers. If we ever have a pressing need
-# for something non-standard, we should add a check for it here.
-# AC_CHECK_HEADERS([stddef.h stdlib.h string.h])
-
-# Checks for typedefs, structures, and compiler characteristics.
-AC_HEADER_STDBOOL
-AC_C_CONST
-AC_C_INLINE
-AC_TYPE_SIZE_T
-AC_C_VOLATILE
-
-# Checks for library functions.
-AC_FUNC_MEMCMP
-AC_FUNC_MMAP
-AC_CHECK_FUNCS([memset munmap strdup strndup])
-
-AC_CHECK_SIZEOF([char])
-AC_CHECK_SIZEOF([short])
-AC_CHECK_SIZEOF([int])
-AC_CHECK_SIZEOF([long])
+
+# checks for programs
+AC_CHECK_PROG(BISON, bison, yes, no)
+AC_PROG_CXX
+AC_PROG_INSTALL
+
+
+# needed by src/c99_stdint.h
+# avoid AC_INCLUDES_DEFAULT
+AC_CHECK_HEADERS([stdint.h], [], [], [[]])
+# list of possible types to use in typedefs
+AC_CHECK_SIZEOF([char], [], [[]])
+AC_CHECK_SIZEOF([short], [], [[]])
+AC_CHECK_SIZEOF([int], [], [[]])
+AC_CHECK_SIZEOF([long], [], [[]])
+AC_CHECK_SIZEOF([long long], [], [[]])
+AC_CHECK_SIZEOF([__int64], [], [[]])
+# size of pointers
+AC_CHECK_SIZEOF([void *], [], [[]])
+# 64-bit integer constant suffix
+AC_CHECK_SIZEOF([0l], [], [[]])
+AC_CHECK_SIZEOF([0ll], [], [[]])
+AC_CHECK_SIZEOF([0i8], [], [[]])
+
+
+# checks for library functions
+AC_CHECK_FUNCS([strdup strndup])
+
AC_CONFIG_FILES([\
-Makefile \
-README \
-makerpm \
-re2c.ad \
-re2c.spec \
-run_tests.sh \
-config_w32.h \
+ Makefile \
+ doc/re2c.ad \
])
-AC_OUTPUT_COMMANDS([chmod +x makerpm run_tests.sh])
+AC_CONFIG_FILES([run_tests.sh], [chmod +x run_tests.sh])
+
+
AC_OUTPUT
</head>
<body>
<h1>re2c</h1>
+
<p>
<b>re2c</b> is a tool for writing very fast and very flexible scanners. Unlike
any other such tool, <b>re2c</b> focuses on generating high efficient code for
regular expression matching. As a result this allows a much broader range of
- use than any traditional lexer offers. And Last but not least <b>re2c</b>
+ use than any traditional lexer offers. And last but not least <b>re2c</b>
generates warning free code that is equal to hand-written code in terms of
size, speed and quality.
</p>
+
<p>
The above made the <a href="http://php.net">PHP</a> team to use <b>re2c</b> in
various places.
</p>
+
<p>
Marcus Börger (helly@users.sourceforge.net)
</p>
+
<p>
I very much welcome anyone who would like to contribute to the project, either
as a developer with source code access or by simply sending patches, bug reports, or
suggestions for improvement.
</p>
+
<p>
Dan Nuffer (nuffer@users.sourceforge.net)
</p>
+
<p>
- Please use the <a href="http://sourceforge.net/projects/re2c">SourceForge
- facilities</a> to download re2c, report bugs, subscribe to the mailing list,
- etc.
+ Please use the <a href="http://sourceforge.net/projects/re2c">sourceforge</a>
+ to download re2c, report bugs, subscribe to the mailing list, etc.
</p>
+
<p>
- You can view the manual online <a href="manual.html">here</a>.
- </p>
- <p>
- re2c is hosted at
- <a href="http://sourceforge.net"><img src=
- "http://sourceforge.net/sflogo.php?group_id=72099&type=5" width="210"
- height="62" border="0" alt="SourceForge.net" /></a>
+ You can view the online manual <a href="manual.html">here</a>.
</p>
+
<h2>Other re2c links:</h2>
<ul>
- <li>Paper on re2c. <a href=
- "http://citeseer.ist.psu.edu/bumbulis94rec.html">http://citeseer.ist.psu.edu/bumbulis94rec.html</a></li>
- <li>You can build <a href="http://rpmseek.com/rpm-pl/re2c.html?cs=re2c">rpm</a> packages out of the box.</li>
- <li>Some Linux distributions like <a href="http://debian.org">debian</a>,
- <a href="http://gentoo.org">Gentoo</a>, <a href="http://mandriva.com">Mandriva</a>
- and <a href="http://packages.ubuntu.com">ubuntu</a>
- provide re2c packages.</li>
- <li><a href="http://www.freebsd.org">FreeBSD</a> offers <a href="http://www.freshports.org/devel/re2c/">re2c</a>.</li>
- <li><a href="http://www.openpkg.org">OpenPkg</a> offers <a href="http://cvs.openpkg.org/dir?d=openpkg-src/re2c">re2c</a>.</li>
- <li>Solaris packages are provided at <a href="http://sunfreeware.com/">http://sunfreeware.com/</a>.</li>
- <li>Source packages and windows binary are available through
- <a href="http://sourceforge.net/projects/re2c">sourceforge</a> on the re2c
- <a href="http://sourceforge.net/project/showfiles.php?group_id=96864">files pages</a>.</li>
- <li>re2c is listed on <a href="http://linux.softpedia.com/get/Programming/Code-Generators/re2c-9919.shtml">softpedia</a>,
- <a href="http://freshmeat.net/projects/re2c/">freshmeat</a> and
- <a href="http://www.icewalkers.com/Linux/Software/529350/re2c.html">IceWalkers</a>.</li>
- <li>yasm is a tool which uses re2c, they created a C version and did some good
- fixes which were incorporated. <a href=
- "http://www.tortall.net/projects/yasm/browser/trunk/yasm/tools/re2c">http://www.tortall.net/projects/yasm/browser/trunk/yasm/tools/re2c</a></li>
+ <li>Paper on re2c.
+ <a href="http://citeseer.ist.psu.edu/bumbulis94rec.html">http://citeseer.ist.psu.edu/bumbulis94rec.html</a>
+ </li>
+
+ <li>Many systems provide re2c packages: you can find some of them
+ <a href="http://pkgs.org/download/re2c">here</a>, but the list is not exhaustive.
+ </li>
+
+ <li>Source code and tarballs are available <a href="http://sourceforge.net/projects/re2c">on sourceforge</a>.</li>
+
+ <li><a href="http://www.tortall.net/projects/yasm/browser/trunk/yasm/tools/re2c">yasm</a>
+ is a tool which uses re2c, they created a C version and did some good fixes which were incorporated.
+ </li>
</ul>
<hr />
<h1>Changelog</h1>
buffer and you are using above mentioned switches you can set *YYCTYPE* to
*unsigned char* and this setting to either *1* or *$$(unsigned char)$$*.
-*re2c:define:define:YYCONDTYPE* = *YYCONDTYPE*; ::
+*re2c:define:YYCONDTYPE* = *YYCONDTYPE*; ::
Enumeration used for condition support with *-c* mode.
*re2c:define:YYCTXMARKER* = *YYCTXMARKER*; ::
UNDERSTANDING RE2C
------------------
-The subdirectory lessons of the *re2c* distribution contains a few step by step
-lessons to get you started with *re2c*. All examples in the lessons subdirectory
+The subdirectory examples of the *re2c* distribution contains a few step by step
+examples to get you started with *re2c*. All examples in the lessons subdirectory
can be compiled and actually work.
+++ /dev/null
-#include <stdlib.h>
-#include <stdio.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-#include <string.h>
-
-#ifndef MAP_NORESERVE
-#define MAP_NORESERVE 0
-#endif
-
-volatile char ch;
-
-main(){
- struct stat statbuf;
- uchar *buf;
- fstat(0, &statbuf);
- buf = mmap(NULL, statbuf.st_size, PROT_READ, MAP_SHARED|MAP_NORESERVE,
- 0, 0);
- if(buf != (uchar*)(-1)){
- uchar *cur, *lim = &buf[statbuf.st_size];
- for(cur = buf; buf != lim; ++cur){
- ch = *cur;
- }
- munmap(buf, statbuf.st_size);
- }
-}
+++ /dev/null
-#include <stdlib.h>
-#include <stdio.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-#include <string.h>
-
-#define ADDEQ 257
-#define ANDAND 258
-#define ANDEQ 259
-#define ARRAY 260
-#define ASM 261
-#define AUTO 262
-#define BREAK 263
-#define CASE 264
-#define CHAR 265
-#define CONST 266
-#define CONTINUE 267
-#define DECR 268
-#define DEFAULT 269
-#define DEREF 270
-#define DIVEQ 271
-#define DO 272
-#define DOUBLE 273
-#define ELLIPSIS 274
-#define ELSE 275
-#define ENUM 276
-#define EQL 277
-#define EXTERN 278
-#define FCON 279
-#define FLOAT 280
-#define FOR 281
-#define FUNCTION 282
-#define GEQ 283
-#define GOTO 284
-#define ICON 285
-#define ID 286
-#define IF 287
-#define INCR 288
-#define INT 289
-#define LEQ 290
-#define LONG 291
-#define LSHIFT 292
-#define LSHIFTEQ 293
-#define MODEQ 294
-#define MULEQ 295
-#define NEQ 296
-#define OREQ 297
-#define OROR 298
-#define POINTER 299
-#define REGISTER 300
-#define RETURN 301
-#define RSHIFT 302
-#define RSHIFTEQ 303
-#define SCON 304
-#define SHORT 305
-#define SIGNED 306
-#define SIZEOF 307
-#define STATIC 308
-#define STRUCT 309
-#define SUBEQ 310
-#define SWITCH 311
-#define TYPEDEF 312
-#define UNION 313
-#define UNSIGNED 314
-#define VOID 315
-#define VOLATILE 316
-#define WHILE 317
-#define XOREQ 318
-#define EOI 319
-
-typedef unsigned int unint;
-typedef unsigned char uchar;
-
-#define YYCTYPE uchar
-#define YYCURSOR cursor
-#define YYLIMIT s->lim
-#define YYMARKER s->ptr
-#define YYFILL(n) {cursor = fill(s, cursor);}
-
-#define RET(i) {s->cur = cursor; return i;}
-
-typedef struct Scanner {
- uchar *tok, *ptr, *cur, *pos, *lim, *eof;
- unint line;
-} Scanner;
-
-uchar *fill(Scanner *s, uchar *cursor){
- if(!s->eof){
- unint cnt = s->lim - s->tok;
- uchar *buf = malloc((cnt + 1)*sizeof(uchar));
- memcpy(buf, s->tok, cnt);
- cursor = &buf[cursor - s->tok];
- s->pos = &buf[s->pos - s->tok];
- s->ptr = &buf[s->ptr - s->tok];
- s->lim = &buf[cnt];
- s->eof = s->lim; *(s->eof)++ = '\n';
- s->tok = buf;
- }
- return cursor;
-}
-
-int scan(Scanner *s){
- uchar *cursor = s->cur;
-std:
- s->tok = cursor;
-/*!re2c
-any = [\000-\377];
-O = [0-7];
-D = [0-9];
-L = [a-zA-Z_];
-H = [a-fA-F0-9];
-E = [Ee] [+-]? D+;
-FS = [fFlL];
-IS = [uUlL]*;
-ESC = [\\] ([abfnrtv?'"\\] | "x" H+ | O+);
-*/
-
-/*!re2c
- "/*" { goto comment; }
-
- "auto" { RET(AUTO); }
- "break" { RET(BREAK); }
- "case" { RET(CASE); }
- "char" { RET(CHAR); }
- "const" { RET(CONST); }
- "continue" { RET(CONTINUE); }
- "default" { RET(DEFAULT); }
- "do" { RET(DO); }
- "double" { RET(DOUBLE); }
- "else" { RET(ELSE); }
- "enum" { RET(ENUM); }
- "extern" { RET(EXTERN); }
- "float" { RET(FLOAT); }
- "for" { RET(FOR); }
- "goto" { RET(GOTO); }
- "if" { RET(IF); }
- "int" { RET(INT); }
- "long" { RET(LONG); }
- "register" { RET(REGISTER); }
- "return" { RET(RETURN); }
- "short" { RET(SHORT); }
- "signed" { RET(SIGNED); }
- "sizeof" { RET(SIZEOF); }
- "static" { RET(STATIC); }
- "struct" { RET(STRUCT); }
- "switch" { RET(SWITCH); }
- "typedef" { RET(TYPEDEF); }
- "union" { RET(UNION); }
- "unsigned" { RET(UNSIGNED); }
- "void" { RET(VOID); }
- "volatile" { RET(VOLATILE); }
- "while" { RET(WHILE); }
-
- L (L|D)* { RET(ID); }
-
- ("0" [xX] H+ IS?) | ("0" D+ IS?) | (D+ IS?) |
- (['] (ESC|any\[\n\\'])* ['])
- { RET(ICON); }
-
- (D+ E FS?) | (D* "." D+ E? FS?) | (D+ "." D* E? FS?)
- { RET(FCON); }
-
- (["] (ESC|any\[\n\\"])* ["])
- { RET(SCON); }
-
- "..." { RET(ELLIPSIS); }
- ">>=" { RET(RSHIFTEQ); }
- "<<=" { RET(LSHIFTEQ); }
- "+=" { RET(ADDEQ); }
- "-=" { RET(SUBEQ); }
- "*=" { RET(MULEQ); }
- "/=" { RET(DIVEQ); }
- "%=" { RET(MODEQ); }
- "&=" { RET(ANDEQ); }
- "^=" { RET(XOREQ); }
- "|=" { RET(OREQ); }
- ">>" { RET(RSHIFT); }
- "<<" { RET(LSHIFT); }
- "++" { RET(INCR); }
- "--" { RET(DECR); }
- "->" { RET(DEREF); }
- "&&" { RET(ANDAND); }
- "||" { RET(OROR); }
- "<=" { RET(LEQ); }
- ">=" { RET(GEQ); }
- "==" { RET(EQL); }
- "!=" { RET(NEQ); }
- ";" { RET(';'); }
- "{" { RET('{'); }
- "}" { RET('}'); }
- "," { RET(','); }
- ":" { RET(':'); }
- "=" { RET('='); }
- "(" { RET('('); }
- ")" { RET(')'); }
- "[" { RET('['); }
- "]" { RET(']'); }
- "." { RET('.'); }
- "&" { RET('&'); }
- "!" { RET('!'); }
- "~" { RET('~'); }
- "-" { RET('-'); }
- "+" { RET('+'); }
- "*" { RET('*'); }
- "/" { RET('/'); }
- "%" { RET('%'); }
- "<" { RET('<'); }
- ">" { RET('>'); }
- "^" { RET('^'); }
- "|" { RET('|'); }
- "?" { RET('?'); }
-
-
- [ \t\v\f]+ { goto std; }
-
- "\n"
- {
- if(cursor == s->eof) RET(EOI);
- s->pos = cursor; s->line++;
- goto std;
- }
-
- any
- {
- printf("unexpected character: %c\n", *s->tok);
- goto std;
- }
-*/
-
-comment:
-/*!re2c
- "*/" { goto std; }
- "\n"
- {
- if(cursor == s->eof) RET(EOI);
- s->tok = s->pos = cursor; s->line++;
- goto comment;
- }
- any { goto comment; }
-*/
-}
-
-#ifndef MAP_NORESERVE
-#define MAP_NORESERVE 0
-#endif
-
-main(){
- Scanner in;
- struct stat statbuf;
- uchar *buf;
- fstat(0, &statbuf);
- buf = mmap(NULL, statbuf.st_size, PROT_READ, MAP_SHARED|MAP_NORESERVE,
- 0, 0);
- if(buf != (uchar*)(-1)){
- int t;
- in.lim = &(in.cur = buf)[statbuf.st_size];
- in.pos = NULL;
- in.eof = NULL;
- while((t = scan(&in)) != EOI){
-/*
- printf("%d\t%.*s\n", t, in.cur - in.tok, in.tok);
- printf("%d\n", t);
-*/
- }
- munmap(buf, statbuf.st_size);
- }
-}
+++ /dev/null
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#define ADDEQ 257
-#define ANDAND 258
-#define ANDEQ 259
-#define ARRAY 260
-#define ASM 261
-#define AUTO 262
-#define BREAK 263
-#define CASE 264
-#define CHAR 265
-#define CONST 266
-#define CONTINUE 267
-#define DECR 268
-#define DEFAULT 269
-#define DEREF 270
-#define DIVEQ 271
-#define DO 272
-#define DOUBLE 273
-#define ELLIPSIS 274
-#define ELSE 275
-#define ENUM 276
-#define EQL 277
-#define EXTERN 278
-#define FCON 279
-#define FLOAT 280
-#define FOR 281
-#define FUNCTION 282
-#define GEQ 283
-#define GOTO 284
-#define ICON 285
-#define ID 286
-#define IF 287
-#define INCR 288
-#define INT 289
-#define LEQ 290
-#define LONG 291
-#define LSHIFT 292
-#define LSHIFTEQ 293
-#define MODEQ 294
-#define MULEQ 295
-#define NEQ 296
-#define OREQ 297
-#define OROR 298
-#define POINTER 299
-#define REGISTER 300
-#define RETURN 301
-#define RSHIFT 302
-#define RSHIFTEQ 303
-#define SCON 304
-#define SHORT 305
-#define SIGNED 306
-#define SIZEOF 307
-#define STATIC 308
-#define STRUCT 309
-#define SUBEQ 310
-#define SWITCH 311
-#define TYPEDEF 312
-#define UNION 313
-#define UNSIGNED 314
-#define VOID 315
-#define VOLATILE 316
-#define WHILE 317
-#define XOREQ 318
-#define EOI 319
-
-typedef unsigned int uint;
-typedef unsigned char uchar;
-
-#define BSIZE 8192
-
-#define YYCTYPE uchar
-#define YYCURSOR cursor
-#define YYLIMIT s->lim
-#define YYMARKER s->ptr
-#define YYFILL(n) {cursor = fill(s, cursor);}
-
-#define RET(i) {s->cur = cursor; return i;}
-
-typedef struct Scanner {
- int fd;
- uchar *bot, *tok, *ptr, *cur, *pos, *lim, *top, *eof;
- uint line;
-} Scanner;
-
-uchar *fill(Scanner *s, uchar *cursor){
- if(!s->eof){
- uint cnt = s->tok - s->bot;
- if(cnt){
- memcpy(s->bot, s->tok, s->lim - s->tok);
- s->tok = s->bot;
- s->ptr -= cnt;
- cursor -= cnt;
- s->pos -= cnt;
- s->lim -= cnt;
- }
- if((s->top - s->lim) < BSIZE){
- uchar *buf = (uchar*) malloc(((s->lim - s->bot) + BSIZE)*sizeof(uchar));
- memcpy(buf, s->tok, s->lim - s->tok);
- s->tok = buf;
- s->ptr = &buf[s->ptr - s->bot];
- cursor = &buf[cursor - s->bot];
- s->pos = &buf[s->pos - s->bot];
- s->lim = &buf[s->lim - s->bot];
- s->top = &s->lim[BSIZE];
- free(s->bot);
- s->bot = buf;
- }
- if((cnt = read(s->fd, (char*) s->lim, BSIZE)) != BSIZE){
- s->eof = &s->lim[cnt]; *(s->eof)++ = '\n';
- }
- s->lim += cnt;
- }
- return cursor;
-}
-
-int scan(Scanner *s){
- uchar *cursor = s->cur;
-std:
- s->tok = cursor;
-/*!re2c
-any = [\000-\377];
-O = [0-7];
-D = [0-9];
-L = [a-zA-Z_];
-H = [a-fA-F0-9];
-E = [Ee] [+-]? D+;
-FS = [fFlL];
-IS = [uUlL]*;
-ESC = [\\] ([abfnrtv?'"\\] | "x" H+ | O+);
-*/
-
-/*!re2c
- "/*" { goto comment; }
-
- L (L|D)* { RET(ID); }
-
- ("0" [xX] H+ IS?) | ("0" D+ IS?) | (D+ IS?) |
- (['] (ESC|any\[\n\\'])* ['])
- { RET(ICON); }
-
- (D+ E FS?) | (D* "." D+ E? FS?) | (D+ "." D* E? FS?)
- { RET(FCON); }
-
- (["] (ESC|any\[\n\\"])* ["])
- { RET(SCON); }
-
- "..." { RET(ELLIPSIS); }
- ">>=" { RET(RSHIFTEQ); }
- "<<=" { RET(LSHIFTEQ); }
- "+=" { RET(ADDEQ); }
- "-=" { RET(SUBEQ); }
- "*=" { RET(MULEQ); }
- "/=" { RET(DIVEQ); }
- "%=" { RET(MODEQ); }
- "&=" { RET(ANDEQ); }
- "^=" { RET(XOREQ); }
- "|=" { RET(OREQ); }
- ">>" { RET(RSHIFT); }
- "<<" { RET(LSHIFT); }
- "++" { RET(INCR); }
- "--" { RET(DECR); }
- "->" { RET(DEREF); }
- "&&" { RET(ANDAND); }
- "||" { RET(OROR); }
- "<=" { RET(LEQ); }
- ">=" { RET(GEQ); }
- "==" { RET(EQL); }
- "!=" { RET(NEQ); }
- ";" { RET(';'); }
- "{" { RET('{'); }
- "}" { RET('}'); }
- "," { RET(','); }
- ":" { RET(':'); }
- "=" { RET('='); }
- "(" { RET('('); }
- ")" { RET(')'); }
- "[" { RET('['); }
- "]" { RET(']'); }
- "." { RET('.'); }
- "&" { RET('&'); }
- "!" { RET('!'); }
- "~" { RET('~'); }
- "-" { RET('-'); }
- "+" { RET('+'); }
- "*" { RET('*'); }
- "/" { RET('/'); }
- "%" { RET('%'); }
- "<" { RET('<'); }
- ">" { RET('>'); }
- "^" { RET('^'); }
- "|" { RET('|'); }
- "?" { RET('?'); }
-
-
- [ \t\v\f]+ { goto std; }
-
- "\n"
- {
- if(cursor == s->eof) RET(EOI);
- s->pos = cursor; s->line++;
- goto std;
- }
-
- any
- {
- printf("unexpected character: %c\n", *s->tok);
- goto std;
- }
-*/
-
-comment:
-/*!re2c
- "*/" { goto std; }
- "\n"
- {
- if(cursor == s->eof) RET(EOI);
- s->tok = s->pos = cursor; s->line++;
- goto comment;
- }
- any { goto comment; }
-*/
-}
-
-main(){
- Scanner in;
- int t;
- memset((char*) &in, 0, sizeof(in));
- in.fd = 0;
- while((t = scan(&in)) != EOI){
-/*
- printf("%d\t%.*s\n", t, in.cur - in.tok, in.tok);
- printf("%d\n", t);
-*/
- }
- close(in.fd);
-}
+++ /dev/null
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#define ADDEQ 257
-#define ANDAND 258
-#define ANDEQ 259
-#define ARRAY 260
-#define ASM 261
-#define AUTO 262
-#define BREAK 263
-#define CASE 264
-#define CHAR 265
-#define CONST 266
-#define CONTINUE 267
-#define DECR 268
-#define DEFAULT 269
-#define DEREF 270
-#define DIVEQ 271
-#define DO 272
-#define DOUBLE 273
-#define ELLIPSIS 274
-#define ELSE 275
-#define ENUM 276
-#define EQL 277
-#define EXTERN 278
-#define FCON 279
-#define FLOAT 280
-#define FOR 281
-#define FUNCTION 282
-#define GEQ 283
-#define GOTO 284
-#define ICON 285
-#define ID 286
-#define IF 287
-#define INCR 288
-#define INT 289
-#define LEQ 290
-#define LONG 291
-#define LSHIFT 292
-#define LSHIFTEQ 293
-#define MODEQ 294
-#define MULEQ 295
-#define NEQ 296
-#define OREQ 297
-#define OROR 298
-#define POINTER 299
-#define REGISTER 300
-#define RETURN 301
-#define RSHIFT 302
-#define RSHIFTEQ 303
-#define SCON 304
-#define SHORT 305
-#define SIGNED 306
-#define SIZEOF 307
-#define STATIC 308
-#define STRUCT 309
-#define SUBEQ 310
-#define SWITCH 311
-#define TYPEDEF 312
-#define UNION 313
-#define UNSIGNED 314
-#define VOID 315
-#define VOLATILE 316
-#define WHILE 317
-#define XOREQ 318
-#define EOI 319
-
-typedef unsigned int uint;
-typedef unsigned char uchar;
-
-#define BSIZE 8192
-
-#define YYCTYPE uchar
-#define YYCURSOR cursor
-#define YYLIMIT s->lim
-#define YYMARKER s->ptr
-#define YYFILL(n) {cursor = fill(s, cursor);}
-
-#define RET(i) {s->cur = cursor; return i;}
-
-typedef struct Scanner {
- int fd;
- uchar *bot, *tok, *ptr, *cur, *pos, *lim, *top, *eof;
- uint line;
-} Scanner;
-
-uchar *fill(Scanner *s, uchar *cursor){
- if(!s->eof){
- uint cnt = s->tok - s->bot;
- if(cnt){
- memcpy(s->bot, s->tok, s->lim - s->tok);
- s->tok = s->bot;
- s->ptr -= cnt;
- cursor -= cnt;
- s->pos -= cnt;
- s->lim -= cnt;
- }
- if((s->top - s->lim) < BSIZE){
- uchar *buf = (uchar*) malloc(((s->lim - s->bot) + BSIZE)*sizeof(uchar));
- memcpy(buf, s->tok, s->lim - s->tok);
- s->tok = buf;
- s->ptr = &buf[s->ptr - s->bot];
- cursor = &buf[cursor - s->bot];
- s->pos = &buf[s->pos - s->bot];
- s->lim = &buf[s->lim - s->bot];
- s->top = &s->lim[BSIZE];
- free(s->bot);
- s->bot = buf;
- }
- if((cnt = read(s->fd, (char*) s->lim, BSIZE)) != BSIZE){
- s->eof = &s->lim[cnt]; *(s->eof)++ = '\n';
- }
- s->lim += cnt;
- }
- return cursor;
-}
-
-int scan(Scanner *s){
- uchar *cursor = s->cur;
-std:
- s->tok = cursor;
-/*!re2c
-any = [\000-\377];
-O = [0-7];
-D = [0-9];
-L = [a-zA-Z_];
-I = L|D;
-H = [a-fA-F0-9];
-E = [Ee] [+-]? D+;
-FS = [fFlL];
-IS = [uUlL]*;
-ESC = [\\] ([abfnrtv?'"\\] | "x" H+ | O+);
-X = any\[*/];
-*/
-
-/*!re2c
- "/*" { goto comment; }
-
-
- L { RET(ID); }
- L I { RET(ID); }
- L I I { RET(ID); }
- L I I I { RET(ID); }
- L I I I I { RET(ID); }
- L I I I I I { RET(ID); }
- L I I I I I I { RET(ID); }
- L I I I I I I I { RET(ID); }
- L I* { RET(ID); }
-
- ("0" [xX] H+ IS?) | ("0" D+ IS?) | (D+ IS?) |
- (['] (ESC|any\[\n\\'])* ['])
- { RET(ICON); }
-
- (D+ E FS?) | (D* "." D+ E? FS?) | (D+ "." D* E? FS?)
- { RET(FCON); }
-
- (["] (ESC|any\[\n\\"])* ["])
- { RET(SCON); }
-
- "..." { RET(ELLIPSIS); }
- ">>=" { RET(RSHIFTEQ); }
- "<<=" { RET(LSHIFTEQ); }
- "+=" { RET(ADDEQ); }
- "-=" { RET(SUBEQ); }
- "*=" { RET(MULEQ); }
- "/=" { RET(DIVEQ); }
- "%=" { RET(MODEQ); }
- "&=" { RET(ANDEQ); }
- "^=" { RET(XOREQ); }
- "|=" { RET(OREQ); }
- ">>" { RET(RSHIFT); }
- "<<" { RET(LSHIFT); }
- "++" { RET(INCR); }
- "--" { RET(DECR); }
- "->" { RET(DEREF); }
- "&&" { RET(ANDAND); }
- "||" { RET(OROR); }
- "<=" { RET(LEQ); }
- ">=" { RET(GEQ); }
- "==" { RET(EQL); }
- "!=" { RET(NEQ); }
- ";" { RET(';'); }
- "{" { RET('{'); }
- "}" { RET('}'); }
- "," { RET(','); }
- ":" { RET(':'); }
- "=" { RET('='); }
- "(" { RET('('); }
- ")" { RET(')'); }
- "[" { RET('['); }
- "]" { RET(']'); }
- "." { RET('.'); }
- "&" { RET('&'); }
- "!" { RET('!'); }
- "~" { RET('~'); }
- "-" { RET('-'); }
- "+" { RET('+'); }
- "*" { RET('*'); }
- "/" { RET('/'); }
- "%" { RET('%'); }
- "<" { RET('<'); }
- ">" { RET('>'); }
- "^" { RET('^'); }
- "|" { RET('|'); }
- "?" { RET('?'); }
-
-
- [ \t\v\f]+ { goto std; }
-
- "\n"
- {
- if(cursor == s->eof) RET(EOI);
- s->pos = cursor; s->line++;
- goto std;
- }
-
- any
- {
- printf("unexpected character: %c\n", *s->tok);
- goto std;
- }
-*/
-
-comment:
-/*!re2c
- "*/" { goto std; }
- "\n"
- {
- if(cursor == s->eof) RET(EOI);
- s->tok = s->pos = cursor; s->line++;
- goto comment;
- }
- X { goto comment; }
- X X { goto comment; }
- X X X { goto comment; }
- X X X X { goto comment; }
- X X X X X { goto comment; }
- X X X X X X { goto comment; }
- X X X X X X X { goto comment; }
- X X X X X X X X { goto comment; }
- any { goto comment; }
-*/
-}
-
-main(){
- Scanner in;
- int t;
- memset((char*) &in, 0, sizeof(in));
- in.fd = 0;
- while((t = scan(&in)) != EOI){
-/*
- printf("%d\t%.*s\n", t, in.cur - in.tok, in.tok);
- printf("%d\n", t);
-*/
- }
- close(in.fd);
-}
#define YYCURSOR cursor
#define YYLIMIT s->lim
#define YYMARKER s->ptr
+#define YYCTXMARKER s->ctx
#define YYFILL {cursor = fill(s, cursor);}
#define RETURN(i) {s->cur = cursor; return i;}
typedef struct Scanner {
int fd;
- uchar *bot, *tok, *ptr, *cur, *pos, *lim, *top, *eof;
+ uchar *bot, *tok, *ptr, *ctx, *cur, *pos, *lim, *top, *eof;
uint line;
} Scanner;
+++ /dev/null
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#define ADDEQ 257
-#define ANDAND 258
-#define ANDEQ 259
-#define ARRAY 260
-#define ASM 261
-#define AUTO 262
-#define BREAK 263
-#define CASE 264
-#define CHAR 265
-#define CONST 266
-#define CONTINUE 267
-#define DECR 268
-#define DEFAULT 269
-#define DEREF 270
-#define DIVEQ 271
-#define DO 272
-#define DOUBLE 273
-#define ELLIPSIS 274
-#define ELSE 275
-#define ENUM 276
-#define EQL 277
-#define EXTERN 278
-#define FCON 279
-#define FLOAT 280
-#define FOR 281
-#define FUNCTION 282
-#define GEQ 283
-#define GOTO 284
-#define ICON 285
-#define ID 286
-#define IF 287
-#define INCR 288
-#define INT 289
-#define LEQ 290
-#define LONG 291
-#define LSHIFT 292
-#define LSHIFTEQ 293
-#define MODEQ 294
-#define MULEQ 295
-#define NEQ 296
-#define OREQ 297
-#define OROR 298
-#define POINTER 299
-#define REGISTER 300
-#define RETURN 301
-#define RSHIFT 302
-#define RSHIFTEQ 303
-#define SCON 304
-#define SHORT 305
-#define SIGNED 306
-#define SIZEOF 307
-#define STATIC 308
-#define STRUCT 309
-#define SUBEQ 310
-#define SWITCH 311
-#define TYPEDEF 312
-#define UNION 313
-#define UNSIGNED 314
-#define VOID 315
-#define VOLATILE 316
-#define WHILE 317
-#define XOREQ 318
-#define EOI 319
-#define PP_INCLUDE 500
-#define PP_LINE 501
-#define PP_DEFINE 502
-#define PP_UNDEF 503
-#define PP_IF 504
-#define PP_IFDEF 505
-#define PP_IFNDEF 506
-#define PP_ELSE 507
-#define PP_ELIF 508
-#define PP_ENDIF 509
-#define PP_ERROR 510
-
-typedef unsigned int uint;
-typedef unsigned char uchar;
-
-#define BSIZE 12
-//8192
-
-#define YYCTYPE uchar
-#define YYCURSOR cursor
-#define YYLIMIT s->lim
-#define YYMARKER s->ptr
-#define YYFILL(n) {cursor = fill(s, cursor);}
-
-#define RET(i) {s->cur = cursor; return i;}
-
-typedef struct Scanner {
- int fd;
- uchar *bot, *tok, *ptr, *cur, *pos, *lim, *top, *eof;
- uint line;
-} Scanner;
-
-uchar *fill(Scanner *s, uchar *cursor){
- if(!s->eof) {
- uint cnt = s->tok - s->bot;
- if(cnt){
- memcpy(s->bot, s->tok, s->lim - s->tok);
- s->tok = s->bot;
- s->ptr -= cnt;
- cursor -= cnt;
- s->pos -= cnt;
- s->lim -= cnt;
- }
- if((s->top - s->lim) < BSIZE){
- uchar *buf = (uchar*) malloc(((s->lim - s->bot) + BSIZE)*sizeof(uchar));
- memcpy(buf, s->tok, s->lim - s->tok);
- s->tok = buf;
- s->ptr = &buf[s->ptr - s->bot];
- cursor = &buf[cursor - s->bot];
- s->pos = &buf[s->pos - s->bot];
- s->lim = &buf[s->lim - s->bot];
- s->top = &s->lim[BSIZE];
- free(s->bot);
- s->bot = buf;
- }
- if((cnt = read(s->fd, (char*) s->lim, BSIZE)) != BSIZE){
- s->eof = &s->lim[cnt]; *(s->eof)++ = '\n';
- }
- s->lim += cnt;
- }
- return cursor;
-}
-
-int scan(Scanner *s){
- uchar *cursor = s->cur;
-std:
- s->tok = cursor;
-/*!re2c
-any = [\000-\377];
-O = [0-7];
-D = [0-9];
-L = [a-zA-Z_];
-H = [a-fA-F0-9];
-E = [Ee] [+-]? D+;
-FS = [fFlL];
-IS = [uUlL]*;
-ESC = [\\] ([abfnrtv?'"\\] | "x" H+ | O+);
-PP = "#" [ \t]*;
-*/
-
-/*!re2c
- "/*" { goto comment; }
-
- "auto" { RET(AUTO); }
- "break" { RET(BREAK); }
- "case" { RET(CASE); }
- "char" { RET(CHAR); }
- "const" { RET(CONST); }
- "continue" { RET(CONTINUE); }
- "default" { RET(DEFAULT); }
- "do" { RET(DO); }
- "double" { RET(DOUBLE); }
- "else" { RET(ELSE); }
- "enum" { RET(ENUM); }
- "extern" { RET(EXTERN); }
- "float" { RET(FLOAT); }
- "for" { RET(FOR); }
- "goto" { RET(GOTO); }
- "if" { RET(IF); }
- "int" { RET(INT); }
- "long" { RET(LONG); }
- "register" { RET(REGISTER); }
- "return" { RET(RETURN); }
- "short" { RET(SHORT); }
- "signed" { RET(SIGNED); }
- "sizeof" { RET(SIZEOF); }
- "static" { RET(STATIC); }
- "struct" { RET(STRUCT); }
- "switch" { RET(SWITCH); }
- "typedef" { RET(TYPEDEF); }
- "union" { RET(UNION); }
- "unsigned" { RET(UNSIGNED); }
- "void" { RET(VOID); }
- "volatile" { RET(VOLATILE); }
- "while" { RET(WHILE); }
-
- L (L|D)* { RET(ID); }
-
- ("0" [xX] H+ IS?) | ("0" D+ IS?) | (D+ IS?) |
- (['] (ESC|any\[\n\\'])* ['])
- { RET(ICON); }
-
- (D+ E FS?) | (D* "." D+ E? FS?) | (D+ "." D* E? FS?)
- { RET(FCON); }
-
- (["] (ESC|any\[\n\\"])* ["])
- { RET(SCON); }
-
- "..." { RET(ELLIPSIS); }
- ">>=" { RET(RSHIFTEQ); }
- "<<=" { RET(LSHIFTEQ); }
- "+=" { RET(ADDEQ); }
- "-=" { RET(SUBEQ); }
- "*=" { RET(MULEQ); }
- "/=" { RET(DIVEQ); }
- "%=" { RET(MODEQ); }
- "&=" { RET(ANDEQ); }
- "^=" { RET(XOREQ); }
- "|=" { RET(OREQ); }
- ">>" { RET(RSHIFT); }
- "<<" { RET(LSHIFT); }
- "++" { RET(INCR); }
- "--" { RET(DECR); }
- "->" { RET(DEREF); }
- "&&" { RET(ANDAND); }
- "||" { RET(OROR); }
- "<=" { RET(LEQ); }
- ">=" { RET(GEQ); }
- "==" { RET(EQL); }
- "!=" { RET(NEQ); }
- ";" { RET(';'); }
- "{" { RET('{'); }
- "}" { RET('}'); }
- "," { RET(','); }
- ":" { RET(':'); }
- "=" { RET('='); }
- "(" { RET('('); }
- ")" { RET(')'); }
- "[" { RET('['); }
- "]" { RET(']'); }
- "." { RET('.'); }
- "&" { RET('&'); }
- "!" { RET('!'); }
- "~" { RET('~'); }
- "-" { RET('-'); }
- "+" { RET('+'); }
- "*" { RET('*'); }
- "/" { RET('/'); }
- "%" { RET('%'); }
- "<" { RET('<'); }
- ">" { RET('>'); }
- "^" { RET('^'); }
- "|" { RET('|'); }
- "?" { RET('?'); }
-
- PP "include" { RET(PP_INCLUDE); }
- PP "line" { RET(PP_LINE); }
- PP "define" { RET(PP_DEFINE); }
- PP "undef" { RET(PP_UNDEF); }
- PP "if" { RET(PP_IF); }
- PP "ifdef" { RET(PP_IFDEF); }
- PP "ifndef" { RET(PP_IFNDEF); }
- PP "else" { RET(PP_ELSE); }
- PP "elif" { RET(PP_ELIF); }
- PP "endif" { RET(PP_ENDIF); }
- PP "error" { RET(PP_ERROR); }
-
- [ \t\v\f]+ { goto std; }
-
- "\n"
- {
- if(cursor == s->eof) RET(EOI);
- s->pos = cursor; s->line++;
- goto std;
- }
-
- any
- {
- printf("unexpected character: %c\n", *s->tok);
- goto std;
- }
-*/
-
-comment:
-/*!re2c
- "*/" { goto std; }
- "\n"
- {
- if(cursor == s->eof) RET(EOI);
- s->tok = s->pos = cursor; s->line++;
- goto comment;
- }
- any { goto comment; }
-*/
-}
-
-main(){
- Scanner in;
- int t;
- memset((char*) &in, 0, sizeof(in));
- in.fd = 0;
- while((t = scan(&in)) != EOI){
-
- printf("%d\t%.*s\n", t, in.cur - in.tok, in.tok);
-
- }
- close(in.fd);
-}
start:
- /*!re2c
-
+ /*!re2c
+ re2c:startlabel = 1;
eol = "\n";
eof = "\000";
digit = [0-9];
integer = digit+;
alpha = [A-Za-z_];
- any = [\000-\0377];
+ any = [\000-\377];
space = [ \h\t\v\f\r];
"if" { SEND(kIf); }
+++ /dev/null
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#define RET(n) printf("%d\n", n); return n
-
-int scan(char *s, int l){
-char *p = s;
-char *q;
-#define YYCTYPE char
-#define YYCURSOR p
-#define YYLIMIT (s+l)
-#define YYMARKER q
-#define YYFILL(n)
-/*!re2c
- 'a'{1}"\n" {RET(1);}
- 'a'{2,3}"\n" {RET(2);}
- 'a'{6}"\n" {RET(4);}
- 'a'{4,}"\n" {RET(3);}
- [^aq]|"\n" {RET(0);}
-*/
-}
-
-#define do_scan(str) scan(str, strlen(str))
-
-main()
-{
- do_scan("a\n");
- do_scan("aa\n");
- do_scan("aaa\n");
- do_scan("aaaa\n");
- do_scan("q");
- do_scan("a");
- do_scan("A\n");
- do_scan("AA\n");
- do_scan("aAa\n");
- do_scan("AaaA\n");
- do_scan("Q");
- do_scan("AaaAa\n");
- do_scan("AaaAaA\n");
- do_scan("A");
- do_scan("\n");
- do_scan("0");
-}
+++ /dev/null
-Replacement modules for an existing REXX interpreter. Not standalone.
+++ /dev/null
-uchar *ScanFill(uchar *cursor){
- unsigned cnt = s->tok - s->bot;
- s->pos += cursor - s->mrk;
- if(cnt){
- if(s->eot){
- unsigned len = s->eot - s->tok;
- memcpy(s->bot, s->tok, len);
- s->eot = &s->bot[len];
- if((len = s->lim - cursor) != 0)
- memcpy(s->eot, cursor, len);
- cursor = s->eot;
- s->lim = &cursor[len];
- } else {
- memcpy(s->bot, s->tok, s->lim - s->tok);
- cursor -= cnt;
- s->lim -= cnt;
- }
- s->tok = s->bot;
- s->ptr -= cnt;
- }
- if((s->top - s->lim) < 512){
- uchar *buf = (uchar*) malloc(((s->lim - s->bot) + 512)*sizeof(uchar));
- memcpy(buf, s->bot, s->lim - s->bot);
- s->tok = buf;
- s->ptr = &buf[s->ptr - s->bot];
- if(s->eot)
- s->eot = &buf[s->eot - s->bot];
- cursor = &buf[cursor - s->bot];
- s->lim = &buf[s->lim - s->bot];
- s->top = &s->lim[512];
- free(s->bot);
- s->bot = buf;
- }
- s->mrk = cursor;
- if(ScanCBIO.file){
- if((cnt = read(ScanCBIO.u.f.fd, (char*) s->lim, 512)) != 512)
- memset(&s->lim[cnt], 0, 512 - cnt);
- s->lim += 512;
- }
- return cursor;
-}
+++ /dev/null
-/*!re2c
- "print" {return PRINT;}
- [a-z]+ {return ID;}
- [0-9]+ {return DEC;}
- "0x" [0-9a-f]+ {return HEX;}
- [\000-\377] {return ERR;}
-*/
+++ /dev/null
-#define NULL ((char*) 0)
-char *scan(char *p){
-char *q;
-#define YYCTYPE char
-#define YYCURSOR p
-#define YYLIMIT p
-#define YYMARKER q
-#define YYFILL(n)
-/*!re2c
- [0-9]+ {return YYCURSOR;}
- [\000-\377] {return NULL;}
-*/
-}
+++ /dev/null
-manual.html
+++ /dev/null
-a.out
-*.temp
-*.diff
-*.o
+++ /dev/null
-a.out
-*.temp
-*.diff
-*.o
+++ /dev/null
-*.diff
-*.exe
-*.ncb
-*.opt
-*.plg
-*.scc
-*.suo
-*.temp
-*.user
-Debug
-Release
+++ /dev/null
-@echo OFF
-goto Start
-rem BuildAndRun.bat 06-Apr-15 lda
-rem Assumes re2c.exe findable with PATH or . or .. or ..\.. or $(RE2C_HOME)
-rem Assumes cl.exe findable with PATH or VcToolKit2003 installed
-
-:Start
-if exist %RE2C_HOME%\re2c.exe goto ProceedWithGenerate
-if exist .\re2c.exe set RE2C_HOME=.
-if exist ..\re2c.exe set RE2C_HOME=..
-if exist ..\..\re2c.exe set RE2C_HOME=..\..
-if exist ..\..\..\re2c.exe set RE2C_HOME=..\..\..
-if exist ..\..\..\Release\re2c.exe set RE2C_HOME=..\..\..\Release
-if exist ..\..\..\Release-2005\re2c.exe set RE2C_HOME=..\..\..\Release-2005
-if not exist %RE2C_HOME%\re2c.exe goto ReportSetupError
-
-:ProceedWithGenerate
-set BASE_FILE_NAME=main
-%RE2C_HOME%\re2c -b -o%BASE_FILE_NAME%.c %BASE_FILE_NAME%.re
-rem echo ErrorLevel is set to %ERRORLEVEL% after re2c
-IF ERRORLEVEL 1 goto ReportRe2cError
-
-rem (to test) set path=
-cl 1>nul 2>nul
-IF ERRORLEVEL 1 goto AttemptToSetupCompiler
-goto ProceedWithCompile
-
-:AttemptToSetupCompiler
-echo ErrorLevel is set to %ERRORLEVEL% after blank cl command line
-call %VCToolkitInstallDir%\vcvars32.bat 1>nul 2>nul
-cl 1>nul 2>nul
-IF ERRORLEVEL 1 goto ReportClError
-
-:ProceedWithCompile
-cl -O2 /DNDEBUG /D_CONSOLE /DWIN32 %BASE_FILE_NAME%.c
-rem echo ErrorLevel is set to %ERRORLEVEL% after cl
-IF ERRORLEVEL 1 goto ReportClError
-%BASE_FILE_NAME%
-goto AllDone
-
-:ReportSetupError
-echo re2c.exe not found in ., .., ..\.., ..\..\.., ..\..\..\Release
-echo or ..\..\..\Release-2005 Environment variable RE2C_HOME invalid or not set?
-
-:ReportClError
-:ReportRe2cError
-:AllDone
-pause
+++ /dev/null
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual Studio 2005
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestRe2c", "TestRe2c-2005.vcproj", "{E2CEB3D0-066A-4C9A-B32C-B2197448A57A}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Default = Debug|Default
- Release|Default = Release|Default
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {E2CEB3D0-066A-4C9A-B32C-B2197448A57A}.Debug|Default.ActiveCfg = Debug|Win32
- {E2CEB3D0-066A-4C9A-B32C-B2197448A57A}.Debug|Default.Build.0 = Debug|Win32
- {E2CEB3D0-066A-4C9A-B32C-B2197448A57A}.Release|Default.ActiveCfg = Release|Win32
- {E2CEB3D0-066A-4C9A-B32C-B2197448A57A}.Release|Default.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
+++ /dev/null
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8,00"
- Name="TestRe2c"
- ProjectGUID="{E2CEB3D0-066A-4C9A-B32C-B2197448A57A}"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory=".\Debug"
- IntermediateDirectory=".\Debug"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="false"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TypeLibraryName=".\Debug/TestRe2c.tlb"
- HeaderFileName=""
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- UsePrecompiledHeader="0"
- PrecompiledHeaderThrough=""
- AssemblerListingLocation=".\Debug/"
- ObjectFile=".\Debug/"
- ProgramDataBaseFileName=".\Debug/"
- WarningLevel="3"
- SuppressStartupBanner="true"
- DebugInformationFormat="4"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG"
- Culture="1033"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile=".\Debug/TestRe2c.exe"
- LinkIncremental="0"
- SuppressStartupBanner="true"
- GenerateDebugInformation="true"
- ProgramDatabaseFile=".\Debug/TestRe2c.pdb"
- SubSystem="1"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory=".\Release"
- IntermediateDirectory=".\Release"
- ConfigurationType="1"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="false"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TypeLibraryName=".\Release/TestRe2c.tlb"
- HeaderFileName=""
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions="/O2"
- Optimization="2"
- InlineFunctionExpansion="1"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE"
- StringPooling="true"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="true"
- UsePrecompiledHeader="0"
- PrecompiledHeaderThrough=""
- AssemblerListingLocation=".\Release/"
- ObjectFile=".\Release/"
- ProgramDataBaseFileName=".\Release/"
- WarningLevel="3"
- SuppressStartupBanner="true"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
- Culture="1033"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile=".\Release/TestRe2c.exe"
- LinkIncremental="0"
- SuppressStartupBanner="true"
- ProgramDatabaseFile=".\Release/TestRe2c.pdb"
- SubSystem="1"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
- >
- <File
- RelativePath="main.b.c"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- PreprocessorDefinitions=""
- BasicRuntimeChecks="3"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="main.b.re"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCustomBuildTool"
- Description="Generate $(InputName).c from $(InputName).re using Re2c"
- CommandLine="..\..\..\Release-2005\re2c.exe -b -o$(InputName).c $(InputName).re
"
- Outputs="$(InputName).c"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCustomBuildTool"
- Description="Generate $(InputName).c from $(InputName).re using Re2c"
- CommandLine="..\..\..\Rlease-2005\re2c.exe -b -o$(InputName).c $(InputName).re
"
- Outputs="$(InputName).c"
- />
- </FileConfiguration>
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
+++ /dev/null
-# Microsoft Developer Studio Project File - Name="TestRe2c" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** NICHT BEARBEITEN **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=TestRe2c - Win32 Debug
-!MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE
-!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl
-!MESSAGE
-!MESSAGE NMAKE /f "TestRe2c.mak".
-!MESSAGE
-!MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben
-!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
-!MESSAGE
-!MESSAGE NMAKE /f "TestRe2c.mak" CFG="TestRe2c - Win32 Debug"
-!MESSAGE
-!MESSAGE Für die Konfiguration stehen zur Auswahl:
-!MESSAGE
-!MESSAGE "TestRe2c - Win32 Release" (basierend auf "Win32 (x86) Console Application")
-!MESSAGE "TestRe2c - Win32 Debug" (basierend auf "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=xicl6.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "TestRe2c - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=xilink6.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-
-!ELSEIF "$(CFG)" == "TestRe2c - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c
-# SUBTRACT CPP /YX
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=xilink6.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-
-!ENDIF
-
-# Begin Target
-
-# Name "TestRe2c - Win32 Release"
-# Name "TestRe2c - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\main.b.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\main.b.re
-
-!IF "$(CFG)" == "TestRe2c - Win32 Release"
-
-# Begin Custom Build - Generate $(InputName).c from $(InputName).re using Re2c
-InputPath=.\main.b.re
-InputName=main.b
-
-"$(InputName).c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- ..\..\..\Release-2005\re2c -b -o$(InputName).c $(InputName).re
-
-# End Custom Build
-
-!ELSEIF "$(CFG)" == "TestRe2c - Win32 Debug"
-
-# Begin Custom Build - Generate $(InputName).c from $(InputName).re using Re2c
-InputPath=.\main.b.re
-InputName=main.b
-
-"$(InputName).c" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- ..\..\..\Release-2005\re2c -b -o$(InputName).c $(InputName).re
-
-# End Custom Build
-
-!ENDIF
-
-# End Source File
-# End Group
-# End Target
-# End Project
+++ /dev/null
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "TestRe2c"=.\TestRe2c.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
+++ /dev/null
-Microsoft Visual Studio Solution File, Format Version 7.00
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestRe2c", "TestRe2c.vcproj", "{BEC086F1-62CD-4BA7-8E17-367B825FA721}"
-EndProject
-Global
- GlobalSection(SolutionConfiguration) = preSolution
- ConfigName.0 = Debug
- ConfigName.1 = Release
- EndGlobalSection
- GlobalSection(ProjectDependencies) = postSolution
- EndGlobalSection
- GlobalSection(ProjectConfiguration) = postSolution
- {BEC086F1-62CD-4BA7-8E17-367B825FA721}.Debug.ActiveCfg = Debug|Win32
- {BEC086F1-62CD-4BA7-8E17-367B825FA721}.Debug.Build.0 = Debug|Win32
- {BEC086F1-62CD-4BA7-8E17-367B825FA721}.Release.ActiveCfg = Release|Win32
- {BEC086F1-62CD-4BA7-8E17-367B825FA721}.Release.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- EndGlobalSection
- GlobalSection(ExtensibilityAddIns) = postSolution
- EndGlobalSection
-EndGlobal
+++ /dev/null
-<?xml version="1.0" encoding = "Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="7.00"
- Name="Re2cTest"
- ProjectGUID="{BEC086F1-62CD-4BA7-8E17-367B825FA721}"
- Keyword="Win32Proj">
- <Platforms>
- <Platform
- Name="Win32"/>
- </Platforms>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="Debug"
- IntermediateDirectory="Debug"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
- MinimalRebuild="TRUE"
- BasicRuntimeChecks="3"
- RuntimeLibrary="5"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="4"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/Re2cTest.exe"
- LinkIncremental="2"
- GenerateDebugInformation="TRUE"
- ProgramDatabaseFile="$(OutDir)/Re2cTest.pdb"
- SubSystem="1"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="Release"
- IntermediateDirectory="Release"
- ConfigurationType="1"
- CharacterSet="2">
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- InlineFunctionExpansion="1"
- OmitFramePointers="TRUE"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
- StringPooling="TRUE"
- RuntimeLibrary="4"
- EnableFunctionLevelLinking="TRUE"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- Detect64BitPortabilityProblems="TRUE"
- DebugInformationFormat="3"/>
- <Tool
- Name="VCCustomBuildTool"/>
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)/Re2cTest.exe"
- LinkIncremental="1"
- GenerateDebugInformation="TRUE"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"/>
- <Tool
- Name="VCMIDLTool"/>
- <Tool
- Name="VCPostBuildEventTool"/>
- <Tool
- Name="VCPreBuildEventTool"/>
- <Tool
- Name="VCPreLinkEventTool"/>
- <Tool
- Name="VCResourceCompilerTool"/>
- <Tool
- Name="VCWebServiceProxyGeneratorTool"/>
- <Tool
- Name="VCWebDeploymentTool"/>
- </Configuration>
- </Configurations>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm">
- <File
- RelativePath="main.b.c">
- </File>
- <File
- RelativePath="main.b.re">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCustomBuildTool"
- Description="Generate $(InputName).c from $(InputName).re using Re2c"
- CommandLine="..\..\..\Release\re2c.exe -b -o$(InputName).c $(InputName).re"
- Outputs="$(InputName).c"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCustomBuildTool"
- Description="Generate $(InputName).c from $(InputName).re using Re2c"
- CommandLine="..\..\..\Release\re2c.exe -b -o$(InputName).c $(InputName).re"
- Outputs="$(InputName).c"/>
- </FileConfiguration>
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx">
- <File
- RelativePath="HiResTimer.h">
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
+++ /dev/null
-a.out
-*.temp
-*.diff
-*.o
-t.c
+++ /dev/null
-re2c lessons, (c) M. Boerger 2006
-
-001_upn_calculator
-
- This lesson gets you started with re2c. In the end you will have an easy
- RPN calculator for use at command line.
-
- You will learn about the basic interface of re2c when scanning input
- strings. How to detect the end of the input and use that to stop scanning
- in order to avoid problems.
-
- The lesson also contains a windows subdirectory to get you started in the
- Microsoft world.
-
-002_strip_comments
-
- In this lesson you will learn how to use multiple scanner blocks and how
- to read the input from a file instead of a zero terminated string. In the
- end you will have a scanner that filters comments out of c source files
- but keeps re2c comments.
+++ /dev/null
-#! /bin/sh
-
-# $Id$
-# M.Boerger <re2c@somabo.de>
-
-PREFIX="@PACKAGE_NAME@"
-VERSION="@PACKAGE_VERSION@"
-TARDIR="`basename \`pwd\``"
-RELEASE=${1:-1}
-
-echo "Usage:"
-echo "$0 <release>"
-echo
-echo "e.g.:"
-echo "$0"
-echo -n "Building RPM version $VERSION, release: $RELEASE "
-sleep 1 ; echo -n . ; sleep 1 ; echo -n . ; sleep 1 ; echo -n .
-echo
-
-TAR=@PACKAGE_TARNAME@-$VERSION.tar.gz
-SPEC=re2c-${VERSION}.spec
-
-RPMBASE=/usr/src/redhat
-for i in /usr/src/redhat /usr/src/packages /usr/src/RPM; do
- if test -d $i; then
- RPMBASE=$i
- break
- fi
-done
-
-RPMDIR=${RPMBASE}/RPMS
-SPECDIR=${RPMBASE}/SPECS
-SRCDIR=${RPMBASE}/SOURCES
-
-make dist
-cp $TAR $SRCDIR
-
-cat re2c.spec | sed -e "s/RPM_RELEASE/${RELEASE}/g" > ${SPEC}
-
-echo "CP: (`pwd`) cp -a $SPEC $SPECDIR/${SPEC}"
-cp -a $SPEC $SPECDIR/${SPEC}
-#cp -a *.patch $SRCDIR
-cd $SPECDIR
-echo "RPM: rpm -ba ${SPEC}"
-rpmbuild -ba ${SPEC}
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<VisualStudioToolFile\r
- Name="re2c"\r
- Version="8.00"\r
- >\r
- <Rules>\r
- <CustomBuildRule\r
- Name="re2c"\r
- DisplayName="re2c"\r
- CommandLine="re2c.exe [AllOptions] [AdditionalOptions] [inputs]"\r
- Outputs="[$OutputFileName]"\r
- FileExtensions="*.re"\r
- ExecutionDescription="Compiling regular expressions..."\r
- >\r
- <Properties>\r
- <StringProperty\r
- Name="OutputFileName"\r
- DisplayName="Output File Name"\r
- Description="Specifies the name of the output source file. (-o[file])"\r
- Switch="-o"[value]""\r
- DefaultValue="$(InputDir)$(InputName).cpp"\r
- />\r
- <EnumProperty\r
- Name="Version"\r
- DisplayName="Show Version Information"\r
- Description="Displays version information at compile-time. (-v -V)"\r
- >\r
- <Values>\r
- <EnumValue\r
- Value="0"\r
- DisplayName="Default"\r
- />\r
- <EnumValue\r
- Value="1"\r
- Switch="-v"\r
- DisplayName="Show Version (-v)"\r
- />\r
- <EnumValue\r
- Value="2"\r
- Switch="-V"\r
- DisplayName="Show Version as a Number (-V)"\r
- />\r
- </Values>\r
- </EnumProperty>\r
- <BooleanProperty\r
- Name="NoLineInfo"\r
- DisplayName="Suppress Line Information"\r
- Description="Suppress line-number debugging information in the output file. (-i)"\r
- Switch="-i"\r
- />\r
- <BooleanProperty\r
- Name="NoGenerationDate"\r
- DisplayName="Suppress Generation Date"\r
- Description="Suppress generation-date information in the output file. (--no-generation-date)"\r
- Switch="--no-generation-date"\r
- />\r
- <EnumProperty\r
- Name="CharacterSet"\r
- DisplayName="Scanner Character Set"\r
- PropertyPageName="Code Generation"\r
- Description="Specifies the generated scanner's character set. (-e, -w, -u)"\r
- >\r
- <Values>\r
- <EnumValue\r
- Value="0"\r
- DisplayName="Default"\r
- />\r
- <EnumValue\r
- Value="1"\r
- Switch="-e"\r
- DisplayName="EBCDIC (-e)"\r
- />\r
- <EnumValue\r
- Value="2"\r
- Switch="-w"\r
- DisplayName="UCS-16 (-w)"\r
- />\r
- <EnumValue\r
- Value="3"\r
- Switch="-u"\r
- DisplayName="UTF-32 (-u)"\r
- />\r
- </Values>\r
- </EnumProperty>\r
- <EnumProperty\r
- Name="Optimization"\r
- DisplayName="Optimization Level"\r
- PropertyPageName="Code Generation"\r
- Description="Specifies the optimizations used in the scanner. (-s, -b, -g)"\r
- DefaultValue="2"\r
- >\r
- <Values>\r
- <EnumValue\r
- Value="0"\r
- DisplayName="None"\r
- />\r
- <EnumValue\r
- Value="1"\r
- Switch="-s"\r
- DisplayName="Use Nested If's (-s)"\r
- />\r
- <EnumValue\r
- Value="2"\r
- Switch="-b"\r
- DisplayName="Use Bit Vectors (-b)"\r
- />\r
- <EnumValue\r
- Value="3"\r
- Switch="-g"\r
- DisplayName="Use Computed Goto's (GCC Only) (-g)"\r
- />\r
- </Values>\r
- </EnumProperty>\r
- <BooleanProperty\r
- Name="StorableState"\r
- DisplayName="Enable Storable State"\r
- PropertyPageName="Code Generation"\r
- Description="Generates a scanner with support for storable state. (-r)"\r
- Switch="-r"\r
- />\r
- <BooleanProperty\r
- Name="DebugOutput"\r
- DisplayName="Enable Debugging Output"\r
- PropertyPageName="Code Generation"\r
- Description="Generates a scanner that outputs its current position and state. You must define a YYDEBUG(int state, char current) macro to recieve this information. (-d)"\r
- Switch="-d"\r
- />\r
- <BooleanProperty\r
- Name="SinglePass"\r
- DisplayName="Single Pass Code Generation"\r
- PropertyPageName="Code Generation"\r
- Description="Forces single pass code generation. This disables YYMAXFILL generation prior to last block and cannot be used with storable state. (-1)"\r
- Switch="-1"\r
- />\r
- <BooleanProperty\r
- Name="Conditions"\r
- DisplayName="Require Start Conditions"\r
- PropertyPageName="Code Generation"\r
- Description="Enables support for (f)lex-like conditions. (-c)"\r
- Switch="-c"\r
- />\r
- <StringProperty\r
- Name="TypeHeader"\r
- DisplayName="Condition Header File"\r
- PropertyPageName="Code Generation"\r
- Description="Generates a header file that contains types for the (f)lex-like condition support. (-t[file])"\r
- Switch="-t"[value]""\r
- />\r
- </Properties>\r
- </CustomBuildRule>\r
- </Rules>\r
-</VisualStudioToolFile>\r
+++ /dev/null
-Summary: A tool for generating C-based recognizers from regular expressions
-Name: @PACKAGE_NAME@
-Version: @PACKAGE_VERSION@
-Release: @PACKAGE_RELEASE@
-License: Public Domain
-Group: Development/Tools
-URL: http://re2c.org/
-Source0: http://prdownloads.sourceforge.net/re2c/re2c-%{version}.tar.gz
-BuildRoot: %{_tmppath}/%{name}-%{version}-root
-
-%description
-re2c is a great tool for writing fast and flexible lexers. It has
-served many people well for many years and it deserves to be
-maintained more actively. re2c is on the order of 2-3 times faster
-than a flex based scanner, and its input model is much more
-flexible.
-
-%prep
-
-%setup -q
-
-%build
-./configure \
- --prefix=%{_prefix}
-make re2c
-#regenerate file scanner.cc
-rm -f scanner.cc
-./re2c -b scanner.re > scanner.cc
-rm -f re2c scanner.o
-make
-
-%install
-rm -rf $RPM_BUILD_ROOT
-mkdir -p $RPM_BUILD_ROOT%{_bindir}
-install -m 0755 re2c $RPM_BUILD_ROOT%{_bindir}
-
-mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1
-install -m 0755 re2c.1 $RPM_BUILD_ROOT%{_mandir}/man1
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-%changelog
-* Sun Jan 04 2003 Marcus Boerger <re2c@somabo.de>
-- Initial version.
-
-%files
-%defattr(-,root,root)
-%{_bindir}/re2c
-%{_mandir}/man1/re2c.1*
-
-%doc README examples doc/* lessons
version="$1"
# edit version in configure.in
-lcontext="AC_INIT\(re2c, "
-rcontext=", re2c-general@lists\.sourceforge\.net\)"
+lcontext="AC_INIT\(\[re2c\],\["
+rcontext="\],\[re2c-general@lists\.sourceforge\.net\]\)"
old="[0-9]+(\.[0-9]+)*(\.dev)?"
new=$version
sed -i -E "s/$lcontext$old$rcontext/$lcontext$new$rcontext/" configure.ac
./autogen.sh
-./configure --enable-docs
-make clean
-make -j5
-make docs
-make tests
-make zip dist
-
-# dist-check
-tmpdir=` date +"%Y%m%d%H%M%S%N"`
-mkdir $tmpdir
-cp re2c-$version.tar.gz $tmpdir
-cd $tmpdir
-gunzip re2c-$version.tar.gz
-tar -x -f re2c-$version.tar
-cd re2c-$version
-./configure
-make -j5
-make tests
-cd ../..
-rm -r $tmpdir
+builddir=.build
+rm -rf $builddir
+mkdir $builddir
+cd $builddir
+
+ ../configure --enable-docs && \
+ make bootstrap -j5 && \
+ make tests && \
+ make dist
+
+ # dist-check
+ tmpdir=` date +"%Y%m%d%H%M%S%N"`
+ mkdir $tmpdir
+ cp re2c-$version.tar.gz $tmpdir
+ cd $tmpdir
+ gunzip re2c-$version.tar.gz
+ tar -x -f re2c-$version.tar
+ cd re2c-$version
+ ./configure && \
+ make bootstrap -j5 && \
+ make tests
+
+ # upload files on sourceforge
+ src=release
+ src_tarballs=$src/frs/project/re2c/re2c/$version
+ src_docs=$src/project-web/re2c/htdocs
+ mkdir -p $src_tarballs
+ mkdir -p $src_docs
+ cp ../../re2c-$version.tar.gz $src_tarballs
+ cp doc/index.html doc/manual.html $src_docs
+ rsync -rK $src/ skvadrik@web.sourceforge.net:/home
+ cd ..
+ cd ..
+ rm -r $tmpdir
+
+cd .. # $builddir
# commit release
git commit -a -m "Release $version."
git tag $version
git push
git push --tags
-
-# upload files on sourceforge
-src=release
-src_tarballs=$src/frs/project/re2c/re2c/$version
-src_docs=$src/project-web/re2c/htdocs
-rm -rf $src
-mkdir -p $src_tarballs
-mkdir -p $src_docs
-cp re2c-$version-src.zip re2c-$version.tar.gz $src_tarballs
-cp htdocs/index.html htdocs/manual.html $src_docs
-rsync -rK $src/ skvadrik@web.sourceforge.net:/home
#!/bin/bash
+# somewhat portable way to detect CPU count
+detect_cpu_count () {
+ if [ "$CPUS" = "" ]; then
+ # Windows standard environment variable
+ CPUS="$NUMBER_OF_PROCESSORS"
+ fi
+ if [ "$CPUS" = "" ]; then
+ # Linux
+ CPUS=`getconf _NPROCESSORS_ONLN 2>/dev/null`
+ fi
+ if [ "$CPUS" = "" ]; then
+ # FreeBSD
+ CPUS=`getconf NPROCESSORS_ONLN 2>/dev/null`
+ fi
+ if [ "$CPUS" = "" ]; then
+ # nothing helped
+ CPUS="1"
+ fi
+ echo "using ${CPUS} CPUs" >&2
+}
+
valgrind=""
-threads=1
+threads=`detect_cpu_count; echo $CPUS`
tests=()
for arg in $*
do
esac
done
+testdir="@srcdir@/test"
if [ ${#tests[@]} -eq 0 ]
then
- tests=(`for i in test lessons; do find @top_srcdir@/$i -name '*.re'; done | sort`)
+ tests=(`for i in $testdir; do find $i -name '*.re'; done | sort`)
fi
tests_per_thread=$((${#tests[@]} / threads + 1))
packs=()
for x in $*
do
local switches=`basename $x | sed -e 's/^[^.]*\.\(.*\)\.re$/-\1/g' -e 's/^[^-].*//g' -e 's/\([^ ]\)--/\1 --/g' -e 's/(\([^)]*\))/ \1/g' -e 's/- //g'`
- local genname=` printf "%s" "$switches" | sed -e 's,--.*$,,g' -e 's,^.[^o]*$,,g' -e 's,^[^ot]*t.*o.*$,,g' -e 's,^-[^o]*o\(.*\),@builddir@/test/\1,g'`
- local headers=` printf "%s" "$switches" | sed -e 's,--.*$,,g' -e 's,^.[^t]*$,,g' -e 's,^[^ot]*o.*t.*$,,g' -e 's,^-[^t]*t\(.*\),@builddir@/test/\1,g'`
- local switches=`printf "%s" "$switches" | sed -e 's,^-\([^ot-]*[ot]\)\(.*\)$,-\1@builddir@/test/\2,g'`
+ local genname=` printf "%s" "$switches" | sed -e 's,--.*$,,g' -e 's,^.[^o]*$,,g' -e 's,^[^ot]*t.*o.*$,,g' -e 's,^-[^o]*o\(.*\),'"$testdir"'/\1,g'`
+ local headers=` printf "%s" "$switches" | sed -e 's,--.*$,,g' -e 's,^.[^t]*$,,g' -e 's,^[^ot]*o.*t.*$,,g' -e 's,^-[^t]*t\(.*\),'"$testdir"'/\1,g'`
+ local switches=`printf "%s" "$switches" | sed -e 's,^-\([^ot-]*[ot]\)\(.*\)$,-\1'"$testdir"'/\2,g'`
# don't use the -o flag, since it makes it harder to diff.
- local outname=@builddir@/test/`basename ${x%.re}.c.temp`
- local outdiff=@builddir@/test/`basename ${x%.re}.c.diff`
- local typname=@builddir@/test/`basename ${x%.re}.h.temp`
- local typdiff=@builddir@/test/`basename ${x%.re}.h.diff`
+ local outname=$testdir/`basename ${x%.re}.c.temp`
+ local outdiff=$testdir/`basename ${x%.re}.c.diff`
+ local typname=$testdir/`basename ${x%.re}.h.temp`
+ local typdiff=$testdir/`basename ${x%.re}.h.diff`
- $re2c $switches $x 2>&1 | LC_ALL=C sed -e "s,$x,`basename $x`,g" -e "s,/\* Generated by re2c .*\*/,/\* Generated by re2c \*/,g" > $outname
+ $re2c $switches $x 2>&1 | LC_ALL=C sed -e "s,$x,`basename $x`,g" -e 's,/\* Generated by re2c .*\*/,/\* Generated by re2c \*/,g' > $outname
if test -n "$genname"
then
- cat $genname | sed -e 's,@builddir@/test/,,g' -e "s,/\* Generated by re2c .*\*/,/\* Generated by re2c \*/,g" > $outname
+ cat $genname | sed -e 's,'"$testdir"'/,,g' -e 's,/\* Generated by re2c .*\*/,/\* Generated by re2c \*/,g' > $outname
rm $genname
fi
if test -n "$headers"
then
- cat $headers | sed -e 's,@builddir@/test/,,g' -e "s,/\* Generated by re2c .*\*/,/\* Generated by re2c \*/,g" > $typname
+ cat $headers | sed -e 's,'"$testdir"'/,,g' -e 's,/\* Generated by re2c .*\*/,/\* Generated by re2c \*/,g' > $typname
rm $headers
if test ! -f ${x%.re}.h
then
#include <iomanip>
#include <cctype>
-#include "globals.h"
-#include "parser.h"
-#include "dfa.h"
-#include "print.h"
-#include "skeleton.h"
-#include "utf8_regexp.h"
-#include "utf16_regexp.h"
+#include "src/dfa.h"
+#include "src/globals.h"
+#include "src/parser.h"
+#include "src/print.h"
+#include "src/skeleton.h"
+#include "src/utf8_regexp.h"
+#include "src/utf16_regexp.h"
namespace re2c
{
--- /dev/null
+#ifndef __C99_STDINT__
+#define __C99_STDINT__
+
+#include "config.h"
+
+#if HAVE_STDINT_H
+# include <stdint.h>
+#else // HAVE_STDINT_H
+
+// A humble attempt to provide C99 compliant <stdint.h>
+// for environments that don't have it (e.g., MSVC 2003).
+//
+// First, we try to define exact-width integer types. We don't
+// rely on any particular environment: instead, we search for
+// a type of certain width in the following list:
+// char (C89)
+// short (C89)
+// int (C89)
+// long (C89)
+// long long (C99)
+// __int64 (MSVC-specific)
+// (we consider even insane possibilities for simplicity).
+// The size of each type is defined by autoconf in the form
+// of a macro SIZEOF_<TYPE> (set to 0 for nonexistent types).
+// If we don't find a type with the required width, we typedef
+// the corresponding exact-width C99 type to a nonexistent
+// type name so that further compilation will fail.
+//
+// We define other types and constants based on exact-width
+// types and C99 standard.
+//
+// We use SIZEOF_VOID_P to determine size of pointers.
+//
+// We use SIZEOF_0<SUFFIX> to find suitable 64-bit integer
+// constant suffix.
+
+typedef
+#if SIZEOF_CHAR == 1
+ char
+#elif SIZEOF_SHORT == 1
+ short
+#elif SIZEOF_INT == 1
+ int
+#elif SIZEOF_LONG == 1
+ long
+#elif SIZEOF_LONG_LONG == 1
+ long long
+#elif SIZEOF___INT64 == 1
+ __int64
+#else
+ nonexistent_byte1_type
+#endif
+byte1_type;
+
+typedef
+#if SIZEOF_CHAR == 2
+ char
+#elif SIZEOF_SHORT == 2
+ short
+#elif SIZEOF_INT == 2
+ int
+#elif SIZEOF_LONG == 2
+ long
+#elif SIZEOF_LONG_LONG == 2
+ long long
+#elif SIZEOF___INT64 == 2
+ __int64
+#else
+ nonexistent_byte2_type
+#endif
+byte2_type;
+
+typedef
+#if SIZEOF_CHAR == 4
+ char
+#elif SIZEOF_SHORT == 4
+ short
+#elif SIZEOF_INT == 4
+ int
+#elif SIZEOF_LONG == 4
+ long
+#elif SIZEOF_LONG_LONG == 4
+ long long
+#elif SIZEOF___INT64 == 4
+ __int64
+#else
+ nonexistent_byte4_type
+#endif
+byte4_type;
+
+typedef
+#if SIZEOF_CHAR == 8
+ char
+#elif SIZEOF_SHORT == 8
+ short
+#elif SIZEOF_INT == 8
+ int
+#elif SIZEOF_LONG == 8
+ long
+#elif SIZEOF_LONG_LONG == 8
+ long long
+#elif SIZEOF___INT64 == 8
+ __int64
+#else
+ nonexistent_byte8_type
+#endif
+byte8_type;
+
+// C99-7.18.1.1 Exact-width integer types
+typedef byte1_type int8_t;
+typedef byte2_type int16_t;
+typedef byte4_type int32_t;
+typedef byte8_type int64_t;
+typedef unsigned byte1_type uint8_t;
+typedef unsigned byte2_type uint16_t;
+typedef unsigned byte4_type uint32_t;
+typedef unsigned byte8_type uint64_t;
+
+// C99-7.18.1.2 Minimum-width integer types
+typedef int8_t int_least8_t;
+typedef int16_t int_least16_t;
+typedef int32_t int_least32_t;
+typedef int64_t int_least64_t;
+typedef uint8_t uint_least8_t;
+typedef uint16_t uint_least16_t;
+typedef uint32_t uint_least32_t;
+typedef uint64_t uint_least64_t;
+
+// C99-7.18.1.3 Fastest minimum-width integer types
+typedef int8_t int_fast8_t;
+typedef int16_t int_fast16_t;
+typedef int32_t int_fast32_t;
+typedef int64_t int_fast64_t;
+typedef uint8_t uint_fast8_t;
+typedef uint16_t uint_fast16_t;
+typedef uint32_t uint_fast32_t;
+typedef uint64_t uint_fast64_t;
+
+// C99-7.18.1.4 Integer types capable of holding object pointers
+#if SIZEOF_VOID_P == 8
+ typedef int64_t intptr_t;
+ typedef uint64_t uintptr_t;
+#else
+ typedef int intptr_t;
+ typedef unsigned int uintptr_t;
+#endif
+
+// C99-7.18.1.5 Greatest-width integer types
+typedef int64_t intmax_t;
+typedef uint64_t uintmax_t;
+
+#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // See footnote 220 at page 257 and footnote 221 at page 259
+
+// C99-7.18.2.1 Limits of exact-width integer types
+#define INT8_MIN (-128) // -2^(8 - 1)
+#define INT8_MAX 127 // 2^(8 - 1) - 1
+#define INT16_MIN (-32768) // -2^(16 - 1)
+#define INT16_MAX 32767 // 2^(16 - 1) - 1
+#define INT32_MIN (-2147483648) // -2^(32 - 1)
+#define INT32_MAX 2147483647 // 2^(32 - 1) - 1
+#define INT64_MIN (-9223372036854775808) // -2^(64 - 1)
+#define INT64_MAX 9223372036854775807 // 2^(64 - 1) - 1
+#define UINT8_MAX 0xFF // 2^8 - 1
+#define UINT16_MAX 0xFFFF // 2^16 - 1
+#define UINT32_MAX 0xFFFFffff // 2^32 - 1
+#define UINT64_MAX 0xFFFFffffFFFFffff // 2^64 - 1
+
+// C99-7.18.2.2 Limits of minimum-width integer types
+#define INT_LEAST8_MIN INT8_MIN
+#define INT_LEAST8_MAX INT8_MAX
+#define INT_LEAST16_MIN INT16_MIN
+#define INT_LEAST16_MAX INT16_MAX
+#define INT_LEAST32_MIN INT32_MIN
+#define INT_LEAST32_MAX INT32_MAX
+#define INT_LEAST64_MIN INT64_MIN
+#define INT_LEAST64_MAX INT64_MAX
+#define UINT_LEAST8_MAX UINT8_MAX
+#define UINT_LEAST16_MAX UINT16_MAX
+#define UINT_LEAST32_MAX UINT32_MAX
+#define UINT_LEAST64_MAX UINT64_MAX
+
+// C99-7.18.2.3 Limits of fastest minimum-width integer types
+#define INT_FAST8_MIN INT8_MIN
+#define INT_FAST8_MAX INT8_MAX
+#define INT_FAST16_MIN INT16_MIN
+#define INT_FAST16_MAX INT16_MAX
+#define INT_FAST32_MIN INT32_MIN
+#define INT_FAST32_MAX INT32_MAX
+#define INT_FAST64_MIN INT64_MIN
+#define INT_FAST64_MAX INT64_MAX
+#define UINT_FAST8_MAX UINT8_MAX
+#define UINT_FAST16_MAX UINT16_MAX
+#define UINT_FAST32_MAX UINT32_MAX
+#define UINT_FAST64_MAX UINT64_MAX
+
+// C99-7.18.2.4 Limits of integer types capable of holding object pointers
+#define INTPTR_MIN (-32767) // -(2^15 - 1)
+#define INTPTR_MAX 32767 // 2^15 - 1
+#define UINTPTR_MAX 0xFFFF // 2^16 - 1
+
+// C99-7.18.2.5 Limits of greatest-width integer types
+#define INTMAX_MIN (-9223372036854775807) // -(2^63 - 1)
+#define INTMAX_MAX 9223372036854775807 // 2^63 - 1
+#define UINTMAX_MAX 0xFFFFffffFFFFffff // 2^64 - 1
+
+// C99-7.18.3 Limits of other integer types:
+// "An implementation shall define only the macros
+// corresponding to those typedef names it actually
+// provides"
+// and footnote 222 at page 259:
+// "A freestanding implementation need not provide
+// all of these types."
+//
+// Since we don't define corresponding types, we don't
+// define the following limits either:
+// PTRDIFF_MIN
+// PTRDIFF_MAX
+// SIG_ATOMIC_MIN
+// SIG_ATOMIC_MAX
+// SIZE_MAX
+// WCHAR_MIN
+// WCHAR_MAX
+// WINT_MIN
+// WINT_MAX
+
+#endif // __STDC_LIMIT_MACROS
+
+#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // See footnote 224 at page 260
+
+// C99-7.18.4.1 Macros for minimum-width integer constants
+#define INT8_C(x) x
+#define UINT8_C(x) x##u
+#define INT16_C(x) x
+#define UINT16_C(x) x##u
+#define INT32_C(x) x
+#define UINT32_C(x) x##u
+#if SIZEOF_0L == 8
+# define INT64_C(x) x##l
+# define UINT64_C(x) x##ul
+#elif SIZEOF_0LL == 8
+# define INT64_C(x) x##ll
+# define UINT64_C(x) x##ull
+#elif SIZEOF_0I8 == 8
+# define INT64_C(x) x##i8
+# define UINT64_C(x) x##ui8
+#else
+# define INT64_C(x) x
+# define UINT64_C(x) x##u
+#endif
+
+// C99-7.18.4.2 Macros for greatest-width integer constants
+#define INTMAX_C INT64_C
+#define UINTMAX_C UINT64_C
+
+#endif // __STDC_CONSTANT_MACROS
+
+#endif // HAVE_STDINT_H
+
+#endif // __C99_STDINT__
#include <iostream>
#include <sstream>
-#include "code.h"
-#include "globals.h"
-#include "go.h"
-#include "dfa.h"
-#include "indent.h"
-#include "input_api.h"
-#include "parser.h"
-#include "print.h"
-#include "skeleton.h"
-#include "substr.h"
+#include "src/code.h"
+#include "src/dfa.h"
+#include "src/globals.h"
+#include "src/go.h"
+#include "src/indent.h"
+#include "src/input_api.h"
+#include "src/parser.h"
+#include "src/print.h"
+#include "src/skeleton.h"
+#include "src/substr.h"
namespace re2c
{
#ifndef _code_h
#define _code_h
-#include "re.h"
+#include "src/re.h"
namespace re2c
{
-#include "code_names.h"
-#include "globals.h"
+#include "src/code_names.h"
+#include "src/globals.h"
namespace re2c
{
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
-#include "globals.h"
-#include "substr.h"
-#include "dfa.h"
-#include "print.h"
+
+#include "src/dfa.h"
+#include "src/globals.h"
+#include "src/print.h"
+#include "src/substr.h"
namespace re2c
{
#include <iosfwd>
#include <map>
-#include "go.h"
-#include "re.h"
+#include "src/go.h"
+#include "src/re.h"
namespace re2c
{
-#include "enc.h"
+#include "src/enc.h"
namespace re2c {
#ifndef _enc_h
#define _enc_h
-#include "c99_stdint.h"
-#include "range.h"
+#include "src/c99_stdint.h"
+#include "src/range.h"
namespace re2c {
#include <algorithm>
#include <string>
-#include "c99_stdint.h"
-#include "code_names.h"
-#include "enc.h"
-#include "input_api.h"
+#include "src/c99_stdint.h"
+#include "src/code_names.h"
+#include "src/enc.h"
+#include "src/input_api.h"
namespace re2c
{
#include <iostream>
#include <vector>
-#include "c99_stdint.h"
-#include "code.h"
+#include "src/c99_stdint.h"
+#include "src/code.h"
namespace re2c
{
-#include "dfa.h"
-#include "go.h"
+#include "src/dfa.h"
+#include "src/go.h"
namespace re2c
{
-#include "dfa.h"
-#include "go.h"
+#include "src/dfa.h"
+#include "src/go.h"
namespace re2c
{
-#include "dfa.h"
-#include "go.h"
-#include "indent.h"
-#include "print.h"
+#include "src/dfa.h"
+#include "src/go.h"
+#include "src/indent.h"
+#include "src/print.h"
namespace re2c
{
-#include "dfa.h"
-#include "go.h"
+#include "src/dfa.h"
+#include "src/go.h"
namespace re2c
{
#define _indent_h
#include <string>
-#include "globals.h"
+
+#include "src/globals.h"
namespace re2c
{
-#include "input.h"
+#include "src/input.h"
namespace re2c {
#ifndef _input_h
#define _input_h
-#include "stdio.h"
+#include <stdio.h>
#include <string>
namespace re2c {
#include <sstream>
-#include "globals.h"
-#include "indent.h"
-#include "input_api.h"
+#include "src/globals.h"
+#include "src/indent.h"
+#include "src/input_api.h"
namespace re2c
{
#include <map>
#include <string>
-#include "c99_stdint.h"
+#include "src/c99_stdint.h"
namespace re2c
{
#ifndef _ins_h
#define _ins_h
-#include "c99_stdint.h"
+#include "src/c99_stdint.h"
namespace re2c
{
/* $Id$ */
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#elif defined(_WIN32)
-#include "config_w32.h"
-#endif
#include <fstream>
#include <iostream>
#include <stdlib.h>
#include <string.h>
-#include "globals.h"
-#include "parser.h"
-#include "dfa.h"
-#include "enc.h"
-#include "mbo_getopt.h"
+#include "config.h"
+#include "src/dfa.h"
+#include "src/enc.h"
+#include "src/globals.h"
+#include "src/mbo_getopt.h"
+#include "src/parser.h"
namespace re2c
{
#include <string.h>
#include <assert.h>
#include <stdlib.h>
-#include "mbo_getopt.h"
+
+#include "src/mbo_getopt.h"
+
#define OPTERRCOLON (1)
#define OPTERRNF (2)
#define OPTERRARG (3)
#include <iomanip>
#include <stdio.h>
-#include "output.h"
-#include "print.h"
-#include "re.h"
+#include "src/output.h"
+#include "src/print.h"
+#include "src/re.h"
namespace re2c
{
#include <string>
#include <vector>
-#include "c99_stdint.h"
+#include "src/c99_stdint.h"
namespace re2c
{
#ifndef _parser_h
#define _parser_h
-#include "output.h"
-#include "re.h"
-#include "scanner.h"
+#include "src/output.h"
+#include "src/re.h"
+#include "src/scanner.h"
namespace re2c
{
/* $Id$ */
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
#include <assert.h>
#include <time.h>
#include <string.h>
#include <iostream>
#include <set>
-#include "globals.h"
-#include "parser.h"
-#include "c99_stdint.h"
-#include "dfa.h"
-#include "smart_ptr.h"
+#include "config.h"
+#include "src/c99_stdint.h"
+#include "src/dfa.h"
+#include "src/globals.h"
+#include "src/parser.h"
+#include "src/smart_ptr.h"
#define YYMALLOC malloc
#define YYFREE free
#include <iostream>
-#include "globals.h"
-#include "print.h"
+#include "src/globals.h"
+#include "src/print.h"
namespace re2c
{
#include <iosfwd>
-#include "c99_stdint.h"
+#include "src/c99_stdint.h"
namespace re2c
{
-#include "print.h"
-#include "range.h"
+#include "src/print.h"
+#include "src/range.h"
namespace re2c
{
#include <iostream>
-#include "c99_stdint.h"
-#include "free_list.h"
+#include "src/c99_stdint.h"
+#include "src/free_list.h"
namespace re2c
{
-#include "re.h"
-#include "range_suffix.h"
+#include "src/re.h"
+#include "src/range_suffix.h"
namespace re2c {
#include <stddef.h> // NULL
-#include "c99_stdint.h"
-#include "free_list.h"
+#include "src/c99_stdint.h"
+#include "src/free_list.h"
namespace re2c {
#include <vector>
#include <string>
-#include "free_list.h"
-#include "globals.h"
-#include "ins.h"
-#include "output.h"
-#include "range.h"
-#include "smart_ptr.h"
-#include "token.h"
+#include "src/free_list.h"
+#include "src/globals.h"
+#include "src/ins.h"
+#include "src/output.h"
+#include "src/range.h"
+#include "src/smart_ptr.h"
+#include "src/token.h"
namespace re2c
{
#include <string>
-#include "globals.h"
-#include "input.h"
-#include "output.h"
-#include "re.h"
-#include "token.h"
+#include "src/globals.h"
+#include "src/input.h"
+#include "src/output.h"
+#include "src/re.h"
+#include "src/token.h"
namespace re2c
{
#include <string.h>
#include <iostream>
#include <sstream>
-#include "scanner.h"
-#include "parser.h"
+
+#include "src/dfa.h"
+#include "src/globals.h"
+#include "src/parser.h"
+#include "src/print.h"
+#include "src/scanner.h"
#include "y.tab.h"
-#include "globals.h"
-#include "dfa.h"
-#include "print.h"
extern YYSTYPE yylval;
-#include "indent.h"
-#include "print.h"
-#include "skeleton.h"
+#include "src/indent.h"
+#include "src/print.h"
+#include "src/skeleton.h"
namespace re2c
{
#include <map>
#include <vector>
-#include "c99_stdint.h"
-#include "dfa.h"
+#include "src/c99_stdint.h"
+#include "src/dfa.h"
namespace re2c
{
/* $Id$ */
#include <string.h>
#include <stdlib.h>
-#include "substr.h"
-#include "globals.h"
+
+#include "src/globals.h"
+#include "src/substr.h"
#ifndef HAVE_STRNDUP
#include <string>
#include <string.h>
-#include "c99_stdint.h"
-
-#ifdef HAVE_CONFIG_H
#include "config.h"
-#elif defined(_WIN32)
-#include "config_w32.h"
-#endif
+#include "src/c99_stdint.h"
namespace re2c
{
#ifndef _token_h
#define _token_h
-#include "substr.h"
+#include "src/substr.h"
namespace re2c
{
/* $Id$ */
-#include "globals.h"
+#include "src/globals.h"
namespace re2c
{
-#include "utf16.h"
+#include "src/utf16.h"
namespace re2c {
#ifndef _re2c_utf16_h
#define _re2c_utf16_h
-#include "c99_stdint.h"
+#include "src/c99_stdint.h"
namespace re2c {
-#include "re.h"
-#include "utf16_range.h"
+#include "src/re.h"
+#include "src/utf16_range.h"
namespace re2c {
#ifndef _utf16_range_h
#define _utf16_range_h
-#include "range_suffix.h"
-#include "utf16.h"
+#include "src/range_suffix.h"
+#include "src/utf16.h"
namespace re2c {
-#include "re.h"
-#include "utf16_range.h"
-#include "utf16_regexp.h"
+#include "src/re.h"
+#include "src/utf16_range.h"
+#include "src/utf16_regexp.h"
namespace re2c {
#ifndef _utf16_regexp_h
#define _utf16_regexp_h
-#include "utf16.h"
+#include "src/utf16.h"
namespace re2c {
-#include "utf8.h"
+#include "src/utf8.h"
namespace re2c {
#ifndef _re2c_utf8_h
#define _re2c_utf8_h
-#include "c99_stdint.h"
+#include "src/c99_stdint.h"
namespace re2c {
-#include "re.h"
-#include "utf8_range.h"
+#include "src/re.h"
+#include "src/utf8_range.h"
namespace re2c {
#ifndef _utf8_range_h
#define _utf8_range_h
-#include "range_suffix.h"
-#include "utf8.h"
+#include "src/range_suffix.h"
+#include "src/utf8.h"
namespace re2c {
-#include "re.h"
-#include "utf8_range.h"
-#include "utf8_regexp.h"
+#include "src/re.h"
+#include "src/utf8_range.h"
+#include "src/utf8_regexp.h"
namespace re2c {
#ifndef _utf8_regexp_h
#define _utf8_regexp_h
-#include "utf8.h"
+#include "src/utf8.h"
namespace re2c {
+++ /dev/null
-a.out
-*.temp
-*.diff
+++ /dev/null
-const uint asc2asc[256] =
- {
- 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
- 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
- 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
- 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
- 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
- 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
- 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
- 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
- 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
- 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
- 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
- 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
- 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
- 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
- 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff
- };
+++ /dev/null
-const uint ebc2asc[256] =
- { /* Based on ISO 8859/1 and Code Page 37 */
- 0x00, 0x01, 0x02, 0x03, 0x9c, 0x09, 0x86, 0x7f, 0x97, 0x8d, 0x8e, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x10, 0x11, 0x12, 0x13, 0x9d, 0x85, 0x08, 0x87, 0x18, 0x19, 0x92, 0x8f, 0x1c, 0x1d, 0x1e, 0x1f,
- 0x80, 0x81, 0x82, 0x83, 0x84, 0x0a, 0x17, 0x1b, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x05, 0x06, 0x07,
- 0x90, 0x91, 0x16, 0x93, 0x94, 0x95, 0x96, 0x04, 0x98, 0x99, 0x9a, 0x9b, 0x14, 0x15, 0x9e, 0x1a,
- 0x20, 0xa0, 0xe2, 0xe4, 0xe0, 0xe1, 0xe3, 0xe5, 0xe7, 0xf1, 0xa2, 0x2e, 0x3c, 0x28, 0x2b, 0x7c,
- 0x26, 0xe9, 0xea, 0xeb, 0xe8, 0xed, 0xee, 0xef, 0xec, 0xdf, 0x21, 0x24, 0x2a, 0x29, 0x3b, 0xac,
- 0x2d, 0x2f, 0xc2, 0xc4, 0xc0, 0xc1, 0xc3, 0xc5, 0xc7, 0xd1, 0xa6, 0x2c, 0x25, 0x5f, 0x3e, 0x3f,
- 0xf8, 0xc9, 0xca, 0xcb, 0xc8, 0xcd, 0xce, 0xcf, 0xcc, 0x60, 0x3a, 0x23, 0x40, 0x27, 0x3d, 0x22,
- 0xd8, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0xab, 0xbb, 0xf0, 0xfd, 0xde, 0xb1,
- 0xb0, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0xaa, 0xba, 0xe6, 0xb8, 0xc6, 0xa4,
- 0xb5, 0x7e, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0xa1, 0xbf, 0xd0, 0xdd, 0xfe, 0xae,
- 0x5e, 0xa3, 0xa5, 0xb7, 0xa9, 0xa7, 0xb6, 0xbc, 0xbd, 0xbe, 0x5b, 0x5d, 0xaf, 0xa8, 0xb4, 0xd7,
- 0x7b, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0xad, 0xf4, 0xf6, 0xf2, 0xf3, 0xf5,
- 0x7d, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0xb9, 0xfb, 0xfc, 0xf9, 0xfa, 0xff,
- 0x5c, 0xf7, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0xb2, 0xd4, 0xd6, 0xd2, 0xd3, 0xd5,
- 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0xb3, 0xdb, 0xdc, 0xd9, 0xda, 0x9f
- };
+++ /dev/null
-const uint ebc2asc[256] =
- { /* Based on ISO 8859/1 and Code Page 37 */
- 0x00, 0x01, 0x02, 0x03, 0x9c, 0x09, 0x86, 0x7f, 0x97, 0x8d, 0x8e, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x10, 0x11, 0x12, 0x13, 0x9d, 0x85, 0x08, 0x87, 0x18, 0x19, 0x92, 0x8f, 0x1c, 0x1d, 0x1e, 0x1f,
- 0x80, 0x81, 0x82, 0x83, 0x84, 0x0a, 0x17, 0x1b, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x05, 0x06, 0x07,
- 0x90, 0x91, 0x16, 0x93, 0x94, 0x95, 0x96, 0x04, 0x98, 0x99, 0x9a, 0x9b, 0x14, 0x15, 0x9e, 0x1a,
- 0x20, 0xa0, 0xe2, 0xe4, 0xe0, 0xe1, 0xe3, 0xe5, 0xe7, 0xf1, 0xa2, 0x2e, 0x3c, 0x28, 0x2b, 0x7c,
- 0x26, 0xe9, 0xea, 0xeb, 0xe8, 0xed, 0xee, 0xef, 0xec, 0xdf, 0x21, 0x24, 0x2a, 0x29, 0x3b, 0xac,
- 0x2d, 0x2f, 0xc2, 0xc4, 0xc0, 0xc1, 0xc3, 0xc5, 0xc7, 0xd1, 0xa6, 0x2c, 0x25, 0x5f, 0x3e, 0x3f,
- 0xf8, 0xc9, 0xca, 0xcb, 0xc8, 0xcd, 0xce, 0xcf, 0xcc, 0x60, 0x3a, 0x23, 0x40, 0x27, 0x3d, 0x22,
- 0xd8, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0xab, 0xbb, 0xf0, 0xfd, 0xde, 0xb1,
- 0xb0, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0xaa, 0xba, 0xe6, 0xb8, 0xc6, 0xa4,
- 0xb5, 0x7e, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0xa1, 0xbf, 0xd0, 0xdd, 0xfe, 0xae,
- 0x5e, 0xa3, 0xa5, 0xb7, 0xa9, 0xa7, 0xb6, 0xbc, 0xbd, 0xbe, 0x5b, 0x5d, 0xaf, 0xa8, 0xb4, 0xd7,
- 0x7b, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0xad, 0xf4, 0xf6, 0xf2, 0xf3, 0xf5,
- 0x7d, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0xb9, 0xfb, 0xfc, 0xf9, 0xfa, 0xff,
- 0x5c, 0xf7, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0xb2, 0xd4, 0xd6, 0xd2, 0xd3, 0xd5,
- 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0xb3, 0xdb, 0xdc, 0xd9, 0xda, 0x9f
- };
+++ /dev/null
-const uint ebc2asc[256] =
- { /* Based on ISO 8859/1 and Code Page 37 */
- 0x00, 0x01, 0x02, 0x03, 0x9c, 0x09, 0x86, 0x7f, 0x97, 0x8d, 0x8e, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- 0x10, 0x11, 0x12, 0x13, 0x9d, 0x85, 0x08, 0x87, 0x18, 0x19, 0x92, 0x8f, 0x1c, 0x1d, 0x1e, 0x1f,
- 0x80, 0x81, 0x82, 0x83, 0x84, 0x0a, 0x17, 0x1b, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x05, 0x06, 0x07,
- 0x90, 0x91, 0x16, 0x93, 0x94, 0x95, 0x96, 0x04, 0x98, 0x99, 0x9a, 0x9b, 0x14, 0x15, 0x9e, 0x1a,
- 0x20, 0xa0, 0xe2, 0xe4, 0xe0, 0xe1, 0xe3, 0xe5, 0xe7, 0xf1, 0xa2, 0x2e, 0x3c, 0x28, 0x2b, 0x7c,
- 0x26, 0xe9, 0xea, 0xeb, 0xe8, 0xed, 0xee, 0xef, 0xec, 0xdf, 0x21, 0x24, 0x2a, 0x29, 0x3b, 0xac,
- 0x2d, 0x2f, 0xc2, 0xc4, 0xc0, 0xc1, 0xc3, 0xc5, 0xc7, 0xd1, 0xa6, 0x2c, 0x25, 0x5f, 0x3e, 0x3f,
- 0xf8, 0xc9, 0xca, 0xcb, 0xc8, 0xcd, 0xce, 0xcf, 0xcc, 0x60, 0x3a, 0x23, 0x40, 0x27, 0x3d, 0x22,
- 0xd8, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0xab, 0xbb, 0xf0, 0xfd, 0xde, 0xb1,
- 0xb0, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0xaa, 0xba, 0xe6, 0xb8, 0xc6, 0xa4,
- 0xb5, 0x7e, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0xa1, 0xbf, 0xd0, 0xdd, 0xfe, 0xae,
- 0x5e, 0xa3, 0xa5, 0xb7, 0xa9, 0xa7, 0xb6, 0xbc, 0xbd, 0xbe, 0x5b, 0x5d, 0xaf, 0xa8, 0xb4, 0xd7,
- 0x7b, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0xad, 0xf4, 0xf6, 0xf2, 0xf3, 0xf5,
- 0x7d, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0xb9, 0xfb, 0xfc, 0xf9, 0xfa, 0xff,
- 0x5c, 0xf7, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0xb2, 0xd4, 0xd6, 0xd2, 0xd3, 0xd5,
- 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0xb3, 0xdb, 0xdc, 0xd9, 0xda, 0x9f
- };
--- /dev/null
+/* re2c lesson 001_upn_calculator, calc_001, (c) M. Boerger 2006 - 2007 */
+/*!ignore:re2c
+
+- basic interface for string reading
+
+ . We define the macros YYCTYPE, YYCURSOR, YYLIMIT, YYMARKER, YYFILL
+ . YYCTYPE is the type re2c operates on or in other words the type that
+ it generates code for. While it is not a big difference when we were
+ using 'unsigned char' here we would need to run re2c with option -w
+ to fully support types with sieof() > 1.
+ . YYCURSOR is used internally and holds the current scanner position. In
+ expression handlers, the code blocks after re2c expressions, this can be
+ used to identify the end of the token.
+ . YYMARKER is not always being used so we set an initial value to avoid
+ a compiler warning. Here we could also omit it compleley.
+ . YYLIMIT stores the end of the input. Unfortunatley we have to use strlen()
+ in this lesson. In the next example we see one way to get rid of it.
+ . We use a 'for(;;)'-loop around the scanner block. We could have used a
+ 'while(1)'-loop instead but some compilers generate a warning for it.
+ . To make the output more readable we use 're2c:indent:top' scanner
+ configuration that configures re2c to prepend a single tab (the default)
+ to the beginning of each output line.
+ . The following lines are expressions and for each expression we output the
+ token name and continue the scanner loop.
+ . The second last token detects the end of our input, the terminating zero in
+ our input string. In other scanners detecting the end of input may vary.
+ For example binary code may contain \0 as valid input.
+ . The last expression accepts any input character. It tells re2c to accept
+ the opposit of the empty range. This includes numbers and our tokens but
+ as re2c goes from top to botton when evaluating the expressions this is no
+ problem.
+ . The first three rules show that re2c actually prioritizes the expressions
+ from top to bottom. Octal number require a starting "0" and the actual
+ number. Normal numbers start with a digit greater 0. And zero is finally a
+ special case. A single "0" is detected by the last rule of this set. And
+ valid ocal number is already being detected by the first rule. This even
+ includes multi "0" sequences that in octal notation also means zero.
+ Another way would be to only use two rules:
+ "0" [0-9]+
+ "0" | ( [1-9] [0-9]* )
+ A full description of re2c rule syntax can be found in the manual.
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+int scan(char *s, int l)
+{
+ char *p = s;
+ char *q = 0;
+#define YYCTYPE char
+#define YYCURSOR p
+#define YYLIMIT (s+l)
+#define YYMARKER q
+#define YYFILL(n)
+
+ for(;;)
+ {
+/*!re2c
+ re2c:indent:top = 2;
+ "0"[0-9]+ { printf("Oct\n"); continue; }
+ [1-9][0-9]* { printf("Num\n"); continue; }
+ "0" { printf("Num\n"); continue; }
+ "+" { printf("+\n"); continue; }
+ "-" { printf("-\n"); continue; }
+ "\000" { printf("EOF\n"); return 0; }
+ [^] { printf("ERR\n"); return 1; }
+*/
+ }
+}
+
+int main(int argc, char **argv)
+{
+ if (argc > 1)
+ {
+ return scan(argv[1], strlen(argv[1]));
+ }
+ else
+ {
+ fprintf(stderr, "%s <expr>\n", argv[0]);
+ return 1;
+ }
+}
--- /dev/null
+/* re2c lesson 001_upn_calculator, calc_002, (c) M. Boerger 2006 - 2007 */
+/*!ignore:re2c
+
+- making use of YYFILL
+
+ . Here we modified the scanner to not require strlen() on the call. Instead
+ we compute limit on the fly. That is whenever more input is needed we
+ search for the terminating \0 in the next n chars the scanner needs.
+ . If there is not enough input we quit the scanner.
+ . Note that in lesson_001 YYLIMIT was a character pointer computed only once.
+ Here is of course also of type YYCTYPE but a variable that gets reevaluated
+ by YYFILL().
+ . To make the code smaller we take advantage of the fact that our loop has no
+ break so far. This allows us to use break here and have the code that is
+ used for YYFILL() not contain the printf in every occurence. That way the
+ generated code gets smaller.
+
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+int fill(char *p, int n, char **l)
+{
+ while (*++p && n--) ;
+ * l = p;
+ return n <= 0;
+}
+
+int scan(char *s)
+{
+ char *p = s;
+ char *l = s;
+ char *q = 0;
+#define YYCTYPE char
+#define YYCURSOR p
+#define YYLIMIT l
+#define YYMARKER q
+#define YYFILL(n) { if (!fill(p, n, &l)) break; }
+
+ for(;;)
+ {
+/*!re2c
+ re2c:indent:top = 2;
+ "0"[0-9]+ { printf("Oct\n"); continue; }
+ [1-9][0-9]* { printf("Num\n"); continue; }
+ "0" { printf("Num\n"); continue; }
+ "+" { printf("+\n"); continue; }
+ "-" { printf("+\n"); continue; }
+ "\000" { printf("EOF\n"); return 0; }
+ [^] { printf("ERR\n"); return 1; }
+*/
+ }
+ printf("OOD\n"); return 2;
+}
+
+int main(int argc, char **argv)
+{
+ if (argc > 1)
+ {
+ return scan(argv[1]);
+ }
+ else
+ {
+ fprintf(stderr, "%s <expr>\n", argv[0]);
+ return 0;
+ }
+}
--- /dev/null
+/* re2c lesson 001_upn_calculator, calc_003, (c) M. Boerger 2006 - 2007 */
+/*!ignore:re2c
+
+- making use of YYFILL
+
+ . Again provide the length of the input to generate the limit only once. Now
+ we can use YYFILL() to detect the end and simply return since YYFILL() is
+ only being used if the next scanner run might use more chars then YYLIMIT
+ allows.
+ . Note that we now use (s+l+2) instead of (s+l) as we did in lesson_001. In
+ the first lesson we did not quit from YYFILL() and used a special rule to
+ detect the end of input. Here we use the fact that we know the exact end
+ of input and that this length does not include the terminating zero. Since
+ YYLIMIT points to the first character behind the used buffer we use "+ 2".
+ If we would use "+1" we could drop the "\000" rule but could no longer
+ distinguish between end of input and out of data.
+
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+int scan(char *s, int l)
+{
+ char *p = s;
+ char *q = 0;
+#define YYCTYPE char
+#define YYCURSOR p
+#define YYLIMIT (s+l+2)
+#define YYMARKER q
+#define YYFILL(n) { printf("OOD\n"); return 2; }
+
+ for(;;)
+ {
+/*!re2c
+ re2c:indent:top = 2;
+ "0"[0-9]+ { printf("Oct\n"); continue; }
+ [1-9][0-9]* { printf("Num\n"); continue; }
+ "0" { printf("Num\n"); continue; }
+ "+" { printf("+\n"); continue; }
+ "-" { printf("+\n"); continue; }
+ "\000" { printf("EOF\n"); return 0; }
+ [^] { printf("ERR\n"); return 1; }
+*/
+ }
+ return 0;
+}
+
+int main(int argc, char **argv)
+{
+ if (argc > 1)
+ {
+ return scan(argv[1], strlen(argv[1]));
+ }
+ else
+ {
+ fprintf(stderr, "%s <expr>\n", argv[0]);
+ return 0;
+ }
+}
--- /dev/null
+/* re2c lesson 001_upn_calculator, calc_004, (c) M. Boerger 2006 - 2007 */
+/*!ignore:re2c
+
+- making use of definitions
+ . We provide complex rules as definitions. We can even have definitions made
+ up from other definitions. And we could also use definitions as part of
+ rules and not only as full rules as shown in this lesson.
+
+- showing the tokens
+ . re2c does not store the beginning of a token on its own but we can easily
+ do this by providing variable, in our case t, that is set to YYCURSOR on
+ every loop. If we were not using a loop here the token, we could have used
+ s instead of a new variable instead.
+ . As we use the token for an output function that requires a terminating zero
+ we copy the token. Alternatively we could store the end of the token, then
+ replace it with a zero character and replace it after the token has been
+ used. However that approach is not always acceptable.
+
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+char * tokendup(const char *t, const char *l)
+{
+ size_t n = l -t + 1;
+ char *r = (char*)malloc(n);
+
+ memmove(r, t, n-1);
+ r[n] = '\0';
+ return r;
+}
+
+int scan(char *s, int l)
+{
+ char *p = s;
+ char *q = 0;
+ char *t;
+#define YYCTYPE char
+#define YYCURSOR p
+#define YYLIMIT (s+l+2)
+#define YYMARKER q
+#define YYFILL(n) { printf("OOD\n"); return 2; }
+
+ for(;;)
+ {
+ t = p;
+/*!re2c
+ re2c:indent:top = 2;
+
+ DIGIT = [0-9] ;
+ OCT = "0" DIGIT+ ;
+ INT = "0" | ( [1-9] DIGIT* ) ;
+
+ OCT { t = tokendup(t, p); printf("Oct: %s\n", t); free(t); continue; }
+ INT { t = tokendup(t, p); printf("Num: %s\n", t); free(t); continue; }
+ "+" { printf("+\n"); continue; }
+ "-" { printf("+\n"); continue; }
+ "\000" { printf("EOF\n"); return 0; }
+ [^] { printf("ERR\n"); return 1; }
+*/
+ }
+ return 0;
+}
+
+int main(int argc, char **argv)
+{
+ if (argc > 1)
+ {
+ return scan(argv[1], strlen(argv[1]));
+ }
+ else
+ {
+ fprintf(stderr, "%s <expr>\n", argv[0]);
+ return 0;
+ }
+}
--- /dev/null
+/* re2c lesson 001_upn_calculator, calc_005, (c) M. Boerger 2006 - 2007 */
+/*!ignore:re2c
+
+- turning this lesson into an easy calculator
+ . We are going to write an UPN calculator so we need an additional rule to
+ ignore white space.
+ . Then we need to store the scanned input somewhere and do our math on it.
+ . Also we need to scan all arguments since the main c code gets the input
+ split up into chunks.
+ . In contrast to what we did before we now add a variable res that holds the
+ scanner state. We initialize that variable to 0 and quit the loop when it
+ is non zero. This will also be our return value so that we can use it in
+ function main to generate error information.
+ . To support operating systems where ' and " get passed in program arguments
+ we check for them being first and last input character. If so we correct
+ input pointer and input length. Since now our scanner might not see a
+ terminating zero we change YYLIMIT again and drop the special zero rule.
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#define DEBUG(stmt) stmt
+
+int stack[4];
+int depth = 0;
+
+int push_num(const char *t, const char *l, int radix)
+{
+ int num = 0;
+
+ if (depth >= sizeof(stack))
+ {
+ return 3;
+ }
+
+ --t;
+ while(++t < l)
+ {
+ num = num * radix + (*t - '0');
+ }
+ DEBUG(printf("Num: %d\n", num));
+
+ stack[depth++] = num;
+ return 0;
+}
+
+int stack_add()
+{
+ if (depth < 2) return 4;
+
+ --depth;
+ stack[depth-1] = stack[depth-1] + stack[depth];
+ return 0;
+}
+
+int stack_sub()
+{
+ if (depth < 2) return 4;
+
+ --depth;
+ stack[depth-1] = stack[depth-1] - stack[depth];
+ return 0;
+}
+
+int scan(char *s, int l)
+{
+ char *p = s;
+ char *q = 0;
+ char *t;
+ int res = 0;
+
+#define YYCTYPE char
+#define YYCURSOR p
+#define YYLIMIT (s+l+1)
+#define YYMARKER q
+#define YYFILL(n) { return depth == 1 ? 0 : 2; }
+
+ while(!res)
+ {
+ t = p;
+/*!re2c
+ re2c:indent:top = 2;
+
+ DIGIT = [0-9] ;
+ OCT = "0" DIGIT+ ;
+ INT = "0" | ( [1-9] DIGIT* ) ;
+ WS = [ \t]+ ;
+
+ WS { continue; }
+ OCT { res = push_num(t, p, 8); continue; }
+ INT { res = push_num(t, p, 10); continue; }
+ "+" { res = stack_add(); continue; }
+ "-" { res = stack_sub(); continue; }
+ [^] { res = 1; continue; }
+*/
+ }
+ return res;
+}
+
+int main(int argc, char **argv)
+{
+ if (argc > 1)
+ {
+ char *inp;
+ int res = 0, argp = 0, len;
+
+ while(!res && ++argp < argc)
+ {
+ inp = argv[argp];
+ len = strlen(inp);
+ if (inp[0] == '\"' && inp[len-1] == '\"')
+ {
+ ++inp;
+ len -=2;
+ }
+ res = scan(inp, len);
+ }
+ switch(res)
+ {
+ case 0:
+ printf("Result: %d\n", stack[0]);
+ return 0;
+ case 1:
+ fprintf(stderr, "Illegal character in input.\n");
+ return 1;
+ case 2:
+ fprintf(stderr, "Premature end of input.\n");
+ return 2;
+ case 3:
+ fprintf(stderr, "Stack overflow.\n");
+ return 3;
+ case 4:
+ fprintf(stderr, "Stack underflow.\n");
+ return 4;
+ }
+ }
+ else
+ {
+ fprintf(stderr, "%s <expr>\n", argv[0]);
+ return 0;
+ }
+}
--- /dev/null
+/* re2c lesson 001_upn_calculator, calc_006, (c) M. Boerger 2006 - 2007 */
+/*!ignore:re2c
+
+- avoiding YYFILL()
+ . We use the inplace configuration re2c:yyfill to suppress generation of
+ YYFILL() blocks. This of course means we no longer have to provide the
+ macro.
+ . We also drop the YYMARKER stuff since we know that re2c does not generate
+ it for this example.
+ . Since re2c does no longer check for out of data situations we must do this.
+ For that reason we first reintroduce our zero rule and second we need to
+ ensure that the scanner does not take more than one bytes in one go.
+
+ In the example suppose "0" is passed. The scanner reads the first "0" and
+ then is in an undecided state. The scanner can earliest decide on the next
+ char what the token is. In case of a zero the input ends and it was a
+ number, 0 to be precise. In case of a digit it is an octal number and the
+ next character needs to be read. In case of any other character the scanner
+ will detect an error with the any rule [^].
+
+ Now the above shows that the scanner may read two characters directly. But
+ only if the first is a "0". So we could easily check that if the first char
+ is "0" and the next char is a digit then yet another charcter is present.
+ But we require our inut to be zero terminated. And that means we do not
+ have to check anything for this scanner.
+
+ However with other rule sets re2c might read more then one character in a
+ row. In those cases it is normally hard to impossible to avoid YYFILL.
+
+- optimizing the generated code by using -s command line switch of re2c
+ . This tells re2c to generate code that uses if statements rather
+ then endless switch/case expressions where appropriate. Note that the
+ generated code now requires the input to be unsigned char rather than char
+ due to the way comparisons are generated.
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#define DEBUG(stmt) stmt
+
+int stack[4];
+int depth = 0;
+
+int push_num(const unsigned char *t, const unsigned char *l, int radix)
+{
+ int num = 0;
+
+ if (depth >= sizeof(stack))
+ {
+ return 3;
+ }
+
+ --t;
+ while(++t < l)
+ {
+ num = num * radix + (*t - (unsigned char)'0');
+ }
+ DEBUG(printf("Num: %d\n", num));
+
+ stack[depth++] = num;
+ return 0;
+}
+
+int stack_add()
+{
+ if (depth < 2) return 4;
+
+ --depth;
+ stack[depth-1] = stack[depth-1] + stack[depth];
+ DEBUG(printf("+\n"));
+ return 0;
+}
+
+int stack_sub()
+{
+ if (depth < 2) return 4;
+
+ --depth;
+ stack[depth-1] = stack[depth-1] - stack[depth];
+ DEBUG(printf("-\n"));
+ return 0;
+}
+
+int scan(char *s)
+{
+ unsigned char *p = (unsigned char*)s;
+ unsigned char *t;
+ int res = 0;
+
+#define YYCTYPE unsigned char
+#define YYCURSOR p
+
+ while(!res)
+ {
+ t = p;
+/*!re2c
+ re2c:indent:top = 2;
+ re2c:yyfill:enable = 0;
+
+ DIGIT = [0-9] ;
+ OCT = "0" DIGIT+ ;
+ INT = "0" | ( [1-9] DIGIT* ) ;
+ WS = [ \t]+ ;
+
+ WS { continue; }
+ OCT { res = push_num(t, p, 8); continue; }
+ INT { res = push_num(t, p, 10); continue; }
+ "+" { res = stack_add(); continue; }
+ "-" { res = stack_sub(); continue; }
+ "\000" { res = depth == 1 ? 0 : 2; break; }
+ [^] { res = 1; continue; }
+*/
+ }
+ return res;
+}
+
+int main(int argc, char **argv)
+{
+ if (argc > 1)
+ {
+ char *inp;
+ int res = 0, argp = 0, len;
+
+ while(!res && ++argp < argc)
+ {
+ inp = strdup(argv[argp]);
+ len = strlen(inp);
+ if (inp[0] == '\"' && inp[len-1] == '\"')
+ {
+ inp[len - 1] = '\0';
+ ++inp;
+ }
+ res = scan(inp);
+ free(inp);
+ }
+ switch(res)
+ {
+ case 0:
+ printf("Result: %d\n", stack[0]);
+ return 0;
+ case 1:
+ fprintf(stderr, "Illegal character in input.\n");
+ return 1;
+ case 2:
+ fprintf(stderr, "Premature end of input.\n");
+ return 2;
+ case 3:
+ fprintf(stderr, "Stack overflow.\n");
+ return 3;
+ case 4:
+ fprintf(stderr, "Stack underflow.\n");
+ return 4;
+ }
+ }
+ else
+ {
+ fprintf(stderr, "%s <expr>\n", argv[0]);
+ return 0;
+ }
+}
--- /dev/null
+/* re2c lesson 001_upn_calculator, calc_007, (c) M. Boerger 2006 - 2007 */
+/*!ignore:re2c
+
+- optimizing the generated code by using -b command line switch of re2c
+ . This tells re2c to generate code that uses a decision table. The -b switch
+ also contains the -s behavior. And -b also requires the input to be
+ unsigned chars.
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#define DEBUG(stmt) stmt
+
+int stack[4];
+int depth = 0;
+
+int push_num(const unsigned char *t, const unsigned char *l, int radix)
+{
+ int num = 0;
+
+ if (depth >= sizeof(stack))
+ {
+ return 3;
+ }
+
+ --t;
+ while(++t < l)
+ {
+ num = num * radix + (*t - (unsigned char)'0');
+ }
+ DEBUG(printf("Num: %d\n", num));
+
+ stack[depth++] = num;
+ return 0;
+}
+
+int stack_add()
+{
+ if (depth < 2) return 4;
+
+ --depth;
+ stack[depth-1] = stack[depth-1] + stack[depth];
+ DEBUG(printf("+\n"));
+ return 0;
+}
+
+int stack_sub()
+{
+ if (depth < 2) return 4;
+
+ --depth;
+ stack[depth-1] = stack[depth-1] - stack[depth];
+ DEBUG(printf("+\n"));
+ return 0;
+}
+
+int scan(char *s)
+{
+ unsigned char *p = (unsigned char*)s;
+ unsigned char *t;
+ int res = 0;
+
+#define YYCTYPE unsigned char
+#define YYCURSOR p
+
+ while(!res)
+ {
+ t = p;
+/*!re2c
+ re2c:indent:top = 2;
+ re2c:yyfill:enable = 0;
+
+ DIGIT = [0-9] ;
+ OCT = "0" DIGIT+ ;
+ INT = "0" | ( [1-9] DIGIT* ) ;
+ WS = [ \t]+ ;
+
+ WS { continue; }
+ OCT { res = push_num(t, p, 8); continue; }
+ INT { res = push_num(t, p, 10); continue; }
+ "+" { res = stack_add(); continue; }
+ "-" { res = stack_sub(); continue; }
+ "\000" { res = depth == 1 ? 0 : 2; break; }
+ [^] { res = 1; continue; }
+*/
+ }
+ return res;
+}
+
+int main(int argc, char **argv)
+{
+ if (argc > 1)
+ {
+ char *inp;
+ int res = 0, argp = 0, len;
+
+ while(!res && ++argp < argc)
+ {
+ inp = strdup(argv[argp]);
+ len = strlen(inp);
+ if (inp[0] == '\"' && inp[len-1] == '\"')
+ {
+ inp[len - 1] = '\0';
+ ++inp;
+ }
+ res = scan(inp);
+ free(inp);
+ }
+ switch(res)
+ {
+ case 0:
+ printf("Result: %d\n", stack[0]);
+ return 0;
+ case 1:
+ fprintf(stderr, "Illegal character in input.\n");
+ return 1;
+ case 2:
+ fprintf(stderr, "Premature end of input.\n");
+ return 2;
+ case 3:
+ fprintf(stderr, "Stack overflow.\n");
+ return 3;
+ case 4:
+ fprintf(stderr, "Stack underflow.\n");
+ return 4;
+ }
+ }
+ else
+ {
+ fprintf(stderr, "%s <expr>\n", argv[0]);
+ return 0;
+ }
+}
--- /dev/null
+/* re2c lesson 001_upn_calculator, calc_008, (c) M. Boerger 2006 - 2007 */
+/*!ignore:re2c
+
+- using -b with signed character input
+ . Since the code is being generated with -b switch re2c requires the internal
+ character variable yych to use an unsigned character type. For that reason
+ the previous lessons had a conversion at the beginning of their scan()
+ function. Other re2c generated code often have the scanners work completely
+ on unsigned input. Thus requesting a conversion.
+
+ To avoid the conversion on input, re2c allows to do the conversion when
+ reading the internal yych variable. To enable that conversion you need to
+ use the implace configuration 're2c:yych:conversion' and set it to 1. This
+ will change the generated code to insert conversions to YYCTYPE whenever
+ yych is being read.
+
+- More inplace configurations for better/nicer code
+ . re2c allows to overwrite the generation of any define, label or variable
+ used in the generated code. For example we overwrite the 'yych' variable
+ name to 'curr' using inplace configuration 're2c:variable:yych = curr;'.
+
+ . We further more use inplace configurations instead of defines. This allows
+ to use correct conversions to 'unsigned char' instead of having to convert
+ to 'YYCTYPE' when placing 're2c:define:YYCTYPE = "unsigned char";' infront
+ of 're2c:yych:conversion'. Note that we have to use apostrophies for the
+ first setting as it contains a space.
+
+ . Last but not least we use 're2c:labelprefix = scan' to change the prefix
+ of generated labels.
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#define DEBUG(stmt) stmt
+
+int stack[4];
+int depth = 0;
+
+int push_num(const char *t, const char *l, int radix)
+{
+ int num = 0;
+
+ if (depth >= sizeof(stack))
+ {
+ return 3;
+ }
+
+ --t;
+ while(++t < l)
+ {
+ num = num * radix + (*t - '0');
+ }
+ DEBUG(printf("Num: %d\n", num));
+
+ stack[depth++] = num;
+ return 0;
+}
+
+int stack_add()
+{
+ if (depth < 2) return 4;
+
+ --depth;
+ stack[depth-1] = stack[depth-1] + stack[depth];
+ DEBUG(printf("+\n"));
+ return 0;
+}
+
+int stack_sub()
+{
+ if (depth < 2) return 4;
+
+ --depth;
+ stack[depth-1] = stack[depth-1] - stack[depth];
+ DEBUG(printf("+\n"));
+ return 0;
+}
+
+int scan(char *p)
+{
+ char *t;
+ int res = 0;
+
+ while(!res)
+ {
+ t = p;
+/*!re2c
+ re2c:define:YYCTYPE = "unsigned char";
+ re2c:define:YYCURSOR = p;
+ re2c:variable:yych = curr;
+ re2c:indent:top = 2;
+ re2c:yyfill:enable = 0;
+ re2c:yych:conversion = 1;
+ re2c:labelprefix = scan;
+
+ DIGIT = [0-9] ;
+ OCT = "0" DIGIT+ ;
+ INT = "0" | ( [1-9] DIGIT* ) ;
+ WS = [ \t]+ ;
+
+ WS { continue; }
+ OCT { res = push_num(t, p, 8); continue; }
+ INT { res = push_num(t, p, 10); continue; }
+ "+" { res = stack_add(); continue; }
+ "-" { res = stack_sub(); continue; }
+ "\000" { res = depth == 1 ? 0 : 2; break; }
+ [^] { res = 1; continue; }
+*/
+ }
+ return res;
+}
+
+int main(int argc, char **argv)
+{
+ if (argc > 1)
+ {
+ char *inp;
+ int res = 0, argp = 0, len;
+
+ while(!res && ++argp < argc)
+ {
+ inp = strdup(argv[argp]);
+ len = strlen(inp);
+ if (inp[0] == '\"' && inp[len-1] == '\"')
+ {
+ inp[len - 1] = '\0';
+ ++inp;
+ }
+ res = scan(inp);
+ free(inp);
+ }
+ switch(res)
+ {
+ case 0:
+ printf("Result: %d\n", stack[0]);
+ return 0;
+ case 1:
+ fprintf(stderr, "Illegal character in input.\n");
+ return 1;
+ case 2:
+ fprintf(stderr, "Premature end of input.\n");
+ return 2;
+ case 3:
+ fprintf(stderr, "Stack overflow.\n");
+ return 3;
+ case 4:
+ fprintf(stderr, "Stack underflow.\n");
+ return 4;
+ }
+ }
+ else
+ {
+ fprintf(stderr, "%s <expr>\n", argv[0]);
+ return 0;
+ }
+}
--- /dev/null
+/* re2c lesson 001_upn_calculator, main.b.re, (c) M. Boerger, L. Allan 2006 */
+/*!ignore:re2c
+
+- basic interface for string reading
+
+ . We define the macros YYCTYPE, YYCURSOR, YYLIMIT, YYMARKER, YYFILL
+ . YYCTYPE is the type re2c operates on or in other words the type that
+ it generates code for. While it is not a big difference when we were
+ using 'unsigned char' here we would need to run re2c with option -w
+ to fully support types with sieof() > 1.
+ . YYCURSOR is used internally and holds the current scanner position. In
+ expression handlers, the code blocks after re2c expressions, this can be
+ used to identify the end of the token.
+ . YYMARKER is not always being used so we set an initial value to avoid
+ a compiler warning.
+ . YYLIMIT stores the end of the input. Unfortunatley we have to use strlen()
+ in this lesson. In the next example we see one way to get rid of it.
+ . We use a 'for(;;)'-loop around the scanner block. We could have used a
+ 'while(1)'-loop instead but some compilers generate a warning for it.
+ . To make the output more readable we use 're2c:indent:top' scanner
+ configuration that configures re2c to prepend a single tab (the default)
+ to the beginning of each output line.
+ . The following lines are expressions and for each expression we output the
+ token name and continue the scanner loop.
+ . The second last token detects the end of our input, the terminating zero in
+ our input string. In other scanners detecting the end of input may vary.
+ For example binary code may contain \0 as valid input.
+ . The last expression accepts any input character. It tells re2c to accept
+ the opposit of the empty range. This includes numbers and our tokens but
+ as re2c goes from top to botton when evaluating the expressions this is no
+ problem.
+ . The first three rules show that re2c actually prioritizes the expressions
+ from top to bottom. Octal number require a starting "0" and the actual
+ number. Normal numbers start with a digit greater 0. And zero is finally a
+ special case. A single "0" is detected by the last rule of this set. And
+ valid ocal number is already being detected by the first rule. This even
+ includes multi "0" sequences that in octal notation also means zero.
+ Another way would be to only use two rules:
+ "0" [0-9]+
+ "0" | ( [1-9] [0-9]* )
+ A full description of re2c rule syntax can be found in the manual.
+*/
+
+#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
+
+#if _MSC_VER > 1200
+#define WINVER 0x0400 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later.
+#endif // Prevents warning from vc7.1 complaining about redefinition
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <string.h>
+#include <windows.h>
+#include "HiResTimer.h"
+
+static char gTestBuf[1000] = "";
+
+/**
+ * @brief Setup HiResolution timer and confirm it is working ok
+ */
+void InitHiResTimerAndVerifyWorking(void)
+{
+ double elapsed;
+ HrtInit();
+ HrtSetPriority(ABOVE_NORMAL_PRIORITY_CLASS);
+ HrtStart();
+ Sleep(100);
+ elapsed = HrtElapsedMillis();
+ if ((elapsed < 90) || (elapsed > 110)) {
+ printf("HiResTimer misbehaving: %f\n", elapsed);
+ exit(2);
+ }
+}
+
+/**
+ * @brief Scan for numbers in different formats
+ */
+int ScanFullSpeed(char *pzStrToScan, size_t lenStrToScan)
+{
+ unsigned char *pzCurScanPos = (unsigned char*)pzStrToScan;
+ unsigned char *pzBacktrackInfo = 0;
+#define YYCTYPE unsigned char
+#define YYCURSOR pzCurScanPos
+#define YYLIMIT (pzStrToScan+lenStrToScan)
+#define YYMARKER pzBacktrackInfo
+#define YYFILL(n)
+
+ for(;;)
+ {
+/*!re2c
+ re2c:indent:top = 2;
+ [1-9][0-9]* { continue; }
+ [0][0-9]+ { continue; }
+ "+" { continue; }
+ "-" { continue; }
+ "\000" { return 0; }
+ [^] { return 1; }
+*/
+ }
+}
+
+/**
+ * @brief Scan for numbers in different formats
+ */
+int scan(char *pzStrToScan, size_t lenStrToScan)
+{
+ unsigned char *pzCurScanPos = (unsigned char*)pzStrToScan;
+ unsigned char *pzBacktrackInfo = 0;
+#define YYCTYPE unsigned char
+#define YYCURSOR pzCurScanPos
+#define YYLIMIT (pzStrToScan+lenStrToScan)
+#define YYMARKER pzBacktrackInfo
+#define YYFILL(n)
+
+ for(;;)
+ {
+/*!re2c
+ re2c:indent:top = 2;
+ [1-9][0-9]* { printf("Num\n"); strcat(gTestBuf, "Num "); continue; }
+ [0][0-9]+ { printf("Oct\n"); strcat(gTestBuf, "Oct "); continue; }
+ "+" { printf("+\n"); strcat(gTestBuf, "+ "); continue; }
+ "-" { printf("-\n"); strcat(gTestBuf, "- "); continue; }
+ "\000" { printf("EOF\n"); return 0; }
+ [^] { printf("ERR\n"); strcat(gTestBuf, "ERR "); return 1; }
+*/
+ }
+}
+
+/**
+ * @brief Show high resolution elapsed time for 10,000 and 100,000 loops
+ */
+void DoTimingsOfStrnCmp(void)
+{
+ char testStr[] = "Hello, world";
+ int totLoops = 10000;
+ int totFoundCount = 0;
+ int foundCount = 0;
+ int loop;
+ int rc;
+ const int progressAnd = 0xFFFFF000;
+ double elapsed;
+
+ printf("\n\n%d loops with * every %d loops to confirm\n", totLoops, ((~progressAnd) + 1));
+
+ HrtStart();
+ for (loop = 0; loop < totLoops; ++loop) {
+ foundCount = 0;
+ rc = strncmp(testStr, "Hello", 5);
+ if (rc == 0) {
+ foundCount++;
+ totFoundCount++;
+ if ((totFoundCount & progressAnd) == totFoundCount) {
+ printf("*");
+ }
+ }
+ }
+ elapsed = HrtElapsedMillis();
+ printf("\nstrncmp Elapsed for %7d loops milliseconds: %7.3f\n", totLoops, elapsed);
+ printf("FoundCount each loop: %d\n", foundCount);
+ printf("TotalFoundCount for all loops: %d\n", totFoundCount);
+
+ totLoops = 100000;
+ HrtStart();
+ for (loop = 0; loop < totLoops; ++loop) {
+ foundCount = 0;
+ rc = strncmp(testStr, "Hello", 5);
+ if (rc == 0) {
+ foundCount++;
+ totFoundCount++;
+ if ((totFoundCount & progressAnd) == totFoundCount) {
+ printf("*");
+ }
+ }
+ }
+ elapsed = HrtElapsedMillis();
+ printf("\nstrncmp Elapsed for %7d loops milliseconds: %7.3f\n", totLoops, elapsed);
+ printf("FoundCount each loop: %d\n", foundCount);
+ printf("TotalFoundCount for all loops: %d\n", totFoundCount);
+}
+
+/**
+ * @brief Show high resolution elapsed time for 10,000 and 100,000 loops
+ */
+void DoTimingsOfRe2c(void)
+{
+ char* testStrings[] = { "123", "1234", "+123", "01234", "-04321", "abc", "123abc" };
+ const int testCount = sizeof(testStrings) / sizeof(testStrings[0]);
+ int i;
+ int totLoops = 10000 / testCount; // Doing more than one per loop
+ int totFoundCount = 0;
+ int foundCount = 0;
+ int loop;
+ int rc;
+ const int progressAnd = 0xFFFFF000;
+ double elapsed;
+
+ printf("\n\n%d loops with * every %d loops to confirm\n", totLoops, ((~progressAnd) + 1));
+
+ HrtStart();
+ for (loop = 0; loop < totLoops; ++loop) {
+ foundCount = 0;
+ strcpy(gTestBuf, "");
+ for (i = 0; i < testCount; ++i) {
+ char* pzCurStr = testStrings[i];
+ size_t len = strlen(pzCurStr); // Calc of strlen slows things down ... std::string?
+ rc = ScanFullSpeed(pzCurStr, len);
+ if (rc == 0) {
+ foundCount++;
+ totFoundCount++;
+ if ((totFoundCount & progressAnd) == totFoundCount) {
+ printf("*");
+ }
+ }
+ }
+ }
+ elapsed = HrtElapsedMillis();
+ printf("\nRe2c Elapsed for %7d loops milliseconds: %7.3f\n", totLoops, elapsed);
+ printf("FoundCount each loop: %d\n", foundCount);
+ printf("TotalFoundCount for all loops: %d\n", totFoundCount);
+
+ totLoops = 100000 / testCount;
+ printf("\n\n%d loops with * every %d loops to confirm\n", totLoops, ((~progressAnd) + 1));
+
+ HrtStart();
+ for (loop = 0; loop < totLoops; ++loop) {
+ foundCount = 0;
+ strcpy(gTestBuf, "");
+ for (i = 0; i < testCount; ++i) {
+ char* pzCurStr = testStrings[i];
+ size_t len = strlen(pzCurStr); // Calc of strlen slows things down ... std::string?
+ rc = ScanFullSpeed(pzCurStr, len);
+ if (rc == 0) {
+ foundCount++;
+ totFoundCount++;
+ if ((totFoundCount & progressAnd) == totFoundCount) {
+ printf("*");
+ }
+ }
+ }
+ }
+ elapsed = HrtElapsedMillis();
+ printf("\nRe2c Elapsed for %7d loops milliseconds: %7.3f\n", totLoops, elapsed);
+ printf("FoundCount each loop: %d\n", foundCount);
+ printf("TotalFoundCount for all loops: %d\n", totFoundCount);
+}
+
+/**
+ * @brief Entry point for console app
+ */
+int main(int argc, char **argv)
+{
+ char testStr_A[] = "123";
+ char* testStr_B = "456";
+ char* testStrings[] = { "123", "1234", "+123", "01234", "-04321", "abc", "123abc" };
+ const int testCount = sizeof(testStrings) / sizeof(testStrings[0]);
+ int i;
+
+ int rc = scan(testStr_A, 3);
+ printf("rc: %d\n", rc);
+
+ rc = scan(testStr_B, 3);
+ printf("rc: %d\n", rc);
+
+ rc = scan("789", 3);
+ printf("rc: %d\n", rc);
+
+ strcpy(gTestBuf, "");
+ for (i = 0; i < testCount; ++i) {
+ char* pzCurStr = testStrings[i];
+ size_t len = strlen(pzCurStr);
+ scan(pzCurStr, len);
+ }
+ printf("%s\n", gTestBuf);
+ rc = strcmp(gTestBuf, "Num Num + Num Oct - Oct ERR Num ERR ");
+ if (rc == 0) {
+ printf("Success\n");
+ }
+ else {
+ printf("Failure\n");
+ }
+ assert(0 == rc); // Doesn't work with Release build
+
+ InitHiResTimerAndVerifyWorking();
+
+ DoTimingsOfStrnCmp();
+
+ DoTimingsOfRe2c();
+
+ return 0;
+}
--- /dev/null
+/* Generated by re2c */
+#line 1 "rexx.re"
+#include "scanio.h"
+#include "scanner.h"
+
+#define CURSOR ch
+#define LOADCURSOR ch = *cursor;
+#define ADVANCE cursor++;
+#define BACK(n) cursor -= (n);
+#define CHECK(n) if((ScanCB.lim - cursor) < (n)){cursor = ScanFill(cursor);}
+#define MARK(n) ScanCB.ptr = cursor; sel = (n);
+#define REVERT cursor = ScanCB.ptr;
+#define MARKER sel
+
+#define RETURN(i) {ScanCB.cur = cursor; return i;}
+
+int ScanToken(){
+ uchar *cursor = ScanCB.cur;
+ unsigned sel;
+ uchar ch;
+ ScanCB.tok = cursor;
+ ScanCB.eot = NULL;
+#line 63 "rexx.re"
+
+
+scan:
+
+#line 29 "<stdout>"
+{
+ YYCTYPE yych;
+ unsigned int yyaccept = 0;
+
+ if ((YYLIMIT - YYCURSOR) < 13) YYFILL(13);
+ yych = *YYCURSOR;
+ switch (yych) {
+ case 0x00: goto yy63;
+ case '\n': goto yy3;
+ case '!':
+ case '?':
+ case 'G':
+ case 'J':
+ case 'K':
+ case 'M':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'g':
+ case 'j':
+ case 'k':
+ case 'm':
+ case 'x':
+ case 'y':
+ case 'z': goto yy59;
+ case '"': goto yy62;
+ case '%': goto yy15;
+ case '&': goto yy25;
+ case '\'': goto yy60;
+ case '(': goto yy31;
+ case ')': goto yy33;
+ case '*': goto yy11;
+ case '+': goto yy7;
+ case ',': goto yy29;
+ case '-': goto yy9;
+ case '.':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy57;
+ case '/': goto yy13;
+ case ':': goto yy27;
+ case ';': goto yy35;
+ case '<': goto yy21;
+ case '=': goto yy17;
+ case '>': goto yy23;
+ case 'A':
+ case 'a': goto yy37;
+ case 'B':
+ case 'b': goto yy52;
+ case 'C':
+ case 'c': goto yy39;
+ case 'D':
+ case 'd': goto yy40;
+ case 'E':
+ case 'e': goto yy41;
+ case 'F':
+ case 'f': goto yy53;
+ case 'H':
+ case 'h': goto yy54;
+ case 'I':
+ case 'i': goto yy42;
+ case 'L':
+ case 'l': goto yy43;
+ case 'N':
+ case 'n': goto yy44;
+ case 'O':
+ case 'o': goto yy45;
+ case 'P':
+ case 'p': goto yy46;
+ case 'Q':
+ case 'q': goto yy47;
+ case 'R':
+ case 'r': goto yy48;
+ case 'S':
+ case 's': goto yy49;
+ case 'T':
+ case 't': goto yy50;
+ case 'U':
+ case 'u': goto yy55;
+ case 'V':
+ case 'v': goto yy56;
+ case 'W':
+ case 'w': goto yy51;
+ case '\\':
+ case '~': goto yy19;
+ case '|': goto yy5;
+ default: goto yy65;
+ }
+yy2:
+#line 253 "rexx.re"
+ { RETURN(SU_SYMBOL_COMPOUND); }
+#line 129 "<stdout>"
+yy3:
+ ++YYCURSOR;
+#line 68 "rexx.re"
+ {
+ ++(ScanCB.lineNum);
+ ScanCB.linePos = ScanCB.pos + (cursor - ScanCB.mrk);
+ RETURN(SU_EOL);
+ }
+#line 138 "<stdout>"
+yy5:
+ yyaccept = 0;
+ yych = *(YYMARKER = ++YYCURSOR);
+ switch (yych) {
+ case '\t':
+ case ' ': goto yy423;
+ case '|': goto yy425;
+ default: goto yy6;
+ }
+yy6:
+#line 116 "rexx.re"
+ { RETURN(OP_OR); }
+#line 151 "<stdout>"
+yy7:
+ ++YYCURSOR;
+#line 76 "rexx.re"
+ { RETURN(OP_PLUS); }
+#line 156 "<stdout>"
+yy9:
+ ++YYCURSOR;
+#line 78 "rexx.re"
+ { RETURN(OP_MINUS); }
+#line 161 "<stdout>"
+yy11:
+ yyaccept = 1;
+ yych = *(YYMARKER = ++YYCURSOR);
+ switch (yych) {
+ case '\t':
+ case ' ': goto yy419;
+ case '*': goto yy421;
+ default: goto yy12;
+ }
+yy12:
+#line 80 "rexx.re"
+ { RETURN(OP_MULT); }
+#line 174 "<stdout>"
+yy13:
+ yyaccept = 2;
+ yych = *(YYMARKER = ++YYCURSOR);
+ switch (yych) {
+ case '\t':
+ case ' ': goto yy415;
+ case '/': goto yy417;
+ default: goto yy14;
+ }
+yy14:
+#line 82 "rexx.re"
+ { RETURN(OP_DIV); }
+#line 187 "<stdout>"
+yy15:
+ ++YYCURSOR;
+#line 84 "rexx.re"
+ { RETURN(OP_IDIV); }
+#line 192 "<stdout>"
+yy17:
+ yyaccept = 3;
+ yych = *(YYMARKER = ++YYCURSOR);
+ switch (yych) {
+ case '\t':
+ case ' ': goto yy411;
+ case '=': goto yy413;
+ default: goto yy18;
+ }
+yy18:
+#line 90 "rexx.re"
+ { RETURN(OP_EQUAL); }
+#line 205 "<stdout>"
+yy19:
+ yyaccept = 4;
+ yych = *(YYMARKER = ++YYCURSOR);
+ switch (yych) {
+ case '\t':
+ case ' ':
+ case '<':
+ case '=':
+ case '>': goto yy399;
+ default: goto yy20;
+ }
+yy20:
+#line 120 "rexx.re"
+ { RETURN(OP_NOT); }
+#line 220 "<stdout>"
+yy21:
+ yyaccept = 5;
+ yych = *(YYMARKER = ++YYCURSOR);
+ switch (yych) {
+ case '\t':
+ case ' ':
+ case '<':
+ case '=':
+ case '>': goto yy389;
+ default: goto yy22;
+ }
+yy22:
+#line 96 "rexx.re"
+ { RETURN(OP_LT); }
+#line 235 "<stdout>"
+yy23:
+ yyaccept = 6;
+ yych = *(YYMARKER = ++YYCURSOR);
+ switch (yych) {
+ case '\t':
+ case ' ':
+ case '<':
+ case '=':
+ case '>': goto yy377;
+ default: goto yy24;
+ }
+yy24:
+#line 94 "rexx.re"
+ { RETURN(OP_GT); }
+#line 250 "<stdout>"
+yy25:
+ yyaccept = 7;
+ yych = *(YYMARKER = ++YYCURSOR);
+ switch (yych) {
+ case '\t':
+ case ' ': goto yy372;
+ case '&': goto yy374;
+ default: goto yy26;
+ }
+yy26:
+#line 114 "rexx.re"
+ { RETURN(OP_AND); }
+#line 263 "<stdout>"
+yy27:
+ ++YYCURSOR;
+#line 123 "rexx.re"
+ { RETURN(SU_COLON); }
+#line 268 "<stdout>"
+yy29:
+ ++YYCURSOR;
+#line 125 "rexx.re"
+ { RETURN(SU_COMMA); }
+#line 273 "<stdout>"
+yy31:
+ ++YYCURSOR;
+#line 127 "rexx.re"
+ { RETURN(SU_POPEN); }
+#line 278 "<stdout>"
+yy33:
+ ++YYCURSOR;
+#line 129 "rexx.re"
+ { RETURN(SU_PCLOSE); }
+#line 283 "<stdout>"
+yy35:
+ ++YYCURSOR;
+#line 131 "rexx.re"
+ { RETURN(SU_EOC); }
+#line 288 "<stdout>"
+yy37:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case 'D':
+ case 'd': goto yy362;
+ case 'R':
+ case 'r': goto yy363;
+ default: goto yy81;
+ }
+yy38:
+#line 249 "rexx.re"
+ { RETURN(SU_SYMBOL); }
+#line 301 "<stdout>"
+yy39:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'A':
+ case 'a': goto yy358;
+ default: goto yy81;
+ }
+yy40:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'I':
+ case 'i': goto yy346;
+ case 'O':
+ case 'o': goto yy347;
+ case 'R':
+ case 'r': goto yy349;
+ default: goto yy81;
+ }
+yy41:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'L':
+ case 'l': goto yy315;
+ case 'N':
+ case 'n': goto yy316;
+ case 'R':
+ case 'r': goto yy317;
+ case 'X':
+ case 'x': goto yy318;
+ default: goto yy81;
+ }
+yy42:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'F':
+ case 'f': goto yy297;
+ case 'N':
+ case 'n': goto yy299;
+ case 'T':
+ case 't': goto yy300;
+ default: goto yy81;
+ }
+yy43:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'E':
+ case 'e': goto yy286;
+ case 'I':
+ case 'i': goto yy287;
+ default: goto yy81;
+ }
+yy44:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'A':
+ case 'a': goto yy259;
+ case 'O':
+ case 'o': goto yy260;
+ case 'U':
+ case 'u': goto yy261;
+ default: goto yy81;
+ }
+yy45:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'F':
+ case 'f': goto yy238;
+ case 'N':
+ case 'n': goto yy239;
+ case 'P':
+ case 'p': goto yy241;
+ case 'T':
+ case 't': goto yy242;
+ default: goto yy81;
+ }
+yy46:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'A':
+ case 'a': goto yy217;
+ case 'R':
+ case 'r': goto yy218;
+ case 'U':
+ case 'u': goto yy219;
+ default: goto yy81;
+ }
+yy47:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'U':
+ case 'u': goto yy212;
+ default: goto yy81;
+ }
+yy48:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'E':
+ case 'e': goto yy206;
+ default: goto yy81;
+ }
+yy49:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'A':
+ case 'a': goto yy169;
+ case 'C':
+ case 'c': goto yy170;
+ case 'E':
+ case 'e': goto yy171;
+ case 'I':
+ case 'i': goto yy172;
+ case 'O':
+ case 'o': goto yy173;
+ case 'Y':
+ case 'y': goto yy174;
+ default: goto yy81;
+ }
+yy50:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'H':
+ case 'h': goto yy158;
+ case 'O':
+ case 'o': goto yy159;
+ case 'R':
+ case 'r': goto yy161;
+ default: goto yy81;
+ }
+yy51:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'H':
+ case 'h': goto yy146;
+ case 'I':
+ case 'i': goto yy147;
+ default: goto yy81;
+ }
+yy52:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'Y':
+ case 'y': goto yy144;
+ default: goto yy81;
+ }
+yy53:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'A':
+ case 'a': goto yy123;
+ case 'O':
+ case 'o': goto yy124;
+ case 'U':
+ case 'u': goto yy125;
+ default: goto yy81;
+ }
+yy54:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'A':
+ case 'a': goto yy119;
+ default: goto yy81;
+ }
+yy55:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'N':
+ case 'n': goto yy109;
+ case 'P':
+ case 'p': goto yy110;
+ default: goto yy81;
+ }
+yy56:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'A':
+ case 'a': goto yy95;
+ case 'E':
+ case 'e': goto yy96;
+ default: goto yy81;
+ }
+yy57:
+ ++YYCURSOR;
+ yych = *YYCURSOR;
+ goto yy87;
+yy58:
+#line 247 "rexx.re"
+ { RETURN(SU_CONST); }
+#line 489 "<stdout>"
+yy59:
+ yych = *++YYCURSOR;
+ goto yy81;
+yy60:
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ switch (yych) {
+ case 0x00:
+ case '\n': goto yy61;
+ default: goto yy78;
+ }
+yy61:
+#line 264 "rexx.re"
+ { RETURN(SU_ERROR); }
+#line 504 "<stdout>"
+yy62:
+ yyaccept = 8;
+ yych = *(YYMARKER = ++YYCURSOR);
+ switch (yych) {
+ case 0x00:
+ case '\n': goto yy61;
+ default: goto yy67;
+ }
+yy63:
+ ++YYCURSOR;
+#line 262 "rexx.re"
+ { RETURN(SU_EOF); }
+#line 517 "<stdout>"
+yy65:
+ yych = *++YYCURSOR;
+ goto yy61;
+yy66:
+ ++YYCURSOR;
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy67:
+ switch (yych) {
+ case 0x00:
+ case '\n': goto yy68;
+ case '"': goto yy69;
+ default: goto yy66;
+ }
+yy68:
+ YYCURSOR = YYMARKER;
+ switch (yyaccept) {
+ case 0: goto yy6;
+ case 1: goto yy12;
+ case 2: goto yy14;
+ case 3: goto yy18;
+ case 4: goto yy20;
+ case 5: goto yy22;
+ case 6: goto yy24;
+ case 7: goto yy26;
+ case 8: goto yy61;
+ case 9: goto yy70;
+ case 10: goto yy58;
+ case 11: goto yy379;
+ case 12: goto yy391;
+ case 13: goto yy393;
+ case 14: goto yy381;
+ default: goto yy383;
+ }
+yy69:
+ yyaccept = 9;
+ YYMARKER = ++YYCURSOR;
+ if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+ yych = *YYCURSOR;
+ switch (yych) {
+ case '"': goto yy66;
+ case 'B':
+ case 'b': goto yy71;
+ case 'X':
+ case 'x': goto yy72;
+ default: goto yy70;
+ }
+yy70:
+#line 255 "rexx.re"
+ { RETURN(SU_LITERAL); }
+#line 568 "<stdout>"
+yy71:
+ YYCTXMARKER = YYCURSOR + 1;
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case '!':
+ case '.':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy68;
+ default: goto yy75;
+ }
+yy72:
+ YYCTXMARKER = YYCURSOR + 1;
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case '!':
+ case '.':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy68;
+ default: goto yy73;
+ }
+yy73:
+ ++YYCURSOR;
+ YYCURSOR = YYCTXMARKER;
+#line 259 "rexx.re"
+ { RETURN(SU_LITERAL_HEX); }
+#line 718 "<stdout>"
+yy75:
+ ++YYCURSOR;
+ YYCURSOR = YYCTXMARKER;
+#line 257 "rexx.re"
+ { RETURN(SU_LITERAL_BIN); }
+#line 724 "<stdout>"
+yy77:
+ ++YYCURSOR;
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy78:
+ switch (yych) {
+ case 0x00:
+ case '\n': goto yy68;
+ case '\'': goto yy79;
+ default: goto yy77;
+ }
+yy79:
+ yyaccept = 9;
+ YYMARKER = ++YYCURSOR;
+ if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+ yych = *YYCURSOR;
+ switch (yych) {
+ case '\'': goto yy77;
+ case 'B':
+ case 'b': goto yy71;
+ case 'X':
+ case 'x': goto yy72;
+ default: goto yy70;
+ }
+yy80:
+ ++YYCURSOR;
+ if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+ yych = *YYCURSOR;
+yy81:
+ switch (yych) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy38;
+ }
+yy82:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '.':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy84;
+ default: goto yy83;
+ }
+yy83:
+#line 251 "rexx.re"
+ { RETURN(SU_SYMBOL_STEM); }
+#line 897 "<stdout>"
+yy84:
+ ++YYCURSOR;
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ switch (yych) {
+ case '!':
+ case '.':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy84;
+ default: goto yy2;
+ }
+yy86:
+ ++YYCURSOR;
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy87:
+ switch (yych) {
+ case '!':
+ case '.':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy86;
+ case 'E':
+ case 'e': goto yy88;
+ default: goto yy58;
+ }
+yy88:
+ yyaccept = 10;
+ YYMARKER = ++YYCURSOR;
+ if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+ yych = *YYCURSOR;
+ switch (yych) {
+ case '!':
+ case '.':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy86;
+ case '+':
+ case '-': goto yy90;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy91;
+ case 'E':
+ case 'e': goto yy88;
+ default: goto yy58;
+ }
+yy90:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy93;
+ default: goto yy68;
+ }
+yy91:
+ ++YYCURSOR;
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ switch (yych) {
+ case '!':
+ case '.':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy86;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy91;
+ case 'E':
+ case 'e': goto yy88;
+ default: goto yy58;
+ }
+yy93:
+ ++YYCURSOR;
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ switch (yych) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy93;
+ default: goto yy58;
+ }
+yy95:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'L':
+ case 'l': goto yy103;
+ case 'R':
+ case 'r': goto yy104;
+ default: goto yy81;
+ }
+yy96:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'R':
+ case 'r': goto yy97;
+ default: goto yy81;
+ }
+yy97:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'S':
+ case 's': goto yy98;
+ default: goto yy81;
+ }
+yy98:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'I':
+ case 'i': goto yy99;
+ default: goto yy81;
+ }
+yy99:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'O':
+ case 'o': goto yy100;
+ default: goto yy81;
+ }
+yy100:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'N':
+ case 'n': goto yy101;
+ default: goto yy81;
+ }
+yy101:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy102;
+ }
+yy102:
+#line 240 "rexx.re"
+ { RETURN(RXS_VERSION); }
+#line 1344 "<stdout>"
+yy103:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'U':
+ case 'u': goto yy106;
+ default: goto yy81;
+ }
+yy104:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy105;
+ }
+yy105:
+#line 238 "rexx.re"
+ { RETURN(RXS_VAR); }
+#line 1426 "<stdout>"
+yy106:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'E':
+ case 'e': goto yy107;
+ default: goto yy81;
+ }
+yy107:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy108;
+ }
+yy108:
+#line 236 "rexx.re"
+ { RETURN(RXS_VALUE); }
+#line 1508 "<stdout>"
+yy109:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'T':
+ case 't': goto yy115;
+ default: goto yy81;
+ }
+yy110:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'P':
+ case 'p': goto yy111;
+ default: goto yy81;
+ }
+yy111:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'E':
+ case 'e': goto yy112;
+ default: goto yy81;
+ }
+yy112:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'R':
+ case 'r': goto yy113;
+ default: goto yy81;
+ }
+yy113:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy114;
+ }
+yy114:
+#line 234 "rexx.re"
+ { RETURN(RXS_UPPER); }
+#line 1611 "<stdout>"
+yy115:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'I':
+ case 'i': goto yy116;
+ default: goto yy81;
+ }
+yy116:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'L':
+ case 'l': goto yy117;
+ default: goto yy81;
+ }
+yy117:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy118;
+ }
+yy118:
+#line 232 "rexx.re"
+ { RETURN(RXS_UNTIL); }
+#line 1700 "<stdout>"
+yy119:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'L':
+ case 'l': goto yy120;
+ default: goto yy81;
+ }
+yy120:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'T':
+ case 't': goto yy121;
+ default: goto yy81;
+ }
+yy121:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy122;
+ }
+yy122:
+#line 214 "rexx.re"
+ { RETURN(RXS_HALT); }
+#line 1789 "<stdout>"
+yy123:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'I':
+ case 'i': goto yy138;
+ default: goto yy81;
+ }
+yy124:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'R':
+ case 'r': goto yy129;
+ default: goto yy81;
+ }
+yy125:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'Z':
+ case 'z': goto yy126;
+ default: goto yy81;
+ }
+yy126:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'Z':
+ case 'z': goto yy127;
+ default: goto yy81;
+ }
+yy127:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy128;
+ }
+yy128:
+#line 212 "rexx.re"
+ { RETURN(RXS_FUZZ); }
+#line 1892 "<stdout>"
+yy129:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ case 'E':
+ case 'e': goto yy131;
+ case 'M':
+ case 'm': goto yy132;
+ default: goto yy130;
+ }
+yy130:
+#line 206 "rexx.re"
+ { RETURN(RXS_FOR); }
+#line 1967 "<stdout>"
+yy131:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'V':
+ case 'v': goto yy134;
+ default: goto yy81;
+ }
+yy132:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy133;
+ }
+yy133:
+#line 210 "rexx.re"
+ { RETURN(RXS_FORM); }
+#line 2049 "<stdout>"
+yy134:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'E':
+ case 'e': goto yy135;
+ default: goto yy81;
+ }
+yy135:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'R':
+ case 'r': goto yy136;
+ default: goto yy81;
+ }
+yy136:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy137;
+ }
+yy137:
+#line 208 "rexx.re"
+ { RETURN(RXS_FOREVER); }
+#line 2138 "<stdout>"
+yy138:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'L':
+ case 'l': goto yy139;
+ default: goto yy81;
+ }
+yy139:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'U':
+ case 'u': goto yy140;
+ default: goto yy81;
+ }
+yy140:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'R':
+ case 'r': goto yy141;
+ default: goto yy81;
+ }
+yy141:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'E':
+ case 'e': goto yy142;
+ default: goto yy81;
+ }
+yy142:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy143;
+ }
+yy143:
+#line 204 "rexx.re"
+ { RETURN(RXS_FAILURE); }
+#line 2241 "<stdout>"
+yy144:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy145;
+ }
+yy145:
+#line 194 "rexx.re"
+ { RETURN(RXS_BY); }
+#line 2316 "<stdout>"
+yy146:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'E':
+ case 'e': goto yy151;
+ case 'I':
+ case 'i': goto yy152;
+ default: goto yy81;
+ }
+yy147:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'T':
+ case 't': goto yy148;
+ default: goto yy81;
+ }
+yy148:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'H':
+ case 'h': goto yy149;
+ default: goto yy81;
+ }
+yy149:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy150;
+ }
+yy150:
+#line 244 "rexx.re"
+ { RETURN(RXS_WITH); }
+#line 2414 "<stdout>"
+yy151:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'N':
+ case 'n': goto yy156;
+ default: goto yy81;
+ }
+yy152:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'L':
+ case 'l': goto yy153;
+ default: goto yy81;
+ }
+yy153:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'E':
+ case 'e': goto yy154;
+ default: goto yy81;
+ }
+yy154:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy155;
+ }
+yy155:
+#line 242 "rexx.re"
+ { RETURN(RXS_WHILE); }
+#line 2510 "<stdout>"
+yy156:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy157;
+ }
+yy157:
+#line 188 "rexx.re"
+ { RETURN(RX_WHEN); }
+#line 2585 "<stdout>"
+yy158:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'E':
+ case 'e': goto yy166;
+ default: goto yy81;
+ }
+yy159:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy160;
+ }
+yy160:
+#line 230 "rexx.re"
+ { RETURN(RXS_TO); }
+#line 2667 "<stdout>"
+yy161:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'A':
+ case 'a': goto yy162;
+ default: goto yy81;
+ }
+yy162:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'C':
+ case 'c': goto yy163;
+ default: goto yy81;
+ }
+yy163:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'E':
+ case 'e': goto yy164;
+ default: goto yy81;
+ }
+yy164:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy165;
+ }
+yy165:
+#line 186 "rexx.re"
+ { RETURN(RX_TRACE); }
+#line 2763 "<stdout>"
+yy166:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'N':
+ case 'n': goto yy167;
+ default: goto yy81;
+ }
+yy167:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy168;
+ }
+yy168:
+#line 184 "rexx.re"
+ { RETURN(RX_THEN); }
+#line 2845 "<stdout>"
+yy169:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'Y':
+ case 'y': goto yy204;
+ default: goto yy81;
+ }
+yy170:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'I':
+ case 'i': goto yy195;
+ default: goto yy81;
+ }
+yy171:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'L':
+ case 'l': goto yy190;
+ default: goto yy81;
+ }
+yy172:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'G':
+ case 'g': goto yy185;
+ default: goto yy81;
+ }
+yy173:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'U':
+ case 'u': goto yy180;
+ default: goto yy81;
+ }
+yy174:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'N':
+ case 'n': goto yy175;
+ default: goto yy81;
+ }
+yy175:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'T':
+ case 't': goto yy176;
+ default: goto yy81;
+ }
+yy176:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'A':
+ case 'a': goto yy177;
+ default: goto yy81;
+ }
+yy177:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'X':
+ case 'x': goto yy178;
+ default: goto yy81;
+ }
+yy178:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy179;
+ }
+yy179:
+#line 228 "rexx.re"
+ { RETURN(RXS_SYNTAX); }
+#line 2983 "<stdout>"
+yy180:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'R':
+ case 'r': goto yy181;
+ default: goto yy81;
+ }
+yy181:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'C':
+ case 'c': goto yy182;
+ default: goto yy81;
+ }
+yy182:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'E':
+ case 'e': goto yy183;
+ default: goto yy81;
+ }
+yy183:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy184;
+ }
+yy184:
+#line 226 "rexx.re"
+ { RETURN(RXS_SOURCE); }
+#line 3079 "<stdout>"
+yy185:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'N':
+ case 'n': goto yy186;
+ default: goto yy81;
+ }
+yy186:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'A':
+ case 'a': goto yy187;
+ default: goto yy81;
+ }
+yy187:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'L':
+ case 'l': goto yy188;
+ default: goto yy81;
+ }
+yy188:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy189;
+ }
+yy189:
+#line 182 "rexx.re"
+ { RETURN(RX_SIGNAL); }
+#line 3175 "<stdout>"
+yy190:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'E':
+ case 'e': goto yy191;
+ default: goto yy81;
+ }
+yy191:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'C':
+ case 'c': goto yy192;
+ default: goto yy81;
+ }
+yy192:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'T':
+ case 't': goto yy193;
+ default: goto yy81;
+ }
+yy193:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy194;
+ }
+yy194:
+#line 180 "rexx.re"
+ { RETURN(RX_SELECT); }
+#line 3271 "<stdout>"
+yy195:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'E':
+ case 'e': goto yy196;
+ default: goto yy81;
+ }
+yy196:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'N':
+ case 'n': goto yy197;
+ default: goto yy81;
+ }
+yy197:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'T':
+ case 't': goto yy198;
+ default: goto yy81;
+ }
+yy198:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'I':
+ case 'i': goto yy199;
+ default: goto yy81;
+ }
+yy199:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'F':
+ case 'f': goto yy200;
+ default: goto yy81;
+ }
+yy200:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'I':
+ case 'i': goto yy201;
+ default: goto yy81;
+ }
+yy201:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'C':
+ case 'c': goto yy202;
+ default: goto yy81;
+ }
+yy202:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy203;
+ }
+yy203:
+#line 224 "rexx.re"
+ { RETURN(RXS_SCIENTIFIC); }
+#line 3395 "<stdout>"
+yy204:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy205;
+ }
+yy205:
+#line 178 "rexx.re"
+ { RETURN(RX_SAY); }
+#line 3470 "<stdout>"
+yy206:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'T':
+ case 't': goto yy207;
+ default: goto yy81;
+ }
+yy207:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'U':
+ case 'u': goto yy208;
+ default: goto yy81;
+ }
+yy208:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'R':
+ case 'r': goto yy209;
+ default: goto yy81;
+ }
+yy209:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'N':
+ case 'n': goto yy210;
+ default: goto yy81;
+ }
+yy210:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy211;
+ }
+yy211:
+#line 176 "rexx.re"
+ { RETURN(RX_RETURN); }
+#line 3573 "<stdout>"
+yy212:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'E':
+ case 'e': goto yy213;
+ default: goto yy81;
+ }
+yy213:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'U':
+ case 'u': goto yy214;
+ default: goto yy81;
+ }
+yy214:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'E':
+ case 'e': goto yy215;
+ default: goto yy81;
+ }
+yy215:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy216;
+ }
+yy216:
+#line 174 "rexx.re"
+ { RETURN(RX_QUEUE); }
+#line 3669 "<stdout>"
+yy217:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'R':
+ case 'r': goto yy234;
+ default: goto yy81;
+ }
+yy218:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'O':
+ case 'o': goto yy226;
+ default: goto yy81;
+ }
+yy219:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'L':
+ case 'l': goto yy220;
+ case 'S':
+ case 's': goto yy221;
+ default: goto yy81;
+ }
+yy220:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'L':
+ case 'l': goto yy224;
+ default: goto yy81;
+ }
+yy221:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'H':
+ case 'h': goto yy222;
+ default: goto yy81;
+ }
+yy222:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy223;
+ }
+yy223:
+#line 172 "rexx.re"
+ { RETURN(RX_PUSH); }
+#line 3781 "<stdout>"
+yy224:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy225;
+ }
+yy225:
+#line 170 "rexx.re"
+ { RETURN(RX_PULL); }
+#line 3856 "<stdout>"
+yy226:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'C':
+ case 'c': goto yy227;
+ default: goto yy81;
+ }
+yy227:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'E':
+ case 'e': goto yy228;
+ default: goto yy81;
+ }
+yy228:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'D':
+ case 'd': goto yy229;
+ default: goto yy81;
+ }
+yy229:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'U':
+ case 'u': goto yy230;
+ default: goto yy81;
+ }
+yy230:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'R':
+ case 'r': goto yy231;
+ default: goto yy81;
+ }
+yy231:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'E':
+ case 'e': goto yy232;
+ default: goto yy81;
+ }
+yy232:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy233;
+ }
+yy233:
+#line 168 "rexx.re"
+ { RETURN(RX_PROCEDURE); }
+#line 3973 "<stdout>"
+yy234:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'S':
+ case 's': goto yy235;
+ default: goto yy81;
+ }
+yy235:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'E':
+ case 'e': goto yy236;
+ default: goto yy81;
+ }
+yy236:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy237;
+ }
+yy237:
+#line 166 "rexx.re"
+ { RETURN(RX_PARSE); }
+#line 4062 "<stdout>"
+yy238:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'F':
+ case 'f': goto yy257;
+ default: goto yy81;
+ }
+yy239:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy240;
+ }
+yy240:
+#line 192 "rexx.re"
+ { RETURN(RXS_ON); }
+#line 4144 "<stdout>"
+yy241:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'T':
+ case 't': goto yy251;
+ default: goto yy81;
+ }
+yy242:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'H':
+ case 'h': goto yy243;
+ default: goto yy81;
+ }
+yy243:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'E':
+ case 'e': goto yy244;
+ default: goto yy81;
+ }
+yy244:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'R':
+ case 'r': goto yy245;
+ default: goto yy81;
+ }
+yy245:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'W':
+ case 'w': goto yy246;
+ default: goto yy81;
+ }
+yy246:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'I':
+ case 'i': goto yy247;
+ default: goto yy81;
+ }
+yy247:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'S':
+ case 's': goto yy248;
+ default: goto yy81;
+ }
+yy248:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'E':
+ case 'e': goto yy249;
+ default: goto yy81;
+ }
+yy249:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy250;
+ }
+yy250:
+#line 164 "rexx.re"
+ { RETURN(RX_OTHERWISE); }
+#line 4275 "<stdout>"
+yy251:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'I':
+ case 'i': goto yy252;
+ default: goto yy81;
+ }
+yy252:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'O':
+ case 'o': goto yy253;
+ default: goto yy81;
+ }
+yy253:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'N':
+ case 'n': goto yy254;
+ default: goto yy81;
+ }
+yy254:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'S':
+ case 's': goto yy255;
+ default: goto yy81;
+ }
+yy255:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy256;
+ }
+yy256:
+#line 162 "rexx.re"
+ { RETURN(RX_OPTIONS); }
+#line 4378 "<stdout>"
+yy257:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy258;
+ }
+yy258:
+#line 190 "rexx.re"
+ { RETURN(RXS_OFF); }
+#line 4453 "<stdout>"
+yy259:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'M':
+ case 'm': goto yy283;
+ default: goto yy81;
+ }
+yy260:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'P':
+ case 'p': goto yy268;
+ case 'T':
+ case 't': goto yy270;
+ case 'V':
+ case 'v': goto yy271;
+ default: goto yy81;
+ }
+yy261:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'M':
+ case 'm': goto yy262;
+ default: goto yy81;
+ }
+yy262:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'E':
+ case 'e': goto yy263;
+ default: goto yy81;
+ }
+yy263:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'R':
+ case 'r': goto yy264;
+ default: goto yy81;
+ }
+yy264:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'I':
+ case 'i': goto yy265;
+ default: goto yy81;
+ }
+yy265:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'C':
+ case 'c': goto yy266;
+ default: goto yy81;
+ }
+yy266:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy267;
+ }
+yy267:
+#line 160 "rexx.re"
+ { RETURN(RX_NUMERIC); }
+#line 4581 "<stdout>"
+yy268:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy269;
+ }
+yy269:
+#line 158 "rexx.re"
+ { RETURN(RX_NOP); }
+#line 4656 "<stdout>"
+yy270:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'R':
+ case 'r': goto yy277;
+ default: goto yy81;
+ }
+yy271:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'A':
+ case 'a': goto yy272;
+ default: goto yy81;
+ }
+yy272:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'L':
+ case 'l': goto yy273;
+ default: goto yy81;
+ }
+yy273:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'U':
+ case 'u': goto yy274;
+ default: goto yy81;
+ }
+yy274:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'E':
+ case 'e': goto yy275;
+ default: goto yy81;
+ }
+yy275:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy276;
+ }
+yy276:
+#line 222 "rexx.re"
+ { RETURN(RXS_NOVALUE); }
+#line 4766 "<stdout>"
+yy277:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'E':
+ case 'e': goto yy278;
+ default: goto yy81;
+ }
+yy278:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'A':
+ case 'a': goto yy279;
+ default: goto yy81;
+ }
+yy279:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'D':
+ case 'd': goto yy280;
+ default: goto yy81;
+ }
+yy280:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'Y':
+ case 'y': goto yy281;
+ default: goto yy81;
+ }
+yy281:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy282;
+ }
+yy282:
+#line 220 "rexx.re"
+ { RETURN(RXS_NOTREADY); }
+#line 4869 "<stdout>"
+yy283:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'E':
+ case 'e': goto yy284;
+ default: goto yy81;
+ }
+yy284:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy285;
+ }
+yy285:
+#line 218 "rexx.re"
+ { RETURN(RXS_NAME); }
+#line 4951 "<stdout>"
+yy286:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'A':
+ case 'a': goto yy293;
+ default: goto yy81;
+ }
+yy287:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'N':
+ case 'n': goto yy288;
+ default: goto yy81;
+ }
+yy288:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'E':
+ case 'e': goto yy289;
+ default: goto yy81;
+ }
+yy289:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'I':
+ case 'i': goto yy290;
+ default: goto yy81;
+ }
+yy290:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'N':
+ case 'n': goto yy291;
+ default: goto yy81;
+ }
+yy291:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy292;
+ }
+yy292:
+#line 216 "rexx.re"
+ { RETURN(RXS_LINEIN); }
+#line 5061 "<stdout>"
+yy293:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'V':
+ case 'v': goto yy294;
+ default: goto yy81;
+ }
+yy294:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'E':
+ case 'e': goto yy295;
+ default: goto yy81;
+ }
+yy295:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy296;
+ }
+yy296:
+#line 156 "rexx.re"
+ { RETURN(RX_LEAVE); }
+#line 5150 "<stdout>"
+yy297:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy298;
+ }
+yy298:
+#line 150 "rexx.re"
+ { RETURN(RX_IF); }
+#line 5225 "<stdout>"
+yy299:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'T':
+ case 't': goto yy307;
+ default: goto yy81;
+ }
+yy300:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'E':
+ case 'e': goto yy301;
+ default: goto yy81;
+ }
+yy301:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'R':
+ case 'r': goto yy302;
+ default: goto yy81;
+ }
+yy302:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'A':
+ case 'a': goto yy303;
+ default: goto yy81;
+ }
+yy303:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'T':
+ case 't': goto yy304;
+ default: goto yy81;
+ }
+yy304:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'E':
+ case 'e': goto yy305;
+ default: goto yy81;
+ }
+yy305:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy306;
+ }
+yy306:
+#line 154 "rexx.re"
+ { RETURN(RX_ITERATE); }
+#line 5342 "<stdout>"
+yy307:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'E':
+ case 'e': goto yy308;
+ default: goto yy81;
+ }
+yy308:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'R':
+ case 'r': goto yy309;
+ default: goto yy81;
+ }
+yy309:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'P':
+ case 'p': goto yy310;
+ default: goto yy81;
+ }
+yy310:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'R':
+ case 'r': goto yy311;
+ default: goto yy81;
+ }
+yy311:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'E':
+ case 'e': goto yy312;
+ default: goto yy81;
+ }
+yy312:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'T':
+ case 't': goto yy313;
+ default: goto yy81;
+ }
+yy313:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy314;
+ }
+yy314:
+#line 152 "rexx.re"
+ { RETURN(RX_INTERPRET); }
+#line 5459 "<stdout>"
+yy315:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'S':
+ case 's': goto yy343;
+ default: goto yy81;
+ }
+yy316:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'D':
+ case 'd': goto yy331;
+ case 'G':
+ case 'g': goto yy333;
+ default: goto yy81;
+ }
+yy317:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'R':
+ case 'r': goto yy327;
+ default: goto yy81;
+ }
+yy318:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'I':
+ case 'i': goto yy319;
+ case 'P':
+ case 'p': goto yy320;
+ default: goto yy81;
+ }
+yy319:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'T':
+ case 't': goto yy325;
+ default: goto yy81;
+ }
+yy320:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'O':
+ case 'o': goto yy321;
+ default: goto yy81;
+ }
+yy321:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'S':
+ case 's': goto yy322;
+ default: goto yy81;
+ }
+yy322:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'E':
+ case 'e': goto yy323;
+ default: goto yy81;
+ }
+yy323:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy324;
+ }
+yy324:
+#line 202 "rexx.re"
+ { RETURN(RXS_EXPOSE); }
+#line 5594 "<stdout>"
+yy325:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy326;
+ }
+yy326:
+#line 148 "rexx.re"
+ { RETURN(RX_EXIT); }
+#line 5669 "<stdout>"
+yy327:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'O':
+ case 'o': goto yy328;
+ default: goto yy81;
+ }
+yy328:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'R':
+ case 'r': goto yy329;
+ default: goto yy81;
+ }
+yy329:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy330;
+ }
+yy330:
+#line 200 "rexx.re"
+ { RETURN(RXS_ERROR); }
+#line 5758 "<stdout>"
+yy331:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy332;
+ }
+yy332:
+#line 146 "rexx.re"
+ { RETURN(RX_END); }
+#line 5833 "<stdout>"
+yy333:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'I':
+ case 'i': goto yy334;
+ default: goto yy81;
+ }
+yy334:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'N':
+ case 'n': goto yy335;
+ default: goto yy81;
+ }
+yy335:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'E':
+ case 'e': goto yy336;
+ default: goto yy81;
+ }
+yy336:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'E':
+ case 'e': goto yy337;
+ default: goto yy81;
+ }
+yy337:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'R':
+ case 'r': goto yy338;
+ default: goto yy81;
+ }
+yy338:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'I':
+ case 'i': goto yy339;
+ default: goto yy81;
+ }
+yy339:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'N':
+ case 'n': goto yy340;
+ default: goto yy81;
+ }
+yy340:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'G':
+ case 'g': goto yy341;
+ default: goto yy81;
+ }
+yy341:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy342;
+ }
+yy342:
+#line 198 "rexx.re"
+ { RETURN(RXS_ENGINEERING); }
+#line 5964 "<stdout>"
+yy343:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'E':
+ case 'e': goto yy344;
+ default: goto yy81;
+ }
+yy344:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy345;
+ }
+yy345:
+#line 144 "rexx.re"
+ { RETURN(RX_ELSE); }
+#line 6046 "<stdout>"
+yy346:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'G':
+ case 'g': goto yy353;
+ default: goto yy81;
+ }
+yy347:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy348;
+ }
+yy348:
+#line 140 "rexx.re"
+ { RETURN(RX_DO); }
+#line 6128 "<stdout>"
+yy349:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'O':
+ case 'o': goto yy350;
+ default: goto yy81;
+ }
+yy350:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'P':
+ case 'p': goto yy351;
+ default: goto yy81;
+ }
+yy351:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy352;
+ }
+yy352:
+#line 142 "rexx.re"
+ { RETURN(RX_DROP); }
+#line 6217 "<stdout>"
+yy353:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'I':
+ case 'i': goto yy354;
+ default: goto yy81;
+ }
+yy354:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'T':
+ case 't': goto yy355;
+ default: goto yy81;
+ }
+yy355:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'S':
+ case 's': goto yy356;
+ default: goto yy81;
+ }
+yy356:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy357;
+ }
+yy357:
+#line 196 "rexx.re"
+ { RETURN(RXS_DIGITS); }
+#line 6313 "<stdout>"
+yy358:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'L':
+ case 'l': goto yy359;
+ default: goto yy81;
+ }
+yy359:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'L':
+ case 'l': goto yy360;
+ default: goto yy81;
+ }
+yy360:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy361;
+ }
+yy361:
+#line 138 "rexx.re"
+ { RETURN(RX_CALL); }
+#line 6402 "<stdout>"
+yy362:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'D':
+ case 'd': goto yy366;
+ default: goto yy81;
+ }
+yy363:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'G':
+ case 'g': goto yy364;
+ default: goto yy81;
+ }
+yy364:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy365;
+ }
+yy365:
+#line 136 "rexx.re"
+ { RETURN(RX_ARG); }
+#line 6491 "<stdout>"
+yy366:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'R':
+ case 'r': goto yy367;
+ default: goto yy81;
+ }
+yy367:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'E':
+ case 'e': goto yy368;
+ default: goto yy81;
+ }
+yy368:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'S':
+ case 's': goto yy369;
+ default: goto yy81;
+ }
+yy369:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case 'S':
+ case 's': goto yy370;
+ default: goto yy81;
+ }
+yy370:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '!':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case '?':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'G':
+ case 'H':
+ case 'I':
+ case 'J':
+ case 'K':
+ case 'L':
+ case 'M':
+ case 'N':
+ case 'O':
+ case 'P':
+ case 'Q':
+ case 'R':
+ case 'S':
+ case 'T':
+ case 'U':
+ case 'V':
+ case 'W':
+ case 'X':
+ case 'Y':
+ case 'Z':
+ case '_':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f':
+ case 'g':
+ case 'h':
+ case 'i':
+ case 'j':
+ case 'k':
+ case 'l':
+ case 'm':
+ case 'n':
+ case 'o':
+ case 'p':
+ case 'q':
+ case 'r':
+ case 's':
+ case 't':
+ case 'u':
+ case 'v':
+ case 'w':
+ case 'x':
+ case 'y':
+ case 'z': goto yy80;
+ case '.': goto yy82;
+ default: goto yy371;
+ }
+yy371:
+#line 134 "rexx.re"
+ { RETURN(RX_ADDRESS); }
+#line 6594 "<stdout>"
+yy372:
+ ++YYCURSOR;
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ switch (yych) {
+ case '\t':
+ case ' ': goto yy372;
+ case '&': goto yy374;
+ default: goto yy68;
+ }
+yy374:
+ ++YYCURSOR;
+#line 118 "rexx.re"
+ { RETURN(OP_XOR); }
+#line 6609 "<stdout>"
+yy376:
+ ++YYCURSOR;
+ if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+ yych = *YYCURSOR;
+yy377:
+ switch (yych) {
+ case '\t':
+ case ' ': goto yy376;
+ case '<': goto yy382;
+ case '=': goto yy380;
+ case '>': goto yy378;
+ default: goto yy68;
+ }
+yy378:
+ yyaccept = 11;
+ yych = *(YYMARKER = ++YYCURSOR);
+ switch (yych) {
+ case '\t':
+ case ' ': goto yy384;
+ case '=': goto yy386;
+ default: goto yy379;
+ }
+yy379:
+#line 106 "rexx.re"
+ { RETURN(OP_GT_STRICT); }
+#line 6635 "<stdout>"
+yy380:
+ ++YYCURSOR;
+yy381:
+#line 98 "rexx.re"
+ { RETURN(OP_GE); }
+#line 6641 "<stdout>"
+yy382:
+ ++YYCURSOR;
+yy383:
+#line 92 "rexx.re"
+ { RETURN(OP_EQUAL_N); }
+#line 6647 "<stdout>"
+yy384:
+ ++YYCURSOR;
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ switch (yych) {
+ case '\t':
+ case ' ': goto yy384;
+ case '=': goto yy386;
+ default: goto yy68;
+ }
+yy386:
+ ++YYCURSOR;
+#line 110 "rexx.re"
+ { RETURN(OP_GE_STRICT); }
+#line 6662 "<stdout>"
+yy388:
+ ++YYCURSOR;
+ if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+ yych = *YYCURSOR;
+yy389:
+ switch (yych) {
+ case '\t':
+ case ' ': goto yy388;
+ case '<': goto yy390;
+ case '=': goto yy392;
+ case '>': goto yy382;
+ default: goto yy68;
+ }
+yy390:
+ yyaccept = 12;
+ yych = *(YYMARKER = ++YYCURSOR);
+ switch (yych) {
+ case '\t':
+ case ' ': goto yy394;
+ case '=': goto yy396;
+ default: goto yy391;
+ }
+yy391:
+#line 108 "rexx.re"
+ { RETURN(OP_LT_STRICT); }
+#line 6688 "<stdout>"
+yy392:
+ ++YYCURSOR;
+yy393:
+#line 100 "rexx.re"
+ { RETURN(OP_LE); }
+#line 6694 "<stdout>"
+yy394:
+ ++YYCURSOR;
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ switch (yych) {
+ case '\t':
+ case ' ': goto yy394;
+ case '=': goto yy396;
+ default: goto yy68;
+ }
+yy396:
+ ++YYCURSOR;
+#line 112 "rexx.re"
+ { RETURN(OP_LE_STRICT); }
+#line 6709 "<stdout>"
+yy398:
+ ++YYCURSOR;
+ if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+ yych = *YYCURSOR;
+yy399:
+ switch (yych) {
+ case '\t':
+ case ' ': goto yy398;
+ case '<': goto yy401;
+ case '=': goto yy402;
+ case '>': goto yy400;
+ default: goto yy68;
+ }
+yy400:
+ yyaccept = 13;
+ yych = *(YYMARKER = ++YYCURSOR);
+ switch (yych) {
+ case '\t':
+ case ' ': goto yy409;
+ case '>': goto yy396;
+ default: goto yy393;
+ }
+yy401:
+ yyaccept = 14;
+ yych = *(YYMARKER = ++YYCURSOR);
+ switch (yych) {
+ case '\t':
+ case ' ': goto yy407;
+ case '<': goto yy386;
+ default: goto yy381;
+ }
+yy402:
+ yyaccept = 15;
+ yych = *(YYMARKER = ++YYCURSOR);
+ switch (yych) {
+ case '\t':
+ case ' ': goto yy403;
+ case '=': goto yy405;
+ default: goto yy383;
+ }
+yy403:
+ ++YYCURSOR;
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ switch (yych) {
+ case '\t':
+ case ' ': goto yy403;
+ case '=': goto yy405;
+ default: goto yy68;
+ }
+yy405:
+ ++YYCURSOR;
+#line 104 "rexx.re"
+ { RETURN(OP_EQUAL_EQ_N); }
+#line 6764 "<stdout>"
+yy407:
+ ++YYCURSOR;
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ switch (yych) {
+ case '\t':
+ case ' ': goto yy407;
+ case '<': goto yy386;
+ default: goto yy68;
+ }
+yy409:
+ ++YYCURSOR;
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ switch (yych) {
+ case '\t':
+ case ' ': goto yy409;
+ case '>': goto yy396;
+ default: goto yy68;
+ }
+yy411:
+ ++YYCURSOR;
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ switch (yych) {
+ case '\t':
+ case ' ': goto yy411;
+ case '=': goto yy413;
+ default: goto yy68;
+ }
+yy413:
+ ++YYCURSOR;
+#line 102 "rexx.re"
+ { RETURN(OP_EQUAL_EQ); }
+#line 6799 "<stdout>"
+yy415:
+ ++YYCURSOR;
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ switch (yych) {
+ case '\t':
+ case ' ': goto yy415;
+ case '/': goto yy417;
+ default: goto yy68;
+ }
+yy417:
+ ++YYCURSOR;
+#line 86 "rexx.re"
+ { RETURN(OP_REMAIN); }
+#line 6814 "<stdout>"
+yy419:
+ ++YYCURSOR;
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ switch (yych) {
+ case '\t':
+ case ' ': goto yy419;
+ case '*': goto yy421;
+ default: goto yy68;
+ }
+yy421:
+ ++YYCURSOR;
+#line 88 "rexx.re"
+ { RETURN(OP_POWER); }
+#line 6829 "<stdout>"
+yy423:
+ ++YYCURSOR;
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ switch (yych) {
+ case '\t':
+ case ' ': goto yy423;
+ case '|': goto yy425;
+ default: goto yy68;
+ }
+yy425:
+ ++YYCURSOR;
+#line 74 "rexx.re"
+ { RETURN(OP_CONCAT); }
+#line 6844 "<stdout>"
+}
+#line 265 "rexx.re"
+
+}
+
+bool StripToken(){
+ uchar *cursor = ScanCB.cur;
+ unsigned depth;
+ uchar ch;
+ bool blanks = FALSE;
+ ScanCB.eot = cursor;
+strip:
+
+#line 6858 "<stdout>"
+{
+ YYCTYPE yych;
+ YYCTXMARKER = YYCURSOR + 1;
+ if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+ yych = *YYCURSOR;
+ switch (yych) {
+ case '\t':
+ case ' ': goto yy433;
+ case '\r': goto yy431;
+ case '/': goto yy429;
+ default: goto yy435;
+ }
+yy429:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '*': goto yy436;
+ default: goto yy430;
+ }
+yy430:
+ YYCURSOR = YYCTXMARKER;
+#line 289 "rexx.re"
+ { RETURN(blanks); }
+#line 6881 "<stdout>"
+yy431:
+ ++YYCURSOR;
+#line 282 "rexx.re"
+ { goto strip; }
+#line 6886 "<stdout>"
+yy433:
+ ++YYCURSOR;
+#line 284 "rexx.re"
+ {
+ blanks = TRUE;
+ goto strip;
+ }
+#line 6894 "<stdout>"
+yy435:
+ yych = *++YYCURSOR;
+ goto yy430;
+yy436:
+ ++YYCURSOR;
+#line 277 "rexx.re"
+ {
+ depth = 1;
+ goto comment;
+ }
+#line 6905 "<stdout>"
+}
+#line 290 "rexx.re"
+
+
+comment:
+
+#line 6912 "<stdout>"
+{
+ YYCTYPE yych;
+ if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+ yych = *YYCURSOR;
+ switch (yych) {
+ case 0x00: goto yy445;
+ case '\n': goto yy442;
+ case '*': goto yy440;
+ case '/': goto yy444;
+ default: goto yy447;
+ }
+yy440:
+ ++YYCURSOR;
+ switch ((yych = *YYCURSOR)) {
+ case '/': goto yy450;
+ default: goto yy441;
+ }
+yy441:
+#line 315 "rexx.re"
+ {
+ goto comment;
+ }
+#line 6935 "<stdout>"
+yy442:
+ ++YYCURSOR;
+#line 302 "rexx.re"
+ {
+ ++(ScanCB.lineNum);
+ ScanCB.linePos = ScanCB.pos + (cursor - ScanCB.mrk);
+ goto comment;
+ }
+#line 6944 "<stdout>"
+yy444:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case '*': goto yy448;
+ default: goto yy441;
+ }
+yy445:
+ ++YYCURSOR;
+#line 313 "rexx.re"
+ { RETURN(blanks); }
+#line 6955 "<stdout>"
+yy447:
+ yych = *++YYCURSOR;
+ goto yy441;
+yy448:
+ ++YYCURSOR;
+#line 308 "rexx.re"
+ {
+ ++depth;
+ goto comment;
+ }
+#line 6966 "<stdout>"
+yy450:
+ ++YYCURSOR;
+#line 295 "rexx.re"
+ {
+ if(--depth == 0)
+ goto strip;
+ else
+ goto comment;
+ }
+#line 6976 "<stdout>"
+}
+#line 318 "rexx.re"
+
+}
--- /dev/null
+#include "scanio.h"
+#include "scanner.h"
+
+#define CURSOR ch
+#define LOADCURSOR ch = *cursor;
+#define ADVANCE cursor++;
+#define BACK(n) cursor -= (n);
+#define CHECK(n) if((ScanCB.lim - cursor) < (n)){cursor = ScanFill(cursor);}
+#define MARK(n) ScanCB.ptr = cursor; sel = (n);
+#define REVERT cursor = ScanCB.ptr;
+#define MARKER sel
+
+#define RETURN(i) {ScanCB.cur = cursor; return i;}
+
+int ScanToken(){
+ uchar *cursor = ScanCB.cur;
+ unsigned sel;
+ uchar ch;
+ ScanCB.tok = cursor;
+ ScanCB.eot = NULL;
+/*!re2c
+all = [\000-\377];
+eof = [\000];
+any = all\eof;
+letter = [a-z]|[A-Z];
+digit = [0-9];
+symchr = letter|digit|[.!?_];
+const = (digit|[.])symchr*([eE][+-]?digit+)?;
+simple = (symchr\(digit|[.]))(symchr\[.])*;
+stem = simple [.];
+symbol = symchr*;
+sqstr = ['] ((any\['\n])|(['][']))* ['];
+dqstr = ["] ((any\["\n])|(["]["]))* ["];
+str = sqstr|dqstr;
+ob = [ \t]*;
+not = [\\~];
+A = [aA];
+B = [bB];
+C = [cC];
+D = [dD];
+E = [eE];
+F = [fF];
+G = [gG];
+H = [hH];
+I = [iI];
+J = [jJ];
+K = [kK];
+L = [lL];
+M = [mM];
+N = [nN];
+O = [oO];
+P = [pP];
+Q = [qQ];
+R = [rR];
+S = [sS];
+T = [tT];
+U = [uU];
+V = [vV];
+W = [wW];
+X = [xX];
+Y = [yY];
+Z = [zZ];
+*/
+
+scan:
+/*!re2c
+"\n"
+ {
+ ++(ScanCB.lineNum);
+ ScanCB.linePos = ScanCB.pos + (cursor - ScanCB.mrk);
+ RETURN(SU_EOL);
+ }
+"|" ob "|"
+ { RETURN(OP_CONCAT); }
+"+"
+ { RETURN(OP_PLUS); }
+"-"
+ { RETURN(OP_MINUS); }
+"*"
+ { RETURN(OP_MULT); }
+"/"
+ { RETURN(OP_DIV); }
+"%"
+ { RETURN(OP_IDIV); }
+"/" ob "/"
+ { RETURN(OP_REMAIN); }
+"*" ob "*"
+ { RETURN(OP_POWER); }
+"="
+ { RETURN(OP_EQUAL); }
+not ob "=" | "<" ob ">" | ">" ob "<"
+ { RETURN(OP_EQUAL_N); }
+">"
+ { RETURN(OP_GT); }
+"<"
+ { RETURN(OP_LT); }
+">" ob "=" | not ob "<"
+ { RETURN(OP_GE); }
+"<" ob "=" | not ob ">"
+ { RETURN(OP_LE); }
+"=" ob "="
+ { RETURN(OP_EQUAL_EQ); }
+not ob "=" ob "="
+ { RETURN(OP_EQUAL_EQ_N); }
+">" ob ">"
+ { RETURN(OP_GT_STRICT); }
+"<" ob "<"
+ { RETURN(OP_LT_STRICT); }
+">" ob ">" ob "=" | not ob "<" ob "<"
+ { RETURN(OP_GE_STRICT); }
+"<" ob "<" ob "=" | not ob ">" ob ">"
+ { RETURN(OP_LE_STRICT); }
+"&"
+ { RETURN(OP_AND); }
+"|"
+ { RETURN(OP_OR); }
+"&" ob "&"
+ { RETURN(OP_XOR); }
+not
+ { RETURN(OP_NOT); }
+
+":"
+ { RETURN(SU_COLON); }
+","
+ { RETURN(SU_COMMA); }
+"("
+ { RETURN(SU_POPEN); }
+")"
+ { RETURN(SU_PCLOSE); }
+";"
+ { RETURN(SU_EOC); }
+
+A D D R E S S
+ { RETURN(RX_ADDRESS); }
+A R G
+ { RETURN(RX_ARG); }
+C A L L
+ { RETURN(RX_CALL); }
+D O
+ { RETURN(RX_DO); }
+D R O P
+ { RETURN(RX_DROP); }
+E L S E
+ { RETURN(RX_ELSE); }
+E N D
+ { RETURN(RX_END); }
+E X I T
+ { RETURN(RX_EXIT); }
+I F
+ { RETURN(RX_IF); }
+I N T E R P R E T
+ { RETURN(RX_INTERPRET); }
+I T E R A T E
+ { RETURN(RX_ITERATE); }
+L E A V E
+ { RETURN(RX_LEAVE); }
+N O P
+ { RETURN(RX_NOP); }
+N U M E R I C
+ { RETURN(RX_NUMERIC); }
+O P T I O N S
+ { RETURN(RX_OPTIONS); }
+O T H E R W I S E
+ { RETURN(RX_OTHERWISE); }
+P A R S E
+ { RETURN(RX_PARSE); }
+P R O C E D U R E
+ { RETURN(RX_PROCEDURE); }
+P U L L
+ { RETURN(RX_PULL); }
+P U S H
+ { RETURN(RX_PUSH); }
+Q U E U E
+ { RETURN(RX_QUEUE); }
+R E T U R N
+ { RETURN(RX_RETURN); }
+S A Y
+ { RETURN(RX_SAY); }
+S E L E C T
+ { RETURN(RX_SELECT); }
+S I G N A L
+ { RETURN(RX_SIGNAL); }
+T H E N
+ { RETURN(RX_THEN); }
+T R A C E
+ { RETURN(RX_TRACE); }
+W H E N
+ { RETURN(RX_WHEN); }
+O F F
+ { RETURN(RXS_OFF); }
+O N
+ { RETURN(RXS_ON); }
+B Y
+ { RETURN(RXS_BY); }
+D I G I T S
+ { RETURN(RXS_DIGITS); }
+E N G I N E E R I N G
+ { RETURN(RXS_ENGINEERING); }
+E R R O R
+ { RETURN(RXS_ERROR); }
+E X P O S E
+ { RETURN(RXS_EXPOSE); }
+F A I L U R E
+ { RETURN(RXS_FAILURE); }
+F O R
+ { RETURN(RXS_FOR); }
+F O R E V E R
+ { RETURN(RXS_FOREVER); }
+F O R M
+ { RETURN(RXS_FORM); }
+F U Z Z
+ { RETURN(RXS_FUZZ); }
+H A L T
+ { RETURN(RXS_HALT); }
+L I N E I N
+ { RETURN(RXS_LINEIN); }
+N A M E
+ { RETURN(RXS_NAME); }
+N O T R E A D Y
+ { RETURN(RXS_NOTREADY); }
+N O V A L U E
+ { RETURN(RXS_NOVALUE); }
+S C I E N T I F I C
+ { RETURN(RXS_SCIENTIFIC); }
+S O U R C E
+ { RETURN(RXS_SOURCE); }
+S Y N T A X
+ { RETURN(RXS_SYNTAX); }
+T O
+ { RETURN(RXS_TO); }
+U N T I L
+ { RETURN(RXS_UNTIL); }
+U P P E R
+ { RETURN(RXS_UPPER); }
+V A L U E
+ { RETURN(RXS_VALUE); }
+V A R
+ { RETURN(RXS_VAR); }
+V E R S I O N
+ { RETURN(RXS_VERSION); }
+W H I L E
+ { RETURN(RXS_WHILE); }
+W I T H
+ { RETURN(RXS_WITH); }
+
+const
+ { RETURN(SU_CONST); }
+simple
+ { RETURN(SU_SYMBOL); }
+stem
+ { RETURN(SU_SYMBOL_STEM); }
+symbol
+ { RETURN(SU_SYMBOL_COMPOUND); }
+str
+ { RETURN(SU_LITERAL); }
+str [bB] / (all\symchr)
+ { RETURN(SU_LITERAL_BIN); }
+str [xX] / (all\symchr)
+ { RETURN(SU_LITERAL_HEX); }
+
+eof
+ { RETURN(SU_EOF); }
+any
+ { RETURN(SU_ERROR); }
+*/
+}
+
+bool StripToken(){
+ uchar *cursor = ScanCB.cur;
+ unsigned depth;
+ uchar ch;
+ bool blanks = FALSE;
+ ScanCB.eot = cursor;
+strip:
+/*!re2c
+"/*"
+ {
+ depth = 1;
+ goto comment;
+ }
+"\r"
+ { goto strip; }
+[ \t]
+ {
+ blanks = TRUE;
+ goto strip;
+ }
+[] / all
+ { RETURN(blanks); }
+*/
+
+comment:
+/*!re2c
+"*/"
+ {
+ if(--depth == 0)
+ goto strip;
+ else
+ goto comment;
+ }
+"\n"
+ {
+ ++(ScanCB.lineNum);
+ ScanCB.linePos = ScanCB.pos + (cursor - ScanCB.mrk);
+ goto comment;
+ }
+"/*"
+ {
+ ++depth;
+ goto comment;
+ }
+eof
+ { RETURN(blanks); }
+any
+ {
+ goto comment;
+ }
+*/
+}
--- /dev/null
+/* re2c lesson 002_strip_comments, strip_001.s, (c) M. Boerger 2006 - 2007 */
+/*!ignore:re2c
+
+- basic interface for file reading
+ . This scanner will read chunks of input from a file. The easiest way would
+ be to read the whole file into a memory buffer and use that a zero
+ terminated string.
+ . Instead we want to read input chunks of a reasonable size as they are neede
+ by the scanner. Thus we basically need YYFILL(n) to call fread(n).
+ . Before we provide a buffer that we constantly reallocate we instead use
+ one buffer that we get from the stack or global memory just once. When we
+ reach the end of the buffer we simply move the beginning of our input
+ that is somewhere in our buffer to the beginning of our buffer and then
+ append the next chunk of input to the correct end inside our buffer.
+ . As re2c scanners might read more than one character we need to ensure our
+ buffer is long enough. We can use re2c to inform about the maximum size
+ by placing a "!max:re2c" comment somewhere. This gets translated to a
+ "#define YYMAXFILL <n>" line where <n> is the maximum length value. This
+ define can be used as precompiler condition.
+
+- multiple scanner blocks
+ . We use a main scanner block that outputs every input character unless the
+ input is two /s or a / followed by a *. In the latter two cases we switch
+ to a special c++ comment and a comment block respectively.
+ . Both special blocks simply detect their end ignore any other character.
+ . The c++ block is a bit special. Since the terminating new line needs to
+ be output and that can either be a new line or a carridge return followed
+ by a new line.
+ . In order to ensure that we do not read behind our buffer we reset the token
+ pointer to the cursor on every scanner run.
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+/*!max:re2c */
+#define BSIZE 128
+
+#if BSIZE < YYMAXFILL
+# error BSIZE must be greater YYMAXFILL
+#endif
+
+#define YYCTYPE unsigned char
+#define YYCURSOR s.cur
+#define YYLIMIT s.lim
+#define YYFILL(n) { if ((res = fill(&s, n)) >= 0) break; }
+
+typedef struct Scanner
+{
+ FILE *fp;
+ unsigned char *cur, *tok, *lim, *eof;
+ unsigned char buffer[BSIZE];
+} Scanner;
+
+int fill(Scanner *s, int len)
+{
+ if (!len)
+ {
+ s->cur = s->tok = s->lim = s->buffer;
+ s->eof = 0;
+ }
+ if (!s->eof)
+ {
+ int got, cnt = s->tok - s->buffer;
+
+ if (cnt > 0)
+ {
+ memcpy(s->buffer, s->tok, s->lim - s->tok);
+ s->tok -= cnt;
+ s->cur -= cnt;
+ s->lim -= cnt;
+ }
+ cnt = BSIZE - cnt;
+ if ((got = fread(s->lim, 1, cnt, s->fp)) != cnt)
+ {
+ s->eof = &s->lim[got];
+ }
+ s->lim += got;
+ }
+ else if (s->cur + len > s->eof)
+ {
+ return 0; /* not enough input data */
+ }
+ return -1;
+}
+
+int scan(FILE *fp)
+{
+ int res = 0;
+ Scanner s;
+
+ if (!fp)
+ {
+ return 1; /* no file was opened */
+ }
+
+ s.fp = fp;
+
+ fill(&s, 0);
+
+ for(;;)
+ {
+ s.tok = s.cur;
+/*!re2c
+ re2c:indent:top = 2;
+
+ NL = "\r"? "\n" ;
+ ANY = [^] ;
+
+ "/" "/" { goto cppcomment; }
+ "/" "*" { goto comment; }
+ ANY { fputc(*s.tok, stdout); continue; }
+*/
+comment:
+ s.tok = s.cur;
+/*!re2c
+ "*" "/" { continue; }
+ ANY { goto comment; }
+*/
+cppcomment:
+ s.tok = s.cur;
+/*!re2c
+ NL { fwrite(s.tok, 1, s.cur - s.tok, stdout); continue; }
+ ANY { goto cppcomment; }
+*/
+ }
+
+ if (fp != stdin)
+ {
+ fclose(fp); /* close only if not stdin */
+ }
+ return res; /* return result */
+}
+
+int main(int argc, char **argv)
+{
+ if (argc > 1)
+ {
+ return scan(!strcmp(argv[1], "-") ? stdin : fopen(argv[1], "r"));
+ }
+ else
+ {
+ fprintf(stderr, "%s <expr>\n", argv[0]);
+ return 1;
+ }
+}
--- /dev/null
+/* re2c lesson 002_strip_comments, strip_002.s, (c) M. Boerger 2006 - 2007 */
+/*!ignore:re2c
+
+- complexity
+ . When a comment is preceeded by a new line and followed by whitespace and a
+ new line then we can drop the trailing whitespace and new line.
+ . Additional to what we strip out already what about two consequtive comment
+ blocks? When two comments are only separated by whitespace we want to drop
+ both. In other words when detecting the end of a comment block we need to
+ check whether it is followed by only whitespace and the a new comment in
+ which case we continure ignoring the input. If it is followed only by white
+ space and a new line we strip out the new white space and new line. In any
+ other case we start outputting all that follows.
+ But we cannot simply use the following two rules:
+ "*" "/" WS* "/" "*" { continue; }
+ "*" "/" WS* NL { continue; }
+ The main problem is that WS* can get bigger then our buffer, so we need a
+ new scanner.
+ . Meanwhile our scanner gets a bit more complex and we have to add two more
+ things. First the scanner code now uses a YYMARKER to store backtracking
+ information.
+
+- backtracking information
+ . When the scanner has two rules that can have the same beginning but a
+ different ending then it needs to store the position that identifies the
+ common part. This is called backtracking. As mentioned above re2c expects
+ you to provide compiler define YYMARKER and a pointer variable.
+ . When shifting buffer contents as done in our fill function the marker needs
+ to be corrected, too.
+
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+/*!max:re2c */
+#define BSIZE 128
+
+#if BSIZE < YYMAXFILL
+# error BSIZE must be greater YYMAXFILL
+#endif
+
+#define YYCTYPE unsigned char
+#define YYCURSOR s.cur
+#define YYLIMIT s.lim
+#define YYMARKER s.mrk
+#define YYFILL(n) { if ((res = fill(&s, n)) >= 0) break; }
+
+typedef struct Scanner
+{
+ FILE *fp;
+ unsigned char *cur, *tok, *lim, *eof, *mrk;
+ unsigned char buffer[BSIZE];
+} Scanner;
+
+int fill(Scanner *s, int len)
+{
+ if (!len)
+ {
+ s->cur = s->tok = s->lim = s->mrk = s->buffer;
+ s->eof = 0;
+ }
+ if (!s->eof)
+ {
+ int got, cnt = s->tok - s->buffer;
+
+ if (cnt > 0)
+ {
+ memcpy(s->buffer, s->tok, s->lim - s->tok);
+ s->tok -= cnt;
+ s->cur -= cnt;
+ s->lim -= cnt;
+ s->mrk -= cnt;
+ }
+ cnt = BSIZE - cnt;
+ if ((got = fread(s->lim, 1, cnt, s->fp)) != cnt)
+ {
+ s->eof = &s->lim[got];
+ }
+ s->lim += got;
+ }
+ else if (s->cur + len > s->eof)
+ {
+ return 0; /* not enough input data */
+ }
+ return -1;
+}
+
+void echo(Scanner *s)
+{
+ fwrite(s->tok, 1, s->cur - s->tok, stdout);
+}
+
+int scan(FILE *fp)
+{
+ int res = 0;
+ Scanner s;
+
+ if (!fp)
+ {
+ return 1; /* no file was opened */
+ }
+
+ s.fp = fp;
+
+ fill(&s, 0);
+
+ for(;;)
+ {
+ s.tok = s.cur;
+/*!re2c
+ re2c:indent:top = 2;
+
+ NL = "\r"? "\n" ;
+ WS = [\r\n\t ] ;
+ ANY = [^] ;
+
+ "/" "/" { goto cppcomment; }
+ "/" "*" { goto comment; }
+ ANY { fputc(*s.tok, stdout); continue; }
+*/
+comment:
+ s.tok = s.cur;
+/*!re2c
+ "*" "/" { goto commentws; }
+ ANY { goto comment; }
+*/
+commentws:
+ s.tok = s.cur;
+/*!re2c
+ NL { echo(&s); continue; }
+ WS { goto commentws; }
+ ANY { echo(&s); continue; }
+*/
+cppcomment:
+ s.tok = s.cur;
+/*!re2c
+ NL { echo(&s); continue; }
+ ANY { goto cppcomment; }
+*/
+ }
+
+ if (fp != stdin)
+ {
+ fclose(fp); /* close only if not stdin */
+ }
+ return res; /* return result */
+}
+
+int main(int argc, char **argv)
+{
+ if (argc > 1)
+ {
+ return scan(!strcmp(argv[1], "-") ? stdin : fopen(argv[1], "r"));
+ }
+ else
+ {
+ fprintf(stderr, "%s <expr>\n", argv[0]);
+ return 1;
+ }
+}
--- /dev/null
+/* re2c lesson 002_strip_comments, strip_003.b, (c) M. Boerger 2006 - 2007 */
+/*!ignore:re2c
+
+- more complexity
+ . Right now we strip out trailing white space and new lines after a comment
+ block. This can be a problem when the comment block was not preceeded by
+ a new line.
+ . The solution is to use trailing contexts.
+
+- trailing contexts
+ . Re2c allows to check for a portion of input and only recognize it when it
+ is followed by another portion. This is called a trailing context.
+ . The trailing context is not part of the identified input. That means that
+ it follows exactly at the cursor. A consequence is that the scanner has
+ already read more input and on the next run you need to restore begining
+ of input, in our case s.tok, from the cursor, here s.cur, rather then
+ restoring to the beginning of the buffer. This way the scanner can reuse
+ the portion it has already read.
+ . The position of the trailing context is stored in YYCTXMARKER for which
+ a pointer variable needs to be provided.
+ . As with YYMARKER the corrsponding variable needs to be corrected if we
+ shift in some buffer.
+ . Still this is not all we need to solve the problem. What is left is that
+ the information whether we detected a trailing context was detected has to
+ be stored somewhere. This is done by the new variable nlcomment.
+
+- formatting
+ . Until now we only used single line expression code and we always had the
+ opening { on the same line as the rule itself. If we have multiline rule
+ code and care for formatting we can no longer rely on re2c. Now we have
+ to indent the rule code ourself. Also we need to take care of the opening
+ {. If we keep it on the same line as the rule then re2c will indent it
+ correctly and the emitted #line informations will be correct. If we place
+ it on the next line then the #line directive will also point to that line
+ and not to the rule.
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+/*!max:re2c */
+#define BSIZE 128
+
+#if BSIZE < YYMAXFILL
+# error BSIZE must be greater YYMAXFILL
+#endif
+
+#define YYCTYPE unsigned char
+#define YYCURSOR s.cur
+#define YYLIMIT s.lim
+#define YYMARKER s.mrk
+#define YYCTXMARKER s.ctx
+#define YYFILL(n) { if ((res = fill(&s, n)) >= 0) break; }
+
+typedef struct Scanner
+{
+ FILE *fp;
+ unsigned char *cur, *tok, *lim, *eof, *ctx, *mrk;
+ unsigned char buffer[BSIZE];
+} Scanner;
+
+int fill(Scanner *s, int len)
+{
+ if (!len)
+ {
+ s->cur = s->tok = s->lim = s->mrk = s->buffer;
+ s->eof = 0;
+ }
+ if (!s->eof)
+ {
+ int got, cnt = s->tok - s->buffer;
+
+ if (cnt > 0)
+ {
+ memcpy(s->buffer, s->tok, s->lim - s->tok);
+ s->tok -= cnt;
+ s->cur -= cnt;
+ s->lim -= cnt;
+ s->mrk -= cnt;
+ s->ctx -= cnt;
+ }
+ cnt = BSIZE - cnt;
+ if ((got = fread(s->lim, 1, cnt, s->fp)) != cnt)
+ {
+ s->eof = &s->lim[got];
+ }
+ s->lim += got;
+ }
+ else if (s->cur + len > s->eof)
+ {
+ return 0; /* not enough input data */
+ }
+ return -1;
+}
+
+void echo(Scanner *s)
+{
+ fwrite(s->tok, 1, s->cur - s->tok, stdout);
+}
+
+int scan(FILE *fp)
+{
+ int res = 0;
+ int nlcomment = 0;
+ Scanner s;
+
+ if (!fp)
+ {
+ return 1; /* no file was opened */
+ }
+
+ s.fp = fp;
+
+ fill(&s, 0);
+
+ for(;;)
+ {
+ s.tok = s.cur;
+/*!re2c
+ re2c:indent:top = 2;
+
+ NL = "\r"? "\n" ;
+ WS = [\r\n\t ] ;
+ ANY = [^] ;
+
+ "/" "/" { goto cppcomment; }
+ NL / "/""*" { echo(&s); nlcomment = 1; continue; }
+ "/" "*" { goto comment; }
+ ANY { fputc(*s.tok, stdout); continue; }
+*/
+comment:
+ s.tok = s.cur;
+/*!re2c
+ "*" "/" { goto commentws; }
+ ANY { goto comment; }
+*/
+commentws:
+ s.tok = s.cur;
+/*!re2c
+ NL? "/" "*" { goto comment; }
+ NL {
+ if (!nlcomment)
+ {
+ echo(&s);
+ }
+ nlcomment = 0;
+ continue;
+ }
+ WS { goto commentws; }
+ ANY { echo(&s); nlcomment = 0; continue; }
+*/
+cppcomment:
+ s.tok = s.cur;
+/*!re2c
+ NL { echo(&s); continue; }
+ ANY { goto cppcomment; }
+*/
+ }
+
+ if (fp != stdin)
+ {
+ fclose(fp); /* close only if not stdin */
+ }
+ return res; /* return result */
+}
+
+int main(int argc, char **argv)
+{
+ if (argc > 1)
+ {
+ return scan(!strcmp(argv[1], "-") ? stdin : fopen(argv[1], "r"));
+ }
+ else
+ {
+ fprintf(stderr, "%s <expr>\n", argv[0]);
+ return 1;
+ }
+}