bool 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,346 @@
1
+ #ifndef yyHEADER_H
2
+ #define yyHEADER_H 1
3
+ #define yyIN_HEADER 1
4
+
5
+ #line 6 "lexer.h"
6
+
7
+ #line 8 "lexer.h"
8
+
9
+ #define YY_INT_ALIGNED short int
10
+
11
+ /* A lexical scanner generated by flex */
12
+
13
+ #define FLEX_SCANNER
14
+ #define YY_FLEX_MAJOR_VERSION 2
15
+ #define YY_FLEX_MINOR_VERSION 5
16
+ #define YY_FLEX_SUBMINOR_VERSION 35
17
+ #if YY_FLEX_SUBMINOR_VERSION > 0
18
+ #define FLEX_BETA
19
+ #endif
20
+
21
+ /* First, we deal with platform-specific or compiler-specific issues. */
22
+
23
+ /* begin standard C headers. */
24
+ #include <stdio.h>
25
+ #include <string.h>
26
+ #include <errno.h>
27
+ #include <stdlib.h>
28
+
29
+ /* end standard C headers. */
30
+
31
+ /* flex integer type definitions */
32
+
33
+ #ifndef FLEXINT_H
34
+ #define FLEXINT_H
35
+
36
+ /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
37
+
38
+ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
39
+
40
+ /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
41
+ * if you want the limit (max/min) macros for int types.
42
+ */
43
+ #ifndef __STDC_LIMIT_MACROS
44
+ #define __STDC_LIMIT_MACROS 1
45
+ #endif
46
+
47
+ #include <inttypes.h>
48
+ typedef int8_t flex_int8_t;
49
+ typedef uint8_t flex_uint8_t;
50
+ typedef int16_t flex_int16_t;
51
+ typedef uint16_t flex_uint16_t;
52
+ typedef int32_t flex_int32_t;
53
+ typedef uint32_t flex_uint32_t;
54
+ typedef uint64_t flex_uint64_t;
55
+ #else
56
+ typedef signed char flex_int8_t;
57
+ typedef short int flex_int16_t;
58
+ typedef int flex_int32_t;
59
+ typedef unsigned char flex_uint8_t;
60
+ typedef unsigned short int flex_uint16_t;
61
+ typedef unsigned int flex_uint32_t;
62
+ #endif /* ! C99 */
63
+
64
+ /* Limits of integral types. */
65
+ #ifndef INT8_MIN
66
+ #define INT8_MIN (-128)
67
+ #endif
68
+ #ifndef INT16_MIN
69
+ #define INT16_MIN (-32767-1)
70
+ #endif
71
+ #ifndef INT32_MIN
72
+ #define INT32_MIN (-2147483647-1)
73
+ #endif
74
+ #ifndef INT8_MAX
75
+ #define INT8_MAX (127)
76
+ #endif
77
+ #ifndef INT16_MAX
78
+ #define INT16_MAX (32767)
79
+ #endif
80
+ #ifndef INT32_MAX
81
+ #define INT32_MAX (2147483647)
82
+ #endif
83
+ #ifndef UINT8_MAX
84
+ #define UINT8_MAX (255U)
85
+ #endif
86
+ #ifndef UINT16_MAX
87
+ #define UINT16_MAX (65535U)
88
+ #endif
89
+ #ifndef UINT32_MAX
90
+ #define UINT32_MAX (4294967295U)
91
+ #endif
92
+
93
+ #endif /* ! FLEXINT_H */
94
+
95
+ #ifdef __cplusplus
96
+
97
+ /* The "const" storage-class-modifier is valid. */
98
+ #define YY_USE_CONST
99
+
100
+ #else /* ! __cplusplus */
101
+
102
+ /* C99 requires __STDC__ to be defined as 1. */
103
+ #if defined (__STDC__)
104
+
105
+ #define YY_USE_CONST
106
+
107
+ #endif /* defined (__STDC__) */
108
+ #endif /* ! __cplusplus */
109
+
110
+ #ifdef YY_USE_CONST
111
+ #define yyconst const
112
+ #else
113
+ #define yyconst
114
+ #endif
115
+
116
+ /* An opaque pointer. */
117
+ #ifndef YY_TYPEDEF_YY_SCANNER_T
118
+ #define YY_TYPEDEF_YY_SCANNER_T
119
+ typedef void* yyscan_t;
120
+ #endif
121
+
122
+ /* For convenience, these vars (plus the bison vars far below)
123
+ are macros in the reentrant scanner. */
124
+ #define yyin yyg->yyin_r
125
+ #define yyout yyg->yyout_r
126
+ #define yyextra yyg->yyextra_r
127
+ #define yyleng yyg->yyleng_r
128
+ #define yytext yyg->yytext_r
129
+ #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
130
+ #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
131
+ #define yy_flex_debug yyg->yy_flex_debug_r
132
+
133
+ /* Size of default input buffer. */
134
+ #ifndef YY_BUF_SIZE
135
+ #define YY_BUF_SIZE 16384
136
+ #endif
137
+
138
+ #ifndef YY_TYPEDEF_YY_BUFFER_STATE
139
+ #define YY_TYPEDEF_YY_BUFFER_STATE
140
+ typedef struct yy_buffer_state *YY_BUFFER_STATE;
141
+ #endif
142
+
143
+ #ifndef YY_TYPEDEF_YY_SIZE_T
144
+ #define YY_TYPEDEF_YY_SIZE_T
145
+ typedef size_t yy_size_t;
146
+ #endif
147
+
148
+ #ifndef YY_STRUCT_YY_BUFFER_STATE
149
+ #define YY_STRUCT_YY_BUFFER_STATE
150
+ struct yy_buffer_state
151
+ {
152
+ FILE *yy_input_file;
153
+
154
+ char *yy_ch_buf; /* input buffer */
155
+ char *yy_buf_pos; /* current position in input buffer */
156
+
157
+ /* Size of input buffer in bytes, not including room for EOB
158
+ * characters.
159
+ */
160
+ yy_size_t yy_buf_size;
161
+
162
+ /* Number of characters read into yy_ch_buf, not including EOB
163
+ * characters.
164
+ */
165
+ yy_size_t yy_n_chars;
166
+
167
+ /* Whether we "own" the buffer - i.e., we know we created it,
168
+ * and can realloc() it to grow it, and should free() it to
169
+ * delete it.
170
+ */
171
+ int yy_is_our_buffer;
172
+
173
+ /* Whether this is an "interactive" input source; if so, and
174
+ * if we're using stdio for input, then we want to use getc()
175
+ * instead of fread(), to make sure we stop fetching input after
176
+ * each newline.
177
+ */
178
+ int yy_is_interactive;
179
+
180
+ /* Whether we're considered to be at the beginning of a line.
181
+ * If so, '^' rules will be active on the next match, otherwise
182
+ * not.
183
+ */
184
+ int yy_at_bol;
185
+
186
+ int yy_bs_lineno; /**< The line count. */
187
+ int yy_bs_column; /**< The column count. */
188
+
189
+ /* Whether to try to fill the input buffer when we reach the
190
+ * end of it.
191
+ */
192
+ int yy_fill_buffer;
193
+
194
+ int yy_buffer_status;
195
+
196
+ };
197
+ #endif /* !YY_STRUCT_YY_BUFFER_STATE */
198
+
199
+ void yyrestart (FILE *input_file ,yyscan_t yyscanner );
200
+ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
201
+ YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
202
+ void yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
203
+ void yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
204
+ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
205
+ void yypop_buffer_state (yyscan_t yyscanner );
206
+
207
+ YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
208
+ YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
209
+ YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner );
210
+
211
+ void *yyalloc (yy_size_t ,yyscan_t yyscanner );
212
+ void *yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
213
+ void yyfree (void * ,yyscan_t yyscanner );
214
+
215
+ /* Begin user sect3 */
216
+
217
+ #define yywrap(n) 1
218
+ #define YY_SKIP_YYWRAP
219
+
220
+ #define yytext_ptr yytext_r
221
+
222
+ #ifdef YY_HEADER_EXPORT_START_CONDITIONS
223
+ #define INITIAL 0
224
+
225
+ #endif
226
+
227
+ #ifndef YY_NO_UNISTD_H
228
+ /* Special case for "unistd.h", since it is non-ANSI. We include it way
229
+ * down here because we want the user's section 1 to have been scanned first.
230
+ * The user has a chance to override it with an option.
231
+ */
232
+ #include <unistd.h>
233
+ #endif
234
+
235
+ #ifndef YY_EXTRA_TYPE
236
+ #define YY_EXTRA_TYPE void *
237
+ #endif
238
+
239
+ int yylex_init (yyscan_t* scanner);
240
+
241
+ int yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
242
+
243
+ /* Accessor methods to globals.
244
+ These are made visible to non-reentrant scanners for convenience. */
245
+
246
+ int yylex_destroy (yyscan_t yyscanner );
247
+
248
+ int yyget_debug (yyscan_t yyscanner );
249
+
250
+ void yyset_debug (int debug_flag ,yyscan_t yyscanner );
251
+
252
+ YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner );
253
+
254
+ void yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
255
+
256
+ FILE *yyget_in (yyscan_t yyscanner );
257
+
258
+ void yyset_in (FILE * in_str ,yyscan_t yyscanner );
259
+
260
+ FILE *yyget_out (yyscan_t yyscanner );
261
+
262
+ void yyset_out (FILE * out_str ,yyscan_t yyscanner );
263
+
264
+ yy_size_t yyget_leng (yyscan_t yyscanner );
265
+
266
+ char *yyget_text (yyscan_t yyscanner );
267
+
268
+ int yyget_lineno (yyscan_t yyscanner );
269
+
270
+ void yyset_lineno (int line_number ,yyscan_t yyscanner );
271
+
272
+ YYSTYPE * yyget_lval (yyscan_t yyscanner );
273
+
274
+ void yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
275
+
276
+ YYLTYPE *yyget_lloc (yyscan_t yyscanner );
277
+
278
+ void yyset_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner );
279
+
280
+ /* Macros after this point can all be overridden by user definitions in
281
+ * section 1.
282
+ */
283
+
284
+ #ifndef YY_SKIP_YYWRAP
285
+ #ifdef __cplusplus
286
+ extern "C" int yywrap (yyscan_t yyscanner );
287
+ #else
288
+ extern int yywrap (yyscan_t yyscanner );
289
+ #endif
290
+ #endif
291
+
292
+ #ifndef yytext_ptr
293
+ static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
294
+ #endif
295
+
296
+ #ifdef YY_NEED_STRLEN
297
+ static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
298
+ #endif
299
+
300
+ #ifndef YY_NO_INPUT
301
+
302
+ #endif
303
+
304
+ /* Amount of stuff to slurp up with each read. */
305
+ #ifndef YY_READ_BUF_SIZE
306
+ #define YY_READ_BUF_SIZE 8192
307
+ #endif
308
+
309
+ /* Number of entries by which start-condition stack grows. */
310
+ #ifndef YY_START_STACK_INCR
311
+ #define YY_START_STACK_INCR 25
312
+ #endif
313
+
314
+ /* Default declaration of generated scanner - a define so the user can
315
+ * easily add parameters.
316
+ */
317
+ #ifndef YY_DECL
318
+ #define YY_DECL_IS_OURS 1
319
+
320
+ extern int yylex \
321
+ (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner);
322
+
323
+ #define YY_DECL int yylex \
324
+ (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
325
+ #endif /* !YY_DECL */
326
+
327
+ /* yy_get_previous_state - get the state just before the EOB char was reached */
328
+
329
+ #undef YY_NEW_FILE
330
+ #undef YY_FLUSH_BUFFER
331
+ #undef yy_set_bol
332
+ #undef yy_new_buffer
333
+ #undef yy_set_interactive
334
+ #undef YY_DO_BEFORE_ACTION
335
+
336
+ #ifdef YY_DECL_IS_OURS
337
+ #undef YY_DECL_IS_OURS
338
+ #undef YY_DECL
339
+ #endif
340
+
341
+ #line 32 "lexer.l"
342
+
343
+
344
+ #line 345 "lexer.h"
345
+ #undef yyIN_HEADER
346
+ #endif /* yyHEADER_H */
@@ -0,0 +1,1785 @@
1
+ /* A Bison parser, made by GNU Bison 2.7. */
2
+
3
+ /* Bison implementation for Yacc-like parsers in C
4
+
5
+ Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
6
+
7
+ This program is free software: you can redistribute it and/or modify
8
+ it under the terms of the GNU General Public License as published by
9
+ the Free Software Foundation, either version 3 of the License, or
10
+ (at your option) any later version.
11
+
12
+ This program is distributed in the hope that it will be useful,
13
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ GNU General Public License for more details.
16
+
17
+ You should have received a copy of the GNU General Public License
18
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
19
+
20
+ /* As a special exception, you may create a larger work that contains
21
+ part or all of the Bison parser skeleton and distribute that work
22
+ under terms of your choice, so long as that work isn't itself a
23
+ parser generator using the skeleton or a modified version thereof
24
+ as a parser skeleton. Alternatively, if you modify or redistribute
25
+ the parser skeleton itself, you may (at your option) remove this
26
+ special exception, which will cause the skeleton and the resulting
27
+ Bison output files to be licensed under the GNU General Public
28
+ License without this special exception.
29
+
30
+ This special exception was added by the Free Software Foundation in
31
+ version 2.2 of Bison. */
32
+
33
+ /* C LALR(1) parser skeleton written by Richard Stallman, by
34
+ simplifying the original so-called "semantic" parser. */
35
+
36
+ /* All symbols defined below should begin with yy or YY, to avoid
37
+ infringing on user name space. This should be done even for local
38
+ variables, as they might otherwise be expanded by user macros.
39
+ There are some unavoidable exceptions within include files to
40
+ define necessary library symbols; they are noted "INFRINGES ON
41
+ USER NAME SPACE" below. */
42
+
43
+ /* Identify Bison output. */
44
+ #define YYBISON 1
45
+
46
+ /* Bison version. */
47
+ #define YYBISON_VERSION "2.7"
48
+
49
+ /* Skeleton name. */
50
+ #define YYSKELETON_NAME "yacc.c"
51
+
52
+ /* Pure parsers. */
53
+ #define YYPURE 1
54
+
55
+ /* Push parsers. */
56
+ #define YYPUSH 0
57
+
58
+ /* Pull parsers. */
59
+ #define YYPULL 1
60
+
61
+
62
+
63
+
64
+ /* Copy the first part of user declarations. */
65
+ /* Line 371 of yacc.c */
66
+ #line 1 "parser.y"
67
+
68
+
69
+ #include "parser.h"
70
+ #include "lexer.h"
71
+
72
+ void yyerror(YYLTYPE *locp, yyscan_t scanner, Node** node, const char* msg);
73
+
74
+
75
+ /* Line 371 of yacc.c */
76
+ #line 77 "parser.c"
77
+
78
+ # ifndef YY_NULL
79
+ # if defined __cplusplus && 201103L <= __cplusplus
80
+ # define YY_NULL nullptr
81
+ # else
82
+ # define YY_NULL 0
83
+ # endif
84
+ # endif
85
+
86
+ /* Enabling verbose error messages. */
87
+ #ifdef YYERROR_VERBOSE
88
+ # undef YYERROR_VERBOSE
89
+ # define YYERROR_VERBOSE 1
90
+ #else
91
+ # define YYERROR_VERBOSE 1
92
+ #endif
93
+
94
+ /* In a future release of Bison, this section will be replaced
95
+ by #include "parser.h". */
96
+ #ifndef YY_YY_PARSER_H_INCLUDED
97
+ # define YY_YY_PARSER_H_INCLUDED
98
+ /* Enabling traces. */
99
+ #ifndef YYDEBUG
100
+ # define YYDEBUG 0
101
+ #endif
102
+ #if YYDEBUG
103
+ extern int yydebug;
104
+ #endif
105
+ /* "%code requires" blocks. */
106
+ /* Line 387 of yacc.c */
107
+ #line 10 "parser.y"
108
+
109
+
110
+ #include "ast.h"
111
+ #ifndef YY_TYPEDEF_YY_SCANNER_T
112
+ #define YY_TYPEDEF_YY_SCANNER_T
113
+ typedef void* yyscan_t;
114
+ #endif
115
+
116
+
117
+ /* Line 387 of yacc.c */
118
+ #line 119 "parser.c"
119
+
120
+ /* Tokens. */
121
+ #ifndef YYTOKENTYPE
122
+ # define YYTOKENTYPE
123
+ /* Put the tokens into the symbol table, so that GDB and other debuggers
124
+ know about them. */
125
+ enum yytokentype {
126
+ TOKEN_OR = 258,
127
+ TOKEN_AND = 259,
128
+ UNOT = 260,
129
+ TOKEN_VAR = 261,
130
+ TOKEN_NOT = 262,
131
+ TOKEN_LPAREN = 263,
132
+ TOKEN_RPAREN = 264
133
+ };
134
+ #endif
135
+
136
+
137
+ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
138
+ typedef union YYSTYPE
139
+ {
140
+ /* Line 387 of yacc.c */
141
+ #line 30 "parser.y"
142
+
143
+ char* value;
144
+ Node* node;
145
+
146
+
147
+ /* Line 387 of yacc.c */
148
+ #line 149 "parser.c"
149
+ } YYSTYPE;
150
+ # define YYSTYPE_IS_TRIVIAL 1
151
+ # define yystype YYSTYPE /* obsolescent; will be withdrawn */
152
+ # define YYSTYPE_IS_DECLARED 1
153
+ #endif
154
+
155
+ #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
156
+ typedef struct YYLTYPE
157
+ {
158
+ int first_line;
159
+ int first_column;
160
+ int last_line;
161
+ int last_column;
162
+ } YYLTYPE;
163
+ # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
164
+ # define YYLTYPE_IS_DECLARED 1
165
+ # define YYLTYPE_IS_TRIVIAL 1
166
+ #endif
167
+
168
+
169
+ #ifdef YYPARSE_PARAM
170
+ #if defined __STDC__ || defined __cplusplus
171
+ int yyparse (void *YYPARSE_PARAM);
172
+ #else
173
+ int yyparse ();
174
+ #endif
175
+ #else /* ! YYPARSE_PARAM */
176
+ #if defined __STDC__ || defined __cplusplus
177
+ int yyparse (Node** node, yyscan_t scanner);
178
+ #else
179
+ int yyparse ();
180
+ #endif
181
+ #endif /* ! YYPARSE_PARAM */
182
+
183
+ #endif /* !YY_YY_PARSER_H_INCLUDED */
184
+
185
+ /* Copy the second part of user declarations. */
186
+
187
+ /* Line 390 of yacc.c */
188
+ #line 189 "parser.c"
189
+
190
+ #ifdef short
191
+ # undef short
192
+ #endif
193
+
194
+ #ifdef YYTYPE_UINT8
195
+ typedef YYTYPE_UINT8 yytype_uint8;
196
+ #else
197
+ typedef unsigned char yytype_uint8;
198
+ #endif
199
+
200
+ #ifdef YYTYPE_INT8
201
+ typedef YYTYPE_INT8 yytype_int8;
202
+ #elif (defined __STDC__ || defined __C99__FUNC__ \
203
+ || defined __cplusplus || defined _MSC_VER)
204
+ typedef signed char yytype_int8;
205
+ #else
206
+ typedef short int yytype_int8;
207
+ #endif
208
+
209
+ #ifdef YYTYPE_UINT16
210
+ typedef YYTYPE_UINT16 yytype_uint16;
211
+ #else
212
+ typedef unsigned short int yytype_uint16;
213
+ #endif
214
+
215
+ #ifdef YYTYPE_INT16
216
+ typedef YYTYPE_INT16 yytype_int16;
217
+ #else
218
+ typedef short int yytype_int16;
219
+ #endif
220
+
221
+ #ifndef YYSIZE_T
222
+ # ifdef __SIZE_TYPE__
223
+ # define YYSIZE_T __SIZE_TYPE__
224
+ # elif defined size_t
225
+ # define YYSIZE_T size_t
226
+ # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
227
+ || defined __cplusplus || defined _MSC_VER)
228
+ # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
229
+ # define YYSIZE_T size_t
230
+ # else
231
+ # define YYSIZE_T unsigned int
232
+ # endif
233
+ #endif
234
+
235
+ #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
236
+
237
+ #ifndef YY_
238
+ # if defined YYENABLE_NLS && YYENABLE_NLS
239
+ # if ENABLE_NLS
240
+ # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
241
+ # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
242
+ # endif
243
+ # endif
244
+ # ifndef YY_
245
+ # define YY_(Msgid) Msgid
246
+ # endif
247
+ #endif
248
+
249
+ /* Suppress unused-variable warnings by "using" E. */
250
+ #if ! defined lint || defined __GNUC__
251
+ # define YYUSE(E) ((void) (E))
252
+ #else
253
+ # define YYUSE(E) /* empty */
254
+ #endif
255
+
256
+ /* Identity function, used to suppress warnings about constant conditions. */
257
+ #ifndef lint
258
+ # define YYID(N) (N)
259
+ #else
260
+ #if (defined __STDC__ || defined __C99__FUNC__ \
261
+ || defined __cplusplus || defined _MSC_VER)
262
+ static int
263
+ YYID (int yyi)
264
+ #else
265
+ static int
266
+ YYID (yyi)
267
+ int yyi;
268
+ #endif
269
+ {
270
+ return yyi;
271
+ }
272
+ #endif
273
+
274
+ #if ! defined yyoverflow || YYERROR_VERBOSE
275
+
276
+ /* The parser invokes alloca or malloc; define the necessary symbols. */
277
+
278
+ # ifdef YYSTACK_USE_ALLOCA
279
+ # if YYSTACK_USE_ALLOCA
280
+ # ifdef __GNUC__
281
+ # define YYSTACK_ALLOC __builtin_alloca
282
+ # elif defined __BUILTIN_VA_ARG_INCR
283
+ # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
284
+ # elif defined _AIX
285
+ # define YYSTACK_ALLOC __alloca
286
+ # elif defined _MSC_VER
287
+ # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
288
+ # define alloca _alloca
289
+ # else
290
+ # define YYSTACK_ALLOC alloca
291
+ # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
292
+ || defined __cplusplus || defined _MSC_VER)
293
+ # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
294
+ /* Use EXIT_SUCCESS as a witness for stdlib.h. */
295
+ # ifndef EXIT_SUCCESS
296
+ # define EXIT_SUCCESS 0
297
+ # endif
298
+ # endif
299
+ # endif
300
+ # endif
301
+ # endif
302
+
303
+ # ifdef YYSTACK_ALLOC
304
+ /* Pacify GCC's `empty if-body' warning. */
305
+ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
306
+ # ifndef YYSTACK_ALLOC_MAXIMUM
307
+ /* The OS might guarantee only one guard page at the bottom of the stack,
308
+ and a page size can be as small as 4096 bytes. So we cannot safely
309
+ invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
310
+ to allow for a few compiler-allocated temporary stack slots. */
311
+ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
312
+ # endif
313
+ # else
314
+ # define YYSTACK_ALLOC YYMALLOC
315
+ # define YYSTACK_FREE YYFREE
316
+ # ifndef YYSTACK_ALLOC_MAXIMUM
317
+ # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
318
+ # endif
319
+ # if (defined __cplusplus && ! defined EXIT_SUCCESS \
320
+ && ! ((defined YYMALLOC || defined malloc) \
321
+ && (defined YYFREE || defined free)))
322
+ # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
323
+ # ifndef EXIT_SUCCESS
324
+ # define EXIT_SUCCESS 0
325
+ # endif
326
+ # endif
327
+ # ifndef YYMALLOC
328
+ # define YYMALLOC malloc
329
+ # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
330
+ || defined __cplusplus || defined _MSC_VER)
331
+ void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
332
+ # endif
333
+ # endif
334
+ # ifndef YYFREE
335
+ # define YYFREE free
336
+ # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
337
+ || defined __cplusplus || defined _MSC_VER)
338
+ void free (void *); /* INFRINGES ON USER NAME SPACE */
339
+ # endif
340
+ # endif
341
+ # endif
342
+ #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
343
+
344
+
345
+ #if (! defined yyoverflow \
346
+ && (! defined __cplusplus \
347
+ || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
348
+ && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
349
+
350
+ /* A type that is properly aligned for any stack member. */
351
+ union yyalloc
352
+ {
353
+ yytype_int16 yyss_alloc;
354
+ YYSTYPE yyvs_alloc;
355
+ YYLTYPE yyls_alloc;
356
+ };
357
+
358
+ /* The size of the maximum gap between one aligned stack and the next. */
359
+ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
360
+
361
+ /* The size of an array large to enough to hold all stacks, each with
362
+ N elements. */
363
+ # define YYSTACK_BYTES(N) \
364
+ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
365
+ + 2 * YYSTACK_GAP_MAXIMUM)
366
+
367
+ # define YYCOPY_NEEDED 1
368
+
369
+ /* Relocate STACK from its old location to the new one. The
370
+ local variables YYSIZE and YYSTACKSIZE give the old and new number of
371
+ elements in the stack, and YYPTR gives the new location of the
372
+ stack. Advance YYPTR to a properly aligned location for the next
373
+ stack. */
374
+ # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
375
+ do \
376
+ { \
377
+ YYSIZE_T yynewbytes; \
378
+ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
379
+ Stack = &yyptr->Stack_alloc; \
380
+ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
381
+ yyptr += yynewbytes / sizeof (*yyptr); \
382
+ } \
383
+ while (YYID (0))
384
+
385
+ #endif
386
+
387
+ #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
388
+ /* Copy COUNT objects from SRC to DST. The source and destination do
389
+ not overlap. */
390
+ # ifndef YYCOPY
391
+ # if defined __GNUC__ && 1 < __GNUC__
392
+ # define YYCOPY(Dst, Src, Count) \
393
+ __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
394
+ # else
395
+ # define YYCOPY(Dst, Src, Count) \
396
+ do \
397
+ { \
398
+ YYSIZE_T yyi; \
399
+ for (yyi = 0; yyi < (Count); yyi++) \
400
+ (Dst)[yyi] = (Src)[yyi]; \
401
+ } \
402
+ while (YYID (0))
403
+ # endif
404
+ # endif
405
+ #endif /* !YYCOPY_NEEDED */
406
+
407
+ /* YYFINAL -- State number of the termination state. */
408
+ #define YYFINAL 8
409
+ /* YYLAST -- Last index in YYTABLE. */
410
+ #define YYLAST 14
411
+
412
+ /* YYNTOKENS -- Number of terminals. */
413
+ #define YYNTOKENS 10
414
+ /* YYNNTS -- Number of nonterminals. */
415
+ #define YYNNTS 3
416
+ /* YYNRULES -- Number of rules. */
417
+ #define YYNRULES 7
418
+ /* YYNRULES -- Number of states. */
419
+ #define YYNSTATES 14
420
+
421
+ /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
422
+ #define YYUNDEFTOK 2
423
+ #define YYMAXUTOK 264
424
+
425
+ #define YYTRANSLATE(YYX) \
426
+ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
427
+
428
+ /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
429
+ static const yytype_uint8 yytranslate[] =
430
+ {
431
+ 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
432
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
433
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
434
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
435
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
436
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
437
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
438
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
439
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
440
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
441
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
442
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
443
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
444
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
445
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
446
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
447
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
448
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
449
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
450
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
451
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
452
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
453
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
454
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
455
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
456
+ 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
457
+ 5, 6, 7, 8, 9
458
+ };
459
+
460
+ #if YYDEBUG
461
+ /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
462
+ YYRHS. */
463
+ static const yytype_uint8 yyprhs[] =
464
+ {
465
+ 0, 0, 3, 5, 7, 11, 15, 18
466
+ };
467
+
468
+ /* YYRHS -- A `-1'-separated list of the rules' RHS. */
469
+ static const yytype_int8 yyrhs[] =
470
+ {
471
+ 11, 0, -1, 12, -1, 6, -1, 12, 4, 12,
472
+ -1, 12, 3, 12, -1, 7, 12, -1, 8, 12,
473
+ 9, -1
474
+ };
475
+
476
+ /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
477
+ static const yytype_uint8 yyrline[] =
478
+ {
479
+ 0, 51, 51, 55, 56, 57, 58, 59
480
+ };
481
+ #endif
482
+
483
+ #if YYDEBUG || YYERROR_VERBOSE || 1
484
+ /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
485
+ First, the terminals, then, starting at YYNTOKENS, nonterminals. */
486
+ static const char *const yytname[] =
487
+ {
488
+ "$end", "error", "$undefined", "TOKEN_OR", "TOKEN_AND", "UNOT",
489
+ "TOKEN_VAR", "TOKEN_NOT", "TOKEN_LPAREN", "TOKEN_RPAREN", "$accept",
490
+ "input", "expr", YY_NULL
491
+ };
492
+ #endif
493
+
494
+ # ifdef YYPRINT
495
+ /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
496
+ token YYLEX-NUM. */
497
+ static const yytype_uint16 yytoknum[] =
498
+ {
499
+ 0, 256, 257, 258, 259, 260, 261, 262, 263, 264
500
+ };
501
+ # endif
502
+
503
+ /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
504
+ static const yytype_uint8 yyr1[] =
505
+ {
506
+ 0, 10, 11, 12, 12, 12, 12, 12
507
+ };
508
+
509
+ /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
510
+ static const yytype_uint8 yyr2[] =
511
+ {
512
+ 0, 2, 1, 1, 3, 3, 2, 3
513
+ };
514
+
515
+ /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
516
+ Performed when YYTABLE doesn't specify something else to do. Zero
517
+ means the default is an error. */
518
+ static const yytype_uint8 yydefact[] =
519
+ {
520
+ 0, 3, 0, 0, 0, 2, 6, 0, 1, 0,
521
+ 0, 7, 5, 4
522
+ };
523
+
524
+ /* YYDEFGOTO[NTERM-NUM]. */
525
+ static const yytype_int8 yydefgoto[] =
526
+ {
527
+ -1, 4, 5
528
+ };
529
+
530
+ /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
531
+ STATE-NUM. */
532
+ #define YYPACT_NINF -3
533
+ static const yytype_int8 yypact[] =
534
+ {
535
+ 4, -3, 4, 4, 13, 2, -3, 0, -3, 4,
536
+ 4, -3, 10, -3
537
+ };
538
+
539
+ /* YYPGOTO[NTERM-NUM]. */
540
+ static const yytype_int8 yypgoto[] =
541
+ {
542
+ -3, -3, -2
543
+ };
544
+
545
+ /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
546
+ positive, shift that token. If negative, reduce the rule which
547
+ number is the opposite. If YYTABLE_NINF, syntax error. */
548
+ #define YYTABLE_NINF -1
549
+ static const yytype_uint8 yytable[] =
550
+ {
551
+ 6, 7, 0, 9, 10, 9, 10, 12, 13, 11,
552
+ 1, 2, 3, 8, 10
553
+ };
554
+
555
+ #define yypact_value_is_default(Yystate) \
556
+ (!!((Yystate) == (-3)))
557
+
558
+ #define yytable_value_is_error(Yytable_value) \
559
+ YYID (0)
560
+
561
+ static const yytype_int8 yycheck[] =
562
+ {
563
+ 2, 3, -1, 3, 4, 3, 4, 9, 10, 9,
564
+ 6, 7, 8, 0, 4
565
+ };
566
+
567
+ /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
568
+ symbol of state STATE-NUM. */
569
+ static const yytype_uint8 yystos[] =
570
+ {
571
+ 0, 6, 7, 8, 11, 12, 12, 12, 0, 3,
572
+ 4, 9, 12, 12
573
+ };
574
+
575
+ #define yyerrok (yyerrstatus = 0)
576
+ #define yyclearin (yychar = YYEMPTY)
577
+ #define YYEMPTY (-2)
578
+ #define YYEOF 0
579
+
580
+ #define YYACCEPT goto yyacceptlab
581
+ #define YYABORT goto yyabortlab
582
+ #define YYERROR goto yyerrorlab
583
+
584
+
585
+ /* Like YYERROR except do call yyerror. This remains here temporarily
586
+ to ease the transition to the new meaning of YYERROR, for GCC.
587
+ Once GCC version 2 has supplanted version 1, this can go. However,
588
+ YYFAIL appears to be in use. Nevertheless, it is formally deprecated
589
+ in Bison 2.4.2's NEWS entry, where a plan to phase it out is
590
+ discussed. */
591
+
592
+ #define YYFAIL goto yyerrlab
593
+ #if defined YYFAIL
594
+ /* This is here to suppress warnings from the GCC cpp's
595
+ -Wunused-macros. Normally we don't worry about that warning, but
596
+ some users do, and we want to make it easy for users to remove
597
+ YYFAIL uses, which will produce warnings from Bison 2.5. */
598
+ #endif
599
+
600
+ #define YYRECOVERING() (!!yyerrstatus)
601
+
602
+ #define YYBACKUP(Token, Value) \
603
+ do \
604
+ if (yychar == YYEMPTY) \
605
+ { \
606
+ yychar = (Token); \
607
+ yylval = (Value); \
608
+ YYPOPSTACK (yylen); \
609
+ yystate = *yyssp; \
610
+ goto yybackup; \
611
+ } \
612
+ else \
613
+ { \
614
+ yyerror (&yylloc, node, scanner, YY_("syntax error: cannot back up")); \
615
+ YYERROR; \
616
+ } \
617
+ while (YYID (0))
618
+
619
+ /* Error token number */
620
+ #define YYTERROR 1
621
+ #define YYERRCODE 256
622
+
623
+
624
+ /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
625
+ If N is 0, then set CURRENT to the empty location which ends
626
+ the previous symbol: RHS[0] (always defined). */
627
+
628
+ #ifndef YYLLOC_DEFAULT
629
+ # define YYLLOC_DEFAULT(Current, Rhs, N) \
630
+ do \
631
+ if (YYID (N)) \
632
+ { \
633
+ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
634
+ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
635
+ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
636
+ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
637
+ } \
638
+ else \
639
+ { \
640
+ (Current).first_line = (Current).last_line = \
641
+ YYRHSLOC (Rhs, 0).last_line; \
642
+ (Current).first_column = (Current).last_column = \
643
+ YYRHSLOC (Rhs, 0).last_column; \
644
+ } \
645
+ while (YYID (0))
646
+ #endif
647
+
648
+ #define YYRHSLOC(Rhs, K) ((Rhs)[K])
649
+
650
+
651
+ /* YY_LOCATION_PRINT -- Print the location on the stream.
652
+ This macro was not mandated originally: define only if we know
653
+ we won't break user code: when these are the locations we know. */
654
+
655
+ #ifndef YY_LOCATION_PRINT
656
+ # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
657
+
658
+ /* Print *YYLOCP on YYO. Private, do not rely on its existence. */
659
+
660
+ __attribute__((__unused__))
661
+ #if (defined __STDC__ || defined __C99__FUNC__ \
662
+ || defined __cplusplus || defined _MSC_VER)
663
+ static unsigned
664
+ yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
665
+ #else
666
+ static unsigned
667
+ yy_location_print_ (yyo, yylocp)
668
+ FILE *yyo;
669
+ YYLTYPE const * const yylocp;
670
+ #endif
671
+ {
672
+ unsigned res = 0;
673
+ int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
674
+ if (0 <= yylocp->first_line)
675
+ {
676
+ res += fprintf (yyo, "%d", yylocp->first_line);
677
+ if (0 <= yylocp->first_column)
678
+ res += fprintf (yyo, ".%d", yylocp->first_column);
679
+ }
680
+ if (0 <= yylocp->last_line)
681
+ {
682
+ if (yylocp->first_line < yylocp->last_line)
683
+ {
684
+ res += fprintf (yyo, "-%d", yylocp->last_line);
685
+ if (0 <= end_col)
686
+ res += fprintf (yyo, ".%d", end_col);
687
+ }
688
+ else if (0 <= end_col && yylocp->first_column < end_col)
689
+ res += fprintf (yyo, "-%d", end_col);
690
+ }
691
+ return res;
692
+ }
693
+
694
+ # define YY_LOCATION_PRINT(File, Loc) \
695
+ yy_location_print_ (File, &(Loc))
696
+
697
+ # else
698
+ # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
699
+ # endif
700
+ #endif
701
+
702
+
703
+ /* YYLEX -- calling `yylex' with the right arguments. */
704
+ #ifdef YYLEX_PARAM
705
+ # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
706
+ #else
707
+ # define YYLEX yylex (&yylval, &yylloc, scanner)
708
+ #endif
709
+
710
+ /* Enable debugging if requested. */
711
+ #if YYDEBUG
712
+
713
+ # ifndef YYFPRINTF
714
+ # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
715
+ # define YYFPRINTF fprintf
716
+ # endif
717
+
718
+ # define YYDPRINTF(Args) \
719
+ do { \
720
+ if (yydebug) \
721
+ YYFPRINTF Args; \
722
+ } while (YYID (0))
723
+
724
+ # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
725
+ do { \
726
+ if (yydebug) \
727
+ { \
728
+ YYFPRINTF (stderr, "%s ", Title); \
729
+ yy_symbol_print (stderr, \
730
+ Type, Value, Location, node, scanner); \
731
+ YYFPRINTF (stderr, "\n"); \
732
+ } \
733
+ } while (YYID (0))
734
+
735
+
736
+ /*--------------------------------.
737
+ | Print this symbol on YYOUTPUT. |
738
+ `--------------------------------*/
739
+
740
+ /*ARGSUSED*/
741
+ #if (defined __STDC__ || defined __C99__FUNC__ \
742
+ || defined __cplusplus || defined _MSC_VER)
743
+ static void
744
+ yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, Node** node, yyscan_t scanner)
745
+ #else
746
+ static void
747
+ yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, node, scanner)
748
+ FILE *yyoutput;
749
+ int yytype;
750
+ YYSTYPE const * const yyvaluep;
751
+ YYLTYPE const * const yylocationp;
752
+ Node** node;
753
+ yyscan_t scanner;
754
+ #endif
755
+ {
756
+ FILE *yyo = yyoutput;
757
+ YYUSE (yyo);
758
+ if (!yyvaluep)
759
+ return;
760
+ YYUSE (yylocationp);
761
+ YYUSE (node);
762
+ YYUSE (scanner);
763
+ # ifdef YYPRINT
764
+ if (yytype < YYNTOKENS)
765
+ YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
766
+ # else
767
+ YYUSE (yyoutput);
768
+ # endif
769
+ switch (yytype)
770
+ {
771
+ default:
772
+ break;
773
+ }
774
+ }
775
+
776
+
777
+ /*--------------------------------.
778
+ | Print this symbol on YYOUTPUT. |
779
+ `--------------------------------*/
780
+
781
+ #if (defined __STDC__ || defined __C99__FUNC__ \
782
+ || defined __cplusplus || defined _MSC_VER)
783
+ static void
784
+ yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, Node** node, yyscan_t scanner)
785
+ #else
786
+ static void
787
+ yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, node, scanner)
788
+ FILE *yyoutput;
789
+ int yytype;
790
+ YYSTYPE const * const yyvaluep;
791
+ YYLTYPE const * const yylocationp;
792
+ Node** node;
793
+ yyscan_t scanner;
794
+ #endif
795
+ {
796
+ if (yytype < YYNTOKENS)
797
+ YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
798
+ else
799
+ YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
800
+
801
+ YY_LOCATION_PRINT (yyoutput, *yylocationp);
802
+ YYFPRINTF (yyoutput, ": ");
803
+ yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, node, scanner);
804
+ YYFPRINTF (yyoutput, ")");
805
+ }
806
+
807
+ /*------------------------------------------------------------------.
808
+ | yy_stack_print -- Print the state stack from its BOTTOM up to its |
809
+ | TOP (included). |
810
+ `------------------------------------------------------------------*/
811
+
812
+ #if (defined __STDC__ || defined __C99__FUNC__ \
813
+ || defined __cplusplus || defined _MSC_VER)
814
+ static void
815
+ yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
816
+ #else
817
+ static void
818
+ yy_stack_print (yybottom, yytop)
819
+ yytype_int16 *yybottom;
820
+ yytype_int16 *yytop;
821
+ #endif
822
+ {
823
+ YYFPRINTF (stderr, "Stack now");
824
+ for (; yybottom <= yytop; yybottom++)
825
+ {
826
+ int yybot = *yybottom;
827
+ YYFPRINTF (stderr, " %d", yybot);
828
+ }
829
+ YYFPRINTF (stderr, "\n");
830
+ }
831
+
832
+ # define YY_STACK_PRINT(Bottom, Top) \
833
+ do { \
834
+ if (yydebug) \
835
+ yy_stack_print ((Bottom), (Top)); \
836
+ } while (YYID (0))
837
+
838
+
839
+ /*------------------------------------------------.
840
+ | Report that the YYRULE is going to be reduced. |
841
+ `------------------------------------------------*/
842
+
843
+ #if (defined __STDC__ || defined __C99__FUNC__ \
844
+ || defined __cplusplus || defined _MSC_VER)
845
+ static void
846
+ yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, Node** node, yyscan_t scanner)
847
+ #else
848
+ static void
849
+ yy_reduce_print (yyvsp, yylsp, yyrule, node, scanner)
850
+ YYSTYPE *yyvsp;
851
+ YYLTYPE *yylsp;
852
+ int yyrule;
853
+ Node** node;
854
+ yyscan_t scanner;
855
+ #endif
856
+ {
857
+ int yynrhs = yyr2[yyrule];
858
+ int yyi;
859
+ unsigned long int yylno = yyrline[yyrule];
860
+ YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
861
+ yyrule - 1, yylno);
862
+ /* The symbols being reduced. */
863
+ for (yyi = 0; yyi < yynrhs; yyi++)
864
+ {
865
+ YYFPRINTF (stderr, " $%d = ", yyi + 1);
866
+ yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
867
+ &(yyvsp[(yyi + 1) - (yynrhs)])
868
+ , &(yylsp[(yyi + 1) - (yynrhs)]) , node, scanner);
869
+ YYFPRINTF (stderr, "\n");
870
+ }
871
+ }
872
+
873
+ # define YY_REDUCE_PRINT(Rule) \
874
+ do { \
875
+ if (yydebug) \
876
+ yy_reduce_print (yyvsp, yylsp, Rule, node, scanner); \
877
+ } while (YYID (0))
878
+
879
+ /* Nonzero means print parse trace. It is left uninitialized so that
880
+ multiple parsers can coexist. */
881
+ int yydebug;
882
+ #else /* !YYDEBUG */
883
+ # define YYDPRINTF(Args)
884
+ # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
885
+ # define YY_STACK_PRINT(Bottom, Top)
886
+ # define YY_REDUCE_PRINT(Rule)
887
+ #endif /* !YYDEBUG */
888
+
889
+
890
+ /* YYINITDEPTH -- initial size of the parser's stacks. */
891
+ #ifndef YYINITDEPTH
892
+ # define YYINITDEPTH 200
893
+ #endif
894
+
895
+ /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
896
+ if the built-in stack extension method is used).
897
+
898
+ Do not make this value too large; the results are undefined if
899
+ YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
900
+ evaluated with infinite-precision integer arithmetic. */
901
+
902
+ #ifndef YYMAXDEPTH
903
+ # define YYMAXDEPTH 10000
904
+ #endif
905
+
906
+
907
+ #if YYERROR_VERBOSE
908
+
909
+ # ifndef yystrlen
910
+ # if defined __GLIBC__ && defined _STRING_H
911
+ # define yystrlen strlen
912
+ # else
913
+ /* Return the length of YYSTR. */
914
+ #if (defined __STDC__ || defined __C99__FUNC__ \
915
+ || defined __cplusplus || defined _MSC_VER)
916
+ static YYSIZE_T
917
+ yystrlen (const char *yystr)
918
+ #else
919
+ static YYSIZE_T
920
+ yystrlen (yystr)
921
+ const char *yystr;
922
+ #endif
923
+ {
924
+ YYSIZE_T yylen;
925
+ for (yylen = 0; yystr[yylen]; yylen++)
926
+ continue;
927
+ return yylen;
928
+ }
929
+ # endif
930
+ # endif
931
+
932
+ # ifndef yystpcpy
933
+ # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
934
+ # define yystpcpy stpcpy
935
+ # else
936
+ /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
937
+ YYDEST. */
938
+ #if (defined __STDC__ || defined __C99__FUNC__ \
939
+ || defined __cplusplus || defined _MSC_VER)
940
+ static char *
941
+ yystpcpy (char *yydest, const char *yysrc)
942
+ #else
943
+ static char *
944
+ yystpcpy (yydest, yysrc)
945
+ char *yydest;
946
+ const char *yysrc;
947
+ #endif
948
+ {
949
+ char *yyd = yydest;
950
+ const char *yys = yysrc;
951
+
952
+ while ((*yyd++ = *yys++) != '\0')
953
+ continue;
954
+
955
+ return yyd - 1;
956
+ }
957
+ # endif
958
+ # endif
959
+
960
+ # ifndef yytnamerr
961
+ /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
962
+ quotes and backslashes, so that it's suitable for yyerror. The
963
+ heuristic is that double-quoting is unnecessary unless the string
964
+ contains an apostrophe, a comma, or backslash (other than
965
+ backslash-backslash). YYSTR is taken from yytname. If YYRES is
966
+ null, do not copy; instead, return the length of what the result
967
+ would have been. */
968
+ static YYSIZE_T
969
+ yytnamerr (char *yyres, const char *yystr)
970
+ {
971
+ if (*yystr == '"')
972
+ {
973
+ YYSIZE_T yyn = 0;
974
+ char const *yyp = yystr;
975
+
976
+ for (;;)
977
+ switch (*++yyp)
978
+ {
979
+ case '\'':
980
+ case ',':
981
+ goto do_not_strip_quotes;
982
+
983
+ case '\\':
984
+ if (*++yyp != '\\')
985
+ goto do_not_strip_quotes;
986
+ /* Fall through. */
987
+ default:
988
+ if (yyres)
989
+ yyres[yyn] = *yyp;
990
+ yyn++;
991
+ break;
992
+
993
+ case '"':
994
+ if (yyres)
995
+ yyres[yyn] = '\0';
996
+ return yyn;
997
+ }
998
+ do_not_strip_quotes: ;
999
+ }
1000
+
1001
+ if (! yyres)
1002
+ return yystrlen (yystr);
1003
+
1004
+ return yystpcpy (yyres, yystr) - yyres;
1005
+ }
1006
+ # endif
1007
+
1008
+ /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1009
+ about the unexpected token YYTOKEN for the state stack whose top is
1010
+ YYSSP.
1011
+
1012
+ Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1013
+ not large enough to hold the message. In that case, also set
1014
+ *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1015
+ required number of bytes is too large to store. */
1016
+ static int
1017
+ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1018
+ yytype_int16 *yyssp, int yytoken)
1019
+ {
1020
+ YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
1021
+ YYSIZE_T yysize = yysize0;
1022
+ enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1023
+ /* Internationalized format string. */
1024
+ const char *yyformat = YY_NULL;
1025
+ /* Arguments of yyformat. */
1026
+ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1027
+ /* Number of reported tokens (one for the "unexpected", one per
1028
+ "expected"). */
1029
+ int yycount = 0;
1030
+
1031
+ /* There are many possibilities here to consider:
1032
+ - Assume YYFAIL is not used. It's too flawed to consider. See
1033
+ <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1034
+ for details. YYERROR is fine as it does not invoke this
1035
+ function.
1036
+ - If this state is a consistent state with a default action, then
1037
+ the only way this function was invoked is if the default action
1038
+ is an error action. In that case, don't check for expected
1039
+ tokens because there are none.
1040
+ - The only way there can be no lookahead present (in yychar) is if
1041
+ this state is a consistent state with a default action. Thus,
1042
+ detecting the absence of a lookahead is sufficient to determine
1043
+ that there is no unexpected or expected token to report. In that
1044
+ case, just report a simple "syntax error".
1045
+ - Don't assume there isn't a lookahead just because this state is a
1046
+ consistent state with a default action. There might have been a
1047
+ previous inconsistent state, consistent state with a non-default
1048
+ action, or user semantic action that manipulated yychar.
1049
+ - Of course, the expected token list depends on states to have
1050
+ correct lookahead information, and it depends on the parser not
1051
+ to perform extra reductions after fetching a lookahead from the
1052
+ scanner and before detecting a syntax error. Thus, state merging
1053
+ (from LALR or IELR) and default reductions corrupt the expected
1054
+ token list. However, the list is correct for canonical LR with
1055
+ one exception: it will still contain any token that will not be
1056
+ accepted due to an error action in a later state.
1057
+ */
1058
+ if (yytoken != YYEMPTY)
1059
+ {
1060
+ int yyn = yypact[*yyssp];
1061
+ yyarg[yycount++] = yytname[yytoken];
1062
+ if (!yypact_value_is_default (yyn))
1063
+ {
1064
+ /* Start YYX at -YYN if negative to avoid negative indexes in
1065
+ YYCHECK. In other words, skip the first -YYN actions for
1066
+ this state because they are default actions. */
1067
+ int yyxbegin = yyn < 0 ? -yyn : 0;
1068
+ /* Stay within bounds of both yycheck and yytname. */
1069
+ int yychecklim = YYLAST - yyn + 1;
1070
+ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1071
+ int yyx;
1072
+
1073
+ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1074
+ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1075
+ && !yytable_value_is_error (yytable[yyx + yyn]))
1076
+ {
1077
+ if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1078
+ {
1079
+ yycount = 1;
1080
+ yysize = yysize0;
1081
+ break;
1082
+ }
1083
+ yyarg[yycount++] = yytname[yyx];
1084
+ {
1085
+ YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
1086
+ if (! (yysize <= yysize1
1087
+ && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1088
+ return 2;
1089
+ yysize = yysize1;
1090
+ }
1091
+ }
1092
+ }
1093
+ }
1094
+
1095
+ switch (yycount)
1096
+ {
1097
+ # define YYCASE_(N, S) \
1098
+ case N: \
1099
+ yyformat = S; \
1100
+ break
1101
+ YYCASE_(0, YY_("syntax error"));
1102
+ YYCASE_(1, YY_("syntax error, unexpected %s"));
1103
+ YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1104
+ YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1105
+ YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1106
+ YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1107
+ # undef YYCASE_
1108
+ }
1109
+
1110
+ {
1111
+ YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1112
+ if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1113
+ return 2;
1114
+ yysize = yysize1;
1115
+ }
1116
+
1117
+ if (*yymsg_alloc < yysize)
1118
+ {
1119
+ *yymsg_alloc = 2 * yysize;
1120
+ if (! (yysize <= *yymsg_alloc
1121
+ && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1122
+ *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1123
+ return 1;
1124
+ }
1125
+
1126
+ /* Avoid sprintf, as that infringes on the user's name space.
1127
+ Don't have undefined behavior even if the translation
1128
+ produced a string with the wrong number of "%s"s. */
1129
+ {
1130
+ char *yyp = *yymsg;
1131
+ int yyi = 0;
1132
+ while ((*yyp = *yyformat) != '\0')
1133
+ if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1134
+ {
1135
+ yyp += yytnamerr (yyp, yyarg[yyi++]);
1136
+ yyformat += 2;
1137
+ }
1138
+ else
1139
+ {
1140
+ yyp++;
1141
+ yyformat++;
1142
+ }
1143
+ }
1144
+ return 0;
1145
+ }
1146
+ #endif /* YYERROR_VERBOSE */
1147
+
1148
+ /*-----------------------------------------------.
1149
+ | Release the memory associated to this symbol. |
1150
+ `-----------------------------------------------*/
1151
+
1152
+ /*ARGSUSED*/
1153
+ #if (defined __STDC__ || defined __C99__FUNC__ \
1154
+ || defined __cplusplus || defined _MSC_VER)
1155
+ static void
1156
+ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, Node** node, yyscan_t scanner)
1157
+ #else
1158
+ static void
1159
+ yydestruct (yymsg, yytype, yyvaluep, yylocationp, node, scanner)
1160
+ const char *yymsg;
1161
+ int yytype;
1162
+ YYSTYPE *yyvaluep;
1163
+ YYLTYPE *yylocationp;
1164
+ Node** node;
1165
+ yyscan_t scanner;
1166
+ #endif
1167
+ {
1168
+ YYUSE (yyvaluep);
1169
+ YYUSE (yylocationp);
1170
+ YYUSE (node);
1171
+ YYUSE (scanner);
1172
+
1173
+ if (!yymsg)
1174
+ yymsg = "Deleting";
1175
+ YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1176
+
1177
+ switch (yytype)
1178
+ {
1179
+
1180
+ default:
1181
+ break;
1182
+ }
1183
+ }
1184
+
1185
+
1186
+
1187
+
1188
+ /*----------.
1189
+ | yyparse. |
1190
+ `----------*/
1191
+
1192
+ #ifdef YYPARSE_PARAM
1193
+ #if (defined __STDC__ || defined __C99__FUNC__ \
1194
+ || defined __cplusplus || defined _MSC_VER)
1195
+ int
1196
+ yyparse (void *YYPARSE_PARAM)
1197
+ #else
1198
+ int
1199
+ yyparse (YYPARSE_PARAM)
1200
+ void *YYPARSE_PARAM;
1201
+ #endif
1202
+ #else /* ! YYPARSE_PARAM */
1203
+ #if (defined __STDC__ || defined __C99__FUNC__ \
1204
+ || defined __cplusplus || defined _MSC_VER)
1205
+ int
1206
+ yyparse (Node** node, yyscan_t scanner)
1207
+ #else
1208
+ int
1209
+ yyparse (node, scanner)
1210
+ Node** node;
1211
+ yyscan_t scanner;
1212
+ #endif
1213
+ #endif
1214
+ {
1215
+ /* The lookahead symbol. */
1216
+ int yychar;
1217
+
1218
+
1219
+ #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
1220
+ /* Suppress an incorrect diagnostic about yylval being uninitialized. */
1221
+ # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
1222
+ _Pragma ("GCC diagnostic push") \
1223
+ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
1224
+ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
1225
+ # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
1226
+ _Pragma ("GCC diagnostic pop")
1227
+ #else
1228
+ /* Default value used for initialization, for pacifying older GCCs
1229
+ or non-GCC compilers. */
1230
+ static YYSTYPE yyval_default;
1231
+ # define YY_INITIAL_VALUE(Value) = Value
1232
+ #endif
1233
+ static YYLTYPE yyloc_default
1234
+ # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1235
+ = { 1, 1, 1, 1 }
1236
+ # endif
1237
+ ;
1238
+ #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1239
+ # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1240
+ # define YY_IGNORE_MAYBE_UNINITIALIZED_END
1241
+ #endif
1242
+ #ifndef YY_INITIAL_VALUE
1243
+ # define YY_INITIAL_VALUE(Value) /* Nothing. */
1244
+ #endif
1245
+
1246
+ /* The semantic value of the lookahead symbol. */
1247
+ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);
1248
+
1249
+ /* Location data for the lookahead symbol. */
1250
+ YYLTYPE yylloc = yyloc_default;
1251
+
1252
+
1253
+ /* Number of syntax errors so far. */
1254
+ int yynerrs;
1255
+
1256
+ int yystate;
1257
+ /* Number of tokens to shift before error messages enabled. */
1258
+ int yyerrstatus;
1259
+
1260
+ /* The stacks and their tools:
1261
+ `yyss': related to states.
1262
+ `yyvs': related to semantic values.
1263
+ `yyls': related to locations.
1264
+
1265
+ Refer to the stacks through separate pointers, to allow yyoverflow
1266
+ to reallocate them elsewhere. */
1267
+
1268
+ /* The state stack. */
1269
+ yytype_int16 yyssa[YYINITDEPTH];
1270
+ yytype_int16 *yyss;
1271
+ yytype_int16 *yyssp;
1272
+
1273
+ /* The semantic value stack. */
1274
+ YYSTYPE yyvsa[YYINITDEPTH];
1275
+ YYSTYPE *yyvs;
1276
+ YYSTYPE *yyvsp;
1277
+
1278
+ /* The location stack. */
1279
+ YYLTYPE yylsa[YYINITDEPTH];
1280
+ YYLTYPE *yyls;
1281
+ YYLTYPE *yylsp;
1282
+
1283
+ /* The locations where the error started and ended. */
1284
+ YYLTYPE yyerror_range[3];
1285
+
1286
+ YYSIZE_T yystacksize;
1287
+
1288
+ int yyn;
1289
+ int yyresult;
1290
+ /* Lookahead token as an internal (translated) token number. */
1291
+ int yytoken = 0;
1292
+ /* The variables used to return semantic value and location from the
1293
+ action routines. */
1294
+ YYSTYPE yyval;
1295
+ YYLTYPE yyloc;
1296
+
1297
+ #if YYERROR_VERBOSE
1298
+ /* Buffer for error messages, and its allocated size. */
1299
+ char yymsgbuf[128];
1300
+ char *yymsg = yymsgbuf;
1301
+ YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1302
+ #endif
1303
+
1304
+ #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1305
+
1306
+ /* The number of symbols on the RHS of the reduced rule.
1307
+ Keep to zero when no symbol should be popped. */
1308
+ int yylen = 0;
1309
+
1310
+ yyssp = yyss = yyssa;
1311
+ yyvsp = yyvs = yyvsa;
1312
+ yylsp = yyls = yylsa;
1313
+ yystacksize = YYINITDEPTH;
1314
+
1315
+ YYDPRINTF ((stderr, "Starting parse\n"));
1316
+
1317
+ yystate = 0;
1318
+ yyerrstatus = 0;
1319
+ yynerrs = 0;
1320
+ yychar = YYEMPTY; /* Cause a token to be read. */
1321
+ yylsp[0] = yylloc;
1322
+ goto yysetstate;
1323
+
1324
+ /*------------------------------------------------------------.
1325
+ | yynewstate -- Push a new state, which is found in yystate. |
1326
+ `------------------------------------------------------------*/
1327
+ yynewstate:
1328
+ /* In all cases, when you get here, the value and location stacks
1329
+ have just been pushed. So pushing a state here evens the stacks. */
1330
+ yyssp++;
1331
+
1332
+ yysetstate:
1333
+ *yyssp = yystate;
1334
+
1335
+ if (yyss + yystacksize - 1 <= yyssp)
1336
+ {
1337
+ /* Get the current used size of the three stacks, in elements. */
1338
+ YYSIZE_T yysize = yyssp - yyss + 1;
1339
+
1340
+ #ifdef yyoverflow
1341
+ {
1342
+ /* Give user a chance to reallocate the stack. Use copies of
1343
+ these so that the &'s don't force the real ones into
1344
+ memory. */
1345
+ YYSTYPE *yyvs1 = yyvs;
1346
+ yytype_int16 *yyss1 = yyss;
1347
+ YYLTYPE *yyls1 = yyls;
1348
+
1349
+ /* Each stack pointer address is followed by the size of the
1350
+ data in use in that stack, in bytes. This used to be a
1351
+ conditional around just the two extra args, but that might
1352
+ be undefined if yyoverflow is a macro. */
1353
+ yyoverflow (YY_("memory exhausted"),
1354
+ &yyss1, yysize * sizeof (*yyssp),
1355
+ &yyvs1, yysize * sizeof (*yyvsp),
1356
+ &yyls1, yysize * sizeof (*yylsp),
1357
+ &yystacksize);
1358
+
1359
+ yyls = yyls1;
1360
+ yyss = yyss1;
1361
+ yyvs = yyvs1;
1362
+ }
1363
+ #else /* no yyoverflow */
1364
+ # ifndef YYSTACK_RELOCATE
1365
+ goto yyexhaustedlab;
1366
+ # else
1367
+ /* Extend the stack our own way. */
1368
+ if (YYMAXDEPTH <= yystacksize)
1369
+ goto yyexhaustedlab;
1370
+ yystacksize *= 2;
1371
+ if (YYMAXDEPTH < yystacksize)
1372
+ yystacksize = YYMAXDEPTH;
1373
+
1374
+ {
1375
+ yytype_int16 *yyss1 = yyss;
1376
+ union yyalloc *yyptr =
1377
+ (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1378
+ if (! yyptr)
1379
+ goto yyexhaustedlab;
1380
+ YYSTACK_RELOCATE (yyss_alloc, yyss);
1381
+ YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1382
+ YYSTACK_RELOCATE (yyls_alloc, yyls);
1383
+ # undef YYSTACK_RELOCATE
1384
+ if (yyss1 != yyssa)
1385
+ YYSTACK_FREE (yyss1);
1386
+ }
1387
+ # endif
1388
+ #endif /* no yyoverflow */
1389
+
1390
+ yyssp = yyss + yysize - 1;
1391
+ yyvsp = yyvs + yysize - 1;
1392
+ yylsp = yyls + yysize - 1;
1393
+
1394
+ YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1395
+ (unsigned long int) yystacksize));
1396
+
1397
+ if (yyss + yystacksize - 1 <= yyssp)
1398
+ YYABORT;
1399
+ }
1400
+
1401
+ YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1402
+
1403
+ if (yystate == YYFINAL)
1404
+ YYACCEPT;
1405
+
1406
+ goto yybackup;
1407
+
1408
+ /*-----------.
1409
+ | yybackup. |
1410
+ `-----------*/
1411
+ yybackup:
1412
+
1413
+ /* Do appropriate processing given the current state. Read a
1414
+ lookahead token if we need one and don't already have one. */
1415
+
1416
+ /* First try to decide what to do without reference to lookahead token. */
1417
+ yyn = yypact[yystate];
1418
+ if (yypact_value_is_default (yyn))
1419
+ goto yydefault;
1420
+
1421
+ /* Not known => get a lookahead token if don't already have one. */
1422
+
1423
+ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1424
+ if (yychar == YYEMPTY)
1425
+ {
1426
+ YYDPRINTF ((stderr, "Reading a token: "));
1427
+ yychar = YYLEX;
1428
+ }
1429
+
1430
+ if (yychar <= YYEOF)
1431
+ {
1432
+ yychar = yytoken = YYEOF;
1433
+ YYDPRINTF ((stderr, "Now at end of input.\n"));
1434
+ }
1435
+ else
1436
+ {
1437
+ yytoken = YYTRANSLATE (yychar);
1438
+ YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1439
+ }
1440
+
1441
+ /* If the proper action on seeing token YYTOKEN is to reduce or to
1442
+ detect an error, take that action. */
1443
+ yyn += yytoken;
1444
+ if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1445
+ goto yydefault;
1446
+ yyn = yytable[yyn];
1447
+ if (yyn <= 0)
1448
+ {
1449
+ if (yytable_value_is_error (yyn))
1450
+ goto yyerrlab;
1451
+ yyn = -yyn;
1452
+ goto yyreduce;
1453
+ }
1454
+
1455
+ /* Count tokens shifted since error; after three, turn off error
1456
+ status. */
1457
+ if (yyerrstatus)
1458
+ yyerrstatus--;
1459
+
1460
+ /* Shift the lookahead token. */
1461
+ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1462
+
1463
+ /* Discard the shifted token. */
1464
+ yychar = YYEMPTY;
1465
+
1466
+ yystate = yyn;
1467
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1468
+ *++yyvsp = yylval;
1469
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
1470
+ *++yylsp = yylloc;
1471
+ goto yynewstate;
1472
+
1473
+
1474
+ /*-----------------------------------------------------------.
1475
+ | yydefault -- do the default action for the current state. |
1476
+ `-----------------------------------------------------------*/
1477
+ yydefault:
1478
+ yyn = yydefact[yystate];
1479
+ if (yyn == 0)
1480
+ goto yyerrlab;
1481
+ goto yyreduce;
1482
+
1483
+
1484
+ /*-----------------------------.
1485
+ | yyreduce -- Do a reduction. |
1486
+ `-----------------------------*/
1487
+ yyreduce:
1488
+ /* yyn is the number of a rule to reduce with. */
1489
+ yylen = yyr2[yyn];
1490
+
1491
+ /* If YYLEN is nonzero, implement the default value of the action:
1492
+ `$$ = $1'.
1493
+
1494
+ Otherwise, the following line sets YYVAL to garbage.
1495
+ This behavior is undocumented and Bison
1496
+ users should not rely upon it. Assigning to YYVAL
1497
+ unconditionally makes the parser a bit smaller, and it avoids a
1498
+ GCC warning that YYVAL may be used uninitialized. */
1499
+ yyval = yyvsp[1-yylen];
1500
+
1501
+ /* Default location. */
1502
+ YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
1503
+ YY_REDUCE_PRINT (yyn);
1504
+ switch (yyn)
1505
+ {
1506
+ case 2:
1507
+ /* Line 1807 of yacc.c */
1508
+ #line 51 "parser.y"
1509
+ { *node = (yyvsp[(1) - (1)].node); }
1510
+ break;
1511
+
1512
+ case 3:
1513
+ /* Line 1807 of yacc.c */
1514
+ #line 55 "parser.y"
1515
+ { (yyval.node) = create_var((yyvsp[(1) - (1)].value)); }
1516
+ break;
1517
+
1518
+ case 4:
1519
+ /* Line 1807 of yacc.c */
1520
+ #line 56 "parser.y"
1521
+ { (yyval.node) = create_and((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); }
1522
+ break;
1523
+
1524
+ case 5:
1525
+ /* Line 1807 of yacc.c */
1526
+ #line 57 "parser.y"
1527
+ { (yyval.node) = create_or((yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node)); }
1528
+ break;
1529
+
1530
+ case 6:
1531
+ /* Line 1807 of yacc.c */
1532
+ #line 58 "parser.y"
1533
+ { (yyval.node) = create_not((yyvsp[(2) - (2)].node)); }
1534
+ break;
1535
+
1536
+ case 7:
1537
+ /* Line 1807 of yacc.c */
1538
+ #line 59 "parser.y"
1539
+ { (yyval.node) = (yyvsp[(2) - (3)].node); }
1540
+ break;
1541
+
1542
+
1543
+ /* Line 1807 of yacc.c */
1544
+ #line 1545 "parser.c"
1545
+ default: break;
1546
+ }
1547
+ /* User semantic actions sometimes alter yychar, and that requires
1548
+ that yytoken be updated with the new translation. We take the
1549
+ approach of translating immediately before every use of yytoken.
1550
+ One alternative is translating here after every semantic action,
1551
+ but that translation would be missed if the semantic action invokes
1552
+ YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1553
+ if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1554
+ incorrect destructor might then be invoked immediately. In the
1555
+ case of YYERROR or YYBACKUP, subsequent parser actions might lead
1556
+ to an incorrect destructor call or verbose syntax error message
1557
+ before the lookahead is translated. */
1558
+ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1559
+
1560
+ YYPOPSTACK (yylen);
1561
+ yylen = 0;
1562
+ YY_STACK_PRINT (yyss, yyssp);
1563
+
1564
+ *++yyvsp = yyval;
1565
+ *++yylsp = yyloc;
1566
+
1567
+ /* Now `shift' the result of the reduction. Determine what state
1568
+ that goes to, based on the state we popped back to and the rule
1569
+ number reduced by. */
1570
+
1571
+ yyn = yyr1[yyn];
1572
+
1573
+ yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1574
+ if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1575
+ yystate = yytable[yystate];
1576
+ else
1577
+ yystate = yydefgoto[yyn - YYNTOKENS];
1578
+
1579
+ goto yynewstate;
1580
+
1581
+
1582
+ /*------------------------------------.
1583
+ | yyerrlab -- here on detecting error |
1584
+ `------------------------------------*/
1585
+ yyerrlab:
1586
+ /* Make sure we have latest lookahead translation. See comments at
1587
+ user semantic actions for why this is necessary. */
1588
+ yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1589
+
1590
+ /* If not already recovering from an error, report this error. */
1591
+ if (!yyerrstatus)
1592
+ {
1593
+ ++yynerrs;
1594
+ #if ! YYERROR_VERBOSE
1595
+ yyerror (&yylloc, node, scanner, YY_("syntax error"));
1596
+ #else
1597
+ # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1598
+ yyssp, yytoken)
1599
+ {
1600
+ char const *yymsgp = YY_("syntax error");
1601
+ int yysyntax_error_status;
1602
+ yysyntax_error_status = YYSYNTAX_ERROR;
1603
+ if (yysyntax_error_status == 0)
1604
+ yymsgp = yymsg;
1605
+ else if (yysyntax_error_status == 1)
1606
+ {
1607
+ if (yymsg != yymsgbuf)
1608
+ YYSTACK_FREE (yymsg);
1609
+ yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1610
+ if (!yymsg)
1611
+ {
1612
+ yymsg = yymsgbuf;
1613
+ yymsg_alloc = sizeof yymsgbuf;
1614
+ yysyntax_error_status = 2;
1615
+ }
1616
+ else
1617
+ {
1618
+ yysyntax_error_status = YYSYNTAX_ERROR;
1619
+ yymsgp = yymsg;
1620
+ }
1621
+ }
1622
+ yyerror (&yylloc, node, scanner, yymsgp);
1623
+ if (yysyntax_error_status == 2)
1624
+ goto yyexhaustedlab;
1625
+ }
1626
+ # undef YYSYNTAX_ERROR
1627
+ #endif
1628
+ }
1629
+
1630
+ yyerror_range[1] = yylloc;
1631
+
1632
+ if (yyerrstatus == 3)
1633
+ {
1634
+ /* If just tried and failed to reuse lookahead token after an
1635
+ error, discard it. */
1636
+
1637
+ if (yychar <= YYEOF)
1638
+ {
1639
+ /* Return failure if at end of input. */
1640
+ if (yychar == YYEOF)
1641
+ YYABORT;
1642
+ }
1643
+ else
1644
+ {
1645
+ yydestruct ("Error: discarding",
1646
+ yytoken, &yylval, &yylloc, node, scanner);
1647
+ yychar = YYEMPTY;
1648
+ }
1649
+ }
1650
+
1651
+ /* Else will try to reuse lookahead token after shifting the error
1652
+ token. */
1653
+ goto yyerrlab1;
1654
+
1655
+
1656
+ /*---------------------------------------------------.
1657
+ | yyerrorlab -- error raised explicitly by YYERROR. |
1658
+ `---------------------------------------------------*/
1659
+ yyerrorlab:
1660
+
1661
+ /* Pacify compilers like GCC when the user code never invokes
1662
+ YYERROR and the label yyerrorlab therefore never appears in user
1663
+ code. */
1664
+ if (/*CONSTCOND*/ 0)
1665
+ goto yyerrorlab;
1666
+
1667
+ yyerror_range[1] = yylsp[1-yylen];
1668
+ /* Do not reclaim the symbols of the rule which action triggered
1669
+ this YYERROR. */
1670
+ YYPOPSTACK (yylen);
1671
+ yylen = 0;
1672
+ YY_STACK_PRINT (yyss, yyssp);
1673
+ yystate = *yyssp;
1674
+ goto yyerrlab1;
1675
+
1676
+
1677
+ /*-------------------------------------------------------------.
1678
+ | yyerrlab1 -- common code for both syntax error and YYERROR. |
1679
+ `-------------------------------------------------------------*/
1680
+ yyerrlab1:
1681
+ yyerrstatus = 3; /* Each real token shifted decrements this. */
1682
+
1683
+ for (;;)
1684
+ {
1685
+ yyn = yypact[yystate];
1686
+ if (!yypact_value_is_default (yyn))
1687
+ {
1688
+ yyn += YYTERROR;
1689
+ if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1690
+ {
1691
+ yyn = yytable[yyn];
1692
+ if (0 < yyn)
1693
+ break;
1694
+ }
1695
+ }
1696
+
1697
+ /* Pop the current state because it cannot handle the error token. */
1698
+ if (yyssp == yyss)
1699
+ YYABORT;
1700
+
1701
+ yyerror_range[1] = *yylsp;
1702
+ yydestruct ("Error: popping",
1703
+ yystos[yystate], yyvsp, yylsp, node, scanner);
1704
+ YYPOPSTACK (1);
1705
+ yystate = *yyssp;
1706
+ YY_STACK_PRINT (yyss, yyssp);
1707
+ }
1708
+
1709
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1710
+ *++yyvsp = yylval;
1711
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
1712
+
1713
+ yyerror_range[2] = yylloc;
1714
+ /* Using YYLLOC is tempting, but would change the location of
1715
+ the lookahead. YYLOC is available though. */
1716
+ YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
1717
+ *++yylsp = yyloc;
1718
+
1719
+ /* Shift the error token. */
1720
+ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1721
+
1722
+ yystate = yyn;
1723
+ goto yynewstate;
1724
+
1725
+
1726
+ /*-------------------------------------.
1727
+ | yyacceptlab -- YYACCEPT comes here. |
1728
+ `-------------------------------------*/
1729
+ yyacceptlab:
1730
+ yyresult = 0;
1731
+ goto yyreturn;
1732
+
1733
+ /*-----------------------------------.
1734
+ | yyabortlab -- YYABORT comes here. |
1735
+ `-----------------------------------*/
1736
+ yyabortlab:
1737
+ yyresult = 1;
1738
+ goto yyreturn;
1739
+
1740
+ #if !defined yyoverflow || YYERROR_VERBOSE
1741
+ /*-------------------------------------------------.
1742
+ | yyexhaustedlab -- memory exhaustion comes here. |
1743
+ `-------------------------------------------------*/
1744
+ yyexhaustedlab:
1745
+ yyerror (&yylloc, node, scanner, YY_("memory exhausted"));
1746
+ yyresult = 2;
1747
+ /* Fall through. */
1748
+ #endif
1749
+
1750
+ yyreturn:
1751
+ if (yychar != YYEMPTY)
1752
+ {
1753
+ /* Make sure we have latest lookahead translation. See comments at
1754
+ user semantic actions for why this is necessary. */
1755
+ yytoken = YYTRANSLATE (yychar);
1756
+ yydestruct ("Cleanup: discarding lookahead",
1757
+ yytoken, &yylval, &yylloc, node, scanner);
1758
+ }
1759
+ /* Do not reclaim the symbols of the rule which action triggered
1760
+ this YYABORT or YYACCEPT. */
1761
+ YYPOPSTACK (yylen);
1762
+ YY_STACK_PRINT (yyss, yyssp);
1763
+ while (yyssp != yyss)
1764
+ {
1765
+ yydestruct ("Cleanup: popping",
1766
+ yystos[*yyssp], yyvsp, yylsp, node, scanner);
1767
+ YYPOPSTACK (1);
1768
+ }
1769
+ #ifndef yyoverflow
1770
+ if (yyss != yyssa)
1771
+ YYSTACK_FREE (yyss);
1772
+ #endif
1773
+ #if YYERROR_VERBOSE
1774
+ if (yymsg != yymsgbuf)
1775
+ YYSTACK_FREE (yymsg);
1776
+ #endif
1777
+ /* Make sure YYID is used. */
1778
+ return YYID (yyresult);
1779
+ }
1780
+
1781
+
1782
+ /* Line 2055 of yacc.c */
1783
+ #line 62 "parser.y"
1784
+
1785
+