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