From earleh@eleazar.dartmouth.edu Wed Jun 29 11:43:04 1988 Path: utastro!ut-sally!cs.utexas.edu!tut.cis.ohio-state.edu!mailrus!ames!oliveb!felix!dhw68k!macintosh From: earleh@eleazar.dartmouth.edu (Earle R. Horton) Newsgroups: comp.sources.mac Subject: Flex for the Mac (part 1 of 7) Message-ID: <9364@dhw68k.cts.com> Date: 29 Jun 88 16:43:04 GMT Sender: macintosh@dhw68k.cts.com Organization: Dartmouth College, Hanover, NH Lines: 1430 Approved: bytebug@dhw68k.cts.com (Roger L. Long) [Flex for the Mac - part 1 of 7] What follows are the sources to Flex, a generator of lexical analysis programs in the style of UNIX lex. These sources are compatible with MPW C 2.0.2, and with 4.3 BSD UNIX. The code is relatively clean, so porting to other systems doesn't look too bad. See my notes in README_for_Macintosh if you want to port to another Macintosh development system. There are some "gotcha"s. My contribution to these sources is the port to MPW (trivial) and fixes to the original code to allow it to scan Macintosh option characters (non-trivial). Macintosh option characters are generally speaking non-ASCII characters, i.e. the high bit of the byte holding an option-char is set. The modifications I have made to the source code now allow Flex to scan for these characters in all systems (I think), and will be of interest for any system where non-ASCII characters might be used (e.g. VMS). The files "makefile", "makefile.MPW", and "flexit" contain Macintosh option-chars (you are warned). There is a UNIX Makefile also, if you want to use this with Aztec. [Moderator's Note: makefile.Hqx, makefile.MPW.Hqx, and flexit.Hqx are provided here.] Earle Horton ********************************************************************* *Earle R. Horton, H.B. 8000, Dartmouth College, Hanover, NH 03755 * ********************************************************************* --- #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create the files: # flex/Changes # flex/README # flex/README_for_Mac # flex/Timings # flex/flexit.Hqx # flex/makefile.Hqx # flex/makefile.MPW.Hqx # flex/makefile.UNIX # flex/manifest # flex/flex.fastskel # flex/flex.skel # This archive created: Wed Jun 29 07:03:10 1988 # By: Roger L. Long (bytebug@dhw68k.cts.com) export PATH; PATH=/bin:$PATH echo shar: extracting "'Changes'" '(861 characters)' if test -f 'Changes' then echo shar: will not over-write existing file "'Changes'" else sed 's/^X//' << \SHAR_EOF > 'Changes' XChanges between beta-test release of Feb. '88 and initial release: X X - many files renamed to remove "flex" prefix X - input() routine added to compressed and fast skeletons X - unput() routine added to compressed skeleton X - -d, -ce support for fast scanners X - symbol table extended to avoid ugly casts of ints <-> char *'s; X this may relieve MS-DOS woes X - actions are now separated with YY_BREAK instead of simple "break"'s X - fixed bug causing core-dumps if skeleton file could not be opened X - fixed bugs in logic deciding which options cannot be intermixed X - initial start condition can now be referred to as X - fixed bug which would incorrectly computer trailing context X count for a pattern like "(foo){3}"; now this is considered X "variable length", even though it isn't. X - block comments allowed between rules X - misc. typos corrected SHAR_EOF if test 861 -ne "`wc -c < 'Changes'`" then echo shar: error transmitting "'Changes'" '(should have been 861 characters)' fi fi # end of overwriting check echo shar: extracting "'README'" '(3402 characters)' if test -f 'README' then echo shar: will not over-write existing file "'README'" else sed 's/^X//' << \SHAR_EOF > 'README' XThis is the initial release of flex, a replacement for the lex(1) Xtool. As the copyright indicates, this distribution can be freely Xredistributed. X XSome notes on the distribution: X X Yes, there are some niggling lex features which are not available which X seem like they'd be easy to add. They're not, or if they are then the X straight-forward implementation of them would slow down the scanner. X Unfortunately I am unable to do any further work on flex other than bug X fixes, so if there's something you've just gotta have, you'd better X be willing to dive into the code. I'll be happy to give (fairly X high-level) advice on how to proceed. X X The compressed tables have been tested pretty thoroughly in the past, X though may be suffering from bit-rot. The fast/full tables have been X recently implemented and are more likely to have bugs. X X For a System V machine, add the #define "SV". Not guaranteed to do X the full job, but a step in the right direction. X X Flex has been successfully ported to Sun Unix and 4.3BSD Vax Unix. X X XThe flex distribution consists of the following files: X X README This message X X Changes Differences between this release and the beta-test X X Makefile X flexdef.h X parse.y X scan.l X ccl.c X dfa.c flex sources X ecs.c X main.c X misc.c X nfa.c X sym.c X tblcmp.c X yylex.c X X scan.c.dist pre-flex'd version of scan.l X X flex.skel X flex.fastskel X flexskelcom.h skeleton scanner sources X flexskeldef.h X fastskeldef.h X X flex.1 manual entry X X Timings a brief note comparing timings of flex vs. lex X X[ The following section is only true if you got the files from FTP X to LBL, directly, and not from the more widely-distributed X comp.sources.unix publication. --Rich $alz XThe files are packaged as a compressed shell archive, which in turn Xcontains seven shell archives. Create a directory where you want flex Xto live, cd there, and use X X uncompress flex.shar.Z X sh flex.shar X X sh flex.shar.1 X sh flex.shar.2 X sh flex.shar.3 X sh flex.shar.4 X sh flex.shar.5 X sh flex.shar.6 X sh flex.shar.7 X Xto extract them. X] X XEither move {flexskelcom.h,flexskeldef.h,fastskeldef.h} into /usr/include Xor edit {flex.skel,flex.fastskel,flexskeldef.h,fastskeldef.h,scan.c.dist} Xand wire in the full pathname of where you are going to keep the include files. X XDecide where you want to keep {flex.skel,flex.fastskel} (suggestion: X/usr/local/lib) and move it there. Edit "Makefile" and change the Xdefinitions of SKELETON_FILE and F_SKELETON_FILE to reflect the full Xpathnames of {flex.skel,flex.fastskel}. X XTo make flex for the first time, use: X X make first_flex X Xwhich uses a pre-generated copy of the scanner whose source is in flex. X XAssuming it builds successfully, you can test it using X X make test X XThe "diff" should not show any differences. X XIf you're feeling adventurous, rebuild scan.c using various Xcombinations of FLEX_FLAGS, each time trying "make test" when Xyou're done. To rebuild it, do X X rm scan.c X make FLEX_FLAGS="..." X Xwhere "..." is one of: X X -ist -c X -ist -ce X -ist -cm X -ist -cfe X -ist -cFe X Xand testing using: X X make FLEX_FLAGS="..." test X X XFormat the manual entry using X X nroff -man flex.1 X X XPlease send problems and feedback to: X X vern@lbl-{csam,rtsg}.arpa or ucbvax!lbl-csam.arpa!vern X X Vern Paxson X Real Time Systems Group X Bldg. 46A X Lawrence Berkeley Laboratory X 1 Cyclotron Rd. X Berkeley, CA 94720 X X (415) 486-6411 SHAR_EOF if test 3402 -ne "`wc -c < 'README'`" then echo shar: error transmitting "'README'" '(should have been 3402 characters)' fi fi # end of overwriting check echo shar: extracting "'README_for_Mac'" '(3938 characters)' if test -f 'README_for_Mac' then echo shar: will not over-write existing file "'README_for_Mac'" else sed 's/^X//' << \SHAR_EOF > 'README_for_Mac' XFlex for the Mac (MPW). Port by Earle Horton, May 1988 X X/* X * Copyright (c) 1987, the University of California X * X * The United States Government has rights in this work pursuant to X * contract no. DE-AC03-76SF00098 between the United States Department of X * Energy and the University of California. X * X * This program may be redistributed. Enhancements and derivative works X * may be created provided the new works, if made available to the general X * public, are made available for use by anyone. X */ X XThis document consists of general comments regarding the implementation Xof Flex as a Macintosh Programmer's Workshop tool. Comments regarding Xthe building of flex and its use are freely interspersed. X XMPW 2.0.2 tools are limited to 32k of global data. This necessitates use of Xmalloc() to obtain space for a number of Flex's work buffers. This is Xdone both in the source code for Flex and in the scanners produced by XFlex, and is determined by definition of the pre-processor macro XMALLOC_BUFFERS. Scanners produced by Flex can save 5k of global data Xspace if compiled with MALLOC_BUFFERS #defined. Still, the fast scanner Xoptions will probably not work in this environment because of the large Xtables used. X XI have supplied a function gettime() which returns a string produced Xby IUTimeString(). Results may not be the same as those produced by Xversions of Flex running on UNIX systems. If you are interested in Xporting Flex to another Macintosh development system, then you should Xlook in misc.c and verify that the calling sequence is correct for Xyour compiler. This is the only Macintosh-specific system call used. X XThe Macintosh "newline" character is decimal 13. MPW C treats all Xreferences to '\n' to mean 13, and not 10. Other development systems Xinclude code in stdio to translate carriage returns to line feeds on Xinput, so that code compiled in these systems sees decimal 10 at the Xend of lines, and not the 13 which is actually there. This means that Xstate tables generated by MPW Flex may not be suitable for compilation Xusing the compiler of another development system, unless the input Xstream read by the macro YY_INPUT is in binary mode. X XThe files "flex.skel" and "flex.fastskel" are found by use of environment Xvariables thusly: X X set SKELETON_FILE "{clibraries}flex.skel" X export SKELETON_FILE X set F_SKELETON_FILE "{clibraries}flex.fastskel" X export F_SKELETON_FILE X X{Clibraries} is where I keep my copies. Copies of the three #include Xfiles flexskelcom.h,flexskeldef.h and fastskeldef.h should also be Xput where the C compiler can find them, usually {CIncludes}. X XThe temporary file used by Flex has a constant name. If you are batty Xenough to have files named "/tmp/flexXXXXXX" lying around you will Xlose them. X XThe MPW Makefile uses stubs.c.o. Stubs.c is included in the MPW C Xdistribution in the "CExamples" folder, and provides dummy functions Xfor those routines which are not needed by tools. This causes the Xlinker to emit duplicate entry warnings, unless "-d" is turned on, Xwhich it is in the supplied Makefile. X XThis distribution contains files which are not used in the MPW Ximplementation, but which will be needed in case anyone wants to Xcompile Flex on a non-Mac system. For this reason, I request that Xif you redistribute the Flex sources, you distribute ALL the files Xwhich I supply. In particular, "scan.c.dist" will be essential to Xanyone attempting to compile these sources on a non-Mac, and possibly Xon a Mac using another Mac development system. X XThis code incorporates fixes to a bug in the original code which did Xnot allow scanning of Macintosh option-characters (those with the Xhigh bit set). This fix should also allow it work with character Xsets such as DEC multi-nationals. I have verified that this fix Xallows Flex to scan non-ASCII characters properly on a 4.3 BSD Xsystem, but have not tried it with any other systems at this time. X XHappy scanning! X XEarle SHAR_EOF if test 3938 -ne "`wc -c < 'README_for_Mac'`" then echo shar: error transmitting "'README_for_Mac'" '(should have been 3938 characters)' fi fi # end of overwriting check echo shar: extracting "'Timings'" '(857 characters)' if test -f 'Timings' then echo shar: will not over-write existing file "'Timings'" else sed 's/^X//' << \SHAR_EOF > 'Timings' Xflex vs. lex timings for a C tokenizer which includes keywords: X XGeneration times: X X lex 83.0 secs X flex 3.9 X flex -cfe 7.1 # uncompressed table, equivalence classes X flex -cf 15.0 # uncompressed table, no equivalence classes X XScanner object file sizes: X X lex 41.0K bytes X flex 9.4K X flex -cfe 49.6K X flex -cf 126.5K X XRunning times on a 28,088 line input (685K characters): X X lex 29.8 secs X flex 19.3 X flex -cfe 9.0 X flex -cf 7.8 X XThe timings were made on a Sun 3/60. All times are user + system CPU time, Xand don't include hashing of identifiers. X XSummary: X X For about the same sized scanner, you get a factor of 3 in performance. X For a 30% faster scanner, you get a scanner 1/4th the size, and it's X generated in 1/20th the time. X For a scanner that's 3 times larger, you get a factor of 3.8 in X performance. SHAR_EOF if test 857 -ne "`wc -c < 'Timings'`" then echo shar: error transmitting "'Timings'" '(should have been 857 characters)' fi fi # end of overwriting check echo shar: extracting "'flexit.Hqx'" '(499 characters)' if test -f 'flexit.Hqx' then echo shar: will not over-write existing file "'flexit.Hqx'" else sed 's/^X//' << \SHAR_EOF > 'flexit.Hqx' X(This file must be converted with BinHex 4.0) X X:"QCXCAKTG!"849K869"6)!#3"!%Z!*!%FH%M)%e39cSJ3fpZGQ9bG#!mFh4ND@i Xq)'PZG'mJB5"XCAKTBf&X)(0MB@jZCA)JEQ&YC@3JE'PZDbj[GA3Z$@CXCAJJ,A3 XJI#"M)#eR)#e%HAPXCAJpE@&TEJeXD@jV)!NYGb!YBL!YBb!R69"6)#FJ,A3J69" X69##f$3N*Bbj[),B0#3NLHd0-D@*bBA*TCA0p)R0dG@*c,Q-ZEb#f$3N*)RY$6'P XLFQ&bD@9cI5*$8R9ZG'PYC5j[),B0#3NLHd0-D@*bBA*TCA0p)P0dC%0-D@)ZEb# Xf$3N*)RY$6'PLFQ&bD@9cI5*$8d&148aTBLj[),B0#3NLHd0-D@*bBA*TCA0p)N0 X*ER4PFQCKBf8ZEb#f$3N*)RY-D@*bBA*TCA0p)NPZG'9bCQ&MC5j[$@2h!!!: SHAR_EOF if test 499 -ne "`wc -c < 'flexit.Hqx'`" then echo shar: error transmitting "'flexit.Hqx'" '(should have been 499 characters)' fi fi # end of overwriting check echo shar: extracting "'makefile.Hqx'" '(2872 characters)' if test -f 'makefile.Hqx' then echo shar: will not over-write existing file "'makefile.Hqx'" else sed 's/^X//' << \SHAR_EOF > 'makefile.Hqx' X(This file must be converted with BinHex 4.0) X X:#'eKDf9QD@aP!&4&@&408&-J!*!%#!8!N!6cUL-JE@&VC5"QD@aP)'C[FL!LCQa XPH#)JG'p[E!dM)%e39b"YB@YP)(CPFR0TEfiJBRNJ4@&bE'8J5'pbG'pZ,#"0BAN XJ-6Ni1!d0)b"dD'8JCQPbFh3JG'PYC5"KFQp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HdC-49KI3ep66e953d96I5!q)'CXCAJZE'PZG!d0BfaPB@i XJa!d*C'9XCA4P)#eT)'CXCAJJa5j[)("KFR0P,Q-JF'&bFf8ZD#"cBf&Z,Q-0$A4 XPFh3Ja!d*C@0SEb!L9'KTFb"cG'9`)'4PFh4bEhPc)'TeEQXZBbiL$3Pl4Na&@(d XJHdC-49KI4Na"4e0p)(0MB@iZE#!q)'TeEQXZBb!0#@0[EA"KFQ8JFf0KELjM)'T XeEQXZB`d*C'9XCA4P)'TeEQXZB`d0D@jcG'&XE#$%)(Y'6%9BI3d*C(9`E'PMBA4 XP)#ej)(Y'6%9BI5"l3NP14%P5I3d*C(9`E'PMBA4P)#ej)'CXCAKcDf9XBfpY,QJ XJHdP13da94%96I3d*C(9`E'PMBA4P)#ej)'CXCAKcDf9XC'9Q,QJJHdP13da94%9 X6I3d*C(9`E'PMBA4P)#ej)'CKFh4cDf9XC'9Q,QJJHdP13da94%96I3d*C(9`E'P XMBA4P)#ej)'CXCAJZFfYPE#"l6%P#4%P5I3d*C(9`E'PMBA4P)#ej)'CXCAJZCQ& XcG(0VC@`JHda*3N4*8Rd0$Gr6!!!: SHAR_EOF if test 2872 -ne "`wc -c < 'makefile.Hqx'`" then echo shar: error transmitting "'makefile.Hqx'" '(should have been 2872 characters)' fi fi # end of overwriting check echo shar: extracting "'makefile.MPW.Hqx'" '(3313 characters)' if test -f 'makefile.MPW.Hqx' then echo shar: will not over-write existing file "'makefile.MPW.Hqx'" else sed 's/^X//' << \SHAR_EOF > 'makefile.MPW.Hqx' X(This file must be converted with BinHex 4.0) X X:$'eKDf9QD@aP,Ne39`"849K869"6)!#3"!J&!!!"IYC1)b"YB@YP)'CTE'8JCQp Xb)#*QE'9i)L"dEfpX$5-J69"A)'eKDf8JGQ9bFfP[EL"LH5"&BA*XC5")Eh*dEfi XX)%eKH5!a16Ji$3dM)(4SC5"QDA*cG#"dD@eP)'&bEh9ZC#"eFf8J)QeKDf8JCQP XbFh4ICQaPH#)0$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makefile.MPW.Hqx'" '(should have been 3313 characters)' fi fi # end of overwriting check echo shar: extracting "'makefile.UNIX'" '(1264 characters)' if test -f 'makefile.UNIX' then echo shar: will not over-write existing file "'makefile.UNIX'" else sed 's/^X//' << \SHAR_EOF > 'makefile.UNIX' X# make file for "flex" tool X X# the first time around use "make first_flex" X XSKELETON_FILE = \"/usr/local/lib/flex.skel\" XF_SKELETON_FILE = \"/usr/local/lib/flex.fastskel\" XSKELFLAGS = -DDEFAULT_SKELETON_FILE=$(SKELETON_FILE) \ X -DFAST_SKELETON_FILE=$(F_SKELETON_FILE) XCFLAGS = -O XLDFLAGS = X XFLEX_FLAGS = -ist XFLEX = flex X XFLEXOBJS = \ X ccl.o \ X dfa.o \ X ecs.o \ X main.o \ X misc.o \ X nfa.o \ X parse.o \ X scan.o \ X sym.o \ X tblcmp.o \ X yylex.o X XFLEX_C_SOURCES = \ X ccl.c \ X dfa.c \ X ecs.c \ X main.c \ X misc.c \ X nfa.c \ X parse.c \ X scan.c \ X sym.c \ X tblcmp.c \ X yylex.c X Xflex : $(FLEXOBJS) X cc $(CFLAGS) -o flex $(LDFLAGS) $(FLEXOBJS) X Xfirst_flex: X cp scan.c.dist scan.c X make $(MFLAGS) flex X Xparse.h parse.c : parse.y X yacc -d parse.y X @mv y.tab.c parse.c X @mv y.tab.h parse.h X X# comment-out the next two lines after a successful "make test" and X# comment-in the following two lines. X Xscan.c : scan.l X $(FLEX) $(FLEX_FLAGS) scan.l >scan.c X Xscan.o : scan.c parse.h X Xmain.o : main.c X cc $(CFLAGS) -c $(SKELFLAGS) main.c X Xflex.lint : $(FLEX_C_SOURCES) X @echo "Expect a \"may be used before set\" and 2 \"unused\"'s X lint $(FLEX_C_SOURCES) > flex.lint X Xclean : X rm -f core errs flex *.o parse.c *.lint parse.h X Xtest : X $(FLEX) $(FLEX_FLAGS) scan.l | diff scan.c - SHAR_EOF if test 1264 -ne "`wc -c < 'makefile.UNIX'`" then echo shar: error transmitting "'makefile.UNIX'" '(should have been 1264 characters)' fi fi # end of overwriting check echo shar: extracting "'manifest'" '(312 characters)' if test -f 'manifest' then echo shar: will not over-write existing file "'manifest'" else sed 's/^X//' << \SHAR_EOF > 'manifest' XName X-------- Xalloca.a Xbzero.c Xccl.c XChanges Xdfa.c Xecs.c Xfastskeldef.h Xflex.1 Xflex.fastskel Xflex.man.page Xflex.skel Xflexdef.h Xflexit Xflexskelcom.h Xflexskeldef.h Xmain.c Xmakefile.MPW Xmakefile.UNIX Xmanifest Xmisc.c Xnfa.c Xparse.y XREADME XREADME_for_Macintosh Xscan.c.dist Xscan.l Xsym.c Xtblcmp.c XTimings Xyylex.c SHAR_EOF if test 312 -ne "`wc -c < 'manifest'`" then echo shar: error transmitting "'manifest'" '(should have been 312 characters)' fi fi # end of overwriting check echo shar: extracting "'flex.fastskel'" '(9560 characters)' if test -f 'flex.fastskel' then echo shar: will not over-write existing file "'flex.fastskel'" else sed 's/^X//' << \SHAR_EOF > 'flex.fastskel' X/* A lexical scanner generated by flex */ X X#define FLEX_FAST_SKEL X X#include "fastskeldef.h" X X%% section 1 code and the definition of YY_TRANS_OFFSET_TYPE, if needed, go here X X#ifndef FLEX_FULL_TABLE X /* struct for yy_transition */ X struct yy_trans_info X { X /* v is a verify for a transition. */ X short v; X X /* In cases where its sister v *is* a "yes, there is a transition", X * n is* the offset (in records) to the next state. In most cases X * where there is no transition, the value of n is irrelevant. If n X * is the -1th record of a state, though, then n is the action X * number for that state X */ X YY_TRANS_OFFSET_TYPE n; X }; X#endif X X%% data tables for DFA go here X X/* these declarations have to come after the section 1 code or lint gets X * confused about whether the variables are used X */ XFILE *yyin = stdin, *yyout = stdout; X X/* these variables are all declared out here so that section 3 code can X * manipulate them X */ Xstatic char *yy_c_buf_p; /* points to current character in buffer */ Xstatic char *yy_b_buf_p; /* points to start of current scan */ Xstatic int yy_init = 1; /* whether we need to initialize */ Xstatic int yy_start; /* start state number */ X X/* true when we've seen an EOF for the current input file */ Xstatic int yy_eof_has_been_seen; X Xstatic int yy_n_chars; /* number of characters read into yy_ch_buf */ X X/* yy_ch_buf has to be 2 characters longer than YY_BUF_SIZE because we need X * to put in 2 end-of-buffer characters (this is explained where it is X * done) at the end of yy_ch_buf X */ X#ifdef MALLOC_BUFFERS Xstatic char *yy_ch_buf = 0L; X#else Xstatic char yy_ch_buf[YY_BUF_SIZE + 2]; X#endif X X/* yy_hold_char holds the character lost when yytext is formed */ Xstatic char yy_hold_char; Xchar *yytext; Xstatic int yyleng; /* length of yytext */ X Xstatic YY_CS_TYPE yy_last_accepting_state; Xstatic char *yy_last_accepting_cpos; X Xstatic YY_CS_TYPE yy_get_previous_state(); Xstatic int yy_get_next_buffer(); X X#define FLEX_USES_BACKTRACKING X X#ifdef FLEX_USES_BACKTRACKING X# ifdef FLEX_FULL_TABLE X# define YY_BACKTRACKING_ACTION \ X if ( l[yy_current_state] ) \ X { \ X yy_last_accepting_state = yy_current_state; \ X yy_last_accepting_cpos = yy_c_buf_p; \ X } X# else X# define YY_BACKTRACKING_ACTION \ X if ( yy_current_state[-1].n ) \ X { \ X yy_last_accepting_state = yy_current_state; \ X yy_last_accepting_cpos = yy_c_buf_p; \ X } X# endif X#else X# define YY_BACKTRACKING_ACTION X#endif X XYY_DECL X { X register YY_CS_TYPE yy_current_state; X register int yy_c; X register struct yy_trans_info *yy_trans_info; X register int yy_act; X X%% user's declarations go here X X#ifdef MALLOC_BUFFERS X if(yy_ch_buf == 0L){ X yy_ch_buf = (char *)malloc(YY_BUF_SIZE + 2); X if(yy_ch_buf == 0L){ X fprintf( stderr, "Out of memory\n"); X exit(-1); X } X } X#endif X if ( yy_init ) X { X yy_start = 1; /* first start state */ X Xnew_file: X /* this is where we enter upon encountering and end-of-file and X * yywrap() indicating that we should continue processing X */ X X /* we put in the '\n' and start reading from [1] so that an X * initial match-at-newline will be true. X */ X X yy_ch_buf[0] = '\n'; X yy_n_chars = 1; X X /* we always need two end-of-buffer characters. The first causes X * a transition to the end-of-buffer state. The second causes X * a jam in that state. X */ X yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; X yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; X X yy_eof_has_been_seen = 0; X X YY_FAST_INIT; X yy_init = 0; X } X X while ( 1 ) /* loops until end-of-file is reached */ X { X /* support of yytext and yyleng */ X YY_DO_BEFORE_SCAN; X X /* yy_b_buf_p points to the position in yy_ch_buf of the start of the X * current run. X */ X yy_b_buf_p = yy_c_buf_p; X X YY_FIND_START_STATE( yy_current_state ); X X YY_FIND_NEXT_MATCH; X X YY_DO_BEFORE_ACTION; X X/* we need this label to process the very last action (right before the end of X * the file) X */ Xdo_action: X YY_FIND_ACTION( yy_act ); X X#ifdef FLEX_DEBUG X fprintf( stderr, "--accepting rule #%d\n", yy_act ); X#endif X switch ( yy_act ) X { X%% actions go here X X case YY_BACK_TRACK: X YY_DO_BEFORE_SCAN; /* undo the effects of YY_DO_BEFORE_ACTION */ X yy_c_buf_p = yy_last_accepting_cpos + 1; X yy_current_state = yy_last_accepting_state; X YY_DO_BEFORE_ACTION; X goto do_action; X X case YY_NEW_FILE: X break; /* begin reading from new file */ X X case YY_DO_DEFAULT: X /* we have to eat up one character and recompute yytext and X * yyleng X */ X YY_DO_BEFORE_SCAN; /* undo the effects of YY_DO_BEFORE_ACTION */ X ++yy_c_buf_p; X YY_DO_BEFORE_ACTION; X YY_DEFAULT_ACTION; X break; X X case YY_END_OF_BUFFER: X YY_DO_BEFORE_SCAN; /* undo the effects of YY_DO_BEFORE_ACTION */ X X switch ( yy_get_next_buffer() ) X { X case EOB_ACT_END_OF_FILE: X { X if ( yywrap() ) X { X /* note: because we've taken care in X * yy_get_next_buffer() to have set up yy_b_buf_p, X * we can now set up yy_c_buf_p so that if some X * total hoser (like flex itself) wants X * to call the scanner after we return the X * YY_NULL, it'll still work - another YY_NULL X * will get returned. X */ X yy_c_buf_p = yy_b_buf_p; X return ( YY_NULL ); X } X X else X goto new_file; X } X break; X X case EOB_ACT_RESTART_SCAN: X yy_c_buf_p = yy_b_buf_p; X X YY_DO_BEFORE_RESTART; X break; X X case EOB_ACT_LAST_MATCH: X yy_c_buf_p = &yy_ch_buf[yy_n_chars]; X X yy_current_state = yy_get_previous_state(); X X YY_DO_BEFORE_ACTION; X X goto do_action; X } X break; X X default: X printf( "action # %d\n", yy_act ); X YY_FATAL_ERROR( "fatal flex scanner internal error" ); X } X } X } X X X/* yy_get_next_buffer - try to read in new buffer X * X * synopsis X * int yy_get_next_buffer(); X * X * returns a code representing an action X * EOB_ACT_LAST_MATCH - X * EOB_ACT_RESTART_SCAN - restart the scanner X * EOB_ACT_END_OF_FILE - end of file X */ X Xstatic int yy_get_next_buffer() X X { X if ( yy_c_buf_p != &yy_ch_buf[yy_n_chars + 1] ) X { X YY_FATAL_ERROR( "NULL in input" ); X /*NOTREACHED*/ X } X X else X { /* try to read more data */ X register char *dest = yy_ch_buf; X register char *source = yy_b_buf_p - 1; /* copy prev. char, too */ X register int number_to_move, i; X int ret_val; X X /* first move last chars to start of buffer */ X number_to_move = yy_c_buf_p - yy_b_buf_p; X X for ( i = 0; i < number_to_move; ++i ) X *(dest++) = *(source++); X X if ( yy_eof_has_been_seen ) X /* don't do the read, it's not guaranteed to return an EOF, X * just force an EOF X */ X yy_n_chars = 0; X X else X /* read in more data */ X YY_INPUT( (&yy_ch_buf[number_to_move]), yy_n_chars, X YY_BUF_SIZE - number_to_move - 1 ); X X if ( yy_n_chars == 0 ) X { X if ( number_to_move == 1 ) X ret_val = EOB_ACT_END_OF_FILE; X else X ret_val = EOB_ACT_LAST_MATCH; X X yy_eof_has_been_seen = 1; X } X X else X ret_val = EOB_ACT_RESTART_SCAN; X X yy_n_chars += number_to_move; X yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; X yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; X X /* yy_b_buf_p begins at the second character in X * yy_ch_buf; the first character is the one which X * preceded it before reading in the latest buffer; X * it needs to be kept around in case it's a X * newline, so yy_get_previous_state() will have X * with '^' rules active X */ X X yy_b_buf_p = &yy_ch_buf[1]; X X return ( ret_val ); X } X } X X X/* yy_get_previous_state - get the state just before the eob char was reached X * X * synopsis X * YY_CS_TYPE yy_get_previous_state(); X */ X Xstatic YY_CS_TYPE yy_get_previous_state() X X { X register YY_CS_TYPE yy_cur_state; X register char *yy_temp_char_ptr; X X YY_FIND_START_STATE( yy_cur_state ); X X for ( yy_temp_char_ptr = yy_b_buf_p; yy_temp_char_ptr < yy_c_buf_p; ) X YY_GET_NEXT_STATE; X X return ( yy_cur_state ); X } X X Xstatic unput( c ) Xint c; X X { X YY_DO_BEFORE_SCAN; /* undo effects of setting up yytext */ X X if ( yy_c_buf_p < yy_ch_buf + 2 ) X { /* need to shift things up to make room */ X register int number_to_move = yy_n_chars + 2; /* +2 for EOB chars */ X register char *dest = &yy_ch_buf[YY_BUF_SIZE + 2]; X register char *source = &yy_ch_buf[number_to_move]; X X while ( source > yy_ch_buf ) X *--dest = *--source; X X yy_c_buf_p += dest - source; X yy_b_buf_p += dest - source; X X if ( yy_c_buf_p < yy_ch_buf + 2 ) X YY_FATAL_ERROR( "flex scanner push-back overflow" ); X } X X if ( yy_c_buf_p > yy_b_buf_p && yy_c_buf_p[-1] == '\n' ) X yy_c_buf_p[-2] = '\n'; X X *--yy_c_buf_p = c; X X YY_DO_BEFORE_ACTION; /* set up yytext again */ X } X X Xstatic int input() X X { X int c; X X YY_DO_BEFORE_SCAN; X X if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) X { /* need more input */ X yy_b_buf_p = yy_c_buf_p; X ++yy_c_buf_p; X X switch ( yy_get_next_buffer() ) X { X /* this code, unfortunately, is somewhat redundant with X * that above X */ X case EOB_ACT_END_OF_FILE: X { X if ( yywrap() ) X { X yy_c_buf_p = yy_b_buf_p; X return ( EOF ); X } X X yy_ch_buf[0] = '\n'; X yy_n_chars = 1; X yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; X yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; X yy_eof_has_been_seen = 0; X X YY_FAST_INIT; X X return ( input() ); X } X break; X X case EOB_ACT_RESTART_SCAN: X yy_c_buf_p = yy_b_buf_p; X break; X X case EOB_ACT_LAST_MATCH: X YY_FATAL_ERROR( "unexpected last match in input()" ); X } X } X X c = *yy_c_buf_p++ & BYTEMASK; X X YY_DO_BEFORE_RESTART; X X return ( c ); X } SHAR_EOF if test 9560 -ne "`wc -c < 'flex.fastskel'`" then echo shar: error transmitting "'flex.fastskel'" '(should have been 9560 characters)' fi fi # end of overwriting check echo shar: extracting "'flex.skel'" '(6916 characters)' if test -f 'flex.skel' then echo shar: will not over-write existing file "'flex.skel'" else sed 's/^X//' << \SHAR_EOF > 'flex.skel' X/* A lexical scanner generated by flex */ X X#include "flexskeldef.h" X X%% section 1 code and data tables for DFA go here X X/* these declarations have to come after the section 1 code or lint gets X * confused about whether the variables are used X */ XFILE *yyin = stdin, *yyout = stdout; X X/* these variables are all declared out here so that section 3 code can X * manipulate them X */ Xstatic int yy_start, yy_b_buf_p, yy_c_buf_p, yy_e_buf_p; Xstatic int yy_saw_eof, yy_init = 1; X X/* yy_ch_buf has to be 1 character longer than YY_BUF_SIZE, since when X * setting up yytext we can try to put a '\0' just past the end of the X * matched text X */ X#ifdef MALLOC_BUFFERS Xstatic char *yy_ch_buf = 0L; Xstatic int *yy_st_buf = 0L; X#else Xstatic char yy_ch_buf[YY_BUF_SIZE + 1]; Xstatic int yy_st_buf[YY_BUF_SIZE]; X#endif Xstatic char yy_hold_char; Xchar *yytext; Xstatic int yyleng; X XYY_DECL X { X int yy_n_chars, yy_lp, yy_iii, yy_buf_pos, yy_act; X X%% user's declarations go here X X#ifdef MALLOC_BUFFERS X if(yy_ch_buf == 0L){ X yy_ch_buf = (char *)malloc(YY_BUF_SIZE + 1); X yy_st_buf = (int *)malloc(YY_BUF_SIZE * sizeof(int)); X if(yy_ch_buf == 0L || yy_st_buf == 0L){ X fprintf( stderr, "Out of memory\n"); X exit(-1); X } X } X#endif X if ( yy_init ) X { X YY_INIT; X yy_start = 1; X yy_init = 0; X } X X goto get_next_token; X Xdo_action: X for ( ; ; ) X { X YY_DO_BEFORE_ACTION X X#ifdef FLEX_DEBUG X fprintf( stderr, "--accepting rule #%d\n", yy_act ); X#endif X switch ( yy_act ) X { X%% actions go here X Xcase YY_NEW_FILE: Xbreak; /* begin reading from new file */ X Xcase YY_DO_DEFAULT: XYY_DEFAULT_ACTION; Xbreak; X Xcase YY_END_TOK: Xreturn ( YY_END_TOK ); X Xdefault: XYY_FATAL_ERROR( "fatal flex scanner internal error" ); X } X Xget_next_token: X { X register int yy_curst; X register char yy_sym; X X YY_DO_BEFORE_SCAN X X /* set up to begin running DFA */ X X yy_curst = yy_start; X X if ( yy_ch_buf[yy_c_buf_p] == '\n' ) X ++yy_curst; X X /* yy_b_buf_p points to the position in yy_ch_buf X * of the start of the current run. X */ X X yy_b_buf_p = yy_c_buf_p + 1; X X do /* until the machine jams */ X { X if ( yy_c_buf_p == yy_e_buf_p ) X { /* need more input */ X if ( yy_e_buf_p >= YY_BUF_LIM ) X { /* not enough room to do another read */ X /* see if we can make some room for more chars */ X X yy_n_chars = yy_e_buf_p - yy_b_buf_p; X X if ( yy_n_chars >= 0 ) X /* shift down buffer to make room */ X for ( yy_iii = 0; yy_iii <= yy_n_chars; ++yy_iii ) X { X yy_buf_pos = yy_b_buf_p + yy_iii; X yy_ch_buf[yy_iii] = yy_ch_buf[yy_buf_pos]; X yy_st_buf[yy_iii] = yy_st_buf[yy_buf_pos]; X } X X yy_b_buf_p = 0; X yy_e_buf_p = yy_n_chars; X X if ( yy_e_buf_p >= YY_BUF_LIM ) X YY_FATAL_ERROR( "flex input buffer overflowed" ); X X yy_c_buf_p = yy_e_buf_p; X } X X else if ( yy_saw_eof ) X { Xsaweof: if ( yy_b_buf_p > yy_e_buf_p ) X { X if ( yywrap() ) X { X yy_act = YY_END_TOK; X goto do_action; X } X X else X { X YY_INIT; X yy_act = YY_NEW_FILE; X goto do_action; X } X } X X else /* do a jam to eat up more input */ X { X#ifndef FLEX_INTERACTIVE_SCANNER X /* we're going to decrement yy_c_buf_p upon doing X * the jam. In this case, that's wrong, since X * it points to the last non-jam character. So X * we increment it now to counter the decrement. X */ X ++yy_c_buf_p; X#endif X break; X } X } X X YY_INPUT( (yy_ch_buf + yy_c_buf_p + 1), yy_n_chars, X YY_MAX_LINE ); X X if ( yy_n_chars == YY_NULL ) X { X if ( yy_saw_eof ) X YY_FATAL_ERROR( "flex scanner saw EOF twice - shouldn't happen" ); X yy_saw_eof = 1; X goto saweof; X } X X yy_e_buf_p += yy_n_chars; X } X X ++yy_c_buf_p; X X#ifdef FLEX_USE_ECS X yy_sym = e[(yy_ch_buf[yy_c_buf_p] & BYTEMASK)]; X#else X yy_sym = yy_ch_buf[yy_c_buf_p]; X#endif X X#ifdef FLEX_FULL_TABLE X yy_curst = n[yy_curst][yy_sym]; X X#else /* get next state from compressed table */ X X while ( c[b[yy_curst] + yy_sym] != yy_curst ) X { X yy_curst = d[yy_curst]; X X#ifdef FLEX_USE_MECS X /* we've arrange it so that templates are never chained X * to one another. This means we can afford make a X * very simple test to see if we need to convert to X * yy_sym's meta-equivalence class without worrying X * about erroneously looking up the meta-equivalence X * class twice X */ X X if ( yy_curst >= YY_TEMPLATE ) X yy_sym = m[yy_sym]; X#endif X } X X yy_curst = n[b[yy_curst] + yy_sym]; X X#endif X X yy_st_buf[yy_c_buf_p] = yy_curst; X X } X#ifdef FLEX_INTERACTIVE_SCANNER X while ( b[yy_curst] != YY_JAM_BASE ); X#else X while ( yy_curst != YY_JAM ); X --yy_c_buf_p; /* put back character we jammed on */ X X#endif X X if ( yy_c_buf_p >= yy_b_buf_p ) X { /* we matched some text */ X yy_curst = yy_st_buf[yy_c_buf_p]; X yy_lp = l[yy_curst]; X X#ifdef FLEX_REJECT_ENABLED Xfind_rule: /* we branch to this label when doing a REJECT */ X#endif X X for ( ; ; ) /* until we find what rule we matched */ X { X#ifdef FLEX_REJECT_ENABLED X if ( yy_lp && yy_lp < l[yy_curst + 1] ) X { X yy_act = a[yy_lp]; X goto do_action; /* "continue 2" */ X } X#else X if ( yy_lp ) X { X yy_act = yy_lp; X goto do_action; /* "continue 2" */ X } X#endif X X if ( --yy_c_buf_p < yy_b_buf_p ) X break; X X yy_curst = yy_st_buf[yy_c_buf_p]; X yy_lp = l[yy_curst]; X } X } X X /* if we got this far, then we didn't find any accepting X * states X */ X X /* so that the default applies to the first char read */ X ++yy_c_buf_p; X X yy_act = YY_DO_DEFAULT; X } X } X X /*NOTREACHED*/ X } X X Xstatic int unput( c ) Xchar c; X X { X YY_DO_BEFORE_SCAN; /* undo effects of setting up yytext */ X X if ( yy_c_buf_p == 0 ) X { X register int i; X register int yy_buf_pos = YY_BUF_MAX; X X for ( i = yy_e_buf_p; i >= yy_c_buf_p; --i ) X { X yy_ch_buf[yy_buf_pos] = yy_ch_buf[i]; X yy_st_buf[yy_buf_pos] = yy_st_buf[i]; X --yy_buf_pos; X } X X yy_c_buf_p = YY_BUF_MAX - yy_e_buf_p; X yy_e_buf_p = YY_BUF_MAX; X } X X if ( yy_c_buf_p <= 0 ) X YY_FATAL_ERROR( "flex scanner push-back overflow" ); X X if ( yy_c_buf_p >= yy_b_buf_p && yy_ch_buf[yy_c_buf_p] == '\n' ) X yy_ch_buf[yy_c_buf_p - 1] = '\n'; X X yy_ch_buf[yy_c_buf_p--] = c; X X YY_DO_BEFORE_ACTION; /* set up yytext again */ X } X X Xstatic int input() X X { X int c; X X YY_DO_BEFORE_SCAN X X if ( yy_c_buf_p == yy_e_buf_p ) X { /* need more input */ X int yy_n_chars; X X /* we can throw away the entire current buffer */ X if ( yy_saw_eof ) X { X if ( yywrap() ) X return ( EOF ); X X YY_INIT; X } X X yy_b_buf_p = 0; X YY_INPUT( yy_ch_buf, yy_n_chars, YY_MAX_LINE ); X X if ( yy_n_chars == YY_NULL ) X { X yy_saw_eof = 1; X X if ( yywrap() ) X return ( EOF ); X X YY_INIT; X X return ( input() ); X } X X yy_c_buf_p = -1; X yy_e_buf_p = yy_n_chars - 1; X } X X c = yy_ch_buf[++yy_c_buf_p]; X X YY_DO_BEFORE_ACTION; X X return ( c & BYTEMASK); X } SHAR_EOF if test 6916 -ne "`wc -c < 'flex.skel'`" then echo shar: error transmitting "'flex.skel'" '(should have been 6916 characters)' fi fi # end of overwriting check # End of shell archive exit 0 --- end of part 1 ---