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