File: grammar.yo

package info (click to toggle)
bisonc%2B%2B 6.09.02-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,984 kB
  • sloc: cpp: 9,375; ansic: 1,505; fortran: 1,134; makefile: 1,062; sh: 526; yacc: 84; lex: 60
file content (232 lines) | stat: -rw-r--r-- 7,700 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
includefile(grammar/intro.yo)

lsect(OUTLINE)(Outline of a Bisonc++ Grammar File)
includefile(grammar/outline.yo)

lsect(SYMBOLS)(Symbols, Terminal and Nonterminal Symbols)
includefile(grammar/symbols.yo)

lsect(RULES)(Syntax of Grammar Rules)
includefile(grammar/syntax.yo)

lsect(RECURSIVE)(Writing recursive rules)
includefile(grammar/recursive.yo)

lsect(DIRECTIVES)(Bisonc++ Directives)
includefile(directives/intro.yo)

    subsect(%baseclass-preinclude: specifying a header included by the
            baseclass)    
    includefile(directives/preinclude.yo)

    lsubsect(PARSERCLASS)
            (%class-name: defining the name of the parser class)
    includefile(directives/parserclass.yo)

    subsect(%debug: adding debugging code to the `parse()' member)
    includefile(directives/debug.yo)

    lsubsect(DEFAULTACTION)
        (%default-actions: adding `$$ = $1' action blocks to production rules)
    includefile(directives/defaultactions.yo)

    subsect(%error-verbose: dumping the parser's state stack)
    includefile(directives/errorverbose.yo)

    lsubsect(EXPECT)(%expect: suppressing conflict warnings)
    includefile(directives/expect.yo)

    subsect(%flex: using the traditional `flex++'  interface)
    includefile(directives/flex.yo)

    lsubsect(INCLUDE)(%include: splitting the input file)
    includefile(directives/include.yo)

    lsubsect(PRECEDENCE)(%left, %right, %nonassoc: defining operator
        precedence)
    includefile(directives/precedence.yo)

    lsubsect(LOCSTRUCT)
            (%locationstruct: specifying a dedicated location struct)
    includefile(directives/locstruct.yo)

    lsubsect(LSPNEEDED)(%lsp-needed: using the default location type)
    includefile(directives/lneeded.yo)

    lsubsect(LTYPE)(%ltype: using an existing location type)
    includefile(directives/ltype.yo)

    subsect(%namespace: using a namespace)
    includefile(directives/namespace.yo)

    subsect(%negative-dollar-indices: using constructions like $-1)
    includefile(directives/negative.yo)

    subsect(%no-lines: suppressing `#line' directives)
    includefile(directives/lines.yo)

    subsect(%polymorphic: using polymorphism to define multiple semantic
            values) 
    includefile(directives/polymorphic.yo)

    subsect(%prec: overruling default precedences)
    includefile(directives/prec.yo)

    subsect(%print-tokens: displaying tokens and matched text) 
    includefile(directives/print.yo)

    subsect(%prompt: show prompts when using debug) 
    includefile(directives/prompt.yo)

    subsect(%required-tokens: defining the minimum number of tokens between
        error reports) 
    includefile(directives/required.yo)

    lsubsect(SCANNER)(%scanner: using a standard scanner interface)
    includefile(directives/scanner.yo)

    subsect(%scanner-matched-text-function: define the name of the scanner's
        member returning the matched texttoken) 
    includefile(directives/scannermatchedtextfunction.yo)

    subsect(%scanner-token-function: define the name of the scanner's token
            function) 
    includefile(directives/scannertokenfunction.yo)

    subsect(%stack-expansion: the number of elements added to the semantic
                                value stack)
    includefile(directives/stackexpansion.yo)

    subsect(%start: defining the start rule)
    includefile(directives/start.yo)

    lsubsect(STYPE)(%stype: defining a single semantic value type)
    includefile(directives/stype.yo)

    subsect(%tag-mismatches: check for tag-mismatches with polymorphic
        semantic values)
    includefile(directives/tagmismatches.yo)

    subsect(%thread-safe: use thread-local data with polymorphic semantic
            values) 
    includefile(directives/threadsafe.yo)

    lsubsect(TOKTYPENAMES)(%token: defining token names)
    includefile(directives/tokens.yo)

        lsubsubsect(IMPROPER)(Improper token names)
        includefile(directives/improper.yo)

    subsect(%token-class: defining the class name containing the semantic
            tokens)
    includefile(directives/tokenclass.yo)

    subsect(%token-namespace: defining the namespce of the Tokens class)
    includefile(directives/tokennamespace.yo)

    lsubsect(TYPE)(%type: associating semantic values with (non)terminals)
    includefile(directives/nonterms.yo)

    lsubsect(UNION)(%union: using a 'union' to define multiple semantic values) 
    includefile(directives/union.yo)

    subsect(%weak-tags: %polymorphic declaring 'enum Tag_')
    includefile(directives/weaktags.yo)

    subsect(Directives controlling the names of generated files)
    includefile(directives/output.yo)

        lsubsubsect(BCHEADER)
            (%baseclass-header: defining the parser's base class header)
        includefile(directives/baseclass.yo)

        lsubsubsect(CHEADER)
            (%class-header: defining the parser's class header)
        includefile(directives/classhdr.yo)

        lsubsubsect(FILES)
            (%filenames: specifying a generic filename)
        includefile(directives/filenames.yo)

        lsubsubsect(IHEADER)
            (%implementation-header: defining the implementation header)
        includefile(directives/imphdr.yo)

        lsubsubsect(PARSESOURCE)
               (%parsefun-source: defining the parse() function's sourcefile)
        includefile(directives/parse.yo)

        subsubsect(%target-directory: defining the directory where files must
                be written)
        includefile(directives/targetdir.yo)

        lsubsubsect(TOKENPATH)
               (%token-path: defining the path of the file containing the
                Tokens_ enumeration)
        includefile(directives/tokenpath.yo)

lsect(SEMANTICS)(The Meaning Of Things: Semantics)
includefile(grammar/semantics.yo)

    lsubsect(POLYMORPHIC)(Polymorphism and Multiple Semantic Values:
                        `%polymorphic') 
    includefile(grammar/polymorphic.yo)

        subsubsect(The %polymorphic directive)
        includefile(grammar/polymorphicdirective.yo)

        subsubsect(Code generated by %polymorphic)
        includefile(grammar/code.yo)

        subsubsect(A parser using a polymorphic semantic value type)
        includefile(grammar/parser.yo)

        subsubsect(A scanner using a polymorphic semantic value type)
        includefile(grammar/scanner.yo)

    lsubsect(ACTIONS)(Actions and shorthand ($) notations)
    includefile(grammar/actions.yo)

        subsubsect(%stype shorthand notations)
        includefile(grammar/stypeshorthand.yo)

        subsubsect(%union shorthand notations)
        includefile(grammar/unionshorthand.yo)

        subsubsect(%polymorphic shorthand notations)
        includefile(grammar/polymorphicshorthand.yo)

COMMENT(
  lsubsubsect(POLYTYPE)
      (The %polymorphic and %type: associating semantic values
          with (non-)terminals) 
  includefile(grammar/polymorphictype.yo)
END)

        lsubsubsect(MIDACTIONS)(Mid-Rule Action Blocks)
        includefile(grammar/midrule.yo)

sect(Basic Grammatical Constructions)
includefile(grammar/gramcons.yo)

    subsect(Plain Alternatives)
    includefile(grammar/alternatives.yo)

    subsect(One Or More Alternatives, No Separators)
    includefile(grammar/series.yo)

    lsubsect(OPTSERIES)(Zero Or More Alternatives, No Separators)
    includefile(grammar/optseries.yo)

    subsect(One Or More Alternatives, Using Separators)
    includefile(grammar/delimseries.yo)

    subsect(Zero Or More Alternatives, Using Separators)
    includefile(grammar/optdelim.yo)

    subsect(Nested Blocks)
    includefile(grammar/nested.yo)

sect(Multiple Parsers in the Same Program)
includefile(grammar/multiple.yo)