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