bison.info-4 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727
  1. Info file bison.info, produced by Makeinfo, -*- Text -*- from input
  2. file bison.texinfo.
  3. This file documents the Bison parser generator.
  4. Copyright (C) 1988, 1989, 1990 Free Software Foundation, Inc.
  5. Permission is granted to make and distribute verbatim copies of
  6. this manual provided the copyright notice and this permission notice
  7. are preserved on all copies.
  8. Permission is granted to copy and distribute modified versions of
  9. this manual under the conditions for verbatim copying, provided also
  10. that the sections entitled "GNU General Public License" and
  11. "Conditions for Using Bison" are included exactly as in the original,
  12. and provided that the entire resulting derived work is distributed
  13. under the terms of a permission notice identical to this one.
  14. Permission is granted to copy and distribute translations of this
  15. manual into another language, under the above conditions for modified
  16. versions, except that the sections entitled "GNU General Public
  17. License", "Conditions for Using Bison" and this permission notice may
  18. be included in translations approved by the Free Software Foundation
  19. instead of in the original English.
  20. 
  21. File: bison.info, Node: Debugging, Next: Invocation, Prev: Context Dependency, Up: Top
  22. Debugging Your Parser
  23. *********************
  24. If a Bison grammar compiles properly but doesn't do what you want
  25. when it runs, the `yydebug' parser-trace feature can help you figure
  26. out why.
  27. To enable compilation of trace facilities, you must define the macro
  28. `YYDEBUG' when you compile the parser. You could use `-DYYDEBUG=1' as
  29. a compiler option or you could put `#define YYDEBUG 1' in the C
  30. declarations section of the grammar file (*note C Declarations::.).
  31. Alternatively, use the `-t' option when you run Bison (*note
  32. Invocation::.). We always define `YYDEBUG' so that debugging is
  33. always possible.
  34. The trace facility uses `stderr', so you must add
  35. `#include <stdio.h>' to the C declarations section unless it is
  36. already there.
  37. Once you have compiled the program with trace facilities, the way to
  38. request a trace is to store a nonzero value in the variable `yydebug'.
  39. You can do this by making the C code do it (in `main', perhaps), or
  40. you can alter the value with a C debugger.
  41. Each step taken by the parser when `yydebug' is nonzero produces a
  42. line or two of trace information, written on `stderr'. The trace
  43. messages tell you these things:
  44. * Each time the parser calls `yylex', what kind of token was read.
  45. * Each time a token is shifted, the depth and complete contents of
  46. the state stack (*note Parser States::.).
  47. * Each time a rule is reduced, which rule it is, and the complete
  48. contents of the state stack afterward.
  49. To make sense of this information, it helps to refer to the listing
  50. file produced by the Bison `-v' option (*note Invocation::.). This
  51. file shows the meaning of each state in terms of positions in various
  52. rules, and also what each state will do with each possible input
  53. token. As you read the successive trace messages, you can see that
  54. the parser is functioning according to its specification in the
  55. listing file. Eventually you will arrive at the place where something
  56. undesirable happens, and you will see which parts of the grammar are
  57. to blame.
  58. The parser file is a C program and you can use C debuggers on it,
  59. but it's not easy to interpret what it is doing. The parser function
  60. is a finite-state machine interpreter, and aside from the actions it
  61. executes the same code over and over. Only the values of variables
  62. show where in the grammar it is working.
  63. The debugging information normally gives the token type of each
  64. token read, but not its semantic value. You can optionally define a
  65. macro named `YYPRINT' to provide a way to print the value. If you
  66. define `YYPRINT', it should take three arguments. The parser will
  67. pass a standard I/O stream, the numeric code for the token type, and
  68. the token value (from `yylval').
  69. Here is an example of `YYPRINT' suitable for the multi-function
  70. calculator (*note Mfcalc Decl::.):
  71. #define YYPRINT(file, type, value) yyprint (file, type, value)
  72. static void
  73. yyprint (file, type, value)
  74. FILE *file;
  75. int type;
  76. YYSTYPE value;
  77. {
  78. if (type == VAR)
  79. fprintf (file, " %s", value.tptr->name);
  80. else if (type == NUM)
  81. fprintf (file, " %d", value.val);
  82. }
  83. 
  84. File: bison.info, Node: Invocation, Next: Table of Symbols, Prev: Debugging, Up: Top
  85. Invoking Bison
  86. **************
  87. The usual way to invoke Bison is as follows:
  88. bison INFILE
  89. Here INFILE is the grammar file name, which usually ends in `.y'.
  90. The parser file's name is made by replacing the `.y' with `.tab.c'.
  91. Thus, the `bison foo.y' filename yields `foo.tab.c', and the `bison
  92. hack/foo.y' filename yields `hack/foo.tab.c'.
  93. Bison supports both traditional single-letter options and mnemonic
  94. long option names. Long option names are indicated with `--' instead
  95. of `-'. Abbreviations for option names are allowed as long as they
  96. are unique. When a long option takes an argument, like
  97. `--file-prefix', connect the option name and the argument with `='.
  98. These options can be used with Bison:
  99. `-b FILE-PREFIX'
  100. `--file-prefix=PREFIX'
  101. Specify a prefix to use for all Bison output file names. The
  102. names are chosen as if the input file were named `PREFIX.c'.
  103. `-d'
  104. `--defines'
  105. Write an extra output file containing macro definitions for the
  106. token type names defined in the grammar and the semantic value
  107. type `YYSTYPE', as well as a few `extern' variable declarations.
  108. If the parser output file is named `NAME.c' then this file is
  109. named `NAME.h'.
  110. This output file is essential if you wish to put the definition of
  111. `yylex' in a separate source file, because `yylex' needs to be
  112. able to refer to token type codes and the variable `yylval'.
  113. *Note Token Values::.
  114. `-l'
  115. `--no-lines'
  116. Don't put any `#line' preprocessor commands in the parser file.
  117. Ordinarily Bison puts them in the parser file so that the C
  118. compiler and debuggers will associate errors with your source
  119. file, the grammar file. This option causes them to associate
  120. errors with the parser file, treating it an independent source
  121. file in its own right.
  122. `-o OUTFILE'
  123. `--output-file=OUTFILE'
  124. Specify the name OUTFILE for the parser file.
  125. The other output files' names are constructed from OUTFILE as
  126. described under the `-v' and `-d' switches.
  127. `-p PREFIX'
  128. `--name-prefix=PREFIX'
  129. Rename the external symbols used in the parser so that they start
  130. with PREFIX instead of `yy'. The precise list of symbols renamed
  131. is `yyparse', `yylex', `yyerror', `yylval', `yychar' and
  132. `yydebug'.
  133. For example, if you use `-p c', the names become `cparse',
  134. `clex', and so on.
  135. *Note Multiple Parsers::.
  136. `-t'
  137. `--debug'
  138. Output a definition of the macro `YYDEBUG' into the parser file,
  139. so that the debugging facilities are compiled. *Note Debugging::.
  140. `-v'
  141. `--verbose'
  142. Write an extra output file containing verbose descriptions of the
  143. parser states and what is done for each type of look-ahead token
  144. in that state.
  145. This file also describes all the conflicts, both those resolved by
  146. operator precedence and the unresolved ones.
  147. The file's name is made by removing `.tab.c' or `.c' from the
  148. parser output file name, and adding `.output' instead.
  149. Therefore, if the input file is `foo.y', then the parser file is
  150. called `foo.tab.c' by default. As a consequence, the verbose
  151. output file is called `foo.output'.
  152. `-V'
  153. `--version'
  154. Print the version number of Bison.
  155. `-y'
  156. `--yacc'
  157. `--fixed-output-files'
  158. Equivalent to `-o y.tab.c'; the parser output file is called
  159. `y.tab.c', and the other outputs are called `y.output' and
  160. `y.tab.h'. The purpose of this switch is to imitate Yacc's output
  161. file name conventions. Thus, the following shell script can
  162. substitute for Yacc:
  163. bison -y $*
  164. 
  165. File: bison.info, Node: Table of Symbols, Next: Glossary, Prev: Invocation, Up: Top
  166. Bison Symbols
  167. *************
  168. `error'
  169. A token name reserved for error recovery. This token may be used
  170. in grammar rules so as to allow the Bison parser to recognize an
  171. error in the grammar without halting the process. In effect, a
  172. sentence containing an error may be recognized as valid. On a
  173. parse error, the token `error' becomes the current look-ahead
  174. token. Actions corresponding to `error' are then executed, and
  175. the look-ahead token is reset to the token that originally caused
  176. the violation. *Note Error Recovery::.
  177. `YYABORT'
  178. Macro to pretend that an unrecoverable syntax error has occurred,
  179. by making `yyparse' return 1 immediately. The error reporting
  180. function `yyerror' is not called. *Note Parser Function::.
  181. `YYACCEPT'
  182. Macro to pretend that a complete utterance of the language has
  183. been read, by making `yyparse' return 0 immediately. *Note
  184. Parser Function::.
  185. `YYBACKUP'
  186. Macro to discard a value from the parser stack and fake a
  187. look-ahead token. *Note Action Features::.
  188. `YYERROR'
  189. Macro to pretend that a syntax error has just been detected: call
  190. `yyerror' and then perform normal error recovery if possible
  191. (*note Error Recovery::.), or (if recovery is impossible) make
  192. `yyparse' return 1. *Note Error Recovery::.
  193. `YYINITDEPTH'
  194. Macro for specifying the initial size of the parser stack. *Note
  195. Stack Overflow::.
  196. `YYLTYPE'
  197. Macro for the data type of `yylloc'; a structure with four
  198. members. *Note Token Positions::.
  199. `YYMAXDEPTH'
  200. Macro for specifying the maximum size of the parser stack. *Note
  201. Stack Overflow::.
  202. `YYRECOVERING'
  203. Macro whose value indicates whether the parser is recovering from
  204. a syntax error. *Note Action Features::.
  205. `YYSTYPE'
  206. Macro for the data type of semantic values; `int' by default.
  207. *Note Value Type::.
  208. `yychar'
  209. External integer variable that contains the integer value of the
  210. current look-ahead token. (In a pure parser, it is a local
  211. variable within `yyparse'.) Error-recovery rule actions may
  212. examine this variable. *Note Action Features::.
  213. `yyclearin'
  214. Macro used in error-recovery rule actions. It clears the previous
  215. look-ahead token. *Note Error Recovery::.
  216. `yydebug'
  217. External integer variable set to zero by default. If `yydebug'
  218. is given a nonzero value, the parser will output information on
  219. input symbols and parser action. *Note Debugging::.
  220. `yyerrok'
  221. Macro to cause parser to recover immediately to its normal mode
  222. after a parse error. *Note Error Recovery::.
  223. `yyerror'
  224. User-supplied function to be called by `yyparse' on error. The
  225. function receives one argument, a pointer to a character string
  226. containing an error message. *Note Error Reporting::.
  227. `yylex'
  228. User-supplied lexical analyzer function, called with no arguments
  229. to get the next token. *Note Lexical::.
  230. `yylval'
  231. External variable in which `yylex' should place the semantic
  232. value associated with a token. (In a pure parser, it is a local
  233. variable within `yyparse', and its address is passed to `yylex'.)
  234. *Note Token Values::.
  235. `yylloc'
  236. External variable in which `yylex' should place the line and
  237. column numbers associated with a token. (In a pure parser, it is
  238. a local variable within `yyparse', and its address is passed to
  239. `yylex'.) You can ignore this variable if you don't use the `@'
  240. feature in the grammar actions. *Note Token Positions::.
  241. `yynerrs'
  242. Global variable which Bison increments each time there is a parse
  243. error. (In a pure parser, it is a local variable within
  244. `yyparse'.) *Note Error Reporting::.
  245. `yyparse'
  246. The parser function produced by Bison; call this function to start
  247. parsing. *Note Parser Function::.
  248. `%left'
  249. Bison declaration to assign left associativity to token(s).
  250. *Note Precedence Decl::.
  251. `%nonassoc'
  252. Bison declaration to assign nonassociativity to token(s). *Note
  253. Precedence Decl::.
  254. `%prec'
  255. Bison declaration to assign a precedence to a specific rule.
  256. *Note Contextual Precedence::.
  257. `%pure_parser'
  258. Bison declaration to request a pure (reentrant) parser. *Note
  259. Pure Decl::.
  260. `%right'
  261. Bison declaration to assign right associativity to token(s).
  262. *Note Precedence Decl::.
  263. `%start'
  264. Bison declaration to specify the start symbol. *Note Start
  265. Decl::.
  266. `%token'
  267. Bison declaration to declare token(s) without specifying
  268. precedence. *Note Token Decl::.
  269. `%type'
  270. Bison declaration to declare nonterminals. *Note Type Decl::.
  271. `%union'
  272. Bison declaration to specify several possible data types for
  273. semantic values. *Note Union Decl::.
  274. These are the punctuation and delimiters used in Bison input:
  275. `%%'
  276. Delimiter used to separate the grammar rule section from the
  277. Bison declarations section or the additional C code section.
  278. *Note Grammar Layout::.
  279. `%{ %}'
  280. All code listed between `%{' and `%}' is copied directly to the
  281. output file uninterpreted. Such code forms the "C declarations"
  282. section of the input file. *Note Grammar Outline::.
  283. `/*...*/'
  284. Comment delimiters, as in C.
  285. `:'
  286. Separates a rule's result from its components. *Note Rules::.
  287. `;'
  288. Terminates a rule. *Note Rules::.
  289. `|'
  290. Separates alternate rules for the same result nonterminal. *Note
  291. Rules::.
  292. 
  293. File: bison.info, Node: Glossary, Next: Index, Prev: Table of Symbols, Up: top
  294. Glossary
  295. ********
  296. Backus-Naur Form (BNF)
  297. Formal method of specifying context-free grammars. BNF was first
  298. used in the `ALGOL-60' report, 1963. *Note Language and
  299. Grammar::.
  300. Context-free grammars
  301. Grammars specified as rules that can be applied regardless of
  302. context. Thus, if there is a rule which says that an integer can
  303. be used as an expression, integers are allowed *anywhere* an
  304. expression is permitted. *Note Language and Grammar::.
  305. Dynamic allocation
  306. Allocation of memory that occurs during execution, rather than at
  307. compile time or on entry to a function.
  308. Empty string
  309. Analogous to the empty set in set theory, the empty string is a
  310. character string of length zero.
  311. Finite-state stack machine
  312. A "machine" that has discrete states in which it is said to exist
  313. at each instant in time. As input to the machine is processed,
  314. the machine moves from state to state as specified by the logic
  315. of the machine. In the case of the parser, the input is the
  316. language being parsed, and the states correspond to various
  317. stages in the grammar rules. *Note Algorithm::.
  318. Grouping
  319. A language construct that is (in general) grammatically divisible;
  320. for example, `expression' or `declaration' in C. *Note Language
  321. and Grammar::.
  322. Infix operator
  323. An arithmetic operator that is placed between the operands on
  324. which it performs some operation.
  325. Input stream
  326. A continuous flow of data between devices or programs.
  327. Language construct
  328. One of the typical usage schemas of the language. For example,
  329. one of the constructs of the C language is the `if' statement.
  330. *Note Language and Grammar::.
  331. Left associativity
  332. Operators having left associativity are analyzed from left to
  333. right: `a+b+c' first computes `a+b' and then combines with `c'.
  334. *Note Precedence::.
  335. Left recursion
  336. A rule whose result symbol is also its first component symbol;
  337. for example, `expseq1 : expseq1 ',' exp;'. *Note Recursion::.
  338. Left-to-right parsing
  339. Parsing a sentence of a language by analyzing it token by token
  340. from left to right. *Note Algorithm::.
  341. Lexical analyzer (scanner)
  342. A function that reads an input stream and returns tokens one by
  343. one. *Note Lexical::.
  344. Lexical tie-in
  345. A flag, set by actions in the grammar rules, which alters the way
  346. tokens are parsed. *Note Lexical Tie-ins::.
  347. Look-ahead token
  348. A token already read but not yet shifted. *Note Look-Ahead::.
  349. LALR(1)
  350. The class of context-free grammars that Bison (like most other
  351. parser generators) can handle; a subset of LR(1). *Note
  352. Mysterious Reduce/Reduce Conflicts: Mystery Conflicts.
  353. LR(1)
  354. The class of context-free grammars in which at most one token of
  355. look-ahead is needed to disambiguate the parsing of any piece of
  356. input.
  357. Nonterminal symbol
  358. A grammar symbol standing for a grammatical construct that can be
  359. expressed through rules in terms of smaller constructs; in other
  360. words, a construct that is not a token. *Note Symbols::.
  361. Parse error
  362. An error encountered during parsing of an input stream due to
  363. invalid syntax. *Note Error Recovery::.
  364. Parser
  365. A function that recognizes valid sentences of a language by
  366. analyzing the syntax structure of a set of tokens passed to it
  367. from a lexical analyzer.
  368. Postfix operator
  369. An arithmetic operator that is placed after the operands upon
  370. which it performs some operation.
  371. Reduction
  372. Replacing a string of nonterminals and/or terminals with a single
  373. nonterminal, according to a grammar rule. *Note Algorithm::.
  374. Reentrant
  375. A reentrant subprogram is a subprogram which can be in invoked any
  376. number of times in parallel, without interference between the
  377. various invocations. *Note Pure Decl::.
  378. Reverse polish notation
  379. A language in which all operators are postfix operators.
  380. Right recursion
  381. A rule whose result symbol is also its last component symbol; for
  382. example, `expseq1: exp ',' expseq1;'. *Note Recursion::.
  383. Semantics
  384. In computer languages, the semantics are specified by the actions
  385. taken for each instance of the language, i.e., the meaning of
  386. each statement. *Note Semantics::.
  387. Shift
  388. A parser is said to shift when it makes the choice of analyzing
  389. further input from the stream rather than reducing immediately
  390. some already-recognized rule. *Note Algorithm::.
  391. Single-character literal
  392. A single character that is recognized and interpreted as is.
  393. *Note Grammar in Bison::.
  394. Start symbol
  395. The nonterminal symbol that stands for a complete valid utterance
  396. in the language being parsed. The start symbol is usually listed
  397. as the first nonterminal symbol in a language specification.
  398. *Note Start Decl::.
  399. Symbol table
  400. A data structure where symbol names and associated data are stored
  401. during parsing to allow for recognition and use of existing
  402. information in repeated uses of a symbol. *Note Multi-function
  403. Calc::.
  404. Token
  405. A basic, grammatically indivisible unit of a language. The symbol
  406. that describes a token in the grammar is a terminal symbol. The
  407. input of the Bison parser is a stream of tokens which comes from
  408. the lexical analyzer. *Note Symbols::.
  409. Terminal symbol
  410. A grammar symbol that has no rules in the grammar and therefore
  411. is grammatically indivisible. The piece of text it represents is
  412. a token. *Note Language and Grammar::.
  413. 
  414. File: bison.info, Node: Index, Prev: Glossary, Up: top
  415. Index
  416. *****
  417. * Menu:
  418. * $$: Actions.
  419. * $N: Actions.
  420. * %expect: Expect Decl.
  421. * %left: Using Precedence.
  422. * %nonassoc: Using Precedence.
  423. * %prec: Contextual Precedence.
  424. * %pure_parser: Pure Decl.
  425. * %right: Using Precedence.
  426. * %start: Start Decl.
  427. * %token: Token Decl.
  428. * %type: Type Decl.
  429. * %union: Union Decl.
  430. * @N: Action Features.
  431. * calc: Infix Calc.
  432. * else, dangling: Shift/Reduce.
  433. * mfcalc: Multi-function Calc.
  434. * rpcalc: RPN Calc.
  435. * BNF: Language and Grammar.
  436. * Backus-Naur form: Language and Grammar.
  437. * Bison declaration summary: Decl Summary.
  438. * Bison declarations: Declarations.
  439. * Bison declarations (introduction): Bison Declarations.
  440. * Bison grammar: Grammar in Bison.
  441. * Bison invocation: Invocation.
  442. * Bison parser: Bison Parser.
  443. * Bison parser algorithm: Algorithm.
  444. * Bison symbols, table of: Table of Symbols.
  445. * Bison utility: Bison Parser.
  446. * C code, section for additional: C Code.
  447. * C declarations section: C Declarations.
  448. * C-language interface: Interface.
  449. * LALR(1): Mystery Conflicts.
  450. * LR(1): Mystery Conflicts.
  451. * YYABORT: Parser Function.
  452. * YYACCEPT: Parser Function.
  453. * YYBACKUP: Action Features.
  454. * YYDEBUG: Debugging.
  455. * YYEMPTY: Action Features.
  456. * YYERROR: Action Features.
  457. * YYINITDEPTH: Stack Overflow.
  458. * YYMAXDEPTH: Stack Overflow.
  459. * YYPRINT: Debugging.
  460. * YYRECOVERING: Error Recovery.
  461. * action: Actions.
  462. * action data types: Action Types.
  463. * action features summary: Action Features.
  464. * actions in mid-rule: Mid-Rule Actions.
  465. * actions, semantic: Semantic Actions.
  466. * additional C code section: C Code.
  467. * algorithm of parser: Algorithm.
  468. * associativity: Why Precedence.
  469. * calculator, infix notation: Infix Calc.
  470. * calculator, multi-function: Multi-function Calc.
  471. * calculator, simple: RPN Calc.
  472. * character token: Symbols.
  473. * compiling the parser: Rpcalc Compile.
  474. * conflicts: Shift/Reduce.
  475. * conflicts, reduce/reduce: Reduce/Reduce.
  476. * conflicts, suppressing warnings of: Expect Decl.
  477. * context-dependent precedence: Contextual Precedence.
  478. * context-free grammar: Language and Grammar.
  479. * controlling function: Rpcalc Main.
  480. * dangling else: Shift/Reduce.
  481. * data types in actions: Action Types.
  482. * data types of semantic values: Value Type.
  483. * debugging: Debugging.
  484. * declaration summary: Decl Summary.
  485. * declarations, Bison: Declarations.
  486. * declarations, Bison (introduction): Bison Declarations.
  487. * declarations, C: C Declarations.
  488. * declaring operator precedence: Precedence Decl.
  489. * declaring the start symbol: Start Decl.
  490. * declaring token type names: Token Decl.
  491. * declaring value types: Union Decl.
  492. * declaring value types, nonterminals: Type Decl.
  493. * defining language semantics: Semantics.
  494. * error: Error Recovery.
  495. * error recovery: Error Recovery.
  496. * error recovery, simple: Simple Error Recovery.
  497. * error reporting function: Error Reporting.
  498. * error reporting routine: Rpcalc Error.
  499. * examples, simple: Examples.
  500. * exercises: Exercises.
  501. * file format: Grammar Layout.
  502. * finite-state machine: Parser States.
  503. * formal grammar: Grammar in Bison.
  504. * format of grammar file: Grammar Layout.
  505. * glossary: Glossary.
  506. * grammar file: Grammar Layout.
  507. * grammar rule syntax: Rules.
  508. * grammar rules section: Grammar Rules.
  509. * grammar, Bison: Grammar in Bison.
  510. * grammar, context-free: Language and Grammar.
  511. * grouping, syntactic: Language and Grammar.
  512. * infix notation calculator: Infix Calc.
  513. * interface: Interface.
  514. * introduction: Introduction.
  515. * invoking Bison: Invocation.
  516. * language semantics, defining: Semantics.
  517. * layout of Bison grammar: Grammar Layout.
  518. * left recursion: Recursion.
  519. * lexical analyzer: Lexical.
  520. * lexical analyzer, purpose: Bison Parser.
  521. * lexical analyzer, writing: Rpcalc Lexer.
  522. * lexical tie-in: Lexical Tie-ins.
  523. * literal token: Symbols.
  524. * look-ahead token: Look-Ahead.
  525. * main function in simple example: Rpcalc Main.
  526. * mid-rule actions: Mid-Rule Actions.
  527. * multi-function calculator: Multi-function Calc.
  528. * mutual recursion: Recursion.
  529. * nonterminal symbol: Symbols.
  530. * operator precedence: Precedence.
  531. * operator precedence, declaring: Precedence Decl.
  532. * options for Bison invocation: Invocation.
  533. * overflow of parser stack: Stack Overflow.
  534. * parse error: Error Reporting.
  535. * parser: Bison Parser.
  536. * parser stack: Algorithm.
  537. * parser stack overflow: Stack Overflow.
  538. * parser state: Parser States.
  539. * polish notation calculator: RPN Calc.
  540. * precedence declarations: Precedence Decl.
  541. * precedence of operators: Precedence.
  542. * precedence, context-dependent: Contextual Precedence.
  543. * precedence, unary operator: Contextual Precedence.
  544. * preventing warnings about conflicts: Expect Decl.
  545. * pure parser: Pure Decl.
  546. * recovery from errors: Error Recovery.
  547. * recursive rule: Recursion.
  548. * reduce/reduce conflict: Reduce/Reduce.
  549. * reduction: Algorithm.
  550. * reentrant parser: Pure Decl.
  551. * reverse polish notation: RPN Calc.
  552. * right recursion: Recursion.
  553. * rule syntax: Rules.
  554. * rules section for grammar: Grammar Rules.
  555. * running Bison (introduction): Rpcalc Gen.
  556. * semantic actions: Semantic Actions.
  557. * semantic value: Semantic Values.
  558. * semantic value type: Value Type.
  559. * shift/reduce conflicts: Shift/Reduce.
  560. * shifting: Algorithm.
  561. * simple examples: Examples.
  562. * single-character literal: Symbols.
  563. * stack overflow: Stack Overflow.
  564. * stack, parser: Algorithm.
  565. * stages in using Bison: Stages.
  566. * start symbol: Language and Grammar.
  567. * start symbol, declaring: Start Decl.
  568. * state (of parser): Parser States.
  569. * summary, Bison declaration: Decl Summary.
  570. * summary, action features: Action Features.
  571. * suppressing conflict warnings: Expect Decl.
  572. * symbol: Symbols.
  573. * symbol table example: Mfcalc Symtab.
  574. * symbols (abstract): Language and Grammar.
  575. * symbols in Bison, table of: Table of Symbols.
  576. * syntactic grouping: Language and Grammar.
  577. * syntax error: Error Reporting.
  578. * syntax of grammar rules: Rules.
  579. * terminal symbol: Symbols.
  580. * token: Language and Grammar.
  581. * token type: Symbols.
  582. * token type names, declaring: Token Decl.
  583. * tracing the parser: Debugging.
  584. * unary operator precedence: Contextual Precedence.
  585. * using Bison: Stages.
  586. * value type, semantic: Value Type.
  587. * value types, declaring: Union Decl.
  588. * value types, nonterminals, declaring: Type Decl.
  589. * value, semantic: Semantic Values.
  590. * warnings, preventing: Expect Decl.
  591. * writing a lexical analyzer: Rpcalc Lexer.
  592. * yychar: Look-Ahead.
  593. * yyclearin: Error Recovery.
  594. * yydebug: Debugging.
  595. * yyerrok: Error Recovery.
  596. * yyerror: Error Reporting.
  597. * yylex: Lexical.
  598. * yylloc: Token Positions.
  599. * yylval: Token Values.
  600. * yynerrs: Error Reporting.
  601. * yyparse: Parser Function.
  602. * |: Rules.