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