summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Williams <andy@andywilliams.me>2016-01-16 16:50:26 +0000
committerAndy Williams <andy@andywilliams.me>2016-01-16 16:50:26 +0000
commit07e9e8a092d9c0ba5cfb55f887315c2c21871653 (patch)
tree82feb65b2a8a635714f8bd7d2331a4b33f52b1a2
parent360560acc21f64a563b5db3e2325f7bae474ecdb (diff)
Fix warnings, update generated parser
-rw-r--r--src/calc.h1
-rw-r--r--src/calc.y3
-rw-r--r--src/calc_lex.c1523
-rw-r--r--src/calc_parse.c1558
4 files changed, 1812 insertions, 1273 deletions
diff --git a/src/calc.h b/src/calc.h
index e0ff6a6..0af482f 100644
--- a/src/calc.h
+++ b/src/calc.h
@@ -10,6 +10,7 @@ double equate_eval(void);
10const char *equate_string_get(void); 10const char *equate_string_get(void);
11Eina_Bool equate_ok(void); 11Eina_Bool equate_ok(void);
12 12
13void math_init(void);
13 14
14/* Fonctions type. */ 15/* Fonctions type. */
15typedef double (*func_t) (double); 16typedef double (*func_t) (double);
diff --git a/src/calc.y b/src/calc.y
index d025726..5460618 100644
--- a/src/calc.y
+++ b/src/calc.y
@@ -1,11 +1,14 @@
1%{ 1%{
2#include <math.h> /* For math functions, cos(), sin(), etc. */ 2#include <math.h> /* For math functions, cos(), sin(), etc. */
3#include "calc.h"
3#include "Equate.h" 4#include "Equate.h"
4 5
5#define YYERROR_VERBOSE 6#define YYERROR_VERBOSE
6 7
7void 8void
8yyerror (const char *s); 9yyerror (const char *s);
10int
11yylex();
9 12
10double _result; 13double _result;
11char tmp[BUFLEN]; 14char tmp[BUFLEN];
diff --git a/src/calc_lex.c b/src/calc_lex.c
index 0f5c2f7..4722c69 100644
--- a/src/calc_lex.c
+++ b/src/calc_lex.c
@@ -1,68 +1,114 @@
1#line 2 "calc_lex.c" 1#line 2 "calc_lex.c"
2/* A lexical scanner generated by flex */
3 2
4/* Scanner skeleton version: 3#line 4 "calc_lex.c"
5 * $Header$ 4
6 */ 5#define YY_INT_ALIGNED short int
6
7/* A lexical scanner generated by flex */
7 8
8#define FLEX_SCANNER 9#define FLEX_SCANNER
9#define YY_FLEX_MAJOR_VERSION 2 10#define YY_FLEX_MAJOR_VERSION 2
10#define YY_FLEX_MINOR_VERSION 5 11#define YY_FLEX_MINOR_VERSION 6
12#define YY_FLEX_SUBMINOR_VERSION 0
13#if YY_FLEX_SUBMINOR_VERSION > 0
14#define FLEX_BETA
15#endif
11 16
17/* First, we deal with platform-specific or compiler-specific issues. */
18
19/* begin standard C headers. */
12#include <stdio.h> 20#include <stdio.h>
13#include <unistd.h> 21#include <string.h>
22#include <errno.h>
23#include <stdlib.h>
14 24
25/* end standard C headers. */
15 26
16/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ 27/* flex integer type definitions */
17#ifdef c_plusplus 28
18#ifndef __cplusplus 29#ifndef FLEXINT_H
19#define __cplusplus 30#define FLEXINT_H
20#endif 31
32/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
33
34#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
35
36/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
37 * if you want the limit (max/min) macros for int types.
38 */
39#ifndef __STDC_LIMIT_MACROS
40#define __STDC_LIMIT_MACROS 1
21#endif 41#endif
22 42
43#include <inttypes.h>
44typedef int8_t flex_int8_t;
45typedef uint8_t flex_uint8_t;
46typedef int16_t flex_int16_t;
47typedef uint16_t flex_uint16_t;
48typedef int32_t flex_int32_t;
49typedef uint32_t flex_uint32_t;
50#else
51typedef signed char flex_int8_t;
52typedef short int flex_int16_t;
53typedef int flex_int32_t;
54typedef unsigned char flex_uint8_t;
55typedef unsigned short int flex_uint16_t;
56typedef unsigned int flex_uint32_t;
57
58/* Limits of integral types. */
59#ifndef INT8_MIN
60#define INT8_MIN (-128)
61#endif
62#ifndef INT16_MIN
63#define INT16_MIN (-32767-1)
64#endif
65#ifndef INT32_MIN
66#define INT32_MIN (-2147483647-1)
67#endif
68#ifndef INT8_MAX
69#define INT8_MAX (127)
70#endif
71#ifndef INT16_MAX
72#define INT16_MAX (32767)
73#endif
74#ifndef INT32_MAX
75#define INT32_MAX (2147483647)
76#endif
77#ifndef UINT8_MAX
78#define UINT8_MAX (255U)
79#endif
80#ifndef UINT16_MAX
81#define UINT16_MAX (65535U)
82#endif
83#ifndef UINT32_MAX
84#define UINT32_MAX (4294967295U)
85#endif
23 86
24#ifdef __cplusplus 87#endif /* ! C99 */
25 88
26#include <stdlib.h> 89#endif /* ! FLEXINT_H */
27 90
28/* Use prototypes in function declarations. */ 91#ifdef __cplusplus
29#define YY_USE_PROTOS
30 92
31/* The "const" storage-class-modifier is valid. */ 93/* The "const" storage-class-modifier is valid. */
32#define YY_USE_CONST 94#define YY_USE_CONST
33 95
34#else /* ! __cplusplus */ 96#else /* ! __cplusplus */
35 97
36#if __STDC__ 98/* C99 requires __STDC__ to be defined as 1. */
99#if defined (__STDC__)
37 100
38#define YY_USE_PROTOS
39#define YY_USE_CONST 101#define YY_USE_CONST
40 102
41#endif /* __STDC__ */ 103#endif /* defined (__STDC__) */
42#endif /* ! __cplusplus */ 104#endif /* ! __cplusplus */
43 105
44#ifdef __TURBOC__
45 #pragma warn -rch
46 #pragma warn -use
47#include <io.h>
48#include <stdlib.h>
49#define YY_USE_CONST
50#define YY_USE_PROTOS
51#endif
52
53#ifdef YY_USE_CONST 106#ifdef YY_USE_CONST
54#define yyconst const 107#define yyconst const
55#else 108#else
56#define yyconst 109#define yyconst
57#endif 110#endif
58 111
59
60#ifdef YY_USE_PROTOS
61#define YY_PROTO(proto) proto
62#else
63#define YY_PROTO(proto) ()
64#endif
65
66/* Returned upon end-of-file. */ 112/* Returned upon end-of-file. */
67#define YY_NULL 0 113#define YY_NULL 0
68 114
@@ -77,71 +123,79 @@
77 * but we do it the disgusting crufty way forced on us by the ()-less 123 * but we do it the disgusting crufty way forced on us by the ()-less
78 * definition of BEGIN. 124 * definition of BEGIN.
79 */ 125 */
80#define BEGIN yy_start = 1 + 2 * 126#define BEGIN (yy_start) = 1 + 2 *
81 127
82/* Translate the current start state into a value that can be later handed 128/* Translate the current start state into a value that can be later handed
83 * to BEGIN to return to the state. The YYSTATE alias is for lex 129 * to BEGIN to return to the state. The YYSTATE alias is for lex
84 * compatibility. 130 * compatibility.
85 */ 131 */
86#define YY_START ((yy_start - 1) / 2) 132#define YY_START (((yy_start) - 1) / 2)
87#define YYSTATE YY_START 133#define YYSTATE YY_START
88 134
89/* Action number for EOF rule of a given start state. */ 135/* Action number for EOF rule of a given start state. */
90#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) 136#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
91 137
92/* Special action meaning "start processing a new file". */ 138/* Special action meaning "start processing a new file". */
93#define YY_NEW_FILE yyrestart( yyin ) 139#define YY_NEW_FILE yyrestart(yyin )
94 140
95#define YY_END_OF_BUFFER_CHAR 0 141#define YY_END_OF_BUFFER_CHAR 0
96 142
97/* Size of default input buffer. */ 143/* Size of default input buffer. */
144#ifndef YY_BUF_SIZE
145#ifdef __ia64__
146/* On IA-64, the buffer size is 16k, not 8k.
147 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
148 * Ditto for the __ia64__ case accordingly.
149 */
150#define YY_BUF_SIZE 32768
151#else
98#define YY_BUF_SIZE 16384 152#define YY_BUF_SIZE 16384
153#endif /* __ia64__ */
154#endif
99 155
156/* The state buf must be large enough to hold one state per character in the main buffer.
157 */
158#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
159
160#ifndef YY_TYPEDEF_YY_BUFFER_STATE
161#define YY_TYPEDEF_YY_BUFFER_STATE
100typedef struct yy_buffer_state *YY_BUFFER_STATE; 162typedef struct yy_buffer_state *YY_BUFFER_STATE;
163#endif
164
165#ifndef YY_TYPEDEF_YY_SIZE_T
166#define YY_TYPEDEF_YY_SIZE_T
167typedef size_t yy_size_t;
168#endif
169
170extern yy_size_t yyleng;
101 171
102extern int yyleng;
103extern FILE *yyin, *yyout; 172extern FILE *yyin, *yyout;
104 173
105#define EOB_ACT_CONTINUE_SCAN 0 174#define EOB_ACT_CONTINUE_SCAN 0
106#define EOB_ACT_END_OF_FILE 1 175#define EOB_ACT_END_OF_FILE 1
107#define EOB_ACT_LAST_MATCH 2 176#define EOB_ACT_LAST_MATCH 2
108 177
109/* The funky do-while in the following #define is used to turn the definition 178 #define YY_LESS_LINENO(n)
110 * int a single C statement (which needs a semi-colon terminator). This 179 #define YY_LINENO_REWIND_TO(ptr)
111 * avoids problems with code like: 180
112 * 181/* Return all but the first "n" matched characters back to the input stream. */
113 * if ( condition_holds )
114 * yyless( 5 );
115 * else
116 * do_something_else();
117 *
118 * Prior to using the do-while the compiler would get upset at the
119 * "else" because it interpreted the "if" statement as being all
120 * done when it reached the ';' after the yyless() call.
121 */
122
123/* Return all but the first 'n' matched characters back to the input stream. */
124
125#define yyless(n) \ 182#define yyless(n) \
126 do \ 183 do \
127 { \ 184 { \
128 /* Undo effects of setting up yytext. */ \ 185 /* Undo effects of setting up yytext. */ \
129 *yy_cp = yy_hold_char; \ 186 int yyless_macro_arg = (n); \
187 YY_LESS_LINENO(yyless_macro_arg);\
188 *yy_cp = (yy_hold_char); \
130 YY_RESTORE_YY_MORE_OFFSET \ 189 YY_RESTORE_YY_MORE_OFFSET \
131 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ 190 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
132 YY_DO_BEFORE_ACTION; /* set up yytext again */ \ 191 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
133 } \ 192 } \
134 while ( 0 ) 193 while ( 0 )
135 194
136#define unput(c) yyunput( c, yytext_ptr ) 195#define unput(c) yyunput( c, (yytext_ptr) )
137
138/* The following is because we cannot portably get our hands on size_t
139 * (without autoconf's help, which isn't available because we want
140 * flex-generated scanners to compile on their own).
141 */
142typedef unsigned int yy_size_t;
143
144 196
197#ifndef YY_STRUCT_YY_BUFFER_STATE
198#define YY_STRUCT_YY_BUFFER_STATE
145struct yy_buffer_state 199struct yy_buffer_state
146 { 200 {
147 FILE *yy_input_file; 201 FILE *yy_input_file;
@@ -157,7 +211,7 @@ struct yy_buffer_state
157 /* Number of characters read into yy_ch_buf, not including EOB 211 /* Number of characters read into yy_ch_buf, not including EOB
158 * characters. 212 * characters.
159 */ 213 */
160 int yy_n_chars; 214 yy_size_t yy_n_chars;
161 215
162 /* Whether we "own" the buffer - i.e., we know we created it, 216 /* Whether we "own" the buffer - i.e., we know we created it,
163 * and can realloc() it to grow it, and should free() it to 217 * and can realloc() it to grow it, and should free() it to
@@ -178,12 +232,16 @@ struct yy_buffer_state
178 */ 232 */
179 int yy_at_bol; 233 int yy_at_bol;
180 234
235 int yy_bs_lineno; /**< The line count. */
236 int yy_bs_column; /**< The column count. */
237
181 /* Whether to try to fill the input buffer when we reach the 238 /* Whether to try to fill the input buffer when we reach the
182 * end of it. 239 * end of it.
183 */ 240 */
184 int yy_fill_buffer; 241 int yy_fill_buffer;
185 242
186 int yy_buffer_status; 243 int yy_buffer_status;
244
187#define YY_BUFFER_NEW 0 245#define YY_BUFFER_NEW 0
188#define YY_BUFFER_NORMAL 1 246#define YY_BUFFER_NORMAL 1
189 /* When an EOF's been seen but there's still some text to process 247 /* When an EOF's been seen but there's still some text to process
@@ -197,28 +255,38 @@ struct yy_buffer_state
197 * just pointing yyin at a new input file. 255 * just pointing yyin at a new input file.
198 */ 256 */
199#define YY_BUFFER_EOF_PENDING 2 257#define YY_BUFFER_EOF_PENDING 2
258
200 }; 259 };
260#endif /* !YY_STRUCT_YY_BUFFER_STATE */
201 261
202static YY_BUFFER_STATE yy_current_buffer = 0; 262/* Stack of input buffers. */
263static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
264static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
265static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
203 266
204/* We provide macros for accessing buffer states in case in the 267/* We provide macros for accessing buffer states in case in the
205 * future we want to put the buffer states in a more general 268 * future we want to put the buffer states in a more general
206 * "scanner state". 269 * "scanner state".
270 *
271 * Returns the top of the stack, or NULL.
207 */ 272 */
208#define YY_CURRENT_BUFFER yy_current_buffer 273#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
274 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
275 : NULL)
209 276
277/* Same as previous macro, but useful when we know that the buffer stack is not
278 * NULL or when we need an lvalue. For internal use only.
279 */
280#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
210 281
211/* yy_hold_char holds the character lost when yytext is formed. */ 282/* yy_hold_char holds the character lost when yytext is formed. */
212static char yy_hold_char; 283static char yy_hold_char;
213 284static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
214static int yy_n_chars; /* number of characters read into yy_ch_buf */ 285yy_size_t yyleng;
215
216
217int yyleng;
218 286
219/* Points to current character in buffer. */ 287/* Points to current character in buffer. */
220static char *yy_c_buf_p = (char *) 0; 288static char *yy_c_buf_p = (char *) 0;
221static int yy_init = 1; /* whether we need to initialize */ 289static int yy_init = 0; /* whether we need to initialize */
222static int yy_start = 0; /* start state number */ 290static int yy_start = 0; /* start state number */
223 291
224/* Flag which is used to allow yywrap()'s to do buffer switches 292/* Flag which is used to allow yywrap()'s to do buffer switches
@@ -226,75 +294,107 @@ static int yy_start = 0; /* start state number */
226 */ 294 */
227static int yy_did_buffer_switch_on_eof; 295static int yy_did_buffer_switch_on_eof;
228 296
229void yyrestart YY_PROTO(( FILE *input_file )); 297void yyrestart (FILE *input_file );
298void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
299YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
300void yy_delete_buffer (YY_BUFFER_STATE b );
301void yy_flush_buffer (YY_BUFFER_STATE b );
302void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
303void yypop_buffer_state (void );
230 304
231void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); 305static void yyensure_buffer_stack (void );
232void yy_load_buffer_state YY_PROTO(( void )); 306static void yy_load_buffer_state (void );
233YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); 307static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
234void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
235void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
236void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
237#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
238 308
239YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); 309#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
240YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
241YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
242 310
243static void *yy_flex_alloc YY_PROTO(( yy_size_t )); 311YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
244static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); 312YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
245static void yy_flex_free YY_PROTO(( void * )); 313YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len );
314
315void *yyalloc (yy_size_t );
316void *yyrealloc (void *,yy_size_t );
317void yyfree (void * );
246 318
247#define yy_new_buffer yy_create_buffer 319#define yy_new_buffer yy_create_buffer
248 320
249#define yy_set_interactive(is_interactive) \ 321#define yy_set_interactive(is_interactive) \
250 { \ 322 { \
251 if ( ! yy_current_buffer ) \ 323 if ( ! YY_CURRENT_BUFFER ){ \
252 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ 324 yyensure_buffer_stack (); \
253 yy_current_buffer->yy_is_interactive = is_interactive; \ 325 YY_CURRENT_BUFFER_LVALUE = \
326 yy_create_buffer(yyin,YY_BUF_SIZE ); \
327 } \
328 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
254 } 329 }
255 330
256#define yy_set_bol(at_bol) \ 331#define yy_set_bol(at_bol) \
257 { \ 332 { \
258 if ( ! yy_current_buffer ) \ 333 if ( ! YY_CURRENT_BUFFER ){\
259 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ 334 yyensure_buffer_stack (); \
260 yy_current_buffer->yy_at_bol = at_bol; \ 335 YY_CURRENT_BUFFER_LVALUE = \
336 yy_create_buffer(yyin,YY_BUF_SIZE ); \
337 } \
338 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
261 } 339 }
262 340
263#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) 341#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
264 342
343/* Begin user sect3 */
265 344
266#define yywrap() 1 345#define yywrap() (/*CONSTCOND*/1)
267#define YY_SKIP_YYWRAP 346#define YY_SKIP_YYWRAP
347
268typedef unsigned char YY_CHAR; 348typedef unsigned char YY_CHAR;
349
269FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; 350FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
351
270typedef int yy_state_type; 352typedef int yy_state_type;
353
354extern int yylineno;
355
356int yylineno = 1;
357
271extern char *yytext; 358extern char *yytext;
359#ifdef yytext_ptr
360#undef yytext_ptr
361#endif
272#define yytext_ptr yytext 362#define yytext_ptr yytext
273 363
274static yy_state_type yy_get_previous_state YY_PROTO(( void )); 364static yy_state_type yy_get_previous_state (void );
275static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); 365static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
276static int yy_get_next_buffer YY_PROTO(( void )); 366static int yy_get_next_buffer (void );
277static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); 367#if defined(__GNUC__) && __GNUC__ >= 3
368__attribute__((__noreturn__))
369#endif
370static void yy_fatal_error (yyconst char msg[] );
278 371
279/* Done after the current pattern has been matched and before the 372/* Done after the current pattern has been matched and before the
280 * corresponding action - sets up yytext. 373 * corresponding action - sets up yytext.
281 */ 374 */
282#define YY_DO_BEFORE_ACTION \ 375#define YY_DO_BEFORE_ACTION \
283 yytext_ptr = yy_bp; \ 376 (yytext_ptr) = yy_bp; \
284 yyleng = (int) (yy_cp - yy_bp); \ 377 yyleng = (size_t) (yy_cp - yy_bp); \
285 yy_hold_char = *yy_cp; \ 378 (yy_hold_char) = *yy_cp; \
286 *yy_cp = '\0'; \ 379 *yy_cp = '\0'; \
287 yy_c_buf_p = yy_cp; 380 (yy_c_buf_p) = yy_cp;
288 381
289#define YY_NUM_RULES 10 382#define YY_NUM_RULES 10
290#define YY_END_OF_BUFFER 11 383#define YY_END_OF_BUFFER 11
291static yyconst short int yy_accept[20] = 384/* This struct is not used in this scanner,
385 but its presence is necessary. */
386struct yy_trans_info
387 {
388 flex_int32_t yy_verify;
389 flex_int32_t yy_nxt;
390 };
391static yyconst flex_int16_t yy_accept[20] =
292 { 0, 392 { 0,
293 0, 0, 11, 9, 8, 8, 6, 7, 5, 9, 393 0, 0, 11, 9, 8, 8, 6, 7, 5, 9,
294 1, 4, 8, 3, 2, 1, 4, 2, 0 394 1, 4, 8, 3, 2, 1, 4, 2, 0
295 } ; 395 } ;
296 396
297static yyconst int yy_ec[256] = 397static yyconst YY_CHAR yy_ec[256] =
298 { 0, 398 { 0,
299 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 399 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
300 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 400 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -326,25 +426,25 @@ static yyconst int yy_ec[256] =
326 1, 1, 1, 1, 1 426 1, 1, 1, 1, 1
327 } ; 427 } ;
328 428
329static yyconst int yy_meta[15] = 429static yyconst YY_CHAR yy_meta[15] =
330 { 0, 430 { 0,
331 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 431 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
332 1, 1, 1, 1 432 1, 1, 1, 1
333 } ; 433 } ;
334 434
335static yyconst short int yy_base[20] = 435static yyconst flex_uint16_t yy_base[20] =
336 { 0, 436 { 0,
337 0, 0, 33, 34, 13, 15, 34, 34, 34, 21, 437 0, 0, 33, 34, 13, 15, 34, 34, 34, 21,
338 10, 9, 22, 20, 18, 17, 16, 11, 34 438 10, 9, 22, 20, 18, 17, 16, 11, 34
339 } ; 439 } ;
340 440
341static yyconst short int yy_def[20] = 441static yyconst flex_int16_t yy_def[20] =
342 { 0, 442 { 0,
343 19, 1, 19, 19, 19, 19, 19, 19, 19, 19, 443 19, 1, 19, 19, 19, 19, 19, 19, 19, 19,
344 19, 19, 19, 19, 19, 19, 19, 19, 0 444 19, 19, 19, 19, 19, 19, 19, 19, 0
345 } ; 445 } ;
346 446
347static yyconst short int yy_nxt[49] = 447static yyconst flex_uint16_t yy_nxt[49] =
348 { 0, 448 { 0,
349 4, 5, 6, 7, 8, 9, 9, 9, 10, 9, 449 4, 5, 6, 7, 8, 9, 9, 9, 10, 9,
350 11, 9, 9, 12, 13, 13, 13, 13, 15, 17, 450 11, 9, 9, 12, 13, 13, 13, 13, 15, 17,
@@ -353,7 +453,7 @@ static yyconst short int yy_nxt[49] =
353 19, 19, 19, 19, 19, 19, 19, 19 453 19, 19, 19, 19, 19, 19, 19, 19
354 } ; 454 } ;
355 455
356static yyconst short int yy_chk[49] = 456static yyconst flex_int16_t yy_chk[49] =
357 { 0, 457 { 0,
358 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 458 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
359 1, 1, 1, 1, 5, 5, 6, 6, 11, 12, 459 1, 1, 1, 1, 5, 5, 6, 6, 11, 12,
@@ -365,6 +465,9 @@ static yyconst short int yy_chk[49] =
365static yy_state_type yy_last_accepting_state; 465static yy_state_type yy_last_accepting_state;
366static char *yy_last_accepting_cpos; 466static char *yy_last_accepting_cpos;
367 467
468extern int yy_flex_debug;
469int yy_flex_debug = 0;
470
368/* The intent behind this definition is that it'll catch 471/* The intent behind this definition is that it'll catch
369 * any uses of REJECT which flex missed. 472 * any uses of REJECT which flex missed.
370 */ 473 */
@@ -374,13 +477,58 @@ static char *yy_last_accepting_cpos;
374#define YY_RESTORE_YY_MORE_OFFSET 477#define YY_RESTORE_YY_MORE_OFFSET
375char *yytext; 478char *yytext;
376#line 1 "calc.l" 479#line 1 "calc.l"
377#define INITIAL 0
378/* scanner for a toy Pascal-like language */ 480/* scanner for a toy Pascal-like language */
379#line 4 "calc.l" 481#line 4 "calc.l"
380/* need this for the call to atof() below */ 482/* need this for the call to atof() below */
381#include <math.h> 483#include <math.h>
484#include "calc.h"
485
486#line 487 "calc_lex.c"
487
488#define INITIAL 0
489
490#ifndef YY_NO_UNISTD_H
491/* Special case for "unistd.h", since it is non-ANSI. We include it way
492 * down here because we want the user's section 1 to have been scanned first.
493 * The user has a chance to override it with an option.
494 */
495#include <unistd.h>
496#endif
497
498#ifndef YY_EXTRA_TYPE
499#define YY_EXTRA_TYPE void *
500#endif
501
502static int yy_init_globals (void );
503
504/* Accessor methods to globals.
505 These are made visible to non-reentrant scanners for convenience. */
506
507int yylex_destroy (void );
508
509int yyget_debug (void );
510
511void yyset_debug (int debug_flag );
512
513YY_EXTRA_TYPE yyget_extra (void );
514
515void yyset_extra (YY_EXTRA_TYPE user_defined );
516
517FILE *yyget_in (void );
518
519void yyset_in (FILE * _in_str );
520
521FILE *yyget_out (void );
522
523void yyset_out (FILE * _out_str );
524
525yy_size_t yyget_leng (void );
526
527char *yyget_text (void );
528
529int yyget_lineno (void );
382 530
383#line 384 "calc_lex.c" 531void yyset_lineno (int _line_number );
384 532
385/* Macros after this point can all be overridden by user definitions in 533/* Macros after this point can all be overridden by user definitions in
386 * section 1. 534 * section 1.
@@ -388,79 +536,52 @@ char *yytext;
388 536
389#ifndef YY_SKIP_YYWRAP 537#ifndef YY_SKIP_YYWRAP
390#ifdef __cplusplus 538#ifdef __cplusplus
391extern "C" int yywrap YY_PROTO(( void )); 539extern "C" int yywrap (void );
392#else 540#else
393extern int yywrap YY_PROTO(( void )); 541extern int yywrap (void );
394#endif 542#endif
395#endif 543#endif
396 544
397#ifndef YY_NO_UNPUT 545#ifndef YY_NO_UNPUT
398static void yyunput YY_PROTO(( int c, char *buf_ptr )); 546
547 static void yyunput (int c,char *buf_ptr );
548
399#endif 549#endif
400 550
401#ifndef yytext_ptr 551#ifndef yytext_ptr
402static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); 552static void yy_flex_strncpy (char *,yyconst char *,int );
403#endif 553#endif
404 554
405#ifdef YY_NEED_STRLEN 555#ifdef YY_NEED_STRLEN
406static int yy_flex_strlen YY_PROTO(( yyconst char * )); 556static int yy_flex_strlen (yyconst char * );
407#endif 557#endif
408 558
409#ifndef YY_NO_INPUT 559#ifndef YY_NO_INPUT
410#ifdef __cplusplus
411static int yyinput YY_PROTO(( void ));
412#else
413static int input YY_PROTO(( void ));
414#endif
415#endif
416
417#if YY_STACK_USED
418static int yy_start_stack_ptr = 0;
419static int yy_start_stack_depth = 0;
420static int *yy_start_stack = 0;
421#ifndef YY_NO_PUSH_STATE
422static void yy_push_state YY_PROTO(( int new_state ));
423#endif
424#ifndef YY_NO_POP_STATE
425static void yy_pop_state YY_PROTO(( void ));
426#endif
427#ifndef YY_NO_TOP_STATE
428static int yy_top_state YY_PROTO(( void ));
429#endif
430 560
561#ifdef __cplusplus
562static int yyinput (void );
431#else 563#else
432#define YY_NO_PUSH_STATE 1 564static int input (void );
433#define YY_NO_POP_STATE 1
434#define YY_NO_TOP_STATE 1
435#endif 565#endif
436 566
437#ifdef YY_MALLOC_DECL
438YY_MALLOC_DECL
439#else
440#if __STDC__
441#ifndef __cplusplus
442#include <stdlib.h>
443#endif
444#else
445/* Just try to get by without declaring the routines. This will fail
446 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
447 * or sizeof(void*) != sizeof(int).
448 */
449#endif
450#endif 567#endif
451 568
452/* Amount of stuff to slurp up with each read. */ 569/* Amount of stuff to slurp up with each read. */
453#ifndef YY_READ_BUF_SIZE 570#ifndef YY_READ_BUF_SIZE
571#ifdef __ia64__
572/* On IA-64, the buffer size is 16k, not 8k */
573#define YY_READ_BUF_SIZE 16384
574#else
454#define YY_READ_BUF_SIZE 8192 575#define YY_READ_BUF_SIZE 8192
576#endif /* __ia64__ */
455#endif 577#endif
456 578
457/* Copy whatever the last rule matched to the standard output. */ 579/* Copy whatever the last rule matched to the standard output. */
458
459#ifndef ECHO 580#ifndef ECHO
460/* This used to be an fputs(), but since the string might contain NUL's, 581/* This used to be an fputs(), but since the string might contain NUL's,
461 * we now use fwrite(). 582 * we now use fwrite().
462 */ 583 */
463#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) 584#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
464#endif 585#endif
465 586
466/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, 587/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
@@ -468,9 +589,10 @@ YY_MALLOC_DECL
468 */ 589 */
469#ifndef YY_INPUT 590#ifndef YY_INPUT
470#define YY_INPUT(buf,result,max_size) \ 591#define YY_INPUT(buf,result,max_size) \
471 if ( yy_current_buffer->yy_is_interactive ) \ 592 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
472 { \ 593 { \
473 int c = '*', n; \ 594 int c = '*'; \
595 size_t n; \
474 for ( n = 0; n < max_size && \ 596 for ( n = 0; n < max_size && \
475 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ 597 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
476 buf[n] = (char) c; \ 598 buf[n] = (char) c; \
@@ -480,9 +602,22 @@ YY_MALLOC_DECL
480 YY_FATAL_ERROR( "input in flex scanner failed" ); \ 602 YY_FATAL_ERROR( "input in flex scanner failed" ); \
481 result = n; \ 603 result = n; \
482 } \ 604 } \
483 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ 605 else \
484 && ferror( yyin ) ) \ 606 { \
485 YY_FATAL_ERROR( "input in flex scanner failed" ); 607 errno=0; \
608 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
609 { \
610 if( errno != EINTR) \
611 { \
612 YY_FATAL_ERROR( "input in flex scanner failed" ); \
613 break; \
614 } \
615 errno=0; \
616 clearerr(yyin); \
617 } \
618 }\
619\
620
486#endif 621#endif
487 622
488/* No semi-colon after return; correct usage is to write "yyterminate();" - 623/* No semi-colon after return; correct usage is to write "yyterminate();" -
@@ -503,12 +638,18 @@ YY_MALLOC_DECL
503#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) 638#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
504#endif 639#endif
505 640
641/* end tables serialization structures and prototypes */
642
506/* Default declaration of generated scanner - a define so the user can 643/* Default declaration of generated scanner - a define so the user can
507 * easily add parameters. 644 * easily add parameters.
508 */ 645 */
509#ifndef YY_DECL 646#ifndef YY_DECL
510#define YY_DECL int yylex YY_PROTO(( void )) 647#define YY_DECL_IS_OURS 1
511#endif 648
649extern int yylex (void);
650
651#define YY_DECL int yylex (void)
652#endif /* !YY_DECL */
512 653
513/* Code executed at the beginning of each rule, after yytext and yyleng 654/* Code executed at the beginning of each rule, after yytext and yyleng
514 * have been set up. 655 * have been set up.
@@ -519,33 +660,30 @@ YY_MALLOC_DECL
519 660
520/* Code executed at the end of each rule. */ 661/* Code executed at the end of each rule. */
521#ifndef YY_BREAK 662#ifndef YY_BREAK
522#define YY_BREAK break; 663#define YY_BREAK /*LINTED*/break;
523#endif 664#endif
524 665
525#define YY_RULE_SETUP \ 666#define YY_RULE_SETUP \
526 YY_USER_ACTION 667 YY_USER_ACTION
527 668
669/** The main scanner function which does all the work.
670 */
528YY_DECL 671YY_DECL
529 { 672{
530 register yy_state_type yy_current_state; 673 yy_state_type yy_current_state;
531 register char *yy_cp = NULL, *yy_bp = NULL; 674 char *yy_cp, *yy_bp;
532 register int yy_act; 675 int yy_act;
533 676
534#line 14 "calc.l" 677 if ( !(yy_init) )
535
536
537#line 538 "calc_lex.c"
538
539 if ( yy_init )
540 { 678 {
541 yy_init = 0; 679 (yy_init) = 1;
542 680
543#ifdef YY_USER_INIT 681#ifdef YY_USER_INIT
544 YY_USER_INIT; 682 YY_USER_INIT;
545#endif 683#endif
546 684
547 if ( ! yy_start ) 685 if ( ! (yy_start) )
548 yy_start = 1; /* first start state */ 686 (yy_start) = 1; /* first start state */
549 687
550 if ( ! yyin ) 688 if ( ! yyin )
551 yyin = stdin; 689 yyin = stdin;
@@ -553,34 +691,42 @@ YY_DECL
553 if ( ! yyout ) 691 if ( ! yyout )
554 yyout = stdout; 692 yyout = stdout;
555 693
556 if ( ! yy_current_buffer ) 694 if ( ! YY_CURRENT_BUFFER ) {
557 yy_current_buffer = 695 yyensure_buffer_stack ();
558 yy_create_buffer( yyin, YY_BUF_SIZE ); 696 YY_CURRENT_BUFFER_LVALUE =
697 yy_create_buffer(yyin,YY_BUF_SIZE );
698 }
559 699
560 yy_load_buffer_state(); 700 yy_load_buffer_state( );
561 } 701 }
562 702
563 while ( 1 ) /* loops until end-of-file is reached */ 703 {
704#line 15 "calc.l"
705
706
707#line 708 "calc_lex.c"
708
709 while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
564 { 710 {
565 yy_cp = yy_c_buf_p; 711 yy_cp = (yy_c_buf_p);
566 712
567 /* Support of yytext. */ 713 /* Support of yytext. */
568 *yy_cp = yy_hold_char; 714 *yy_cp = (yy_hold_char);
569 715
570 /* yy_bp points to the position in yy_ch_buf of the start of 716 /* yy_bp points to the position in yy_ch_buf of the start of
571 * the current run. 717 * the current run.
572 */ 718 */
573 yy_bp = yy_cp; 719 yy_bp = yy_cp;
574 720
575 yy_current_state = yy_start; 721 yy_current_state = (yy_start);
576yy_match: 722yy_match:
577 do 723 do
578 { 724 {
579 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; 725 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
580 if ( yy_accept[yy_current_state] ) 726 if ( yy_accept[yy_current_state] )
581 { 727 {
582 yy_last_accepting_state = yy_current_state; 728 (yy_last_accepting_state) = yy_current_state;
583 yy_last_accepting_cpos = yy_cp; 729 (yy_last_accepting_cpos) = yy_cp;
584 } 730 }
585 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 731 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
586 { 732 {
@@ -597,29 +743,27 @@ yy_find_action:
597 yy_act = yy_accept[yy_current_state]; 743 yy_act = yy_accept[yy_current_state];
598 if ( yy_act == 0 ) 744 if ( yy_act == 0 )
599 { /* have to back up */ 745 { /* have to back up */
600 yy_cp = yy_last_accepting_cpos; 746 yy_cp = (yy_last_accepting_cpos);
601 yy_current_state = yy_last_accepting_state; 747 yy_current_state = (yy_last_accepting_state);
602 yy_act = yy_accept[yy_current_state]; 748 yy_act = yy_accept[yy_current_state];
603 } 749 }
604 750
605 YY_DO_BEFORE_ACTION; 751 YY_DO_BEFORE_ACTION;
606 752
607
608do_action: /* This label is used only to access EOF actions. */ 753do_action: /* This label is used only to access EOF actions. */
609 754
610
611 switch ( yy_act ) 755 switch ( yy_act )
612 { /* beginning of action switch */ 756 { /* beginning of action switch */
613 case 0: /* must back up */ 757 case 0: /* must back up */
614 /* undo the effects of YY_DO_BEFORE_ACTION */ 758 /* undo the effects of YY_DO_BEFORE_ACTION */
615 *yy_cp = yy_hold_char; 759 *yy_cp = (yy_hold_char);
616 yy_cp = yy_last_accepting_cpos; 760 yy_cp = (yy_last_accepting_cpos);
617 yy_current_state = yy_last_accepting_state; 761 yy_current_state = (yy_last_accepting_state);
618 goto yy_find_action; 762 goto yy_find_action;
619 763
620case 1: 764case 1:
621YY_RULE_SETUP 765YY_RULE_SETUP
622#line 16 "calc.l" 766#line 17 "calc.l"
623{ 767{
624 E(2, "An integer: %s (%g)\n", yytext, atof( yytext ) ); 768 E(2, "An integer: %s (%g)\n", yytext, atof( yytext ) );
625 yylval.val= atof( yytext ); 769 yylval.val= atof( yytext );
@@ -628,7 +772,7 @@ YY_RULE_SETUP
628 YY_BREAK 772 YY_BREAK
629case 2: 773case 2:
630YY_RULE_SETUP 774YY_RULE_SETUP
631#line 22 "calc.l" 775#line 23 "calc.l"
632{ 776{
633 E(2, "A float: %s (%g)\n", yytext, atof( yytext ) ); 777 E(2, "A float: %s (%g)\n", yytext, atof( yytext ) );
634 yylval.val= atof( yytext ); 778 yylval.val= atof( yytext );
@@ -637,7 +781,7 @@ YY_RULE_SETUP
637 YY_BREAK 781 YY_BREAK
638case 3: 782case 3:
639YY_RULE_SETUP 783YY_RULE_SETUP
640#line 27 "calc.l" 784#line 28 "calc.l"
641{ 785{
642 E(2, "A float: %s (%g)\n", yytext, atof( yytext ) ); 786 E(2, "A float: %s (%g)\n", yytext, atof( yytext ) );
643 yylval.val= atof( yytext ); 787 yylval.val= atof( yytext );
@@ -646,7 +790,7 @@ YY_RULE_SETUP
646 YY_BREAK 790 YY_BREAK
647case 4: 791case 4:
648YY_RULE_SETUP 792YY_RULE_SETUP
649#line 33 "calc.l" 793#line 34 "calc.l"
650{ 794{
651 symrec *s; 795 symrec *s;
652 E(2, "An identifier: %s\n", yytext); 796 E(2, "An identifier: %s\n", yytext);
@@ -659,69 +803,70 @@ YY_RULE_SETUP
659 YY_BREAK 803 YY_BREAK
660case 5: 804case 5:
661YY_RULE_SETUP 805YY_RULE_SETUP
662#line 43 "calc.l" 806#line 44 "calc.l"
663{ 807{
664 E(2, "An operator: %s\n", yytext ); 808 E(2, "An operator: %s\n", yytext );
665 return (char) yytext[0];} 809 return (char) yytext[0];}
666 YY_BREAK 810 YY_BREAK
667case 6: 811case 6:
668YY_RULE_SETUP 812YY_RULE_SETUP
669#line 47 "calc.l" 813#line 48 "calc.l"
670{ 814{
671 E(2, "(\n", NULL); 815 E(2, "(\n", NULL, 0);
672 return OBRAK; 816 return OBRAK;
673 } 817 }
674 YY_BREAK 818 YY_BREAK
675case 7: 819case 7:
676YY_RULE_SETUP 820YY_RULE_SETUP
677#line 51 "calc.l" 821#line 52 "calc.l"
678{ 822{
679 E(2, ")\n", NULL); 823 E(2, ")\n", NULL, 0);
680 return CBRAK; 824 return CBRAK;
681 } 825 }
682 YY_BREAK 826 YY_BREAK
683case 8: 827case 8:
828/* rule 8 can match eol */
684YY_RULE_SETUP 829YY_RULE_SETUP
685#line 56 "calc.l" 830#line 57 "calc.l"
686/* eat up whitespace */ 831/* eat up whitespace */
687 YY_BREAK 832 YY_BREAK
688case 9: 833case 9:
689YY_RULE_SETUP 834YY_RULE_SETUP
690#line 58 "calc.l" 835#line 59 "calc.l"
691fprintf(stderr, "Unrecognized character: %s\n", yytext ); 836fprintf(stderr, "Unrecognized character: %s\n", yytext );
692 YY_BREAK 837 YY_BREAK
693case 10: 838case 10:
694YY_RULE_SETUP 839YY_RULE_SETUP
695#line 59 "calc.l" 840#line 60 "calc.l"
696ECHO; 841ECHO;
697 YY_BREAK 842 YY_BREAK
698#line 699 "calc_lex.c" 843#line 844 "calc_lex.c"
699case YY_STATE_EOF(INITIAL): 844case YY_STATE_EOF(INITIAL):
700 yyterminate(); 845 yyterminate();
701 846
702 case YY_END_OF_BUFFER: 847 case YY_END_OF_BUFFER:
703 { 848 {
704 /* Amount of text matched not including the EOB char. */ 849 /* Amount of text matched not including the EOB char. */
705 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; 850 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
706 851
707 /* Undo the effects of YY_DO_BEFORE_ACTION. */ 852 /* Undo the effects of YY_DO_BEFORE_ACTION. */
708 *yy_cp = yy_hold_char; 853 *yy_cp = (yy_hold_char);
709 YY_RESTORE_YY_MORE_OFFSET 854 YY_RESTORE_YY_MORE_OFFSET
710 855
711 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) 856 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
712 { 857 {
713 /* We're scanning a new file or input source. It's 858 /* We're scanning a new file or input source. It's
714 * possible that this happened because the user 859 * possible that this happened because the user
715 * just pointed yyin at a new source and called 860 * just pointed yyin at a new source and called
716 * yylex(). If so, then we have to assure 861 * yylex(). If so, then we have to assure
717 * consistency between yy_current_buffer and our 862 * consistency between YY_CURRENT_BUFFER and our
718 * globals. Here is the right place to do so, because 863 * globals. Here is the right place to do so, because
719 * this is the first action (other than possibly a 864 * this is the first action (other than possibly a
720 * back-up) that will match for the new input source. 865 * back-up) that will match for the new input source.
721 */ 866 */
722 yy_n_chars = yy_current_buffer->yy_n_chars; 867 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
723 yy_current_buffer->yy_input_file = yyin; 868 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
724 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; 869 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
725 } 870 }
726 871
727 /* Note that here we test for yy_c_buf_p "<=" to the position 872 /* Note that here we test for yy_c_buf_p "<=" to the position
@@ -731,13 +876,13 @@ case YY_STATE_EOF(INITIAL):
731 * end-of-buffer state). Contrast this with the test 876 * end-of-buffer state). Contrast this with the test
732 * in input(). 877 * in input().
733 */ 878 */
734 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) 879 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
735 { /* This was really a NUL. */ 880 { /* This was really a NUL. */
736 yy_state_type yy_next_state; 881 yy_state_type yy_next_state;
737 882
738 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; 883 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
739 884
740 yy_current_state = yy_get_previous_state(); 885 yy_current_state = yy_get_previous_state( );
741 886
742 /* Okay, we're now positioned to make the NUL 887 /* Okay, we're now positioned to make the NUL
743 * transition. We couldn't have 888 * transition. We couldn't have
@@ -750,30 +895,30 @@ case YY_STATE_EOF(INITIAL):
750 895
751 yy_next_state = yy_try_NUL_trans( yy_current_state ); 896 yy_next_state = yy_try_NUL_trans( yy_current_state );
752 897
753 yy_bp = yytext_ptr + YY_MORE_ADJ; 898 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
754 899
755 if ( yy_next_state ) 900 if ( yy_next_state )
756 { 901 {
757 /* Consume the NUL. */ 902 /* Consume the NUL. */
758 yy_cp = ++yy_c_buf_p; 903 yy_cp = ++(yy_c_buf_p);
759 yy_current_state = yy_next_state; 904 yy_current_state = yy_next_state;
760 goto yy_match; 905 goto yy_match;
761 } 906 }
762 907
763 else 908 else
764 { 909 {
765 yy_cp = yy_c_buf_p; 910 yy_cp = (yy_c_buf_p);
766 goto yy_find_action; 911 goto yy_find_action;
767 } 912 }
768 } 913 }
769 914
770 else switch ( yy_get_next_buffer() ) 915 else switch ( yy_get_next_buffer( ) )
771 { 916 {
772 case EOB_ACT_END_OF_FILE: 917 case EOB_ACT_END_OF_FILE:
773 { 918 {
774 yy_did_buffer_switch_on_eof = 0; 919 (yy_did_buffer_switch_on_eof) = 0;
775 920
776 if ( yywrap() ) 921 if ( yywrap( ) )
777 { 922 {
778 /* Note: because we've taken care in 923 /* Note: because we've taken care in
779 * yy_get_next_buffer() to have set up 924 * yy_get_next_buffer() to have set up
@@ -784,7 +929,7 @@ case YY_STATE_EOF(INITIAL):
784 * YY_NULL, it'll still work - another 929 * YY_NULL, it'll still work - another
785 * YY_NULL will get returned. 930 * YY_NULL will get returned.
786 */ 931 */
787 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; 932 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
788 933
789 yy_act = YY_STATE_EOF(YY_START); 934 yy_act = YY_STATE_EOF(YY_START);
790 goto do_action; 935 goto do_action;
@@ -792,30 +937,30 @@ case YY_STATE_EOF(INITIAL):
792 937
793 else 938 else
794 { 939 {
795 if ( ! yy_did_buffer_switch_on_eof ) 940 if ( ! (yy_did_buffer_switch_on_eof) )
796 YY_NEW_FILE; 941 YY_NEW_FILE;
797 } 942 }
798 break; 943 break;
799 } 944 }
800 945
801 case EOB_ACT_CONTINUE_SCAN: 946 case EOB_ACT_CONTINUE_SCAN:
802 yy_c_buf_p = 947 (yy_c_buf_p) =
803 yytext_ptr + yy_amount_of_matched_text; 948 (yytext_ptr) + yy_amount_of_matched_text;
804 949
805 yy_current_state = yy_get_previous_state(); 950 yy_current_state = yy_get_previous_state( );
806 951
807 yy_cp = yy_c_buf_p; 952 yy_cp = (yy_c_buf_p);
808 yy_bp = yytext_ptr + YY_MORE_ADJ; 953 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
809 goto yy_match; 954 goto yy_match;
810 955
811 case EOB_ACT_LAST_MATCH: 956 case EOB_ACT_LAST_MATCH:
812 yy_c_buf_p = 957 (yy_c_buf_p) =
813 &yy_current_buffer->yy_ch_buf[yy_n_chars]; 958 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
814 959
815 yy_current_state = yy_get_previous_state(); 960 yy_current_state = yy_get_previous_state( );
816 961
817 yy_cp = yy_c_buf_p; 962 yy_cp = (yy_c_buf_p);
818 yy_bp = yytext_ptr + YY_MORE_ADJ; 963 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
819 goto yy_find_action; 964 goto yy_find_action;
820 } 965 }
821 break; 966 break;
@@ -826,8 +971,8 @@ case YY_STATE_EOF(INITIAL):
826 "fatal flex scanner internal error--no action found" ); 971 "fatal flex scanner internal error--no action found" );
827 } /* end of action switch */ 972 } /* end of action switch */
828 } /* end of scanning one token */ 973 } /* end of scanning one token */
829 } /* end of yylex */ 974 } /* end of user's declarations */
830 975} /* end of yylex */
831 976
832/* yy_get_next_buffer - try to read in a new buffer 977/* yy_get_next_buffer - try to read in a new buffer
833 * 978 *
@@ -836,21 +981,20 @@ case YY_STATE_EOF(INITIAL):
836 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position 981 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
837 * EOB_ACT_END_OF_FILE - end of file 982 * EOB_ACT_END_OF_FILE - end of file
838 */ 983 */
839 984static int yy_get_next_buffer (void)
840static int yy_get_next_buffer() 985{
841 { 986 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
842 register char *dest = yy_current_buffer->yy_ch_buf; 987 char *source = (yytext_ptr);
843 register char *source = yytext_ptr; 988 yy_size_t number_to_move, i;
844 register int number_to_move, i;
845 int ret_val; 989 int ret_val;
846 990
847 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) 991 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
848 YY_FATAL_ERROR( 992 YY_FATAL_ERROR(
849 "fatal flex scanner internal error--end of buffer missed" ); 993 "fatal flex scanner internal error--end of buffer missed" );
850 994
851 if ( yy_current_buffer->yy_fill_buffer == 0 ) 995 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
852 { /* Don't try to fill the buffer, so this is an EOF. */ 996 { /* Don't try to fill the buffer, so this is an EOF. */
853 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) 997 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
854 { 998 {
855 /* We matched a single character, the EOB, so 999 /* We matched a single character, the EOB, so
856 * treat this as a final EOF. 1000 * treat this as a final EOF.
@@ -870,38 +1014,34 @@ static int yy_get_next_buffer()
870 /* Try to read more data. */ 1014 /* Try to read more data. */
871 1015
872 /* First move last chars to start of buffer. */ 1016 /* First move last chars to start of buffer. */
873 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; 1017 number_to_move = (yy_size_t) ((yy_c_buf_p) - (yytext_ptr)) - 1;
874 1018
875 for ( i = 0; i < number_to_move; ++i ) 1019 for ( i = 0; i < number_to_move; ++i )
876 *(dest++) = *(source++); 1020 *(dest++) = *(source++);
877 1021
878 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) 1022 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
879 /* don't do the read, it's not guaranteed to return an EOF, 1023 /* don't do the read, it's not guaranteed to return an EOF,
880 * just force an EOF 1024 * just force an EOF
881 */ 1025 */
882 yy_current_buffer->yy_n_chars = yy_n_chars = 0; 1026 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
883 1027
884 else 1028 else
885 { 1029 {
886 int num_to_read = 1030 yy_size_t num_to_read =
887 yy_current_buffer->yy_buf_size - number_to_move - 1; 1031 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
888 1032
889 while ( num_to_read <= 0 ) 1033 while ( num_to_read <= 0 )
890 { /* Not enough room in the buffer - grow it. */ 1034 { /* Not enough room in the buffer - grow it. */
891#ifdef YY_USES_REJECT
892 YY_FATAL_ERROR(
893"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
894#else
895 1035
896 /* just a shorter name for the current buffer */ 1036 /* just a shorter name for the current buffer */
897 YY_BUFFER_STATE b = yy_current_buffer; 1037 YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
898 1038
899 int yy_c_buf_p_offset = 1039 int yy_c_buf_p_offset =
900 (int) (yy_c_buf_p - b->yy_ch_buf); 1040 (int) ((yy_c_buf_p) - b->yy_ch_buf);
901 1041
902 if ( b->yy_is_our_buffer ) 1042 if ( b->yy_is_our_buffer )
903 { 1043 {
904 int new_size = b->yy_buf_size * 2; 1044 yy_size_t new_size = b->yy_buf_size * 2;
905 1045
906 if ( new_size <= 0 ) 1046 if ( new_size <= 0 )
907 b->yy_buf_size += b->yy_buf_size / 8; 1047 b->yy_buf_size += b->yy_buf_size / 8;
@@ -910,8 +1050,7 @@ static int yy_get_next_buffer()
910 1050
911 b->yy_ch_buf = (char *) 1051 b->yy_ch_buf = (char *)
912 /* Include room in for 2 EOB chars. */ 1052 /* Include room in for 2 EOB chars. */
913 yy_flex_realloc( (void *) b->yy_ch_buf, 1053 yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
914 b->yy_buf_size + 2 );
915 } 1054 }
916 else 1055 else
917 /* Can't grow it, we don't own it. */ 1056 /* Can't grow it, we don't own it. */
@@ -921,35 +1060,35 @@ static int yy_get_next_buffer()
921 YY_FATAL_ERROR( 1060 YY_FATAL_ERROR(
922 "fatal error - scanner input buffer overflow" ); 1061 "fatal error - scanner input buffer overflow" );
923 1062
924 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; 1063 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
925 1064
926 num_to_read = yy_current_buffer->yy_buf_size - 1065 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
927 number_to_move - 1; 1066 number_to_move - 1;
928#endif 1067
929 } 1068 }
930 1069
931 if ( num_to_read > YY_READ_BUF_SIZE ) 1070 if ( num_to_read > YY_READ_BUF_SIZE )
932 num_to_read = YY_READ_BUF_SIZE; 1071 num_to_read = YY_READ_BUF_SIZE;
933 1072
934 /* Read in more data. */ 1073 /* Read in more data. */
935 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), 1074 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
936 yy_n_chars, num_to_read ); 1075 (yy_n_chars), num_to_read );
937 1076
938 yy_current_buffer->yy_n_chars = yy_n_chars; 1077 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
939 } 1078 }
940 1079
941 if ( yy_n_chars == 0 ) 1080 if ( (yy_n_chars) == 0 )
942 { 1081 {
943 if ( number_to_move == YY_MORE_ADJ ) 1082 if ( number_to_move == YY_MORE_ADJ )
944 { 1083 {
945 ret_val = EOB_ACT_END_OF_FILE; 1084 ret_val = EOB_ACT_END_OF_FILE;
946 yyrestart( yyin ); 1085 yyrestart(yyin );
947 } 1086 }
948 1087
949 else 1088 else
950 { 1089 {
951 ret_val = EOB_ACT_LAST_MATCH; 1090 ret_val = EOB_ACT_LAST_MATCH;
952 yy_current_buffer->yy_buffer_status = 1091 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
953 YY_BUFFER_EOF_PENDING; 1092 YY_BUFFER_EOF_PENDING;
954 } 1093 }
955 } 1094 }
@@ -957,32 +1096,39 @@ static int yy_get_next_buffer()
957 else 1096 else
958 ret_val = EOB_ACT_CONTINUE_SCAN; 1097 ret_val = EOB_ACT_CONTINUE_SCAN;
959 1098
960 yy_n_chars += number_to_move; 1099 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
961 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; 1100 /* Extend the array by 50%, plus the number we really need. */
962 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; 1101 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1102 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1103 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1104 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1105 }
963 1106
964 yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; 1107 (yy_n_chars) += number_to_move;
1108 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1109 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
965 1110
966 return ret_val; 1111 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
967 }
968 1112
1113 return ret_val;
1114}
969 1115
970/* yy_get_previous_state - get the state just before the EOB char was reached */ 1116/* yy_get_previous_state - get the state just before the EOB char was reached */
971 1117
972static yy_state_type yy_get_previous_state() 1118 static yy_state_type yy_get_previous_state (void)
973 { 1119{
974 register yy_state_type yy_current_state; 1120 yy_state_type yy_current_state;
975 register char *yy_cp; 1121 char *yy_cp;
976 1122
977 yy_current_state = yy_start; 1123 yy_current_state = (yy_start);
978 1124
979 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) 1125 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
980 { 1126 {
981 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); 1127 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
982 if ( yy_accept[yy_current_state] ) 1128 if ( yy_accept[yy_current_state] )
983 { 1129 {
984 yy_last_accepting_state = yy_current_state; 1130 (yy_last_accepting_state) = yy_current_state;
985 yy_last_accepting_cpos = yy_cp; 1131 (yy_last_accepting_cpos) = yy_cp;
986 } 1132 }
987 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 1133 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
988 { 1134 {
@@ -994,30 +1140,23 @@ static yy_state_type yy_get_previous_state()
994 } 1140 }
995 1141
996 return yy_current_state; 1142 return yy_current_state;
997 } 1143}
998
999 1144
1000/* yy_try_NUL_trans - try to make a transition on the NUL character 1145/* yy_try_NUL_trans - try to make a transition on the NUL character
1001 * 1146 *
1002 * synopsis 1147 * synopsis
1003 * next_state = yy_try_NUL_trans( current_state ); 1148 * next_state = yy_try_NUL_trans( current_state );
1004 */ 1149 */
1150 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1151{
1152 int yy_is_jam;
1153 char *yy_cp = (yy_c_buf_p);
1005 1154
1006#ifdef YY_USE_PROTOS 1155 YY_CHAR yy_c = 1;
1007static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1008#else
1009static yy_state_type yy_try_NUL_trans( yy_current_state )
1010yy_state_type yy_current_state;
1011#endif
1012 {
1013 register int yy_is_jam;
1014 register char *yy_cp = yy_c_buf_p;
1015
1016 register YY_CHAR yy_c = 1;
1017 if ( yy_accept[yy_current_state] ) 1156 if ( yy_accept[yy_current_state] )
1018 { 1157 {
1019 yy_last_accepting_state = yy_current_state; 1158 (yy_last_accepting_state) = yy_current_state;
1020 yy_last_accepting_cpos = yy_cp; 1159 (yy_last_accepting_cpos) = yy_cp;
1021 } 1160 }
1022 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 1161 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1023 { 1162 {
@@ -1028,81 +1167,78 @@ yy_state_type yy_current_state;
1028 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 1167 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1029 yy_is_jam = (yy_current_state == 19); 1168 yy_is_jam = (yy_current_state == 19);
1030 1169
1031 return yy_is_jam ? 0 : yy_current_state; 1170 return yy_is_jam ? 0 : yy_current_state;
1032 } 1171}
1033
1034 1172
1035#ifndef YY_NO_UNPUT 1173#ifndef YY_NO_UNPUT
1036#ifdef YY_USE_PROTOS 1174
1037static void yyunput( int c, register char *yy_bp ) 1175 static void yyunput (int c, char * yy_bp )
1038#else 1176{
1039static void yyunput( c, yy_bp ) 1177 char *yy_cp;
1040int c; 1178
1041register char *yy_bp; 1179 yy_cp = (yy_c_buf_p);
1042#endif
1043 {
1044 register char *yy_cp = yy_c_buf_p;
1045 1180
1046 /* undo effects of setting up yytext */ 1181 /* undo effects of setting up yytext */
1047 *yy_cp = yy_hold_char; 1182 *yy_cp = (yy_hold_char);
1048 1183
1049 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) 1184 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1050 { /* need to shift things up to make room */ 1185 { /* need to shift things up to make room */
1051 /* +2 for EOB chars. */ 1186 /* +2 for EOB chars. */
1052 register int number_to_move = yy_n_chars + 2; 1187 yy_size_t number_to_move = (yy_n_chars) + 2;
1053 register char *dest = &yy_current_buffer->yy_ch_buf[ 1188 char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1054 yy_current_buffer->yy_buf_size + 2]; 1189 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1055 register char *source = 1190 char *source =
1056 &yy_current_buffer->yy_ch_buf[number_to_move]; 1191 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1057 1192
1058 while ( source > yy_current_buffer->yy_ch_buf ) 1193 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1059 *--dest = *--source; 1194 *--dest = *--source;
1060 1195
1061 yy_cp += (int) (dest - source); 1196 yy_cp += (int) (dest - source);
1062 yy_bp += (int) (dest - source); 1197 yy_bp += (int) (dest - source);
1063 yy_current_buffer->yy_n_chars = 1198 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1064 yy_n_chars = yy_current_buffer->yy_buf_size; 1199 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1065 1200
1066 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) 1201 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1067 YY_FATAL_ERROR( "flex scanner push-back overflow" ); 1202 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1068 } 1203 }
1069 1204
1070 *--yy_cp = (char) c; 1205 *--yy_cp = (char) c;
1071 1206
1207 (yytext_ptr) = yy_bp;
1208 (yy_hold_char) = *yy_cp;
1209 (yy_c_buf_p) = yy_cp;
1210}
1072 1211
1073 yytext_ptr = yy_bp; 1212#endif
1074 yy_hold_char = *yy_cp;
1075 yy_c_buf_p = yy_cp;
1076 }
1077#endif /* ifndef YY_NO_UNPUT */
1078
1079 1213
1214#ifndef YY_NO_INPUT
1080#ifdef __cplusplus 1215#ifdef __cplusplus
1081static int yyinput() 1216 static int yyinput (void)
1082#else 1217#else
1083static int input() 1218 static int input (void)
1084#endif 1219#endif
1085 {
1086 int c;
1087 1220
1088 *yy_c_buf_p = yy_hold_char; 1221{
1222 int c;
1223
1224 *(yy_c_buf_p) = (yy_hold_char);
1089 1225
1090 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) 1226 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1091 { 1227 {
1092 /* yy_c_buf_p now points to the character we want to return. 1228 /* yy_c_buf_p now points to the character we want to return.
1093 * If this occurs *before* the EOB characters, then it's a 1229 * If this occurs *before* the EOB characters, then it's a
1094 * valid NUL; if not, then we've hit the end of the buffer. 1230 * valid NUL; if not, then we've hit the end of the buffer.
1095 */ 1231 */
1096 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) 1232 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1097 /* This was really a NUL. */ 1233 /* This was really a NUL. */
1098 *yy_c_buf_p = '\0'; 1234 *(yy_c_buf_p) = '\0';
1099 1235
1100 else 1236 else
1101 { /* need more input */ 1237 { /* need more input */
1102 int offset = yy_c_buf_p - yytext_ptr; 1238 yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
1103 ++yy_c_buf_p; 1239 ++(yy_c_buf_p);
1104 1240
1105 switch ( yy_get_next_buffer() ) 1241 switch ( yy_get_next_buffer( ) )
1106 { 1242 {
1107 case EOB_ACT_LAST_MATCH: 1243 case EOB_ACT_LAST_MATCH:
1108 /* This happens because yy_g_n_b() 1244 /* This happens because yy_g_n_b()
@@ -1116,16 +1252,16 @@ static int input()
1116 */ 1252 */
1117 1253
1118 /* Reset buffer status. */ 1254 /* Reset buffer status. */
1119 yyrestart( yyin ); 1255 yyrestart(yyin );
1120 1256
1121 /* fall through */ 1257 /*FALLTHROUGH*/
1122 1258
1123 case EOB_ACT_END_OF_FILE: 1259 case EOB_ACT_END_OF_FILE:
1124 { 1260 {
1125 if ( yywrap() ) 1261 if ( yywrap( ) )
1126 return EOF; 1262 return EOF;
1127 1263
1128 if ( ! yy_did_buffer_switch_on_eof ) 1264 if ( ! (yy_did_buffer_switch_on_eof) )
1129 YY_NEW_FILE; 1265 YY_NEW_FILE;
1130#ifdef __cplusplus 1266#ifdef __cplusplus
1131 return yyinput(); 1267 return yyinput();
@@ -1135,167 +1271,165 @@ static int input()
1135 } 1271 }
1136 1272
1137 case EOB_ACT_CONTINUE_SCAN: 1273 case EOB_ACT_CONTINUE_SCAN:
1138 yy_c_buf_p = yytext_ptr + offset; 1274 (yy_c_buf_p) = (yytext_ptr) + offset;
1139 break; 1275 break;
1140 } 1276 }
1141 } 1277 }
1142 } 1278 }
1143 1279
1144 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ 1280 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1145 *yy_c_buf_p = '\0'; /* preserve yytext */ 1281 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1146 yy_hold_char = *++yy_c_buf_p; 1282 (yy_hold_char) = *++(yy_c_buf_p);
1147
1148 1283
1149 return c; 1284 return c;
1150 } 1285}
1151 1286#endif /* ifndef YY_NO_INPUT */
1152 1287
1153#ifdef YY_USE_PROTOS 1288/** Immediately switch to a different input stream.
1154void yyrestart( FILE *input_file ) 1289 * @param input_file A readable stream.
1155#else 1290 *
1156void yyrestart( input_file ) 1291 * @note This function does not reset the start condition to @c INITIAL .
1157FILE *input_file; 1292 */
1158#endif 1293 void yyrestart (FILE * input_file )
1159 { 1294{
1160 if ( ! yy_current_buffer ) 1295
1161 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); 1296 if ( ! YY_CURRENT_BUFFER ){
1162 1297 yyensure_buffer_stack ();
1163 yy_init_buffer( yy_current_buffer, input_file ); 1298 YY_CURRENT_BUFFER_LVALUE =
1164 yy_load_buffer_state(); 1299 yy_create_buffer(yyin,YY_BUF_SIZE );
1165 } 1300 }
1166 1301
1302 yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1303 yy_load_buffer_state( );
1304}
1167 1305
1168#ifdef YY_USE_PROTOS 1306/** Switch to a different input buffer.
1169void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) 1307 * @param new_buffer The new input buffer.
1170#else 1308 *
1171void yy_switch_to_buffer( new_buffer ) 1309 */
1172YY_BUFFER_STATE new_buffer; 1310 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1173#endif 1311{
1174 { 1312
1175 if ( yy_current_buffer == new_buffer ) 1313 /* TODO. We should be able to replace this entire function body
1314 * with
1315 * yypop_buffer_state();
1316 * yypush_buffer_state(new_buffer);
1317 */
1318 yyensure_buffer_stack ();
1319 if ( YY_CURRENT_BUFFER == new_buffer )
1176 return; 1320 return;
1177 1321
1178 if ( yy_current_buffer ) 1322 if ( YY_CURRENT_BUFFER )
1179 { 1323 {
1180 /* Flush out information for old buffer. */ 1324 /* Flush out information for old buffer. */
1181 *yy_c_buf_p = yy_hold_char; 1325 *(yy_c_buf_p) = (yy_hold_char);
1182 yy_current_buffer->yy_buf_pos = yy_c_buf_p; 1326 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1183 yy_current_buffer->yy_n_chars = yy_n_chars; 1327 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1184 } 1328 }
1185 1329
1186 yy_current_buffer = new_buffer; 1330 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1187 yy_load_buffer_state(); 1331 yy_load_buffer_state( );
1188 1332
1189 /* We don't actually know whether we did this switch during 1333 /* We don't actually know whether we did this switch during
1190 * EOF (yywrap()) processing, but the only time this flag 1334 * EOF (yywrap()) processing, but the only time this flag
1191 * is looked at is after yywrap() is called, so it's safe 1335 * is looked at is after yywrap() is called, so it's safe
1192 * to go ahead and always set it. 1336 * to go ahead and always set it.
1193 */ 1337 */
1194 yy_did_buffer_switch_on_eof = 1; 1338 (yy_did_buffer_switch_on_eof) = 1;
1195 } 1339}
1196
1197
1198#ifdef YY_USE_PROTOS
1199void yy_load_buffer_state( void )
1200#else
1201void yy_load_buffer_state()
1202#endif
1203 {
1204 yy_n_chars = yy_current_buffer->yy_n_chars;
1205 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1206 yyin = yy_current_buffer->yy_input_file;
1207 yy_hold_char = *yy_c_buf_p;
1208 }
1209
1210 1340
1211#ifdef YY_USE_PROTOS 1341static void yy_load_buffer_state (void)
1212YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) 1342{
1213#else 1343 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1214YY_BUFFER_STATE yy_create_buffer( file, size ) 1344 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1215FILE *file; 1345 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1216int size; 1346 (yy_hold_char) = *(yy_c_buf_p);
1217#endif 1347}
1218 { 1348
1349/** Allocate and initialize an input buffer state.
1350 * @param file A readable stream.
1351 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1352 *
1353 * @return the allocated buffer state.
1354 */
1355 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1356{
1219 YY_BUFFER_STATE b; 1357 YY_BUFFER_STATE b;
1220 1358
1221 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); 1359 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1222 if ( ! b ) 1360 if ( ! b )
1223 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); 1361 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1224 1362
1225 b->yy_buf_size = size; 1363 b->yy_buf_size = (yy_size_t)size;
1226 1364
1227 /* yy_ch_buf has to be 2 characters longer than the size given because 1365 /* yy_ch_buf has to be 2 characters longer than the size given because
1228 * we need to put in 2 end-of-buffer characters. 1366 * we need to put in 2 end-of-buffer characters.
1229 */ 1367 */
1230 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); 1368 b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
1231 if ( ! b->yy_ch_buf ) 1369 if ( ! b->yy_ch_buf )
1232 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); 1370 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1233 1371
1234 b->yy_is_our_buffer = 1; 1372 b->yy_is_our_buffer = 1;
1235 1373
1236 yy_init_buffer( b, file ); 1374 yy_init_buffer(b,file );
1237 1375
1238 return b; 1376 return b;
1239 } 1377}
1240
1241 1378
1242#ifdef YY_USE_PROTOS 1379/** Destroy the buffer.
1243void yy_delete_buffer( YY_BUFFER_STATE b ) 1380 * @param b a buffer created with yy_create_buffer()
1244#else 1381 *
1245void yy_delete_buffer( b ) 1382 */
1246YY_BUFFER_STATE b; 1383 void yy_delete_buffer (YY_BUFFER_STATE b )
1247#endif 1384{
1248 { 1385
1249 if ( ! b ) 1386 if ( ! b )
1250 return; 1387 return;
1251 1388
1252 if ( b == yy_current_buffer ) 1389 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1253 yy_current_buffer = (YY_BUFFER_STATE) 0; 1390 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1254 1391
1255 if ( b->yy_is_our_buffer ) 1392 if ( b->yy_is_our_buffer )
1256 yy_flex_free( (void *) b->yy_ch_buf ); 1393 yyfree((void *) b->yy_ch_buf );
1257
1258 yy_flex_free( (void *) b );
1259 }
1260 1394
1395 yyfree((void *) b );
1396}
1261 1397
1398/* Initializes or reinitializes a buffer.
1399 * This function is sometimes called more than once on the same buffer,
1400 * such as during a yyrestart() or at EOF.
1401 */
1402 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1262 1403
1263#ifdef YY_USE_PROTOS 1404{
1264void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) 1405 int oerrno = errno;
1265#else 1406
1266void yy_init_buffer( b, file ) 1407 yy_flush_buffer(b );
1267YY_BUFFER_STATE b;
1268FILE *file;
1269#endif
1270
1271
1272 {
1273 yy_flush_buffer( b );
1274 1408
1275 b->yy_input_file = file; 1409 b->yy_input_file = file;
1276 b->yy_fill_buffer = 1; 1410 b->yy_fill_buffer = 1;
1277 1411
1278#if YY_ALWAYS_INTERACTIVE 1412 /* If b is the current buffer, then yy_init_buffer was _probably_
1279 b->yy_is_interactive = 1; 1413 * called from yyrestart() or through yy_get_next_buffer.
1280#else 1414 * In that case, we don't want to reset the lineno or column.
1281#if YY_NEVER_INTERACTIVE 1415 */
1282 b->yy_is_interactive = 0; 1416 if (b != YY_CURRENT_BUFFER){
1283#else 1417 b->yy_bs_lineno = 1;
1284 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; 1418 b->yy_bs_column = 0;
1285#endif 1419 }
1286#endif 1420
1287 } 1421 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1288 1422
1289 1423 errno = oerrno;
1290#ifdef YY_USE_PROTOS 1424}
1291void yy_flush_buffer( YY_BUFFER_STATE b ) 1425
1292#else 1426/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1293void yy_flush_buffer( b ) 1427 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1294YY_BUFFER_STATE b; 1428 *
1295#endif 1429 */
1296 1430 void yy_flush_buffer (YY_BUFFER_STATE b )
1297 { 1431{
1298 if ( ! b ) 1432 if ( ! b )
1299 return; 1433 return;
1300 1434
1301 b->yy_n_chars = 0; 1435 b->yy_n_chars = 0;
@@ -1312,29 +1446,125 @@ YY_BUFFER_STATE b;
1312 b->yy_at_bol = 1; 1446 b->yy_at_bol = 1;
1313 b->yy_buffer_status = YY_BUFFER_NEW; 1447 b->yy_buffer_status = YY_BUFFER_NEW;
1314 1448
1315 if ( b == yy_current_buffer ) 1449 if ( b == YY_CURRENT_BUFFER )
1316 yy_load_buffer_state(); 1450 yy_load_buffer_state( );
1451}
1452
1453/** Pushes the new state onto the stack. The new state becomes
1454 * the current state. This function will allocate the stack
1455 * if necessary.
1456 * @param new_buffer The new state.
1457 *
1458 */
1459void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1460{
1461 if (new_buffer == NULL)
1462 return;
1463
1464 yyensure_buffer_stack();
1465
1466 /* This block is copied from yy_switch_to_buffer. */
1467 if ( YY_CURRENT_BUFFER )
1468 {
1469 /* Flush out information for old buffer. */
1470 *(yy_c_buf_p) = (yy_hold_char);
1471 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1472 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1473 }
1474
1475 /* Only push if top exists. Otherwise, replace top. */
1476 if (YY_CURRENT_BUFFER)
1477 (yy_buffer_stack_top)++;
1478 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1479
1480 /* copied from yy_switch_to_buffer. */
1481 yy_load_buffer_state( );
1482 (yy_did_buffer_switch_on_eof) = 1;
1483}
1484
1485/** Removes and deletes the top of the stack, if present.
1486 * The next element becomes the new top.
1487 *
1488 */
1489void yypop_buffer_state (void)
1490{
1491 if (!YY_CURRENT_BUFFER)
1492 return;
1493
1494 yy_delete_buffer(YY_CURRENT_BUFFER );
1495 YY_CURRENT_BUFFER_LVALUE = NULL;
1496 if ((yy_buffer_stack_top) > 0)
1497 --(yy_buffer_stack_top);
1498
1499 if (YY_CURRENT_BUFFER) {
1500 yy_load_buffer_state( );
1501 (yy_did_buffer_switch_on_eof) = 1;
1502 }
1503}
1504
1505/* Allocates the stack if it does not exist.
1506 * Guarantees space for at least one push.
1507 */
1508static void yyensure_buffer_stack (void)
1509{
1510 yy_size_t num_to_alloc;
1511
1512 if (!(yy_buffer_stack)) {
1513
1514 /* First allocation is just for 2 elements, since we don't know if this
1515 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1516 * immediate realloc on the next call.
1517 */
1518 num_to_alloc = 1; // After all that talk, this was set to 1 anyways...
1519 (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1520 (num_to_alloc * sizeof(struct yy_buffer_state*)
1521 );
1522 if ( ! (yy_buffer_stack) )
1523 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1524
1525 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1526
1527 (yy_buffer_stack_max) = num_to_alloc;
1528 (yy_buffer_stack_top) = 0;
1529 return;
1317 } 1530 }
1318 1531
1532 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1319 1533
1320#ifndef YY_NO_SCAN_BUFFER 1534 /* Increase the buffer to prepare for a possible push. */
1321#ifdef YY_USE_PROTOS 1535 yy_size_t grow_size = 8 /* arbitrary grow size */;
1322YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1323#else
1324YY_BUFFER_STATE yy_scan_buffer( base, size )
1325char *base;
1326yy_size_t size;
1327#endif
1328 {
1329 YY_BUFFER_STATE b;
1330 1536
1537 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1538 (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1539 ((yy_buffer_stack),
1540 num_to_alloc * sizeof(struct yy_buffer_state*)
1541 );
1542 if ( ! (yy_buffer_stack) )
1543 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1544
1545 /* zero only the new slots.*/
1546 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1547 (yy_buffer_stack_max) = num_to_alloc;
1548 }
1549}
1550
1551/** Setup the input buffer state to scan directly from a user-specified character buffer.
1552 * @param base the character buffer
1553 * @param size the size in bytes of the character buffer
1554 *
1555 * @return the newly allocated buffer state object.
1556 */
1557YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1558{
1559 YY_BUFFER_STATE b;
1560
1331 if ( size < 2 || 1561 if ( size < 2 ||
1332 base[size-2] != YY_END_OF_BUFFER_CHAR || 1562 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1333 base[size-1] != YY_END_OF_BUFFER_CHAR ) 1563 base[size-1] != YY_END_OF_BUFFER_CHAR )
1334 /* They forgot to leave room for the EOB's. */ 1564 /* They forgot to leave room for the EOB's. */
1335 return 0; 1565 return 0;
1336 1566
1337 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); 1567 b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1338 if ( ! b ) 1568 if ( ! b )
1339 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); 1569 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1340 1570
@@ -1348,56 +1578,51 @@ yy_size_t size;
1348 b->yy_fill_buffer = 0; 1578 b->yy_fill_buffer = 0;
1349 b->yy_buffer_status = YY_BUFFER_NEW; 1579 b->yy_buffer_status = YY_BUFFER_NEW;
1350 1580
1351 yy_switch_to_buffer( b ); 1581 yy_switch_to_buffer(b );
1352 1582
1353 return b; 1583 return b;
1354 } 1584}
1355#endif 1585
1356 1586/** Setup the input buffer state to scan a string. The next call to yylex() will
1357 1587 * scan from a @e copy of @a str.
1358#ifndef YY_NO_SCAN_STRING 1588 * @param yystr a NUL-terminated string to scan
1359#ifdef YY_USE_PROTOS 1589 *
1360YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) 1590 * @return the newly allocated buffer state object.
1361#else 1591 * @note If you want to scan bytes that may contain NUL values, then use
1362YY_BUFFER_STATE yy_scan_string( yy_str ) 1592 * yy_scan_bytes() instead.
1363yyconst char *yy_str; 1593 */
1364#endif 1594YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
1365 { 1595{
1366 int len; 1596
1367 for ( len = 0; yy_str[len]; ++len ) 1597 return yy_scan_bytes(yystr,strlen(yystr) );
1368 ; 1598}
1369 1599
1370 return yy_scan_bytes( yy_str, len ); 1600/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1371 } 1601 * scan from a @e copy of @a bytes.
1372#endif 1602 * @param yybytes the byte buffer to scan
1373 1603 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
1374 1604 *
1375#ifndef YY_NO_SCAN_BYTES 1605 * @return the newly allocated buffer state object.
1376#ifdef YY_USE_PROTOS 1606 */
1377YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) 1607YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
1378#else 1608{
1379YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1380yyconst char *bytes;
1381int len;
1382#endif
1383 {
1384 YY_BUFFER_STATE b; 1609 YY_BUFFER_STATE b;
1385 char *buf; 1610 char *buf;
1386 yy_size_t n; 1611 yy_size_t n;
1387 int i; 1612 yy_size_t i;
1388 1613
1389 /* Get memory for full buffer, including space for trailing EOB's. */ 1614 /* Get memory for full buffer, including space for trailing EOB's. */
1390 n = len + 2; 1615 n = _yybytes_len + 2;
1391 buf = (char *) yy_flex_alloc( n ); 1616 buf = (char *) yyalloc(n );
1392 if ( ! buf ) 1617 if ( ! buf )
1393 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); 1618 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1394 1619
1395 for ( i = 0; i < len; ++i ) 1620 for ( i = 0; i < _yybytes_len; ++i )
1396 buf[i] = bytes[i]; 1621 buf[i] = yybytes[i];
1397 1622
1398 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; 1623 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1399 1624
1400 b = yy_scan_buffer( buf, n ); 1625 b = yy_scan_buffer(buf,n );
1401 if ( ! b ) 1626 if ( ! b )
1402 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); 1627 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1403 1628
@@ -1407,148 +1632,198 @@ int len;
1407 b->yy_is_our_buffer = 1; 1632 b->yy_is_our_buffer = 1;
1408 1633
1409 return b; 1634 return b;
1410 } 1635}
1636
1637#ifndef YY_EXIT_FAILURE
1638#define YY_EXIT_FAILURE 2
1411#endif 1639#endif
1412 1640
1641static void yy_fatal_error (yyconst char* msg )
1642{
1643 (void) fprintf( stderr, "%s\n", msg );
1644 exit( YY_EXIT_FAILURE );
1645}
1413 1646
1414#ifndef YY_NO_PUSH_STATE 1647/* Redefine yyless() so it works in section 3 code. */
1415#ifdef YY_USE_PROTOS
1416static void yy_push_state( int new_state )
1417#else
1418static void yy_push_state( new_state )
1419int new_state;
1420#endif
1421 {
1422 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1423 {
1424 yy_size_t new_size;
1425 1648
1426 yy_start_stack_depth += YY_START_STACK_INCR; 1649#undef yyless
1427 new_size = yy_start_stack_depth * sizeof( int ); 1650#define yyless(n) \
1651 do \
1652 { \
1653 /* Undo effects of setting up yytext. */ \
1654 int yyless_macro_arg = (n); \
1655 YY_LESS_LINENO(yyless_macro_arg);\
1656 yytext[yyleng] = (yy_hold_char); \
1657 (yy_c_buf_p) = yytext + yyless_macro_arg; \
1658 (yy_hold_char) = *(yy_c_buf_p); \
1659 *(yy_c_buf_p) = '\0'; \
1660 yyleng = yyless_macro_arg; \
1661 } \
1662 while ( 0 )
1428 1663
1429 if ( ! yy_start_stack ) 1664/* Accessor methods (get/set functions) to struct members. */
1430 yy_start_stack = (int *) yy_flex_alloc( new_size );
1431 1665
1432 else 1666/** Get the current line number.
1433 yy_start_stack = (int *) yy_flex_realloc( 1667 *
1434 (void *) yy_start_stack, new_size ); 1668 */
1669int yyget_lineno (void)
1670{
1671
1672 return yylineno;
1673}
1435 1674
1436 if ( ! yy_start_stack ) 1675/** Get the input stream.
1437 YY_FATAL_ERROR( 1676 *
1438 "out of memory expanding start-condition stack" ); 1677 */
1439 } 1678FILE *yyget_in (void)
1679{
1680 return yyin;
1681}
1440 1682
1441 yy_start_stack[yy_start_stack_ptr++] = YY_START; 1683/** Get the output stream.
1684 *
1685 */
1686FILE *yyget_out (void)
1687{
1688 return yyout;
1689}
1442 1690
1443 BEGIN(new_state); 1691/** Get the length of the current token.
1444 } 1692 *
1445#endif 1693 */
1694yy_size_t yyget_leng (void)
1695{
1696 return yyleng;
1697}
1446 1698
1699/** Get the current token.
1700 *
1701 */
1447 1702
1448#ifndef YY_NO_POP_STATE 1703char *yyget_text (void)
1449static void yy_pop_state() 1704{
1450 { 1705 return yytext;
1451 if ( --yy_start_stack_ptr < 0 ) 1706}
1452 YY_FATAL_ERROR( "start-condition stack underflow" );
1453 1707
1454 BEGIN(yy_start_stack[yy_start_stack_ptr]); 1708/** Set the current line number.
1455 } 1709 * @param _line_number line number
1456#endif 1710 *
1711 */
1712void yyset_lineno (int _line_number )
1713{
1714
1715 yylineno = _line_number;
1716}
1717
1718/** Set the input stream. This does not discard the current
1719 * input buffer.
1720 * @param _in_str A readable stream.
1721 *
1722 * @see yy_switch_to_buffer
1723 */
1724void yyset_in (FILE * _in_str )
1725{
1726 yyin = _in_str ;
1727}
1457 1728
1729void yyset_out (FILE * _out_str )
1730{
1731 yyout = _out_str ;
1732}
1458 1733
1459#ifndef YY_NO_TOP_STATE 1734int yyget_debug (void)
1460static int yy_top_state() 1735{
1461 { 1736 return yy_flex_debug;
1462 return yy_start_stack[yy_start_stack_ptr - 1]; 1737}
1463 }
1464#endif
1465 1738
1466#ifndef YY_EXIT_FAILURE 1739void yyset_debug (int _bdebug )
1467#define YY_EXIT_FAILURE 2 1740{
1468#endif 1741 yy_flex_debug = _bdebug ;
1742}
1469 1743
1470#ifdef YY_USE_PROTOS 1744static int yy_init_globals (void)
1471static void yy_fatal_error( yyconst char msg[] ) 1745{
1746 /* Initialization is the same as for the non-reentrant scanner.
1747 * This function is called from yylex_destroy(), so don't allocate here.
1748 */
1749
1750 (yy_buffer_stack) = 0;
1751 (yy_buffer_stack_top) = 0;
1752 (yy_buffer_stack_max) = 0;
1753 (yy_c_buf_p) = (char *) 0;
1754 (yy_init) = 0;
1755 (yy_start) = 0;
1756
1757/* Defined in main.c */
1758#ifdef YY_STDINIT
1759 yyin = stdin;
1760 yyout = stdout;
1472#else 1761#else
1473static void yy_fatal_error( msg ) 1762 yyin = (FILE *) 0;
1474char msg[]; 1763 yyout = (FILE *) 0;
1475#endif 1764#endif
1476 {
1477 (void) fprintf( stderr, "%s\n", msg );
1478 exit( YY_EXIT_FAILURE );
1479 }
1480 1765
1766 /* For future reference: Set errno on error, since we are called by
1767 * yylex_init()
1768 */
1769 return 0;
1770}
1481 1771
1772/* yylex_destroy is for both reentrant and non-reentrant scanners. */
1773int yylex_destroy (void)
1774{
1775
1776 /* Pop the buffer stack, destroying each element. */
1777 while(YY_CURRENT_BUFFER){
1778 yy_delete_buffer(YY_CURRENT_BUFFER );
1779 YY_CURRENT_BUFFER_LVALUE = NULL;
1780 yypop_buffer_state();
1781 }
1482 1782
1483/* Redefine yyless() so it works in section 3 code. */ 1783 /* Destroy the stack itself. */
1784 yyfree((yy_buffer_stack) );
1785 (yy_buffer_stack) = NULL;
1484 1786
1485#undef yyless 1787 /* Reset the globals. This is important in a non-reentrant scanner so the next time
1486#define yyless(n) \ 1788 * yylex() is called, initialization will occur. */
1487 do \ 1789 yy_init_globals( );
1488 { \
1489 /* Undo effects of setting up yytext. */ \
1490 yytext[yyleng] = yy_hold_char; \
1491 yy_c_buf_p = yytext + n; \
1492 yy_hold_char = *yy_c_buf_p; \
1493 *yy_c_buf_p = '\0'; \
1494 yyleng = n; \
1495 } \
1496 while ( 0 )
1497 1790
1791 return 0;
1792}
1498 1793
1499/* Internal utility routines. */ 1794/*
1795 * Internal utility routines.
1796 */
1500 1797
1501#ifndef yytext_ptr 1798#ifndef yytext_ptr
1502#ifdef YY_USE_PROTOS 1799static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1503static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) 1800{
1504#else 1801
1505static void yy_flex_strncpy( s1, s2, n ) 1802 int i;
1506char *s1;
1507yyconst char *s2;
1508int n;
1509#endif
1510 {
1511 register int i;
1512 for ( i = 0; i < n; ++i ) 1803 for ( i = 0; i < n; ++i )
1513 s1[i] = s2[i]; 1804 s1[i] = s2[i];
1514 } 1805}
1515#endif 1806#endif
1516 1807
1517#ifdef YY_NEED_STRLEN 1808#ifdef YY_NEED_STRLEN
1518#ifdef YY_USE_PROTOS 1809static int yy_flex_strlen (yyconst char * s )
1519static int yy_flex_strlen( yyconst char *s ) 1810{
1520#else 1811 int n;
1521static int yy_flex_strlen( s )
1522yyconst char *s;
1523#endif
1524 {
1525 register int n;
1526 for ( n = 0; s[n]; ++n ) 1812 for ( n = 0; s[n]; ++n )
1527 ; 1813 ;
1528 1814
1529 return n; 1815 return n;
1530 } 1816}
1531#endif 1817#endif
1532 1818
1819void *yyalloc (yy_size_t size )
1820{
1821 return (void *) malloc( size );
1822}
1533 1823
1534#ifdef YY_USE_PROTOS 1824void *yyrealloc (void * ptr, yy_size_t size )
1535static void *yy_flex_alloc( yy_size_t size ) 1825{
1536#else 1826
1537static void *yy_flex_alloc( size )
1538yy_size_t size;
1539#endif
1540 {
1541 return (void *) malloc( size );
1542 }
1543
1544#ifdef YY_USE_PROTOS
1545static void *yy_flex_realloc( void *ptr, yy_size_t size )
1546#else
1547static void *yy_flex_realloc( ptr, size )
1548void *ptr;
1549yy_size_t size;
1550#endif
1551 {
1552 /* The cast to (char *) in the following accommodates both 1827 /* The cast to (char *) in the following accommodates both
1553 * implementations that use char* generic pointers, and those 1828 * implementations that use char* generic pointers, and those
1554 * that use void* generic pointers. It works with the latter 1829 * that use void* generic pointers. It works with the latter
@@ -1557,25 +1832,17 @@ yy_size_t size;
1557 * as though doing an assignment. 1832 * as though doing an assignment.
1558 */ 1833 */
1559 return (void *) realloc( (char *) ptr, size ); 1834 return (void *) realloc( (char *) ptr, size );
1560 } 1835}
1836
1837void yyfree (void * ptr )
1838{
1839 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
1840}
1841
1842#define YYTABLES_NAME "yytables"
1843
1844#line 60 "calc.l"
1561 1845
1562#ifdef YY_USE_PROTOS
1563static void yy_flex_free( void *ptr )
1564#else
1565static void yy_flex_free( ptr )
1566void *ptr;
1567#endif
1568 {
1569 free( ptr );
1570 }
1571 1846
1572#if YY_MAIN
1573int main()
1574 {
1575 yylex();
1576 return 0;
1577 }
1578#endif
1579#line 59 "calc.l"
1580 1847
1581 1848
diff --git a/src/calc_parse.c b/src/calc_parse.c
index bf7bc2c..60e1a3c 100644
--- a/src/calc_parse.c
+++ b/src/calc_parse.c
@@ -1,12 +1,13 @@
1/* A Bison parser, made by GNU Bison 1.875. */ 1/* A Bison parser, made by GNU Bison 3.0.4. */
2 2
3/* Skeleton parser for Yacc-like parsing with Bison, 3/* Bison implementation for Yacc-like parsers in C
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.
5 4
6 This program is free software; you can redistribute it and/or modify 5 Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
6
7 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by 8 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option) 9 the Free Software Foundation, either version 3 of the License, or
9 any later version. 10 (at your option) any later version.
10 11
11 This program is distributed in the hope that it will be useful, 12 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -14,17 +15,23 @@
14 GNU General Public License for more details. 15 GNU General Public License for more details.
15 16
16 You should have received a copy of the GNU General Public License 17 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software 18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
18 Foundation, Inc., 59 Temple Place - Suite 330, 19
19 Boston, MA 02111-1307, USA. */ 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.
20 29
21/* As a special exception, when this file is copied by Bison into a 30 This special exception was added by the Free Software Foundation in
22 Bison output file, you may use that output file without restriction. 31 version 2.2 of Bison. */
23 This special exception was added by the Free Software Foundation
24 in version 1.24 of Bison. */
25 32
26/* Written by Richard Stallman by simplifying the original so called 33/* C LALR(1) parser skeleton written by Richard Stallman, by
27 ``semantic'' parser. */ 34 simplifying the original so-called "semantic" parser. */
28 35
29/* All symbols defined below should begin with yy or YY, to avoid 36/* All symbols defined below should begin with yy or YY, to avoid
30 infringing on user name space. This should be done even for local 37 infringing on user name space. This should be done even for local
@@ -36,43 +43,26 @@
36/* Identify Bison output. */ 43/* Identify Bison output. */
37#define YYBISON 1 44#define YYBISON 1
38 45
46/* Bison version. */
47#define YYBISON_VERSION "3.0.4"
48
39/* Skeleton name. */ 49/* Skeleton name. */
40#define YYSKELETON_NAME "yacc.c" 50#define YYSKELETON_NAME "yacc.c"
41 51
42/* Pure parsers. */ 52/* Pure parsers. */
43#define YYPURE 0 53#define YYPURE 0
44 54
45/* Using locations. */ 55/* Push parsers. */
46#define YYLSP_NEEDED 0 56#define YYPUSH 0
47 57
48 58/* Pull parsers. */
49 59#define YYPULL 1
50/* Tokens. */
51#ifndef YYTOKENTYPE
52# define YYTOKENTYPE
53 /* Put the tokens into the symbol table, so that GDB and other debuggers
54 know about them. */
55 enum yytokentype {
56 NUM = 258,
57 VAR = 259,
58 FNCT = 260,
59 OBRAK = 261,
60 CBRAK = 262,
61 NEG = 263
62 };
63#endif
64#define NUM 258
65#define VAR 259
66#define FNCT 260
67#define OBRAK 261
68#define CBRAK 262
69#define NEG 263
70 60
71 61
72 62
73 63
74/* Copy the first part of user declarations. */ 64/* Copy the first part of user declarations. */
75#line 1 "calc.y" 65#line 1 "calc.y" /* yacc.c:339 */
76 66
77#include <math.h> /* For math functions, cos(), sin(), etc. */ 67#include <math.h> /* For math functions, cos(), sin(), etc. */
78#include "calc.h" 68#include "calc.h"
@@ -82,16 +72,22 @@
82 72
83void 73void
84yyerror (const char *s); 74yyerror (const char *s);
75int
76yylex();
85 77
86double _result; 78double _result;
87char tmp[BUFLEN]; 79char tmp[BUFLEN];
88 80
89 81
82#line 83 "calc_parse.c" /* yacc.c:339 */
90 83
91/* Enabling traces. */ 84# ifndef YY_NULLPTR
92#ifndef YYDEBUG 85# if defined __cplusplus && 201103L <= __cplusplus
93# define YYDEBUG 0 86# define YY_NULLPTR nullptr
94#endif 87# else
88# define YY_NULLPTR 0
89# endif
90# endif
95 91
96/* Enabling verbose error messages. */ 92/* Enabling verbose error messages. */
97#ifdef YYERROR_VERBOSE 93#ifdef YYERROR_VERBOSE
@@ -101,69 +97,245 @@ char tmp[BUFLEN];
101# define YYERROR_VERBOSE 0 97# define YYERROR_VERBOSE 0
102#endif 98#endif
103 99
104#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) 100
105#line 14 "calc.y" 101/* Debug traces. */
106typedef union YYSTYPE { 102#ifndef YYDEBUG
103# define YYDEBUG 0
104#endif
105#if YYDEBUG
106extern int yydebug;
107#endif
108
109/* Token type. */
110#ifndef YYTOKENTYPE
111# define YYTOKENTYPE
112 enum yytokentype
113 {
114 NUM = 258,
115 VAR = 259,
116 FNCT = 260,
117 OBRAK = 261,
118 CBRAK = 262,
119 NEG = 263
120 };
121#endif
122
123/* Value type. */
124#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
125
126union YYSTYPE
127{
128#line 17 "calc.y" /* yacc.c:355 */
129
107double val; /* For returning numbers. */ 130double val; /* For returning numbers. */
108symrec *tptr; /* For returning symbol-table pointers */ 131symrec *tptr; /* For returning symbol-table pointers */
109} YYSTYPE; 132
110/* Line 191 of yacc.c. */ 133#line 134 "calc_parse.c" /* yacc.c:355 */
111#line 110 "calc_parse.c" 134};
112# define yystype YYSTYPE /* obsolescent; will be withdrawn */ 135
113# define YYSTYPE_IS_DECLARED 1 136typedef union YYSTYPE YYSTYPE;
114# define YYSTYPE_IS_TRIVIAL 1 137# define YYSTYPE_IS_TRIVIAL 1
138# define YYSTYPE_IS_DECLARED 1
115#endif 139#endif
116 140
117 141
142extern YYSTYPE yylval;
143
144int yyparse (void);
145
146
118 147
119/* Copy the second part of user declarations. */ 148/* Copy the second part of user declarations. */
120 149
150#line 151 "calc_parse.c" /* yacc.c:358 */
121 151
122/* Line 214 of yacc.c. */ 152#ifdef short
123#line 122 "calc_parse.c" 153# undef short
154#endif
124 155
125#if ! defined (yyoverflow) || YYERROR_VERBOSE 156#ifdef YYTYPE_UINT8
157typedef YYTYPE_UINT8 yytype_uint8;
158#else
159typedef unsigned char yytype_uint8;
160#endif
126 161
127/* The parser invokes alloca or malloc; define the necessary symbols. */ 162#ifdef YYTYPE_INT8
163typedef YYTYPE_INT8 yytype_int8;
164#else
165typedef signed char yytype_int8;
166#endif
167
168#ifdef YYTYPE_UINT16
169typedef YYTYPE_UINT16 yytype_uint16;
170#else
171typedef unsigned short int yytype_uint16;
172#endif
128 173
129# if YYSTACK_USE_ALLOCA 174#ifdef YYTYPE_INT16
130# define YYSTACK_ALLOC alloca 175typedef YYTYPE_INT16 yytype_int16;
176#else
177typedef short int yytype_int16;
178#endif
179
180#ifndef YYSIZE_T
181# ifdef __SIZE_TYPE__
182# define YYSIZE_T __SIZE_TYPE__
183# elif defined size_t
184# define YYSIZE_T size_t
185# elif ! defined YYSIZE_T
186# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
187# define YYSIZE_T size_t
131# else 188# else
132# ifndef YYSTACK_USE_ALLOCA 189# define YYSIZE_T unsigned int
133# if defined (alloca) || defined (_ALLOCA_H) 190# endif
134# define YYSTACK_ALLOC alloca 191#endif
192
193#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
194
195#ifndef YY_
196# if defined YYENABLE_NLS && YYENABLE_NLS
197# if ENABLE_NLS
198# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
199# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
200# endif
201# endif
202# ifndef YY_
203# define YY_(Msgid) Msgid
204# endif
205#endif
206
207#ifndef YY_ATTRIBUTE
208# if (defined __GNUC__ \
209 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
210 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
211# define YY_ATTRIBUTE(Spec) __attribute__(Spec)
212# else
213# define YY_ATTRIBUTE(Spec) /* empty */
214# endif
215#endif
216
217#ifndef YY_ATTRIBUTE_PURE
218# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
219#endif
220
221#ifndef YY_ATTRIBUTE_UNUSED
222# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
223#endif
224
225#if !defined _Noreturn \
226 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
227# if defined _MSC_VER && 1200 <= _MSC_VER
228# define _Noreturn __declspec (noreturn)
229# else
230# define _Noreturn YY_ATTRIBUTE ((__noreturn__))
231# endif
232#endif
233
234/* Suppress unused-variable warnings by "using" E. */
235#if ! defined lint || defined __GNUC__
236# define YYUSE(E) ((void) (E))
237#else
238# define YYUSE(E) /* empty */
239#endif
240
241#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
242/* Suppress an incorrect diagnostic about yylval being uninitialized. */
243# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
244 _Pragma ("GCC diagnostic push") \
245 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
246 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
247# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
248 _Pragma ("GCC diagnostic pop")
249#else
250# define YY_INITIAL_VALUE(Value) Value
251#endif
252#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
253# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
254# define YY_IGNORE_MAYBE_UNINITIALIZED_END
255#endif
256#ifndef YY_INITIAL_VALUE
257# define YY_INITIAL_VALUE(Value) /* Nothing. */
258#endif
259
260
261#if ! defined yyoverflow || YYERROR_VERBOSE
262
263/* The parser invokes alloca or malloc; define the necessary symbols. */
264
265# ifdef YYSTACK_USE_ALLOCA
266# if YYSTACK_USE_ALLOCA
267# ifdef __GNUC__
268# define YYSTACK_ALLOC __builtin_alloca
269# elif defined __BUILTIN_VA_ARG_INCR
270# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
271# elif defined _AIX
272# define YYSTACK_ALLOC __alloca
273# elif defined _MSC_VER
274# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
275# define alloca _alloca
135# else 276# else
136# ifdef __GNUC__ 277# define YYSTACK_ALLOC alloca
137# define YYSTACK_ALLOC __builtin_alloca 278# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
279# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
280 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
281# ifndef EXIT_SUCCESS
282# define EXIT_SUCCESS 0
283# endif
138# endif 284# endif
139# endif 285# endif
140# endif 286# endif
141# endif 287# endif
142 288
143# ifdef YYSTACK_ALLOC 289# ifdef YYSTACK_ALLOC
144 /* Pacify GCC's `empty if-body' warning. */ 290 /* Pacify GCC's 'empty if-body' warning. */
145# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) 291# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
292# ifndef YYSTACK_ALLOC_MAXIMUM
293 /* The OS might guarantee only one guard page at the bottom of the stack,
294 and a page size can be as small as 4096 bytes. So we cannot safely
295 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
296 to allow for a few compiler-allocated temporary stack slots. */
297# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
298# endif
146# else 299# else
147# if defined (__STDC__) || defined (__cplusplus) 300# define YYSTACK_ALLOC YYMALLOC
301# define YYSTACK_FREE YYFREE
302# ifndef YYSTACK_ALLOC_MAXIMUM
303# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
304# endif
305# if (defined __cplusplus && ! defined EXIT_SUCCESS \
306 && ! ((defined YYMALLOC || defined malloc) \
307 && (defined YYFREE || defined free)))
148# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 308# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
149# define YYSIZE_T size_t 309# ifndef EXIT_SUCCESS
310# define EXIT_SUCCESS 0
311# endif
312# endif
313# ifndef YYMALLOC
314# define YYMALLOC malloc
315# if ! defined malloc && ! defined EXIT_SUCCESS
316void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
317# endif
318# endif
319# ifndef YYFREE
320# define YYFREE free
321# if ! defined free && ! defined EXIT_SUCCESS
322void free (void *); /* INFRINGES ON USER NAME SPACE */
323# endif
150# endif 324# endif
151# define YYSTACK_ALLOC malloc
152# define YYSTACK_FREE free
153# endif 325# endif
154#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ 326#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
155 327
156 328
157#if (! defined (yyoverflow) \ 329#if (! defined yyoverflow \
158 && (! defined (__cplusplus) \ 330 && (! defined __cplusplus \
159 || (YYSTYPE_IS_TRIVIAL))) 331 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
160 332
161/* A type that is properly aligned for any stack member. */ 333/* A type that is properly aligned for any stack member. */
162union yyalloc 334union yyalloc
163{ 335{
164 short yyss; 336 yytype_int16 yyss_alloc;
165 YYSTYPE yyvs; 337 YYSTYPE yyvs_alloc;
166 }; 338};
167 339
168/* The size of the maximum gap between one aligned stack and the next. */ 340/* The size of the maximum gap between one aligned stack and the next. */
169# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) 341# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
@@ -171,74 +343,74 @@ union yyalloc
171/* The size of an array large to enough to hold all stacks, each with 343/* The size of an array large to enough to hold all stacks, each with
172 N elements. */ 344 N elements. */
173# define YYSTACK_BYTES(N) \ 345# define YYSTACK_BYTES(N) \
174 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ 346 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
175 + YYSTACK_GAP_MAXIMUM) 347 + YYSTACK_GAP_MAXIMUM)
176 348
177/* Copy COUNT objects from FROM to TO. The source and destination do 349# define YYCOPY_NEEDED 1
178 not overlap. */
179# ifndef YYCOPY
180# if 1 < __GNUC__
181# define YYCOPY(To, From, Count) \
182 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
183# else
184# define YYCOPY(To, From, Count) \
185 do \
186 { \
187 register YYSIZE_T yyi; \
188 for (yyi = 0; yyi < (Count); yyi++) \
189 (To)[yyi] = (From)[yyi]; \
190 } \
191 while (0)
192# endif
193# endif
194 350
195/* Relocate STACK from its old location to the new one. The 351/* Relocate STACK from its old location to the new one. The
196 local variables YYSIZE and YYSTACKSIZE give the old and new number of 352 local variables YYSIZE and YYSTACKSIZE give the old and new number of
197 elements in the stack, and YYPTR gives the new location of the 353 elements in the stack, and YYPTR gives the new location of the
198 stack. Advance YYPTR to a properly aligned location for the next 354 stack. Advance YYPTR to a properly aligned location for the next
199 stack. */ 355 stack. */
200# define YYSTACK_RELOCATE(Stack) \ 356# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
201 do \ 357 do \
202 { \ 358 { \
203 YYSIZE_T yynewbytes; \ 359 YYSIZE_T yynewbytes; \
204 YYCOPY (&yyptr->Stack, Stack, yysize); \ 360 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
205 Stack = &yyptr->Stack; \ 361 Stack = &yyptr->Stack_alloc; \
206 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 362 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
207 yyptr += yynewbytes / sizeof (*yyptr); \ 363 yyptr += yynewbytes / sizeof (*yyptr); \
208 } \ 364 } \
209 while (0) 365 while (0)
210 366
211#endif 367#endif
212 368
213#if defined (__STDC__) || defined (__cplusplus) 369#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
214 typedef signed char yysigned_char; 370/* Copy COUNT objects from SRC to DST. The source and destination do
215#else 371 not overlap. */
216 typedef short yysigned_char; 372# ifndef YYCOPY
217#endif 373# if defined __GNUC__ && 1 < __GNUC__
374# define YYCOPY(Dst, Src, Count) \
375 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
376# else
377# define YYCOPY(Dst, Src, Count) \
378 do \
379 { \
380 YYSIZE_T yyi; \
381 for (yyi = 0; yyi < (Count); yyi++) \
382 (Dst)[yyi] = (Src)[yyi]; \
383 } \
384 while (0)
385# endif
386# endif
387#endif /* !YYCOPY_NEEDED */
218 388
219/* YYFINAL -- State number of the termination state. */ 389/* YYFINAL -- State number of the termination state. */
220#define YYFINAL 12 390#define YYFINAL 12
221/* YYLAST -- Last index in YYTABLE. */ 391/* YYLAST -- Last index in YYTABLE. */
222#define YYLAST 44 392#define YYLAST 44
223 393
224/* YYNTOKENS -- Number of terminals. */ 394/* YYNTOKENS -- Number of terminals. */
225#define YYNTOKENS 15 395#define YYNTOKENS 15
226/* YYNNTS -- Number of nonterminals. */ 396/* YYNNTS -- Number of nonterminals. */
227#define YYNNTS 3 397#define YYNNTS 3
228/* YYNRULES -- Number of rules. */ 398/* YYNRULES -- Number of rules. */
229#define YYNRULES 14 399#define YYNRULES 14
230/* YYNRULES -- Number of states. */ 400/* YYNSTATES -- Number of states. */
231#define YYNSTATES 27 401#define YYNSTATES 27
232 402
233/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ 403/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
404 by yylex, with out-of-bounds checking. */
234#define YYUNDEFTOK 2 405#define YYUNDEFTOK 2
235#define YYMAXUTOK 263 406#define YYMAXUTOK 263
236 407
237#define YYTRANSLATE(YYX) \ 408#define YYTRANSLATE(YYX) \
238 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 409 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
239 410
240/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ 411/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
241static const unsigned char yytranslate[] = 412 as returned by yylex, without out-of-bounds checking. */
413static const yytype_uint8 yytranslate[] =
242{ 414{
243 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 415 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
244 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 416 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -270,105 +442,80 @@ static const unsigned char yytranslate[] =
270}; 442};
271 443
272#if YYDEBUG 444#if YYDEBUG
273/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in 445 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
274 YYRHS. */ 446static const yytype_uint8 yyrline[] =
275static const unsigned char yyprhs[] =
276{
277 0, 0, 3, 4, 6, 8, 10, 14, 19, 23,
278 27, 31, 35, 38, 42
279};
280
281/* YYRHS -- A `-1'-separated list of the rules' RHS. */
282static const yysigned_char yyrhs[] =
283{
284 16, 0, -1, -1, 17, -1, 3, -1, 4, -1,
285 4, 8, 17, -1, 5, 6, 17, 7, -1, 17,
286 10, 17, -1, 17, 9, 17, -1, 17, 11, 17,
287 -1, 17, 12, 17, -1, 9, 17, -1, 17, 14,
288 17, -1, 6, 17, 7, -1
289};
290
291/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
292static const unsigned char yyrline[] =
293{ 447{
294 0, 36, 36, 37, 40, 41, 42, 43, 44, 45, 448 0, 39, 39, 40, 43, 44, 45, 46, 47, 48,
295 46, 47, 48, 49, 50 449 49, 50, 51, 52, 53
296}; 450};
297#endif 451#endif
298 452
299#if YYDEBUG || YYERROR_VERBOSE 453#if YYDEBUG || YYERROR_VERBOSE || 0
300/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. 454/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
301 First, the terminals, then, starting at YYNTOKENS, nonterminals. */ 455 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
302static const char *const yytname[] = 456static const char *const yytname[] =
303{ 457{
304 "$end", "error", "$undefined", "NUM", "VAR", "FNCT", "OBRAK", "CBRAK", 458 "$end", "error", "$undefined", "NUM", "VAR", "FNCT", "OBRAK", "CBRAK",
305 "'='", "'-'", "'+'", "'*'", "'/'", "NEG", "'^'", "$accept", "input", 459 "'='", "'-'", "'+'", "'*'", "'/'", "NEG", "'^'", "$accept", "input",
306 "exp", 0 460 "exp", YY_NULLPTR
307}; 461};
308#endif 462#endif
309 463
310# ifdef YYPRINT 464# ifdef YYPRINT
311/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to 465/* YYTOKNUM[NUM] -- (External) token number corresponding to the
312 token YYLEX-NUM. */ 466 (internal) symbol number NUM (which must be that of a token). */
313static const unsigned short yytoknum[] = 467static const yytype_uint16 yytoknum[] =
314{ 468{
315 0, 256, 257, 258, 259, 260, 261, 262, 61, 45, 469 0, 256, 257, 258, 259, 260, 261, 262, 61, 45,
316 43, 42, 47, 263, 94 470 43, 42, 47, 263, 94
317}; 471};
318# endif 472# endif
319 473
320/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ 474#define YYPACT_NINF -8
321static const unsigned char yyr1[] =
322{
323 0, 15, 16, 16, 17, 17, 17, 17, 17, 17,
324 17, 17, 17, 17, 17
325};
326 475
327/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ 476#define yypact_value_is_default(Yystate) \
328static const unsigned char yyr2[] = 477 (!!((Yystate) == (-8)))
478
479#define YYTABLE_NINF -1
480
481#define yytable_value_is_error(Yytable_value) \
482 0
483
484 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
485 STATE-NUM. */
486static const yytype_int8 yypact[] =
329{ 487{
330 0, 2, 0, 1, 1, 1, 3, 4, 3, 3, 488 25, -8, -6, -3, 25, 25, 6, 26, 25, 25,
331 3, 3, 2, 3, 3 489 7, -7, -8, 25, 25, 25, 25, 25, 26, 13,
490 -8, 30, 30, -7, -7, -7, -8
332}; 491};
333 492
334/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state 493 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
335 STATE-NUM when YYTABLE doesn't specify something else to do. Zero 494 Performed when YYTABLE does not specify something else to do. Zero
336 means the default is an error. */ 495 means the default is an error. */
337static const unsigned char yydefact[] = 496static const yytype_uint8 yydefact[] =
338{ 497{
339 2, 4, 5, 0, 0, 0, 0, 3, 0, 0, 498 2, 4, 5, 0, 0, 0, 0, 3, 0, 0,
340 0, 12, 1, 0, 0, 0, 0, 0, 6, 0, 499 0, 12, 1, 0, 0, 0, 0, 0, 6, 0,
341 14, 9, 8, 10, 11, 13, 7 500 14, 9, 8, 10, 11, 13, 7
342}; 501};
343 502
344/* YYDEFGOTO[NTERM-NUM]. */ 503 /* YYPGOTO[NTERM-NUM]. */
345static const yysigned_char yydefgoto[] = 504static const yytype_int8 yypgoto[] =
346{ 505{
347 -1, 6, 7 506 -8, -8, -4
348};
349
350/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
351 STATE-NUM. */
352#define YYPACT_NINF -8
353static const yysigned_char yypact[] =
354{
355 25, -8, -6, -3, 25, 25, 6, 26, 25, 25,
356 7, -7, -8, 25, 25, 25, 25, 25, 26, 13,
357 -8, 30, 30, -7, -7, -7, -8
358}; 507};
359 508
360/* YYPGOTO[NTERM-NUM]. */ 509 /* YYDEFGOTO[NTERM-NUM]. */
361static const yysigned_char yypgoto[] = 510static const yytype_int8 yydefgoto[] =
362{ 511{
363 -8, -8, -4 512 -1, 6, 7
364}; 513};
365 514
366/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If 515 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
367 positive, shift that token. If negative, reduce the rule which 516 positive, shift that token. If negative, reduce the rule whose
368 number is the opposite. If zero, do what YYDEFACT says. 517 number is the opposite. If YYTABLE_NINF, syntax error. */
369 If YYTABLE_NINF, syntax error. */ 518static const yytype_uint8 yytable[] =
370#define YYTABLE_NINF -1
371static const unsigned char yytable[] =
372{ 519{
373 10, 11, 8, 9, 18, 19, 12, 17, 0, 21, 520 10, 11, 8, 9, 18, 19, 12, 17, 0, 21,
374 22, 23, 24, 25, 20, 0, 13, 14, 15, 16, 521 22, 23, 24, 25, 20, 0, 13, 14, 15, 16,
@@ -377,7 +524,7 @@ static const unsigned char yytable[] =
377 17, 15, 16, 0, 17 524 17, 15, 16, 0, 17
378}; 525};
379 526
380static const yysigned_char yycheck[] = 527static const yytype_int8 yycheck[] =
381{ 528{
382 4, 5, 8, 6, 8, 9, 0, 14, -1, 13, 529 4, 5, 8, 6, 8, 9, 0, 14, -1, 13,
383 14, 15, 16, 17, 7, -1, 9, 10, 11, 12, 530 14, 15, 16, 17, 7, -1, 9, 10, 11, 12,
@@ -386,87 +533,64 @@ static const yysigned_char yycheck[] =
386 14, 11, 12, -1, 14 533 14, 11, 12, -1, 14
387}; 534};
388 535
389/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing 536 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
390 symbol of state STATE-NUM. */ 537 symbol of state STATE-NUM. */
391static const unsigned char yystos[] = 538static const yytype_uint8 yystos[] =
392{ 539{
393 0, 3, 4, 5, 6, 9, 16, 17, 8, 6, 540 0, 3, 4, 5, 6, 9, 16, 17, 8, 6,
394 17, 17, 0, 9, 10, 11, 12, 14, 17, 17, 541 17, 17, 0, 9, 10, 11, 12, 14, 17, 17,
395 7, 17, 17, 17, 17, 17, 7 542 7, 17, 17, 17, 17, 17, 7
396}; 543};
397 544
398#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) 545 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
399# define YYSIZE_T __SIZE_TYPE__ 546static const yytype_uint8 yyr1[] =
400#endif 547{
401#if ! defined (YYSIZE_T) && defined (size_t) 548 0, 15, 16, 16, 17, 17, 17, 17, 17, 17,
402# define YYSIZE_T size_t 549 17, 17, 17, 17, 17
403#endif 550};
404#if ! defined (YYSIZE_T)
405# if defined (__STDC__) || defined (__cplusplus)
406# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
407# define YYSIZE_T size_t
408# endif
409#endif
410#if ! defined (YYSIZE_T)
411# define YYSIZE_T unsigned int
412#endif
413 551
414#define yyerrok (yyerrstatus = 0) 552 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
415#define yyclearin (yychar = YYEMPTY) 553static const yytype_uint8 yyr2[] =
416#define YYEMPTY (-2) 554{
417#define YYEOF 0 555 0, 2, 0, 1, 1, 1, 3, 4, 3, 3,
556 3, 3, 2, 3, 3
557};
418 558
419#define YYACCEPT goto yyacceptlab
420#define YYABORT goto yyabortlab
421#define YYERROR goto yyerrlab1
422 559
560#define yyerrok (yyerrstatus = 0)
561#define yyclearin (yychar = YYEMPTY)
562#define YYEMPTY (-2)
563#define YYEOF 0
423 564
424/* Like YYERROR except do call yyerror. This remains here temporarily 565#define YYACCEPT goto yyacceptlab
425 to ease the transition to the new meaning of YYERROR, for GCC. 566#define YYABORT goto yyabortlab
426 Once GCC version 2 has supplanted version 1, this can go. */ 567#define YYERROR goto yyerrorlab
427 568
428#define YYFAIL goto yyerrlab
429 569
430#define YYRECOVERING() (!!yyerrstatus) 570#define YYRECOVERING() (!!yyerrstatus)
431 571
432#define YYBACKUP(Token, Value) \ 572#define YYBACKUP(Token, Value) \
433do \ 573do \
434 if (yychar == YYEMPTY && yylen == 1) \ 574 if (yychar == YYEMPTY) \
435 { \ 575 { \
436 yychar = (Token); \ 576 yychar = (Token); \
437 yylval = (Value); \ 577 yylval = (Value); \
438 yytoken = YYTRANSLATE (yychar); \ 578 YYPOPSTACK (yylen); \
439 YYPOPSTACK; \ 579 yystate = *yyssp; \
440 goto yybackup; \ 580 goto yybackup; \
441 } \ 581 } \
442 else \ 582 else \
443 { \ 583 { \
444 yyerror ("syntax error: cannot back up");\ 584 yyerror (YY_("syntax error: cannot back up")); \
445 YYERROR; \ 585 YYERROR; \
446 } \ 586 } \
447while (0) 587while (0)
448 588
449#define YYTERROR 1 589/* Error token number */
450#define YYERRCODE 256 590#define YYTERROR 1
591#define YYERRCODE 256
451 592
452/* YYLLOC_DEFAULT -- Compute the default location (before the actions
453 are run). */
454 593
455#ifndef YYLLOC_DEFAULT
456# define YYLLOC_DEFAULT(Current, Rhs, N) \
457 Current.first_line = Rhs[1].first_line; \
458 Current.first_column = Rhs[1].first_column; \
459 Current.last_line = Rhs[N].last_line; \
460 Current.last_column = Rhs[N].last_column;
461#endif
462
463/* YYLEX -- calling `yylex' with the right arguments. */
464
465#ifdef YYLEX_PARAM
466# define YYLEX yylex (YYLEX_PARAM)
467#else
468# define YYLEX yylex ()
469#endif
470 594
471/* Enable debugging if requested. */ 595/* Enable debugging if requested. */
472#if YYDEBUG 596#if YYDEBUG
@@ -476,54 +600,84 @@ while (0)
476# define YYFPRINTF fprintf 600# define YYFPRINTF fprintf
477# endif 601# endif
478 602
479# define YYDPRINTF(Args) \ 603# define YYDPRINTF(Args) \
480do { \ 604do { \
481 if (yydebug) \ 605 if (yydebug) \
482 YYFPRINTF Args; \ 606 YYFPRINTF Args; \
483} while (0) 607} while (0)
484 608
485# define YYDSYMPRINT(Args) \ 609/* This macro is provided for backward compatibility. */
486do { \ 610#ifndef YY_LOCATION_PRINT
487 if (yydebug) \ 611# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
488 yysymprint Args; \ 612#endif
489} while (0) 613
490 614
491# define YYDSYMPRINTF(Title, Token, Value, Location) \ 615# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
492do { \ 616do { \
493 if (yydebug) \ 617 if (yydebug) \
494 { \ 618 { \
495 YYFPRINTF (stderr, "%s ", Title); \ 619 YYFPRINTF (stderr, "%s ", Title); \
496 yysymprint (stderr, \ 620 yy_symbol_print (stderr, \
497 Token, Value); \ 621 Type, Value); \
498 YYFPRINTF (stderr, "\n"); \ 622 YYFPRINTF (stderr, "\n"); \
499 } \ 623 } \
500} while (0) 624} while (0)
501 625
626
627/*----------------------------------------.
628| Print this symbol's value on YYOUTPUT. |
629`----------------------------------------*/
630
631static void
632yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
633{
634 FILE *yyo = yyoutput;
635 YYUSE (yyo);
636 if (!yyvaluep)
637 return;
638# ifdef YYPRINT
639 if (yytype < YYNTOKENS)
640 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
641# endif
642 YYUSE (yytype);
643}
644
645
646/*--------------------------------.
647| Print this symbol on YYOUTPUT. |
648`--------------------------------*/
649
650static void
651yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
652{
653 YYFPRINTF (yyoutput, "%s %s (",
654 yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
655
656 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
657 YYFPRINTF (yyoutput, ")");
658}
659
502/*------------------------------------------------------------------. 660/*------------------------------------------------------------------.
503| yy_stack_print -- Print the state stack from its BOTTOM up to its | 661| yy_stack_print -- Print the state stack from its BOTTOM up to its |
504| TOP (cinluded). | 662| TOP (included). |
505`------------------------------------------------------------------*/ 663`------------------------------------------------------------------*/
506 664
507#if defined (__STDC__) || defined (__cplusplus)
508static void 665static void
509yy_stack_print (short *bottom, short *top) 666yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
510#else
511static void
512yy_stack_print (bottom, top)
513 short *bottom;
514 short *top;
515#endif
516{ 667{
517 YYFPRINTF (stderr, "Stack now"); 668 YYFPRINTF (stderr, "Stack now");
518 for (/* Nothing. */; bottom <= top; ++bottom) 669 for (; yybottom <= yytop; yybottom++)
519 YYFPRINTF (stderr, " %d", *bottom); 670 {
671 int yybot = *yybottom;
672 YYFPRINTF (stderr, " %d", yybot);
673 }
520 YYFPRINTF (stderr, "\n"); 674 YYFPRINTF (stderr, "\n");
521} 675}
522 676
523# define YY_STACK_PRINT(Bottom, Top) \ 677# define YY_STACK_PRINT(Bottom, Top) \
524do { \ 678do { \
525 if (yydebug) \ 679 if (yydebug) \
526 yy_stack_print ((Bottom), (Top)); \ 680 yy_stack_print ((Bottom), (Top)); \
527} while (0) 681} while (0)
528 682
529 683
@@ -531,29 +685,30 @@ do { \
531| Report that the YYRULE is going to be reduced. | 685| Report that the YYRULE is going to be reduced. |
532`------------------------------------------------*/ 686`------------------------------------------------*/
533 687
534#if defined (__STDC__) || defined (__cplusplus)
535static void 688static void
536yy_reduce_print (int yyrule) 689yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
537#else
538static void
539yy_reduce_print (yyrule)
540 int yyrule;
541#endif
542{ 690{
691 unsigned long int yylno = yyrline[yyrule];
692 int yynrhs = yyr2[yyrule];
543 int yyi; 693 int yyi;
544 unsigned int yylineno = yyrline[yyrule]; 694 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
545 YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", 695 yyrule - 1, yylno);
546 yyrule - 1, yylineno); 696 /* The symbols being reduced. */
547 /* Print the symbols being reduced, and their result. */ 697 for (yyi = 0; yyi < yynrhs; yyi++)
548 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) 698 {
549 YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); 699 YYFPRINTF (stderr, " $%d = ", yyi + 1);
550 YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); 700 yy_symbol_print (stderr,
701 yystos[yyssp[yyi + 1 - yynrhs]],
702 &(yyvsp[(yyi + 1) - (yynrhs)])
703 );
704 YYFPRINTF (stderr, "\n");
705 }
551} 706}
552 707
553# define YY_REDUCE_PRINT(Rule) \ 708# define YY_REDUCE_PRINT(Rule) \
554do { \ 709do { \
555 if (yydebug) \ 710 if (yydebug) \
556 yy_reduce_print (Rule); \ 711 yy_reduce_print (yyssp, yyvsp, Rule); \
557} while (0) 712} while (0)
558 713
559/* Nonzero means print parse trace. It is left uninitialized so that 714/* Nonzero means print parse trace. It is left uninitialized so that
@@ -561,15 +716,14 @@ do { \
561int yydebug; 716int yydebug;
562#else /* !YYDEBUG */ 717#else /* !YYDEBUG */
563# define YYDPRINTF(Args) 718# define YYDPRINTF(Args)
564# define YYDSYMPRINT(Args) 719# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
565# define YYDSYMPRINTF(Title, Token, Value, Location)
566# define YY_STACK_PRINT(Bottom, Top) 720# define YY_STACK_PRINT(Bottom, Top)
567# define YY_REDUCE_PRINT(Rule) 721# define YY_REDUCE_PRINT(Rule)
568#endif /* !YYDEBUG */ 722#endif /* !YYDEBUG */
569 723
570 724
571/* YYINITDEPTH -- initial size of the parser's stacks. */ 725/* YYINITDEPTH -- initial size of the parser's stacks. */
572#ifndef YYINITDEPTH 726#ifndef YYINITDEPTH
573# define YYINITDEPTH 200 727# define YYINITDEPTH 200
574#endif 728#endif
575 729
@@ -577,61 +731,43 @@ int yydebug;
577 if the built-in stack extension method is used). 731 if the built-in stack extension method is used).
578 732
579 Do not make this value too large; the results are undefined if 733 Do not make this value too large; the results are undefined if
580 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) 734 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
581 evaluated with infinite-precision integer arithmetic. */ 735 evaluated with infinite-precision integer arithmetic. */
582 736
583#if YYMAXDEPTH == 0
584# undef YYMAXDEPTH
585#endif
586
587#ifndef YYMAXDEPTH 737#ifndef YYMAXDEPTH
588# define YYMAXDEPTH 10000 738# define YYMAXDEPTH 10000
589#endif 739#endif
590 740
591
592 741
593#if YYERROR_VERBOSE 742#if YYERROR_VERBOSE
594 743
595# ifndef yystrlen 744# ifndef yystrlen
596# if defined (__GLIBC__) && defined (_STRING_H) 745# if defined __GLIBC__ && defined _STRING_H
597# define yystrlen strlen 746# define yystrlen strlen
598# else 747# else
599/* Return the length of YYSTR. */ 748/* Return the length of YYSTR. */
600static YYSIZE_T 749static YYSIZE_T
601# if defined (__STDC__) || defined (__cplusplus)
602yystrlen (const char *yystr) 750yystrlen (const char *yystr)
603# else
604yystrlen (yystr)
605 const char *yystr;
606# endif
607{ 751{
608 register const char *yys = yystr; 752 YYSIZE_T yylen;
609 753 for (yylen = 0; yystr[yylen]; yylen++)
610 while (*yys++ != '\0')
611 continue; 754 continue;
612 755 return yylen;
613 return yys - yystr - 1;
614} 756}
615# endif 757# endif
616# endif 758# endif
617 759
618# ifndef yystpcpy 760# ifndef yystpcpy
619# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) 761# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
620# define yystpcpy stpcpy 762# define yystpcpy stpcpy
621# else 763# else
622/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in 764/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
623 YYDEST. */ 765 YYDEST. */
624static char * 766static char *
625# if defined (__STDC__) || defined (__cplusplus)
626yystpcpy (char *yydest, const char *yysrc) 767yystpcpy (char *yydest, const char *yysrc)
627# else
628yystpcpy (yydest, yysrc)
629 char *yydest;
630 const char *yysrc;
631# endif
632{ 768{
633 register char *yyd = yydest; 769 char *yyd = yydest;
634 register const char *yys = yysrc; 770 const char *yys = yysrc;
635 771
636 while ((*yyd++ = *yys++) != '\0') 772 while ((*yyd++ = *yys++) != '\0')
637 continue; 773 continue;
@@ -641,89 +777,207 @@ yystpcpy (yydest, yysrc)
641# endif 777# endif
642# endif 778# endif
643 779
644#endif /* !YYERROR_VERBOSE */ 780# ifndef yytnamerr
781/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
782 quotes and backslashes, so that it's suitable for yyerror. The
783 heuristic is that double-quoting is unnecessary unless the string
784 contains an apostrophe, a comma, or backslash (other than
785 backslash-backslash). YYSTR is taken from yytname. If YYRES is
786 null, do not copy; instead, return the length of what the result
787 would have been. */
788static YYSIZE_T
789yytnamerr (char *yyres, const char *yystr)
790{
791 if (*yystr == '"')
792 {
793 YYSIZE_T yyn = 0;
794 char const *yyp = yystr;
795
796 for (;;)
797 switch (*++yyp)
798 {
799 case '\'':
800 case ',':
801 goto do_not_strip_quotes;
802
803 case '\\':
804 if (*++yyp != '\\')
805 goto do_not_strip_quotes;
806 /* Fall through. */
807 default:
808 if (yyres)
809 yyres[yyn] = *yyp;
810 yyn++;
811 break;
812
813 case '"':
814 if (yyres)
815 yyres[yyn] = '\0';
816 return yyn;
817 }
818 do_not_strip_quotes: ;
819 }
645 820
646 821 if (! yyres)
822 return yystrlen (yystr);
647 823
648#if YYDEBUG 824 return yystpcpy (yyres, yystr) - yyres;
649/*--------------------------------. 825}
650| Print this symbol on YYOUTPUT. | 826# endif
651`--------------------------------*/
652 827
653#if defined (__STDC__) || defined (__cplusplus) 828/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
654static void 829 about the unexpected token YYTOKEN for the state stack whose top is
655yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) 830 YYSSP.
656#else 831
657static void 832 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
658yysymprint (yyoutput, yytype, yyvaluep) 833 not large enough to hold the message. In that case, also set
659 FILE *yyoutput; 834 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
660 int yytype; 835 required number of bytes is too large to store. */
661 YYSTYPE *yyvaluep; 836static int
662#endif 837yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
838 yytype_int16 *yyssp, int yytoken)
663{ 839{
664 /* Pacify ``unused variable'' warnings. */ 840 YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
665 (void) yyvaluep; 841 YYSIZE_T yysize = yysize0;
842 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
843 /* Internationalized format string. */
844 const char *yyformat = YY_NULLPTR;
845 /* Arguments of yyformat. */
846 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
847 /* Number of reported tokens (one for the "unexpected", one per
848 "expected"). */
849 int yycount = 0;
850
851 /* There are many possibilities here to consider:
852 - If this state is a consistent state with a default action, then
853 the only way this function was invoked is if the default action
854 is an error action. In that case, don't check for expected
855 tokens because there are none.
856 - The only way there can be no lookahead present (in yychar) is if
857 this state is a consistent state with a default action. Thus,
858 detecting the absence of a lookahead is sufficient to determine
859 that there is no unexpected or expected token to report. In that
860 case, just report a simple "syntax error".
861 - Don't assume there isn't a lookahead just because this state is a
862 consistent state with a default action. There might have been a
863 previous inconsistent state, consistent state with a non-default
864 action, or user semantic action that manipulated yychar.
865 - Of course, the expected token list depends on states to have
866 correct lookahead information, and it depends on the parser not
867 to perform extra reductions after fetching a lookahead from the
868 scanner and before detecting a syntax error. Thus, state merging
869 (from LALR or IELR) and default reductions corrupt the expected
870 token list. However, the list is correct for canonical LR with
871 one exception: it will still contain any token that will not be
872 accepted due to an error action in a later state.
873 */
874 if (yytoken != YYEMPTY)
875 {
876 int yyn = yypact[*yyssp];
877 yyarg[yycount++] = yytname[yytoken];
878 if (!yypact_value_is_default (yyn))
879 {
880 /* Start YYX at -YYN if negative to avoid negative indexes in
881 YYCHECK. In other words, skip the first -YYN actions for
882 this state because they are default actions. */
883 int yyxbegin = yyn < 0 ? -yyn : 0;
884 /* Stay within bounds of both yycheck and yytname. */
885 int yychecklim = YYLAST - yyn + 1;
886 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
887 int yyx;
888
889 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
890 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
891 && !yytable_value_is_error (yytable[yyx + yyn]))
892 {
893 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
894 {
895 yycount = 1;
896 yysize = yysize0;
897 break;
898 }
899 yyarg[yycount++] = yytname[yyx];
900 {
901 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
902 if (! (yysize <= yysize1
903 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
904 return 2;
905 yysize = yysize1;
906 }
907 }
908 }
909 }
666 910
667 if (yytype < YYNTOKENS) 911 switch (yycount)
668 { 912 {
669 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); 913# define YYCASE_(N, S) \
670# ifdef YYPRINT 914 case N: \
671 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); 915 yyformat = S; \
672# endif 916 break
917 YYCASE_(0, YY_("syntax error"));
918 YYCASE_(1, YY_("syntax error, unexpected %s"));
919 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
920 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
921 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
922 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
923# undef YYCASE_
673 } 924 }
674 else
675 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
676 925
677 switch (yytype) 926 {
927 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
928 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
929 return 2;
930 yysize = yysize1;
931 }
932
933 if (*yymsg_alloc < yysize)
678 { 934 {
679 default: 935 *yymsg_alloc = 2 * yysize;
680 break; 936 if (! (yysize <= *yymsg_alloc
937 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
938 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
939 return 1;
681 } 940 }
682 YYFPRINTF (yyoutput, ")"); 941
942 /* Avoid sprintf, as that infringes on the user's name space.
943 Don't have undefined behavior even if the translation
944 produced a string with the wrong number of "%s"s. */
945 {
946 char *yyp = *yymsg;
947 int yyi = 0;
948 while ((*yyp = *yyformat) != '\0')
949 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
950 {
951 yyp += yytnamerr (yyp, yyarg[yyi++]);
952 yyformat += 2;
953 }
954 else
955 {
956 yyp++;
957 yyformat++;
958 }
959 }
960 return 0;
683} 961}
962#endif /* YYERROR_VERBOSE */
684 963
685#endif /* ! YYDEBUG */
686/*-----------------------------------------------. 964/*-----------------------------------------------.
687| Release the memory associated to this symbol. | 965| Release the memory associated to this symbol. |
688`-----------------------------------------------*/ 966`-----------------------------------------------*/
689 967
690#if defined (__STDC__) || defined (__cplusplus)
691static void
692yydestruct (int yytype, YYSTYPE *yyvaluep)
693#else
694static void 968static void
695yydestruct (yytype, yyvaluep) 969yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
696 int yytype;
697 YYSTYPE *yyvaluep;
698#endif
699{ 970{
700 /* Pacify ``unused variable'' warnings. */ 971 YYUSE (yyvaluep);
701 (void) yyvaluep; 972 if (!yymsg)
702 973 yymsg = "Deleting";
703 switch (yytype) 974 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
704 { 975
705 976 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
706 default: 977 YYUSE (yytype);
707 break; 978 YY_IGNORE_MAYBE_UNINITIALIZED_END
708 }
709} 979}
710
711 980
712/* Prevent warnings from -Wmissing-prototypes. */
713
714#ifdef YYPARSE_PARAM
715# if defined (__STDC__) || defined (__cplusplus)
716int yyparse (void *YYPARSE_PARAM);
717# else
718int yyparse ();
719# endif
720#else /* ! YYPARSE_PARAM */
721#if defined (__STDC__) || defined (__cplusplus)
722int yyparse (void);
723#else
724int yyparse ();
725#endif
726#endif /* ! YYPARSE_PARAM */
727 981
728 982
729 983
@@ -732,91 +986,71 @@ int yychar;
732 986
733/* The semantic value of the lookahead symbol. */ 987/* The semantic value of the lookahead symbol. */
734YYSTYPE yylval; 988YYSTYPE yylval;
735
736/* Number of syntax errors so far. */ 989/* Number of syntax errors so far. */
737int yynerrs; 990int yynerrs;
738 991
739 992
740
741/*----------. 993/*----------.
742| yyparse. | 994| yyparse. |
743`----------*/ 995`----------*/
744 996
745#ifdef YYPARSE_PARAM
746# if defined (__STDC__) || defined (__cplusplus)
747int yyparse (void *YYPARSE_PARAM)
748# else
749int yyparse (YYPARSE_PARAM)
750 void *YYPARSE_PARAM;
751# endif
752#else /* ! YYPARSE_PARAM */
753#if defined (__STDC__) || defined (__cplusplus)
754int 997int
755yyparse (void) 998yyparse (void)
756#else
757int
758yyparse ()
759
760#endif
761#endif
762{ 999{
763 1000 int yystate;
764 register int yystate; 1001 /* Number of tokens to shift before error messages enabled. */
765 register int yyn; 1002 int yyerrstatus;
766 int yyresult;
767 /* Number of tokens to shift before error messages enabled. */
768 int yyerrstatus;
769 /* Lookahead token as an internal (translated) token number. */
770 int yytoken = 0;
771 1003
772 /* Three stacks and their tools: 1004 /* The stacks and their tools:
773 `yyss': related to states, 1005 'yyss': related to states.
774 `yyvs': related to semantic values, 1006 'yyvs': related to semantic values.
775 `yyls': related to locations.
776 1007
777 Refer to the stacks thru separate pointers, to allow yyoverflow 1008 Refer to the stacks through separate pointers, to allow yyoverflow
778 to reallocate them elsewhere. */ 1009 to reallocate them elsewhere. */
779 1010
780 /* The state stack. */ 1011 /* The state stack. */
781 short yyssa[YYINITDEPTH]; 1012 yytype_int16 yyssa[YYINITDEPTH];
782 short *yyss = yyssa; 1013 yytype_int16 *yyss;
783 register short *yyssp; 1014 yytype_int16 *yyssp;
784 1015
785 /* The semantic value stack. */ 1016 /* The semantic value stack. */
786 YYSTYPE yyvsa[YYINITDEPTH]; 1017 YYSTYPE yyvsa[YYINITDEPTH];
787 YYSTYPE *yyvs = yyvsa; 1018 YYSTYPE *yyvs;
788 register YYSTYPE *yyvsp; 1019 YYSTYPE *yyvsp;
789 1020
1021 YYSIZE_T yystacksize;
790 1022
791 1023 int yyn;
792#define YYPOPSTACK (yyvsp--, yyssp--) 1024 int yyresult;
793 1025 /* Lookahead token as an internal (translated) token number. */
794 YYSIZE_T yystacksize = YYINITDEPTH; 1026 int yytoken = 0;
795
796 /* The variables used to return semantic value and location from the 1027 /* The variables used to return semantic value and location from the
797 action routines. */ 1028 action routines. */
798 YYSTYPE yyval; 1029 YYSTYPE yyval;
799 1030
1031#if YYERROR_VERBOSE
1032 /* Buffer for error messages, and its allocated size. */
1033 char yymsgbuf[128];
1034 char *yymsg = yymsgbuf;
1035 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1036#endif
1037
1038#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1039
1040 /* The number of symbols on the RHS of the reduced rule.
1041 Keep to zero when no symbol should be popped. */
1042 int yylen = 0;
800 1043
801 /* When reducing, the number of symbols on the RHS of the reduced 1044 yyssp = yyss = yyssa;
802 rule. */ 1045 yyvsp = yyvs = yyvsa;
803 int yylen; 1046 yystacksize = YYINITDEPTH;
804 1047
805 YYDPRINTF ((stderr, "Starting parse\n")); 1048 YYDPRINTF ((stderr, "Starting parse\n"));
806 1049
807 yystate = 0; 1050 yystate = 0;
808 yyerrstatus = 0; 1051 yyerrstatus = 0;
809 yynerrs = 0; 1052 yynerrs = 0;
810 yychar = YYEMPTY; /* Cause a token to be read. */ 1053 yychar = YYEMPTY; /* Cause a token to be read. */
811
812 /* Initialize stack pointers.
813 Waste one element of value and location stack
814 so that they stay on the same level as the state stack.
815 The wasted elements are never initialized. */
816
817 yyssp = yyss;
818 yyvsp = yyvs;
819
820 goto yysetstate; 1054 goto yysetstate;
821 1055
822/*------------------------------------------------------------. 1056/*------------------------------------------------------------.
@@ -824,8 +1058,7 @@ yyparse ()
824`------------------------------------------------------------*/ 1058`------------------------------------------------------------*/
825 yynewstate: 1059 yynewstate:
826 /* In all cases, when you get here, the value and location stacks 1060 /* In all cases, when you get here, the value and location stacks
827 have just been pushed. so pushing a state here evens the stacks. 1061 have just been pushed. So pushing a state here evens the stacks. */
828 */
829 yyssp++; 1062 yyssp++;
830 1063
831 yysetstate: 1064 yysetstate:
@@ -838,49 +1071,46 @@ yyparse ()
838 1071
839#ifdef yyoverflow 1072#ifdef yyoverflow
840 { 1073 {
841 /* Give user a chance to reallocate the stack. Use copies of 1074 /* Give user a chance to reallocate the stack. Use copies of
842 these so that the &'s don't force the real ones into 1075 these so that the &'s don't force the real ones into
843 memory. */ 1076 memory. */
844 YYSTYPE *yyvs1 = yyvs; 1077 YYSTYPE *yyvs1 = yyvs;
845 short *yyss1 = yyss; 1078 yytype_int16 *yyss1 = yyss;
846 1079
847 1080 /* Each stack pointer address is followed by the size of the
848 /* Each stack pointer address is followed by the size of the 1081 data in use in that stack, in bytes. This used to be a
849 data in use in that stack, in bytes. This used to be a 1082 conditional around just the two extra args, but that might
850 conditional around just the two extra args, but that might 1083 be undefined if yyoverflow is a macro. */
851 be undefined if yyoverflow is a macro. */ 1084 yyoverflow (YY_("memory exhausted"),
852 yyoverflow ("parser stack overflow", 1085 &yyss1, yysize * sizeof (*yyssp),
853 &yyss1, yysize * sizeof (*yyssp), 1086 &yyvs1, yysize * sizeof (*yyvsp),
854 &yyvs1, yysize * sizeof (*yyvsp), 1087 &yystacksize);
855 1088
856 &yystacksize); 1089 yyss = yyss1;
857 1090 yyvs = yyvs1;
858 yyss = yyss1;
859 yyvs = yyvs1;
860 } 1091 }
861#else /* no yyoverflow */ 1092#else /* no yyoverflow */
862# ifndef YYSTACK_RELOCATE 1093# ifndef YYSTACK_RELOCATE
863 goto yyoverflowlab; 1094 goto yyexhaustedlab;
864# else 1095# else
865 /* Extend the stack our own way. */ 1096 /* Extend the stack our own way. */
866 if (YYMAXDEPTH <= yystacksize) 1097 if (YYMAXDEPTH <= yystacksize)
867 goto yyoverflowlab; 1098 goto yyexhaustedlab;
868 yystacksize *= 2; 1099 yystacksize *= 2;
869 if (YYMAXDEPTH < yystacksize) 1100 if (YYMAXDEPTH < yystacksize)
870 yystacksize = YYMAXDEPTH; 1101 yystacksize = YYMAXDEPTH;
871 1102
872 { 1103 {
873 short *yyss1 = yyss; 1104 yytype_int16 *yyss1 = yyss;
874 union yyalloc *yyptr = 1105 union yyalloc *yyptr =
875 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 1106 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
876 if (! yyptr) 1107 if (! yyptr)
877 goto yyoverflowlab; 1108 goto yyexhaustedlab;
878 YYSTACK_RELOCATE (yyss); 1109 YYSTACK_RELOCATE (yyss_alloc, yyss);
879 YYSTACK_RELOCATE (yyvs); 1110 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
880
881# undef YYSTACK_RELOCATE 1111# undef YYSTACK_RELOCATE
882 if (yyss1 != yyssa) 1112 if (yyss1 != yyssa)
883 YYSTACK_FREE (yyss1); 1113 YYSTACK_FREE (yyss1);
884 } 1114 }
885# endif 1115# endif
886#endif /* no yyoverflow */ 1116#endif /* no yyoverflow */
@@ -888,16 +1118,18 @@ yyparse ()
888 yyssp = yyss + yysize - 1; 1118 yyssp = yyss + yysize - 1;
889 yyvsp = yyvs + yysize - 1; 1119 yyvsp = yyvs + yysize - 1;
890 1120
891
892 YYDPRINTF ((stderr, "Stack size increased to %lu\n", 1121 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
893 (unsigned long int) yystacksize)); 1122 (unsigned long int) yystacksize));
894 1123
895 if (yyss + yystacksize - 1 <= yyssp) 1124 if (yyss + yystacksize - 1 <= yyssp)
896 YYABORT; 1125 YYABORT;
897 } 1126 }
898 1127
899 YYDPRINTF ((stderr, "Entering state %d\n", yystate)); 1128 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
900 1129
1130 if (yystate == YYFINAL)
1131 YYACCEPT;
1132
901 goto yybackup; 1133 goto yybackup;
902 1134
903/*-----------. 1135/*-----------.
@@ -905,14 +1137,12 @@ yyparse ()
905`-----------*/ 1137`-----------*/
906yybackup: 1138yybackup:
907 1139
908/* Do appropriate processing given the current state. */ 1140 /* Do appropriate processing given the current state. Read a
909/* Read a lookahead token if we need one and don't already have one. */ 1141 lookahead token if we need one and don't already have one. */
910/* yyresume: */
911 1142
912 /* First try to decide what to do without reference to lookahead token. */ 1143 /* First try to decide what to do without reference to lookahead token. */
913
914 yyn = yypact[yystate]; 1144 yyn = yypact[yystate];
915 if (yyn == YYPACT_NINF) 1145