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