updated on Thu Jan 19 12:17:07 UTC 2012
[aur-mirror.git] / accent / accent.patch
blob736d8a20295d568601a0d86d2647a544394071a3
1 diff -ruN accent/accent/ana.c good/accent/ana.c
2 --- accent/accent/ana.c 2006-03-30 12:35:24.000000000 +0000
3 +++ good/accent/ana.c 2010-11-22 18:38:17.903333119 +0000
4 @@ -26,7 +26,8 @@
5 */
7 /*----------------------------------------------------------------------------*/
9 +#include <stdio.h>
10 +#include <stdlib.h>
11 #include "sets.h"
13 #define PUBLIC
14 diff -ruN accent/accent/bnf.c good/accent/bnf.c
15 --- accent/accent/bnf.c 2006-03-30 12:35:24.000000000 +0000
16 +++ good/accent/bnf.c 2010-11-22 18:38:42.656666452 +0000
17 @@ -1,3 +1,6 @@
18 +#include <stdio.h>
19 +#include <stdlib.h>
21 typedef long * yy;
22 #define yyu (-2147483647L)
23 static yy yynull;
24 diff -ruN accent/accent/errmsg.c good/accent/errmsg.c
25 --- accent/accent/errmsg.c 2006-03-30 12:35:24.000000000 +0000
26 +++ good/accent/errmsg.c 2010-11-22 18:40:25.819999790 +0000
27 @@ -20,6 +20,8 @@
28 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
31 +#include <stdio.h>
32 +#include <stdlib.h>
35 * errmsg.c
36 diff -ruN accent/accent/grts.c good/accent/grts.c
37 --- accent/accent/grts.c 2006-03-30 12:35:25.000000000 +0000
38 +++ good/accent/grts.c 2010-11-22 18:39:50.466666415 +0000
39 @@ -9,6 +9,8 @@
43 +#include <stdio.h>
44 +#include <stdlib.h>
46 /* Gentle Runtime System */
48 diff -ruN accent/accent/idents.c good/accent/idents.c
49 --- accent/accent/idents.c 2006-03-30 12:35:24.000000000 +0000
50 +++ good/accent/idents.c 2010-11-22 18:39:24.313333090 +0000
51 @@ -20,6 +20,8 @@
52 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
55 +#include <stdio.h>
56 +#include <stdlib.h>
58 #define PRIVATE static
60 diff -ruN accent/accent/main.c good/accent/main.c
61 --- accent/accent/main.c 2006-03-30 12:35:24.000000000 +0000
62 +++ good/accent/main.c 2010-11-22 18:38:56.456666482 +0000
63 @@ -22,6 +22,7 @@
66 #include <stdio.h>
67 +#include <stdlib.h>
69 extern FILE *yyin;
71 diff -ruN accent/accent/output.c good/accent/output.c
72 --- accent/accent/output.c 2006-03-30 12:35:24.000000000 +0000
73 +++ good/accent/output.c 2010-11-22 18:40:33.076666448 +0000
74 @@ -24,6 +24,7 @@
75 #define PRIVATE static
77 #include <stdio.h>
78 +#include <stdlib.h>
80 /*--------------------------------------------------------------------*/
82 diff -ruN accent/accent/sets.c good/accent/sets.c
83 --- accent/accent/sets.c 2006-03-30 12:35:24.000000000 +0000
84 +++ good/accent/sets.c 2010-11-22 18:39:57.569999785 +0000
85 @@ -26,6 +26,8 @@
89 +#include <stdio.h>
90 +#include <stdlib.h>
91 #include "sets.h"
93 #define PUBLIC
94 diff -ruN accent/accent/strings.c good/accent/strings.c
95 --- accent/accent/strings.c 2006-03-30 12:35:24.000000000 +0000
96 +++ good/accent/strings.c 2010-11-22 18:39:38.569999790 +0000
97 @@ -21,6 +21,8 @@
101 +#include <stdio.h>
102 +#include <stdlib.h>
103 #define PRIVATE static
105 /*--------------------------------------------------------------------*/
106 diff -ruN accent/entire/entire.c good/entire/entire.c
107 --- accent/entire/entire.c 2006-03-30 12:35:25.000000000 +0000
108 +++ good/entire/entire.c 2010-11-22 19:29:45.069999783 +0000
109 @@ -30,6 +30,7 @@
111 /*============================================================================*/
112 #include <stdlib.h>
113 +#include <stdio.h>
115 #define PRIVATE static
116 #define PUBLIC
117 diff -ruN accent/exmplaccent/auxil.c good/exmplaccent/auxil.c
118 --- accent/exmplaccent/auxil.c 2006-03-30 12:35:25.000000000 +0000
119 +++ good/exmplaccent/auxil.c 2010-11-22 19:30:43.129999785 +0000
120 @@ -1,3 +1,6 @@
121 +#include <stdio.h>
122 +#include <stdlib.h>
124 main()
126 yyparse();
127 diff -ruN accent/exmplaccent/build good/exmplaccent/build
128 --- accent/exmplaccent/build 2006-03-30 12:35:26.000000000 +0000
129 +++ good/exmplaccent/build 2010-11-22 19:33:43.523333117 +0000
130 @@ -9,6 +9,11 @@
132 $LEX spec.lex
134 +echo "#include <stdio.h>" > .tmp
135 +echo "#include <stdlib.h>" >> .tmp
136 +cat yygrammar.c >> .tmp
137 +mv .tmp yygrammar.c
139 $CC -o calculator yygrammar.c lex.yy.c auxil.c $ENTIRE
141 -calculator < input
142 +./calculator < input
143 diff -ruN accent/exmplaccent/lex.yy.c good/exmplaccent/lex.yy.c
144 --- accent/exmplaccent/lex.yy.c 1970-01-01 00:00:00.000000000 +0000
145 +++ good/exmplaccent/lex.yy.c 2010-11-22 19:33:47.833333118 +0000
146 @@ -0,0 +1,1816 @@
148 +#line 3 "lex.yy.c"
150 +#define YY_INT_ALIGNED short int
152 +/* A lexical scanner generated by flex */
154 +#define FLEX_SCANNER
155 +#define YY_FLEX_MAJOR_VERSION 2
156 +#define YY_FLEX_MINOR_VERSION 5
157 +#define YY_FLEX_SUBMINOR_VERSION 35
158 +#if YY_FLEX_SUBMINOR_VERSION > 0
159 +#define FLEX_BETA
160 +#endif
162 +/* First, we deal with platform-specific or compiler-specific issues. */
164 +/* begin standard C headers. */
165 +#include <stdio.h>
166 +#include <string.h>
167 +#include <errno.h>
168 +#include <stdlib.h>
170 +/* end standard C headers. */
172 +/* flex integer type definitions */
174 +#ifndef FLEXINT_H
175 +#define FLEXINT_H
177 +/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
179 +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
181 +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
182 + * if you want the limit (max/min) macros for int types.
183 + */
184 +#ifndef __STDC_LIMIT_MACROS
185 +#define __STDC_LIMIT_MACROS 1
186 +#endif
188 +#include <inttypes.h>
189 +typedef int8_t flex_int8_t;
190 +typedef uint8_t flex_uint8_t;
191 +typedef int16_t flex_int16_t;
192 +typedef uint16_t flex_uint16_t;
193 +typedef int32_t flex_int32_t;
194 +typedef uint32_t flex_uint32_t;
195 +#else
196 +typedef signed char flex_int8_t;
197 +typedef short int flex_int16_t;
198 +typedef int flex_int32_t;
199 +typedef unsigned char flex_uint8_t;
200 +typedef unsigned short int flex_uint16_t;
201 +typedef unsigned int flex_uint32_t;
202 +#endif /* ! C99 */
204 +/* Limits of integral types. */
205 +#ifndef INT8_MIN
206 +#define INT8_MIN (-128)
207 +#endif
208 +#ifndef INT16_MIN
209 +#define INT16_MIN (-32767-1)
210 +#endif
211 +#ifndef INT32_MIN
212 +#define INT32_MIN (-2147483647-1)
213 +#endif
214 +#ifndef INT8_MAX
215 +#define INT8_MAX (127)
216 +#endif
217 +#ifndef INT16_MAX
218 +#define INT16_MAX (32767)
219 +#endif
220 +#ifndef INT32_MAX
221 +#define INT32_MAX (2147483647)
222 +#endif
223 +#ifndef UINT8_MAX
224 +#define UINT8_MAX (255U)
225 +#endif
226 +#ifndef UINT16_MAX
227 +#define UINT16_MAX (65535U)
228 +#endif
229 +#ifndef UINT32_MAX
230 +#define UINT32_MAX (4294967295U)
231 +#endif
233 +#endif /* ! FLEXINT_H */
235 +#ifdef __cplusplus
237 +/* The "const" storage-class-modifier is valid. */
238 +#define YY_USE_CONST
240 +#else /* ! __cplusplus */
242 +/* C99 requires __STDC__ to be defined as 1. */
243 +#if defined (__STDC__)
245 +#define YY_USE_CONST
247 +#endif /* defined (__STDC__) */
248 +#endif /* ! __cplusplus */
250 +#ifdef YY_USE_CONST
251 +#define yyconst const
252 +#else
253 +#define yyconst
254 +#endif
256 +/* Returned upon end-of-file. */
257 +#define YY_NULL 0
259 +/* Promotes a possibly negative, possibly signed char to an unsigned
260 + * integer for use as an array index. If the signed char is negative,
261 + * we want to instead treat it as an 8-bit unsigned char, hence the
262 + * double cast.
263 + */
264 +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
266 +/* Enter a start condition. This macro really ought to take a parameter,
267 + * but we do it the disgusting crufty way forced on us by the ()-less
268 + * definition of BEGIN.
269 + */
270 +#define BEGIN (yy_start) = 1 + 2 *
272 +/* Translate the current start state into a value that can be later handed
273 + * to BEGIN to return to the state. The YYSTATE alias is for lex
274 + * compatibility.
275 + */
276 +#define YY_START (((yy_start) - 1) / 2)
277 +#define YYSTATE YY_START
279 +/* Action number for EOF rule of a given start state. */
280 +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
282 +/* Special action meaning "start processing a new file". */
283 +#define YY_NEW_FILE yyrestart(yyin )
285 +#define YY_END_OF_BUFFER_CHAR 0
287 +/* Size of default input buffer. */
288 +#ifndef YY_BUF_SIZE
289 +#define YY_BUF_SIZE 16384
290 +#endif
292 +/* The state buf must be large enough to hold one state per character in the main buffer.
293 + */
294 +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
296 +#ifndef YY_TYPEDEF_YY_BUFFER_STATE
297 +#define YY_TYPEDEF_YY_BUFFER_STATE
298 +typedef struct yy_buffer_state *YY_BUFFER_STATE;
299 +#endif
301 +extern int yyleng;
303 +extern FILE *yyin, *yyout;
305 +#define EOB_ACT_CONTINUE_SCAN 0
306 +#define EOB_ACT_END_OF_FILE 1
307 +#define EOB_ACT_LAST_MATCH 2
309 + /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
310 + * access to the local variable yy_act. Since yyless() is a macro, it would break
311 + * existing scanners that call yyless() from OUTSIDE yylex.
312 + * One obvious solution it to make yy_act a global. I tried that, and saw
313 + * a 5% performance hit in a non-yylineno scanner, because yy_act is
314 + * normally declared as a register variable-- so it is not worth it.
315 + */
316 + #define YY_LESS_LINENO(n) \
317 + do { \
318 + int yyl;\
319 + for ( yyl = n; yyl < yyleng; ++yyl )\
320 + if ( yytext[yyl] == '\n' )\
321 + --yylineno;\
322 + }while(0)
324 +/* Return all but the first "n" matched characters back to the input stream. */
325 +#define yyless(n) \
326 + do \
327 + { \
328 + /* Undo effects of setting up yytext. */ \
329 + int yyless_macro_arg = (n); \
330 + YY_LESS_LINENO(yyless_macro_arg);\
331 + *yy_cp = (yy_hold_char); \
332 + YY_RESTORE_YY_MORE_OFFSET \
333 + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
334 + YY_DO_BEFORE_ACTION; /* set up yytext again */ \
335 + } \
336 + while ( 0 )
338 +#define unput(c) yyunput( c, (yytext_ptr) )
340 +#ifndef YY_TYPEDEF_YY_SIZE_T
341 +#define YY_TYPEDEF_YY_SIZE_T
342 +typedef size_t yy_size_t;
343 +#endif
345 +#ifndef YY_STRUCT_YY_BUFFER_STATE
346 +#define YY_STRUCT_YY_BUFFER_STATE
347 +struct yy_buffer_state
349 + FILE *yy_input_file;
351 + char *yy_ch_buf; /* input buffer */
352 + char *yy_buf_pos; /* current position in input buffer */
354 + /* Size of input buffer in bytes, not including room for EOB
355 + * characters.
356 + */
357 + yy_size_t yy_buf_size;
359 + /* Number of characters read into yy_ch_buf, not including EOB
360 + * characters.
361 + */
362 + int yy_n_chars;
364 + /* Whether we "own" the buffer - i.e., we know we created it,
365 + * and can realloc() it to grow it, and should free() it to
366 + * delete it.
367 + */
368 + int yy_is_our_buffer;
370 + /* Whether this is an "interactive" input source; if so, and
371 + * if we're using stdio for input, then we want to use getc()
372 + * instead of fread(), to make sure we stop fetching input after
373 + * each newline.
374 + */
375 + int yy_is_interactive;
377 + /* Whether we're considered to be at the beginning of a line.
378 + * If so, '^' rules will be active on the next match, otherwise
379 + * not.
380 + */
381 + int yy_at_bol;
383 + int yy_bs_lineno; /**< The line count. */
384 + int yy_bs_column; /**< The column count. */
386 + /* Whether to try to fill the input buffer when we reach the
387 + * end of it.
388 + */
389 + int yy_fill_buffer;
391 + int yy_buffer_status;
393 +#define YY_BUFFER_NEW 0
394 +#define YY_BUFFER_NORMAL 1
395 + /* When an EOF's been seen but there's still some text to process
396 + * then we mark the buffer as YY_EOF_PENDING, to indicate that we
397 + * shouldn't try reading from the input source any more. We might
398 + * still have a bunch of tokens to match, though, because of
399 + * possible backing-up.
401 + * When we actually see the EOF, we change the status to "new"
402 + * (via yyrestart()), so that the user can continue scanning by
403 + * just pointing yyin at a new input file.
404 + */
405 +#define YY_BUFFER_EOF_PENDING 2
407 + };
408 +#endif /* !YY_STRUCT_YY_BUFFER_STATE */
410 +/* Stack of input buffers. */
411 +static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
412 +static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
413 +static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
415 +/* We provide macros for accessing buffer states in case in the
416 + * future we want to put the buffer states in a more general
417 + * "scanner state".
419 + * Returns the top of the stack, or NULL.
420 + */
421 +#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
422 + ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
423 + : NULL)
425 +/* Same as previous macro, but useful when we know that the buffer stack is not
426 + * NULL or when we need an lvalue. For internal use only.
427 + */
428 +#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
430 +/* yy_hold_char holds the character lost when yytext is formed. */
431 +static char yy_hold_char;
432 +static int yy_n_chars; /* number of characters read into yy_ch_buf */
433 +int yyleng;
435 +/* Points to current character in buffer. */
436 +static char *yy_c_buf_p = (char *) 0;
437 +static int yy_init = 0; /* whether we need to initialize */
438 +static int yy_start = 0; /* start state number */
440 +/* Flag which is used to allow yywrap()'s to do buffer switches
441 + * instead of setting up a fresh yyin. A bit of a hack ...
442 + */
443 +static int yy_did_buffer_switch_on_eof;
445 +void yyrestart (FILE *input_file );
446 +void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
447 +YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
448 +void yy_delete_buffer (YY_BUFFER_STATE b );
449 +void yy_flush_buffer (YY_BUFFER_STATE b );
450 +void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
451 +void yypop_buffer_state (void );
453 +static void yyensure_buffer_stack (void );
454 +static void yy_load_buffer_state (void );
455 +static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
457 +#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
459 +YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
460 +YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
461 +YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
463 +void *yyalloc (yy_size_t );
464 +void *yyrealloc (void *,yy_size_t );
465 +void yyfree (void * );
467 +#define yy_new_buffer yy_create_buffer
469 +#define yy_set_interactive(is_interactive) \
470 + { \
471 + if ( ! YY_CURRENT_BUFFER ){ \
472 + yyensure_buffer_stack (); \
473 + YY_CURRENT_BUFFER_LVALUE = \
474 + yy_create_buffer(yyin,YY_BUF_SIZE ); \
475 + } \
476 + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
479 +#define yy_set_bol(at_bol) \
480 + { \
481 + if ( ! YY_CURRENT_BUFFER ){\
482 + yyensure_buffer_stack (); \
483 + YY_CURRENT_BUFFER_LVALUE = \
484 + yy_create_buffer(yyin,YY_BUF_SIZE ); \
485 + } \
486 + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
489 +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
491 +typedef unsigned char YY_CHAR;
493 +FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
495 +typedef int yy_state_type;
497 +#define YY_FLEX_LEX_COMPAT
498 +extern int yylineno;
500 +int yylineno = 1;
502 +extern char yytext[];
504 +static yy_state_type yy_get_previous_state (void );
505 +static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
506 +static int yy_get_next_buffer (void );
507 +static void yy_fatal_error (yyconst char msg[] );
509 +/* Done after the current pattern has been matched and before the
510 + * corresponding action - sets up yytext.
511 + */
512 +#define YY_DO_BEFORE_ACTION \
513 + (yytext_ptr) = yy_bp; \
514 + yyleng = (size_t) (yy_cp - yy_bp); \
515 + (yy_hold_char) = *yy_cp; \
516 + *yy_cp = '\0'; \
517 + if ( yyleng + (yy_more_offset) >= YYLMAX ) \
518 + YY_FATAL_ERROR( "token too large, exceeds YYLMAX" ); \
519 + yy_flex_strncpy( &yytext[(yy_more_offset)], (yytext_ptr), yyleng + 1 ); \
520 + yyleng += (yy_more_offset); \
521 + (yy_prev_more_offset) = (yy_more_offset); \
522 + (yy_more_offset) = 0; \
523 + (yy_c_buf_p) = yy_cp;
525 +#define YY_NUM_RULES 9
526 +#define YY_END_OF_BUFFER 10
527 +/* This struct is not used in this scanner,
528 + but its presence is necessary. */
529 +struct yy_trans_info
531 + flex_int32_t yy_verify;
532 + flex_int32_t yy_nxt;
533 + };
534 +static yyconst flex_int16_t yy_acclist[25] =
535 + { 0,
536 + 10, 8, 9, 7, 9, 6, 8, 9, 3, 8,
537 + 9, 1, 8, 9, 2, 8, 9, 4, 8, 9,
538 + 5, 8, 9, 5
539 + } ;
541 +static yyconst flex_int16_t yy_accept[15] =
542 + { 0,
543 + 1, 1, 1, 2, 4, 6, 9, 12, 15, 18,
544 + 21, 24, 25, 25
545 + } ;
547 +static yyconst flex_int32_t yy_ec[256] =
548 + { 0,
549 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
550 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
551 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
552 + 1, 3, 1, 1, 1, 1, 1, 1, 1, 1,
553 + 1, 4, 5, 1, 6, 1, 7, 8, 8, 8,
554 + 8, 8, 8, 8, 8, 8, 8, 1, 1, 1,
555 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
556 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
557 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
558 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
560 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
561 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
562 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
563 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
564 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
565 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
566 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
567 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
568 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
569 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
571 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
572 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
573 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
574 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
575 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
576 + 1, 1, 1, 1, 1
577 + } ;
579 +static yyconst flex_int32_t yy_meta[9] =
580 + { 0,
581 + 1, 1, 1, 1, 1, 1, 1, 1
582 + } ;
584 +static yyconst flex_int16_t yy_base[14] =
585 + { 0,
586 + 0, 0, 11, 12, 12, 12, 12, 12, 12, 12,
587 + 2, 1, 12
588 + } ;
590 +static yyconst flex_int16_t yy_def[14] =
591 + { 0,
592 + 13, 1, 13, 13, 13, 13, 13, 13, 13, 13,
593 + 13, 13, 0
594 + } ;
596 +static yyconst flex_int16_t yy_nxt[21] =
597 + { 0,
598 + 4, 5, 6, 7, 8, 9, 10, 11, 12, 12,
599 + 13, 3, 13, 13, 13, 13, 13, 13, 13, 13
600 + } ;
602 +static yyconst flex_int16_t yy_chk[21] =
603 + { 0,
604 + 1, 1, 1, 1, 1, 1, 1, 1, 12, 11,
605 + 3, 13, 13, 13, 13, 13, 13, 13, 13, 13
606 + } ;
608 +/* Table of booleans, true if rule could match eol. */
609 +static yyconst flex_int32_t yy_rule_can_match_eol[10] =
610 + { 0,
611 +0, 0, 0, 0, 0, 0, 1, 0, 0, };
613 +extern int yy_flex_debug;
614 +int yy_flex_debug = 0;
616 +static yy_state_type *yy_state_buf=0, *yy_state_ptr=0;
617 +static char *yy_full_match;
618 +static int yy_lp;
619 +#define REJECT \
620 +{ \
621 +*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ \
622 +yy_cp = (yy_full_match); /* restore poss. backed-over text */ \
623 +++(yy_lp); \
624 +goto find_rule; \
627 +static int yy_more_offset = 0;
628 +static int yy_prev_more_offset = 0;
629 +#define yymore() ((yy_more_offset) = yy_flex_strlen( yytext ))
630 +#define YY_NEED_STRLEN
631 +#define YY_MORE_ADJ 0
632 +#define YY_RESTORE_YY_MORE_OFFSET \
633 + { \
634 + (yy_more_offset) = (yy_prev_more_offset); \
635 + yyleng -= (yy_more_offset); \
637 +#ifndef YYLMAX
638 +#define YYLMAX 8192
639 +#endif
641 +char yytext[YYLMAX];
642 +char *yytext_ptr;
643 +#line 1 "spec.lex"
644 +#line 2 "spec.lex"
645 +#include "yygrammar.h"
646 +#line 501 "lex.yy.c"
648 +#define INITIAL 0
650 +#ifndef YY_NO_UNISTD_H
651 +/* Special case for "unistd.h", since it is non-ANSI. We include it way
652 + * down here because we want the user's section 1 to have been scanned first.
653 + * The user has a chance to override it with an option.
654 + */
655 +#include <unistd.h>
656 +#endif
658 +#ifndef YY_EXTRA_TYPE
659 +#define YY_EXTRA_TYPE void *
660 +#endif
662 +static int yy_init_globals (void );
664 +/* Accessor methods to globals.
665 + These are made visible to non-reentrant scanners for convenience. */
667 +int yylex_destroy (void );
669 +int yyget_debug (void );
671 +void yyset_debug (int debug_flag );
673 +YY_EXTRA_TYPE yyget_extra (void );
675 +void yyset_extra (YY_EXTRA_TYPE user_defined );
677 +FILE *yyget_in (void );
679 +void yyset_in (FILE * in_str );
681 +FILE *yyget_out (void );
683 +void yyset_out (FILE * out_str );
685 +int yyget_leng (void );
687 +char *yyget_text (void );
689 +int yyget_lineno (void );
691 +void yyset_lineno (int line_number );
693 +/* Macros after this point can all be overridden by user definitions in
694 + * section 1.
695 + */
697 +#ifndef YY_SKIP_YYWRAP
698 +#ifdef __cplusplus
699 +extern "C" int yywrap (void );
700 +#else
701 +extern int yywrap (void );
702 +#endif
703 +#endif
705 + static void yyunput (int c,char *buf_ptr );
707 +#ifndef yytext_ptr
708 +static void yy_flex_strncpy (char *,yyconst char *,int );
709 +#endif
711 +#ifdef YY_NEED_STRLEN
712 +static int yy_flex_strlen (yyconst char * );
713 +#endif
715 +#ifndef YY_NO_INPUT
717 +#ifdef __cplusplus
718 +static int yyinput (void );
719 +#else
720 +static int input (void );
721 +#endif
723 +#endif
725 +/* Amount of stuff to slurp up with each read. */
726 +#ifndef YY_READ_BUF_SIZE
727 +#define YY_READ_BUF_SIZE 8192
728 +#endif
730 +/* Copy whatever the last rule matched to the standard output. */
731 +#ifndef ECHO
732 +/* This used to be an fputs(), but since the string might contain NUL's,
733 + * we now use fwrite().
734 + */
735 +#define ECHO fwrite( yytext, yyleng, 1, yyout )
736 +#endif
738 +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
739 + * is returned in "result".
740 + */
741 +#ifndef YY_INPUT
742 +#define YY_INPUT(buf,result,max_size) \
743 + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
744 + { \
745 + int c = '*'; \
746 + int n; \
747 + for ( n = 0; n < max_size && \
748 + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
749 + buf[n] = (char) c; \
750 + if ( c == '\n' ) \
751 + buf[n++] = (char) c; \
752 + if ( c == EOF && ferror( yyin ) ) \
753 + YY_FATAL_ERROR( "input in flex scanner failed" ); \
754 + result = n; \
755 + } \
756 + else \
757 + { \
758 + errno=0; \
759 + while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
760 + { \
761 + if( errno != EINTR) \
762 + { \
763 + YY_FATAL_ERROR( "input in flex scanner failed" ); \
764 + break; \
765 + } \
766 + errno=0; \
767 + clearerr(yyin); \
768 + } \
769 + }\
772 +#endif
774 +/* No semi-colon after return; correct usage is to write "yyterminate();" -
775 + * we don't want an extra ';' after the "return" because that will cause
776 + * some compilers to complain about unreachable statements.
777 + */
778 +#ifndef yyterminate
779 +#define yyterminate() return YY_NULL
780 +#endif
782 +/* Number of entries by which start-condition stack grows. */
783 +#ifndef YY_START_STACK_INCR
784 +#define YY_START_STACK_INCR 25
785 +#endif
787 +/* Report a fatal error. */
788 +#ifndef YY_FATAL_ERROR
789 +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
790 +#endif
792 +/* end tables serialization structures and prototypes */
794 +/* Default declaration of generated scanner - a define so the user can
795 + * easily add parameters.
796 + */
797 +#ifndef YY_DECL
798 +#define YY_DECL_IS_OURS 1
800 +extern int yylex (void);
802 +#define YY_DECL int yylex (void)
803 +#endif /* !YY_DECL */
805 +/* Code executed at the beginning of each rule, after yytext and yyleng
806 + * have been set up.
807 + */
808 +#ifndef YY_USER_ACTION
809 +#define YY_USER_ACTION
810 +#endif
812 +/* Code executed at the end of each rule. */
813 +#ifndef YY_BREAK
814 +#define YY_BREAK break;
815 +#endif
817 +#define YY_RULE_SETUP \
818 + YY_USER_ACTION
820 +/** The main scanner function which does all the work.
821 + */
822 +YY_DECL
824 + register yy_state_type yy_current_state;
825 + register char *yy_cp, *yy_bp;
826 + register int yy_act;
828 +#line 4 "spec.lex"
830 +#line 685 "lex.yy.c"
832 + if ( !(yy_init) )
834 + (yy_init) = 1;
836 +#ifdef YY_USER_INIT
837 + YY_USER_INIT;
838 +#endif
840 + /* Create the reject buffer large enough to save one state per allowed character. */
841 + if ( ! (yy_state_buf) )
842 + (yy_state_buf) = (yy_state_type *)yyalloc(YY_STATE_BUF_SIZE );
843 + if ( ! (yy_state_buf) )
844 + YY_FATAL_ERROR( "out of dynamic memory in yylex()" );
846 + if ( ! (yy_start) )
847 + (yy_start) = 1; /* first start state */
849 + if ( ! yyin )
850 + yyin = stdin;
852 + if ( ! yyout )
853 + yyout = stdout;
855 + if ( ! YY_CURRENT_BUFFER ) {
856 + yyensure_buffer_stack ();
857 + YY_CURRENT_BUFFER_LVALUE =
858 + yy_create_buffer(yyin,YY_BUF_SIZE );
861 + yy_load_buffer_state( );
864 + while ( 1 ) /* loops until end-of-file is reached */
866 + yy_cp = (yy_c_buf_p);
868 + /* Support of yytext. */
869 + *yy_cp = (yy_hold_char);
871 + /* yy_bp points to the position in yy_ch_buf of the start of
872 + * the current run.
873 + */
874 + yy_bp = yy_cp;
876 + yy_current_state = (yy_start);
878 + (yy_state_ptr) = (yy_state_buf);
879 + *(yy_state_ptr)++ = yy_current_state;
881 +yy_match:
882 + do
884 + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
885 + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
887 + yy_current_state = (int) yy_def[yy_current_state];
888 + if ( yy_current_state >= 14 )
889 + yy_c = yy_meta[(unsigned int) yy_c];
891 + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
892 + *(yy_state_ptr)++ = yy_current_state;
893 + ++yy_cp;
895 + while ( yy_base[yy_current_state] != 12 );
897 +yy_find_action:
898 + yy_current_state = *--(yy_state_ptr);
899 + (yy_lp) = yy_accept[yy_current_state];
900 +find_rule: /* we branch to this label when backing up */
901 + for ( ; ; ) /* until we find what rule we matched */
903 + if ( (yy_lp) && (yy_lp) < yy_accept[yy_current_state + 1] )
905 + yy_act = yy_acclist[(yy_lp)];
907 + (yy_full_match) = yy_cp;
908 + break;
911 + --yy_cp;
912 + yy_current_state = *--(yy_state_ptr);
913 + (yy_lp) = yy_accept[yy_current_state];
916 + YY_DO_BEFORE_ACTION;
918 + if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
920 + int yyl;
921 + for ( yyl = (yy_prev_more_offset); yyl < yyleng; ++yyl )
922 + if ( yytext[yyl] == '\n' )
924 + yylineno++;
928 +do_action: /* This label is used only to access EOF actions. */
930 + switch ( yy_act )
931 + { /* beginning of action switch */
932 +case 1:
933 +YY_RULE_SETUP
934 +#line 5 "spec.lex"
935 +{ return '+'; }
936 + YY_BREAK
937 +case 2:
938 +YY_RULE_SETUP
939 +#line 6 "spec.lex"
940 +{ return '-'; }
941 + YY_BREAK
942 +case 3:
943 +YY_RULE_SETUP
944 +#line 7 "spec.lex"
945 +{ return '*'; }
946 + YY_BREAK
947 +case 4:
948 +YY_RULE_SETUP
949 +#line 8 "spec.lex"
950 +{ return '/'; }
951 + YY_BREAK
952 +case 5:
953 +YY_RULE_SETUP
954 +#line 9 "spec.lex"
955 +{ yylval = atoi(yytext); return NUMBER; }
956 + YY_BREAK
957 +case 6:
958 +YY_RULE_SETUP
959 +#line 10 "spec.lex"
960 +{ /* skip blank */ }
961 + YY_BREAK
962 +case 7:
963 +/* rule 7 can match eol */
964 +YY_RULE_SETUP
965 +#line 11 "spec.lex"
966 +{ yypos++; /* adjust linenumber and skip newline */ }
967 + YY_BREAK
968 +case 8:
969 +YY_RULE_SETUP
970 +#line 12 "spec.lex"
971 +{ yyerror("illegal token"); }
972 + YY_BREAK
973 +case 9:
974 +YY_RULE_SETUP
975 +#line 13 "spec.lex"
976 +ECHO;
977 + YY_BREAK
978 +#line 833 "lex.yy.c"
979 + case YY_STATE_EOF(INITIAL):
980 + yyterminate();
982 + case YY_END_OF_BUFFER:
984 + /* Amount of text matched not including the EOB char. */
985 + int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
987 + /* Undo the effects of YY_DO_BEFORE_ACTION. */
988 + *yy_cp = (yy_hold_char);
989 + YY_RESTORE_YY_MORE_OFFSET
991 + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
993 + /* We're scanning a new file or input source. It's
994 + * possible that this happened because the user
995 + * just pointed yyin at a new source and called
996 + * yylex(). If so, then we have to assure
997 + * consistency between YY_CURRENT_BUFFER and our
998 + * globals. Here is the right place to do so, because
999 + * this is the first action (other than possibly a
1000 + * back-up) that will match for the new input source.
1001 + */
1002 + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1003 + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1004 + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1007 + /* Note that here we test for yy_c_buf_p "<=" to the position
1008 + * of the first EOB in the buffer, since yy_c_buf_p will
1009 + * already have been incremented past the NUL character
1010 + * (since all states make transitions on EOB to the
1011 + * end-of-buffer state). Contrast this with the test
1012 + * in input().
1013 + */
1014 + if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1015 + { /* This was really a NUL. */
1016 + yy_state_type yy_next_state;
1018 + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1020 + yy_current_state = yy_get_previous_state( );
1022 + /* Okay, we're now positioned to make the NUL
1023 + * transition. We couldn't have
1024 + * yy_get_previous_state() go ahead and do it
1025 + * for us because it doesn't know how to deal
1026 + * with the possibility of jamming (and we don't
1027 + * want to build jamming into it because then it
1028 + * will run more slowly).
1029 + */
1031 + yy_next_state = yy_try_NUL_trans( yy_current_state );
1033 + yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1035 + if ( yy_next_state )
1037 + /* Consume the NUL. */
1038 + yy_cp = ++(yy_c_buf_p);
1039 + yy_current_state = yy_next_state;
1040 + goto yy_match;
1043 + else
1045 + yy_cp = (yy_c_buf_p);
1046 + goto yy_find_action;
1050 + else switch ( yy_get_next_buffer( ) )
1052 + case EOB_ACT_END_OF_FILE:
1054 + (yy_did_buffer_switch_on_eof) = 0;
1056 + if ( yywrap( ) )
1058 + /* Note: because we've taken care in
1059 + * yy_get_next_buffer() to have set up
1060 + * yytext, we can now set up
1061 + * yy_c_buf_p so that if some total
1062 + * hoser (like flex itself) wants to
1063 + * call the scanner after we return the
1064 + * YY_NULL, it'll still work - another
1065 + * YY_NULL will get returned.
1066 + */
1067 + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1069 + yy_act = YY_STATE_EOF(YY_START);
1070 + goto do_action;
1073 + else
1075 + if ( ! (yy_did_buffer_switch_on_eof) )
1076 + YY_NEW_FILE;
1078 + break;
1081 + case EOB_ACT_CONTINUE_SCAN:
1082 + (yy_c_buf_p) =
1083 + (yytext_ptr) + yy_amount_of_matched_text;
1085 + yy_current_state = yy_get_previous_state( );
1087 + yy_cp = (yy_c_buf_p);
1088 + yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1089 + goto yy_match;
1091 + case EOB_ACT_LAST_MATCH:
1092 + (yy_c_buf_p) =
1093 + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1095 + yy_current_state = yy_get_previous_state( );
1097 + yy_cp = (yy_c_buf_p);
1098 + yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1099 + goto yy_find_action;
1101 + break;
1104 + default:
1105 + YY_FATAL_ERROR(
1106 + "fatal flex scanner internal error--no action found" );
1107 + } /* end of action switch */
1108 + } /* end of scanning one token */
1109 +} /* end of yylex */
1111 +/* yy_get_next_buffer - try to read in a new buffer
1113 + * Returns a code representing an action:
1114 + * EOB_ACT_LAST_MATCH -
1115 + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1116 + * EOB_ACT_END_OF_FILE - end of file
1117 + */
1118 +static int yy_get_next_buffer (void)
1120 + register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1121 + register char *source = (yytext_ptr);
1122 + register int number_to_move, i;
1123 + int ret_val;
1125 + if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1126 + YY_FATAL_ERROR(
1127 + "fatal flex scanner internal error--end of buffer missed" );
1129 + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1130 + { /* Don't try to fill the buffer, so this is an EOF. */
1131 + if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1133 + /* We matched a single character, the EOB, so
1134 + * treat this as a final EOF.
1135 + */
1136 + return EOB_ACT_END_OF_FILE;
1139 + else
1141 + /* We matched some text prior to the EOB, first
1142 + * process it.
1143 + */
1144 + return EOB_ACT_LAST_MATCH;
1148 + /* Try to read more data. */
1150 + /* First move last chars to start of buffer. */
1151 + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1153 + for ( i = 0; i < number_to_move; ++i )
1154 + *(dest++) = *(source++);
1156 + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1157 + /* don't do the read, it's not guaranteed to return an EOF,
1158 + * just force an EOF
1159 + */
1160 + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1162 + else
1164 + int num_to_read =
1165 + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1167 + while ( num_to_read <= 0 )
1168 + { /* Not enough room in the buffer - grow it. */
1170 + YY_FATAL_ERROR(
1171 +"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1175 + if ( num_to_read > YY_READ_BUF_SIZE )
1176 + num_to_read = YY_READ_BUF_SIZE;
1178 + /* Read in more data. */
1179 + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1180 + (yy_n_chars), (size_t) num_to_read );
1182 + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1185 + if ( (yy_n_chars) == 0 )
1187 + if ( number_to_move == YY_MORE_ADJ )
1189 + ret_val = EOB_ACT_END_OF_FILE;
1190 + yyrestart(yyin );
1193 + else
1195 + ret_val = EOB_ACT_LAST_MATCH;
1196 + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1197 + YY_BUFFER_EOF_PENDING;
1201 + else
1202 + ret_val = EOB_ACT_CONTINUE_SCAN;
1204 + if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1205 + /* Extend the array by 50%, plus the number we really need. */
1206 + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1207 + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1208 + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1209 + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1212 + (yy_n_chars) += number_to_move;
1213 + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1214 + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1216 + (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1218 + return ret_val;
1221 +/* yy_get_previous_state - get the state just before the EOB char was reached */
1223 + static yy_state_type yy_get_previous_state (void)
1225 + register yy_state_type yy_current_state;
1226 + register char *yy_cp;
1228 + yy_current_state = (yy_start);
1230 + (yy_state_ptr) = (yy_state_buf);
1231 + *(yy_state_ptr)++ = yy_current_state;
1233 + for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1235 + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1236 + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1238 + yy_current_state = (int) yy_def[yy_current_state];
1239 + if ( yy_current_state >= 14 )
1240 + yy_c = yy_meta[(unsigned int) yy_c];
1242 + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1243 + *(yy_state_ptr)++ = yy_current_state;
1246 + return yy_current_state;
1249 +/* yy_try_NUL_trans - try to make a transition on the NUL character
1251 + * synopsis
1252 + * next_state = yy_try_NUL_trans( current_state );
1253 + */
1254 + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1256 + register int yy_is_jam;
1258 + register YY_CHAR yy_c = 1;
1259 + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1261 + yy_current_state = (int) yy_def[yy_current_state];
1262 + if ( yy_current_state >= 14 )
1263 + yy_c = yy_meta[(unsigned int) yy_c];
1265 + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1266 + yy_is_jam = (yy_current_state == 13);
1267 + if ( ! yy_is_jam )
1268 + *(yy_state_ptr)++ = yy_current_state;
1270 + return yy_is_jam ? 0 : yy_current_state;
1273 + static void yyunput (int c, register char * yy_bp )
1275 + register char *yy_cp;
1277 + yy_cp = (yy_c_buf_p);
1279 + /* undo effects of setting up yytext */
1280 + *yy_cp = (yy_hold_char);
1282 + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1283 + { /* need to shift things up to make room */
1284 + /* +2 for EOB chars. */
1285 + register int number_to_move = (yy_n_chars) + 2;
1286 + register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1287 + YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1288 + register char *source =
1289 + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1291 + while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1292 + *--dest = *--source;
1294 + yy_cp += (int) (dest - source);
1295 + yy_bp += (int) (dest - source);
1296 + YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1297 + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1299 + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1300 + YY_FATAL_ERROR( "flex scanner push-back overflow" );
1303 + *--yy_cp = (char) c;
1305 + if ( c == '\n' ){
1306 + --yylineno;
1309 + (yytext_ptr) = yy_bp;
1310 + (yy_hold_char) = *yy_cp;
1311 + (yy_c_buf_p) = yy_cp;
1314 +#ifndef YY_NO_INPUT
1315 +#ifdef __cplusplus
1316 + static int yyinput (void)
1317 +#else
1318 + static int input (void)
1319 +#endif
1322 + int c;
1324 + *(yy_c_buf_p) = (yy_hold_char);
1326 + if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1328 + /* yy_c_buf_p now points to the character we want to return.
1329 + * If this occurs *before* the EOB characters, then it's a
1330 + * valid NUL; if not, then we've hit the end of the buffer.
1331 + */
1332 + if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1333 + /* This was really a NUL. */
1334 + *(yy_c_buf_p) = '\0';
1336 + else
1337 + { /* need more input */
1338 + int offset = (yy_c_buf_p) - (yytext_ptr);
1339 + ++(yy_c_buf_p);
1341 + switch ( yy_get_next_buffer( ) )
1343 + case EOB_ACT_LAST_MATCH:
1344 + /* This happens because yy_g_n_b()
1345 + * sees that we've accumulated a
1346 + * token and flags that we need to
1347 + * try matching the token before
1348 + * proceeding. But for input(),
1349 + * there's no matching to consider.
1350 + * So convert the EOB_ACT_LAST_MATCH
1351 + * to EOB_ACT_END_OF_FILE.
1352 + */
1354 + /* Reset buffer status. */
1355 + yyrestart(yyin );
1357 + /*FALLTHROUGH*/
1359 + case EOB_ACT_END_OF_FILE:
1361 + if ( yywrap( ) )
1362 + return EOF;
1364 + if ( ! (yy_did_buffer_switch_on_eof) )
1365 + YY_NEW_FILE;
1366 +#ifdef __cplusplus
1367 + return yyinput();
1368 +#else
1369 + return input();
1370 +#endif
1373 + case EOB_ACT_CONTINUE_SCAN:
1374 + (yy_c_buf_p) = (yytext_ptr) + offset;
1375 + break;
1380 + c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1381 + *(yy_c_buf_p) = '\0'; /* preserve yytext */
1382 + (yy_hold_char) = *++(yy_c_buf_p);
1384 + if ( c == '\n' )
1386 + yylineno++;
1389 + return c;
1391 +#endif /* ifndef YY_NO_INPUT */
1393 +/** Immediately switch to a different input stream.
1394 + * @param input_file A readable stream.
1395 + *
1396 + * @note This function does not reset the start condition to @c INITIAL .
1397 + */
1398 + void yyrestart (FILE * input_file )
1401 + if ( ! YY_CURRENT_BUFFER ){
1402 + yyensure_buffer_stack ();
1403 + YY_CURRENT_BUFFER_LVALUE =
1404 + yy_create_buffer(yyin,YY_BUF_SIZE );
1407 + yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1408 + yy_load_buffer_state( );
1411 +/** Switch to a different input buffer.
1412 + * @param new_buffer The new input buffer.
1413 + *
1414 + */
1415 + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1418 + /* TODO. We should be able to replace this entire function body
1419 + * with
1420 + * yypop_buffer_state();
1421 + * yypush_buffer_state(new_buffer);
1422 + */
1423 + yyensure_buffer_stack ();
1424 + if ( YY_CURRENT_BUFFER == new_buffer )
1425 + return;
1427 + if ( YY_CURRENT_BUFFER )
1429 + /* Flush out information for old buffer. */
1430 + *(yy_c_buf_p) = (yy_hold_char);
1431 + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1432 + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1435 + YY_CURRENT_BUFFER_LVALUE = new_buffer;
1436 + yy_load_buffer_state( );
1438 + /* We don't actually know whether we did this switch during
1439 + * EOF (yywrap()) processing, but the only time this flag
1440 + * is looked at is after yywrap() is called, so it's safe
1441 + * to go ahead and always set it.
1442 + */
1443 + (yy_did_buffer_switch_on_eof) = 1;
1446 +static void yy_load_buffer_state (void)
1448 + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1449 + (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1450 + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1451 + (yy_hold_char) = *(yy_c_buf_p);
1454 +/** Allocate and initialize an input buffer state.
1455 + * @param file A readable stream.
1456 + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1457 + *
1458 + * @return the allocated buffer state.
1459 + */
1460 + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1462 + YY_BUFFER_STATE b;
1464 + b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1465 + if ( ! b )
1466 + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1468 + b->yy_buf_size = size;
1470 + /* yy_ch_buf has to be 2 characters longer than the size given because
1471 + * we need to put in 2 end-of-buffer characters.
1472 + */
1473 + b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
1474 + if ( ! b->yy_ch_buf )
1475 + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1477 + b->yy_is_our_buffer = 1;
1479 + yy_init_buffer(b,file );
1481 + return b;
1484 +/** Destroy the buffer.
1485 + * @param b a buffer created with yy_create_buffer()
1486 + *
1487 + */
1488 + void yy_delete_buffer (YY_BUFFER_STATE b )
1491 + if ( ! b )
1492 + return;
1494 + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1495 + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1497 + if ( b->yy_is_our_buffer )
1498 + yyfree((void *) b->yy_ch_buf );
1500 + yyfree((void *) b );
1503 +#ifndef __cplusplus
1504 +extern int isatty (int );
1505 +#endif /* __cplusplus */
1507 +/* Initializes or reinitializes a buffer.
1508 + * This function is sometimes called more than once on the same buffer,
1509 + * such as during a yyrestart() or at EOF.
1510 + */
1511 + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1514 + int oerrno = errno;
1516 + yy_flush_buffer(b );
1518 + b->yy_input_file = file;
1519 + b->yy_fill_buffer = 1;
1521 + /* If b is the current buffer, then yy_init_buffer was _probably_
1522 + * called from yyrestart() or through yy_get_next_buffer.
1523 + * In that case, we don't want to reset the lineno or column.
1524 + */
1525 + if (b != YY_CURRENT_BUFFER){
1526 + b->yy_bs_lineno = 1;
1527 + b->yy_bs_column = 0;
1530 + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1532 + errno = oerrno;
1535 +/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1536 + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1537 + *
1538 + */
1539 + void yy_flush_buffer (YY_BUFFER_STATE b )
1541 + if ( ! b )
1542 + return;
1544 + b->yy_n_chars = 0;
1546 + /* We always need two end-of-buffer characters. The first causes
1547 + * a transition to the end-of-buffer state. The second causes
1548 + * a jam in that state.
1549 + */
1550 + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1551 + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1553 + b->yy_buf_pos = &b->yy_ch_buf[0];
1555 + b->yy_at_bol = 1;
1556 + b->yy_buffer_status = YY_BUFFER_NEW;
1558 + if ( b == YY_CURRENT_BUFFER )
1559 + yy_load_buffer_state( );
1562 +/** Pushes the new state onto the stack. The new state becomes
1563 + * the current state. This function will allocate the stack
1564 + * if necessary.
1565 + * @param new_buffer The new state.
1566 + *
1567 + */
1568 +void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1570 + if (new_buffer == NULL)
1571 + return;
1573 + yyensure_buffer_stack();
1575 + /* This block is copied from yy_switch_to_buffer. */
1576 + if ( YY_CURRENT_BUFFER )
1578 + /* Flush out information for old buffer. */
1579 + *(yy_c_buf_p) = (yy_hold_char);
1580 + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1581 + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1584 + /* Only push if top exists. Otherwise, replace top. */
1585 + if (YY_CURRENT_BUFFER)
1586 + (yy_buffer_stack_top)++;
1587 + YY_CURRENT_BUFFER_LVALUE = new_buffer;
1589 + /* copied from yy_switch_to_buffer. */
1590 + yy_load_buffer_state( );
1591 + (yy_did_buffer_switch_on_eof) = 1;
1594 +/** Removes and deletes the top of the stack, if present.
1595 + * The next element becomes the new top.
1596 + *
1597 + */
1598 +void yypop_buffer_state (void)
1600 + if (!YY_CURRENT_BUFFER)
1601 + return;
1603 + yy_delete_buffer(YY_CURRENT_BUFFER );
1604 + YY_CURRENT_BUFFER_LVALUE = NULL;
1605 + if ((yy_buffer_stack_top) > 0)
1606 + --(yy_buffer_stack_top);
1608 + if (YY_CURRENT_BUFFER) {
1609 + yy_load_buffer_state( );
1610 + (yy_did_buffer_switch_on_eof) = 1;
1614 +/* Allocates the stack if it does not exist.
1615 + * Guarantees space for at least one push.
1616 + */
1617 +static void yyensure_buffer_stack (void)
1619 + int num_to_alloc;
1621 + if (!(yy_buffer_stack)) {
1623 + /* First allocation is just for 2 elements, since we don't know if this
1624 + * scanner will even need a stack. We use 2 instead of 1 to avoid an
1625 + * immediate realloc on the next call.
1626 + */
1627 + num_to_alloc = 1;
1628 + (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1629 + (num_to_alloc * sizeof(struct yy_buffer_state*)
1630 + );
1631 + if ( ! (yy_buffer_stack) )
1632 + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1634 + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1636 + (yy_buffer_stack_max) = num_to_alloc;
1637 + (yy_buffer_stack_top) = 0;
1638 + return;
1641 + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1643 + /* Increase the buffer to prepare for a possible push. */
1644 + int grow_size = 8 /* arbitrary grow size */;
1646 + num_to_alloc = (yy_buffer_stack_max) + grow_size;
1647 + (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1648 + ((yy_buffer_stack),
1649 + num_to_alloc * sizeof(struct yy_buffer_state*)
1650 + );
1651 + if ( ! (yy_buffer_stack) )
1652 + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1654 + /* zero only the new slots.*/
1655 + memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1656 + (yy_buffer_stack_max) = num_to_alloc;
1660 +/** Setup the input buffer state to scan directly from a user-specified character buffer.
1661 + * @param base the character buffer
1662 + * @param size the size in bytes of the character buffer
1663 + *
1664 + * @return the newly allocated buffer state object.
1665 + */
1666 +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1668 + YY_BUFFER_STATE b;
1670 + if ( size < 2 ||
1671 + base[size-2] != YY_END_OF_BUFFER_CHAR ||
1672 + base[size-1] != YY_END_OF_BUFFER_CHAR )
1673 + /* They forgot to leave room for the EOB's. */
1674 + return 0;
1676 + b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1677 + if ( ! b )
1678 + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1680 + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1681 + b->yy_buf_pos = b->yy_ch_buf = base;
1682 + b->yy_is_our_buffer = 0;
1683 + b->yy_input_file = 0;
1684 + b->yy_n_chars = b->yy_buf_size;
1685 + b->yy_is_interactive = 0;
1686 + b->yy_at_bol = 1;
1687 + b->yy_fill_buffer = 0;
1688 + b->yy_buffer_status = YY_BUFFER_NEW;
1690 + yy_switch_to_buffer(b );
1692 + return b;
1695 +/** Setup the input buffer state to scan a string. The next call to yylex() will
1696 + * scan from a @e copy of @a str.
1697 + * @param yystr a NUL-terminated string to scan
1698 + *
1699 + * @return the newly allocated buffer state object.
1700 + * @note If you want to scan bytes that may contain NUL values, then use
1701 + * yy_scan_bytes() instead.
1702 + */
1703 +YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
1706 + return yy_scan_bytes(yystr,strlen(yystr) );
1709 +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1710 + * scan from a @e copy of @a bytes.
1711 + * @param bytes the byte buffer to scan
1712 + * @param len the number of bytes in the buffer pointed to by @a bytes.
1713 + *
1714 + * @return the newly allocated buffer state object.
1715 + */
1716 +YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
1718 + YY_BUFFER_STATE b;
1719 + char *buf;
1720 + yy_size_t n;
1721 + int i;
1723 + /* Get memory for full buffer, including space for trailing EOB's. */
1724 + n = _yybytes_len + 2;
1725 + buf = (char *) yyalloc(n );
1726 + if ( ! buf )
1727 + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1729 + for ( i = 0; i < _yybytes_len; ++i )
1730 + buf[i] = yybytes[i];
1732 + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1734 + b = yy_scan_buffer(buf,n );
1735 + if ( ! b )
1736 + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1738 + /* It's okay to grow etc. this buffer, and we should throw it
1739 + * away when we're done.
1740 + */
1741 + b->yy_is_our_buffer = 1;
1743 + return b;
1746 +#ifndef YY_EXIT_FAILURE
1747 +#define YY_EXIT_FAILURE 2
1748 +#endif
1750 +static void yy_fatal_error (yyconst char* msg )
1752 + (void) fprintf( stderr, "%s\n", msg );
1753 + exit( YY_EXIT_FAILURE );
1756 +/* Redefine yyless() so it works in section 3 code. */
1758 +#undef yyless
1759 +#define yyless(n) \
1760 + do \
1761 + { \
1762 + /* Undo effects of setting up yytext. */ \
1763 + int yyless_macro_arg = (n); \
1764 + YY_LESS_LINENO(yyless_macro_arg);\
1765 + yytext[yyleng] = (yy_hold_char); \
1766 + (yy_c_buf_p) = yytext + yyless_macro_arg; \
1767 + (yy_hold_char) = *(yy_c_buf_p); \
1768 + *(yy_c_buf_p) = '\0'; \
1769 + yyleng = yyless_macro_arg; \
1770 + } \
1771 + while ( 0 )
1773 +/* Accessor methods (get/set functions) to struct members. */
1775 +/** Get the current line number.
1776 + *
1777 + */
1778 +int yyget_lineno (void)
1781 + return yylineno;
1784 +/** Get the input stream.
1785 + *
1786 + */
1787 +FILE *yyget_in (void)
1789 + return yyin;
1792 +/** Get the output stream.
1793 + *
1794 + */
1795 +FILE *yyget_out (void)
1797 + return yyout;
1800 +/** Get the length of the current token.
1801 + *
1802 + */
1803 +int yyget_leng (void)
1805 + return yyleng;
1808 +/** Get the current token.
1809 + *
1810 + */
1812 +char *yyget_text (void)
1814 + return yytext;
1817 +/** Set the current line number.
1818 + * @param line_number
1819 + *
1820 + */
1821 +void yyset_lineno (int line_number )
1824 + yylineno = line_number;
1827 +/** Set the input stream. This does not discard the current
1828 + * input buffer.
1829 + * @param in_str A readable stream.
1830 + *
1831 + * @see yy_switch_to_buffer
1832 + */
1833 +void yyset_in (FILE * in_str )
1835 + yyin = in_str ;
1838 +void yyset_out (FILE * out_str )
1840 + yyout = out_str ;
1843 +int yyget_debug (void)
1845 + return yy_flex_debug;
1848 +void yyset_debug (int bdebug )
1850 + yy_flex_debug = bdebug ;
1853 +static int yy_init_globals (void)
1855 + /* Initialization is the same as for the non-reentrant scanner.
1856 + * This function is called from yylex_destroy(), so don't allocate here.
1857 + */
1859 + /* We do not touch yylineno unless the option is enabled. */
1860 + yylineno = 1;
1862 + (yy_buffer_stack) = 0;
1863 + (yy_buffer_stack_top) = 0;
1864 + (yy_buffer_stack_max) = 0;
1865 + (yy_c_buf_p) = (char *) 0;
1866 + (yy_init) = 0;
1867 + (yy_start) = 0;
1869 + (yy_state_buf) = 0;
1870 + (yy_state_ptr) = 0;
1871 + (yy_full_match) = 0;
1872 + (yy_lp) = 0;
1874 +/* Defined in main.c */
1875 +#ifdef YY_STDINIT
1876 + yyin = stdin;
1877 + yyout = stdout;
1878 +#else
1879 + yyin = (FILE *) 0;
1880 + yyout = (FILE *) 0;
1881 +#endif
1883 + /* For future reference: Set errno on error, since we are called by
1884 + * yylex_init()
1885 + */
1886 + return 0;
1889 +/* yylex_destroy is for both reentrant and non-reentrant scanners. */
1890 +int yylex_destroy (void)
1893 + /* Pop the buffer stack, destroying each element. */
1894 + while(YY_CURRENT_BUFFER){
1895 + yy_delete_buffer(YY_CURRENT_BUFFER );
1896 + YY_CURRENT_BUFFER_LVALUE = NULL;
1897 + yypop_buffer_state();
1900 + /* Destroy the stack itself. */
1901 + yyfree((yy_buffer_stack) );
1902 + (yy_buffer_stack) = NULL;
1904 + yyfree ( (yy_state_buf) );
1905 + (yy_state_buf) = NULL;
1907 + /* Reset the globals. This is important in a non-reentrant scanner so the next time
1908 + * yylex() is called, initialization will occur. */
1909 + yy_init_globals( );
1911 + return 0;
1915 + * Internal utility routines.
1916 + */
1918 +#ifndef yytext_ptr
1919 +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1921 + register int i;
1922 + for ( i = 0; i < n; ++i )
1923 + s1[i] = s2[i];
1925 +#endif
1927 +#ifdef YY_NEED_STRLEN
1928 +static int yy_flex_strlen (yyconst char * s )
1930 + register int n;
1931 + for ( n = 0; s[n]; ++n )
1934 + return n;
1936 +#endif
1938 +void *yyalloc (yy_size_t size )
1940 + return (void *) malloc( size );
1943 +void *yyrealloc (void * ptr, yy_size_t size )
1945 + /* The cast to (char *) in the following accommodates both
1946 + * implementations that use char* generic pointers, and those
1947 + * that use void* generic pointers. It works with the latter
1948 + * because both ANSI C and C++ allow castless assignment from
1949 + * any pointer type to void*, and deal with argument conversions
1950 + * as though doing an assignment.
1951 + */
1952 + return (void *) realloc( (char *) ptr, size );
1955 +void yyfree (void * ptr )
1957 + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
1960 +#define YYTABLES_NAME "yytables"
1962 +#line 13 "spec.lex"
1963 diff -ruN accent/exmplaccent/yygrammar.c good/exmplaccent/yygrammar.c
1964 --- accent/exmplaccent/yygrammar.c 1970-01-01 00:00:00.000000000 +0000
1965 +++ good/exmplaccent/yygrammar.c 2010-11-22 19:33:47.833333118 +0000
1966 @@ -0,0 +1,477 @@
1967 +#include <stdio.h>
1968 +#include <stdlib.h>
1969 +#include "yygrammar.h"
1971 +YYSTART ()
1973 + switch(yyselect()) {
1974 + case 14: {
1975 + root();
1976 + get_lexval();
1977 + } break;
1981 +root ()
1983 + switch(yyselect()) {
1984 + case 1: {
1985 + expression();
1986 + } break;
1987 + case 2: {
1988 + null();
1989 + } break;
1993 +null ()
1995 + switch(yyselect()) {
1996 + case 3: {
1997 + } break;
2001 +expression ()
2003 + YYSTYPE n;
2004 + switch(yyselect()) {
2005 + case 4: {
2006 + term(&n);
2007 +#line 11 "spec.acc"
2008 + printf("%d\n", n);
2009 +# line 42 "yygrammar.c"
2010 + } break;
2014 +term (n)
2015 + YYSTYPE *n;
2017 + YYSTYPE x;
2018 + YYSTYPE y;
2019 + switch(yyselect()) {
2020 + case 5: {
2021 + term(&x);
2022 + get_lexval();
2023 + factor(&y);
2024 +#line 15 "spec.acc"
2025 + *n = x+y;
2026 +# line 59 "yygrammar.c"
2027 + } break;
2028 + case 6: {
2029 + term(&x);
2030 + get_lexval();
2031 + factor(&y);
2032 +#line 16 "spec.acc"
2033 + *n = x-y;
2034 +# line 67 "yygrammar.c"
2035 + } break;
2036 + case 7: {
2037 + factor(n);
2038 + } break;
2042 +factor (n)
2043 + YYSTYPE *n;
2045 + YYSTYPE x;
2046 + YYSTYPE y;
2047 + switch(yyselect()) {
2048 + case 8: {
2049 + factor(&x);
2050 + get_lexval();
2051 + primary(&y);
2052 +#line 21 "spec.acc"
2053 + *n = x*y;
2054 +# line 87 "yygrammar.c"
2055 + } break;
2056 + case 9: {
2057 + factor(&x);
2058 + get_lexval();
2059 + primary(&y);
2060 +#line 22 "spec.acc"
2061 + *n = x/y;
2062 +# line 95 "yygrammar.c"
2063 + } break;
2064 + case 10: {
2065 + primary(n);
2066 + } break;
2070 +primary (n)
2071 + YYSTYPE *n;
2073 + YYSTYPE x;
2074 + switch(yyselect()) {
2075 + case 11: {
2076 + get_lexval();
2077 + *n = yylval;
2078 + } break;
2079 + case 12: {
2080 + get_lexval();
2081 + term(n);
2082 + get_lexval();
2083 + } break;
2084 + case 13: {
2085 + get_lexval();
2086 + primary(&x);
2087 +#line 29 "spec.acc"
2088 + *n = -x;
2089 +# line 122 "yygrammar.c"
2090 + } break;
2094 +extern YYSTYPE yylval;
2095 +YYSTYPE yylval;
2096 +extern long yypos;
2097 +long yypos = 1;
2098 +/* GentleFlag = no */
2100 +typedef struct LEXELEMSTRUCT {
2101 + YYSTYPE val;
2102 + long pos;
2103 + long sym;
2104 + char * text;
2105 + struct LEXELEMSTRUCT *next;
2106 +} LEXELEM;
2108 +LEXELEM *first_lexelem, *cur_lexelem;
2110 +init_lexelem()
2112 + cur_lexelem = first_lexelem;
2115 +first_lexval () {
2116 + LEXELEM *p;
2117 + p = (LEXELEM *)malloc(sizeof(LEXELEM));
2118 + if (! p) yymallocerror();
2119 + p->val = yylval;
2120 + p->pos = yypos;
2121 + p->next = 0;
2122 + cur_lexelem = p;
2123 + first_lexelem = p;
2126 +next_lexval() {
2127 + LEXELEM *p;
2128 + p = (LEXELEM *)malloc(sizeof(LEXELEM));
2129 + if (! p) yymallocerror();
2130 + cur_lexelem-> next = p;
2131 + p->val = yylval;
2132 + p->pos = yypos;
2133 + p->next = 0;
2134 + cur_lexelem = p;
2137 +get_lexval() {
2138 + extern int FREE_LEXELEMS;
2139 + LEXELEM *p;
2140 + yylval = cur_lexelem->val;
2141 + yypos = cur_lexelem->pos;
2142 + p = cur_lexelem;
2143 + cur_lexelem = cur_lexelem->next;
2144 + free(p);
2147 +extern int c_length;
2148 +int c_length = 67;
2149 +extern int yygrammar[];
2150 +int yygrammar[] = {
2152 +/* 1 */ 0,
2153 +/* 2 */ 6,
2154 +/* 3 */ 50000,
2155 +/* 4 */ -1,
2156 +/* 5 */ 14,
2157 +/* 6 */ 10,
2158 +/* 7 */ 17,
2159 +/* 8 */ -6,
2160 +/* 9 */ 1,
2161 +/* 10 */ 0,
2162 +/* 11 */ 14,
2163 +/* 12 */ -6,
2164 +/* 13 */ 2,
2165 +/* 14 */ 0,
2166 +/* 15 */ -14,
2167 +/* 16 */ 3,
2168 +/* 17 */ 0,
2169 +/* 18 */ 21,
2170 +/* 19 */ -17,
2171 +/* 20 */ 4,
2172 +/* 21 */ 27,
2173 +/* 22 */ 21,
2174 +/* 23 */ 50043,
2175 +/* 24 */ 37,
2176 +/* 25 */ -21,
2177 +/* 26 */ 5,
2178 +/* 27 */ 33,
2179 +/* 28 */ 21,
2180 +/* 29 */ 50045,
2181 +/* 30 */ 37,
2182 +/* 31 */ -21,
2183 +/* 32 */ 6,
2184 +/* 33 */ 0,
2185 +/* 34 */ 37,
2186 +/* 35 */ -21,
2187 +/* 36 */ 7,
2188 +/* 37 */ 43,
2189 +/* 38 */ 37,
2190 +/* 39 */ 50042,
2191 +/* 40 */ 53,
2192 +/* 41 */ -37,
2193 +/* 42 */ 8,
2194 +/* 43 */ 49,
2195 +/* 44 */ 37,
2196 +/* 45 */ 50047,
2197 +/* 46 */ 53,
2198 +/* 47 */ -37,
2199 +/* 48 */ 9,
2200 +/* 49 */ 0,
2201 +/* 50 */ 53,
2202 +/* 51 */ -37,
2203 +/* 52 */ 10,
2204 +/* 53 */ 57,
2205 +/* 54 */ 50256,
2206 +/* 55 */ -53,
2207 +/* 56 */ 11,
2208 +/* 57 */ 63,
2209 +/* 58 */ 50040,
2210 +/* 59 */ 21,
2211 +/* 60 */ 50041,
2212 +/* 61 */ -53,
2213 +/* 62 */ 12,
2214 +/* 63 */ 0,
2215 +/* 64 */ 50045,
2216 +/* 65 */ 53,
2217 +/* 66 */ -53,
2218 +/* 67 */ 13,
2221 +extern int yyannotation[];
2222 +int yyannotation[] = {
2224 +/* 1 */ 0,
2225 +/* 2 */ 0,
2226 +/* 3 */ 50000,
2227 +/* 4 */ -1,
2228 +/* 5 */ 0,
2229 +/* 6 */ 10,
2230 +/* 7 */ 1,
2231 +/* 8 */ -6,
2232 +/* 9 */ 1,
2233 +/* 10 */ 0,
2234 +/* 11 */ 1,
2235 +/* 12 */ -6,
2236 +/* 13 */ 2,
2237 +/* 14 */ 0,
2238 +/* 15 */ -14,
2239 +/* 16 */ 1,
2240 +/* 17 */ 0,
2241 +/* 18 */ 1,
2242 +/* 19 */ -17,
2243 +/* 20 */ 1,
2244 +/* 21 */ 27,
2245 +/* 22 */ 1,
2246 +/* 23 */ 50043,
2247 +/* 24 */ 1,
2248 +/* 25 */ -21,
2249 +/* 26 */ 1,
2250 +/* 27 */ 33,
2251 +/* 28 */ 1,
2252 +/* 29 */ 50045,
2253 +/* 30 */ 1,
2254 +/* 31 */ -21,
2255 +/* 32 */ 2,
2256 +/* 33 */ 0,
2257 +/* 34 */ 1,
2258 +/* 35 */ -21,
2259 +/* 36 */ 3,
2260 +/* 37 */ 43,
2261 +/* 38 */ 1,
2262 +/* 39 */ 50042,
2263 +/* 40 */ 1,
2264 +/* 41 */ -37,
2265 +/* 42 */ 1,
2266 +/* 43 */ 49,
2267 +/* 44 */ 1,
2268 +/* 45 */ 50047,
2269 +/* 46 */ 1,
2270 +/* 47 */ -37,
2271 +/* 48 */ 2,
2272 +/* 49 */ 0,
2273 +/* 50 */ 1,
2274 +/* 51 */ -37,
2275 +/* 52 */ 3,
2276 +/* 53 */ 57,
2277 +/* 54 */ 50256,
2278 +/* 55 */ -53,
2279 +/* 56 */ 1,
2280 +/* 57 */ 63,
2281 +/* 58 */ 50040,
2282 +/* 59 */ 1,
2283 +/* 60 */ 50041,
2284 +/* 61 */ -53,
2285 +/* 62 */ 2,
2286 +/* 63 */ 0,
2287 +/* 64 */ 50045,
2288 +/* 65 */ 1,
2289 +/* 66 */ -53,
2290 +/* 67 */ 3,
2293 +extern int yycoordinate[];
2294 +int yycoordinate[] = {
2296 +/* 1 */ 9999,
2297 +/* 2 */ 2006,
2298 +/* 3 */ 9999,
2299 +/* 4 */ 9999,
2300 +/* 5 */ 2006,
2301 +/* 6 */ 9999,
2302 +/* 7 */ 3004,
2303 +/* 8 */ 9999,
2304 +/* 9 */ 3013,
2305 +/* 10 */ 9999,
2306 +/* 11 */ 4004,
2307 +/* 12 */ 9999,
2308 +/* 13 */ 4007,
2309 +/* 14 */ 9999,
2310 +/* 15 */ 9999,
2311 +/* 16 */ 8001,
2312 +/* 17 */ 9999,
2313 +/* 18 */ 11003,
2314 +/* 19 */ 9999,
2315 +/* 20 */ 11006,
2316 +/* 21 */ 9999,
2317 +/* 22 */ 15003,
2318 +/* 23 */ 9999,
2319 +/* 24 */ 15015,
2320 +/* 25 */ 9999,
2321 +/* 26 */ 15006,
2322 +/* 27 */ 9999,
2323 +/* 28 */ 16003,
2324 +/* 29 */ 9999,
2325 +/* 30 */ 16015,
2326 +/* 31 */ 9999,
2327 +/* 32 */ 16006,
2328 +/* 33 */ 9999,
2329 +/* 34 */ 17003,
2330 +/* 35 */ 9999,
2331 +/* 36 */ 17008,
2332 +/* 37 */ 9999,
2333 +/* 38 */ 21003,
2334 +/* 39 */ 9999,
2335 +/* 40 */ 21017,
2336 +/* 41 */ 9999,
2337 +/* 42 */ 21008,
2338 +/* 43 */ 9999,
2339 +/* 44 */ 22003,
2340 +/* 45 */ 9999,
2341 +/* 46 */ 22017,
2342 +/* 47 */ 9999,
2343 +/* 48 */ 22008,
2344 +/* 49 */ 9999,
2345 +/* 50 */ 23003,
2346 +/* 51 */ 9999,
2347 +/* 52 */ 23009,
2348 +/* 53 */ 9999,
2349 +/* 54 */ 9999,
2350 +/* 55 */ 9999,
2351 +/* 56 */ 27008,
2352 +/* 57 */ 9999,
2353 +/* 58 */ 9999,
2354 +/* 59 */ 28007,
2355 +/* 60 */ 9999,
2356 +/* 61 */ 9999,
2357 +/* 62 */ 28003,
2358 +/* 63 */ 9999,
2359 +/* 64 */ 9999,
2360 +/* 65 */ 29007,
2361 +/* 66 */ 9999,
2362 +/* 67 */ 29003,
2365 +/* only for BIGHASH (see art.c)
2366 +extern int DHITS[];
2367 +int DHITS[69];
2369 +int TABLE[15][257];
2370 +init_dirsets() {
2371 +TABLE[14][0] = 1;
2372 +TABLE[14][256] = 1;
2373 +TABLE[14][40] = 1;
2374 +TABLE[14][45] = 1;
2375 +TABLE[1][45] = 1;
2376 +TABLE[1][40] = 1;
2377 +TABLE[1][256] = 1;
2378 +TABLE[2][0] = 1;
2379 +TABLE[3][0] = 1;
2380 +TABLE[4][256] = 1;
2381 +TABLE[4][40] = 1;
2382 +TABLE[4][45] = 1;
2383 +TABLE[5][256] = 1;
2384 +TABLE[5][40] = 1;
2385 +TABLE[5][45] = 1;
2386 +TABLE[6][256] = 1;
2387 +TABLE[6][40] = 1;
2388 +TABLE[6][45] = 1;
2389 +TABLE[7][45] = 1;
2390 +TABLE[7][40] = 1;
2391 +TABLE[7][256] = 1;
2392 +TABLE[8][45] = 1;
2393 +TABLE[8][40] = 1;
2394 +TABLE[8][256] = 1;
2395 +TABLE[9][45] = 1;
2396 +TABLE[9][40] = 1;
2397 +TABLE[9][256] = 1;
2398 +TABLE[10][256] = 1;
2399 +TABLE[10][40] = 1;
2400 +TABLE[10][45] = 1;
2401 +TABLE[11][256] = 1;
2402 +TABLE[12][40] = 1;
2403 +TABLE[13][45] = 1;
2406 +extern int yydirset();
2407 +int yydirset(i,j)
2408 + int i,j;
2410 + return TABLE[i][j];
2412 +int yytransparent(n)
2413 + int n;
2415 + switch(n) {
2416 + case 1: return 1; break;
2417 + case 6: return 1; break;
2418 + case 14: return 1; break;
2419 + case 17: return 0; break;
2420 + case 21: return 0; break;
2421 + case 37: return 0; break;
2422 + case 53: return 0; break;
2425 +char * yyprintname(n)
2426 + int n;
2428 + if (n <= 50000)
2429 + switch(n) {
2430 + case 1: return "YYSTART"; break;
2431 + case 6: return "root"; break;
2432 + case 14: return "null"; break;
2433 + case 17: return "expression"; break;
2434 + case 21: return "term"; break;
2435 + case 37: return "factor"; break;
2436 + case 53: return "primary"; break;
2438 + else
2439 + switch(n-50000) {
2440 + case 256: return "NUMBER"; break;
2442 + return "special_character";
2444 diff -ruN accent/exmplaccent/yygrammar.h good/exmplaccent/yygrammar.h
2445 --- accent/exmplaccent/yygrammar.h 1970-01-01 00:00:00.000000000 +0000
2446 +++ good/exmplaccent/yygrammar.h 2010-11-22 19:33:47.819999791 +0000
2447 @@ -0,0 +1,7 @@
2448 +#ifndef YYSTYPE
2449 +#define YYSTYPE long
2450 +#endif
2451 +extern YYSTYPE yylval;
2452 +extern long yypos;
2454 +#define NUMBER 256
2455 diff -ruN accent/exmplamber/build good/exmplamber/build
2456 --- accent/exmplamber/build 2006-03-30 12:35:26.000000000 +0000
2457 +++ good/exmplamber/build 2010-11-22 19:35:12.133333114 +0000
2458 @@ -9,6 +9,11 @@
2460 $ACCENT spec.acc
2462 +echo "#include <stdio.h>" > .tmp
2463 +echo "#include <stdlib.h>" >> .tmp
2464 +cat yygrammar.c >> .tmp
2465 +mv .tmp yygrammar.c
2467 cc -o amber -O3 yygrammar.c $AMBER
2469 -amber examples 500
2470 +./amber examples 500