480 2000 P 24 12 F (YAY) S 60 J ( - a LALR parser generator.) S
480 2480 P LU (Syntax:) S LE
1920 2720 P 0 12 F 0 12 F (yay) S 144 J ( sourcefile Parser=outfile [option]*) S
1920 3200 P (\(+|-\)LR2 \(-\) \(+|-\)Verbose \(-\)) S
1920 3440 P (\(+|-\)Warnings \(+\) Description=file) S
1920 3680 P (Header=file INSTallation=file) S
1920 3920 P (Language=C|C++ \(C\) Parser=file) S
480 4400 P 0 12 F 24 12 F LU (Examples:) S LE
1920 4640 P 0 12 F 0 12 F (yay) S 144 J ( cgram.y parse=myparse.c) S
1920 4880 P (c myparse.c) S
1920 5360 P (yay ccgram.y lang=c++ pars=myparse.cpp) S
480 5840 P 0 12 F 24 12 F LU (Options:) S LE
480 6080 P 0 12 F 0 12 F (sourcefile) S
1200 6320 P 0 12 F 24 12 F (is) S 60 J ( a file containing YAY input.) S
480 6800 P 0 12 F 0 12 F (Language=C) S
1200 7040 P 0 12 F 24 12 F (produces) S 106 J ( parsing) S 107 J ( tables) S 106 J ( in the C programming language. This is the) S
1200 7280 P (default.) S
480 7760 P 0 12 F 0 12 F (Language=C++) S
1200 8000 P 0 12 F 24 12 F (produces) S 95 J ( parsing tables in the C++ programming language. Note that) S
1200 8240 P (YAY) S 85 J ( only) S 86 J ( produces) S 85 J ( the) S 86 J ( tables;) S 85 J ( the) S 86 J ( routines) S 85 J ( that) S 86 J ( use) S 85 J ( the) S 86 J ( tables to parse) S
1200 8480 P (input) S 60 J ( are predefined.) S
480 8960 P 0 12 F 0 12 F (+LR2) S
1200 9200 P 0 12 F 24 12 F (says) S 63 J ( that) S 64 J ( the) S 63 J ( YAY) S 64 J ( input) S 63 J ( describes an LALR\(2\) grammar. Without ) S 0 12 F 0 10 F (+LR2) S 0 12 F 24 12 F (,) S
1200 9440 P (YAY) S 111 J ( assumes) S 112 J ( that) S 111 J ( the) S 112 J ( grammar) S 111 J ( is) S 112 J ( LALR\(1\).) S 111 J ( ) S 112 J ( The) S 111 J ( manual) S 112 J ( describes) S
1200 9680 P (modifications) S 60 J ( that need to be made for LALR\(2\) grammars.) S
480 10160 P 0 12 F 0 12 F (Description=file) S
1200 10400 P 0 12 F 24 12 F (translates) S 109 J ( the) S 110 J ( parsing) S 109 J ( tables) S 110 J ( into) S 109 J ( a) S 110 J ( format) S 109 J ( that) S 110 J ( humans) S 109 J ( can) S 110 J ( read, and) S
1200 10640 P (writes) S 60 J ( this output into the given file.) S
480 11120 P 0 12 F 0 12 F (Header=file) S
1200 11360 P 0 12 F 24 12 F (writes) S 116 J ( token) S 117 J ( definitions) S 116 J ( and) S 117 J ( other) S 116 J ( information) S 117 J ( necessary for separate) S
1200 11600 P (compilation,) S 60 J ( to the named file.) S
480 12080 P 0 12 F 0 12 F (INSTallation=file) S
1200 12320 P 0 12 F 24 12 F (tells) S 89 J ( YAY) S 90 J ( where) S 89 J ( to) S 90 J ( find) S 89 J ( the installation file. The installation file tells) S
1200 12560 P (where) S 129 J ( various) S 130 J ( software) S 129 J ( components) S 130 J ( have been installed. For more) S
1200 12800 P (information,) S 60 J ( see the section on ) S 0 12 F 24 12 F I (Installation) S 60 J ( Files) S E 0 12 F 24 12 F () S 60 J ( below.) S
1200 13280 P (If) S 90 J ( you) S 91 J ( do) S 90 J ( not) S 91 J ( specify) S 90 J ( an) S 91 J ( ) S 0 12 F 0 10 F (INSTallation=) S 0 12 F 24 12 F () S 90 J ( option) S 91 J ( on) S 90 J ( the) S 91 J ( command) S 90 J ( line,) S
1200 13520 P (YAY) S 80 J ( checks) S 81 J ( for) S 80 J ( an) S 81 J ( environment) S 80 J ( variable named ) S 0 12 F 0 10 F (YAY_INST) S 0 12 F 24 12 F () S 80 J ( and uses its) S
1200 13760 P (value) S 90 J ( as) S 91 J ( the) S 90 J ( name) S 91 J ( of) S 90 J ( the) S 91 J ( installation) S 90 J ( file. If this environment variable) S
1200 14000 P (does) S 60 J ( not exist, YAY uses the default installation file.) S 0 12 F
PE
480 2240 P (Parser=file) S
1200 2480 P 24 12 F (writes) S 64 J ( the) S 65 J ( resulting) S 64 J ( source) S 65 J ( code) S 64 J ( for) S 65 J ( the) S 64 J ( parser into the named file. If this) S
1200 2720 P (option) S 60 J ( is omitted, YAY just checks the syntax of your input.) S
480 3200 P 0 12 F 0 12 F (+Verbose) S
1200 3440 P 0 12 F 24 12 F (produces) S 60 J ( verbose output -- everything that can be flagged is flagged.) S
480 3920 P 0 12 F 0 12 F (-Warnings) S
1200 4160 P 0 12 F 24 12 F (suppresses) S 60 J ( a number of warning messages that YAY normally issues.) S
480 4640 P LU (Description:) S LE
1056 4880 P (YAY) S 66 J ( converts) S 67 J ( your) S 66 J ( context-free) S 67 J ( grammar) S 66 J ( into) S 67 J ( a) S 66 J ( C or C++ program that is) S
480 5120 P (written) S 60 J ( to the file specified by the ) S 0 12 F 0 10 F (Parser=) S 0 12 F 24 12 F () S 60 J ( option.) S
1056 5600 P (If) S 70 J ( you) S 71 J ( use) S 70 J ( the) S 71 J ( ) S 0 12 F 0 10 F (Description=) S 0 12 F 24 12 F () S 70 J ( option,) S 71 J ( YAY) S 70 J ( writes) S 71 J ( a) S 70 J ( full) S 71 J ( description of the) S
480 5840 P (grammar) S 118 J ( to) S 119 J ( the) S 118 J ( specified) S 119 J ( file.) S 118 J ( ) S 119 J ( YAY) S 118 J ( only) S 119 J ( displays) S 118 J ( a) S 119 J ( brief) S 118 J ( message) S 119 J ( on) S 118 J ( the) S
480 6080 P (standard) S 105 J ( output,) S 106 J ( summarizing) S 105 J ( conflicts) S 106 J ( \(and other information if you specify) S
480 6320 P 0 12 F 0 10 F (+Verbose) S 0 12 F 24 12 F (\).) S 99 J ( ) S 100 J ( On) S 99 J ( the) S 100 J ( other) S 99 J ( hand,) S 100 J ( if) S 99 J ( you do not use the ) S 0 12 F 0 10 F (Description=) S 0 12 F 24 12 F () S 99 J ( option,) S
480 6560 P (YAY) S 80 J ( writes) S 81 J ( more) S 80 J ( information) S 81 J ( to) S 80 J ( standard) S 81 J ( output, including descriptions of the) S
480 6800 P (states) S 104 J ( where) S 105 J ( conflicts) S 104 J ( occur.) S 105 J ( ) S 104 J ( In this case, YAY actually provides additional) S
480 7040 P (information) S 100 J ( to) S 101 J ( help) S 100 J ( you) S 101 J ( identify the source of the conflicts; if you ask for a) S
480 7280 P (description) S 120 J ( file,) S 121 J ( YAY) S 120 J ( outputs) S 121 J ( less information when reporting the conflicts) S
480 7520 P (because) S 69 J ( it) S 70 J ( assumes) S 69 J ( you) S 70 J ( can track down additional information by looking at the) S
480 7760 P (description) S 75 J ( file.) S 76 J ( ) S 75 J ( For) S 76 J ( this) S 75 J ( reason, you can sometimes get a quicker idea of what) S
480 8000 P (has) S 60 J ( gone wrong if you do not ask for a description file.) S
480 8480 P LU (C++ Parsers) S LE
1056 8720 P (In) S 76 J ( general,) S 77 J ( you) S 76 J ( only need to use ) S 0 12 F 0 10 F (Language=C++) S 0 12 F 24 12 F () S 76 J ( if you intend ) S 0 12 F 0 10 F (YYSTYPE) S 0 12 F 24 12 F () S 76 J ( to) S
480 8960 P (contain) S 63 J ( a) S 64 J ( C++ object with constructors. If you intend to compile the parser with) S
480 9200 P (C++) S 171 J ( but) S 172 J ( the) S 171 J ( ) S 0 12 F 0 10 F (%union) S 0 12 F 24 12 F () S 172 J ( statement) S 171 J ( does) S 172 J ( not have any elements that need) S
480 9440 P (constructors,) S 60 J ( it's best to use ) S 0 12 F 0 10 F (Language=C) S 0 12 F 24 12 F () S 60 J ( to get more efficient C code.) S
1056 9920 P (If) S 115 J ( ) S 0 12 F 0 10 F (YYSTYPE) S 0 12 F 24 12 F () S 116 J ( does) S 115 J ( contain elements that need constructors, you need to) S
480 10160 P (define) S 121 J ( an) S 122 J ( appropriate constructor-like function for the ) S 0 12 F 0 10 F (YYSTYPE) S 0 12 F 24 12 F () S 122 J ( type. This) S
480 10400 P (function) S 60 J ( should have the prototype) S
1920 10880 P 0 12 F 0 12 F (void) S 144 J ( name\(YYSTYPE *p\)) S
480 11360 P 0 12 F 24 12 F (where) S 128 J ( ) S 0 12 F 0 10 F ("name") S 0 12 F 24 12 F () S 129 J ( can) S 128 J ( be) S 129 J ( any) S 128 J ( valid) S 129 J ( name.) S 128 J ( ) S 129 J ( In) S 128 J ( the) S 129 J ( declarations section of the) S
480 11600 P (grammar,) S 60 J ( you must then add the statement) S
1920 12080 P 0 12 F 0 12 F (#define) S 144 J ( YYSTYPE_INIT name) S
480 12560 P 0 12 F 24 12 F (where) S 60 J ( ) S 0 12 F 0 10 F ("name") S 0 12 F 24 12 F () S 60 J ( is the name of the constructor-like function.) S
1056 13040 P (With) S 127 J ( ) S 0 12 F 0 10 F (Language=C++) S 0 12 F 24 12 F (,) S 128 J ( the) S 127 J ( ) S 0 12 F 0 10 F (%union) S 0 12 F 24 12 F () S 127 J ( statement generates a structure type) S
480 13280 P (rather) S 118 J ( than) S 119 J ( a) S 118 J ( union, since C++ does not allow objects with constructors to) S
480 13520 P (belong) S 60 J ( to unions.) S 0 12 F
PE
1056 2000 P 24 12 F (In) S 168 J ( many) S 169 J ( cases,) S 168 J ( the) S 169 J ( same) S 168 J ( grammar) S 169 J ( may) S 168 J ( be) S 169 J ( processed) S 168 J ( with either) S
480 2240 P 0 12 F 0 10 F (Language=C) S 0 12 F 24 12 F () S 60 J ( or ) S 0 12 F 0 10 F (Language=C++) S 0 12 F 24 12 F (.) S
480 2720 P LU (Installation) S 60 J ( Files:) S LE
1056 2960 P (An) S 108 J ( installation) S 109 J ( file specifies the pathnames for software and data files) S
480 3200 P (used) S 92 J ( by) S 93 J ( YAY.) S 92 J ( ) S 93 J ( Installation) S 92 J ( files) S 93 J ( are text files made up of comment lines and) S
480 3440 P (option) S 60 J ( lines.) S
480 3920 P (Comment lines:) S
1200 4160 P (Any) S 143 J ( line) S 144 J ( whose) S 143 J ( first) S 144 J ( non-blank) S 143 J ( character) S 144 J ( is) S 143 J ( ) S 0 12 F 0 10 F (#) S 0 12 F 24 12 F () S 144 J ( will) S 143 J ( be) S 144 J ( taken) S 143 J ( as a) S
1200 4400 P (comment.) S 60 J ( Blank lines are also considered comments.) S
480 4880 P (Option lines:) S
1200 5120 P (Option lines have the format) S
1920 5600 P 0 12 F 0 12 F (Keyword=pathname) S
1200 6080 P 0 12 F 24 12 F (In) S 86 J ( this documentation, keywords are written with some letters in upper) S
1200 6320 P (case) S 63 J ( and) S 64 J ( some in lower case. You may abbreviate keywords by omitting) S
1200 6560 P (any) S 71 J ( or) S 72 J ( all) S 71 J ( of) S 72 J ( the) S 71 J ( letters) S 72 J ( shown in lower case. The remaining letters may) S
1200 6800 P (be) S 75 J ( entered in either upper or lower case; the documentation simply uses) S
1200 7040 P (upper) S 60 J ( case to show which characters may not be omitted.) S
1056 7520 P (In this version of YAY, there is only one valid option line:) S
1920 8000 P 0 12 F 0 12 F (Library=pathname) S
480 8480 P 0 12 F 24 12 F (The) S 71 J ( pathname) S 72 J ( should) S 71 J ( be) S 72 J ( the) S 71 J ( directory) S 72 J ( containing) S 71 J ( the YAY parser template files) S
480 8720 P (\(e.g.) S 60 J ( ) S 0 12 F 0 10 F (yyparse.c) S 0 12 F 24 12 F (\).) S
480 9200 P LU (Notes:) S LE
1056 9440 P (If) S 121 J ( you) S 122 J ( define) S 121 J ( ) S 0 12 F 0 10 F (YYALLOC) S 0 12 F 24 12 F (,) S 122 J ( the) S 121 J ( parser) S 122 J ( allocates) S 121 J ( its) S 122 J ( state) S 121 J ( and) S 122 J ( value stacks) S
480 9680 P (dynamically) S 94 J ( via) S 95 J ( malloc and free. This shrinks your parser and helps prevent) S
480 9920 P (stack) S 60 J ( overflows.) S
480 10400 P (Copyright 1995, Thinkage Ltd.) S 0 12 F