⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme

📁 a little DFA compiler.
💻
字号:
re2c Version 0.12.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/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.4mGCC 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    makeThe above version will be based on the pregenerated scanner.cc file. If you want to build that file yourself (recommended when installingre2c) you need the following steps:    ./configure    make    rm -f scanner.cc    make installOr you can create a rpm package and install it by the following commands:    ./configure    make rpm    rpm -Uhv <packagedir>/re2c-0.12.3-1.rpmIf you want to build from CVS then the first thing you should do is regenerating all build files using the following command:	./autogen.shand 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-0.12.3-<release>.rpmHere <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 rpmsto debian packages.When building with native SUN compilers you need to set the following compilerflags: CXXFLAGS='-g -compat5 -library=stlport4'.If you want to build re2c on a windows system you can either use cygwin and oneof the methods described above or use Microsoft Visual C .NET 2002 or laterwith the solution files provided (re2c.sln for 2002/2003 and re2c-2005.sln forversion 2005). re2c cannot be built with Microsoft Visual C 6.0 or earlier.re2c is a great tool for writing fast and flexible lexers. It hasserved 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 regularexpressions.  re2c-based scanners are efficient:  for programminglanguages, given similar specifications, an re2c-based scanner istypically almost twice as fast as a flex-based scanner with little or noincrease 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 mustsupply some interface code.  While this code is not bulky (about 50-100lines for a flex-like scanner; see the man page and examples in thedistribution) careful coding is required for efficiency (andcorrectness).  One advantage of this arrangement is that the generatedcode is not tied to any particular input model.  For example, re2cgenerated code can be used to scan data from a null-byte terminatedbuffer 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 removeall YYCURSOR, YYLIMIT comparisions.re2c was developed for a particular project (constructing a fast REXXscanner of all things!) and so while it has some rough edges, it shouldbe quite usable.  More information about re2c can be found in the(admittedly skimpy) man page; the algorithms and heuristics used aredescribed in an upcoming LOPLAS article (included in the distribution).Probably the best way to find out more about re2c is to try the suppliedexamples.  re2c is written in C++, and is currently being developedunder Linux using gcc 2.5.8.Peter--re2c is distributed with no warranty whatever.  The code is certain tocontain errors.  Neither the author nor any contributor takesresponsibility for any consequences of its use.re2c is in the public domain.  The data structures and algorithms usedin re2c are all either taken from documents available to the generalpublic or are inventions of the author.  Programs generated by re2c maybe distributed freely.  re2c itself may be distributed freely, in sourceor binary, unchanged or modified.  Distributors may charge whatever feesthey can obtain for re2c.If you do make use of re2c, or incorporate it into a larger project anacknowledgement somewhere (documentation, research report, etc.) wouldbe appreciated.Please send bug reports and feedback (including suggestions forimproving the distribution) to			peter@csg.uwaterloo.caInclude a small example and the banner from parser.y with bug reports.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -