]>
Commit | Line | Data |
---|---|---|
28bf4b0b | 1 | /* |
2 | ** Inserted at beginning of c files generated by bison | |
3 | ** REMEMBER: Change bison.reset too. | |
4 | */ | |
5 | ||
6 | /*@-allmacros@*/ | |
7 | /*@+boolint@*/ | |
8 | /*@+charint@*/ | |
9 | /*@-macroparams@*/ | |
10 | /*@-macroundef@*/ | |
11 | /*@-unreachable@*/ | |
12 | /*@-macrospec@*/ | |
13 | /*@-varuse@*/ | |
14 | /*@+ignorequals@*/ | |
15 | /*@-macrostmt@*/ | |
16 | /*@-noeffect@*/ | |
17 | /*@-shadow@*/ | |
18 | /*@-exitarg@*/ | |
19 | /*@-macroredef@*/ | |
20 | /*@-uniondef@*/ | |
21 | /*@-compdef@*/ | |
22 | /*@-matchfields@*/ | |
23 | /*@-exportlocal@*/ | |
24 | /*@-evalorderuncon@*/ | |
25 | /*@-exportheader@*/ | |
26 | /*@-typeuse@*/ | |
27 | /*@-redecl@*/ | |
28 | /*@-redef@*/ | |
29 | /*@-noparams@*/ | |
30 | /*@-ansireserved@*/ | |
31 | /*@-fielduse@*/ | |
32 | /*@-ifblock@*/ | |
33 | /*@-elseifcomplete@*/ | |
34 | /*@-whileblock@*/ | |
35 | /*@-forblock@*/ | |
36 | /*@-branchstate@*/ | |
37 | /*@-readonlytrans@*/ | |
38 | /*@-namechecks@*/ | |
39 | /*@-usedef@*/ | |
40 | /*@-systemunrecog@*/ | |
41 | /*@-dependenttrans@*/ | |
42 | /*@-unqualifiedtrans@*/ | |
43 | /*@-nullassign@*/ | |
60eced23 | 44 | /*@-declundef@*/ |
28bf4b0b | 45 | |
46 | /* < end of bison.head > */ | |
47 | ||
48 | ||
49 | /* A Bison parser, made from mtgrammar.y | |
50 | by GNU Bison version 1.28 */ | |
51 | ||
52 | #define YYBISON 1 /* Identify Bison output. */ | |
53 | ||
54 | #define yyparse mtparse | |
55 | #define yylex mtlex | |
56 | #define yyerror mterror | |
57 | #define yylval mtlval | |
58 | #define yychar mtchar | |
59 | #define yydebug mtdebug | |
60 | #define yynerrs mtnerrs | |
61 | #define MT_BADTOK 257 | |
62 | #define MT_END 258 | |
63 | #define MT_STATE 259 | |
64 | #define MT_GLOBAL 260 | |
65 | #define MT_CONTEXT 261 | |
66 | #define MT_ONEOF 262 | |
67 | #define MT_DEFAULTS 263 | |
68 | #define MT_DEFAULT 264 | |
69 | #define MT_REFERENCE 265 | |
70 | #define MT_PARAMETER 266 | |
b072092f | 71 | #define MT_RESULT 267 |
72 | #define MT_CLAUSE 268 | |
12f2ffe9 | 73 | #define MT_LITERAL 269 |
74 | #define MT_NULL 270 | |
75 | #define MT_ANNOTATIONS 271 | |
76 | #define MT_ARROW 272 | |
77 | #define MT_MERGE 273 | |
78 | #define MT_TRANSFERS 274 | |
79 | #define MT_PRECONDITIONS 275 | |
80 | #define MT_POSTCONDITIONS 276 | |
81 | #define MT_LOSEREFERENCE 277 | |
82 | #define MT_AS 278 | |
83 | #define MT_ERROR 279 | |
84 | #define MT_PLUS 280 | |
85 | #define MT_STAR 281 | |
86 | #define MT_BAR 282 | |
87 | #define MT_LPAREN 283 | |
88 | #define MT_RPAREN 284 | |
89 | #define MT_LBRACKET 285 | |
90 | #define MT_RBRACKET 286 | |
91 | #define MT_LBRACE 287 | |
92 | #define MT_RBRACE 288 | |
93 | #define MT_COMMA 289 | |
94 | #define MT_CHAR 290 | |
95 | #define MT_INT 291 | |
96 | #define MT_FLOAT 292 | |
97 | #define MT_DOUBLE 293 | |
98 | #define MT_VOID 294 | |
99 | #define MT_ANYTYPE 295 | |
100 | #define MT_INTEGRALTYPE 296 | |
101 | #define MT_UNSIGNEDINTEGRALTYPE 297 | |
102 | #define MT_SIGNEDINTEGRALTYPE 298 | |
103 | #define MT_CONST 299 | |
104 | #define MT_VOLATILE 300 | |
105 | #define MT_STRINGLIT 301 | |
106 | #define MT_IDENT 302 | |
28bf4b0b | 107 | |
108 | #line 25 "mtgrammar.y" | |
109 | ||
110 | ||
111 | # include "bison.reset" | |
112 | # include "lclintMacros.nf" | |
113 | # include "llbasic.h" | |
28bf4b0b | 114 | |
b7b694d6 | 115 | # ifndef __LCLINT__ |
116 | extern ctype mtscanner_lookupType (mttok p_tok) /*@modifies p_tok@*/ ; | |
117 | # endif | |
118 | ||
68de3f33 | 119 | /*@i523@*/ /* can't include these here |
b7b694d6 | 120 | # include "mtgrammar.h" |
121 | # include "mtscanner.h" | |
122 | */ | |
123 | ||
28bf4b0b | 124 | static /*@exits@*/ void mterror (char *); |
125 | ||
126 | /*@-noparams@*/ /* Can't list params since YYSTYPE isn't defined yet. */ | |
127 | static void yyprint (/*FILE *p_file, int p_type, YYSTYPE p_value */); | |
128 | /*@=noparams@*/ | |
129 | ||
130 | # define YYPRINT(file, type, value) yyprint (file, type, value) | |
131 | ||
132 | # define YYDEBUG 1 | |
133 | ||
134 | # include "bison.head" | |
135 | ||
136 | ||
b7b694d6 | 137 | #line 56 "mtgrammar.y" |
28bf4b0b | 138 | typedef union { |
139 | mttok tok; | |
140 | mtDeclarationNode mtdecl; | |
141 | mtDeclarationPiece mtpiece; | |
142 | mtDeclarationPieces mtpieces; | |
143 | mtContextNode mtcontext; | |
144 | mtValuesNode mtvalues; | |
145 | mtDefaultsNode mtdefaults; | |
146 | mtDefaultsDeclList mtdeflist; | |
147 | mtAnnotationsNode mtannotations; | |
148 | mtAnnotationList mtannotlist; | |
149 | mtAnnotationDecl mtannotdecl; | |
150 | mtMergeNode mtmerge; | |
151 | mtMergeItem mtmergeitem; | |
152 | mtMergeClauseList mtmergeclauselist; | |
153 | mtMergeClause mtmergeclause; | |
154 | mtTransferClauseList mttransferclauselist; | |
155 | mtTransferClause mttransferclause; | |
156 | mtTransferAction mttransferaction; | |
157 | mtLoseReferenceList mtlosereferencelist; | |
158 | mtLoseReference mtlosereference; | |
159 | ||
160 | /*@only@*/ cstringList cstringlist; | |
161 | ctype ctyp; | |
162 | /*@only@*/ qtype qtyp; | |
163 | int count; | |
164 | } YYSTYPE; | |
165 | #ifndef YYDEBUG | |
166 | #define YYDEBUG 1 | |
167 | #endif | |
168 | ||
169 | #include <stdio.h> | |
170 | ||
171 | #ifndef __cplusplus | |
172 | #ifndef __STDC__ | |
173 | #define const | |
174 | #endif | |
175 | #endif | |
176 | ||
177 | ||
178 | ||
12f2ffe9 | 179 | #define YYFINAL 135 |
28bf4b0b | 180 | #define YYFLAG -32768 |
12f2ffe9 | 181 | #define YYNTBASE 49 |
28bf4b0b | 182 | |
12f2ffe9 | 183 | #define YYTRANSLATE(x) ((unsigned)(x) <= 302 ? yytranslate[x] : 92) |
28bf4b0b | 184 | |
185 | static const char yytranslate[] = { 0, | |
186 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
187 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
188 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
189 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
190 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
191 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
192 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
193 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
194 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
195 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
196 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
197 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
198 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
199 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
200 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
201 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
202 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
203 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
204 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
205 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
206 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
207 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
208 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
209 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
210 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | |
211 | 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, | |
212 | 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, | |
213 | 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, | |
214 | 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, | |
12f2ffe9 | 215 | 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, |
216 | 47, 48 | |
28bf4b0b | 217 | }; |
218 | ||
219 | #if YYDEBUG != 0 | |
220 | static const short yyprhs[] = { 0, | |
221 | 0, 1, 3, 7, 12, 15, 16, 19, 21, 23, | |
222 | 25, 27, 29, 31, 33, 35, 37, 39, 42, 43, | |
12f2ffe9 | 223 | 45, 48, 51, 54, 57, 60, 63, 64, 66, 68, |
224 | 71, 73, 77, 80, 81, 83, 85, 87, 90, 92, | |
225 | 95, 98, 102, 104, 106, 108, 111, 115, 118, 122, | |
226 | 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, | |
227 | 144, 147, 149, 153, 156, 159, 163, 168, 171, 173, | |
228 | 176, 181, 184, 186, 189, 195, 197, 199, 202, 205, | |
229 | 208, 211, 213, 216, 220, 222, 225, 231, 233, 235, | |
230 | 237, 240 | |
28bf4b0b | 231 | }; |
232 | ||
233 | static const short yyrhs[] = { -1, | |
12f2ffe9 | 234 | 50, 0, 5, 51, 4, 0, 6, 5, 51, 4, |
235 | 0, 48, 52, 0, 0, 53, 52, 0, 54, 0, | |
236 | 69, 0, 72, 0, 71, 0, 74, 0, 77, 0, | |
237 | 83, 0, 81, 0, 82, 0, 84, 0, 7, 56, | |
238 | 0, 0, 56, 0, 12, 57, 0, 11, 57, 0, | |
239 | 13, 57, 0, 14, 57, 0, 15, 57, 0, 16, | |
240 | 57, 0, 0, 58, 0, 59, 0, 59, 62, 0, | |
241 | 60, 0, 59, 28, 58, 0, 67, 61, 0, 0, | |
242 | 59, 0, 63, 0, 66, 0, 63, 66, 0, 27, | |
243 | 0, 27, 65, 0, 27, 63, 0, 27, 65, 63, | |
244 | 0, 45, 0, 46, 0, 64, 0, 65, 64, 0, | |
245 | 29, 62, 30, 0, 31, 32, 0, 66, 31, 32, | |
246 | 0, 36, 0, 37, 0, 38, 0, 39, 0, 40, | |
247 | 0, 41, 0, 42, 0, 43, 0, 44, 0, 68, | |
248 | 0, 48, 0, 8, 70, 0, 48, 0, 48, 35, | |
249 | 70, 0, 10, 91, 0, 9, 73, 0, 56, 18, | |
250 | 91, 0, 56, 18, 91, 73, 0, 17, 75, 0, | |
251 | 76, 0, 76, 75, 0, 48, 55, 18, 91, 0, | |
252 | 19, 78, 0, 79, 0, 79, 78, 0, 80, 26, | |
253 | 80, 18, 89, 0, 91, 0, 27, 0, 21, 87, | |
254 | 0, 22, 87, 0, 20, 87, 0, 23, 85, 0, | |
255 | 86, 0, 86, 85, 0, 91, 18, 90, 0, 88, | |
256 | 0, 88, 87, 0, 91, 24, 91, 18, 89, 0, | |
257 | 91, 0, 90, 0, 25, 0, 25, 47, 0, 48, | |
258 | 0 | |
28bf4b0b | 259 | }; |
260 | ||
261 | #endif | |
262 | ||
263 | #if YYDEBUG != 0 | |
264 | static const short yyrline[] = { 0, | |
b7b694d6 | 265 | 152, 153, 156, 158, 162, 166, 167, 171, 172, 173, |
266 | 174, 175, 176, 177, 178, 179, 180, 183, 187, 188, | |
267 | 191, 192, 193, 194, 195, 196, 203, 204, 207, 208, | |
268 | 211, 212, 216, 219, 220, 224, 225, 226, 229, 230, | |
269 | 231, 232, 235, 236, 239, 240, 243, 244, 245, 252, | |
270 | 253, 254, 255, 256, 257, 258, 259, 260, 261, 267, | |
271 | 270, 273, 274, 278, 281, 284, 286, 290, 293, 294, | |
272 | 298, 302, 305, 306, 309, 313, 314, 317, 320, 323, | |
273 | 326, 329, 330, 333, 336, 337, 340, 344, 345, 348, | |
274 | 349, 352 | |
28bf4b0b | 275 | }; |
276 | #endif | |
277 | ||
278 | ||
279 | #if YYDEBUG != 0 || defined (YYERROR_VERBOSE) | |
280 | ||
281 | static const char * const yytname[] = { "$","error","$undefined.","MT_BADTOK", | |
282 | "MT_END","MT_STATE","MT_GLOBAL","MT_CONTEXT","MT_ONEOF","MT_DEFAULTS","MT_DEFAULT", | |
12f2ffe9 | 283 | "MT_REFERENCE","MT_PARAMETER","MT_RESULT","MT_CLAUSE","MT_LITERAL","MT_NULL", |
284 | "MT_ANNOTATIONS","MT_ARROW","MT_MERGE","MT_TRANSFERS","MT_PRECONDITIONS","MT_POSTCONDITIONS", | |
285 | "MT_LOSEREFERENCE","MT_AS","MT_ERROR","MT_PLUS","MT_STAR","MT_BAR","MT_LPAREN", | |
286 | "MT_RPAREN","MT_LBRACKET","MT_RBRACKET","MT_LBRACE","MT_RBRACE","MT_COMMA","MT_CHAR", | |
287 | "MT_INT","MT_FLOAT","MT_DOUBLE","MT_VOID","MT_ANYTYPE","MT_INTEGRALTYPE","MT_UNSIGNEDINTEGRALTYPE", | |
28bf4b0b | 288 | "MT_SIGNEDINTEGRALTYPE","MT_CONST","MT_VOLATILE","MT_STRINGLIT","MT_IDENT","file", |
289 | "mtsDeclaration","declarationNode","declarationPieces","declarationPiece","contextDeclaration", | |
290 | "optContextSelection","contextSelection","optType","typeExpression","completeType", | |
291 | "completeTypeAux","optCompleteType","abstractDecl","pointers","innerMods","innerModsList", | |
292 | "abstractDeclBase","typeSpecifier","typeName","valuesDeclaration","valuesList", | |
293 | "defaultNode","defaultsDeclaration","defaultDeclarationList","annotationsDeclaration", | |
294 | "annotationsDeclarationList","annotationDeclaration","mergeDeclaration","mergeClauses", | |
295 | "mergeClause","mergeItem","preconditionsDeclaration","postconditionsDeclaration", | |
296 | "transfersDeclaration","loseReferenceDeclaration","lostClauses","lostClause", | |
297 | "transferClauses","transferClause","transferAction","errorAction","valueChoice", NULL | |
298 | }; | |
299 | #endif | |
300 | ||
301 | static const short yyr1[] = { 0, | |
12f2ffe9 | 302 | 49, 49, 50, 50, 51, 52, 52, 53, 53, 53, |
303 | 53, 53, 53, 53, 53, 53, 53, 54, 55, 55, | |
304 | 56, 56, 56, 56, 56, 56, 57, 57, 58, 58, | |
305 | 59, 59, 60, 61, 61, 62, 62, 62, 63, 63, | |
306 | 63, 63, 64, 64, 65, 65, 66, 66, 66, 67, | |
307 | 67, 67, 67, 67, 67, 67, 67, 67, 67, 68, | |
308 | 69, 70, 70, 71, 72, 73, 73, 74, 75, 75, | |
309 | 76, 77, 78, 78, 79, 80, 80, 81, 82, 83, | |
310 | 84, 85, 85, 86, 87, 87, 88, 89, 89, 90, | |
311 | 90, 91 | |
28bf4b0b | 312 | }; |
313 | ||
314 | static const short yyr2[] = { 0, | |
315 | 0, 1, 3, 4, 2, 0, 2, 1, 1, 1, | |
316 | 1, 1, 1, 1, 1, 1, 1, 2, 0, 1, | |
12f2ffe9 | 317 | 2, 2, 2, 2, 2, 2, 0, 1, 1, 2, |
318 | 1, 3, 2, 0, 1, 1, 1, 2, 1, 2, | |
319 | 2, 3, 1, 1, 1, 2, 3, 2, 3, 1, | |
320 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
321 | 2, 1, 3, 2, 2, 3, 4, 2, 1, 2, | |
322 | 4, 2, 1, 2, 5, 1, 1, 2, 2, 2, | |
323 | 2, 1, 2, 3, 1, 2, 5, 1, 1, 1, | |
324 | 2, 1 | |
28bf4b0b | 325 | }; |
326 | ||
327 | static const short yydefact[] = { 1, | |
328 | 0, 0, 2, 6, 0, 0, 0, 0, 0, 0, | |
329 | 0, 0, 0, 0, 0, 0, 5, 6, 8, 9, | |
330 | 11, 10, 12, 13, 15, 16, 14, 17, 3, 0, | |
12f2ffe9 | 331 | 27, 27, 27, 27, 27, 27, 18, 62, 61, 0, |
332 | 65, 92, 64, 19, 68, 69, 77, 72, 73, 0, | |
333 | 76, 80, 85, 0, 78, 79, 81, 82, 0, 7, | |
334 | 4, 50, 51, 52, 53, 54, 55, 56, 57, 58, | |
335 | 60, 22, 28, 29, 31, 34, 59, 21, 23, 24, | |
336 | 25, 26, 0, 0, 0, 20, 70, 74, 0, 86, | |
337 | 0, 83, 0, 39, 0, 0, 0, 30, 36, 37, | |
338 | 35, 33, 63, 66, 0, 0, 0, 90, 84, 43, | |
339 | 44, 41, 45, 40, 32, 0, 48, 38, 0, 67, | |
340 | 71, 0, 0, 91, 42, 46, 47, 49, 75, 89, | |
341 | 88, 87, 0, 0, 0 | |
28bf4b0b | 342 | }; |
343 | ||
12f2ffe9 | 344 | static const short yydefgoto[] = { 133, |
345 | 3, 5, 17, 18, 19, 85, 40, 72, 73, 74, | |
346 | 75, 102, 98, 99, 113, 114, 100, 76, 77, 20, | |
347 | 39, 21, 22, 41, 23, 45, 46, 24, 48, 49, | |
348 | 50, 25, 26, 27, 28, 57, 58, 52, 53, 129, | |
349 | 130, 54 | |
28bf4b0b | 350 | }; |
351 | ||
12f2ffe9 | 352 | static const short yypact[] = { 4, |
353 | -37, 35,-32768, 36, 37, -37, 21, 2, 21, 17, | |
354 | 18, -19, 17, 17, 17, 17,-32768, 36,-32768,-32768, | |
355 | -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 63, | |
356 | -23, -23, -23, -23, -23, -23,-32768, 33,-32768, 51, | |
357 | -32768,-32768,-32768, 21,-32768, 18,-32768,-32768, -19, 44, | |
358 | -32768,-32768, 17, 47,-32768,-32768,-32768, 17, 54,-32768, | |
28bf4b0b | 359 | -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, |
12f2ffe9 | 360 | -32768,-32768,-32768, -5,-32768, -23,-32768,-32768,-32768,-32768, |
361 | -32768,-32768, 2, 17, 55,-32768,-32768,-32768, -19,-32768, | |
362 | 17,-32768, 50, -15, -23, 20, 45,-32768, 23, 49, | |
363 | 48,-32768,-32768, 21, 17, 60, 64, 38,-32768,-32768, | |
364 | -32768,-32768,-32768, -15,-32768, 53,-32768, 49, 52,-32768, | |
365 | -32768, -20, -20,-32768,-32768,-32768,-32768,-32768,-32768,-32768, | |
366 | -32768,-32768, 86, 87,-32768 | |
28bf4b0b | 367 | }; |
368 | ||
369 | static const short yypgoto[] = {-32768, | |
12f2ffe9 | 370 | -32768, 82, 71,-32768,-32768,-32768, -6, 28, -4, 14, |
371 | -32768,-32768, -3, -87, -22,-32768, -2,-32768,-32768,-32768, | |
372 | 11,-32768,-32768, -8,-32768, 56,-32768,-32768, 57,-32768, | |
373 | 9,-32768,-32768,-32768,-32768, 41,-32768, -11,-32768, -18, | |
374 | 7, -10 | |
28bf4b0b | 375 | }; |
376 | ||
377 | ||
12f2ffe9 | 378 | #define YYLAST 113 |
28bf4b0b | 379 | |
380 | ||
12f2ffe9 | 381 | static const short yytable[] = { 43, |
382 | 37, 51, 55, 56, 108, 59, 112, 47, 1, 2, | |
383 | 4, 94, 62, 63, 64, 65, 66, 67, 68, 69, | |
384 | 70, 94, 95, 96, 71, 97, 125, 42, 42, 110, | |
385 | 111, 31, 32, 33, 34, 35, 36, 86, 51, 6, | |
386 | 29, 90, 7, 8, 9, 10, 94, 59, 96, 38, | |
387 | 97, 96, 11, 97, 12, 13, 14, 15, 16, 78, | |
388 | 79, 80, 81, 82, 42, 44, 61, 83, 84, 89, | |
389 | 91, 93, 105, 104, 108, 95, 117, 122, 51, 119, | |
390 | 107, 123, 127, 128, 124, 134, 135, 30, 60, 101, | |
391 | 115, 126, 116, 103, 121, 120, 118, 106, 92, 109, | |
392 | 0, 87, 0, 0, 132, 88, 0, 0, 0, 0, | |
393 | 0, 131, 131 | |
28bf4b0b | 394 | }; |
395 | ||
396 | static const short yycheck[] = { 10, | |
12f2ffe9 | 397 | 7, 12, 14, 15, 25, 16, 94, 27, 5, 6, |
398 | 48, 27, 36, 37, 38, 39, 40, 41, 42, 43, | |
399 | 44, 27, 28, 29, 48, 31, 114, 48, 48, 45, | |
400 | 46, 11, 12, 13, 14, 15, 16, 44, 49, 5, | |
401 | 4, 53, 7, 8, 9, 10, 27, 58, 29, 48, | |
402 | 31, 29, 17, 31, 19, 20, 21, 22, 23, 32, | |
403 | 33, 34, 35, 36, 48, 48, 4, 35, 18, 26, | |
404 | 24, 18, 18, 84, 25, 28, 32, 18, 89, 31, | |
405 | 91, 18, 30, 32, 47, 0, 0, 6, 18, 76, | |
406 | 95, 114, 96, 83, 105, 104, 99, 89, 58, 93, | |
407 | -1, 46, -1, -1, 123, 49, -1, -1, -1, -1, | |
408 | -1, 122, 123 | |
28bf4b0b | 409 | }; |
410 | #define YYPURE 1 | |
411 | ||
412 | /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ | |
413 | #line 3 "/usr/lib/bison.simple" | |
414 | /* This file comes from bison-1.28. */ | |
415 | ||
416 | /* Skeleton output parser for bison, | |
417 | Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. | |
418 | ||
419 | This program is free software; you can redistribute it and/or modify | |
420 | it under the terms of the GNU General Public License as published by | |
421 | the Free Software Foundation; either version 2, or (at your option) | |
422 | any later version. | |
423 | ||
424 | This program is distributed in the hope that it will be useful, | |
425 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
426 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
427 | GNU General Public License for more details. | |
428 | ||
429 | You should have received a copy of the GNU General Public License | |
430 | along with this program; if not, write to the Free Software | |
431 | Foundation, Inc., 59 Temple Place - Suite 330, | |
432 | Boston, MA 02111-1307, USA. */ | |
433 | ||
434 | /* As a special exception, when this file is copied by Bison into a | |
435 | Bison output file, you may use that output file without restriction. | |
436 | This special exception was added by the Free Software Foundation | |
437 | in version 1.24 of Bison. */ | |
438 | ||
439 | /* This is the parser code that is written into each bison parser | |
440 | when the %semantic_parser declaration is not specified in the grammar. | |
441 | It was written by Richard Stallman by simplifying the hairy parser | |
442 | used when %semantic_parser is specified. */ | |
443 | ||
444 | #ifndef YYSTACK_USE_ALLOCA | |
445 | #ifdef alloca | |
446 | #define YYSTACK_USE_ALLOCA | |
447 | #else /* alloca not defined */ | |
448 | #ifdef __GNUC__ | |
449 | #define YYSTACK_USE_ALLOCA | |
450 | #define alloca __builtin_alloca | |
451 | #else /* not GNU C. */ | |
452 | #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) | |
453 | #define YYSTACK_USE_ALLOCA | |
454 | #include <alloca.h> | |
455 | #else /* not sparc */ | |
456 | /* We think this test detects Watcom and Microsoft C. */ | |
457 | /* This used to test MSDOS, but that is a bad idea | |
458 | since that symbol is in the user namespace. */ | |
459 | #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) | |
460 | #if 0 /* No need for malloc.h, which pollutes the namespace; | |
461 | instead, just don't use alloca. */ | |
462 | #include <malloc.h> | |
463 | #endif | |
464 | #else /* not MSDOS, or __TURBOC__ */ | |
465 | #if defined(_AIX) | |
466 | /* I don't know what this was needed for, but it pollutes the namespace. | |
467 | So I turned it off. rms, 2 May 1997. */ | |
468 | /* #include <malloc.h> */ | |
469 | #pragma alloca | |
470 | #define YYSTACK_USE_ALLOCA | |
471 | #else /* not MSDOS, or __TURBOC__, or _AIX */ | |
472 | #if 0 | |
473 | #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up, | |
474 | and on HPUX 10. Eventually we can turn this on. */ | |
475 | #define YYSTACK_USE_ALLOCA | |
476 | #define alloca __builtin_alloca | |
477 | #endif /* __hpux */ | |
478 | #endif | |
479 | #endif /* not _AIX */ | |
480 | #endif /* not MSDOS, or __TURBOC__ */ | |
481 | #endif /* not sparc */ | |
482 | #endif /* not GNU C */ | |
483 | #endif /* alloca not defined */ | |
484 | #endif /* YYSTACK_USE_ALLOCA not defined */ | |
485 | ||
486 | #ifdef YYSTACK_USE_ALLOCA | |
487 | #define YYSTACK_ALLOC alloca | |
488 | #else | |
489 | #define YYSTACK_ALLOC malloc | |
490 | #endif | |
491 | ||
492 | /* Note: there must be only one dollar sign in this file. | |
493 | It is replaced by the list of actions, each action | |
494 | as one case of the switch. */ | |
495 | ||
496 | #define yyerrok (yyerrstatus = 0) | |
497 | #define yyclearin (yychar = YYEMPTY) | |
498 | #define YYEMPTY -2 | |
499 | #define YYEOF 0 | |
500 | #define YYACCEPT goto yyacceptlab | |
501 | #define YYABORT goto yyabortlab | |
502 | #define YYERROR goto yyerrlab1 | |
503 | /* Like YYERROR except do call yyerror. | |
504 | This remains here temporarily to ease the | |
505 | transition to the new meaning of YYERROR, for GCC. | |
506 | Once GCC version 2 has supplanted version 1, this can go. */ | |
507 | #define YYFAIL goto yyerrlab | |
508 | #define YYRECOVERING() (!!yyerrstatus) | |
509 | #define YYBACKUP(token, value) \ | |
510 | do \ | |
511 | if (yychar == YYEMPTY && yylen == 1) \ | |
512 | { yychar = (token), yylval = (value); \ | |
513 | yychar1 = YYTRANSLATE (yychar); \ | |
514 | YYPOPSTACK; \ | |
515 | goto yybackup; \ | |
516 | } \ | |
517 | else \ | |
518 | { yyerror ("syntax error: cannot back up"); YYERROR; } \ | |
519 | while (0) | |
520 | ||
521 | #define YYTERROR 1 | |
522 | #define YYERRCODE 256 | |
523 | ||
524 | #ifndef YYPURE | |
525 | #define YYLEX yylex() | |
526 | #endif | |
527 | ||
528 | #ifdef YYPURE | |
529 | #ifdef YYLSP_NEEDED | |
530 | #ifdef YYLEX_PARAM | |
531 | #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) | |
532 | #else | |
533 | #define YYLEX yylex(&yylval, &yylloc) | |
534 | #endif | |
535 | #else /* not YYLSP_NEEDED */ | |
536 | #ifdef YYLEX_PARAM | |
537 | #define YYLEX yylex(&yylval, YYLEX_PARAM) | |
538 | #else | |
539 | #define YYLEX yylex(&yylval) | |
540 | #endif | |
541 | #endif /* not YYLSP_NEEDED */ | |
542 | #endif | |
543 | ||
544 | /* If nonreentrant, generate the variables here */ | |
545 | ||
546 | #ifndef YYPURE | |
547 | ||
548 | int yychar; /* the lookahead symbol */ | |
549 | YYSTYPE yylval; /* the semantic value of the */ | |
550 | /* lookahead symbol */ | |
551 | ||
552 | #ifdef YYLSP_NEEDED | |
553 | YYLTYPE yylloc; /* location data for the lookahead */ | |
554 | /* symbol */ | |
555 | #endif | |
556 | ||
557 | int yynerrs; /* number of parse errors so far */ | |
558 | #endif /* not YYPURE */ | |
559 | ||
560 | #if YYDEBUG != 0 | |
561 | int yydebug; /* nonzero means print parse trace */ | |
562 | /* Since this is uninitialized, it does not stop multiple parsers | |
563 | from coexisting. */ | |
564 | #endif | |
565 | ||
566 | /* YYINITDEPTH indicates the initial size of the parser's stacks */ | |
567 | ||
568 | #ifndef YYINITDEPTH | |
569 | #define YYINITDEPTH 200 | |
570 | #endif | |
571 | ||
572 | /* YYMAXDEPTH is the maximum size the stacks can grow to | |
573 | (effective only if the built-in stack extension method is used). */ | |
574 | ||
575 | #if YYMAXDEPTH == 0 | |
576 | #undef YYMAXDEPTH | |
577 | #endif | |
578 | ||
579 | #ifndef YYMAXDEPTH | |
580 | #define YYMAXDEPTH 10000 | |
581 | #endif | |
582 | \f | |
583 | /* Define __yy_memcpy. Note that the size argument | |
584 | should be passed with type unsigned int, because that is what the non-GCC | |
585 | definitions require. With GCC, __builtin_memcpy takes an arg | |
586 | of type size_t, but it can handle unsigned int. */ | |
587 | ||
588 | #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ | |
589 | #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) | |
590 | #else /* not GNU C or C++ */ | |
591 | #ifndef __cplusplus | |
592 | ||
593 | /* This is the most reliable way to avoid incompatibilities | |
594 | in available built-in functions on various systems. */ | |
595 | static void | |
596 | __yy_memcpy (to, from, count) | |
597 | char *to; | |
598 | char *from; | |
599 | unsigned int count; | |
600 | { | |
601 | register char *f = from; | |
602 | register char *t = to; | |
603 | register int i = count; | |
604 | ||
605 | while (i-- > 0) | |
606 | *t++ = *f++; | |
607 | } | |
608 | ||
609 | #else /* __cplusplus */ | |
610 | ||
611 | /* This is the most reliable way to avoid incompatibilities | |
612 | in available built-in functions on various systems. */ | |
613 | static void | |
614 | __yy_memcpy (char *to, char *from, unsigned int count) | |
615 | { | |
616 | register char *t = to; | |
617 | register char *f = from; | |
618 | register int i = count; | |
619 | ||
620 | while (i-- > 0) | |
621 | *t++ = *f++; | |
622 | } | |
623 | ||
624 | #endif | |
625 | #endif | |
626 | \f | |
627 | #line 217 "/usr/lib/bison.simple" | |
628 | ||
629 | /* The user can define YYPARSE_PARAM as the name of an argument to be passed | |
630 | into yyparse. The argument should have type void *. | |
631 | It should actually point to an object. | |
632 | Grammar actions can access the variable by casting it | |
633 | to the proper pointer type. */ | |
634 | ||
635 | #ifdef YYPARSE_PARAM | |
636 | #ifdef __cplusplus | |
637 | #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM | |
638 | #define YYPARSE_PARAM_DECL | |
639 | #else /* not __cplusplus */ | |
640 | #define YYPARSE_PARAM_ARG YYPARSE_PARAM | |
641 | #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; | |
642 | #endif /* not __cplusplus */ | |
643 | #else /* not YYPARSE_PARAM */ | |
644 | #define YYPARSE_PARAM_ARG | |
645 | #define YYPARSE_PARAM_DECL | |
646 | #endif /* not YYPARSE_PARAM */ | |
647 | ||
648 | /* Prevent warning if -Wstrict-prototypes. */ | |
649 | #ifdef __GNUC__ | |
650 | #ifdef YYPARSE_PARAM | |
651 | int yyparse (void *); | |
652 | #else | |
653 | int yyparse (void); | |
654 | #endif | |
655 | #endif | |
656 | ||
657 | int | |
658 | yyparse(YYPARSE_PARAM_ARG) | |
659 | YYPARSE_PARAM_DECL | |
660 | { | |
661 | register int yystate; | |
662 | register int yyn; | |
663 | register short *yyssp; | |
664 | register YYSTYPE *yyvsp; | |
665 | int yyerrstatus; /* number of tokens to shift before error messages enabled */ | |
666 | int yychar1 = 0; /* lookahead token as an internal (translated) token number */ | |
667 | ||
668 | short yyssa[YYINITDEPTH]; /* the state stack */ | |
669 | YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ | |
670 | ||
671 | short *yyss = yyssa; /* refer to the stacks thru separate pointers */ | |
672 | YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ | |
673 | ||
674 | #ifdef YYLSP_NEEDED | |
675 | YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ | |
676 | YYLTYPE *yyls = yylsa; | |
677 | YYLTYPE *yylsp; | |
678 | ||
679 | #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) | |
680 | #else | |
681 | #define YYPOPSTACK (yyvsp--, yyssp--) | |
682 | #endif | |
683 | ||
684 | int yystacksize = YYINITDEPTH; | |
685 | int yyfree_stacks = 0; | |
686 | ||
687 | #ifdef YYPURE | |
688 | int yychar; | |
689 | YYSTYPE yylval; | |
690 | int yynerrs; | |
691 | #ifdef YYLSP_NEEDED | |
692 | YYLTYPE yylloc; | |
693 | #endif | |
694 | #endif | |
695 | ||
696 | YYSTYPE yyval; /* the variable used to return */ | |
697 | /* semantic values from the action */ | |
698 | /* routines */ | |
699 | ||
700 | int yylen; | |
701 | ||
702 | #if YYDEBUG != 0 | |
703 | if (yydebug) | |
704 | fprintf(stderr, "Starting parse\n"); | |
705 | #endif | |
706 | ||
707 | yystate = 0; | |
708 | yyerrstatus = 0; | |
709 | yynerrs = 0; | |
710 | yychar = YYEMPTY; /* Cause a token to be read. */ | |
711 | ||
712 | /* Initialize stack pointers. | |
713 | Waste one element of value and location stack | |
714 | so that they stay on the same level as the state stack. | |
715 | The wasted elements are never initialized. */ | |
716 | ||
717 | yyssp = yyss - 1; | |
718 | yyvsp = yyvs; | |
719 | #ifdef YYLSP_NEEDED | |
720 | yylsp = yyls; | |
721 | #endif | |
722 | ||
723 | /* Push a new state, which is found in yystate . */ | |
724 | /* In all cases, when you get here, the value and location stacks | |
725 | have just been pushed. so pushing a state here evens the stacks. */ | |
726 | yynewstate: | |
727 | ||
728 | *++yyssp = yystate; | |
729 | ||
730 | if (yyssp >= yyss + yystacksize - 1) | |
731 | { | |
732 | /* Give user a chance to reallocate the stack */ | |
733 | /* Use copies of these so that the &'s don't force the real ones into memory. */ | |
734 | YYSTYPE *yyvs1 = yyvs; | |
735 | short *yyss1 = yyss; | |
736 | #ifdef YYLSP_NEEDED | |
737 | YYLTYPE *yyls1 = yyls; | |
738 | #endif | |
739 | ||
740 | /* Get the current used size of the three stacks, in elements. */ | |
741 | int size = yyssp - yyss + 1; | |
742 | ||
743 | #ifdef yyoverflow | |
744 | /* Each stack pointer address is followed by the size of | |
745 | the data in use in that stack, in bytes. */ | |
746 | #ifdef YYLSP_NEEDED | |
747 | /* This used to be a conditional around just the two extra args, | |
748 | but that might be undefined if yyoverflow is a macro. */ | |
749 | yyoverflow("parser stack overflow", | |
750 | &yyss1, size * sizeof (*yyssp), | |
751 | &yyvs1, size * sizeof (*yyvsp), | |
752 | &yyls1, size * sizeof (*yylsp), | |
753 | &yystacksize); | |
754 | #else | |
755 | yyoverflow("parser stack overflow", | |
756 | &yyss1, size * sizeof (*yyssp), | |
757 | &yyvs1, size * sizeof (*yyvsp), | |
758 | &yystacksize); | |
759 | #endif | |
760 | ||
761 | yyss = yyss1; yyvs = yyvs1; | |
762 | #ifdef YYLSP_NEEDED | |
763 | yyls = yyls1; | |
764 | #endif | |
765 | #else /* no yyoverflow */ | |
766 | /* Extend the stack our own way. */ | |
767 | if (yystacksize >= YYMAXDEPTH) | |
768 | { | |
769 | yyerror("parser stack overflow"); | |
770 | if (yyfree_stacks) | |
771 | { | |
772 | free (yyss); | |
773 | free (yyvs); | |
774 | #ifdef YYLSP_NEEDED | |
775 | free (yyls); | |
776 | #endif | |
777 | } | |
778 | return 2; | |
779 | } | |
780 | yystacksize *= 2; | |
781 | if (yystacksize > YYMAXDEPTH) | |
782 | yystacksize = YYMAXDEPTH; | |
783 | #ifndef YYSTACK_USE_ALLOCA | |
784 | yyfree_stacks = 1; | |
785 | #endif | |
786 | yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); | |
787 | __yy_memcpy ((char *)yyss, (char *)yyss1, | |
788 | size * (unsigned int) sizeof (*yyssp)); | |
789 | yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); | |
790 | __yy_memcpy ((char *)yyvs, (char *)yyvs1, | |
791 | size * (unsigned int) sizeof (*yyvsp)); | |
792 | #ifdef YYLSP_NEEDED | |
793 | yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); | |
794 | __yy_memcpy ((char *)yyls, (char *)yyls1, | |
795 | size * (unsigned int) sizeof (*yylsp)); | |
796 | #endif | |
797 | #endif /* no yyoverflow */ | |
798 | ||
799 | yyssp = yyss + size - 1; | |
800 | yyvsp = yyvs + size - 1; | |
801 | #ifdef YYLSP_NEEDED | |
802 | yylsp = yyls + size - 1; | |
803 | #endif | |
804 | ||
805 | #if YYDEBUG != 0 | |
806 | if (yydebug) | |
807 | fprintf(stderr, "Stack size increased to %d\n", yystacksize); | |
808 | #endif | |
809 | ||
810 | if (yyssp >= yyss + yystacksize - 1) | |
811 | YYABORT; | |
812 | } | |
813 | ||
814 | #if YYDEBUG != 0 | |
815 | if (yydebug) | |
816 | fprintf(stderr, "Entering state %d\n", yystate); | |
817 | #endif | |
818 | ||
819 | goto yybackup; | |
820 | yybackup: | |
821 | ||
822 | /* Do appropriate processing given the current state. */ | |
823 | /* Read a lookahead token if we need one and don't already have one. */ | |
824 | /* yyresume: */ | |
825 | ||
826 | /* First try to decide what to do without reference to lookahead token. */ | |
827 | ||
828 | yyn = yypact[yystate]; | |
829 | if (yyn == YYFLAG) | |
830 | goto yydefault; | |
831 | ||
832 | /* Not known => get a lookahead token if don't already have one. */ | |
833 | ||
834 | /* yychar is either YYEMPTY or YYEOF | |
835 | or a valid token in external form. */ | |
836 | ||
837 | if (yychar == YYEMPTY) | |
838 | { | |
839 | #if YYDEBUG != 0 | |
840 | if (yydebug) | |
841 | fprintf(stderr, "Reading a token: "); | |
842 | #endif | |
843 | yychar = YYLEX; | |
844 | } | |
845 | ||
846 | /* Convert token to internal form (in yychar1) for indexing tables with */ | |
847 | ||
848 | if (yychar <= 0) /* This means end of input. */ | |
849 | { | |
850 | yychar1 = 0; | |
851 | yychar = YYEOF; /* Don't call YYLEX any more */ | |
852 | ||
853 | #if YYDEBUG != 0 | |
854 | if (yydebug) | |
855 | fprintf(stderr, "Now at end of input.\n"); | |
856 | #endif | |
857 | } | |
858 | else | |
859 | { | |
860 | yychar1 = YYTRANSLATE(yychar); | |
861 | ||
862 | #if YYDEBUG != 0 | |
863 | if (yydebug) | |
864 | { | |
865 | fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); | |
866 | /* Give the individual parser a way to print the precise meaning | |
867 | of a token, for further debugging info. */ | |
868 | #ifdef YYPRINT | |
869 | YYPRINT (stderr, yychar, yylval); | |
870 | #endif | |
871 | fprintf (stderr, ")\n"); | |
872 | } | |
873 | #endif | |
874 | } | |
875 | ||
876 | yyn += yychar1; | |
877 | if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) | |
878 | goto yydefault; | |
879 | ||
880 | yyn = yytable[yyn]; | |
881 | ||
882 | /* yyn is what to do for this token type in this state. | |
883 | Negative => reduce, -yyn is rule number. | |
884 | Positive => shift, yyn is new state. | |
885 | New state is final state => don't bother to shift, | |
886 | just return success. | |
887 | 0, or most negative number => error. */ | |
888 | ||
889 | if (yyn < 0) | |
890 | { | |
891 | if (yyn == YYFLAG) | |
892 | goto yyerrlab; | |
893 | yyn = -yyn; | |
894 | goto yyreduce; | |
895 | } | |
896 | else if (yyn == 0) | |
897 | goto yyerrlab; | |
898 | ||
899 | if (yyn == YYFINAL) | |
900 | YYACCEPT; | |
901 | ||
902 | /* Shift the lookahead token. */ | |
903 | ||
904 | #if YYDEBUG != 0 | |
905 | if (yydebug) | |
906 | fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); | |
907 | #endif | |
908 | ||
909 | /* Discard the token being shifted unless it is eof. */ | |
910 | if (yychar != YYEOF) | |
911 | yychar = YYEMPTY; | |
912 | ||
913 | *++yyvsp = yylval; | |
914 | #ifdef YYLSP_NEEDED | |
915 | *++yylsp = yylloc; | |
916 | #endif | |
917 | ||
918 | /* count tokens shifted since error; after three, turn off error status. */ | |
919 | if (yyerrstatus) yyerrstatus--; | |
920 | ||
921 | yystate = yyn; | |
922 | goto yynewstate; | |
923 | ||
924 | /* Do the default action for the current state. */ | |
925 | yydefault: | |
926 | ||
927 | yyn = yydefact[yystate]; | |
928 | if (yyn == 0) | |
929 | goto yyerrlab; | |
930 | ||
931 | /* Do a reduction. yyn is the number of a rule to reduce with. */ | |
932 | yyreduce: | |
933 | yylen = yyr2[yyn]; | |
934 | if (yylen > 0) | |
935 | yyval = yyvsp[1-yylen]; /* implement default value of the action */ | |
936 | ||
937 | #if YYDEBUG != 0 | |
938 | if (yydebug) | |
939 | { | |
940 | int i; | |
941 | ||
942 | fprintf (stderr, "Reducing via rule %d (line %d), ", | |
943 | yyn, yyrline[yyn]); | |
944 | ||
945 | /* Print the symbols being reduced, and their result. */ | |
946 | for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) | |
947 | fprintf (stderr, "%s ", yytname[yyrhs[i]]); | |
948 | fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); | |
949 | } | |
950 | #endif | |
951 | ||
952 | ||
953 | switch (yyn) { | |
954 | ||
955 | case 1: | |
b7b694d6 | 956 | #line 152 "mtgrammar.y" |
28bf4b0b | 957 | {; |
958 | break;} | |
959 | case 2: | |
b7b694d6 | 960 | #line 153 "mtgrammar.y" |
28bf4b0b | 961 | {; |
962 | break;} | |
963 | case 3: | |
b7b694d6 | 964 | #line 157 "mtgrammar.y" |
28bf4b0b | 965 | { mtreader_processDeclaration (yyvsp[-1].mtdecl); ; |
966 | break;} | |
967 | case 4: | |
b7b694d6 | 968 | #line 159 "mtgrammar.y" |
28bf4b0b | 969 | { mtreader_processGlobalDeclaration (yyvsp[-1].mtdecl); ; |
970 | break;} | |
971 | case 5: | |
b7b694d6 | 972 | #line 163 "mtgrammar.y" |
28bf4b0b | 973 | { yyval.mtdecl = mtDeclarationNode_create (yyvsp[-1].tok, yyvsp[0].mtpieces); ; |
974 | break;} | |
975 | case 6: | |
b7b694d6 | 976 | #line 166 "mtgrammar.y" |
28bf4b0b | 977 | { yyval.mtpieces = mtDeclarationPieces_create (); ; |
978 | break;} | |
979 | case 7: | |
b7b694d6 | 980 | #line 168 "mtgrammar.y" |
28bf4b0b | 981 | { yyval.mtpieces = mtDeclarationPieces_append (yyvsp[0].mtpieces, yyvsp[-1].mtpiece); ; |
982 | break;} | |
983 | case 8: | |
b7b694d6 | 984 | #line 171 "mtgrammar.y" |
28bf4b0b | 985 | { yyval.mtpiece = mtDeclarationPiece_createContext (yyvsp[0].mtcontext); ; |
986 | break;} | |
987 | case 9: | |
b7b694d6 | 988 | #line 172 "mtgrammar.y" |
28bf4b0b | 989 | { yyval.mtpiece = mtDeclarationPiece_createValues (yyvsp[0].mtvalues); ; |
990 | break;} | |
991 | case 10: | |
b7b694d6 | 992 | #line 173 "mtgrammar.y" |
28bf4b0b | 993 | { yyval.mtpiece = mtDeclarationPiece_createDefaults (yyvsp[0].mtdefaults); ; |
994 | break;} | |
995 | case 11: | |
b7b694d6 | 996 | #line 174 "mtgrammar.y" |
28bf4b0b | 997 | { yyval.mtpiece = mtDeclarationPiece_createValueDefault (yyvsp[0].tok); ; |
998 | break;} | |
999 | case 12: | |
b7b694d6 | 1000 | #line 175 "mtgrammar.y" |
28bf4b0b | 1001 | { yyval.mtpiece = mtDeclarationPiece_createAnnotations (yyvsp[0].mtannotations); ; |
1002 | break;} | |
1003 | case 13: | |
b7b694d6 | 1004 | #line 176 "mtgrammar.y" |
28bf4b0b | 1005 | { yyval.mtpiece = mtDeclarationPiece_createMerge (yyvsp[0].mtmerge); ; |
1006 | break;} | |
1007 | case 14: | |
b7b694d6 | 1008 | #line 177 "mtgrammar.y" |
28bf4b0b | 1009 | { yyval.mtpiece = mtDeclarationPiece_createTransfers (yyvsp[0].mttransferclauselist); ; |
1010 | break;} | |
1011 | case 15: | |
b7b694d6 | 1012 | #line 178 "mtgrammar.y" |
28bf4b0b | 1013 | { yyval.mtpiece = mtDeclarationPiece_createPreconditions (yyvsp[0].mttransferclauselist); ; |
1014 | break;} | |
1015 | case 16: | |
b7b694d6 | 1016 | #line 179 "mtgrammar.y" |
28bf4b0b | 1017 | { yyval.mtpiece = mtDeclarationPiece_createPostconditions (yyvsp[0].mttransferclauselist); ; |
1018 | break;} | |
1019 | case 17: | |
b7b694d6 | 1020 | #line 180 "mtgrammar.y" |
28bf4b0b | 1021 | { yyval.mtpiece = mtDeclarationPiece_createLosers (yyvsp[0].mtlosereferencelist); ; |
1022 | break;} | |
1023 | case 18: | |
b7b694d6 | 1024 | #line 183 "mtgrammar.y" |
28bf4b0b | 1025 | { yyval.mtcontext = yyvsp[0].mtcontext; ; |
1026 | break;} | |
1027 | case 19: | |
b7b694d6 | 1028 | #line 187 "mtgrammar.y" |
28bf4b0b | 1029 | { yyval.mtcontext = mtContextNode_createAny (); ; |
1030 | break;} | |
1031 | case 21: | |
b7b694d6 | 1032 | #line 191 "mtgrammar.y" |
28bf4b0b | 1033 | { yyval.mtcontext = mtContextNode_createParameter (yyvsp[0].ctyp); ; |
1034 | break;} | |
1035 | case 22: | |
b7b694d6 | 1036 | #line 192 "mtgrammar.y" |
28bf4b0b | 1037 | { yyval.mtcontext = mtContextNode_createReference (yyvsp[0].ctyp); ; |
1038 | break;} | |
1039 | case 23: | |
b7b694d6 | 1040 | #line 193 "mtgrammar.y" |
b072092f | 1041 | { yyval.mtcontext = mtContextNode_createResult (yyvsp[0].ctyp); ; |
28bf4b0b | 1042 | break;} |
1043 | case 24: | |
b7b694d6 | 1044 | #line 194 "mtgrammar.y" |
b072092f | 1045 | { yyval.mtcontext = mtContextNode_createClause (yyvsp[0].ctyp); ; |
28bf4b0b | 1046 | break;} |
1047 | case 25: | |
b7b694d6 | 1048 | #line 195 "mtgrammar.y" |
12f2ffe9 | 1049 | { yyval.mtcontext = mtContextNode_createLiteral (yyvsp[0].ctyp); ; |
28bf4b0b | 1050 | break;} |
b072092f | 1051 | case 26: |
b7b694d6 | 1052 | #line 196 "mtgrammar.y" |
12f2ffe9 | 1053 | { yyval.mtcontext = mtContextNode_createNull (yyvsp[0].ctyp); ; |
1054 | break;} | |
1055 | case 27: | |
b7b694d6 | 1056 | #line 203 "mtgrammar.y" |
12f2ffe9 | 1057 | { yyval.ctyp = ctype_unknown; ; |
28bf4b0b | 1058 | break;} |
1059 | case 28: | |
b7b694d6 | 1060 | #line 204 "mtgrammar.y" |
12f2ffe9 | 1061 | { DPRINTF (("Type: %s", qtype_unparse (yyvsp[0].qtyp))); yyval.ctyp = qtype_getType (yyvsp[0].qtyp); ; |
1062 | break;} | |
1063 | case 30: | |
b7b694d6 | 1064 | #line 208 "mtgrammar.y" |
b072092f | 1065 | { yyval.qtyp = qtype_newBase (yyvsp[-1].qtyp, yyvsp[0].ctyp); ; |
28bf4b0b | 1066 | break;} |
12f2ffe9 | 1067 | case 31: |
b7b694d6 | 1068 | #line 211 "mtgrammar.y" |
b072092f | 1069 | { yyval.qtyp = yyvsp[0].qtyp; ; |
28bf4b0b | 1070 | break;} |
12f2ffe9 | 1071 | case 32: |
b7b694d6 | 1072 | #line 213 "mtgrammar.y" |
b072092f | 1073 | { yyval.qtyp = qtype_mergeAlt (yyvsp[-2].qtyp, yyvsp[0].qtyp); ; |
28bf4b0b | 1074 | break;} |
12f2ffe9 | 1075 | case 33: |
b7b694d6 | 1076 | #line 216 "mtgrammar.y" |
b072092f | 1077 | { yyval.qtyp = qtype_combine (yyvsp[0].qtyp, yyvsp[-1].ctyp); ; |
28bf4b0b | 1078 | break;} |
12f2ffe9 | 1079 | case 34: |
b7b694d6 | 1080 | #line 219 "mtgrammar.y" |
b072092f | 1081 | { yyval.qtyp = qtype_unknown (); ; |
28bf4b0b | 1082 | break;} |
12f2ffe9 | 1083 | case 35: |
b7b694d6 | 1084 | #line 220 "mtgrammar.y" |
b072092f | 1085 | { yyval.qtyp = yyvsp[0].qtyp; ; |
28bf4b0b | 1086 | break;} |
12f2ffe9 | 1087 | case 36: |
b7b694d6 | 1088 | #line 224 "mtgrammar.y" |
b072092f | 1089 | { yyval.ctyp = ctype_adjustPointers (yyvsp[0].count, ctype_unknown); ; |
28bf4b0b | 1090 | break;} |
12f2ffe9 | 1091 | case 38: |
b7b694d6 | 1092 | #line 226 "mtgrammar.y" |
b072092f | 1093 | { yyval.ctyp = ctype_adjustPointers (yyvsp[-1].count, yyvsp[0].ctyp); ; |
28bf4b0b | 1094 | break;} |
12f2ffe9 | 1095 | case 39: |
b7b694d6 | 1096 | #line 229 "mtgrammar.y" |
b072092f | 1097 | { yyval.count = 1; ; |
28bf4b0b | 1098 | break;} |
12f2ffe9 | 1099 | case 40: |
b7b694d6 | 1100 | #line 230 "mtgrammar.y" |
12f2ffe9 | 1101 | { yyval.count = 1; ; |
28bf4b0b | 1102 | break;} |
12f2ffe9 | 1103 | case 41: |
b7b694d6 | 1104 | #line 231 "mtgrammar.y" |
b072092f | 1105 | { yyval.count = 1 + yyvsp[0].count; ; |
28bf4b0b | 1106 | break;} |
28bf4b0b | 1107 | case 42: |
b7b694d6 | 1108 | #line 232 "mtgrammar.y" |
12f2ffe9 | 1109 | { yyval.count = 1 + yyvsp[0].count; ; |
28bf4b0b | 1110 | break;} |
1111 | case 43: | |
b7b694d6 | 1112 | #line 235 "mtgrammar.y" |
12f2ffe9 | 1113 | { /* ignored for now */; ; |
28bf4b0b | 1114 | break;} |
1115 | case 44: | |
b7b694d6 | 1116 | #line 236 "mtgrammar.y" |
b072092f | 1117 | { ; ; |
28bf4b0b | 1118 | break;} |
1119 | case 45: | |
b7b694d6 | 1120 | #line 239 "mtgrammar.y" |
12f2ffe9 | 1121 | { ; ; |
28bf4b0b | 1122 | break;} |
1123 | case 46: | |
b7b694d6 | 1124 | #line 240 "mtgrammar.y" |
12f2ffe9 | 1125 | { ; ; |
28bf4b0b | 1126 | break;} |
1127 | case 47: | |
b7b694d6 | 1128 | #line 243 "mtgrammar.y" |
12f2ffe9 | 1129 | { yyval.ctyp = ctype_expectFunction (yyvsp[-1].ctyp); ; |
28bf4b0b | 1130 | break;} |
1131 | case 48: | |
b7b694d6 | 1132 | #line 244 "mtgrammar.y" |
12f2ffe9 | 1133 | { yyval.ctyp = ctype_makeArray (ctype_unknown); ; |
28bf4b0b | 1134 | break;} |
1135 | case 49: | |
b7b694d6 | 1136 | #line 245 "mtgrammar.y" |
12f2ffe9 | 1137 | { yyval.ctyp = ctype_makeArray (yyvsp[-2].ctyp); ; |
28bf4b0b | 1138 | break;} |
1139 | case 50: | |
b7b694d6 | 1140 | #line 252 "mtgrammar.y" |
12f2ffe9 | 1141 | { yyval.ctyp = ctype_char; ; |
28bf4b0b | 1142 | break;} |
1143 | case 51: | |
b7b694d6 | 1144 | #line 253 "mtgrammar.y" |
12f2ffe9 | 1145 | { yyval.ctyp = ctype_int; ; |
28bf4b0b | 1146 | break;} |
1147 | case 52: | |
b7b694d6 | 1148 | #line 254 "mtgrammar.y" |
12f2ffe9 | 1149 | { yyval.ctyp = ctype_float; ; |
28bf4b0b | 1150 | break;} |
1151 | case 53: | |
b7b694d6 | 1152 | #line 255 "mtgrammar.y" |
12f2ffe9 | 1153 | { yyval.ctyp = ctype_double; ; |
28bf4b0b | 1154 | break;} |
1155 | case 54: | |
b7b694d6 | 1156 | #line 256 "mtgrammar.y" |
12f2ffe9 | 1157 | { yyval.ctyp = ctype_void; ; |
28bf4b0b | 1158 | break;} |
1159 | case 55: | |
b7b694d6 | 1160 | #line 257 "mtgrammar.y" |
12f2ffe9 | 1161 | { yyval.ctyp = ctype_unknown; ; |
28bf4b0b | 1162 | break;} |
b072092f | 1163 | case 56: |
b7b694d6 | 1164 | #line 258 "mtgrammar.y" |
12f2ffe9 | 1165 | { yyval.ctyp = ctype_anyintegral; ; |
1166 | break;} | |
1167 | case 57: | |
b7b694d6 | 1168 | #line 259 "mtgrammar.y" |
12f2ffe9 | 1169 | { yyval.ctyp = ctype_unsignedintegral; ; |
28bf4b0b | 1170 | break;} |
1171 | case 58: | |
b7b694d6 | 1172 | #line 260 "mtgrammar.y" |
12f2ffe9 | 1173 | { yyval.ctyp = ctype_signedintegral; ; |
28bf4b0b | 1174 | break;} |
1175 | case 60: | |
b7b694d6 | 1176 | #line 267 "mtgrammar.y" |
12f2ffe9 | 1177 | { yyval.ctyp = mtscanner_lookupType (yyvsp[0].tok); ; |
28bf4b0b | 1178 | break;} |
1179 | case 61: | |
b7b694d6 | 1180 | #line 270 "mtgrammar.y" |
12f2ffe9 | 1181 | { yyval.mtvalues = mtValuesNode_create (yyvsp[0].cstringlist); ; |
28bf4b0b | 1182 | break;} |
1183 | case 62: | |
b7b694d6 | 1184 | #line 273 "mtgrammar.y" |
12f2ffe9 | 1185 | { yyval.cstringlist = cstringList_single (mttok_getText (yyvsp[0].tok)); ; |
28bf4b0b | 1186 | break;} |
1187 | case 63: | |
b7b694d6 | 1188 | #line 275 "mtgrammar.y" |
12f2ffe9 | 1189 | { yyval.cstringlist = cstringList_prepend (yyvsp[0].cstringlist, mttok_getText (yyvsp[-2].tok)); ; |
28bf4b0b | 1190 | break;} |
1191 | case 64: | |
b7b694d6 | 1192 | #line 278 "mtgrammar.y" |
12f2ffe9 | 1193 | { yyval.tok = yyvsp[0].tok; ; |
28bf4b0b | 1194 | break;} |
1195 | case 65: | |
b7b694d6 | 1196 | #line 281 "mtgrammar.y" |
12f2ffe9 | 1197 | { yyval.mtdefaults = mtDefaultsNode_create (yyvsp[-1].tok, yyvsp[0].mtdeflist); ; |
28bf4b0b | 1198 | break;} |
1199 | case 66: | |
b7b694d6 | 1200 | #line 285 "mtgrammar.y" |
12f2ffe9 | 1201 | { yyval.mtdeflist = mtDefaultsDeclList_single (mtDefaultsDecl_create (yyvsp[-2].mtcontext, yyvsp[0].tok)); ; |
28bf4b0b | 1202 | break;} |
1203 | case 67: | |
b7b694d6 | 1204 | #line 287 "mtgrammar.y" |
12f2ffe9 | 1205 | { yyval.mtdeflist = mtDefaultsDeclList_prepend (yyvsp[0].mtdeflist, mtDefaultsDecl_create (yyvsp[-3].mtcontext, yyvsp[-1].tok)); ; |
28bf4b0b | 1206 | break;} |
1207 | case 68: | |
b7b694d6 | 1208 | #line 290 "mtgrammar.y" |
12f2ffe9 | 1209 | { yyval.mtannotations = mtAnnotationsNode_create (yyvsp[0].mtannotlist); ; |
28bf4b0b | 1210 | break;} |
1211 | case 69: | |
b7b694d6 | 1212 | #line 293 "mtgrammar.y" |
12f2ffe9 | 1213 | { yyval.mtannotlist = mtAnnotationList_single (yyvsp[0].mtannotdecl); ; |
28bf4b0b | 1214 | break;} |
1215 | case 70: | |
b7b694d6 | 1216 | #line 295 "mtgrammar.y" |
12f2ffe9 | 1217 | { yyval.mtannotlist = mtAnnotationList_prepend (yyvsp[0].mtannotlist, yyvsp[-1].mtannotdecl); ; |
28bf4b0b | 1218 | break;} |
1219 | case 71: | |
b7b694d6 | 1220 | #line 299 "mtgrammar.y" |
12f2ffe9 | 1221 | { yyval.mtannotdecl = mtAnnotationDecl_create (yyvsp[-3].tok, yyvsp[-2].mtcontext, yyvsp[0].tok); ; |
28bf4b0b | 1222 | break;} |
1223 | case 72: | |
b7b694d6 | 1224 | #line 302 "mtgrammar.y" |
12f2ffe9 | 1225 | { yyval.mtmerge = mtMergeNode_create (yyvsp[0].mtmergeclauselist); ; |
28bf4b0b | 1226 | break;} |
1227 | case 73: | |
b7b694d6 | 1228 | #line 305 "mtgrammar.y" |
12f2ffe9 | 1229 | { yyval.mtmergeclauselist = mtMergeClauseList_single (yyvsp[0].mtmergeclause); ; |
28bf4b0b | 1230 | break;} |
1231 | case 74: | |
b7b694d6 | 1232 | #line 306 "mtgrammar.y" |
12f2ffe9 | 1233 | { yyval.mtmergeclauselist = mtMergeClauseList_prepend (yyvsp[0].mtmergeclauselist, yyvsp[-1].mtmergeclause); ; |
28bf4b0b | 1234 | break;} |
1235 | case 75: | |
b7b694d6 | 1236 | #line 310 "mtgrammar.y" |
12f2ffe9 | 1237 | { yyval.mtmergeclause = mtMergeClause_create (yyvsp[-4].mtmergeitem, yyvsp[-2].mtmergeitem, yyvsp[0].mttransferaction); ; |
28bf4b0b | 1238 | break;} |
1239 | case 76: | |
b7b694d6 | 1240 | #line 313 "mtgrammar.y" |
12f2ffe9 | 1241 | { yyval.mtmergeitem = mtMergeItem_createValue (yyvsp[0].tok); ; |
28bf4b0b | 1242 | break;} |
1243 | case 77: | |
b7b694d6 | 1244 | #line 314 "mtgrammar.y" |
12f2ffe9 | 1245 | { yyval.mtmergeitem = mtMergeItem_createStar (yyvsp[0].tok); ; |
28bf4b0b | 1246 | break;} |
1247 | case 78: | |
b7b694d6 | 1248 | #line 317 "mtgrammar.y" |
b072092f | 1249 | { yyval.mttransferclauselist = yyvsp[0].mttransferclauselist; ; |
28bf4b0b | 1250 | break;} |
1251 | case 79: | |
b7b694d6 | 1252 | #line 320 "mtgrammar.y" |
12f2ffe9 | 1253 | { yyval.mttransferclauselist = yyvsp[0].mttransferclauselist; ; |
28bf4b0b | 1254 | break;} |
1255 | case 80: | |
b7b694d6 | 1256 | #line 323 "mtgrammar.y" |
12f2ffe9 | 1257 | { yyval.mttransferclauselist = yyvsp[0].mttransferclauselist; ; |
28bf4b0b | 1258 | break;} |
1259 | case 81: | |
b7b694d6 | 1260 | #line 326 "mtgrammar.y" |
12f2ffe9 | 1261 | { yyval.mtlosereferencelist = yyvsp[0].mtlosereferencelist; ; |
28bf4b0b | 1262 | break;} |
1263 | case 82: | |
b7b694d6 | 1264 | #line 329 "mtgrammar.y" |
12f2ffe9 | 1265 | { yyval.mtlosereferencelist = mtLoseReferenceList_single (yyvsp[0].mtlosereference); ; |
28bf4b0b | 1266 | break;} |
1267 | case 83: | |
b7b694d6 | 1268 | #line 330 "mtgrammar.y" |
12f2ffe9 | 1269 | { yyval.mtlosereferencelist = mtLoseReferenceList_prepend (yyvsp[0].mtlosereferencelist, yyvsp[-1].mtlosereference); ; |
28bf4b0b | 1270 | break;} |
1271 | case 84: | |
b7b694d6 | 1272 | #line 333 "mtgrammar.y" |
12f2ffe9 | 1273 | { yyval.mtlosereference = mtLoseReference_create (yyvsp[-2].tok, yyvsp[0].mttransferaction); ; |
28bf4b0b | 1274 | break;} |
1275 | case 85: | |
b7b694d6 | 1276 | #line 336 "mtgrammar.y" |
12f2ffe9 | 1277 | { yyval.mttransferclauselist = mtTransferClauseList_single (yyvsp[0].mttransferclause); ; |
28bf4b0b | 1278 | break;} |
1279 | case 86: | |
b7b694d6 | 1280 | #line 337 "mtgrammar.y" |
12f2ffe9 | 1281 | { yyval.mttransferclauselist = mtTransferClauseList_prepend (yyvsp[0].mttransferclauselist, yyvsp[-1].mttransferclause); ; |
28bf4b0b | 1282 | break;} |
1283 | case 87: | |
b7b694d6 | 1284 | #line 341 "mtgrammar.y" |
12f2ffe9 | 1285 | { yyval.mttransferclause = mtTransferClause_create (yyvsp[-4].tok, yyvsp[-2].tok, yyvsp[0].mttransferaction); ; |
28bf4b0b | 1286 | break;} |
1287 | case 88: | |
b7b694d6 | 1288 | #line 344 "mtgrammar.y" |
12f2ffe9 | 1289 | { yyval.mttransferaction = mtTransferAction_createValue (yyvsp[0].tok); ; |
28bf4b0b | 1290 | break;} |
1291 | case 89: | |
b7b694d6 | 1292 | #line 345 "mtgrammar.y" |
12f2ffe9 | 1293 | { yyval.mttransferaction = yyvsp[0].mttransferaction; ; |
1294 | break;} | |
1295 | case 90: | |
b7b694d6 | 1296 | #line 348 "mtgrammar.y" |
12f2ffe9 | 1297 | { yyval.mttransferaction = mtTransferAction_createError (yyvsp[0].tok); ; |
1298 | break;} | |
1299 | case 91: | |
b7b694d6 | 1300 | #line 349 "mtgrammar.y" |
b072092f | 1301 | { yyval.mttransferaction = mtTransferAction_createErrorMessage (yyvsp[0].tok); ; |
28bf4b0b | 1302 | break;} |
1303 | } | |
1304 | /* the action file gets copied in in place of this dollarsign */ | |
1305 | #line 543 "/usr/lib/bison.simple" | |
1306 | \f | |
1307 | yyvsp -= yylen; | |
1308 | yyssp -= yylen; | |
1309 | #ifdef YYLSP_NEEDED | |
1310 | yylsp -= yylen; | |
1311 | #endif | |
1312 | ||
1313 | #if YYDEBUG != 0 | |
1314 | if (yydebug) | |
1315 | { | |
1316 | short *ssp1 = yyss - 1; | |
1317 | fprintf (stderr, "state stack now"); | |
1318 | while (ssp1 != yyssp) | |
1319 | fprintf (stderr, " %d", *++ssp1); | |
1320 | fprintf (stderr, "\n"); | |
1321 | } | |
1322 | #endif | |
1323 | ||
1324 | *++yyvsp = yyval; | |
1325 | ||
1326 | #ifdef YYLSP_NEEDED | |
1327 | yylsp++; | |
1328 | if (yylen == 0) | |
1329 | { | |
1330 | yylsp->first_line = yylloc.first_line; | |
1331 | yylsp->first_column = yylloc.first_column; | |
1332 | yylsp->last_line = (yylsp-1)->last_line; | |
1333 | yylsp->last_column = (yylsp-1)->last_column; | |
1334 | yylsp->text = 0; | |
1335 | } | |
1336 | else | |
1337 | { | |
1338 | yylsp->last_line = (yylsp+yylen-1)->last_line; | |
1339 | yylsp->last_column = (yylsp+yylen-1)->last_column; | |
1340 | } | |
1341 | #endif | |
1342 | ||
1343 | /* Now "shift" the result of the reduction. | |
1344 | Determine what state that goes to, | |
1345 | based on the state we popped back to | |
1346 | and the rule number reduced by. */ | |
1347 | ||
1348 | yyn = yyr1[yyn]; | |
1349 | ||
1350 | yystate = yypgoto[yyn - YYNTBASE] + *yyssp; | |
1351 | if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) | |
1352 | yystate = yytable[yystate]; | |
1353 | else | |
1354 | yystate = yydefgoto[yyn - YYNTBASE]; | |
1355 | ||
1356 | goto yynewstate; | |
1357 | ||
1358 | yyerrlab: /* here on detecting error */ | |
1359 | ||
1360 | if (! yyerrstatus) | |
1361 | /* If not already recovering from an error, report this error. */ | |
1362 | { | |
1363 | ++yynerrs; | |
1364 | ||
1365 | #ifdef YYERROR_VERBOSE | |
1366 | yyn = yypact[yystate]; | |
1367 | ||
1368 | if (yyn > YYFLAG && yyn < YYLAST) | |
1369 | { | |
1370 | int size = 0; | |
1371 | char *msg; | |
1372 | int x, count; | |
1373 | ||
1374 | count = 0; | |
1375 | /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ | |
1376 | for (x = (yyn < 0 ? -yyn : 0); | |
1377 | x < (sizeof(yytname) / sizeof(char *)); x++) | |
1378 | if (yycheck[x + yyn] == x) | |
1379 | size += strlen(yytname[x]) + 15, count++; | |
1380 | msg = (char *) malloc(size + 15); | |
1381 | if (msg != 0) | |
1382 | { | |
1383 | strcpy(msg, "parse error"); | |
1384 | ||
1385 | if (count < 5) | |
1386 | { | |
1387 | count = 0; | |
1388 | for (x = (yyn < 0 ? -yyn : 0); | |
1389 | x < (sizeof(yytname) / sizeof(char *)); x++) | |
1390 | if (yycheck[x + yyn] == x) | |
1391 | { | |
1392 | strcat(msg, count == 0 ? ", expecting `" : " or `"); | |
1393 | strcat(msg, yytname[x]); | |
1394 | strcat(msg, "'"); | |
1395 | count++; | |
1396 | } | |
1397 | } | |
1398 | yyerror(msg); | |
1399 | free(msg); | |
1400 | } | |
1401 | else | |
1402 | yyerror ("parse error; also virtual memory exceeded"); | |
1403 | } | |
1404 | else | |
1405 | #endif /* YYERROR_VERBOSE */ | |
1406 | yyerror("parse error"); | |
1407 | } | |
1408 | ||
1409 | goto yyerrlab1; | |
1410 | yyerrlab1: /* here on error raised explicitly by an action */ | |
1411 | ||
1412 | if (yyerrstatus == 3) | |
1413 | { | |
1414 | /* if just tried and failed to reuse lookahead token after an error, discard it. */ | |
1415 | ||
1416 | /* return failure if at end of input */ | |
1417 | if (yychar == YYEOF) | |
1418 | YYABORT; | |
1419 | ||
1420 | #if YYDEBUG != 0 | |
1421 | if (yydebug) | |
1422 | fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); | |
1423 | #endif | |
1424 | ||
1425 | yychar = YYEMPTY; | |
1426 | } | |
1427 | ||
1428 | /* Else will try to reuse lookahead token | |
1429 | after shifting the error token. */ | |
1430 | ||
1431 | yyerrstatus = 3; /* Each real token shifted decrements this */ | |
1432 | ||
1433 | goto yyerrhandle; | |
1434 | ||
1435 | yyerrdefault: /* current state does not do anything special for the error token. */ | |
1436 | ||
1437 | #if 0 | |
1438 | /* This is wrong; only states that explicitly want error tokens | |
1439 | should shift them. */ | |
1440 | yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ | |
1441 | if (yyn) goto yydefault; | |
1442 | #endif | |
1443 | ||
1444 | yyerrpop: /* pop the current state because it cannot handle the error token */ | |
1445 | ||
1446 | if (yyssp == yyss) YYABORT; | |
1447 | yyvsp--; | |
1448 | yystate = *--yyssp; | |
1449 | #ifdef YYLSP_NEEDED | |
1450 | yylsp--; | |
1451 | #endif | |
1452 | ||
1453 | #if YYDEBUG != 0 | |
1454 | if (yydebug) | |
1455 | { | |
1456 | short *ssp1 = yyss - 1; | |
1457 | fprintf (stderr, "Error: state stack now"); | |
1458 | while (ssp1 != yyssp) | |
1459 | fprintf (stderr, " %d", *++ssp1); | |
1460 | fprintf (stderr, "\n"); | |
1461 | } | |
1462 | #endif | |
1463 | ||
1464 | yyerrhandle: | |
1465 | ||
1466 | yyn = yypact[yystate]; | |
1467 | if (yyn == YYFLAG) | |
1468 | goto yyerrdefault; | |
1469 | ||
1470 | yyn += YYTERROR; | |
1471 | if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) | |
1472 | goto yyerrdefault; | |
1473 | ||
1474 | yyn = yytable[yyn]; | |
1475 | if (yyn < 0) | |
1476 | { | |
1477 | if (yyn == YYFLAG) | |
1478 | goto yyerrpop; | |
1479 | yyn = -yyn; | |
1480 | goto yyreduce; | |
1481 | } | |
1482 | else if (yyn == 0) | |
1483 | goto yyerrpop; | |
1484 | ||
1485 | if (yyn == YYFINAL) | |
1486 | YYACCEPT; | |
1487 | ||
1488 | #if YYDEBUG != 0 | |
1489 | if (yydebug) | |
1490 | fprintf(stderr, "Shifting error token, "); | |
1491 | #endif | |
1492 | ||
1493 | *++yyvsp = yylval; | |
1494 | #ifdef YYLSP_NEEDED | |
1495 | *++yylsp = yylloc; | |
1496 | #endif | |
1497 | ||
1498 | yystate = yyn; | |
1499 | goto yynewstate; | |
1500 | ||
1501 | yyacceptlab: | |
1502 | /* YYACCEPT comes here. */ | |
1503 | if (yyfree_stacks) | |
1504 | { | |
1505 | free (yyss); | |
1506 | free (yyvs); | |
1507 | #ifdef YYLSP_NEEDED | |
1508 | free (yyls); | |
1509 | #endif | |
1510 | } | |
1511 | return 0; | |
1512 | ||
1513 | yyabortlab: | |
1514 | /* YYABORT comes here. */ | |
1515 | if (yyfree_stacks) | |
1516 | { | |
1517 | free (yyss); | |
1518 | free (yyvs); | |
1519 | #ifdef YYLSP_NEEDED | |
1520 | free (yyls); | |
1521 | #endif | |
1522 | } | |
1523 | return 1; | |
1524 | } | |
b7b694d6 | 1525 | #line 354 "mtgrammar.y" |
28bf4b0b | 1526 | |
1527 | ||
1528 | # include "bison.reset" | |
1529 | ||
1530 | extern char *yytext; | |
1531 | ||
1532 | static void mterror (char *s) | |
1533 | { | |
b072092f | 1534 | |
1535 | if (s != NULL) | |
1536 | { | |
1537 | llparseerror | |
1538 | (message ("Parse error in meta-state file: %s", cstring_fromChars (s))); | |
1539 | } | |
1540 | else | |
1541 | { | |
1542 | llparseerror | |
1543 | (message ("Parse error in meta-state file")); | |
1544 | } | |
1545 | ||
28bf4b0b | 1546 | } |
1547 | ||
1548 | static void yyprint (FILE *file, int type, YYSTYPE value) | |
1549 | { | |
1550 | cstring tname = mttok_unparse (value.tok); | |
1551 | fprintf (file, " (%s)", cstring_toCharsSafe (tname)); | |
1552 | cstring_free (tname); | |
1553 | } | |
1554 | ||
1555 | ||
1556 | ||
1557 | ||
1558 | /* | |
1559 | ** Resets all flags in bison.head | |
1560 | */ | |
1561 | ||
1562 | ||
1563 | /*@=allmacros@*/ | |
1564 | /*@=boolint@*/ | |
1565 | /*@=charint@*/ | |
1566 | /*@=macroparams@*/ | |
1567 | /*@=macroundef@*/ | |
1568 | /*@=unreachable@*/ | |
1569 | /*@=macrospec@*/ | |
1570 | /*@=varuse@*/ | |
1571 | /*@=ignorequals@*/ | |
1572 | /*@=macrostmt@*/ | |
1573 | /*@=noeffect@*/ | |
1574 | /*@=shadow@*/ | |
1575 | /*@=exitarg@*/ | |
1576 | /*@=macroredef@*/ | |
1577 | /*@=uniondef@*/ | |
1578 | /*@=compdef@*/ | |
1579 | /*@=matchfields@*/ | |
1580 | /*@=exportlocal@*/ | |
1581 | /*@=evalorderuncon@*/ | |
1582 | /*@=exportheader@*/ | |
1583 | /*@=typeuse@*/ | |
1584 | /*@=redecl@*/ | |
1585 | /*@=redef@*/ | |
1586 | /*@=noparams@*/ | |
1587 | /*@=ansireserved@*/ | |
1588 | /*@=fielduse@*/ | |
1589 | /*@=ifblock@*/ | |
1590 | /*@=elseifcomplete@*/ | |
1591 | /*@=whileblock@*/ | |
1592 | /*@=forblock@*/ | |
1593 | /*@=branchstate@*/ | |
1594 | /*@=readonlytrans@*/ | |
1595 | /*@=namechecks@*/ | |
1596 | /*@=usedef@*/ | |
1597 | /*@=systemunrecog@*/ | |
1598 | /*@=dependenttrans@*/ | |
1599 | /*@=unqualifiedtrans@*/ | |
60eced23 | 1600 | /*@=declundef@*/ |