bison.info-4 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254
  1. This is Info file bison.info, produced by Makeinfo-1.54 from the input
  2. file /home/gd2/gnu/bison/bison.texinfo.
  3. This file documents the Bison parser generator.
  4. Copyright (C) 1988, 1989, 1990, 1991, 1992 Free Software Foundation,
  5. Inc.
  6. Permission is granted to make and distribute verbatim copies of this
  7. manual provided the copyright notice and this permission notice are
  8. preserved on all copies.
  9. Permission is granted to copy and distribute modified versions of
  10. this manual under the conditions for verbatim copying, provided also
  11. that the sections entitled "GNU General Public License" and "Conditions
  12. for Using Bison" are included exactly as in the original, and provided
  13. that the entire resulting derived work is distributed under the terms
  14. of a permission notice identical to this one.
  15. Permission is granted to copy and distribute translations of this
  16. manual into another language, under the above conditions for modified
  17. versions, except that the sections entitled "GNU General Public
  18. License", "Conditions for Using Bison" and this permission notice may be
  19. included in translations approved by the Free Software Foundation
  20. instead of in the original English.
  21. 
  22. File: bison.info, Node: Mystery Conflicts, Next: Stack Overflow, Prev: Reduce/Reduce, Up: Algorithm
  23. Mysterious Reduce/Reduce Conflicts
  24. ==================================
  25. Sometimes reduce/reduce conflicts can occur that don't look
  26. warranted. Here is an example:
  27. %token ID
  28. %%
  29. def: param_spec return_spec ','
  30. ;
  31. param_spec:
  32. type
  33. | name_list ':' type
  34. ;
  35. return_spec:
  36. type
  37. | name ':' type
  38. ;
  39. type: ID
  40. ;
  41. name: ID
  42. ;
  43. name_list:
  44. name
  45. | name ',' name_list
  46. ;
  47. It would seem that this grammar can be parsed with only a single
  48. token of look-ahead: when a `param_spec' is being read, an `ID' is a
  49. `name' if a comma or colon follows, or a `type' if another `ID'
  50. follows. In other words, this grammar is LR(1).
  51. However, Bison, like most parser generators, cannot actually handle
  52. all LR(1) grammars. In this grammar, two contexts, that after an `ID'
  53. at the beginning of a `param_spec' and likewise at the beginning of a
  54. `return_spec', are similar enough that Bison assumes they are the same.
  55. They appear similar because the same set of rules would be active--the
  56. rule for reducing to a `name' and that for reducing to a `type'. Bison
  57. is unable to determine at that stage of processing that the rules would
  58. require different look-ahead tokens in the two contexts, so it makes a
  59. single parser state for them both. Combining the two contexts causes a
  60. conflict later. In parser terminology, this occurrence means that the
  61. grammar is not LALR(1).
  62. In general, it is better to fix deficiencies than to document them.
  63. But this particular deficiency is intrinsically hard to fix; parser
  64. generators that can handle LR(1) grammars are hard to write and tend to
  65. produce parsers that are very large. In practice, Bison is more useful
  66. as it is now.
  67. When the problem arises, you can often fix it by identifying the two
  68. parser states that are being confused, and adding something to make them
  69. look distinct. In the above example, adding one rule to `return_spec'
  70. as follows makes the problem go away:
  71. %token BOGUS
  72. ...
  73. %%
  74. ...
  75. return_spec:
  76. type
  77. | name ':' type
  78. /* This rule is never used. */
  79. | ID BOGUS
  80. ;
  81. This corrects the problem because it introduces the possibility of an
  82. additional active rule in the context after the `ID' at the beginning of
  83. `return_spec'. This rule is not active in the corresponding context in
  84. a `param_spec', so the two contexts receive distinct parser states. As
  85. long as the token `BOGUS' is never generated by `yylex', the added rule
  86. cannot alter the way actual input is parsed.
  87. In this particular example, there is another way to solve the
  88. problem: rewrite the rule for `return_spec' to use `ID' directly
  89. instead of via `name'. This also causes the two confusing contexts to
  90. have different sets of active rules, because the one for `return_spec'
  91. activates the altered rule for `return_spec' rather than the one for
  92. `name'.
  93. param_spec:
  94. type
  95. | name_list ':' type
  96. ;
  97. return_spec:
  98. type
  99. | ID ':' type
  100. ;
  101. 
  102. File: bison.info, Node: Stack Overflow, Prev: Mystery Conflicts, Up: Algorithm
  103. Stack Overflow, and How to Avoid It
  104. ===================================
  105. The Bison parser stack can overflow if too many tokens are shifted
  106. and not reduced. When this happens, the parser function `yyparse'
  107. returns a nonzero value, pausing only to call `yyerror' to report the
  108. overflow.
  109. By defining the macro `YYMAXDEPTH', you can control how deep the
  110. parser stack can become before a stack overflow occurs. Define the
  111. macro with a value that is an integer. This value is the maximum number
  112. of tokens that can be shifted (and not reduced) before overflow. It
  113. must be a constant expression whose value is known at compile time.
  114. The stack space allowed is not necessarily allocated. If you
  115. specify a large value for `YYMAXDEPTH', the parser actually allocates a
  116. small stack at first, and then makes it bigger by stages as needed.
  117. This increasing allocation happens automatically and silently.
  118. Therefore, you do not need to make `YYMAXDEPTH' painfully small merely
  119. to save space for ordinary inputs that do not need much stack.
  120. The default value of `YYMAXDEPTH', if you do not define it, is 10000.
  121. You can control how much stack is allocated initially by defining the
  122. macro `YYINITDEPTH'. This value too must be a compile-time constant
  123. integer. The default is 200.
  124. 
  125. File: bison.info, Node: Error Recovery, Next: Context Dependency, Prev: Algorithm, Up: Top
  126. Error Recovery
  127. **************
  128. It is not usually acceptable to have a program terminate on a parse
  129. error. For example, a compiler should recover sufficiently to parse the
  130. rest of the input file and check it for errors; a calculator should
  131. accept another expression.
  132. In a simple interactive command parser where each input is one line,
  133. it may be sufficient to allow `yyparse' to return 1 on error and have
  134. the caller ignore the rest of the input line when that happens (and
  135. then call `yyparse' again). But this is inadequate for a compiler,
  136. because it forgets all the syntactic context leading up to the error.
  137. A syntax error deep within a function in the compiler input should not
  138. cause the compiler to treat the following line like the beginning of a
  139. source file.
  140. You can define how to recover from a syntax error by writing rules to
  141. recognize the special token `error'. This is a terminal symbol that is
  142. always defined (you need not declare it) and reserved for error
  143. handling. The Bison parser generates an `error' token whenever a
  144. syntax error happens; if you have provided a rule to recognize this
  145. token in the current context, the parse can continue.
  146. For example:
  147. stmnts: /* empty string */
  148. | stmnts '\n'
  149. | stmnts exp '\n'
  150. | stmnts error '\n'
  151. The fourth rule in this example says that an error followed by a
  152. newline makes a valid addition to any `stmnts'.
  153. What happens if a syntax error occurs in the middle of an `exp'? The
  154. error recovery rule, interpreted strictly, applies to the precise
  155. sequence of a `stmnts', an `error' and a newline. If an error occurs in
  156. the middle of an `exp', there will probably be some additional tokens
  157. and subexpressions on the stack after the last `stmnts', and there will
  158. be tokens to read before the next newline. So the rule is not
  159. applicable in the ordinary way.
  160. But Bison can force the situation to fit the rule, by discarding
  161. part of the semantic context and part of the input. First it discards
  162. states and objects from the stack until it gets back to a state in
  163. which the `error' token is acceptable. (This means that the
  164. subexpressions already parsed are discarded, back to the last complete
  165. `stmnts'.) At this point the `error' token can be shifted. Then, if
  166. the old look-ahead token is not acceptable to be shifted next, the
  167. parser reads tokens and discards them until it finds a token which is
  168. acceptable. In this example, Bison reads and discards input until the
  169. next newline so that the fourth rule can apply.
  170. The choice of error rules in the grammar is a choice of strategies
  171. for error recovery. A simple and useful strategy is simply to skip the
  172. rest of the current input line or current statement if an error is
  173. detected:
  174. stmnt: error ';' /* on error, skip until ';' is read */
  175. It is also useful to recover to the matching close-delimiter of an
  176. opening-delimiter that has already been parsed. Otherwise the
  177. close-delimiter will probably appear to be unmatched, and generate
  178. another, spurious error message:
  179. primary: '(' expr ')'
  180. | '(' error ')'
  181. ...
  182. ;
  183. Error recovery strategies are necessarily guesses. When they guess
  184. wrong, one syntax error often leads to another. In the above example,
  185. the error recovery rule guesses that an error is due to bad input
  186. within one `stmnt'. Suppose that instead a spurious semicolon is
  187. inserted in the middle of a valid `stmnt'. After the error recovery
  188. rule recovers from the first error, another syntax error will be found
  189. straightaway, since the text following the spurious semicolon is also
  190. an invalid `stmnt'.
  191. To prevent an outpouring of error messages, the parser will output
  192. no error message for another syntax error that happens shortly after
  193. the first; only after three consecutive input tokens have been
  194. successfully shifted will error messages resume.
  195. Note that rules which accept the `error' token may have actions, just
  196. as any other rules can.
  197. You can make error messages resume immediately by using the macro
  198. `yyerrok' in an action. If you do this in the error rule's action, no
  199. error messages will be suppressed. This macro requires no arguments;
  200. `yyerrok;' is a valid C statement.
  201. The previous look-ahead token is reanalyzed immediately after an
  202. error. If this is unacceptable, then the macro `yyclearin' may be used
  203. to clear this token. Write the statement `yyclearin;' in the error
  204. rule's action.
  205. For example, suppose that on a parse error, an error handling
  206. routine is called that advances the input stream to some point where
  207. parsing should once again commence. The next symbol returned by the
  208. lexical scanner is probably correct. The previous look-ahead token
  209. ought to be discarded with `yyclearin;'.
  210. The macro `YYRECOVERING' stands for an expression that has the value
  211. 1 when the parser is recovering from a syntax error, and 0 the rest of
  212. the time. A value of 1 indicates that error messages are currently
  213. suppressed for new syntax errors.
  214. 
  215. File: bison.info, Node: Context Dependency, Next: Debugging, Prev: Error Recovery, Up: Top
  216. Handling Context Dependencies
  217. *****************************
  218. The Bison paradigm is to parse tokens first, then group them into
  219. larger syntactic units. In many languages, the meaning of a token is
  220. affected by its context. Although this violates the Bison paradigm,
  221. certain techniques (known as "kludges") may enable you to write Bison
  222. parsers for such languages.
  223. * Menu:
  224. * Semantic Tokens:: Token parsing can depend on the semantic context.
  225. * Lexical Tie-ins:: Token parsing can depend on the syntactic context.
  226. * Tie-in Recovery:: Lexical tie-ins have implications for how
  227. error recovery rules must be written.
  228. (Actually, "kludge" means any technique that gets its job done but is
  229. neither clean nor robust.)
  230. 
  231. File: bison.info, Node: Semantic Tokens, Next: Lexical Tie-ins, Up: Context Dependency
  232. Semantic Info in Token Types
  233. ============================
  234. The C language has a context dependency: the way an identifier is
  235. used depends on what its current meaning is. For example, consider
  236. this:
  237. foo (x);
  238. This looks like a function call statement, but if `foo' is a typedef
  239. name, then this is actually a declaration of `x'. How can a Bison
  240. parser for C decide how to parse this input?
  241. The method used in GNU C is to have two different token types,
  242. `IDENTIFIER' and `TYPENAME'. When `yylex' finds an identifier, it
  243. looks up the current declaration of the identifier in order to decide
  244. which token type to return: `TYPENAME' if the identifier is declared as
  245. a typedef, `IDENTIFIER' otherwise.
  246. The grammar rules can then express the context dependency by the
  247. choice of token type to recognize. `IDENTIFIER' is accepted as an
  248. expression, but `TYPENAME' is not. `TYPENAME' can start a declaration,
  249. but `IDENTIFIER' cannot. In contexts where the meaning of the
  250. identifier is *not* significant, such as in declarations that can
  251. shadow a typedef name, either `TYPENAME' or `IDENTIFIER' is
  252. accepted--there is one rule for each of the two token types.
  253. This technique is simple to use if the decision of which kinds of
  254. identifiers to allow is made at a place close to where the identifier is
  255. parsed. But in C this is not always so: C allows a declaration to
  256. redeclare a typedef name provided an explicit type has been specified
  257. earlier:
  258. typedef int foo, bar, lose;
  259. static foo (bar); /* redeclare `bar' as static variable */
  260. static int foo (lose); /* redeclare `foo' as function */
  261. Unfortunately, the name being declared is separated from the
  262. declaration construct itself by a complicated syntactic structure--the
  263. "declarator".
  264. As a result, the part of Bison parser for C needs to be duplicated,
  265. with all the nonterminal names changed: once for parsing a declaration
  266. in which a typedef name can be redefined, and once for parsing a
  267. declaration in which that can't be done. Here is a part of the
  268. duplication, with actions omitted for brevity:
  269. initdcl:
  270. declarator maybeasm '='
  271. init
  272. | declarator maybeasm
  273. ;
  274. notype_initdcl:
  275. notype_declarator maybeasm '='
  276. init
  277. | notype_declarator maybeasm
  278. ;
  279. Here `initdcl' can redeclare a typedef name, but `notype_initdcl'
  280. cannot. The distinction between `declarator' and `notype_declarator'
  281. is the same sort of thing.
  282. There is some similarity between this technique and a lexical tie-in
  283. (described next), in that information which alters the lexical analysis
  284. is changed during parsing by other parts of the program. The
  285. difference is here the information is global, and is used for other
  286. purposes in the program. A true lexical tie-in has a special-purpose
  287. flag controlled by the syntactic context.
  288. 
  289. File: bison.info, Node: Lexical Tie-ins, Next: Tie-in Recovery, Prev: Semantic Tokens, Up: Context Dependency
  290. Lexical Tie-ins
  291. ===============
  292. One way to handle context-dependency is the "lexical tie-in": a flag
  293. which is set by Bison actions, whose purpose is to alter the way tokens
  294. are parsed.
  295. For example, suppose we have a language vaguely like C, but with a
  296. special construct `hex (HEX-EXPR)'. After the keyword `hex' comes an
  297. expression in parentheses in which all integers are hexadecimal. In
  298. particular, the token `a1b' must be treated as an integer rather than
  299. as an identifier if it appears in that context. Here is how you can do
  300. it:
  301. %{
  302. int hexflag;
  303. %}
  304. %%
  305. ...
  306. expr: IDENTIFIER
  307. | constant
  308. | HEX '('
  309. { hexflag = 1; }
  310. expr ')'
  311. { hexflag = 0;
  312. $$ = $4; }
  313. | expr '+' expr
  314. { $$ = make_sum ($1, $3); }
  315. ...
  316. ;
  317. constant:
  318. INTEGER
  319. | STRING
  320. ;
  321. Here we assume that `yylex' looks at the value of `hexflag'; when it is
  322. nonzero, all integers are parsed in hexadecimal, and tokens starting
  323. with letters are parsed as integers if possible.
  324. The declaration of `hexflag' shown in the C declarations section of
  325. the parser file is needed to make it accessible to the actions (*note
  326. The C Declarations Section: C Declarations.). You must also write the
  327. code in `yylex' to obey the flag.
  328. 
  329. File: bison.info, Node: Tie-in Recovery, Prev: Lexical Tie-ins, Up: Context Dependency
  330. Lexical Tie-ins and Error Recovery
  331. ==================================
  332. Lexical tie-ins make strict demands on any error recovery rules you
  333. have. *Note Error Recovery::.
  334. The reason for this is that the purpose of an error recovery rule is
  335. to abort the parsing of one construct and resume in some larger
  336. construct. For example, in C-like languages, a typical error recovery
  337. rule is to skip tokens until the next semicolon, and then start a new
  338. statement, like this:
  339. stmt: expr ';'
  340. | IF '(' expr ')' stmt { ... }
  341. ...
  342. error ';'
  343. { hexflag = 0; }
  344. ;
  345. If there is a syntax error in the middle of a `hex (EXPR)'
  346. construct, this error rule will apply, and then the action for the
  347. completed `hex (EXPR)' will never run. So `hexflag' would remain set
  348. for the entire rest of the input, or until the next `hex' keyword,
  349. causing identifiers to be misinterpreted as integers.
  350. To avoid this problem the error recovery rule itself clears
  351. `hexflag'.
  352. There may also be an error recovery rule that works within
  353. expressions. For example, there could be a rule which applies within
  354. parentheses and skips to the close-parenthesis:
  355. expr: ...
  356. | '(' expr ')'
  357. { $$ = $2; }
  358. | '(' error ')'
  359. ...
  360. If this rule acts within the `hex' construct, it is not going to
  361. abort that construct (since it applies to an inner level of parentheses
  362. within the construct). Therefore, it should not clear the flag: the
  363. rest of the `hex' construct should be parsed with the flag still in
  364. effect.
  365. What if there is an error recovery rule which might abort out of the
  366. `hex' construct or might not, depending on circumstances? There is no
  367. way you can write the action to determine whether a `hex' construct is
  368. being aborted or not. So if you are using a lexical tie-in, you had
  369. better make sure your error recovery rules are not of this kind. Each
  370. rule must be such that you can be sure that it always will, or always
  371. won't, have to clear the flag.
  372. 
  373. File: bison.info, Node: Debugging, Next: Invocation, Prev: Context Dependency, Up: Top
  374. Debugging Your Parser
  375. *********************
  376. If a Bison grammar compiles properly but doesn't do what you want
  377. when it runs, the `yydebug' parser-trace feature can help you figure
  378. out why.
  379. To enable compilation of trace facilities, you must define the macro
  380. `YYDEBUG' when you compile the parser. You could use `-DYYDEBUG=1' as
  381. a compiler option or you could put `#define YYDEBUG 1' in the C
  382. declarations section of the grammar file (*note The C Declarations
  383. Section: C Declarations.). Alternatively, use the `-t' option when you
  384. run Bison (*note Invoking Bison: Invocation.). We always define
  385. `YYDEBUG' so that debugging is always possible.
  386. The trace facility uses `stderr', so you must add
  387. `#include <stdio.h>' to the C declarations section unless it is already
  388. there.
  389. Once you have compiled the program with trace facilities, the way to
  390. request a trace is to store a nonzero value in the variable `yydebug'.
  391. You can do this by making the C code do it (in `main', perhaps), or you
  392. can alter the value with a C debugger.
  393. Each step taken by the parser when `yydebug' is nonzero produces a
  394. line or two of trace information, written on `stderr'. The trace
  395. messages tell you these things:
  396. * Each time the parser calls `yylex', what kind of token was read.
  397. * Each time a token is shifted, the depth and complete contents of
  398. the state stack (*note Parser States::.).
  399. * Each time a rule is reduced, which rule it is, and the complete
  400. contents of the state stack afterward.
  401. To make sense of this information, it helps to refer to the listing
  402. file produced by the Bison `-v' option (*note Invoking Bison:
  403. Invocation.). This file shows the meaning of each state in terms of
  404. positions in various rules, and also what each state will do with each
  405. possible input token. As you read the successive trace messages, you
  406. can see that the parser is functioning according to its specification
  407. in the listing file. Eventually you will arrive at the place where
  408. something undesirable happens, and you will see which parts of the
  409. grammar are to blame.
  410. The parser file is a C program and you can use C debuggers on it,
  411. but it's not easy to interpret what it is doing. The parser function
  412. is a finite-state machine interpreter, and aside from the actions it
  413. executes the same code over and over. Only the values of variables
  414. show where in the grammar it is working.
  415. The debugging information normally gives the token type of each token
  416. read, but not its semantic value. You can optionally define a macro
  417. named `YYPRINT' to provide a way to print the value. If you define
  418. `YYPRINT', it should take three arguments. The parser will pass a
  419. standard I/O stream, the numeric code for the token type, and the token
  420. value (from `yylval').
  421. Here is an example of `YYPRINT' suitable for the multi-function
  422. calculator (*note Declarations for `mfcalc': Mfcalc Decl.):
  423. #define YYPRINT(file, type, value) yyprint (file, type, value)
  424. static void
  425. yyprint (file, type, value)
  426. FILE *file;
  427. int type;
  428. YYSTYPE value;
  429. {
  430. if (type == VAR)
  431. fprintf (file, " %s", value.tptr->name);
  432. else if (type == NUM)
  433. fprintf (file, " %d", value.val);
  434. }
  435. 
  436. File: bison.info, Node: Invocation, Next: Table of Symbols, Prev: Debugging, Up: Top
  437. Invoking Bison
  438. **************
  439. The usual way to invoke Bison is as follows:
  440. bison INFILE
  441. Here INFILE is the grammar file name, which usually ends in `.y'.
  442. The parser file's name is made by replacing the `.y' with `.tab.c'.
  443. Thus, the `bison foo.y' filename yields `foo.tab.c', and the `bison
  444. hack/foo.y' filename yields `hack/foo.tab.c'.
  445. * Menu:
  446. * Bison Options:: All the options described in detail,
  447. in alphabetical order by short options.
  448. * Option Cross Key:: Alphabetical list of long options.
  449. * VMS Invocation:: Bison command syntax on VMS.
  450. 
  451. File: bison.info, Node: Bison Options, Next: Option Cross Key, Up: Invocation
  452. Bison Options
  453. =============
  454. Bison supports both traditional single-letter options and mnemonic
  455. long option names. Long option names are indicated with `--' instead of
  456. `-'. Abbreviations for option names are allowed as long as they are
  457. unique. When a long option takes an argument, like `--file-prefix',
  458. connect the option name and the argument with `='.
  459. Here is a list of options that can be used with Bison, alphabetized
  460. by short option. It is followed by a cross key alphabetized by long
  461. option.
  462. `-b FILE-PREFIX'
  463. `--file-prefix=PREFIX'
  464. Specify a prefix to use for all Bison output file names. The
  465. names are chosen as if the input file were named `PREFIX.c'.
  466. `-d'
  467. `--defines'
  468. Write an extra output file containing macro definitions for the
  469. token type names defined in the grammar and the semantic value type
  470. `YYSTYPE', as well as a few `extern' variable declarations.
  471. If the parser output file is named `NAME.c' then this file is
  472. named `NAME.h'.
  473. This output file is essential if you wish to put the definition of
  474. `yylex' in a separate source file, because `yylex' needs to be
  475. able to refer to token type codes and the variable `yylval'.
  476. *Note Semantic Values of Tokens: Token Values.
  477. `-l'
  478. `--no-lines'
  479. Don't put any `#line' preprocessor commands in the parser file.
  480. Ordinarily Bison puts them in the parser file so that the C
  481. compiler and debuggers will associate errors with your source
  482. file, the grammar file. This option causes them to associate
  483. errors with the parser file, treating it an independent source
  484. file in its own right.
  485. `-o OUTFILE'
  486. `--output-file=OUTFILE'
  487. Specify the name OUTFILE for the parser file.
  488. The other output files' names are constructed from OUTFILE as
  489. described under the `-v' and `-d' switches.
  490. `-p PREFIX'
  491. `--name-prefix=PREFIX'
  492. Rename the external symbols used in the parser so that they start
  493. with PREFIX instead of `yy'. The precise list of symbols renamed
  494. is `yyparse', `yylex', `yyerror', `yylval', `yychar' and `yydebug'.
  495. For example, if you use `-p c', the names become `cparse', `clex',
  496. and so on.
  497. *Note Multiple Parsers in the Same Program: Multiple Parsers.
  498. `-t'
  499. `--debug'
  500. Output a definition of the macro `YYDEBUG' into the parser file,
  501. so that the debugging facilities are compiled. *Note Debugging
  502. Your Parser: Debugging.
  503. `-v'
  504. `--verbose'
  505. Write an extra output file containing verbose descriptions of the
  506. parser states and what is done for each type of look-ahead token in
  507. that state.
  508. This file also describes all the conflicts, both those resolved by
  509. operator precedence and the unresolved ones.
  510. The file's name is made by removing `.tab.c' or `.c' from the
  511. parser output file name, and adding `.output' instead.
  512. Therefore, if the input file is `foo.y', then the parser file is
  513. called `foo.tab.c' by default. As a consequence, the verbose
  514. output file is called `foo.output'.
  515. `-V'
  516. `--version'
  517. Print the version number of Bison and exit.
  518. `-h'
  519. `--help'
  520. Print a summary of the command-line options to Bison and exit.
  521. `-y'
  522. `--yacc'
  523. `--fixed-output-files'
  524. Equivalent to `-o y.tab.c'; the parser output file is called
  525. `y.tab.c', and the other outputs are called `y.output' and
  526. `y.tab.h'. The purpose of this switch is to imitate Yacc's output
  527. file name conventions. Thus, the following shell script can
  528. substitute for Yacc:
  529. bison -y $*
  530. 
  531. File: bison.info, Node: Option Cross Key, Next: VMS Invocation, Prev: Bison Options, Up: Invocation
  532. Option Cross Key
  533. ================
  534. Here is a list of options, alphabetized by long option, to help you
  535. find the corresponding short option.
  536. --debug -t
  537. --defines -d
  538. --file-prefix=PREFIX -b FILE-PREFIX
  539. --fixed-output-files --yacc -y
  540. --help -h
  541. --name-prefix -p
  542. --no-lines -l
  543. --output-file=OUTFILE -o OUTFILE
  544. --verbose -v
  545. --version -V
  546. 
  547. File: bison.info, Node: VMS Invocation, Prev: Option Cross Key, Up: Invocation
  548. Invoking Bison under VMS
  549. ========================
  550. The command line syntax for Bison on VMS is a variant of the usual
  551. Bison command syntax--adapted to fit VMS conventions.
  552. To find the VMS equivalent for any Bison option, start with the long
  553. option, and substitute a `/' for the leading `--', and substitute a `_'
  554. for each `-' in the name of the long option. For example, the
  555. following invocation under VMS:
  556. bison /debug/name_prefix=bar foo.y
  557. is equivalent to the following command under POSIX.
  558. bison --debug --name-prefix=bar foo.y
  559. The VMS file system does not permit filenames such as `foo.tab.c'.
  560. In the above example, the output file would instead be named
  561. `foo_tab.c'.
  562. 
  563. File: bison.info, Node: Table of Symbols, Next: Glossary, Prev: Invocation, Up: Top
  564. Bison Symbols
  565. *************
  566. `error'
  567. A token name reserved for error recovery. This token may be used
  568. in grammar rules so as to allow the Bison parser to recognize an
  569. error in the grammar without halting the process. In effect, a
  570. sentence containing an error may be recognized as valid. On a
  571. parse error, the token `error' becomes the current look-ahead
  572. token. Actions corresponding to `error' are then executed, and
  573. the look-ahead token is reset to the token that originally caused
  574. the violation. *Note Error Recovery::.
  575. `YYABORT'
  576. Macro to pretend that an unrecoverable syntax error has occurred,
  577. by making `yyparse' return 1 immediately. The error reporting
  578. function `yyerror' is not called. *Note The Parser Function
  579. `yyparse': Parser Function.
  580. `YYACCEPT'
  581. Macro to pretend that a complete utterance of the language has been
  582. read, by making `yyparse' return 0 immediately. *Note The Parser
  583. Function `yyparse': Parser Function.
  584. `YYBACKUP'
  585. Macro to discard a value from the parser stack and fake a
  586. look-ahead token. *Note Special Features for Use in Actions:
  587. Action Features.
  588. `YYERROR'
  589. Macro to pretend that a syntax error has just been detected: call
  590. `yyerror' and then perform normal error recovery if possible
  591. (*note Error Recovery::.), or (if recovery is impossible) make
  592. `yyparse' return 1. *Note Error Recovery::.
  593. `YYERROR_VERBOSE'
  594. Macro that you define with `#define' in the Bison declarations
  595. section to request verbose, specific error message strings when
  596. `yyerror' is called.
  597. `YYINITDEPTH'
  598. Macro for specifying the initial size of the parser stack. *Note
  599. Stack Overflow::.
  600. `YYLTYPE'
  601. Macro for the data type of `yylloc'; a structure with four
  602. members. *Note Textual Positions of Tokens: Token Positions.
  603. `YYMAXDEPTH'
  604. Macro for specifying the maximum size of the parser stack. *Note
  605. Stack Overflow::.
  606. `YYRECOVERING'
  607. Macro whose value indicates whether the parser is recovering from a
  608. syntax error. *Note Special Features for Use in Actions: Action
  609. Features.
  610. `YYSTYPE'
  611. Macro for the data type of semantic values; `int' by default.
  612. *Note Data Types of Semantic Values: Value Type.
  613. `yychar'
  614. External integer variable that contains the integer value of the
  615. current look-ahead token. (In a pure parser, it is a local
  616. variable within `yyparse'.) Error-recovery rule actions may
  617. examine this variable. *Note Special Features for Use in Actions:
  618. Action Features.
  619. `yyclearin'
  620. Macro used in error-recovery rule actions. It clears the previous
  621. look-ahead token. *Note Error Recovery::.
  622. `yydebug'
  623. External integer variable set to zero by default. If `yydebug' is
  624. given a nonzero value, the parser will output information on input
  625. symbols and parser action. *Note Debugging Your Parser: Debugging.
  626. `yyerrok'
  627. Macro to cause parser to recover immediately to its normal mode
  628. after a parse error. *Note Error Recovery::.
  629. `yyerror'
  630. User-supplied function to be called by `yyparse' on error. The
  631. function receives one argument, a pointer to a character string
  632. containing an error message. *Note The Error Reporting Function
  633. `yyerror': Error Reporting.
  634. `yylex'
  635. User-supplied lexical analyzer function, called with no arguments
  636. to get the next token. *Note The Lexical Analyzer Function
  637. `yylex': Lexical.
  638. `yylval'
  639. External variable in which `yylex' should place the semantic value
  640. associated with a token. (In a pure parser, it is a local
  641. variable within `yyparse', and its address is passed to `yylex'.)
  642. *Note Semantic Values of Tokens: Token Values.
  643. `yylloc'
  644. External variable in which `yylex' should place the line and
  645. column numbers associated with a token. (In a pure parser, it is a
  646. local variable within `yyparse', and its address is passed to
  647. `yylex'.) You can ignore this variable if you don't use the `@'
  648. feature in the grammar actions. *Note Textual Positions of
  649. Tokens: Token Positions.
  650. `yynerrs'
  651. Global variable which Bison increments each time there is a parse
  652. error. (In a pure parser, it is a local variable within
  653. `yyparse'.) *Note The Error Reporting Function `yyerror': Error
  654. Reporting.
  655. `yyparse'
  656. The parser function produced by Bison; call this function to start
  657. parsing. *Note The Parser Function `yyparse': Parser Function.
  658. `%left'
  659. Bison declaration to assign left associativity to token(s). *Note
  660. Operator Precedence: Precedence Decl.
  661. `%nonassoc'
  662. Bison declaration to assign nonassociativity to token(s). *Note
  663. Operator Precedence: Precedence Decl.
  664. `%prec'
  665. Bison declaration to assign a precedence to a specific rule.
  666. *Note Context-Dependent Precedence: Contextual Precedence.
  667. `%pure_parser'
  668. Bison declaration to request a pure (reentrant) parser. *Note A
  669. Pure (Reentrant) Parser: Pure Decl.
  670. `%right'
  671. Bison declaration to assign right associativity to token(s).
  672. *Note Operator Precedence: Precedence Decl.
  673. `%start'
  674. Bison declaration to specify the start symbol. *Note The
  675. Start-Symbol: Start Decl.
  676. `%token'
  677. Bison declaration to declare token(s) without specifying
  678. precedence. *Note Token Type Names: Token Decl.
  679. `%type'
  680. Bison declaration to declare nonterminals. *Note Nonterminal
  681. Symbols: Type Decl.
  682. `%union'
  683. Bison declaration to specify several possible data types for
  684. semantic values. *Note The Collection of Value Types: Union Decl.
  685. These are the punctuation and delimiters used in Bison input:
  686. `%%'
  687. Delimiter used to separate the grammar rule section from the Bison
  688. declarations section or the additional C code section. *Note The
  689. Overall Layout of a Bison Grammar: Grammar Layout.
  690. `%{ %}'
  691. All code listed between `%{' and `%}' is copied directly to the
  692. output file uninterpreted. Such code forms the "C declarations"
  693. section of the input file. *Note Outline of a Bison Grammar:
  694. Grammar Outline.
  695. `/*...*/'
  696. Comment delimiters, as in C.
  697. `:'
  698. Separates a rule's result from its components. *Note Syntax of
  699. Grammar Rules: Rules.
  700. `;'
  701. Terminates a rule. *Note Syntax of Grammar Rules: Rules.
  702. `|'
  703. Separates alternate rules for the same result nonterminal. *Note
  704. Syntax of Grammar Rules: Rules.
  705. 
  706. File: bison.info, Node: Glossary, Next: Index, Prev: Table of Symbols, Up: Top
  707. Glossary
  708. ********
  709. Backus-Naur Form (BNF)
  710. Formal method of specifying context-free grammars. BNF was first
  711. used in the `ALGOL-60' report, 1963. *Note Languages and
  712. Context-Free Grammars: Language and Grammar.
  713. Context-free grammars
  714. Grammars specified as rules that can be applied regardless of
  715. context. Thus, if there is a rule which says that an integer can
  716. be used as an expression, integers are allowed *anywhere* an
  717. expression is permitted. *Note Languages and Context-Free
  718. Grammars: Language and Grammar.
  719. Dynamic allocation
  720. Allocation of memory that occurs during execution, rather than at
  721. compile time or on entry to a function.
  722. Empty string
  723. Analogous to the empty set in set theory, the empty string is a
  724. character string of length zero.
  725. Finite-state stack machine
  726. A "machine" that has discrete states in which it is said to exist
  727. at each instant in time. As input to the machine is processed, the
  728. machine moves from state to state as specified by the logic of the
  729. machine. In the case of the parser, the input is the language
  730. being parsed, and the states correspond to various stages in the
  731. grammar rules. *Note The Bison Parser Algorithm: Algorithm.
  732. Grouping
  733. A language construct that is (in general) grammatically divisible;
  734. for example, `expression' or `declaration' in C. *Note Languages
  735. and Context-Free Grammars: Language and Grammar.
  736. Infix operator
  737. An arithmetic operator that is placed between the operands on
  738. which it performs some operation.
  739. Input stream
  740. A continuous flow of data between devices or programs.
  741. Language construct
  742. One of the typical usage schemas of the language. For example,
  743. one of the constructs of the C language is the `if' statement.
  744. *Note Languages and Context-Free Grammars: Language and Grammar.
  745. Left associativity
  746. Operators having left associativity are analyzed from left to
  747. right: `a+b+c' first computes `a+b' and then combines with `c'.
  748. *Note Operator Precedence: Precedence.
  749. Left recursion
  750. A rule whose result symbol is also its first component symbol; for
  751. example, `expseq1 : expseq1 ',' exp;'. *Note Recursive Rules:
  752. Recursion.
  753. Left-to-right parsing
  754. Parsing a sentence of a language by analyzing it token by token
  755. from left to right. *Note The Bison Parser Algorithm: Algorithm.
  756. Lexical analyzer (scanner)
  757. A function that reads an input stream and returns tokens one by
  758. one. *Note The Lexical Analyzer Function `yylex': Lexical.
  759. Lexical tie-in
  760. A flag, set by actions in the grammar rules, which alters the way
  761. tokens are parsed. *Note Lexical Tie-ins::.
  762. Look-ahead token
  763. A token already read but not yet shifted. *Note Look-Ahead
  764. Tokens: Look-Ahead.
  765. LALR(1)
  766. The class of context-free grammars that Bison (like most other
  767. parser generators) can handle; a subset of LR(1). *Note
  768. Mysterious Reduce/Reduce Conflicts: Mystery Conflicts.
  769. LR(1)
  770. The class of context-free grammars in which at most one token of
  771. look-ahead is needed to disambiguate the parsing of any piece of
  772. input.
  773. Nonterminal symbol
  774. A grammar symbol standing for a grammatical construct that can be
  775. expressed through rules in terms of smaller constructs; in other
  776. words, a construct that is not a token. *Note Symbols::.
  777. Parse error
  778. An error encountered during parsing of an input stream due to
  779. invalid syntax. *Note Error Recovery::.
  780. Parser
  781. A function that recognizes valid sentences of a language by
  782. analyzing the syntax structure of a set of tokens passed to it
  783. from a lexical analyzer.
  784. Postfix operator
  785. An arithmetic operator that is placed after the operands upon
  786. which it performs some operation.
  787. Reduction
  788. Replacing a string of nonterminals and/or terminals with a single
  789. nonterminal, according to a grammar rule. *Note The Bison Parser
  790. Algorithm: Algorithm.
  791. Reentrant
  792. A reentrant subprogram is a subprogram which can be in invoked any
  793. number of times in parallel, without interference between the
  794. various invocations. *Note A Pure (Reentrant) Parser: Pure Decl.
  795. Reverse polish notation
  796. A language in which all operators are postfix operators.
  797. Right recursion
  798. A rule whose result symbol is also its last component symbol; for
  799. example, `expseq1: exp ',' expseq1;'. *Note Recursive Rules:
  800. Recursion.
  801. Semantics
  802. In computer languages, the semantics are specified by the actions
  803. taken for each instance of the language, i.e., the meaning of each
  804. statement. *Note Defining Language Semantics: Semantics.
  805. Shift
  806. A parser is said to shift when it makes the choice of analyzing
  807. further input from the stream rather than reducing immediately some
  808. already-recognized rule. *Note The Bison Parser Algorithm:
  809. Algorithm.
  810. Single-character literal
  811. A single character that is recognized and interpreted as is.
  812. *Note From Formal Rules to Bison Input: Grammar in Bison.
  813. Start symbol
  814. The nonterminal symbol that stands for a complete valid utterance
  815. in the language being parsed. The start symbol is usually listed
  816. as the first nonterminal symbol in a language specification.
  817. *Note The Start-Symbol: Start Decl.
  818. Symbol table
  819. A data structure where symbol names and associated data are stored
  820. during parsing to allow for recognition and use of existing
  821. information in repeated uses of a symbol. *Note Multi-function
  822. Calc::.
  823. Token
  824. A basic, grammatically indivisible unit of a language. The symbol
  825. that describes a token in the grammar is a terminal symbol. The
  826. input of the Bison parser is a stream of tokens which comes from
  827. the lexical analyzer. *Note Symbols::.
  828. Terminal symbol
  829. A grammar symbol that has no rules in the grammar and therefore is
  830. grammatically indivisible. The piece of text it represents is a
  831. token. *Note Languages and Context-Free Grammars: Language and
  832. Grammar.
  833. 
  834. File: bison.info, Node: Index, Prev: Glossary, Up: Top
  835. Index
  836. *****
  837. * Menu:
  838. * $$: Actions.
  839. * $N: Actions.
  840. * %expect: Expect Decl.
  841. * %left: Using Precedence.
  842. * %nonassoc: Using Precedence.
  843. * %prec: Contextual Precedence.
  844. * %pure_parser: Pure Decl.
  845. * %right: Using Precedence.
  846. * %start: Start Decl.
  847. * %token: Token Decl.
  848. * %type: Type Decl.
  849. * %union: Union Decl.
  850. * @N: Action Features.
  851. * calc: Infix Calc.
  852. * else, dangling: Shift/Reduce.
  853. * mfcalc: Multi-function Calc.
  854. * rpcalc: RPN Calc.
  855. * action: Actions.
  856. * action data types: Action Types.
  857. * action features summary: Action Features.
  858. * actions in mid-rule: Mid-Rule Actions.
  859. * actions, semantic: Semantic Actions.
  860. * additional C code section: C Code.
  861. * algorithm of parser: Algorithm.
  862. * associativity: Why Precedence.
  863. * Backus-Naur form: Language and Grammar.
  864. * Bison declaration summary: Decl Summary.
  865. * Bison declarations: Declarations.
  866. * Bison declarations (introduction): Bison Declarations.
  867. * Bison grammar: Grammar in Bison.
  868. * Bison invocation: Invocation.
  869. * Bison parser: Bison Parser.
  870. * Bison parser algorithm: Algorithm.
  871. * Bison symbols, table of: Table of Symbols.
  872. * Bison utility: Bison Parser.
  873. * BNF: Language and Grammar.
  874. * C code, section for additional: C Code.
  875. * C declarations section: C Declarations.
  876. * C-language interface: Interface.
  877. * calculator, infix notation: Infix Calc.
  878. * calculator, multi-function: Multi-function Calc.
  879. * calculator, simple: RPN Calc.
  880. * character token: Symbols.
  881. * compiling the parser: Rpcalc Compile.
  882. * conflicts: Shift/Reduce.
  883. * conflicts, reduce/reduce: Reduce/Reduce.
  884. * conflicts, suppressing warnings of: Expect Decl.
  885. * context-dependent precedence: Contextual Precedence.
  886. * context-free grammar: Language and Grammar.
  887. * controlling function: Rpcalc Main.
  888. * dangling else: Shift/Reduce.
  889. * data types in actions: Action Types.
  890. * data types of semantic values: Value Type.
  891. * debugging: Debugging.
  892. * declaration summary: Decl Summary.
  893. * declarations, Bison: Declarations.
  894. * declarations, Bison (introduction): Bison Declarations.
  895. * declarations, C: C Declarations.
  896. * declaring operator precedence: Precedence Decl.
  897. * declaring the start symbol: Start Decl.
  898. * declaring token type names: Token Decl.
  899. * declaring value types: Union Decl.
  900. * declaring value types, nonterminals: Type Decl.
  901. * default action: Actions.
  902. * default data type: Value Type.
  903. * default stack limit: Stack Overflow.
  904. * default start symbol: Start Decl.
  905. * defining language semantics: Semantics.
  906. * error: Error Recovery.
  907. * error recovery: Error Recovery.
  908. * error recovery, simple: Simple Error Recovery.
  909. * error reporting function: Error Reporting.
  910. * error reporting routine: Rpcalc Error.
  911. * examples, simple: Examples.
  912. * exercises: Exercises.
  913. * file format: Grammar Layout.
  914. * finite-state machine: Parser States.
  915. * formal grammar: Grammar in Bison.
  916. * format of grammar file: Grammar Layout.
  917. * glossary: Glossary.
  918. * grammar file: Grammar Layout.
  919. * grammar rule syntax: Rules.
  920. * grammar rules section: Grammar Rules.
  921. * grammar, Bison: Grammar in Bison.
  922. * grammar, context-free: Language and Grammar.
  923. * grouping, syntactic: Language and Grammar.
  924. * infix notation calculator: Infix Calc.
  925. * interface: Interface.
  926. * introduction: Introduction.
  927. * invoking Bison: Invocation.
  928. * invoking Bison under VMS: VMS Invocation.
  929. * LALR(1): Mystery Conflicts.
  930. * language semantics, defining: Semantics.
  931. * layout of Bison grammar: Grammar Layout.
  932. * left recursion: Recursion.
  933. * lexical analyzer: Lexical.
  934. * lexical analyzer, purpose: Bison Parser.
  935. * lexical analyzer, writing: Rpcalc Lexer.
  936. * lexical tie-in: Lexical Tie-ins.
  937. * literal token: Symbols.
  938. * look-ahead token: Look-Ahead.
  939. * LR(1): Mystery Conflicts.
  940. * main function in simple example: Rpcalc Main.
  941. * mid-rule actions: Mid-Rule Actions.
  942. * multi-function calculator: Multi-function Calc.
  943. * mutual recursion: Recursion.
  944. * nonterminal symbol: Symbols.
  945. * operator precedence: Precedence.
  946. * operator precedence, declaring: Precedence Decl.
  947. * options for invoking Bison: Invocation.
  948. * overflow of parser stack: Stack Overflow.
  949. * parse error: Error Reporting.
  950. * parser: Bison Parser.
  951. * parser stack: Algorithm.
  952. * parser stack overflow: Stack Overflow.
  953. * parser state: Parser States.
  954. * polish notation calculator: RPN Calc.
  955. * precedence declarations: Precedence Decl.
  956. * precedence of operators: Precedence.
  957. * precedence, context-dependent: Contextual Precedence.
  958. * precedence, unary operator: Contextual Precedence.
  959. * preventing warnings about conflicts: Expect Decl.
  960. * pure parser: Pure Decl.
  961. * recovery from errors: Error Recovery.
  962. * recursive rule: Recursion.
  963. * reduce/reduce conflict: Reduce/Reduce.
  964. * reduction: Algorithm.
  965. * reentrant parser: Pure Decl.
  966. * reverse polish notation: RPN Calc.
  967. * right recursion: Recursion.
  968. * rule syntax: Rules.
  969. * rules section for grammar: Grammar Rules.
  970. * running Bison (introduction): Rpcalc Gen.
  971. * semantic actions: Semantic Actions.
  972. * semantic value: Semantic Values.
  973. * semantic value type: Value Type.
  974. * shift/reduce conflicts: Shift/Reduce.
  975. * shifting: Algorithm.
  976. * simple examples: Examples.
  977. * single-character literal: Symbols.
  978. * stack overflow: Stack Overflow.
  979. * stack, parser: Algorithm.
  980. * stages in using Bison: Stages.
  981. * start symbol: Language and Grammar.
  982. * start symbol, declaring: Start Decl.
  983. * state (of parser): Parser States.
  984. * summary, action features: Action Features.
  985. * summary, Bison declaration: Decl Summary.
  986. * suppressing conflict warnings: Expect Decl.
  987. * symbol: Symbols.
  988. * symbol table example: Mfcalc Symtab.
  989. * symbols (abstract): Language and Grammar.
  990. * symbols in Bison, table of: Table of Symbols.
  991. * syntactic grouping: Language and Grammar.
  992. * syntax error: Error Reporting.
  993. * syntax of grammar rules: Rules.
  994. * terminal symbol: Symbols.
  995. * token: Language and Grammar.
  996. * token type: Symbols.
  997. * token type names, declaring: Token Decl.
  998. * tracing the parser: Debugging.
  999. * unary operator precedence: Contextual Precedence.
  1000. * using Bison: Stages.
  1001. * value type, semantic: Value Type.
  1002. * value types, declaring: Union Decl.
  1003. * value types, nonterminals, declaring: Type Decl.
  1004. * value, semantic: Semantic Values.
  1005. * VMS: VMS Invocation.
  1006. * warnings, preventing: Expect Decl.
  1007. * writing a lexical analyzer: Rpcalc Lexer.
  1008. * YYABORT: Parser Function.
  1009. * YYACCEPT: Parser Function.
  1010. * YYBACKUP: Action Features.
  1011. * yychar: Look-Ahead.
  1012. * yyclearin: Error Recovery.
  1013. * YYDEBUG: Debugging.
  1014. * yydebug: Debugging.
  1015. * YYEMPTY: Action Features.
  1016. * yyerrok: Error Recovery.
  1017. * YYERROR: Action Features.
  1018. * yyerror: Error Reporting.
  1019. * YYERROR_VERBOSE: Error Reporting.
  1020. * YYINITDEPTH: Stack Overflow.
  1021. * yylex: Lexical.
  1022. * yylloc: Token Positions.
  1023. * YYLTYPE: Token Positions.
  1024. * yylval: Token Values.
  1025. * YYMAXDEPTH: Stack Overflow.
  1026. * yynerrs: Error Reporting.
  1027. * yyparse: Parser Function.
  1028. * YYPRINT: Debugging.
  1029. * YYRECOVERING: Error Recovery.
  1030. * |: Rules.