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