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