[comp.sources.misc] REPOST: v19i091: wacco - A C++ LL parser generator, Part04/06

parag@hpsdeb.sde.hp.com (Parag Patel) (05/19/91)

Submitted-by: Parag Patel <parag@hpsdeb.sde.hp.com>
Posting-number: Volume 19, Issue 91
Archive-name: wacco/part04

#!/bin/sh
# this is Part-.04 (part 4 of a multipart archive)
# do not concatenate these parts, unpack them in order with /bin/sh
# file wacco.doc.iw continued
#
if test ! -r _shar_seq_.tmp; then
	echo 'Please unpack part 1 first!'
	exit 1
fi
(read Scheck
 if test "$Scheck" != 4; then
	echo Please unpack part "$Scheck" next!
	exit 1
 else
	exit 0
 fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
	echo 'x - still skipping wacco.doc.iw'
else
echo 'x - continuing file wacco.doc.iw'
sed 's/^X//' << 'SHAR_EOF' >> 'wacco.doc.iw' &&
<
(Palatino) cf ><eop>
The second form introduces the ability to name (alias) one of the right-hand si
de's non-terminal names!  Here we name <ON it>expr1<IT type_rev> to be called <
ON it>front<IT type_rev> and <ON it>expr2<IT type_rev> to be <ON it>back<IT typ
e_rev> for just this particular right-hand side.<eop>
<eop>
<eop>
<(AvantGarde) cf ><14 cs><ON bo>More actions<(Palatino) cf ><SIZE type_rev><BO 
type_rev><eop>
<eop>
Since wacco generates a C++ recursive-descent parser, we can do even more inter
esting things on the right.  Wacco passes the local vars to store return values
X by reference.  Thus we can pass information into a rule as well as get stuff o
ut of it.<eop>
<eop>
<(Courier) cf ><tab>example: { $expr = $$; } '(' expr ')' { $$ = $expr; };<eop>
X
<(Palatino) cf ><eop>
This initializes the temp-var used to store the return value from <ON it>expr<I
T type_rev> to whatever was passed in to <ON it>example<IT type_rev> then passe
s it to <ON it>expr.<IT type_rev>  If a non-terminal never uses "<
(Courier) cf >$$<(Palatino) cf >", then it is assumed to not return anything, a
nd no temp-var will be declared nor passed into it.<eop>
<eop>
Other things that one can do:<eop>
<eop>
<(Courier) cf ><tab>example: '(' { int v = 2; } expr ')' { v = $expr; };<(Palat
ino) cf ><eop>
<(Courier) cf ><
(Palatino) cf ><eop>
and create temp C++ vars anywhere you want.  Wacco carefully avoids putting out
X unnecessary sets of blocks in the output parser file.<eop>
<eop>
To generate incomplete blocks, and allow a wierd sort of free-form grammar, the
X <
(Courier) cf >%{%}<(Palatino) cf > format may be used wherever a {} is normally
X used. This allows creating incomplete blocks:<eop>
<eop>
<(Courier) cf ><tab>example: '(' %{ if (somevar) { %} expr ')' %{ } %} ;<eop>
<(Palatino) cf ><eop>
Curly-braces are not counted within <(Courier) cf >%{%}<
(Palatino) cf > blocks, and <(Courier) cf >%{%}<(Palatino) cf > blocks may be u
sed wherever <(Courier) cf >{}<(Palatino) cf > blocks are allowed.<eop>
<eop>
<eop>
<
(AvantGarde) cf ><14 cs><ON bo>Empty symbol<SIZE type_rev><(Palatino) cf ><BO t
ype_rev><eop>
<eop>
The empty rule may not be implicitly specified is in yacc, but must be defined 
with the special "<(Courier) cf >[]<(Palatino) cf >" symbol:<eop>
<eop>
<(Courier) cf ><tab>null: [] ;<eop>
<tab>expr: '(' expr ')' | [] ;<eop>
<
(Palatino) cf ><eop>
An empty statement is an error in wacco to help protect against typos and other
X mistakes.<eop>
<eop>
<eop>
<(AvantGarde) cf ><14 cs><ON bo>Parenthesized expressions<(Palatino) cf ><SIZE 
type_rev><BO type_rev><eop>
<eop>
Right-hand sides may have parentheses for grouping.  Basically, a function must
X be generated for every parenthesized expression to maintain the parsing semant
ics:<eop>
<eop>
<(Courier) cf ><tab>value: (ID | INT) | [];<eop>
<(Palatino) cf ><eop>
is the equivalent of:<eop>
<eop>
<
(Courier) cf ><tab>value: v1 | [];<eop>
<tab>v1: ID | INT;<eop>
<(Palatino) cf ><eop>
Just like every other non-terminal, parenthesized expressions have return value
s, types, aliases, and may be referred to in other parts of the right-hand side
.  The default type is the type of the enclosing parens or left-hand side for t
he outer-most parens:<eop>
<eop>
<
(Courier) cf ><tab>example: (<la>long<ra> ID | INT) { $$ = $_; };<eop>
<(Palatino) cf ><eop>
Multiple sets of parens on the right may be referred to as<(Courier) cf > $_1<(
Palatino) cf >,<(Courier) cf > $_2<
(Palatino) cf >, and so on.  They may be named as well:<eop>
<eop>
<(Courier) cf ><tab>example<la>float<ra>: (ID | FLOAT)=num { $$ = $num; };<eop>
X
<(Palatino) cf ><eop>
Here the parenthesized expression <ON it>num<IT type_rev> inherits the type <(C
ourier) cf >float<(Palatino) cf > from <ON it>example<IT type_rev>.<eop>
<eop>
Since the left-hand side may be used on the right for recursive functions, so m
ay parenthesized expressions.  The names just get a little strange.<eop>
<eop>
<
(Courier) cf ><tab>strange: (ID (OP # #1 #2 #3 #* | []) | []);<eop>
<(Palatino) cf ><eop>
The inner "<(Courier) cf >#<(Palatino) cf >" refers to the inner-most set of pa
rens enclosing the "<(Courier) cf >OP...<
(Palatino) cf >".  The strings "<(Courier) cf >#<(Palatino) cf >" and "<(Courie
r) cf >#1<(Palatino) cf >" are equivalent and refer to this inner most set of p
arens.  "<
(Courier) cf >#2<(Palatino) cf >" refers to the next outer parens starting the 
"<(Courier) cf >ID...<(Palatino) cf >".  "<(Courier) cf >#3<
(Palatino) cf >" and "<(Courier) cf >#*<(Palatino) cf >" refer the the name of 
the left-hand side, just for completeness.  These can be viewed as the outermos
t "parens" in the expression.  Ugly but sometimes useful.<eop>
<eop>
<eop>
<(AvantGarde) cf ><14 cs><ON bo>Special tokens<(Palatino) cf ><SIZE type_rev><B
O type_rev><eop>
<eop>
Other things defined in <ON it>tokens.h<IT type_rev> include the end-of-input t
oken <ON it>EOI<IT type_rev> which has value 0, and the constants <ON it>RETOK<
IT type_rev> and <ON it>RETERR,<IT type_rev> for appropriate return values.  Th
ese have the values of <ON it>TRUE<IT type_rev> (1) and <ON it>FALSE<IT type_re
v> (0) respectively.  These may be used in the right-hand side of rules if it i
s determined that further parsing of rules is un-necessary.<eop>
<eop>
<
(Courier) cf ><tab>parenexpr: LPAREN expr<eop>
<tab><tab>{ if ($expr == BOGUS) return RETERR; } RPAREN;<eop>
<(Palatino) cf ><eop>
The return-code from various rules is always available as the magic string "<(C
ourier) cf >$?<(Palatino) cf >" directly after that particular rule is called:<
eop>
<eop>
<(Courier) cf ><tab>parenexpr: LPAREN expr<eop>
<tab><tab>{ if ($? != RETOK) return RETERR; } RPAREN;<eop>
<
(Palatino) cf ><eop>
The return code is overwritten with each call to a non-terminal on the right-ha
nd side, so if a previous return value is needed, you must save it in some vari
able yourself. The generated parser code does not look at the actual return val
ue of non-terminals (functions), so other return values may be used if desired.
<eop>
<eop>
<(AvantGarde) cf ><14 cs><ON bo>Start symbols<(Palatino) cf ><SIZE type_rev><BO
X type_rev><eop>
<eop>
By default, the first rule in the grammar is considered to be the start symbol.
X  Instead of calling <
(Courier) cf >yyparse()<(Palatino) cf > to initiate the parse, the function to 
call is the name of the left-hand <ON it>ID<IT type_rev> in the first rule.  It
X is called with no arguments.  It returns either <ON it>RETOK<IT type_rev> or <
ON it>RETERR<IT type_rev> depending on whether the parse succeeded or not.<eop>
X
<eop>
<(Courier) cf ><tab>firstsymbol: ... ;<eop>
<tab>...<eop>
<eop>
<tab>main()<eop>
<tab>{<eop>
<tab><tab>if (firstsymbol() == RETOK)<eop>
<tab><tab><tab>return 0;<eop>
<tab><tab>return -1;<eop>
<tab>}<eop>
<(Palatino) cf ><eop>
But you don't have to have just one entry point!  Adding a "<(Courier) cf >%exp
ort<
(Palatino) cf >" modifier after a non-terminal just before the "<(Courier) cf >
:<(Palatino) cf >" causes that symbol to become callable from outside the gramm
ar:<eop>
<eop>
<(Courier) cf ><tab>thing<la>type<ra> %export :  ...  ;<eop>
<eop>
<(Palatino) cf >And in some another source file:<eop>
<
(Courier) cf ><eop>
<tab>func() { type var;  return thing(var); }<eop>
<(Palatino) cf ><eop>
The first non-terminal in the grammar is automatically exported unless <(Courie
r) cf >%export<(Palatino) cf > is used somewhere in the grammar.  Also, notice 
that if a <ON it>type<IT type_rev> is defined and used for a non-terminal, that
X <ON it>type<IT type_rev> must be passed in by reference to that function.<eop>
X
<eop>
The <(Courier) cf >%export<
(Palatino) cf > feature lets you call several non-terminals in the grammar.  Th
is can be used to export parts of a grammar, say sub-expression parsing, or let
X you put several different parsers into one grammar file.  All exported non-ter
minals are also listed as "<
(Courier) cf >extern<(Palatino) cf >"s in the <ON it>tokens.h<IT type_rev> head
er file.<eop>
<eop>
Also remember that <ON it>type<IT type_rev> must be a simple type and not a com
plex struct for a start symbol.<pe><eop>
<CENTER align><16 cs><(AvantGarde) cf ><ON bo>Scanning<SIZE type_rev><(Palatino
) cf ><BO type_rev><eop>
<ALIGN para_rev><eop>
<eop>
The scanner section is optional.  If there is a "<(Courier) cf >$$<
(Palatino) cf >" at the end of the file, the rest is considered to be almost st
raight <ON it>lex(1)<IT type_rev> source.  If there is a "<(Courier) cf >$$<(Pa
latino) cf >", every terminal must have a lexical value associated with it.  Ch
aracter and string constants are self-defining.  Other non-terminals need to be
X described in the lex section.<eop>
<eop>
An example wacco source file with scanner:<eop>
<eop>
<(Courier) cf ><tab>expr: LPAREN expr RPAREN | "id" | [];<eop>
<eop>
<tab>$$<eop>
<eop>
<tab>%%<eop>
<eop>
<tab>"."<tab><tab>{ return (int)EOI; }<eop>
<eop>
<tab>$LPAREN<tab><tab>"("|"["<eop>
<tab>$RPAREN<tab><tab>")"|"]"<eop>
<eop>
<tab>[ \t\v\n\f]<tab>;<eop>
<tab>.  { w_scanerr("Illegal character %d (%c)",<eop>
<tab><tab>yytext[0], yytext[0]); }<eop>
<(Palatino) cf ><eop>
The string "<
(Courier) cf >id<(Palatino) cf >" naturally stands for itself.  <ON it>LPAREN<I
T type_rev> and <ON it>RPAREN<IT type_rev> are described in the lex section in 
reverse order from a normal lex file.  Wacco will convert those lines starting 
with a "<(Courier) cf >$<(Palatino) cf >" into the appropriate lex output. This
X is not only to make sure that all terminals are defined, but allows defining a
X language without ever having to manually define token ids for any terminal sym
bol!<eop>
<eop>
<eop>
<
(AvantGarde) cf ><14 cs><ON bo>Default scanner<(Palatino) cf ><SIZE type_rev><B
O type_rev><eop>
<eop>
The default scanner (located in -lwacco) maintains its own I/O file pointer.  T
his is so that user code can implement the equivalent of "<(Courier) cf >#inclu
de<(Palatino) cf >" without too much work.  The functions in the scanner includ
e:<eop>
<eop>
<tab><(Courier) cf >int w_openfile(char *fname)<
(Palatino) cf ><tab>// open a file to the specified name<eop>
<tab><(Courier) cf >void w_closefile()<(Palatino) cf ><tab><tab>// close the la
st opened file<eop>
<tab><(Courier) cf >void w_setfile(FILE *f)<(Palatino) cf ><tab>// set the curr
ent file to this<eop>
<tab><
(Courier) cf >FILE *w_getfile()<(Palatino) cf ><tab><tab>// return the currentl
y opened file<eop>
<tab><(Courier) cf >int w_currcol()<(Palatino) cf ><tab><tab>// the current col
umn in the input<eop>
<tab><(Courier) cf >int w_currline()<
(Palatino) cf ><tab><tab>// the current line in the input<eop>
<tab><(Courier) cf >char *w_getcurrline()<(Palatino) cf ><tab>// the text of th
e current line<eop>
<tab><(Courier) cf >int w_input()<tab><(Palatino) cf ><tab>// basic I/O routine
s which are<eop>
<tab><
(Courier) cf >int w_unput(int c)<(Palatino) cf ><tab><tab>//          to be use
d by the scanner<eop>
<tab><(Courier) cf >void w_output(int c)<(Palatino) cf ><eop>
<eop>
You should call either <(Courier) cf >w_setfile()<
(Palatino) cf > or <(Courier) cf >w_openfile()<(Palatino) cf > before starting 
the parse or the default scanner will probably dump core.<eop>
<eop>
<eop>
<
(AvantGarde) cf ><14 cs><ON bo>Parser's requirements<(Palatino) cf ><SIZE type_
rev><BO type_rev><eop>
<eop>
The functions that the parser expects to have available are:<eop>
<eop>
<tab><(Courier) cf >int w_gettoken()<(Palatino) cf ><tab><tab>// get the next t
oken - usually calls yylex()<eop>
<tab><tab><tab><tab>// - must return <ON it>EOI<IT type_rev> on end-of-input<eo
p>
<eop>
<tab><(Courier) cf >int w_scanerr()<
(Palatino) cf ><tab><tab>// printf-type error printing routine<eop>
<tab><tab><tab><tab>// - must always returns <ON it>RETERR<IT type_rev><eop>
<tab><tab><tab><tab>// - is called with a <ON it>NULL<IT type_rev> argument<eop
>
<tab><tab><tab><tab>// when just skipping a token in the input<eop>
<eop>
These are either are in the wacco library -lwacco, or must be provided by the u
ser.<eop>
<eop>
The default <(Courier) cf >w_scanerr()<(Palatino) cf > will try to print the li
ne that had the error, and underneath it print "<(Courier) cf >^<(Palatino) cf 
>" where the error occurred and "<
(Courier) cf >*<(Palatino) cf >" where tokens were skipped when re-syncing.  Be
cause of some lex(1) funnies, this doesn't always work as expected.<eop>
<eop>
<eop>
<(AvantGarde) cf ><14 cs><ON bo>Parser functions<(Palatino) cf ><SIZE type_rev>
<BO type_rev><eop>
<eop>
Some other convenient functions defined in <ON it>parser.C<IT type_rev> include
:<eop>
<eop>
<tab><(Courier) cf >int w_nexttoken(<
(Palatino) cf >)<tab>// return the value of the next token but don't<eop>
<tab><tab><tab>// scan it yet - calls <(Courier) cf >w_gettoken()<(Palatino) cf
X > at most once<eop>
<tab><tab><tab>// - useful for token look-ahead<eop>
<eop>
<tab><(Courier) cf >void w_skiptoken()<(Palatino) cf ><tab>// scan the current 
token - the next call to<eop>
<tab><tab><tab>// <
(Courier) cf >w_nexttoken()<(Palatino) cf > will actually read another token<eo
p>
<eop>
<tab><(Courier) cf >char *w_tokenname(int tokid)<(Palatino) cf ><tab>// return 
the string name of a token<eop>
<tab><tab><tab><tab>// whose id is tokid<eop>
<eop>
These are only really useful if you are writing your own scanner instead of usi
ng lex.  <(Courier) cf >w_nexttoken()<
(Palatino) cf > and <(Courier) cf >w_skiptoken()<(Palatino) cf > can also be us
ed to somewhat direct the parse.  If you provide your own infinite push-back st
ack of tokens, you can completely alter the parse at run-time!<eop>
<eop>
<eop>
<(AvantGarde) cf ><14 cs><ON bo>Flex<(Palatino) cf ><SIZE type_rev><BO type_rev
><eop>
<eop>
The program <ON it>flex(1)<IT type_rev> may be used instead of <ON it>lex(1)<IT
X type_rev> if desired, and is highly recommended.<eop>
<eop>
The extern for "<
(Courier) cf >yytext<(Palatino) cf >" is automatically declared in <ON it>parse
r.C<IT type_rev>. Unfortunately, it may be wrong for the scanner generator actu
ally being used.  To change the definition, the macro <ON it>YYTEXT_DECL<IT typ
e_rev> may be redefined at the top of your wacco grammar if you wish to use fle
x:<eop>
<eop>
<(Courier) cf ><tab>{<eop>
<tab>#undef YYTEXT_DECL<eop>
<tab>#define YYTEXT_DECL char *yytext<eop>
<tab>}<eop>
<tab>...<eop>
<(Palatino) cf ><eop>
<pe><eop>
<CENTER align><CENTER align><(AvantGarde) cf ><ON bo> <16 cs>Example Wacco Gram
mar<SIZE type_rev><eop>
<ALIGN para_rev><
(Palatino) cf ><BO type_rev><eop>
<eop>
// This is the usual required calculator sample.  It can still use<eop>
// a LOT of work, but it illustrates the basics.  Note that the<eop>
// precedence of operators is all wrong.<eop>
<eop>
<
(Courier) cf >{<eop>
#include <la>stdio.h<ra><eop>
#include <la>stdlib.h<ra><eop>
}<eop>
<eop>
calc<eop>
<tab>:<tab>%{<eop>
<tab><tab><tab>while (w_nexttoken() != EOI) {<eop>
<tab><tab>%}<eop>
<tab><tab>expr ([] | '=' | ';' | ',')<eop>
<tab><tab>%{<eop>
<tab><tab><tab>printf("%f\n", $expr);<eop>
<tab><tab><tab>}<eop>
<tab><tab>%}<eop>
<tab>| []<eop>
<tab>;<eop>
<eop>
expr<la>double<ra><eop>
<tab>:<tab>term { $binop_expr = $term; }<eop>
<tab><tab><tab>binop_expr { $$ = $binop_expr; }<eop>
<tab>;<eop>
<eop>
binop_expr<la>double<ra><eop>
<tab>:<tab>'+' expr { $$ += $expr; }<eop>
<tab>|<tab>'-' expr { $$ -= $expr; }<eop>
<tab>|<tab>'*' expr { $$ *= $expr; }<eop>
<tab>|<tab>'/' expr { $$ /= $expr; }<eop>
<tab>|<tab>'&' expr { $$ = (int)$$ & (int)$expr; }<eop>
<tab>|<tab>'|' expr { $$ = (int)$$ | (int)$expr; }<eop>
<tab>|<tab>'^' expr { $$ = (int)$$ ^ (int)$expr; }<eop>
<tab>|<tab>"<la><la>" expr { $$ = (int)$$ <la><la> (int)$expr; }<eop>
<tab>|<tab>"<ra><ra>" expr { $$ = (int)$$ <ra><ra> (int)$expr; }<eop>
<tab>|<tab>"&&" expr { $$ = $$ && $expr; }<eop>
<tab>|<tab>"||" expr { $$ = $$ || $expr; }<eop>
<tab>|<tab>[]<eop>
<tab>;<eop>
<eop>
term<la>double<ra><eop>
<tab>:<tab>DOUBLE { $$ = atof((char *)yytext); }<eop>
<tab>|<tab>'-' expr { $$ = -$expr; }<eop>
<tab>|<tab>'~' expr { $$ = ~(int)$expr; }<eop>
<tab>|<tab>'!' expr { $$ = !$expr; }<eop>
<tab>|<tab>'(' expr ')' { $$ = $expr; }<eop>
<tab>;<eop>
<eop>
{<eop>
<tab>main()<eop>
<tab>{<eop>
<tab><tab>w_setfile(stdin);<eop>
<tab><tab>calc();<eop>
<tab>}<eop>
}<eop>
<eop>
$$<eop>
<eop>
D<tab>[0-9]<eop>
L<tab>[_A-Za-z]<eop>
<eop>
%%<eop>
<eop>
"."<tab><tab>{ return (int)EOI; }<eop>
<eop>
$DOUBLE<tab>({D}+)|({D}+\.{D}+)|({D}+[Ee]-?{D}+)|({D}+\.{D}+[Ee]-?{D}+)<eop>
<eop>
"#".*$<tab><tab>;<eop>
<eop>
[ \t\v\n\f]<tab>;<eop>
.<tab>{ w_scanerr("Illegal character %d ($c)", yytext[0], yytext[0]); }<eop>
X
<textstream_end> 5580 1725 7080 1725 
0 100 -1 0 0 0 0 (2) 7 
rule 
X
POLY_OBJECT POLY_TEXT |  DefPolyType 
X
0 DefLineWidth TRANSPARENT DefPenColor TRANSPARENT DefFillColor 1 DefIG 300 
DefResolution 100 DefYScale 100 DefXScale (=default) DefPolyResId 1 
DefMasterRef 
X
MP_CPSUCC_LINK MP_CPPRED_LINK LINK_OVERFLOW MPREF_VALID POLY_COLUMN AUTO_STREAM | | | | | 
DefSLinksFlags 10 DefStreamSucc 5 DefStreamPred 6 DefTextHandle 
1440 1080 11160 1080 11160 14760 1440 14760 4 
POLY_OBJECT POLY_TEXT |  (3) 0 8 TextPolygon 5520 1710 7110 1710 
0 100 -1 0 0 0 0 (3) 9 
rule 
X
POLY_OBJECT POLY_TEXT |  DefPolyType 
X
0 DefLineWidth TRANSPARENT DefPenColor TRANSPARENT DefFillColor 1 DefIG 300 
DefResolution 100 DefYScale 100 DefXScale (=default) DefPolyResId 1 
DefMasterRef 
X
MP_CPSUCC_LINK MP_CPPRED_LINK LINK_OVERFLOW MPREF_VALID POLY_COLUMN AUTO_STREAM | | | | | 
DefSLinksFlags 12 DefStreamSucc 8 DefStreamPred 6 DefTextHandle 
1440 1080 11160 1080 11160 14760 1440 14760 4 
POLY_OBJECT POLY_TEXT |  (4) 0 10 TextPolygon 5910 1695 6720 1695 
0 100 -1 0 0 0 0 (4) 11 
rule 
X
POLY_OBJECT POLY_TEXT |  DefPolyType 
X
0 DefLineWidth TRANSPARENT DefPenColor TRANSPARENT DefFillColor 1 DefIG 300 
DefResolution 100 DefYScale 100 DefXScale (=default) DefPolyResId 1 
DefMasterRef 
X
MP_CPSUCC_LINK MP_CPPRED_LINK LINK_OVERFLOW MPREF_VALID POLY_COLUMN AUTO_STREAM | | | | | 
DefSLinksFlags 13 DefStreamSucc 10 DefStreamPred 6 DefTextHandle 
1440 1080 11160 1080 11160 14760 1440 14760 4 
POLY_OBJECT POLY_TEXT |  (5) 0 12 TextPolygon 
X
POLY_OBJECT POLY_TEXT |  DefPolyType 
X
0 DefLineWidth TRANSPARENT DefPenColor TRANSPARENT DefFillColor 1 DefIG 300 
DefResolution 100 DefYScale 100 DefXScale (=default) DefPolyResId 1 
DefMasterRef 
X
MP_CPSUCC_LINK MP_CPPRED_LINK LINK_OVERFLOW MPREF_VALID POLY_COLUMN AUTO_STREAM | | | | | 
DefSLinksFlags 14 DefStreamSucc 12 DefStreamPred 6 DefTextHandle 
1440 1080 11160 1080 11160 14760 1440 14760 4 
POLY_OBJECT POLY_TEXT |  (6) 0 13 TextPolygon 
X
POLY_OBJECT POLY_TEXT |  DefPolyType 
X
0 DefLineWidth TRANSPARENT DefPenColor TRANSPARENT DefFillColor 1 DefIG 300 
DefResolution 100 DefYScale 100 DefXScale (=default) DefPolyResId 1 
DefMasterRef 
X
MP_CPSUCC_LINK MP_CPPRED_LINK LINK_OVERFLOW MPREF_VALID POLY_COLUMN AUTO_STREAM | | | | | 
DefSLinksFlags 15 DefStreamSucc 13 DefStreamPred 6 DefTextHandle 
1440 1080 11160 1080 11160 14760 1440 14760 4 
POLY_OBJECT POLY_TEXT |  (7) 0 14 TextPolygon 
X
POLY_OBJECT POLY_TEXT |  DefPolyType 
X
0 DefLineWidth TRANSPARENT DefPenColor TRANSPARENT DefFillColor 1 DefIG 300 
DefResolution 100 DefYScale 100 DefXScale (=default) DefPolyResId 1 
DefMasterRef 
X
MP_CPSUCC_LINK MP_CPPRED_LINK LINK_OVERFLOW MPREF_VALID POLY_COLUMN AUTO_STREAM | | | | | 
DefSLinksFlags 16 DefStreamSucc 14 DefStreamPred 6 DefTextHandle 
1440 1080 11160 1080 11160 14760 1440 14760 4 
POLY_OBJECT POLY_TEXT |  (8) 0 15 TextPolygon 
X
POLY_OBJECT POLY_TEXT |  DefPolyType 
X
0 DefLineWidth TRANSPARENT DefPenColor TRANSPARENT DefFillColor 1 DefIG 300 
DefResolution 100 DefYScale 100 DefXScale (=default) DefPolyResId 1 
DefMasterRef 
X
MP_CPSUCC_LINK MP_CPPRED_LINK LINK_OVERFLOW MPREF_VALID POLY_COLUMN AUTO_STREAM | | | | | 
DefSLinksFlags 17 DefStreamSucc 15 DefStreamPred 6 DefTextHandle 
1440 1080 11160 1080 11160 14760 1440 14760 4 
POLY_OBJECT POLY_TEXT |  (9) 0 16 TextPolygon 
X
POLY_OBJECT POLY_TEXT |  DefPolyType 
X
0 DefLineWidth TRANSPARENT DefPenColor TRANSPARENT DefFillColor 1 DefIG 300 
DefResolution 100 DefYScale 100 DefXScale (=default) DefPolyResId 1 
DefMasterRef 
X
MP_CPSUCC_LINK MP_CPPRED_LINK LINK_OVERFLOW MPREF_VALID POLY_COLUMN AUTO_STREAM | | | | | 
DefSLinksFlags 19 DefStreamSucc 16 DefStreamPred 6 DefTextHandle 
1440 1080 11160 1080 11160 14760 1440 14760 4 
POLY_OBJECT POLY_TEXT |  (10) 0 17 TextPolygon 5580 1725 7020 1725 
0 100 -1 0 0 0 0 (10) 18 
rule 
X
POLY_OBJECT POLY_TEXT |  DefPolyType 
X
0 DefLineWidth TRANSPARENT DefPenColor TRANSPARENT DefFillColor 1 DefIG 300 
DefResolution 100 DefYScale 100 DefXScale (=default) DefPolyResId 1 
DefMasterRef 
X
MP_CPSUCC_LINK MP_CPPRED_LINK LINK_OVERFLOW MPREF_VALID POLY_COLUMN AUTO_STREAM | | | | | 
DefSLinksFlags 20 DefStreamSucc 17 DefStreamPred 6 DefTextHandle 
1440 1080 11160 1080 11160 14760 1440 14760 4 
POLY_OBJECT POLY_TEXT |  (11) 0 19 TextPolygon 
X
POLY_OBJECT POLY_TEXT |  DefPolyType 
X
0 DefLineWidth TRANSPARENT DefPenColor TRANSPARENT DefFillColor 1 DefIG 300 
DefResolution 100 DefYScale 100 DefXScale (=default) DefPolyResId 1 
DefMasterRef 
X
MP_CPSUCC_LINK MP_CPPRED_LINK LINK_OVERFLOW MPREF_VALID POLY_COLUMN AUTO_STREAM | | | | | 
DefSLinksFlags 21 DefStreamSucc 19 DefStreamPred 6 DefTextHandle 
1440 1080 11160 1080 11160 14760 1440 14760 4 
POLY_OBJECT POLY_TEXT |  (12) 0 20 TextPolygon 
X
POLY_OBJECT POLY_TEXT |  DefPolyType 
X
0 DefLineWidth TRANSPARENT DefPenColor TRANSPARENT DefFillColor 1 DefIG 300 
DefResolution 100 DefYScale 100 DefXScale (=default) DefPolyResId 1 
DefMasterRef 
X
MP_CPSUCC_LINK MP_CPPRED_LINK LINK_OVERFLOW MPREF_VALID POLY_COLUMN AUTO_STREAM | | | | | 
DefSLinksFlags 23 DefStreamSucc 20 DefStreamPred 6 DefTextHandle 
1440 1080 11160 1080 11160 14760 1440 14760 4 
POLY_OBJECT POLY_TEXT |  (13) 0 21 TextPolygon 4260 1725 8415 1725 
0 100 -1 0 0 0 0 (13) 22 
rule 
X
POLY_OBJECT POLY_TEXT |  DefPolyType 
X
0 DefLineWidth TRANSPARENT DefPenColor TRANSPARENT DefFillColor 1 DefIG 300 
DefResolution 100 DefYScale 100 DefXScale (=default) DefPolyResId 1 
DefMasterRef 
MP_CPSUCC_LINK MP_CPPRED_LINK MPREF_VALID POLY_COLUMN AUTO_STREAM | | | |  
DefSLinksFlags 0 DefStreamSucc 21 DefStreamPred 6 DefTextHandle 
1440 1080 11160 1080 11160 14760 1440 14760 4 
POLY_OBJECT POLY_TEXT |  (14) 0 23 TextPolygon 
X
BeginProfile 
(Number of Pages) (14)  DefProfileString 
(Language) (ENGLISH)  DefProfileString 
(Version) (IslandWrite Version 2.1)  DefProfileString 
(Creation Date) (31.July.1990 16:31)  DefProfileString 
(Revision History) (parag May 17, 1991 4:26 PM)  DefProfileString 
(Revision History) (parag May 17, 1991 4:22 PM)  DefProfileString 
(Revision History) (parag February 21, 1991 5:06 PM)  DefProfileString 
(Revision History) (parag February 21, 1991 5:05 PM)  DefProfileString 
(Revision History) (February 21, 1991 3:02 PM)  DefProfileString 
(Revision History) (.August.1990 15:43)  DefProfileString 
(Revision History) (.August.1990 15:32)  DefProfileString 
(Revision History) (.August.1990 14:40)  DefProfileString 
(Revision History) (.August.1990 14:37)  DefProfileString 
(Revision History) (.August.1990 14:37)  DefProfileString 
(Revision History) (.August.1990 14:31)  DefProfileString 
(Revision History) (.August.1990 14:28)  DefProfileString 
(Revision History) (.August.1990 14:27)  DefProfileString 
(Revision History) (.August.1990 14:26)  DefProfileString 
(Revision History) (.August.1990 14:26)  DefProfileString 
(Revision History) (.August.1990 14:23)  DefProfileString 
(Revision History) (.August.1990 14:18)  DefProfileString 
(Revision History) (.August.1990 14:17)  DefProfileString 
(Revision History) (.August.1990 14:16)  DefProfileString 
(Revision History) (.August.1990 14:12)  DefProfileString 
(Revision History) (.August.1990 17:42)  DefProfileString 
(Revision History) (.August.1990 17:08)  DefProfileString 
(Revision History) (.August.1990 16:45)  DefProfileString 
(Revision History) (.August.1990 16:12)  DefProfileString 
(Revision History) (.August.1990 14:58)  DefProfileString 
(Revision History) (.August.1990 14:58)  DefProfileString 
(Revision History) (.August.1990 14:55)  DefProfileString 
(Revision History) (.August.1990 14:55)  DefProfileString 
(Revision History) (.August.1990 14:55)  DefProfileString 
(Revision History) (.August.1990 14:54)  DefProfileString 
(Revision History) (.August.1990 14:53)  DefProfileString 
(Revision History) (.August.1990 14:52)  DefProfileString 
(Revision History) (.August.1990 14:47)  DefProfileString 
(Revision History) (.August.1990 14:41)  DefProfileString 
(Revision History) (.August.1990 14:38)  DefProfileString 
(Revision History) (.August.1990 14:38)  DefProfileString 
(Revision History) (.August.1990 14:37)  DefProfileString 
(Revision History) (.August.1990 14:34)  DefProfileString 
(Revision History) (.August.1990 14:20)  DefProfileString 
(Revision History) (.August.1990 14:13)  DefProfileString 
(Revision History) (.August.1990 14:04)  DefProfileString 
(Revision History) (.August.1990 13:35)  DefProfileString 
(Revision History) (.August.1990 13:29)  DefProfileString 
(Revision History) (.August.1990 13:28)  DefProfileString 
(Revision History) (.August.1990 12:00)  DefProfileString 
(Revision History) (.August.1990 11:56)  DefProfileString 
(Revision History) (.August.1990 11:55)  DefProfileString 
(Revision History) (.August.1990 11:52)  DefProfileString 
(Revision History) (.August.1990 11:51)  DefProfileString 
(Revision History) (.August.1990 11:48)  DefProfileString 
(Revision History) (.August.1990 11:44)  DefProfileString 
(Revision History) (31.July.1990 17:29)  DefProfileString 
(Revision History) (31.July.1990 17:28)  DefProfileString 
(Revision History) (31.July.1990 17:24)  DefProfileString 
(Revision History) (31.July.1990 17:22)  DefProfileString 
(Revision History) (31.July.1990 17:19)  DefProfileString 
(Revision History) (31.July.1990 17:18)  DefProfileString 
(Revision History) (31.July.1990 17:15)  DefProfileString 
(Revision History) (31.July.1990 17:14)  DefProfileString 
(Revision History) (31.July.1990 17:11)  DefProfileString 
(Revision History) (31.July.1990 17:11)  DefProfileString 
(Revision History) (31.July.1990 17:10)  DefProfileString 
(Revision History) (31.July.1990 17:08)  DefProfileString 
(Revision History) (31.July.1990 17:07)  DefProfileString 
(Revision History) (31.July.1990 17:05)  DefProfileString 
(Revision History) (31.July.1990 16:54)  DefProfileString 
(Revision History) (31.July.1990 16:48)  DefProfileString 
(Revision History) (31.July.1990 16:40)  DefProfileString 
(Revision History) (31.July.1990 16:37)  DefProfileString 
(Revision History) (31.July.1990 16:35)  DefProfileString 
(Revision History) (31.July.1990 16:34)  DefProfileString 
(Revision History) (31.July.1990 16:31)  DefProfileString 
(Text Formats) (default)  DefProfileString 
(Container Formats) (default)  DefProfileString 
(Page Formats) (default)  DefProfileString 
(Fonts) (AvantGarde)  DefProfileString 
(Fonts) (Palatino)  DefProfileString 
(Fonts) (Courier)  DefProfileString 
(Fonts) (Times-Roman)  DefProfileString 
(File Path) ()  DefProfileString 
(External Contents) ()  DefProfileString 
(Title) ()  DefProfileString 
(Status) ()  DefProfileString 
(Distribution List) ()  DefProfileString 
(Preparer) ()  DefProfileString 
(Owner) ()  DefProfileString 
(Author) ()  DefProfileString 
(Superseded Documents) ()  DefProfileString 
EndProfile 
X
pgscriptdone 
SHAR_EOF
echo 'File wacco.doc.iw is complete' &&
chmod 0444 wacco.doc.iw ||
echo 'restore of wacco.doc.iw failed'
Wc_c="`wc -c < 'wacco.doc.iw'`"
test 42897 -eq "$Wc_c" ||
	echo 'wacco.doc.iw: original size 42897, current size' "$Wc_c"
rm -f _shar_wnt_.tmp
fi
# ============= wacco.doc.ps ==============
if test -f 'wacco.doc.ps' -a X"$1" != X"-c"; then
	echo 'x - skipping wacco.doc.ps (File already exists)'
	rm -f _shar_wnt_.tmp
else
> _shar_wnt_.tmp
echo 'x - extracting wacco.doc.ps (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'wacco.doc.ps' &&
%! ISLANDWRITE prolog Version 2.1
%%
/BLACK { 0.0 } bind def
/CP {closepath} bind def
/FI {eofill} bind def
/E {exch} bind def
/FF {findfont} bind def
/GR {grestore} bind def
/GS {gsave} bind def
/MF {makefont} bind def
/NP {newpath} bind def
/RO {rotate} bind def
/ST {stroke} bind def
/SC {scale} bind def
/SF {setfont} bind def
/SG {setgray} bind def
/SLC {setlinecap} bind def
/SLJ {setlinejoin} bind def
/SLW {setlinewidth} bind def
/TR {translate} bind def
/WHITE { 1.0 } bind def
/m {moveto} bind def
/r {rmoveto} bind def
/l {lineto} bind def
/sp {x 0 rmoveto} bind def
/rl {rlineto} bind def
/s {show} bind def
/box { NP m l l l CP } bind def
/pageboundary { NP m l l l CP } bind def
/BS {   % black stroke
GS SLJ SLW BLACK SG ST GR
} bind def
/WS {   % white stroke
GS SLJ SLW WHITE SG ST GR
} bind def
/reencode_small_dict 12 dict def
/ReencodeSmall {
reencode_small_dict begin
/new_codes_and_names E def
/new_font_name E def
/base_font_name E def
/base_font_dict base_font_name FF def
/newfont base_font_dict maxlength dict def
base_font_dict {
E dup /FID ne
{ dup /Encoding eq
{ E dup length array copy newfont 3 1 roll put }
{ E newfont 3 1 roll put }
ifelse
}
{ pop pop }
ifelse
} forall
newfont /FontName new_font_name put
new_codes_and_names aload pop
new_codes_and_names length 2 idiv
{ newfont /Encoding get 3 1 roll put }
repeat
new_font_name newfont definefont pop
end     %reencode_small_dict
} def
/extended_Zapf [
8#223 /a89
8#224 /a90
8#225 /a93
8#226 /a94
8#227 /a91
8#230 /a92
8#231 /a205
8#232 /a85
8#233 /a206
8#234 /a86
8#235 /a87
8#236 /a88
8#237 /a95
8#240 /a96
] def
/extended_Standard [
128 /Acircumflex
129 /Adieresis
130 /Agrave
131 /Aring
132 /Atilde
133 /Ccedilla
134 /Eacute
135 /Ecircumflex
136 /Edieresis
137 /Egrave
138 /Iacute
139 /Icircumflex
140 /Idieresis
141 /Igrave
142 /Ntilde
143 /Oacute
144 /Ocircumflex
145 /Odieresis
146 /Ograve
147 /Otilde
148 /Scaron
149 /Uacute
150 /Ucircumflex
151 /Udieresis
152 /Ugrave
153 /Ydieresis
154 /Zcaron
155 /aacute
156 /acircumflex
157 /adieresis
158 /agrave
159 /aring
160 /atilde
209 /ccedilla
210 /copyright
211 /eacute
212 /ecircumflex
213 /edieresis
214 /egrave
215 /iacute
216 /icircumflex
217 /idieresis
218 /igrave
219 /logicalnot
220 /minus
221 /ntilde
222 /oacute
223 /ocircumflex
224 /odieresis
228 /ograve
229 /otilde
230 /registered
231 /scaron
236 /trademark
237 /uacute
238 /ucircumflex
239 /udieresis
240 /ugrave
242 /ydieresis
243 /zcaron
244 /Aacute
] def
/extended_Symbol [
] def
/extend_font {  % stack: fontname newfontname
E dup (ZapfDingbats) eq
{ cvn E cvn extended_Zapf ReencodeSmall }
{ dup (Symbol) eq
{ cvn E cvn extended_Symbol ReencodeSmall }
{ cvn E cvn extended_Standard ReencodeSmall }
ifelse
}
ifelse
} bind def
/getfont {
/f E def f cvn where
{ begin f cvx cvn exec SF end }
% { f 0 f length 8 sub getinterval (LocalFont) extend_font
%/LocalFont FF
{ f 0 f length 8 sub getinterval dup
dup length 1 add string /localfont exch def
localfont exch 0 exch putinterval
localfont dup length 1 sub (X) putinterval
localfont extend_font
localfont FF
/xsz f f length 4 sub 4 getinterval cvi def
/ysz f f length 8 sub 4 getinterval cvi def
[ xsz 0 0 ysz neg 0 0 ] MF dup f cvn E def
SF
}
ifelse
} bind def
/ul { % space drop thickness
GS currentpoint currentlinewidth 
currentpoint NP m 6 -3 roll 
SLW 0 E r
0 rl ST SLW m
GR 
} bind def
/ss { currentpoint pop E m } bind def
/image_raster { % sw sh dw dh xs ys
TR SC /sh E def /sw E def
/imagebuf sw 7 add 8 idiv string def
sw sh 1 [sw 0 0 sh 0 0] { currentfile imagebuf readhexstring pop }
image
} bind def
/nx { /x E def } bind def
0. nx
%%EndFixedProlog
X
save /vm_state E def [1 0 0 -1 0 0] concat 0.050000 0.050000 SC .5 SLW
0 -15840 TR 0 RO
0 0 0 15840 12240 15840 12240 0 pageboundary clip
userdict /#copies 1 put statusdict /manualfeed false put 1426 ss 1440 1426 m
(AvantGarde-Book04800480) getfont 2042 ss 1440 2042 m
(AvantGarde-Book04800480) getfont 2658 ss 1440 2658 m
(AvantGarde-Book04800480) getfont 3274 ss 1440 3274 m
(AvantGarde-Book04800480) getfont 3890 ss 1440 3890 m
(AvantGarde-Book04800480) getfont 4506 ss 1440 4506 m
(AvantGarde-Book04800480) getfont 5122 ss 1440 5122 m
(AvantGarde-Book04800480) getfont (AvantGarde-Demi06400640) getfont 5930 ss
5007 5930 m (AvantGarde-Demi06400640) getfont (WACCO) s
(AvantGarde-Book06400640) getfont (AvantGarde-Demi04800480) getfont 6546 ss
6300 6546 m (AvantGarde-Demi04800480) getfont 7162 ss 6300 7162 m
(AvantGarde-Demi04800480) getfont 7778 ss 2419 7778 m
(AvantGarde-Demi04800480) getfont (W) s (AvantGarde-Book04800480) getfont (hy ) s
(AvantGarde-Demi04800480) getfont (A) s (AvantGarde-Book04800480) getfont (nother ) s
(AvantGarde-Demi04800480) getfont (C) s (AvantGarde-Book04800480) getfont (ompiler ) s
(AvantGarde-Demi04800480) getfont (Co) s (AvantGarde-Book04800480) getfont (mpiler?) s
8394 ss 6300 8394 m (AvantGarde-Book04800480) getfont 9010 ss 5131 9010 m
(AvantGarde-Book04800480) getfont (Why not!!!) s 9626 ss 6300 9626 m
(AvantGarde-Book04800480) getfont 10242 ss 6300 10242 m
(AvantGarde-Book04800480) getfont (AvantGarde-Book02800280) getfont 10618 ss
6129 10618 m (AvantGarde-Book02800280) getfont (by) s 10994 ss 5506 10994 m
(AvantGarde-Book02800280) getfont (Parag Patel) s showpage vm_state restore
X
X
save /vm_state E def [1 0 0 -1 0 0] concat 0.050000 0.050000 SC .5 SLW
0 -15840 TR 0 RO
0 0 0 15840 12240 15840 12240 0 pageboundary clip
userdict /#copies 1 put statusdict /manualfeed false put 1253 ss 1440 1253 m
(Palatino-Roman02400240) getfont (AvantGarde-Demi03200320) getfont 1677 ss
5564 1677 m (AvantGarde-Demi03200320) getfont (Overview) s
(Palatino-Roman02400240) getfont (Palatino-Roman02400240) getfont 2005 ss
1440 2005 m (Palatino-Roman02400240) getfont 2333 ss 1440 2333 m
(Palatino-Roman02400240) getfont (Palatino-Roman02400240) getfont 2661 ss
2880 2661 m (Palatino-Roman02400240) getfont (W) s -0.920 nx sp (a) s -0.940 nx sp
(c) s sp (c) s -0.920 nx sp (o ) s -12.000 nx sp (i) s -0.940 nx sp (s ) s -12.000 nx sp (a) s
-0.940 nx sp (n) s sp (o) s -0.920 nx sp (t) s -0.940 nx sp (h) s sp (e) s sp (r ) s
-12.000 nx sp (c) s -0.920 nx sp (o) s -0.940 nx sp (m) s sp (p) s sp (i) s -0.920 nx sp (l) s
-0.940 nx sp (e) s sp (r ) s -12.000 nx sp (c) s -0.940 nx sp (o) s -0.920 nx sp (m) s
-0.940 nx sp (p) s sp (i) s sp (l) s -0.920 nx sp (e) s -0.940 nx sp (r) s sp (. ) s
-12.000 nx sp (I) s -0.920 nx sp (t ) s -12.000 nx sp (g) s -0.940 nx sp (e) s sp (n) s sp (e) s
-0.920 nx sp (r) s -0.940 nx sp (a) s sp (t) s sp (e) s -0.920 nx sp (s ) s -12.000 nx sp (a ) s
sp (C) s -0.940 nx sp (+) s sp (+ ) s -12.000 nx sp (r) s -0.940 nx sp (e) s -0.920 nx sp (c) s
-0.940 nx sp (u) s sp (r) s sp (s) s -0.920 nx sp (i) s -0.940 nx sp (v) s sp (e) s sp (-) s
2949 ss 2880 2949 m (Palatino-Roman02400240) getfont (descent ) s 1.440 nx sp (LL\(1\) ) s
sp (parser ) s sp (rather ) s sp (than ) s 1.460 nx sp (a ) s 1.440 nx sp (bottom-up ) s sp
(style ) s sp (LALR ) s 1.460 nx sp (parser. ) s 1.440 nx sp 3237 ss 2880 3237 m
(Palatino-Roman02400240) getfont (It ) s 10.300 nx sp (also ) s sp (directly ) s sp (supports ) s
sp (lexical ) s sp (scanning, ) s sp (making ) s sp (it ) s sp (very ) s sp (easy ) s sp (to ) s
sp 3525 ss 2880 3525 m (Palatino-Roman02400240) getfont (describe a complete language within a single wacco source file.) s
3853 ss 2880 3853 m (Palatino-Roman02400240) getfont 4181 ss 2880 4181 m
(Palatino-Roman02400240) getfont (The ) s 17.320 nx sp (underlying ) s 17.340 nx sp
(philosophy ) s sp (in ) s 17.320 nx sp (wacco ) s 17.340 nx sp (is ) s sp (that ) s
17.320 nx sp (the ) s 17.340 nx sp (code ) s sp (generated ) s 17.320 nx sp 4469 ss
2880 4469 m (Palatino-Roman02400240) getfont (should ) s 13.700 nx sp (be ) s sp (exactly ) s
sp (like ) s sp (that ) s sp (someone ) s sp (would ) s sp (generate ) s sp (by ) s sp (hand, ) s
sp (if ) s sp 4757 ss 2880 4757 m (Palatino-Roman02400240) getfont (they were writing a recursive-descent compiler the hard way.) s
5085 ss 2880 5085 m (Palatino-Roman02400240) getfont 5413 ss 2880 5413 m
(Palatino-Roman02400240) getfont (W) s 1.480 nx sp (a) s sp (c) s 1.500 nx sp (c) s
1.480 nx sp (o ) s 30.000 nx sp (a) s 1.500 nx sp (l) s 1.480 nx sp (s) s 1.500 nx sp (o ) s
30.000 nx sp (g) s 1.480 nx sp (e) s 1.500 nx sp (n) s 1.480 nx sp (e) s sp (r) s
1.500 nx sp (a) s 1.480 nx sp (t) s 1.500 nx sp (e) s 1.480 nx sp (s ) s 30.000 nx sp (s) s
1.500 nx sp (o) s 1.480 nx sp (m) s 1.500 nx sp (e ) s 30.000 nx sp (r) s 1.480 nx sp (e) s
sp (l) s 1.500 nx sp (a) s 1.480 nx sp (t) s 1.500 nx sp (i) s 1.480 nx sp (v) s 1.500 nx sp
(e) s 1.480 nx sp (l) s 1.500 nx sp (y ) s 30.000 nx sp (s) s 1.480 nx sp (i) s sp (m) s
1.500 nx sp (p) s 1.480 nx sp (l) s 1.500 nx sp (e) s 1.480 nx sp (-) s 1.500 nx sp (m) s
1.480 nx sp (i) s 1.500 nx sp (n) s 1.480 nx sp (d) s sp (e) s 1.500 nx sp (d ) s
30.000 nx sp (e) s 1.480 nx sp (r) s 1.500 nx sp (r) s 1.480 nx sp (o) s 1.500 nx sp (r ) s
30.000 nx sp (r) s 1.480 nx sp (e) s 1.500 nx sp (-) s 5701 ss 2880 5701 m
(Palatino-Roman02400240) getfont (covery ) s -7.100 nx sp (schemes ) s sp (using ) s
sp (FIRST ) s sp (and ) s sp (FOLLOW ) s sp (sets. ) s sp (While ) s sp (it ) s sp (leaves ) s sp
(a ) s sp 5989 ss 2880 5989 m (Palatino-Roman02400240) getfont (lot ) s 9.520 nx sp
(to ) s 9.540 nx sp (be ) s sp (desired, ) s sp (it's ) s sp (seems ) s sp (to ) s sp (be ) s sp (much ) s
sp (better ) s sp (than ) s sp (Palatino-Italic02400240) getfont (yacc\(1\)) s
(Palatino-Roman02400240) getfont ('s! ) s sp ( ) s sp (In-) s 6277 ss 2880 6277 m
(Palatino-Roman02400240) getfont (deed, ) s 10.600 nx sp (wacco ) s sp (was ) s sp (written ) s
sp (to ) s sp ( ) s sp (provide ) s sp (a ) s sp (platform ) s sp (for ) s sp (experiment-) s
6565 ss 2880 6565 m (Palatino-Roman02400240) getfont (i) s 0.440 nx sp (n) s
0.460 nx sp (g ) s 30.000 nx sp (w) s 0.440 nx sp (i) s 0.460 nx sp (t) s 0.440 nx sp (h ) s
30.000 nx sp (v) s 0.460 nx sp (a) s 0.440 nx sp (r) s 0.460 nx sp (i) s 0.440 nx sp (o) s
0.460 nx sp (u) s 0.440 nx sp (s ) s 30.000 nx sp (e) s 0.460 nx sp (r) s 0.440 nx sp (r) s
0.460 nx sp (o) s 0.440 nx sp (r ) s 30.000 nx sp (r) s 0.460 nx sp (e) s 0.440 nx sp (c) s
0.460 nx sp (o) s 0.440 nx sp (v) s 0.460 nx sp (e) s 0.440 nx sp (r) s 0.460 nx sp (y ) s
30.000 nx sp (s) s 0.440 nx sp (c) s 0.460 nx sp (h) s 0.440 nx sp (e) s 0.460 nx sp (m) s
0.440 nx sp (e) s 0.460 nx sp (s) s 0.440 nx sp (, ) s 30.000 nx sp (b) s 0.460 nx sp (u) s
0.440 nx sp (t ) s 30.000 nx sp (t) s 0.460 nx sp (u) s 0.440 nx sp (r) s 0.460 nx sp (n) s
0.440 nx sp (e) s 0.460 nx sp (d ) s 30.000 nx sp (o) s 0.440 nx sp (u) s 0.460 nx sp (t ) s
30.000 nx sp (t) s 0.440 nx sp (o ) s 30.000 nx sp (b) s 0.460 nx sp (e ) s 30.000 nx sp
6853 ss 2880 6853 m (Palatino-Roman02400240) getfont (quite useful in its own right.) s
7181 ss 2880 7181 m (Palatino-Roman02400240) getfont 7509 ss 2880 7509 m
(Palatino-Roman02400240) getfont (For ) s -1.360 nx sp (more ) s sp (details ) s sp (about ) s
sp (how ) s sp (to ) s -1.380 nx sp (run ) s -1.360 nx sp (wacco, ) s sp (please ) s sp (see ) s
sp (the ) s -1.380 nx sp (Palatino-Italic02400240) getfont (wacco\(1\)) s
(Palatino-Roman02400240) getfont ( ) s -1.360 nx sp 7797 ss 2880 7797 m
(Palatino-Roman02400240) getfont (manual ) s 19.880 nx sp (page. ) s sp (This ) s
19.900 nx sp (document ) s 19.880 nx sp (is ) s 19.900 nx sp (intended ) s
19.880 nx sp (to ) s 19.900 nx sp (describe ) s 19.880 nx sp (the ) s 19.900 nx sp (wacco ) s
19.880 nx sp 8085 ss 2880 8085 m (Palatino-Roman02400240) getfont (grammar format.) s
8413 ss 2880 8413 m (Palatino-Roman02400240) getfont 8741 ss 2880 8741 m
(Palatino-Roman02400240) getfont 9069 ss 2880 9069 m
(Palatino-Roman02400240) getfont 9397 ss 2880 9397 m
(Palatino-Roman02400240) getfont 9725 ss 2880 9725 m
(Palatino-Roman02400240) getfont 10053 ss 2880 10053 m
(Palatino-Roman02400240) getfont 10381 ss 2880 10381 m
(Palatino-Roman02400240) getfont 10709 ss 2880 10709 m
(Palatino-Roman02400240) getfont 11037 ss 2880 11037 m
(Palatino-Roman02400240) getfont 11365 ss 2880 11365 m
(Palatino-Roman02400240) getfont 11693 ss 2880 11693 m
(Palatino-Roman02400240) getfont 12021 ss 2880 12021 m
(Palatino-Roman02400240) getfont 12349 ss 2880 12349 m
(Palatino-Roman02400240) getfont 12677 ss 2880 12677 m
(Palatino-Roman02400240) getfont 13005 ss 2880 13005 m
(Palatino-Roman02400240) getfont 13333 ss 2880 13333 m
(Palatino-Roman02400240) getfont 13661 ss 2880 13661 m
(Palatino-Roman02400240) getfont 13989 ss 2880 13989 m
(Palatino-Roman02400240) getfont 14317 ss 2880 14317 m
(Palatino-Roman02400240) getfont (Palatino-Roman01800180) getfont 14573 ss
2880 14573 m (Palatino-Roman01800180) getfont (Copyright \322 1991 by Parag Patel.  All Rights Reserved.) s
(Palatino-Roman01800180) getfont (Palatino-Roman01800180) getfont
(Palatino-Roman02400240) getfont
NP 7080 1725 m 5580 1725 l GS 0.00 SG 1 SLW ST GR 5580 1725 m
showpage vm_state restore
X
X
save /vm_state E def [1 0 0 -1 0 0] concat 0.050000 0.050000 SC .5 SLW
0 -15840 TR 0 RO
0 0 0 15840 12240 15840 12240 0 pageboundary clip
userdict /#copies 1 put statusdict /manualfeed false put 1253 ss 1440 1253 m
(Palatino-Roman02400240) getfont (AvantGarde-Demi03200320) getfont 1677 ss
5497 1677 m (AvantGarde-Demi03200320) getfont (File format) s
(Palatino-Roman02400240) getfont (Palatino-Roman02400240) getfont 2005 ss
1440 2005 m (Palatino-Roman02400240) getfont 2333 ss 1440 2333 m
(Palatino-Roman02400240) getfont 2661 ss 1440 2661 m
(Palatino-Roman02400240) getfont (The basic wacco grammar file format is:) s
2989 ss 1440 2989 m (Palatino-Roman02400240) getfont
(Courier02400240) getfont 3317 ss 1440 3317 m (Courier02400240) getfont
720.000 nx sp (/* C style comments */) s 3645 ss 1440 3645 m
(Courier02400240) getfont sp (%opt ) s (Palatino-Italic02400240) getfont (directives) s
(Palatino-Roman02400240) getfont 3973 ss 1440 3973 m
(Palatino-Roman02400240) getfont sp (Courier02400240) getfont ({ ) s
(Palatino-Italic02400240) getfont (header) s (Courier02400240) getfont ( }) s
(Palatino-Roman02400240) getfont 4301 ss 1440 4301 m
(Palatino-Roman02400240) getfont sp (Palatino-Italic02400240) getfont (rules) s
(Courier02400240) getfont 960.000 nx sp (// C++ style comments) s 4629 ss
1440 4629 m (Courier02400240) getfont 720.000 nx sp ($$) s
(Palatino-Roman02400240) getfont 4957 ss 1440 4957 m
(Palatino-Roman02400240) getfont sp (Palatino-Italic02400240) getfont (scanner) s
(Palatino-Roman02400240) getfont 5285 ss 1440 5285 m
(Palatino-Roman02400240) getfont 5613 ss 1440 5613 m
(Palatino-Roman02400240) getfont (Wacco ) s -1.180 nx sp (directives ) s sp (may ) s
-1.200 nx sp (be ) s -1.180 nx sp (placed ) s sp (on ) s -1.200 nx sp (the ) s
-1.180 nx sp (optional ) s -1.200 nx sp (Courier02400240) getfont (%opt) s
(Palatino-Roman02400240) getfont ( ) s -1.180 nx sp (line ) s sp (at ) s -1.200 nx sp
(the ) s -1.180 nx sp (top ) s sp (of ) s -1.200 nx sp (the ) s -1.180 nx sp (source ) s
-1.200 nx sp (grammar. ) s -1.180 nx sp 5901 ss 1442 5901 m
(Palatino-Roman02400240) getfont ( ) s -10.240 nx sp (Only ) s -10.260 nx sp (one ) s
-10.240 nx sp (such ) s -10.260 nx sp (line ) s -10.240 nx sp (is ) s -10.260 nx sp (allowed ) s
-10.240 nx sp (in ) s -10.260 nx sp (the ) s -10.240 nx sp (grammar ) s -10.260 nx sp
(source, ) s -10.240 nx sp (and ) s -10.260 nx sp (it ) s -10.240 nx sp (MUST ) s
-10.260 nx sp (be ) s -10.240 nx sp (first ) s -10.260 nx sp (in ) s -10.240 nx sp (the ) s
-10.260 nx sp (source. ) s -10.240 nx sp ( ) s -10.260 nx sp (The ) s -10.240 nx sp
6189 ss 1442 6189 m (Palatino-Roman02400240) getfont (directives ) s 1.920 nx sp
(are ) s sp (actually ) s 1.940 nx sp (the ) s 1.920 nx sp (command-line ) s 1.940 nx sp
(options ) s 1.920 nx sp (for ) s 1.940 nx sp (wacco! ) s 1.920 nx sp ( ) s sp (Options ) s
1.940 nx sp (may ) s 1.920 nx sp (thus ) s 1.940 nx sp (be ) s 1.920 nx sp (set ) s
1.940 nx sp (either ) s 1.920 nx sp 6477 ss 1442 6477 m
(Palatino-Roman02400240) getfont (on ) s 9.260 nx sp (the ) s sp (command ) s sp (line, ) s
sp (or ) s sp (in ) s sp (the ) s 9.280 nx sp (wacco ) s 9.260 nx sp (source ) s sp (itself. ) s
sp ( ) s sp (The ) s sp (entire ) s 9.280 nx sp (") s (Courier02400240) getfont (%opt) s
(Palatino-Roman02400240) getfont (" ) s 9.260 nx sp (line ) s sp (is ) s sp (parsed ) s
sp (as ) s sp (if ) s 9.280 nx sp (it ) s 9.260 nx sp 6765 ss 1442 6765 m
(Palatino-Roman02400240) getfont (w) s 1.280 nx sp (e) s sp (r) s sp (e ) s 30.000 nx sp
(t) s 1.300 nx sp (h) s 1.280 nx sp (e ) s 30.000 nx sp (c) s 1.280 nx sp (o) s 1.300 nx sp
(m) s 1.280 nx sp (m) s sp (a) s sp (n) s 1.300 nx sp (d ) s 30.000 nx sp (l) s 1.280 nx sp (i) s
sp (n) s 1.300 nx sp (e) s 1.280 nx sp (. ) s 30.000 nx sp ( ) s sp (P) s 1.280 nx sp (l) s sp
(e) s 1.300 nx sp (a) s 1.280 nx sp (s) s sp (e ) s 30.000 nx sp (s) s 1.300 nx sp (e) s
1.280 nx sp (e ) s 30.000 nx sp (t) s 1.280 nx sp (h) s sp (e ) s 30.000 nx sp (m) s
1.300 nx sp (a) s 1.280 nx sp (n ) s 30.000 nx sp (p) s 1.280 nx sp (a) s 1.300 nx sp (g) s
1.280 nx sp (e ) s 30.000 nx sp (f) s 1.280 nx sp (o) s sp (r ) s 30.000 nx sp (d) s
1.300 nx sp (e) s 1.280 nx sp (s) s sp (c) s 1.300 nx sp (r) s 1.280 nx sp (i) s sp (p) s sp (t) s
1.300 nx sp (i) s 1.280 nx sp (o) s sp (n) s 1.300 nx sp (s ) s 30.000 nx sp (o) s
1.280 nx sp (f ) s 30.000 nx sp (t) s 1.280 nx sp (h) s sp (e ) s 30.000 nx sp (c) s
1.300 nx sp (o) s 1.280 nx sp (m) s sp (m) s 1.300 nx sp (a) s 1.280 nx sp (n) s sp (d) s sp (-) s
1.300 nx sp (l) s 1.280 nx sp (i) s sp (n) s 1.300 nx sp (e ) s 30.000 nx sp 7053 ss
1442 7053 m (Palatino-Roman02400240) getfont (options.) s 7381 ss 1440 7381 m
(Palatino-Roman02400240) getfont 7709 ss 1440 7709 m
(Palatino-Roman02400240) getfont (The ) s -5.260 nx sp (header ) s sp (section ) s sp
(\(which ) s sp (is ) s sp (optional\) ) s sp (is ) s -5.280 nx sp (a ) s -5.260 nx sp (set ) s
sp (of ) s sp (code ) s sp (in ) s sp (curly-braces ) s -5.280 nx sp
(Courier02400240) getfont ({}) s (Palatino-Roman02400240) getfont ( ) s
-5.260 nx sp (that ) s sp (is ) s sp (put ) s sp (at ) s sp (the ) s -5.280 nx sp (top ) s
-5.260 nx sp 7997 ss 1442 7997 m (Palatino-Roman02400240) getfont (of ) s
20.280 nx sp (the ) s 20.300 nx sp (output ) s sp (Palatino-Italic02400240) getfont
(parser.C) s (Palatino-Roman02400240) getfont ( ) s 20.280 nx sp (file. ) s
20.300 nx sp ( ) s sp (This ) s 20.280 nx sp (a ) s 20.300 nx sp (the ) s sp (place ) s sp (to ) s
20.280 nx sp (include ) s 20.300 nx sp (files, ) s sp (define ) s 20.280 nx sp (classes, ) s
20.300 nx sp (or ) s sp (setup ) s sp (global ) s 20.280 nx sp 8285 ss 1442 8285 m
(Palatino-Roman02400240) getfont (variables.  Naturally, there are no curlies ) s
(Courier02400240) getfont ({}) s (Palatino-Roman02400240) getfont ( if there is no need for a header section.) s
8613 ss 1440 8613 m (Palatino-Roman02400240) getfont 8941 ss 1440 8941 m
(Palatino-Roman02400240) getfont (The ) s -1.740 nx sp (scanner ) s -1.760 nx sp (section ) s
-1.740 nx sp (\(the ) s -1.760 nx sp (two) s (Palatino-Roman02400240) getfont ( ) s
-1.740 nx sp (") s (Courier02400240) getfont ($$) s
(Palatino-Roman02400240) getfont (" ) s -1.760 nx sp (and ) s -1.740 nx sp (everything ) s
-1.760 nx sp (after\) ) s -1.740 nx sp (is ) s -1.760 nx sp (entirely ) s -1.740 nx sp
(optional. ) s -1.760 nx sp ( ) s -1.740 nx sp (It ) s -1.760 nx sp (is ) s -1.740 nx sp
(included ) s -1.760 nx sp (in ) s -1.740 nx sp 9229 ss 1442 9229 m
(Palatino-Roman02400240) getfont (the ) s 24.180 nx sp (grammar ) s sp (file ) s
24.200 nx sp (to ) s 24.180 nx sp (make ) s sp (it ) s 24.200 nx sp (easy ) s
24.180 nx sp (to ) s 24.200 nx sp (refer ) s 24.180 nx sp (to ) s sp (the ) s
24.200 nx sp (actual ) s 24.180 nx sp (values ) s sp (of ) s 24.200 nx sp (tokens ) s
24.180 nx sp (without ) s 24.200 nx sp (explicitly ) s 24.180 nx sp 9517 ss
1442 9517 m (Palatino-Roman02400240) getfont (defining those values by hand.) s
9845 ss 1440 9845 m (Palatino-Roman02400240) getfont 10173 ss 1440 10173 m
(Palatino-Roman02400240) getfont (Without any of the optional parts, a grammar consists only of rules.) s
(Palatino-Roman02400240) getfont 10501 ss 1440 10501 m
(Palatino-Roman02400240) getfont (Palatino-Roman02400240) getfont
(Palatino-Roman02400240) getfont
NP 7110 1710 m 5520 1710 l GS 0.00 SG 1 SLW ST GR 5520 1710 m
showpage vm_state restore
X
X
save /vm_state E def [1 0 0 -1 0 0] concat 0.050000 0.050000 SC .5 SLW
0 -15840 TR 0 RO
0 0 0 15840 12240 15840 12240 0 pageboundary clip
userdict /#copies 1 put statusdict /manualfeed false put 1253 ss 1440 1253 m
(Palatino-Roman02400240) getfont (AvantGarde-Demi03200320) getfont 1677 ss
5900 1677 m (AvantGarde-Demi03200320) getfont (Rules) s
(Palatino-Roman02400240) getfont (Palatino-Roman02400240) getfont 2005 ss
1440 2005 m (Palatino-Roman02400240) getfont 2333 ss 1440 2333 m
(Palatino-Roman02400240) getfont 2661 ss 1440 2661 m
(Palatino-Roman02400240) getfont (T) s 9.500 nx sp (h) s sp (e ) s 30.000 nx sp (r) s
9.500 nx sp (u) s sp (l) s sp (e) s sp (s ) s 30.000 nx sp (l) s 9.500 nx sp (o) s sp (o) s sp (k ) s
30.000 nx sp (m) s 9.500 nx sp (u) s sp (c) s sp (h ) s 30.000 nx sp (l) s 9.500 nx sp (i) s sp
(k) s sp (e ) s 30.000 nx sp (t) s 9.500 nx sp (h) s sp (o) s sp (s) s sp (e ) s 30.000 nx sp (o) s
9.500 nx sp (f ) s 30.000 nx sp (y) s 9.500 nx sp (a) s sp (c) s sp (c ) s 30.000 nx sp (a) s
9.500 nx sp (t ) s 30.000 nx sp (f) s 9.500 nx sp (i) s sp (r) s sp (s) s sp (t ) s
30.000 nx sp (g) s 9.500 nx sp (l) s sp (a) s sp (n) s sp (c) s sp (e ) s 30.000 nx sp (b) s
9.500 nx sp (u) s sp (t ) s 30.000 nx sp (t) s 9.500 nx sp (h) s sp (e) s sp (r) s sp (e ) s
30.000 nx sp (a) s 9.500 nx sp (r) s sp (e ) s 30.000 nx sp (s) s 9.500 nx sp (o) s sp (m) s sp
(e ) s 30.000 nx sp (i) s 9.500 nx sp (n) s sp (t) s sp (e) s sp (r) s sp (e) s sp (s) s sp (t) s sp (i) s
sp (n) s sp (g ) s 30.000 nx sp 2949 ss 1442 2949 m
(Palatino-Roman02400240) getfont (differences.  A rule looks like:) s 3277 ss
SHAR_EOF
true || echo 'restore of wacco.doc.ps failed'
fi
echo 'End of  part 4'
echo 'File wacco.doc.ps is continued in part 5'
echo 5 > _shar_seq_.tmp
exit 0
exit 0 # Just in case...
-- 
Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
Sterling Software, IMD           UUCP:     uunet!sparky!kent
Phone:    (402) 291-8300         FAX:      (402) 291-4362
Please send comp.sources.misc-related mail to kent@uunet.uu.net.