qzdoom/tools/re2c
Randy Heit 748d7bf4b1 - The game is now free of leaks up to the point just after the wads are loaded.
- Fixed: Although TypeInfos are now deleted at exit, their FlatPointers or ActorInfo
  data was not freed. I chose not to use a destructor to handle this, because then it
  would no longer be a POD type that can be statically initialized.
- Fixed: Aliases were not deleted at exit.
- Fixed: FWadCollection did not free its hash tables, lump info, full names, or the
  list of open files when destroyed.


SVN r85 (trunk)
2006-05-09 00:02:37 +00:00
..
doc Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
examples Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
Makefile.am Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
Makefile.in Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
Makefile.mgw Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
README Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
README.in Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
aclocal.m4 Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
actions.cc - The game is now free of leaks up to the point just after the wads are loaded. 2006-05-09 00:02:37 +00:00
basics.h Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
code.cc Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
config.h.in Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
configure Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
configure.in Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
configwin.h Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
dfa.cc - The game is now free of leaks up to the point just after the wads are loaded. 2006-05-09 00:02:37 +00:00
dfa.h Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
globals.h Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
ins.h Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
install-sh Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
main.cc Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
makerpm.in Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
mbo_getopt.cc Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
mbo_getopt.h Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
missing Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
mkinstalldirs Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
parser.cc Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
parser.h Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
parser.y Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
re.h Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
re2c.1 Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
re2c.1.in Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
re2c.spec.in Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
re2c.vcproj Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
scanner.cc Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
scanner.h Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
scanner.re Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
stamp-h.in Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
substr.cc Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
substr.h Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
test.c Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
test.re Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
token.h Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
translate.cc Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00
y.tab.h Directory restructuring to make it easier to version projects that don't build zdoom.exe. 2006-02-24 04:48:15 +00:00

README

re2c Version 0.9.3
------------------

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/

This distribution is a cleaned up version of the 0.5 release. Several 
bugs were fixed as well as code cleanup for warning free compilation.  
It has been developed and tested with egcs 1.0.2 and gcc 2.7.2.3, 2.96 
and 3.3.1 on Linux x86. You can compile your own version with other gcc 
version if you have yacc or any working bison version (tested up to bison
1.875).

You can build this software by simply typing the following commands:
    ./autogen.sh
    ./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:
    ./autogen.sh
    ./configure
    make
    rm -f scanner.cc
    make install

Or you can create a rpm package and install it by the following commands:
    ./autogen.sh
    ./configure
    ./makerpm <release>
    rpm -Uhv <packagedir>/re2c-0.9.3-<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.

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.

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){
    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;}
    */
    }

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){
    char *q;
    #define YYCTYPE         char
    #define YYCURSOR        p
    #define YYLIMIT         p
    #define YYMARKER        q
    #define YYFILL(n)
    {
	    YYCTYPE yych;
	    unsigned int yyaccept;
	    goto yy0;
    yy1:    ++YYCURSOR;
    yy0:
	    if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
	    yych = *YYCURSOR;
	    if(yych <= '/') goto yy4;
	    if(yych >= ':') goto yy4;
    yy2:    yych = *++YYCURSOR;
	    goto yy7;
    yy3:
    #line 10
	    {return YYCURSOR;}
    yy4:    yych = *++YYCURSOR;
    yy5:
    #line 11
	    {return NULL;}
    yy6:    ++YYCURSOR;
	    if(YYLIMIT == YYCURSOR) YYFILL(1);
	    yych = *YYCURSOR;
    yy7:    if(yych <= '/') goto yy3;
	    if(yych <= '9') goto yy6;
	    goto yy3;
    }
    #line 12

    }

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.