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