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