]> git.saurik.com Git - bison.git/blob - doc/bison.info-5
Version 1.30d.
[bison.git] / doc / bison.info-5
1 Ceci est le fichier Info bison.info, produit par Makeinfo version 4.0b
2 à partir bison.texinfo.
3
4 START-INFO-DIR-ENTRY
5 * bison: (bison). GNU Project parser generator (yacc replacement).
6 END-INFO-DIR-ENTRY
7
8 This file documents the Bison parser generator.
9
10 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1995, 1998, 1999,
11 2000, 2001 Free Software Foundation, Inc.
12
13 Permission is granted to make and distribute verbatim copies of this
14 manual provided the copyright notice and this permission notice are
15 preserved on all copies.
16
17 Permission is granted to copy and distribute modified versions of
18 this manual under the conditions for verbatim copying, provided also
19 that the sections entitled "GNU General Public License" and "Conditions
20 for Using Bison" are included exactly as in the original, and provided
21 that the entire resulting derived work is distributed under the terms
22 of a permission notice identical to this one.
23
24 Permission is granted to copy and distribute translations of this
25 manual into another language, under the above conditions for modified
26 versions, except that the sections entitled "GNU General Public
27 License", "Conditions for Using Bison" and this permission notice may be
28 included in translations approved by the Free Software Foundation
29 instead of in the original English.
30
31 \1f
32 File: bison.info, Node: VMS Invocation, Prev: Option Cross Key, Up: Invocation
33
34 Invoking Bison under VMS
35 ========================
36
37 The command line syntax for Bison on VMS is a variant of the usual
38 Bison command syntax--adapted to fit VMS conventions.
39
40 To find the VMS equivalent for any Bison option, start with the long
41 option, and substitute a `/' for the leading `--', and substitute a `_'
42 for each `-' in the name of the long option. For example, the
43 following invocation under VMS:
44
45 bison /debug/name_prefix=bar foo.y
46
47 is equivalent to the following command under POSIX.
48
49 bison --debug --name-prefix=bar foo.y
50
51 The VMS file system does not permit filenames such as `foo.tab.c'.
52 In the above example, the output file would instead be named
53 `foo_tab.c'.
54
55 \1f
56 File: bison.info, Node: Table of Symbols, Next: Glossary, Prev: Invocation, Up: Top
57
58 Bison Symbols
59 *************
60
61 `error'
62 A token name reserved for error recovery. This token may be used
63 in grammar rules so as to allow the Bison parser to recognize an
64 error in the grammar without halting the process. In effect, a
65 sentence containing an error may be recognized as valid. On a
66 parse error, the token `error' becomes the current look-ahead
67 token. Actions corresponding to `error' are then executed, and
68 the look-ahead token is reset to the token that originally caused
69 the violation. *Note Error Recovery::.
70
71 `YYABORT'
72 Macro to pretend that an unrecoverable syntax error has occurred,
73 by making `yyparse' return 1 immediately. The error reporting
74 function `yyerror' is not called. *Note The Parser Function
75 `yyparse': Parser Function.
76
77 `YYACCEPT'
78 Macro to pretend that a complete utterance of the language has been
79 read, by making `yyparse' return 0 immediately. *Note The Parser
80 Function `yyparse': Parser Function.
81
82 `YYBACKUP'
83 Macro to discard a value from the parser stack and fake a
84 look-ahead token. *Note Special Features for Use in Actions:
85 Action Features.
86
87 `YYERROR'
88 Macro to pretend that a syntax error has just been detected: call
89 `yyerror' and then perform normal error recovery if possible
90 (*note Error Recovery::), or (if recovery is impossible) make
91 `yyparse' return 1. *Note Error Recovery::.
92
93 `YYERROR_VERBOSE'
94 Macro that you define with `#define' in the Bison declarations
95 section to request verbose, specific error message strings when
96 `yyerror' is called.
97
98 `YYINITDEPTH'
99 Macro for specifying the initial size of the parser stack. *Note
100 Stack Overflow::.
101
102 `YYLEX_PARAM'
103 Macro for specifying an extra argument (or list of extra
104 arguments) for `yyparse' to pass to `yylex'. *Note Calling
105 Conventions for Pure Parsers: Pure Calling.
106
107 `YYLTYPE'
108 Macro for the data type of `yylloc'; a structure with four
109 members. *Note Data Types of Locations: Location Type.
110
111 `yyltype'
112 Default value for YYLTYPE.
113
114 `YYMAXDEPTH'
115 Macro for specifying the maximum size of the parser stack. *Note
116 Stack Overflow::.
117
118 `YYPARSE_PARAM'
119 Macro for specifying the name of a parameter that `yyparse' should
120 accept. *Note Calling Conventions for Pure Parsers: Pure Calling.
121
122 `YYRECOVERING'
123 Macro whose value indicates whether the parser is recovering from a
124 syntax error. *Note Special Features for Use in Actions: Action
125 Features.
126
127 `YYSTACK_USE_ALLOCA'
128 Macro used to control the use of `alloca'. If defined to `0', the
129 parser will not use `alloca' but `malloc' when trying to grow its
130 internal stacks. Do _not_ define `YYSTACK_USE_ALLOCA' to anything
131 else.
132
133 `YYSTYPE'
134 Macro for the data type of semantic values; `int' by default.
135 *Note Data Types of Semantic Values: Value Type.
136
137 `yychar'
138 External integer variable that contains the integer value of the
139 current look-ahead token. (In a pure parser, it is a local
140 variable within `yyparse'.) Error-recovery rule actions may
141 examine this variable. *Note Special Features for Use in Actions:
142 Action Features.
143
144 `yyclearin'
145 Macro used in error-recovery rule actions. It clears the previous
146 look-ahead token. *Note Error Recovery::.
147
148 `yydebug'
149 External integer variable set to zero by default. If `yydebug' is
150 given a nonzero value, the parser will output information on input
151 symbols and parser action. *Note Debugging Your Parser: Debugging.
152
153 `yyerrok'
154 Macro to cause parser to recover immediately to its normal mode
155 after a parse error. *Note Error Recovery::.
156
157 `yyerror'
158 User-supplied function to be called by `yyparse' on error. The
159 function receives one argument, a pointer to a character string
160 containing an error message. *Note The Error Reporting Function
161 `yyerror': Error Reporting.
162
163 `yylex'
164 User-supplied lexical analyzer function, called with no arguments
165 to get the next token. *Note The Lexical Analyzer Function
166 `yylex': Lexical.
167
168 `yylval'
169 External variable in which `yylex' should place the semantic value
170 associated with a token. (In a pure parser, it is a local
171 variable within `yyparse', and its address is passed to `yylex'.)
172 *Note Semantic Values of Tokens: Token Values.
173
174 `yylloc'
175 External variable in which `yylex' should place the line and column
176 numbers associated with a token. (In a pure parser, it is a local
177 variable within `yyparse', and its address is passed to `yylex'.)
178 You can ignore this variable if you don't use the `@' feature in
179 the grammar actions. *Note Textual Positions of Tokens: Token
180 Positions.
181
182 `yynerrs'
183 Global variable which Bison increments each time there is a parse
184 error. (In a pure parser, it is a local variable within
185 `yyparse'.) *Note The Error Reporting Function `yyerror': Error
186 Reporting.
187
188 `yyparse'
189 The parser function produced by Bison; call this function to start
190 parsing. *Note The Parser Function `yyparse': Parser Function.
191
192 `%debug'
193 Equip the parser for debugging. *Note Decl Summary::.
194
195 `%defines'
196 Bison declaration to create a header file meant for the scanner.
197 *Note Decl Summary::.
198
199 `%file-prefix="PREFIX"'
200 Bison declaration to set tge prefix of the output files. *Note
201 Decl Summary::.
202
203 `%left'
204 Bison declaration to assign left associativity to token(s). *Note
205 Operator Precedence: Precedence Decl.
206
207 `%name-prefix="PREFIX"'
208 Bison declaration to rename the external symbols. *Note Decl
209 Summary::.
210
211 `%no-lines'
212 Bison declaration to avoid generating `#line' directives in the
213 parser file. *Note Decl Summary::.
214
215 `%nonassoc'
216 Bison declaration to assign non-associativity to token(s). *Note
217 Operator Precedence: Precedence Decl.
218
219 `%output="FILENAME"'
220 Bison declaration to set the name of the parser file. *Note Decl
221 Summary::.
222
223 `%prec'
224 Bison declaration to assign a precedence to a specific rule.
225 *Note Context-Dependent Precedence: Contextual Precedence.
226
227 `%pure-parser'
228 Bison declaration to request a pure (reentrant) parser. *Note A
229 Pure (Reentrant) Parser: Pure Decl.
230
231 `%right'
232 Bison declaration to assign right associativity to token(s).
233 *Note Operator Precedence: Precedence Decl.
234
235 `%start'
236 Bison declaration to specify the start symbol. *Note The
237 Start-Symbol: Start Decl.
238
239 `%token'
240 Bison declaration to declare token(s) without specifying
241 precedence. *Note Token Type Names: Token Decl.
242
243 `%token-table'
244 Bison declaration to include a token name table in the parser file.
245 *Note Decl Summary::.
246
247 `%type'
248 Bison declaration to declare nonterminals. *Note Nonterminal
249 Symbols: Type Decl.
250
251 `%union'
252 Bison declaration to specify several possible data types for
253 semantic values. *Note The Collection of Value Types: Union Decl.
254
255 These are the punctuation and delimiters used in Bison input:
256
257 `%%'
258 Delimiter used to separate the grammar rule section from the Bison
259 declarations section or the additional C code section. *Note The
260 Overall Layout of a Bison Grammar: Grammar Layout.
261
262 `%{ %}'
263 All code listed between `%{' and `%}' is copied directly to the
264 output file uninterpreted. Such code forms the "C declarations"
265 section of the input file. *Note Outline of a Bison Grammar:
266 Grammar Outline.
267
268 `/*...*/'
269 Comment delimiters, as in C.
270
271 `:'
272 Separates a rule's result from its components. *Note Syntax of
273 Grammar Rules: Rules.
274
275 `;'
276 Terminates a rule. *Note Syntax of Grammar Rules: Rules.
277
278 `|'
279 Separates alternate rules for the same result nonterminal. *Note
280 Syntax of Grammar Rules: Rules.
281
282 \1f
283 File: bison.info, Node: Glossary, Next: Copying This Manual, Prev: Table of Symbols, Up: Top
284
285 Glossary
286 ********
287
288 Backus-Naur Form (BNF)
289 Formal method of specifying context-free grammars. BNF was first
290 used in the `ALGOL-60' report, 1963. *Note Languages and
291 Context-Free Grammars: Language and Grammar.
292
293 Context-free grammars
294 Grammars specified as rules that can be applied regardless of
295 context. Thus, if there is a rule which says that an integer can
296 be used as an expression, integers are allowed _anywhere_ an
297 expression is permitted. *Note Languages and Context-Free
298 Grammars: Language and Grammar.
299
300 Dynamic allocation
301 Allocation of memory that occurs during execution, rather than at
302 compile time or on entry to a function.
303
304 Empty string
305 Analogous to the empty set in set theory, the empty string is a
306 character string of length zero.
307
308 Finite-state stack machine
309 A "machine" that has discrete states in which it is said to exist
310 at each instant in time. As input to the machine is processed, the
311 machine moves from state to state as specified by the logic of the
312 machine. In the case of the parser, the input is the language
313 being parsed, and the states correspond to various stages in the
314 grammar rules. *Note The Bison Parser Algorithm: Algorithm.
315
316 Grouping
317 A language construct that is (in general) grammatically divisible;
318 for example, `expression' or `declaration' in C. *Note Languages
319 and Context-Free Grammars: Language and Grammar.
320
321 Infix operator
322 An arithmetic operator that is placed between the operands on
323 which it performs some operation.
324
325 Input stream
326 A continuous flow of data between devices or programs.
327
328 Language construct
329 One of the typical usage schemas of the language. For example,
330 one of the constructs of the C language is the `if' statement.
331 *Note Languages and Context-Free Grammars: Language and Grammar.
332
333 Left associativity
334 Operators having left associativity are analyzed from left to
335 right: `a+b+c' first computes `a+b' and then combines with `c'.
336 *Note Operator Precedence: Precedence.
337
338 Left recursion
339 A rule whose result symbol is also its first component symbol; for
340 example, `expseq1 : expseq1 ',' exp;'. *Note Recursive Rules:
341 Recursion.
342
343 Left-to-right parsing
344 Parsing a sentence of a language by analyzing it token by token
345 from left to right. *Note The Bison Parser Algorithm: Algorithm.
346
347 Lexical analyzer (scanner)
348 A function that reads an input stream and returns tokens one by
349 one. *Note The Lexical Analyzer Function `yylex': Lexical.
350
351 Lexical tie-in
352 A flag, set by actions in the grammar rules, which alters the way
353 tokens are parsed. *Note Lexical Tie-ins::.
354
355 Literal string token
356 A token which consists of two or more fixed characters. *Note
357 Symbols::.
358
359 Look-ahead token
360 A token already read but not yet shifted. *Note Look-Ahead
361 Tokens: Look-Ahead.
362
363 LALR(1)
364 The class of context-free grammars that Bison (like most other
365 parser generators) can handle; a subset of LR(1). *Note
366 Mysterious Reduce/Reduce Conflicts: Mystery Conflicts.
367
368 LR(1)
369 The class of context-free grammars in which at most one token of
370 look-ahead is needed to disambiguate the parsing of any piece of
371 input.
372
373 Nonterminal symbol
374 A grammar symbol standing for a grammatical construct that can be
375 expressed through rules in terms of smaller constructs; in other
376 words, a construct that is not a token. *Note Symbols::.
377
378 Parse error
379 An error encountered during parsing of an input stream due to
380 invalid syntax. *Note Error Recovery::.
381
382 Parser
383 A function that recognizes valid sentences of a language by
384 analyzing the syntax structure of a set of tokens passed to it
385 from a lexical analyzer.
386
387 Postfix operator
388 An arithmetic operator that is placed after the operands upon
389 which it performs some operation.
390
391 Reduction
392 Replacing a string of nonterminals and/or terminals with a single
393 nonterminal, according to a grammar rule. *Note The Bison Parser
394 Algorithm: Algorithm.
395
396 Reentrant
397 A reentrant subprogram is a subprogram which can be in invoked any
398 number of times in parallel, without interference between the
399 various invocations. *Note A Pure (Reentrant) Parser: Pure Decl.
400
401 Reverse polish notation
402 A language in which all operators are postfix operators.
403
404 Right recursion
405 A rule whose result symbol is also its last component symbol; for
406 example, `expseq1: exp ',' expseq1;'. *Note Recursive Rules:
407 Recursion.
408
409 Semantics
410 In computer languages, the semantics are specified by the actions
411 taken for each instance of the language, i.e., the meaning of each
412 statement. *Note Defining Language Semantics: Semantics.
413
414 Shift
415 A parser is said to shift when it makes the choice of analyzing
416 further input from the stream rather than reducing immediately some
417 already-recognized rule. *Note The Bison Parser Algorithm:
418 Algorithm.
419
420 Single-character literal
421 A single character that is recognized and interpreted as is.
422 *Note From Formal Rules to Bison Input: Grammar in Bison.
423
424 Start symbol
425 The nonterminal symbol that stands for a complete valid utterance
426 in the language being parsed. The start symbol is usually listed
427 as the first nonterminal symbol in a language specification.
428 *Note The Start-Symbol: Start Decl.
429
430 Symbol table
431 A data structure where symbol names and associated data are stored
432 during parsing to allow for recognition and use of existing
433 information in repeated uses of a symbol. *Note Multi-function
434 Calc::.
435
436 Token
437 A basic, grammatically indivisible unit of a language. The symbol
438 that describes a token in the grammar is a terminal symbol. The
439 input of the Bison parser is a stream of tokens which comes from
440 the lexical analyzer. *Note Symbols::.
441
442 Terminal symbol
443 A grammar symbol that has no rules in the grammar and therefore is
444 grammatically indivisible. The piece of text it represents is a
445 token. *Note Languages and Context-Free Grammars: Language and
446 Grammar.
447
448 \1f
449 File: bison.info, Node: Copying This Manual, Next: Index, Prev: Glossary, Up: Top
450
451 Copying This Manual
452 *******************
453
454 * Menu:
455
456 * GNU Free Documentation License:: License for copying this manual.
457
458 \1f
459 File: bison.info, Node: GNU Free Documentation License, Up: Copying This Manual
460
461 GNU Free Documentation License
462 ==============================
463
464 Version 1.1, March 2000
465 Copyright (C) 2000 Free Software Foundation, Inc.
466 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
467
468 Everyone is permitted to copy and distribute verbatim copies
469 of this license document, but changing it is not allowed.
470
471 0. PREAMBLE
472
473 The purpose of this License is to make a manual, textbook, or other
474 written document "free" in the sense of freedom: to assure everyone
475 the effective freedom to copy and redistribute it, with or without
476 modifying it, either commercially or noncommercially. Secondarily,
477 this License preserves for the author and publisher a way to get
478 credit for their work, while not being considered responsible for
479 modifications made by others.
480
481 This License is a kind of "copyleft", which means that derivative
482 works of the document must themselves be free in the same sense.
483 It complements the GNU General Public License, which is a copyleft
484 license designed for free software.
485
486 We have designed this License in order to use it for manuals for
487 free software, because free software needs free documentation: a
488 free program should come with manuals providing the same freedoms
489 that the software does. But this License is not limited to
490 software manuals; it can be used for any textual work, regardless
491 of subject matter or whether it is published as a printed book.
492 We recommend this License principally for works whose purpose is
493 instruction or reference.
494
495 1. APPLICABILITY AND DEFINITIONS
496
497 This License applies to any manual or other work that contains a
498 notice placed by the copyright holder saying it can be distributed
499 under the terms of this License. The "Document", below, refers to
500 any such manual or work. Any member of the public is a licensee,
501 and is addressed as "you".
502
503 A "Modified Version" of the Document means any work containing the
504 Document or a portion of it, either copied verbatim, or with
505 modifications and/or translated into another language.
506
507 A "Secondary Section" is a named appendix or a front-matter
508 section of the Document that deals exclusively with the
509 relationship of the publishers or authors of the Document to the
510 Document's overall subject (or to related matters) and contains
511 nothing that could fall directly within that overall subject.
512 (For example, if the Document is in part a textbook of
513 mathematics, a Secondary Section may not explain any mathematics.)
514 The relationship could be a matter of historical connection with
515 the subject or with related matters, or of legal, commercial,
516 philosophical, ethical or political position regarding them.
517
518 The "Invariant Sections" are certain Secondary Sections whose
519 titles are designated, as being those of Invariant Sections, in
520 the notice that says that the Document is released under this
521 License.
522
523 The "Cover Texts" are certain short passages of text that are
524 listed, as Front-Cover Texts or Back-Cover Texts, in the notice
525 that says that the Document is released under this License.
526
527 A "Transparent" copy of the Document means a machine-readable copy,
528 represented in a format whose specification is available to the
529 general public, whose contents can be viewed and edited directly
530 and straightforwardly with generic text editors or (for images
531 composed of pixels) generic paint programs or (for drawings) some
532 widely available drawing editor, and that is suitable for input to
533 text formatters or for automatic translation to a variety of
534 formats suitable for input to text formatters. A copy made in an
535 otherwise Transparent file format whose markup has been designed
536 to thwart or discourage subsequent modification by readers is not
537 Transparent. A copy that is not "Transparent" is called "Opaque".
538
539 Examples of suitable formats for Transparent copies include plain
540 ASCII without markup, Texinfo input format, LaTeX input format,
541 SGML or XML using a publicly available DTD, and
542 standard-conforming simple HTML designed for human modification.
543 Opaque formats include PostScript, PDF, proprietary formats that
544 can be read and edited only by proprietary word processors, SGML
545 or XML for which the DTD and/or processing tools are not generally
546 available, and the machine-generated HTML produced by some word
547 processors for output purposes only.
548
549 The "Title Page" means, for a printed book, the title page itself,
550 plus such following pages as are needed to hold, legibly, the
551 material this License requires to appear in the title page. For
552 works in formats which do not have any title page as such, "Title
553 Page" means the text near the most prominent appearance of the
554 work's title, preceding the beginning of the body of the text.
555
556 2. VERBATIM COPYING
557
558 You may copy and distribute the Document in any medium, either
559 commercially or noncommercially, provided that this License, the
560 copyright notices, and the license notice saying this License
561 applies to the Document are reproduced in all copies, and that you
562 add no other conditions whatsoever to those of this License. You
563 may not use technical measures to obstruct or control the reading
564 or further copying of the copies you make or distribute. However,
565 you may accept compensation in exchange for copies. If you
566 distribute a large enough number of copies you must also follow
567 the conditions in section 3.
568
569 You may also lend copies, under the same conditions stated above,
570 and you may publicly display copies.
571
572 3. COPYING IN QUANTITY
573
574 If you publish printed copies of the Document numbering more than
575 100, and the Document's license notice requires Cover Texts, you
576 must enclose the copies in covers that carry, clearly and legibly,
577 all these Cover Texts: Front-Cover Texts on the front cover, and
578 Back-Cover Texts on the back cover. Both covers must also clearly
579 and legibly identify you as the publisher of these copies. The
580 front cover must present the full title with all words of the
581 title equally prominent and visible. You may add other material
582 on the covers in addition. Copying with changes limited to the
583 covers, as long as they preserve the title of the Document and
584 satisfy these conditions, can be treated as verbatim copying in
585 other respects.
586
587 If the required texts for either cover are too voluminous to fit
588 legibly, you should put the first ones listed (as many as fit
589 reasonably) on the actual cover, and continue the rest onto
590 adjacent pages.
591
592 If you publish or distribute Opaque copies of the Document
593 numbering more than 100, you must either include a
594 machine-readable Transparent copy along with each Opaque copy, or
595 state in or with each Opaque copy a publicly-accessible
596 computer-network location containing a complete Transparent copy
597 of the Document, free of added material, which the general
598 network-using public has access to download anonymously at no
599 charge using public-standard network protocols. If you use the
600 latter option, you must take reasonably prudent steps, when you
601 begin distribution of Opaque copies in quantity, to ensure that
602 this Transparent copy will remain thus accessible at the stated
603 location until at least one year after the last time you
604 distribute an Opaque copy (directly or through your agents or
605 retailers) of that edition to the public.
606
607 It is requested, but not required, that you contact the authors of
608 the Document well before redistributing any large number of
609 copies, to give them a chance to provide you with an updated
610 version of the Document.
611
612 4. MODIFICATIONS
613
614 You may copy and distribute a Modified Version of the Document
615 under the conditions of sections 2 and 3 above, provided that you
616 release the Modified Version under precisely this License, with
617 the Modified Version filling the role of the Document, thus
618 licensing distribution and modification of the Modified Version to
619 whoever possesses a copy of it. In addition, you must do these
620 things in the Modified Version:
621
622 A. Use in the Title Page (and on the covers, if any) a title
623 distinct from that of the Document, and from those of
624 previous versions (which should, if there were any, be listed
625 in the History section of the Document). You may use the
626 same title as a previous version if the original publisher of
627 that version gives permission.
628
629 B. List on the Title Page, as authors, one or more persons or
630 entities responsible for authorship of the modifications in
631 the Modified Version, together with at least five of the
632 principal authors of the Document (all of its principal
633 authors, if it has less than five).
634
635 C. State on the Title page the name of the publisher of the
636 Modified Version, as the publisher.
637
638 D. Preserve all the copyright notices of the Document.
639
640 E. Add an appropriate copyright notice for your modifications
641 adjacent to the other copyright notices.
642
643 F. Include, immediately after the copyright notices, a license
644 notice giving the public permission to use the Modified
645 Version under the terms of this License, in the form shown in
646 the Addendum below.
647
648 G. Preserve in that license notice the full lists of Invariant
649 Sections and required Cover Texts given in the Document's
650 license notice.
651
652 H. Include an unaltered copy of this License.
653
654 I. Preserve the section entitled "History", and its title, and
655 add to it an item stating at least the title, year, new
656 authors, and publisher of the Modified Version as given on
657 the Title Page. If there is no section entitled "History" in
658 the Document, create one stating the title, year, authors,
659 and publisher of the Document as given on its Title Page,
660 then add an item describing the Modified Version as stated in
661 the previous sentence.
662
663 J. Preserve the network location, if any, given in the Document
664 for public access to a Transparent copy of the Document, and
665 likewise the network locations given in the Document for
666 previous versions it was based on. These may be placed in
667 the "History" section. You may omit a network location for a
668 work that was published at least four years before the
669 Document itself, or if the original publisher of the version
670 it refers to gives permission.
671
672 K. In any section entitled "Acknowledgments" or "Dedications",
673 preserve the section's title, and preserve in the section all
674 the substance and tone of each of the contributor
675 acknowledgments and/or dedications given therein.
676
677 L. Preserve all the Invariant Sections of the Document,
678 unaltered in their text and in their titles. Section numbers
679 or the equivalent are not considered part of the section
680 titles.
681
682 M. Delete any section entitled "Endorsements". Such a section
683 may not be included in the Modified Version.
684
685 N. Do not retitle any existing section as "Endorsements" or to
686 conflict in title with any Invariant Section.
687
688 If the Modified Version includes new front-matter sections or
689 appendices that qualify as Secondary Sections and contain no
690 material copied from the Document, you may at your option
691 designate some or all of these sections as invariant. To do this,
692 add their titles to the list of Invariant Sections in the Modified
693 Version's license notice. These titles must be distinct from any
694 other section titles.
695
696 You may add a section entitled "Endorsements", provided it contains
697 nothing but endorsements of your Modified Version by various
698 parties--for example, statements of peer review or that the text
699 has been approved by an organization as the authoritative
700 definition of a standard.
701
702 You may add a passage of up to five words as a Front-Cover Text,
703 and a passage of up to 25 words as a Back-Cover Text, to the end
704 of the list of Cover Texts in the Modified Version. Only one
705 passage of Front-Cover Text and one of Back-Cover Text may be
706 added by (or through arrangements made by) any one entity. If the
707 Document already includes a cover text for the same cover,
708 previously added by you or by arrangement made by the same entity
709 you are acting on behalf of, you may not add another; but you may
710 replace the old one, on explicit permission from the previous
711 publisher that added the old one.
712
713 The author(s) and publisher(s) of the Document do not by this
714 License give permission to use their names for publicity for or to
715 assert or imply endorsement of any Modified Version.
716
717 5. COMBINING DOCUMENTS
718
719 You may combine the Document with other documents released under
720 this License, under the terms defined in section 4 above for
721 modified versions, provided that you include in the combination
722 all of the Invariant Sections of all of the original documents,
723 unmodified, and list them all as Invariant Sections of your
724 combined work in its license notice.
725
726 The combined work need only contain one copy of this License, and
727 multiple identical Invariant Sections may be replaced with a single
728 copy. If there are multiple Invariant Sections with the same name
729 but different contents, make the title of each such section unique
730 by adding at the end of it, in parentheses, the name of the
731 original author or publisher of that section if known, or else a
732 unique number. Make the same adjustment to the section titles in
733 the list of Invariant Sections in the license notice of the
734 combined work.
735
736 In the combination, you must combine any sections entitled
737 "History" in the various original documents, forming one section
738 entitled "History"; likewise combine any sections entitled
739 "Acknowledgments", and any sections entitled "Dedications". You
740 must delete all sections entitled "Endorsements."
741
742 6. COLLECTIONS OF DOCUMENTS
743
744 You may make a collection consisting of the Document and other
745 documents released under this License, and replace the individual
746 copies of this License in the various documents with a single copy
747 that is included in the collection, provided that you follow the
748 rules of this License for verbatim copying of each of the
749 documents in all other respects.
750
751 You may extract a single document from such a collection, and
752 distribute it individually under this License, provided you insert
753 a copy of this License into the extracted document, and follow
754 this License in all other respects regarding verbatim copying of
755 that document.
756
757 7. AGGREGATION WITH INDEPENDENT WORKS
758
759 A compilation of the Document or its derivatives with other
760 separate and independent documents or works, in or on a volume of
761 a storage or distribution medium, does not as a whole count as a
762 Modified Version of the Document, provided no compilation
763 copyright is claimed for the compilation. Such a compilation is
764 called an "aggregate", and this License does not apply to the
765 other self-contained works thus compiled with the Document, on
766 account of their being thus compiled, if they are not themselves
767 derivative works of the Document.
768
769 If the Cover Text requirement of section 3 is applicable to these
770 copies of the Document, then if the Document is less than one
771 quarter of the entire aggregate, the Document's Cover Texts may be
772 placed on covers that surround only the Document within the
773 aggregate. Otherwise they must appear on covers around the whole
774 aggregate.
775
776 8. TRANSLATION
777
778 Translation is considered a kind of modification, so you may
779 distribute translations of the Document under the terms of section
780 4. Replacing Invariant Sections with translations requires special
781 permission from their copyright holders, but you may include
782 translations of some or all Invariant Sections in addition to the
783 original versions of these Invariant Sections. You may include a
784 translation of this License provided that you also include the
785 original English version of this License. In case of a
786 disagreement between the translation and the original English
787 version of this License, the original English version will prevail.
788
789 9. TERMINATION
790
791 You may not copy, modify, sublicense, or distribute the Document
792 except as expressly provided for under this License. Any other
793 attempt to copy, modify, sublicense or distribute the Document is
794 void, and will automatically terminate your rights under this
795 License. However, parties who have received copies, or rights,
796 from you under this License will not have their licenses
797 terminated so long as such parties remain in full compliance.
798
799 10. FUTURE REVISIONS OF THIS LICENSE
800
801 The Free Software Foundation may publish new, revised versions of
802 the GNU Free Documentation License from time to time. Such new
803 versions will be similar in spirit to the present version, but may
804 differ in detail to address new problems or concerns. See
805 `http://www.gnu.org/copyleft/'.
806
807 Each version of the License is given a distinguishing version
808 number. If the Document specifies that a particular numbered
809 version of this License "or any later version" applies to it, you
810 have the option of following the terms and conditions either of
811 that specified version or of any later version that has been
812 published (not as a draft) by the Free Software Foundation. If
813 the Document does not specify a version number of this License,
814 you may choose any version ever published (not as a draft) by the
815 Free Software Foundation.
816
817 ADDENDUM: How to use this License for your documents
818 ----------------------------------------------------
819
820 To use this License in a document you have written, include a copy of
821 the License in the document and put the following copyright and license
822 notices just after the title page:
823
824 Copyright (C) YEAR YOUR NAME.
825 Permission is granted to copy, distribute and/or modify this document
826 under the terms of the GNU Free Documentation License, Version 1.1
827 or any later version published by the Free Software Foundation;
828 with the Invariant Sections being LIST THEIR TITLES, with the
829 Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
830 A copy of the license is included in the section entitled ``GNU
831 Free Documentation License''.
832
833 If you have no Invariant Sections, write "with no Invariant Sections"
834 instead of saying which ones are invariant. If you have no Front-Cover
835 Texts, write "no Front-Cover Texts" instead of "Front-Cover Texts being
836 LIST"; likewise for Back-Cover Texts.
837
838 If your document contains nontrivial examples of program code, we
839 recommend releasing these examples in parallel under your choice of
840 free software license, such as the GNU General Public License, to
841 permit their use in free software.
842
843 \1f
844 File: bison.info, Node: Index, Prev: Copying This Manual, Up: Top
845
846 Index
847 *****
848
849 * Menu:
850
851 * $$: Actions.
852 * $N: Actions.
853 * %expect: Expect Decl.
854 * %left: Using Precedence.
855 * %nonassoc: Using Precedence.
856 * %prec: Contextual Precedence.
857 * %pure_parser: Pure Decl.
858 * %right: Using Precedence.
859 * %start: Start Decl.
860 * %token: Token Decl.
861 * %type: Type Decl.
862 * %union: Union Decl.
863 * @$ <1>: Action Features.
864 * @$: Actions and Locations.
865 * @N <1>: Action Features.
866 * @N: Actions and Locations.
867 * action: Actions.
868 * action data types: Action Types.
869 * action features summary: Action Features.
870 * actions in mid-rule: Mid-Rule Actions.
871 * actions, location: Actions and Locations.
872 * actions, semantic: Semantic Actions.
873 * additional C code section: C Code.
874 * algorithm of parser: Algorithm.
875 * associativity: Why Precedence.
876 * Backus-Naur form: Language and Grammar.
877 * Bison declaration summary: Decl Summary.
878 * Bison declarations: Declarations.
879 * Bison declarations (introduction): Bison Declarations.
880 * Bison grammar: Grammar in Bison.
881 * Bison invocation: Invocation.
882 * Bison parser: Bison Parser.
883 * Bison parser algorithm: Algorithm.
884 * Bison symbols, table of: Table of Symbols.
885 * Bison utility: Bison Parser.
886 * BISON_HAIRY: Environment Variables.
887 * BISON_SIMPLE: Environment Variables.
888 * BNF: Language and Grammar.
889 * C code, section for additional: C Code.
890 * C declarations section: C Declarations.
891 * C-language interface: Interface.
892 * calc: Infix Calc.
893 * calculator, infix notation: Infix Calc.
894 * calculator, location tracking: Location Tracking Calc.
895 * calculator, multi-function: Multi-function Calc.
896 * calculator, simple: RPN Calc.
897 * character token: Symbols.
898 * compiling the parser: Rpcalc Compile.
899 * conflicts: Shift/Reduce.
900 * conflicts, reduce/reduce: Reduce/Reduce.
901 * conflicts, suppressing warnings of: Expect Decl.
902 * context-dependent precedence: Contextual Precedence.
903 * context-free grammar: Language and Grammar.
904 * controlling function: Rpcalc Main.
905 * dangling else: Shift/Reduce.
906 * data type of locations: Location Type.
907 * data types in actions: Action Types.
908 * data types of semantic values: Value Type.
909 * debugging: Debugging.
910 * declaration summary: Decl Summary.
911 * declarations, Bison: Declarations.
912 * declarations, Bison (introduction): Bison Declarations.
913 * declarations, C: C Declarations.
914 * declaring literal string tokens: Token Decl.
915 * declaring operator precedence: Precedence Decl.
916 * declaring the start symbol: Start Decl.
917 * declaring token type names: Token Decl.
918 * declaring value types: Union Decl.
919 * declaring value types, nonterminals: Type Decl.
920 * default action: Actions.
921 * default data type: Value Type.
922 * default location type: Location Type.
923 * default stack limit: Stack Overflow.
924 * default start symbol: Start Decl.
925 * defining language semantics: Semantics.
926 * else, dangling: Shift/Reduce.
927 * environment variables: Environment Variables.
928 * error: Error Recovery.
929 * error recovery: Error Recovery.
930 * error recovery, simple: Simple Error Recovery.
931 * error reporting function: Error Reporting.
932 * error reporting routine: Rpcalc Error.
933 * examples, simple: Examples.
934 * exercises: Exercises.
935 * FDL, GNU Free Documentation License: GNU Free Documentation License.
936 * file format: Grammar Layout.
937 * finite-state machine: Parser States.
938 * formal grammar: Grammar in Bison.
939 * format of grammar file: Grammar Layout.
940 * glossary: Glossary.
941 * grammar file: Grammar Layout.
942 * grammar rule syntax: Rules.
943 * grammar rules section: Grammar Rules.
944 * grammar, Bison: Grammar in Bison.
945 * grammar, context-free: Language and Grammar.
946 * grouping, syntactic: Language and Grammar.
947 * infix notation calculator: Infix Calc.
948 * interface: Interface.
949 * introduction: Introduction.
950 * invoking Bison: Invocation.
951 * invoking Bison under VMS: VMS Invocation.
952 * LALR(1): Mystery Conflicts.
953 * language semantics, defining: Semantics.
954 * layout of Bison grammar: Grammar Layout.
955 * left recursion: Recursion.
956 * lexical analyzer: Lexical.
957 * lexical analyzer, purpose: Bison Parser.
958 * lexical analyzer, writing: Rpcalc Lexer.
959 * lexical tie-in: Lexical Tie-ins.
960 * literal string token: Symbols.
961 * literal token: Symbols.
962 * location <1>: Locations.
963 * location: Locations Overview.
964 * location actions: Actions and Locations.
965 * location tracking calculator: Location Tracking Calc.
966 * look-ahead token: Look-Ahead.
967 * LR(1): Mystery Conflicts.
968 * ltcalc: Location Tracking Calc.
969 * main function in simple example: Rpcalc Main.
970 * mfcalc: Multi-function Calc.
971 * mid-rule actions: Mid-Rule Actions.
972 * multi-function calculator: Multi-function Calc.
973 * multicharacter literal: Symbols.
974 * mutual recursion: Recursion.
975 * nonterminal symbol: Symbols.
976 * operator precedence: Precedence.
977 * operator precedence, declaring: Precedence Decl.
978 * options for invoking Bison: Invocation.
979 * overflow of parser stack: Stack Overflow.
980 * parse error: Error Reporting.
981 * parser: Bison Parser.
982 * parser stack: Algorithm.
983 * parser stack overflow: Stack Overflow.
984 * parser state: Parser States.
985 * polish notation calculator: RPN Calc.
986 * position, textual <1>: Locations.
987 * position, textual: Locations Overview.
988 * precedence declarations: Precedence Decl.
989 * precedence of operators: Precedence.
990 * precedence, context-dependent: Contextual Precedence.
991 * precedence, unary operator: Contextual Precedence.
992 * preventing warnings about conflicts: Expect Decl.
993 * pure parser: Pure Decl.
994 * recovery from errors: Error Recovery.
995 * recursive rule: Recursion.
996 * reduce/reduce conflict: Reduce/Reduce.
997 * reduction: Algorithm.
998 * reentrant parser: Pure Decl.
999 * reverse polish notation: RPN Calc.
1000 * right recursion: Recursion.
1001 * rpcalc: RPN Calc.
1002 * rule syntax: Rules.
1003 * rules section for grammar: Grammar Rules.
1004 * running Bison (introduction): Rpcalc Gen.
1005 * semantic actions: Semantic Actions.
1006 * semantic value: Semantic Values.
1007 * semantic value type: Value Type.
1008 * shift/reduce conflicts: Shift/Reduce.
1009 * shifting: Algorithm.
1010 * simple examples: Examples.
1011 * single-character literal: Symbols.
1012 * stack overflow: Stack Overflow.
1013 * stack, parser: Algorithm.
1014 * stages in using Bison: Stages.
1015 * start symbol: Language and Grammar.
1016 * start symbol, declaring: Start Decl.
1017 * state (of parser): Parser States.
1018 * string token: Symbols.
1019 * summary, action features: Action Features.
1020 * summary, Bison declaration: Decl Summary.
1021 * suppressing conflict warnings: Expect Decl.
1022 * symbol: Symbols.
1023 * symbol table example: Mfcalc Symtab.
1024 * symbols (abstract): Language and Grammar.
1025 * symbols in Bison, table of: Table of Symbols.
1026 * syntactic grouping: Language and Grammar.
1027 * syntax error: Error Reporting.
1028 * syntax of grammar rules: Rules.
1029 * terminal symbol: Symbols.
1030 * textual position <1>: Locations.
1031 * textual position: Locations Overview.
1032 * token: Language and Grammar.
1033 * token type: Symbols.
1034 * token type names, declaring: Token Decl.
1035 * tracing the parser: Debugging.
1036 * unary operator precedence: Contextual Precedence.
1037 * using Bison: Stages.
1038 * value type, semantic: Value Type.
1039 * value types, declaring: Union Decl.
1040 * value types, nonterminals, declaring: Type Decl.
1041 * value, semantic: Semantic Values.
1042 * VMS: VMS Invocation.
1043 * warnings, preventing: Expect Decl.
1044 * writing a lexical analyzer: Rpcalc Lexer.
1045 * YYABORT: Parser Function.
1046 * YYACCEPT: Parser Function.
1047 * YYBACKUP: Action Features.
1048 * yychar: Look-Ahead.
1049 * yyclearin: Error Recovery.
1050 * yydebug: Debugging.
1051 * YYDEBUG: Debugging.
1052 * YYEMPTY: Action Features.
1053 * yyerrok: Error Recovery.
1054 * YYERROR: Action Features.
1055 * yyerror: Error Reporting.
1056 * YYERROR_VERBOSE: Error Reporting.
1057 * YYINITDEPTH: Stack Overflow.
1058 * yylex: Lexical.
1059 * YYLEX_PARAM: Pure Calling.
1060 * yylloc: Token Positions.
1061 * YYLLOC_DEFAULT: Location Default Action.
1062 * YYLTYPE: Token Positions.
1063 * yylval: Token Values.
1064 * YYMAXDEPTH: Stack Overflow.
1065 * yynerrs: Error Reporting.
1066 * yyparse: Parser Function.
1067 * YYPARSE_PARAM: Pure Calling.
1068 * YYPRINT: Debugging.
1069 * YYRECOVERING: Error Recovery.
1070 * |: Rules.
1071
1072