fancy 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. data/README.md +4 -1
  2. data/Rakefile +8 -0
  3. data/bin/fyi +25 -20
  4. data/bin/ifancy +39 -5
  5. data/{extconf.rb → boot/extconf.rb} +1 -1
  6. data/boot/fancy_ext/block_env.rb +0 -14
  7. data/boot/fancy_ext/kernel.rb +6 -2
  8. data/boot/rbx-compiler/parser/fancy_parser.bundle +0 -0
  9. data/examples/actor.fy +37 -0
  10. data/examples/armstrong_numbers.fy +1 -1
  11. data/examples/curl_async.fy +37 -0
  12. data/examples/echo.fy +1 -1
  13. data/examples/factorial.fy +1 -1
  14. data/examples/future_composition.fy +20 -0
  15. data/examples/game_of_life.fy +2 -2
  16. data/examples/person.fy +4 -8
  17. data/examples/rbx/blocks.fy +1 -1
  18. data/examples/return.fy +1 -1
  19. data/examples/struct.fy +9 -0
  20. data/lib/argv.fy +2 -2
  21. data/lib/array.fy +157 -0
  22. data/lib/block.fy +18 -1
  23. data/lib/boot.fy +5 -1
  24. data/lib/compiler/ast/class_def.fy +1 -1
  25. data/lib/compiler/ast/identifier.fy +2 -2
  26. data/lib/compiler/ast/message_send.fy +2 -2
  27. data/lib/compiler/ast/method_def.fy +2 -2
  28. data/lib/compiler/ast/try_catch.fy +5 -1
  29. data/lib/documentation.fy +1 -1
  30. data/lib/enumerable.fy +3 -7
  31. data/lib/enumerator.fy +77 -0
  32. data/lib/false_class.fy +52 -0
  33. data/lib/fancy_spec.fy +40 -12
  34. data/lib/fdoc.fy +2 -2
  35. data/lib/file.fy +8 -1
  36. data/lib/future.fy +23 -2
  37. data/lib/iteration.fy +60 -0
  38. data/lib/main.fy +4 -4
  39. data/lib/nil_class.fy +14 -22
  40. data/lib/number.fy +51 -0
  41. data/lib/object.fy +126 -43
  42. data/lib/package/installer.fy +1 -1
  43. data/lib/parser/ext/lexer.lex +6 -1
  44. data/lib/parser/ext/parser.y +18 -0
  45. data/lib/parser/methods.fy +20 -2
  46. data/lib/proxy.fy +20 -3
  47. data/lib/rbx.fy +0 -1
  48. data/lib/rbx/array.fy +4 -138
  49. data/lib/rbx/block.fy +25 -1
  50. data/lib/rbx/class.fy +21 -0
  51. data/lib/rbx/exception.fy +1 -0
  52. data/lib/rbx/fiber.fy +1 -0
  53. data/lib/rbx/file.fy +8 -0
  54. data/lib/rbx/integer.fy +0 -8
  55. data/lib/rbx/method.fy +34 -7
  56. data/lib/rbx/no_method_error.fy +8 -1
  57. data/lib/rbx/object.fy +3 -32
  58. data/lib/rbx/range.fy +13 -1
  59. data/lib/rbx/regexp.fy +3 -0
  60. data/lib/rbx/string.fy +6 -1
  61. data/lib/rbx/system.fy +20 -2
  62. data/lib/set.fy +2 -2
  63. data/lib/string.fy +1 -1
  64. data/lib/struct.fy +15 -12
  65. data/lib/symbol.fy +2 -2
  66. data/lib/true_class.fy +16 -20
  67. data/lib/version.fy +1 -1
  68. data/tests/argv.fy +1 -0
  69. data/tests/array.fy +33 -2
  70. data/tests/block.fy +44 -0
  71. data/tests/class.fy +102 -88
  72. data/tests/control_flow.fy +131 -8
  73. data/tests/enumerator.fy +85 -0
  74. data/tests/exception.fy +13 -13
  75. data/tests/file.fy +4 -13
  76. data/tests/future.fy +26 -0
  77. data/tests/method.fy +83 -72
  78. data/tests/nil_class.fy +20 -13
  79. data/tests/number.fy +16 -9
  80. data/tests/object.fy +39 -20
  81. data/tests/string.fy +7 -0
  82. data/tests/true_class.fy +4 -4
  83. data/tools/fancy-mode.el +1 -1
  84. metadata +15 -20
  85. data/boot/compiler/parser/ext/fancy_parser.bundle +0 -0
  86. data/boot/rbx-compiler/parser/Makefile +0 -162
  87. data/boot/rbx-compiler/parser/lexer.c +0 -2316
  88. data/boot/rbx-compiler/parser/lexer.h +0 -315
  89. data/boot/rbx-compiler/parser/parser.c +0 -3105
  90. data/boot/rbx-compiler/parser/parser.h +0 -114
  91. data/lib/lazy_array.fy +0 -23
  92. data/lib/parser/ext/Makefile +0 -162
  93. data/lib/parser/ext/fancy_parser.bundle +0 -0
  94. data/lib/parser/ext/lexer.c +0 -2360
  95. data/lib/parser/ext/lexer.h +0 -315
  96. data/lib/parser/ext/parser.c +0 -3382
  97. data/lib/parser/ext/parser.h +0 -118
  98. data/lib/rbx/false_class.fy +0 -58
@@ -1,2316 +0,0 @@
1
- #line 2 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.c"
2
-
3
- #line 4 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.c"
4
-
5
- #define YY_INT_ALIGNED short int
6
-
7
- /* A lexical scanner generated by flex */
8
-
9
- #define FLEX_SCANNER
10
- #define YY_FLEX_MAJOR_VERSION 2
11
- #define YY_FLEX_MINOR_VERSION 5
12
- #define YY_FLEX_SUBMINOR_VERSION 35
13
- #if YY_FLEX_SUBMINOR_VERSION > 0
14
- #define FLEX_BETA
15
- #endif
16
-
17
- /* First, we deal with platform-specific or compiler-specific issues. */
18
-
19
- /* begin standard C headers. */
20
- #include <stdio.h>
21
- #include <string.h>
22
- #include <errno.h>
23
- #include <stdlib.h>
24
-
25
- /* end standard C headers. */
26
-
27
- /* flex integer type definitions */
28
-
29
- #ifndef FLEXINT_H
30
- #define FLEXINT_H
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
41
- #endif
42
-
43
- #include <inttypes.h>
44
- typedef int8_t flex_int8_t;
45
- typedef uint8_t flex_uint8_t;
46
- typedef int16_t flex_int16_t;
47
- typedef uint16_t flex_uint16_t;
48
- typedef int32_t flex_int32_t;
49
- typedef uint32_t flex_uint32_t;
50
- #else
51
- typedef signed char flex_int8_t;
52
- typedef short int flex_int16_t;
53
- typedef int flex_int32_t;
54
- typedef unsigned char flex_uint8_t;
55
- typedef unsigned short int flex_uint16_t;
56
- typedef unsigned int flex_uint32_t;
57
- #endif /* ! C99 */
58
-
59
- /* Limits of integral types. */
60
- #ifndef INT8_MIN
61
- #define INT8_MIN (-128)
62
- #endif
63
- #ifndef INT16_MIN
64
- #define INT16_MIN (-32767-1)
65
- #endif
66
- #ifndef INT32_MIN
67
- #define INT32_MIN (-2147483647-1)
68
- #endif
69
- #ifndef INT8_MAX
70
- #define INT8_MAX (127)
71
- #endif
72
- #ifndef INT16_MAX
73
- #define INT16_MAX (32767)
74
- #endif
75
- #ifndef INT32_MAX
76
- #define INT32_MAX (2147483647)
77
- #endif
78
- #ifndef UINT8_MAX
79
- #define UINT8_MAX (255U)
80
- #endif
81
- #ifndef UINT16_MAX
82
- #define UINT16_MAX (65535U)
83
- #endif
84
- #ifndef UINT32_MAX
85
- #define UINT32_MAX (4294967295U)
86
- #endif
87
-
88
- #endif /* ! FLEXINT_H */
89
-
90
- #ifdef __cplusplus
91
-
92
- /* The "const" storage-class-modifier is valid. */
93
- #define YY_USE_CONST
94
-
95
- #else /* ! __cplusplus */
96
-
97
- /* C99 requires __STDC__ to be defined as 1. */
98
- #if defined (__STDC__)
99
-
100
- #define YY_USE_CONST
101
-
102
- #endif /* defined (__STDC__) */
103
- #endif /* ! __cplusplus */
104
-
105
- #ifdef YY_USE_CONST
106
- #define yyconst const
107
- #else
108
- #define yyconst
109
- #endif
110
-
111
- /* Returned upon end-of-file. */
112
- #define YY_NULL 0
113
-
114
- /* Promotes a possibly negative, possibly signed char to an unsigned
115
- * integer for use as an array index. If the signed char is negative,
116
- * we want to instead treat it as an 8-bit unsigned char, hence the
117
- * double cast.
118
- */
119
- #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
120
-
121
- /* Enter a start condition. This macro really ought to take a parameter,
122
- * but we do it the disgusting crufty way forced on us by the ()-less
123
- * definition of BEGIN.
124
- */
125
- #define BEGIN (yy_start) = 1 + 2 *
126
-
127
- /* Translate the current start state into a value that can be later handed
128
- * to BEGIN to return to the state. The YYSTATE alias is for lex
129
- * compatibility.
130
- */
131
- #define YY_START (((yy_start) - 1) / 2)
132
- #define YYSTATE YY_START
133
-
134
- /* Action number for EOF rule of a given start state. */
135
- #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
136
-
137
- /* Special action meaning "start processing a new file". */
138
- #define YY_NEW_FILE yyrestart(yyin )
139
-
140
- #define YY_END_OF_BUFFER_CHAR 0
141
-
142
- /* Size of default input buffer. */
143
- #ifndef YY_BUF_SIZE
144
- #define YY_BUF_SIZE 16384
145
- #endif
146
-
147
- /* The state buf must be large enough to hold one state per character in the main buffer.
148
- */
149
- #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
150
-
151
- #ifndef YY_TYPEDEF_YY_BUFFER_STATE
152
- #define YY_TYPEDEF_YY_BUFFER_STATE
153
- typedef struct yy_buffer_state *YY_BUFFER_STATE;
154
- #endif
155
-
156
- #ifndef YY_TYPEDEF_YY_SIZE_T
157
- #define YY_TYPEDEF_YY_SIZE_T
158
- typedef size_t yy_size_t;
159
- #endif
160
-
161
- extern yy_size_t yyleng;
162
-
163
- extern FILE *yyin, *yyout;
164
-
165
- #define EOB_ACT_CONTINUE_SCAN 0
166
- #define EOB_ACT_END_OF_FILE 1
167
- #define EOB_ACT_LAST_MATCH 2
168
-
169
- /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
170
- * access to the local variable yy_act. Since yyless() is a macro, it would break
171
- * existing scanners that call yyless() from OUTSIDE yylex.
172
- * One obvious solution it to make yy_act a global. I tried that, and saw
173
- * a 5% performance hit in a non-yylineno scanner, because yy_act is
174
- * normally declared as a register variable-- so it is not worth it.
175
- */
176
- #define YY_LESS_LINENO(n) \
177
- do { \
178
- int yyl;\
179
- for ( yyl = n; yyl < yyleng; ++yyl )\
180
- if ( yytext[yyl] == '\n' )\
181
- --yylineno;\
182
- }while(0)
183
-
184
- /* Return all but the first "n" matched characters back to the input stream. */
185
- #define yyless(n) \
186
- do \
187
- { \
188
- /* Undo effects of setting up yytext. */ \
189
- int yyless_macro_arg = (n); \
190
- YY_LESS_LINENO(yyless_macro_arg);\
191
- *yy_cp = (yy_hold_char); \
192
- YY_RESTORE_YY_MORE_OFFSET \
193
- (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
194
- YY_DO_BEFORE_ACTION; /* set up yytext again */ \
195
- } \
196
- while ( 0 )
197
-
198
- #define unput(c) yyunput( c, (yytext_ptr) )
199
-
200
- #ifndef YY_STRUCT_YY_BUFFER_STATE
201
- #define YY_STRUCT_YY_BUFFER_STATE
202
- struct yy_buffer_state
203
- {
204
- FILE *yy_input_file;
205
-
206
- char *yy_ch_buf; /* input buffer */
207
- char *yy_buf_pos; /* current position in input buffer */
208
-
209
- /* Size of input buffer in bytes, not including room for EOB
210
- * characters.
211
- */
212
- yy_size_t yy_buf_size;
213
-
214
- /* Number of characters read into yy_ch_buf, not including EOB
215
- * characters.
216
- */
217
- yy_size_t yy_n_chars;
218
-
219
- /* Whether we "own" the buffer - i.e., we know we created it,
220
- * and can realloc() it to grow it, and should free() it to
221
- * delete it.
222
- */
223
- int yy_is_our_buffer;
224
-
225
- /* Whether this is an "interactive" input source; if so, and
226
- * if we're using stdio for input, then we want to use getc()
227
- * instead of fread(), to make sure we stop fetching input after
228
- * each newline.
229
- */
230
- int yy_is_interactive;
231
-
232
- /* Whether we're considered to be at the beginning of a line.
233
- * If so, '^' rules will be active on the next match, otherwise
234
- * not.
235
- */
236
- int yy_at_bol;
237
-
238
- int yy_bs_lineno; /**< The line count. */
239
- int yy_bs_column; /**< The column count. */
240
-
241
- /* Whether to try to fill the input buffer when we reach the
242
- * end of it.
243
- */
244
- int yy_fill_buffer;
245
-
246
- int yy_buffer_status;
247
-
248
- #define YY_BUFFER_NEW 0
249
- #define YY_BUFFER_NORMAL 1
250
- /* When an EOF's been seen but there's still some text to process
251
- * then we mark the buffer as YY_EOF_PENDING, to indicate that we
252
- * shouldn't try reading from the input source any more. We might
253
- * still have a bunch of tokens to match, though, because of
254
- * possible backing-up.
255
- *
256
- * When we actually see the EOF, we change the status to "new"
257
- * (via yyrestart()), so that the user can continue scanning by
258
- * just pointing yyin at a new input file.
259
- */
260
- #define YY_BUFFER_EOF_PENDING 2
261
-
262
- };
263
- #endif /* !YY_STRUCT_YY_BUFFER_STATE */
264
-
265
- /* Stack of input buffers. */
266
- static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
267
- static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
268
- static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
269
-
270
- /* We provide macros for accessing buffer states in case in the
271
- * future we want to put the buffer states in a more general
272
- * "scanner state".
273
- *
274
- * Returns the top of the stack, or NULL.
275
- */
276
- #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
277
- ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
278
- : NULL)
279
-
280
- /* Same as previous macro, but useful when we know that the buffer stack is not
281
- * NULL or when we need an lvalue. For internal use only.
282
- */
283
- #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
284
-
285
- /* yy_hold_char holds the character lost when yytext is formed. */
286
- static char yy_hold_char;
287
- static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
288
- yy_size_t yyleng;
289
-
290
- /* Points to current character in buffer. */
291
- static char *yy_c_buf_p = (char *) 0;
292
- static int yy_init = 0; /* whether we need to initialize */
293
- static int yy_start = 0; /* start state number */
294
-
295
- /* Flag which is used to allow yywrap()'s to do buffer switches
296
- * instead of setting up a fresh yyin. A bit of a hack ...
297
- */
298
- static int yy_did_buffer_switch_on_eof;
299
-
300
- void yyrestart (FILE *input_file );
301
- void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
302
- YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
303
- void yy_delete_buffer (YY_BUFFER_STATE b );
304
- void yy_flush_buffer (YY_BUFFER_STATE b );
305
- void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
306
- void yypop_buffer_state (void );
307
-
308
- static void yyensure_buffer_stack (void );
309
- static void yy_load_buffer_state (void );
310
- static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
311
-
312
- #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
313
-
314
- YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
315
- YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
316
- YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len );
317
-
318
- void *yyalloc (yy_size_t );
319
- void *yyrealloc (void *,yy_size_t );
320
- void yyfree (void * );
321
-
322
- #define yy_new_buffer yy_create_buffer
323
-
324
- #define yy_set_interactive(is_interactive) \
325
- { \
326
- if ( ! YY_CURRENT_BUFFER ){ \
327
- yyensure_buffer_stack (); \
328
- YY_CURRENT_BUFFER_LVALUE = \
329
- yy_create_buffer(yyin,YY_BUF_SIZE ); \
330
- } \
331
- YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
332
- }
333
-
334
- #define yy_set_bol(at_bol) \
335
- { \
336
- if ( ! YY_CURRENT_BUFFER ){\
337
- yyensure_buffer_stack (); \
338
- YY_CURRENT_BUFFER_LVALUE = \
339
- yy_create_buffer(yyin,YY_BUF_SIZE ); \
340
- } \
341
- YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
342
- }
343
-
344
- #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
345
-
346
- typedef unsigned char YY_CHAR;
347
-
348
- FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
349
-
350
- typedef int yy_state_type;
351
-
352
- extern int yylineno;
353
-
354
- int yylineno = 1;
355
-
356
- extern char *yytext;
357
- #define yytext_ptr yytext
358
-
359
- static yy_state_type yy_get_previous_state (void );
360
- static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
361
- static int yy_get_next_buffer (void );
362
- static void yy_fatal_error (yyconst char msg[] );
363
-
364
- /* Done after the current pattern has been matched and before the
365
- * corresponding action - sets up yytext.
366
- */
367
- #define YY_DO_BEFORE_ACTION \
368
- (yytext_ptr) = yy_bp; \
369
- yyleng = (size_t) (yy_cp - yy_bp); \
370
- (yy_hold_char) = *yy_cp; \
371
- *yy_cp = '\0'; \
372
- (yy_c_buf_p) = yy_cp;
373
-
374
- #define YY_NUM_RULES 53
375
- #define YY_END_OF_BUFFER 54
376
- /* This struct is not used in this scanner,
377
- but its presence is necessary. */
378
- struct yy_trans_info
379
- {
380
- flex_int32_t yy_verify;
381
- flex_int32_t yy_nxt;
382
- };
383
- static yyconst flex_int16_t yy_accept[181] =
384
- { 0,
385
- 49, 49, 54, 52, 49, 51, 22, 52, 48, 47,
386
- 22, 52, 10, 11, 22, 43, 22, 46, 22, 6,
387
- 6, 45, 44, 22, 21, 52, 39, 39, 14, 52,
388
- 15, 36, 36, 36, 36, 36, 36, 36, 36, 36,
389
- 12, 18, 13, 49, 22, 38, 0, 8, 0, 48,
390
- 22, 37, 36, 36, 41, 41, 41, 0, 0, 41,
391
- 0, 6, 20, 0, 22, 38, 22, 0, 6, 0,
392
- 0, 0, 0, 16, 19, 36, 0, 39, 39, 0,
393
- 0, 0, 50, 17, 37, 36, 36, 36, 36, 36,
394
- 36, 36, 36, 36, 36, 22, 8, 0, 41, 41,
395
-
396
- 41, 41, 41, 0, 41, 42, 7, 5, 4, 3,
397
- 0, 36, 36, 36, 2, 36, 36, 36, 36, 36,
398
- 36, 36, 36, 26, 22, 0, 0, 0, 41, 41,
399
- 41, 40, 35, 36, 36, 36, 36, 36, 36, 36,
400
- 36, 36, 33, 36, 0, 41, 41, 41, 40, 40,
401
- 27, 1, 36, 34, 36, 36, 36, 29, 36, 30,
402
- 9, 36, 36, 36, 36, 24, 28, 31, 36, 36,
403
- 36, 36, 25, 36, 32, 36, 36, 36, 23, 0
404
- } ;
405
-
406
- static yyconst flex_int32_t yy_ec[256] =
407
- { 0,
408
- 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
409
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
410
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
411
- 1, 2, 4, 5, 6, 7, 4, 8, 9, 10,
412
- 11, 8, 12, 13, 14, 15, 16, 17, 18, 19,
413
- 19, 19, 19, 19, 19, 20, 20, 21, 22, 23,
414
- 24, 25, 4, 26, 27, 28, 27, 27, 27, 27,
415
- 29, 29, 29, 29, 29, 30, 29, 29, 31, 29,
416
- 29, 29, 29, 29, 29, 29, 29, 32, 29, 29,
417
- 33, 34, 35, 4, 36, 1, 37, 38, 39, 40,
418
-
419
- 41, 42, 43, 44, 45, 43, 43, 46, 47, 48,
420
- 49, 50, 51, 52, 53, 54, 55, 56, 43, 57,
421
- 58, 43, 59, 60, 61, 4, 1, 1, 1, 1,
422
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
423
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
424
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
425
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
426
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
427
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
428
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
429
-
430
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
431
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
432
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
433
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
434
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
435
- 1, 1, 1, 1, 1
436
- } ;
437
-
438
- static yyconst flex_int32_t yy_meta[62] =
439
- { 0,
440
- 1, 1, 2, 3, 1, 1, 1, 4, 1, 5,
441
- 1, 3, 1, 3, 1, 3, 6, 6, 6, 6,
442
- 7, 1, 3, 3, 3, 8, 9, 9, 10, 10,
443
- 10, 10, 11, 1, 1, 12, 13, 13, 13, 13,
444
- 13, 13, 14, 14, 14, 14, 14, 14, 14, 14,
445
- 14, 14, 14, 14, 14, 14, 14, 14, 1, 15,
446
- 1
447
- } ;
448
-
449
- static yyconst flex_int16_t yy_base[195] =
450
- { 0,
451
- 0, 0, 387, 728, 383, 728, 58, 58, 0, 728,
452
- 89, 122, 728, 728, 59, 728, 70, 728, 92, 168,
453
- 103, 728, 728, 61, 146, 357, 222, 255, 728, 377,
454
- 354, 288, 27, 337, 332, 339, 323, 333, 43, 315,
455
- 728, 306, 728, 363, 149, 728, 106, 358, 355, 0,
456
- 197, 728, 0, 0, 321, 378, 0, 435, 316, 0,
457
- 290, 161, 225, 332, 258, 327, 285, 172, 237, 68,
458
- 110, 0, 267, 728, 345, 0, 315, 335, 334, 317,
459
- 130, 333, 728, 728, 728, 56, 297, 290, 283, 276,
460
- 88, 90, 282, 277, 268, 297, 728, 161, 0, 0,
461
-
462
- 0, 0, 0, 280, 348, 289, 297, 114, 197, 0,
463
- 291, 262, 255, 237, 0, 251, 238, 219, 211, 209,
464
- 97, 219, 212, 0, 241, 189, 239, 239, 0, 458,
465
- 0, 492, 0, 196, 179, 185, 184, 190, 183, 174,
466
- 160, 160, 0, 158, 203, 0, 0, 0, 525, 0,
467
- 0, 0, 157, 0, 148, 159, 141, 0, 136, 0,
468
- 728, 119, 134, 114, 126, 115, 0, 0, 101, 103,
469
- 73, 67, 728, 42, 0, 36, 30, 19, 0, 728,
470
- 561, 576, 589, 601, 614, 620, 633, 641, 653, 667,
471
- 677, 688, 700, 713
472
-
473
- } ;
474
-
475
- static yyconst flex_int16_t yy_def[195] =
476
- { 0,
477
- 180, 1, 180, 180, 180, 180, 180, 181, 182, 180,
478
- 183, 184, 180, 180, 185, 180, 185, 180, 186, 180,
479
- 180, 180, 180, 187, 180, 188, 189, 189, 180, 190,
480
- 180, 183, 32, 32, 32, 32, 32, 32, 32, 32,
481
- 180, 180, 180, 180, 180, 180, 181, 180, 181, 182,
482
- 32, 180, 32, 32, 184, 180, 55, 184, 180, 56,
483
- 180, 180, 180, 186, 186, 186, 186, 180, 180, 180,
484
- 180, 191, 180, 180, 180, 32, 188, 28, 28, 180,
485
- 181, 190, 180, 180, 180, 32, 32, 32, 32, 32,
486
- 32, 32, 32, 32, 32, 192, 180, 193, 56, 56,
487
-
488
- 56, 56, 56, 58, 55, 186, 180, 180, 180, 191,
489
- 180, 32, 32, 32, 32, 32, 32, 32, 32, 32,
490
- 32, 32, 32, 32, 192, 193, 180, 193, 105, 56,
491
- 130, 194, 32, 32, 32, 32, 32, 32, 32, 32,
492
- 32, 32, 32, 32, 180, 130, 130, 130, 194, 149,
493
- 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
494
- 180, 32, 32, 32, 32, 32, 32, 32, 32, 32,
495
- 32, 32, 180, 32, 32, 32, 32, 32, 32, 0,
496
- 180, 180, 180, 180, 180, 180, 180, 180, 180, 180,
497
- 180, 180, 180, 180
498
-
499
- } ;
500
-
501
- static yyconst flex_int16_t yy_nxt[790] =
502
- { 0,
503
- 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
504
- 14, 15, 16, 17, 18, 19, 20, 21, 21, 21,
505
- 22, 23, 24, 25, 7, 26, 27, 27, 27, 28,
506
- 27, 27, 29, 30, 31, 32, 32, 32, 33, 34,
507
- 32, 35, 32, 32, 32, 32, 36, 32, 32, 37,
508
- 32, 38, 39, 40, 32, 32, 32, 32, 41, 42,
509
- 43, 45, 48, 86, 179, 45, 178, 46, 46, 45,
510
- 46, 45, 87, 45, 177, 62, 62, 62, 62, 46,
511
- 45, 45, 45, 93, 108, 108, 62, 62, 62, 62,
512
- 176, 49, 51, 74, 63, 65, 51, 94, 52, 65,
513
-
514
- 51, 66, 51, 65, 51, 65, 175, 67, 112, 113,
515
- 97, 51, 51, 51, 65, 65, 65, 68, 174, 69,
516
- 69, 69, 69, 173, 54, 55, 109, 109, 109, 56,
517
- 108, 108, 118, 55, 48, 55, 119, 55, 73, 49,
518
- 120, 172, 57, 121, 55, 55, 55, 58, 141, 45,
519
- 171, 142, 45, 45, 59, 46, 45, 45, 46, 45,
520
- 45, 45, 45, 49, 45, 127, 170, 169, 45, 45,
521
- 75, 45, 45, 45, 168, 68, 167, 69, 69, 69,
522
- 69, 61, 68, 166, 69, 69, 69, 69, 107, 107,
523
- 107, 107, 165, 127, 128, 70, 73, 164, 71, 72,
524
-
525
- 51, 163, 162, 73, 51, 70, 52, 161, 51, 160,
526
- 51, 159, 51, 109, 109, 109, 71, 158, 157, 51,
527
- 51, 51, 128, 156, 72, 78, 155, 154, 45, 78,
528
- 153, 152, 45, 78, 46, 78, 45, 78, 45, 151,
529
- 45, 180, 80, 145, 78, 78, 78, 45, 45, 45,
530
- 46, 68, 144, 69, 69, 69, 69, 78, 78, 81,
531
- 143, 65, 78, 140, 139, 65, 78, 66, 78, 65,
532
- 78, 65, 73, 67, 138, 80, 137, 78, 78, 78,
533
- 65, 65, 65, 69, 69, 69, 69, 136, 65, 135,
534
- 78, 54, 65, 134, 66, 54, 65, 85, 65, 54,
535
-
536
- 67, 54, 133, 54, 106, 180, 46, 65, 65, 65,
537
- 54, 54, 54, 107, 107, 107, 107, 132, 132, 132,
538
- 132, 132, 132, 54, 55, 124, 123, 122, 56, 117,
539
- 116, 115, 55, 114, 55, 83, 55, 111, 180, 180,
540
- 180, 57, 106, 55, 55, 55, 58, 106, 45, 105,
541
- 57, 129, 45, 59, 46, 130, 45, 180, 45, 129,
542
- 45, 129, 98, 129, 44, 96, 95, 45, 45, 45,
543
- 129, 129, 129, 92, 91, 90, 89, 88, 84, 83,
544
- 61, 99, 77, 131, 44, 100, 180, 180, 180, 99,
545
- 180, 99, 180, 99, 101, 101, 101, 101, 57, 180,
546
-
547
- 99, 99, 99, 58, 101, 101, 101, 101, 101, 101,
548
- 59, 180, 180, 102, 103, 103, 103, 103, 103, 103,
549
- 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
550
- 103, 103, 103, 103, 103, 103, 180, 61, 180, 180,
551
- 180, 180, 180, 180, 180, 180, 180, 180, 180, 180,
552
- 180, 180, 180, 180, 180, 180, 180, 180, 180, 180,
553
- 104, 146, 180, 180, 180, 147, 180, 180, 180, 146,
554
- 180, 146, 180, 146, 180, 180, 180, 180, 180, 180,
555
- 146, 146, 146, 180, 180, 180, 180, 180, 180, 180,
556
- 180, 180, 180, 148, 180, 149, 180, 180, 180, 149,
557
-
558
- 180, 180, 180, 149, 180, 149, 180, 149, 180, 180,
559
- 180, 180, 80, 180, 149, 149, 149, 180, 180, 180,
560
- 180, 180, 180, 180, 180, 180, 180, 149, 149, 180,
561
- 180, 180, 149, 180, 180, 180, 149, 180, 149, 180,
562
- 149, 180, 180, 180, 180, 80, 180, 149, 149, 149,
563
- 180, 180, 180, 180, 180, 180, 180, 180, 180, 180,
564
- 149, 47, 47, 47, 47, 47, 47, 47, 47, 47,
565
- 47, 47, 47, 47, 47, 47, 50, 180, 50, 50,
566
- 50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
567
- 50, 53, 53, 53, 53, 180, 180, 53, 53, 180,
568
-
569
- 53, 53, 53, 60, 60, 180, 180, 60, 60, 180,
570
- 180, 60, 60, 60, 60, 60, 45, 45, 45, 45,
571
- 64, 180, 64, 64, 64, 64, 64, 64, 64, 64,
572
- 64, 64, 64, 64, 64, 45, 45, 45, 180, 180,
573
- 180, 180, 180, 45, 76, 180, 180, 180, 76, 180,
574
- 180, 180, 76, 76, 76, 79, 79, 180, 79, 79,
575
- 180, 79, 79, 180, 79, 79, 79, 82, 82, 82,
576
- 82, 82, 82, 82, 82, 82, 82, 82, 82, 82,
577
- 82, 82, 110, 180, 180, 110, 180, 180, 180, 110,
578
- 125, 125, 125, 180, 180, 180, 180, 180, 180, 125,
579
-
580
- 126, 126, 126, 126, 126, 126, 126, 126, 126, 126,
581
- 126, 126, 126, 126, 126, 150, 150, 180, 150, 150,
582
- 180, 150, 150, 180, 150, 150, 150, 3, 180, 180,
583
- 180, 180, 180, 180, 180, 180, 180, 180, 180, 180,
584
- 180, 180, 180, 180, 180, 180, 180, 180, 180, 180,
585
- 180, 180, 180, 180, 180, 180, 180, 180, 180, 180,
586
- 180, 180, 180, 180, 180, 180, 180, 180, 180, 180,
587
- 180, 180, 180, 180, 180, 180, 180, 180, 180, 180,
588
- 180, 180, 180, 180, 180, 180, 180, 180, 180
589
- } ;
590
-
591
- static yyconst flex_int16_t yy_chk[790] =
592
- { 0,
593
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
594
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
595
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
596
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
597
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
598
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
599
- 1, 7, 8, 33, 178, 7, 177, 7, 15, 7,
600
- 24, 7, 33, 7, 176, 15, 15, 15, 15, 17,
601
- 7, 7, 7, 39, 70, 70, 17, 17, 17, 17,
602
- 174, 8, 11, 24, 17, 19, 11, 39, 11, 19,
603
-
604
- 11, 19, 11, 19, 11, 19, 172, 19, 86, 86,
605
- 47, 11, 11, 11, 19, 19, 19, 21, 171, 21,
606
- 21, 21, 21, 170, 11, 12, 71, 71, 71, 12,
607
- 108, 108, 91, 12, 81, 12, 91, 12, 21, 47,
608
- 92, 169, 12, 92, 12, 12, 12, 12, 121, 25,
609
- 166, 121, 45, 25, 12, 25, 45, 25, 45, 25,
610
- 45, 25, 45, 81, 45, 98, 165, 164, 25, 25,
611
- 25, 45, 45, 45, 163, 62, 162, 62, 62, 62,
612
- 62, 12, 20, 159, 20, 20, 20, 20, 68, 68,
613
- 68, 68, 157, 126, 98, 20, 62, 156, 20, 20,
614
-
615
- 51, 155, 153, 20, 51, 20, 51, 145, 51, 144,
616
- 51, 142, 51, 109, 109, 109, 20, 141, 140, 51,
617
- 51, 51, 126, 139, 20, 27, 138, 137, 63, 27,
618
- 136, 135, 63, 27, 63, 27, 63, 27, 63, 134,
619
- 63, 128, 27, 127, 27, 27, 27, 63, 63, 63,
620
- 125, 69, 123, 69, 69, 69, 69, 27, 28, 28,
621
- 122, 65, 28, 120, 119, 65, 28, 65, 28, 65,
622
- 28, 65, 69, 65, 118, 28, 117, 28, 28, 28,
623
- 65, 65, 65, 73, 73, 73, 73, 116, 67, 114,
624
- 28, 32, 67, 113, 67, 32, 67, 32, 67, 32,
625
-
626
- 67, 32, 112, 32, 106, 104, 96, 67, 67, 67,
627
- 32, 32, 32, 107, 107, 107, 107, 111, 111, 111,
628
- 111, 111, 111, 32, 55, 95, 94, 93, 55, 90,
629
- 89, 88, 55, 87, 55, 82, 55, 80, 79, 78,
630
- 77, 55, 66, 55, 55, 55, 55, 64, 75, 61,
631
- 59, 105, 75, 55, 75, 105, 75, 49, 75, 105,
632
- 75, 105, 48, 105, 44, 42, 40, 75, 75, 75,
633
- 105, 105, 105, 38, 37, 36, 35, 34, 31, 30,
634
- 55, 56, 26, 105, 5, 56, 3, 0, 0, 56,
635
- 0, 56, 0, 56, 56, 56, 56, 56, 56, 0,
636
-
637
- 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
638
- 56, 0, 0, 56, 56, 56, 56, 56, 56, 56,
639
- 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
640
- 56, 56, 56, 56, 56, 56, 0, 56, 58, 0,
641
- 0, 0, 0, 0, 0, 0, 58, 0, 58, 0,
642
- 58, 0, 0, 0, 0, 58, 0, 58, 58, 58,
643
- 58, 130, 0, 0, 0, 130, 0, 58, 0, 130,
644
- 0, 130, 0, 130, 0, 0, 0, 0, 0, 0,
645
- 130, 130, 130, 0, 0, 0, 0, 0, 0, 0,
646
- 0, 0, 0, 130, 58, 132, 0, 0, 0, 132,
647
-
648
- 0, 0, 0, 132, 0, 132, 0, 132, 0, 0,
649
- 0, 0, 132, 0, 132, 132, 132, 0, 0, 0,
650
- 0, 0, 0, 0, 0, 0, 0, 132, 149, 0,
651
- 0, 0, 149, 0, 0, 0, 149, 0, 149, 0,
652
- 149, 0, 0, 0, 0, 149, 0, 149, 149, 149,
653
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
654
- 149, 181, 181, 181, 181, 181, 181, 181, 181, 181,
655
- 181, 181, 181, 181, 181, 181, 182, 0, 182, 182,
656
- 182, 182, 182, 182, 182, 182, 182, 182, 182, 182,
657
- 182, 183, 183, 183, 183, 0, 0, 183, 183, 0,
658
-
659
- 183, 183, 183, 184, 184, 0, 0, 184, 184, 0,
660
- 0, 184, 184, 184, 184, 184, 185, 185, 185, 185,
661
- 186, 0, 186, 186, 186, 186, 186, 186, 186, 186,
662
- 186, 186, 186, 186, 186, 187, 187, 187, 0, 0,
663
- 0, 0, 0, 187, 188, 0, 0, 0, 188, 0,
664
- 0, 0, 188, 188, 188, 189, 189, 0, 189, 189,
665
- 0, 189, 189, 0, 189, 189, 189, 190, 190, 190,
666
- 190, 190, 190, 190, 190, 190, 190, 190, 190, 190,
667
- 190, 190, 191, 0, 0, 191, 0, 0, 0, 191,
668
- 192, 192, 192, 0, 0, 0, 0, 0, 0, 192,
669
-
670
- 193, 193, 193, 193, 193, 193, 193, 193, 193, 193,
671
- 193, 193, 193, 193, 193, 194, 194, 0, 194, 194,
672
- 0, 194, 194, 0, 194, 194, 194, 180, 180, 180,
673
- 180, 180, 180, 180, 180, 180, 180, 180, 180, 180,
674
- 180, 180, 180, 180, 180, 180, 180, 180, 180, 180,
675
- 180, 180, 180, 180, 180, 180, 180, 180, 180, 180,
676
- 180, 180, 180, 180, 180, 180, 180, 180, 180, 180,
677
- 180, 180, 180, 180, 180, 180, 180, 180, 180, 180,
678
- 180, 180, 180, 180, 180, 180, 180, 180, 180
679
- } ;
680
-
681
- /* Table of booleans, true if rule could match eol. */
682
- static yyconst flex_int32_t yy_rule_can_match_eol[54] =
683
- { 0,
684
- 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
685
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
686
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, };
687
-
688
- static yy_state_type yy_last_accepting_state;
689
- static char *yy_last_accepting_cpos;
690
-
691
- extern int yy_flex_debug;
692
- int yy_flex_debug = 0;
693
-
694
- /* The intent behind this definition is that it'll catch
695
- * any uses of REJECT which flex missed.
696
- */
697
- #define REJECT reject_used_but_not_detected
698
- #define yymore() yymore_used_but_not_detected
699
- #define YY_MORE_ADJ 0
700
- #define YY_RESTORE_YY_MORE_OFFSET
701
- char *yytext;
702
- #line 1 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
703
- #line 2 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
704
- #include "ruby.h"
705
- #include "parser.h"
706
-
707
- int yyerror(char *s);
708
- #line 709 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.c"
709
-
710
- #define INITIAL 0
711
-
712
- #ifndef YY_NO_UNISTD_H
713
- /* Special case for "unistd.h", since it is non-ANSI. We include it way
714
- * down here because we want the user's section 1 to have been scanned first.
715
- * The user has a chance to override it with an option.
716
- */
717
- #include <unistd.h>
718
- #endif
719
-
720
- #ifndef YY_EXTRA_TYPE
721
- #define YY_EXTRA_TYPE void *
722
- #endif
723
-
724
- static int yy_init_globals (void );
725
-
726
- /* Accessor methods to globals.
727
- These are made visible to non-reentrant scanners for convenience. */
728
-
729
- int yylex_destroy (void );
730
-
731
- int yyget_debug (void );
732
-
733
- void yyset_debug (int debug_flag );
734
-
735
- YY_EXTRA_TYPE yyget_extra (void );
736
-
737
- void yyset_extra (YY_EXTRA_TYPE user_defined );
738
-
739
- FILE *yyget_in (void );
740
-
741
- void yyset_in (FILE * in_str );
742
-
743
- FILE *yyget_out (void );
744
-
745
- void yyset_out (FILE * out_str );
746
-
747
- yy_size_t yyget_leng (void );
748
-
749
- char *yyget_text (void );
750
-
751
- int yyget_lineno (void );
752
-
753
- void yyset_lineno (int line_number );
754
-
755
- /* Macros after this point can all be overridden by user definitions in
756
- * section 1.
757
- */
758
-
759
- #ifndef YY_SKIP_YYWRAP
760
- #ifdef __cplusplus
761
- extern "C" int yywrap (void );
762
- #else
763
- extern int yywrap (void );
764
- #endif
765
- #endif
766
-
767
- static void yyunput (int c,char *buf_ptr );
768
-
769
- #ifndef yytext_ptr
770
- static void yy_flex_strncpy (char *,yyconst char *,int );
771
- #endif
772
-
773
- #ifdef YY_NEED_STRLEN
774
- static int yy_flex_strlen (yyconst char * );
775
- #endif
776
-
777
- #ifndef YY_NO_INPUT
778
-
779
- #ifdef __cplusplus
780
- static int yyinput (void );
781
- #else
782
- static int input (void );
783
- #endif
784
-
785
- #endif
786
-
787
- /* Amount of stuff to slurp up with each read. */
788
- #ifndef YY_READ_BUF_SIZE
789
- #define YY_READ_BUF_SIZE 8192
790
- #endif
791
-
792
- /* Copy whatever the last rule matched to the standard output. */
793
- #ifndef ECHO
794
- /* This used to be an fputs(), but since the string might contain NUL's,
795
- * we now use fwrite().
796
- */
797
- #define ECHO fwrite( yytext, yyleng, 1, yyout )
798
- #endif
799
-
800
- /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
801
- * is returned in "result".
802
- */
803
- #ifndef YY_INPUT
804
- #define YY_INPUT(buf,result,max_size) \
805
- if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
806
- { \
807
- int c = '*'; \
808
- yy_size_t n; \
809
- for ( n = 0; n < max_size && \
810
- (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
811
- buf[n] = (char) c; \
812
- if ( c == '\n' ) \
813
- buf[n++] = (char) c; \
814
- if ( c == EOF && ferror( yyin ) ) \
815
- YY_FATAL_ERROR( "input in flex scanner failed" ); \
816
- result = n; \
817
- } \
818
- else \
819
- { \
820
- errno=0; \
821
- while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
822
- { \
823
- if( errno != EINTR) \
824
- { \
825
- YY_FATAL_ERROR( "input in flex scanner failed" ); \
826
- break; \
827
- } \
828
- errno=0; \
829
- clearerr(yyin); \
830
- } \
831
- }\
832
- \
833
-
834
- #endif
835
-
836
- /* No semi-colon after return; correct usage is to write "yyterminate();" -
837
- * we don't want an extra ';' after the "return" because that will cause
838
- * some compilers to complain about unreachable statements.
839
- */
840
- #ifndef yyterminate
841
- #define yyterminate() return YY_NULL
842
- #endif
843
-
844
- /* Number of entries by which start-condition stack grows. */
845
- #ifndef YY_START_STACK_INCR
846
- #define YY_START_STACK_INCR 25
847
- #endif
848
-
849
- /* Report a fatal error. */
850
- #ifndef YY_FATAL_ERROR
851
- #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
852
- #endif
853
-
854
- /* end tables serialization structures and prototypes */
855
-
856
- /* Default declaration of generated scanner - a define so the user can
857
- * easily add parameters.
858
- */
859
- #ifndef YY_DECL
860
- #define YY_DECL_IS_OURS 1
861
-
862
- extern int yylex (void);
863
-
864
- #define YY_DECL int yylex (void)
865
- #endif /* !YY_DECL */
866
-
867
- /* Code executed at the beginning of each rule, after yytext and yyleng
868
- * have been set up.
869
- */
870
- #ifndef YY_USER_ACTION
871
- #define YY_USER_ACTION
872
- #endif
873
-
874
- /* Code executed at the end of each rule. */
875
- #ifndef YY_BREAK
876
- #define YY_BREAK break;
877
- #endif
878
-
879
- #define YY_RULE_SETUP \
880
- YY_USER_ACTION
881
-
882
- /** The main scanner function which does all the work.
883
- */
884
- YY_DECL
885
- {
886
- register yy_state_type yy_current_state;
887
- register char *yy_cp, *yy_bp;
888
- register int yy_act;
889
-
890
- #line 71 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
891
-
892
-
893
- #line 894 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.c"
894
-
895
- if ( !(yy_init) )
896
- {
897
- (yy_init) = 1;
898
-
899
- #ifdef YY_USER_INIT
900
- YY_USER_INIT;
901
- #endif
902
-
903
- if ( ! (yy_start) )
904
- (yy_start) = 1; /* first start state */
905
-
906
- if ( ! yyin )
907
- yyin = stdin;
908
-
909
- if ( ! yyout )
910
- yyout = stdout;
911
-
912
- if ( ! YY_CURRENT_BUFFER ) {
913
- yyensure_buffer_stack ();
914
- YY_CURRENT_BUFFER_LVALUE =
915
- yy_create_buffer(yyin,YY_BUF_SIZE );
916
- }
917
-
918
- yy_load_buffer_state( );
919
- }
920
-
921
- while ( 1 ) /* loops until end-of-file is reached */
922
- {
923
- yy_cp = (yy_c_buf_p);
924
-
925
- /* Support of yytext. */
926
- *yy_cp = (yy_hold_char);
927
-
928
- /* yy_bp points to the position in yy_ch_buf of the start of
929
- * the current run.
930
- */
931
- yy_bp = yy_cp;
932
-
933
- yy_current_state = (yy_start);
934
- yy_match:
935
- do
936
- {
937
- register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
938
- if ( yy_accept[yy_current_state] )
939
- {
940
- (yy_last_accepting_state) = yy_current_state;
941
- (yy_last_accepting_cpos) = yy_cp;
942
- }
943
- while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
944
- {
945
- yy_current_state = (int) yy_def[yy_current_state];
946
- if ( yy_current_state >= 181 )
947
- yy_c = yy_meta[(unsigned int) yy_c];
948
- }
949
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
950
- ++yy_cp;
951
- }
952
- while ( yy_base[yy_current_state] != 728 );
953
-
954
- yy_find_action:
955
- yy_act = yy_accept[yy_current_state];
956
- if ( yy_act == 0 )
957
- { /* have to back up */
958
- yy_cp = (yy_last_accepting_cpos);
959
- yy_current_state = (yy_last_accepting_state);
960
- yy_act = yy_accept[yy_current_state];
961
- }
962
-
963
- YY_DO_BEFORE_ACTION;
964
-
965
- if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
966
- {
967
- int yyl;
968
- for ( yyl = 0; yyl < yyleng; ++yyl )
969
- if ( yytext[yyl] == '\n' )
970
-
971
- yylineno++;
972
- ;
973
- }
974
-
975
- do_action: /* This label is used only to access EOF actions. */
976
-
977
- switch ( yy_act )
978
- { /* beginning of action switch */
979
- case 0: /* must back up */
980
- /* undo the effects of YY_DO_BEFORE_ACTION */
981
- *yy_cp = (yy_hold_char);
982
- yy_cp = (yy_last_accepting_cpos);
983
- yy_current_state = (yy_last_accepting_state);
984
- goto yy_find_action;
985
-
986
- case 1:
987
- YY_RULE_SETUP
988
- #line 73 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
989
- { return CLASS; }
990
- YY_BREAK
991
- case 2:
992
- YY_RULE_SETUP
993
- #line 74 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
994
- { return DEF; }
995
- YY_BREAK
996
- case 3:
997
- YY_RULE_SETUP
998
- #line 75 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
999
- {
1000
- yylval.object = rb_str_new2(yytext);
1001
- return HEX_LITERAL;
1002
- }
1003
- YY_BREAK
1004
- case 4:
1005
- YY_RULE_SETUP
1006
- #line 79 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1007
- {
1008
- yylval.object = rb_str_new2(yytext);
1009
- return OCT_LITERAL;
1010
- }
1011
- YY_BREAK
1012
- case 5:
1013
- YY_RULE_SETUP
1014
- #line 83 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1015
- {
1016
- yylval.object = rb_str_new2(yytext);
1017
- return BIN_LITERAL;
1018
- }
1019
- YY_BREAK
1020
- case 6:
1021
- YY_RULE_SETUP
1022
- #line 87 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1023
- {
1024
- yylval.object = rb_str_new2(yytext);
1025
- return INTEGER_LITERAL;
1026
- }
1027
- YY_BREAK
1028
- case 7:
1029
- YY_RULE_SETUP
1030
- #line 91 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1031
- {
1032
- yylval.object = rb_str_new2(yytext);
1033
- return DOUBLE_LITERAL;
1034
- }
1035
- YY_BREAK
1036
- case 8:
1037
- /* rule 8 can match eol */
1038
- YY_RULE_SETUP
1039
- #line 95 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1040
- {
1041
- yylval.object = rb_str_new2(yytext);
1042
- return STRING_LITERAL;
1043
- }
1044
- YY_BREAK
1045
- case 9:
1046
- /* rule 9 can match eol */
1047
- YY_RULE_SETUP
1048
- #line 99 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1049
- {
1050
- yylval.object = rb_str_new2(yytext);
1051
- return MULTI_STRING_LITERAL;
1052
- }
1053
- YY_BREAK
1054
- case 10:
1055
- YY_RULE_SETUP
1056
- #line 103 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1057
- { return LPAREN; }
1058
- YY_BREAK
1059
- case 11:
1060
- YY_RULE_SETUP
1061
- #line 104 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1062
- { return RPAREN; }
1063
- YY_BREAK
1064
- case 12:
1065
- YY_RULE_SETUP
1066
- #line 105 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1067
- { return LCURLY; }
1068
- YY_BREAK
1069
- case 13:
1070
- YY_RULE_SETUP
1071
- #line 106 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1072
- { return RCURLY; }
1073
- YY_BREAK
1074
- case 14:
1075
- YY_RULE_SETUP
1076
- #line 107 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1077
- { return LBRACKET; }
1078
- YY_BREAK
1079
- case 15:
1080
- YY_RULE_SETUP
1081
- #line 108 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1082
- { return RBRACKET; }
1083
- YY_BREAK
1084
- case 16:
1085
- YY_RULE_SETUP
1086
- #line 109 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1087
- { return LHASH; }
1088
- YY_BREAK
1089
- case 17:
1090
- YY_RULE_SETUP
1091
- #line 110 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1092
- { return RHASH; }
1093
- YY_BREAK
1094
- case 18:
1095
- YY_RULE_SETUP
1096
- #line 111 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1097
- { return STAB; }
1098
- YY_BREAK
1099
- case 19:
1100
- YY_RULE_SETUP
1101
- #line 112 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1102
- { return ARROW; }
1103
- YY_BREAK
1104
- case 20:
1105
- YY_RULE_SETUP
1106
- #line 113 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1107
- { return THIN_ARROW; }
1108
- YY_BREAK
1109
- case 21:
1110
- YY_RULE_SETUP
1111
- #line 114 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1112
- { return EQUALS; }
1113
- YY_BREAK
1114
- case 22:
1115
- YY_RULE_SETUP
1116
- #line 115 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1117
- {
1118
- yylval.object = rb_str_new2(yytext);
1119
- return OPERATOR;
1120
- }
1121
- YY_BREAK
1122
- case 23:
1123
- YY_RULE_SETUP
1124
- #line 119 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1125
- { return RETURN_LOCAL; }
1126
- YY_BREAK
1127
- case 24:
1128
- YY_RULE_SETUP
1129
- #line 120 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1130
- { return RETURN; }
1131
- YY_BREAK
1132
- case 25:
1133
- YY_RULE_SETUP
1134
- #line 121 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1135
- { return REQUIRE; }
1136
- YY_BREAK
1137
- case 26:
1138
- YY_RULE_SETUP
1139
- #line 122 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1140
- { return TRY; }
1141
- YY_BREAK
1142
- case 27:
1143
- YY_RULE_SETUP
1144
- #line 123 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1145
- { return CATCH; }
1146
- YY_BREAK
1147
- case 28:
1148
- YY_RULE_SETUP
1149
- #line 124 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1150
- { return FINALLY; }
1151
- YY_BREAK
1152
- case 29:
1153
- YY_RULE_SETUP
1154
- #line 125 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1155
- { return RETRY; }
1156
- YY_BREAK
1157
- case 30:
1158
- YY_RULE_SETUP
1159
- #line 126 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1160
- { return SUPER; }
1161
- YY_BREAK
1162
- case 31:
1163
- YY_RULE_SETUP
1164
- #line 127 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1165
- { return PRIVATE; }
1166
- YY_BREAK
1167
- case 32:
1168
- YY_RULE_SETUP
1169
- #line 128 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1170
- { return PROTECTED; }
1171
- YY_BREAK
1172
- case 33:
1173
- YY_RULE_SETUP
1174
- #line 129 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1175
- {
1176
- yylval.object = rb_str_new2(yytext);
1177
- return IDENTIFIER;
1178
- }
1179
- YY_BREAK
1180
- case 34:
1181
- YY_RULE_SETUP
1182
- #line 133 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1183
- {
1184
- return MATCH;
1185
- }
1186
- YY_BREAK
1187
- case 35:
1188
- YY_RULE_SETUP
1189
- #line 136 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1190
- {
1191
- return CASE;
1192
- }
1193
- YY_BREAK
1194
- case 36:
1195
- YY_RULE_SETUP
1196
- #line 139 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1197
- {
1198
- yylval.object = rb_str_new2(yytext);
1199
- return IDENTIFIER;
1200
- }
1201
- YY_BREAK
1202
- case 37:
1203
- YY_RULE_SETUP
1204
- #line 143 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1205
- {
1206
- yylval.object = rb_str_new2(yytext);
1207
- return RUBY_SEND_OPEN;
1208
- }
1209
- YY_BREAK
1210
- case 38:
1211
- YY_RULE_SETUP
1212
- #line 147 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1213
- {
1214
- yylval.object = rb_str_new2(yytext);
1215
- return RUBY_OPER_OPEN;
1216
- }
1217
- YY_BREAK
1218
- case 39:
1219
- YY_RULE_SETUP
1220
- #line 151 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1221
- {
1222
- yylval.object = rb_str_new2(yytext);
1223
- return CONSTANT;
1224
- }
1225
- YY_BREAK
1226
- case 40:
1227
- YY_RULE_SETUP
1228
- #line 155 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1229
- {
1230
- yylval.object = rb_str_new2(yytext);
1231
- return CONSTANT;
1232
- }
1233
- YY_BREAK
1234
- case 41:
1235
- YY_RULE_SETUP
1236
- #line 159 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1237
- {
1238
- yylval.object = rb_str_new2(yytext);
1239
- return SYMBOL_LITERAL;
1240
- }
1241
- YY_BREAK
1242
- case 42:
1243
- YY_RULE_SETUP
1244
- #line 163 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1245
- {
1246
- yylval.object = rb_str_new2(yytext);
1247
- return REGEX_LITERAL;
1248
- }
1249
- YY_BREAK
1250
- case 43:
1251
- YY_RULE_SETUP
1252
- #line 167 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1253
- { return COMMA; }
1254
- YY_BREAK
1255
- case 44:
1256
- YY_RULE_SETUP
1257
- #line 168 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1258
- { return SEMI; }
1259
- YY_BREAK
1260
- case 45:
1261
- YY_RULE_SETUP
1262
- #line 169 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1263
- { return COLON; }
1264
- YY_BREAK
1265
- case 46:
1266
- YY_RULE_SETUP
1267
- #line 170 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1268
- { return DOT; }
1269
- YY_BREAK
1270
- case 47:
1271
- YY_RULE_SETUP
1272
- #line 171 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1273
- { return DOLLAR; }
1274
- YY_BREAK
1275
- case 48:
1276
- YY_RULE_SETUP
1277
- #line 173 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1278
- {}
1279
- YY_BREAK
1280
- case 49:
1281
- YY_RULE_SETUP
1282
- #line 175 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1283
- {}
1284
- YY_BREAK
1285
- case 50:
1286
- /* rule 50 can match eol */
1287
- YY_RULE_SETUP
1288
- #line 176 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1289
- {}
1290
- YY_BREAK
1291
- case 51:
1292
- /* rule 51 can match eol */
1293
- YY_RULE_SETUP
1294
- #line 177 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1295
- { return NL; }
1296
- YY_BREAK
1297
- case 52:
1298
- YY_RULE_SETUP
1299
- #line 179 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1300
- { fprintf(stderr, "SCANNER %d", yyerror("")); exit(1); }
1301
- YY_BREAK
1302
- case 53:
1303
- YY_RULE_SETUP
1304
- #line 181 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"
1305
- ECHO;
1306
- YY_BREAK
1307
- #line 1308 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.c"
1308
- case YY_STATE_EOF(INITIAL):
1309
- yyterminate();
1310
-
1311
- case YY_END_OF_BUFFER:
1312
- {
1313
- /* Amount of text matched not including the EOB char. */
1314
- int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1315
-
1316
- /* Undo the effects of YY_DO_BEFORE_ACTION. */
1317
- *yy_cp = (yy_hold_char);
1318
- YY_RESTORE_YY_MORE_OFFSET
1319
-
1320
- if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1321
- {
1322
- /* We're scanning a new file or input source. It's
1323
- * possible that this happened because the user
1324
- * just pointed yyin at a new source and called
1325
- * yylex(). If so, then we have to assure
1326
- * consistency between YY_CURRENT_BUFFER and our
1327
- * globals. Here is the right place to do so, because
1328
- * this is the first action (other than possibly a
1329
- * back-up) that will match for the new input source.
1330
- */
1331
- (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1332
- YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1333
- YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1334
- }
1335
-
1336
- /* Note that here we test for yy_c_buf_p "<=" to the position
1337
- * of the first EOB in the buffer, since yy_c_buf_p will
1338
- * already have been incremented past the NUL character
1339
- * (since all states make transitions on EOB to the
1340
- * end-of-buffer state). Contrast this with the test
1341
- * in input().
1342
- */
1343
- if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1344
- { /* This was really a NUL. */
1345
- yy_state_type yy_next_state;
1346
-
1347
- (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1348
-
1349
- yy_current_state = yy_get_previous_state( );
1350
-
1351
- /* Okay, we're now positioned to make the NUL
1352
- * transition. We couldn't have
1353
- * yy_get_previous_state() go ahead and do it
1354
- * for us because it doesn't know how to deal
1355
- * with the possibility of jamming (and we don't
1356
- * want to build jamming into it because then it
1357
- * will run more slowly).
1358
- */
1359
-
1360
- yy_next_state = yy_try_NUL_trans( yy_current_state );
1361
-
1362
- yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1363
-
1364
- if ( yy_next_state )
1365
- {
1366
- /* Consume the NUL. */
1367
- yy_cp = ++(yy_c_buf_p);
1368
- yy_current_state = yy_next_state;
1369
- goto yy_match;
1370
- }
1371
-
1372
- else
1373
- {
1374
- yy_cp = (yy_c_buf_p);
1375
- goto yy_find_action;
1376
- }
1377
- }
1378
-
1379
- else switch ( yy_get_next_buffer( ) )
1380
- {
1381
- case EOB_ACT_END_OF_FILE:
1382
- {
1383
- (yy_did_buffer_switch_on_eof) = 0;
1384
-
1385
- if ( yywrap( ) )
1386
- {
1387
- /* Note: because we've taken care in
1388
- * yy_get_next_buffer() to have set up
1389
- * yytext, we can now set up
1390
- * yy_c_buf_p so that if some total
1391
- * hoser (like flex itself) wants to
1392
- * call the scanner after we return the
1393
- * YY_NULL, it'll still work - another
1394
- * YY_NULL will get returned.
1395
- */
1396
- (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1397
-
1398
- yy_act = YY_STATE_EOF(YY_START);
1399
- goto do_action;
1400
- }
1401
-
1402
- else
1403
- {
1404
- if ( ! (yy_did_buffer_switch_on_eof) )
1405
- YY_NEW_FILE;
1406
- }
1407
- break;
1408
- }
1409
-
1410
- case EOB_ACT_CONTINUE_SCAN:
1411
- (yy_c_buf_p) =
1412
- (yytext_ptr) + yy_amount_of_matched_text;
1413
-
1414
- yy_current_state = yy_get_previous_state( );
1415
-
1416
- yy_cp = (yy_c_buf_p);
1417
- yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1418
- goto yy_match;
1419
-
1420
- case EOB_ACT_LAST_MATCH:
1421
- (yy_c_buf_p) =
1422
- &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1423
-
1424
- yy_current_state = yy_get_previous_state( );
1425
-
1426
- yy_cp = (yy_c_buf_p);
1427
- yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1428
- goto yy_find_action;
1429
- }
1430
- break;
1431
- }
1432
-
1433
- default:
1434
- YY_FATAL_ERROR(
1435
- "fatal flex scanner internal error--no action found" );
1436
- } /* end of action switch */
1437
- } /* end of scanning one token */
1438
- } /* end of yylex */
1439
-
1440
- /* yy_get_next_buffer - try to read in a new buffer
1441
- *
1442
- * Returns a code representing an action:
1443
- * EOB_ACT_LAST_MATCH -
1444
- * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1445
- * EOB_ACT_END_OF_FILE - end of file
1446
- */
1447
- static int yy_get_next_buffer (void)
1448
- {
1449
- register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1450
- register char *source = (yytext_ptr);
1451
- register int number_to_move, i;
1452
- int ret_val;
1453
-
1454
- if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1455
- YY_FATAL_ERROR(
1456
- "fatal flex scanner internal error--end of buffer missed" );
1457
-
1458
- if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1459
- { /* Don't try to fill the buffer, so this is an EOF. */
1460
- if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1461
- {
1462
- /* We matched a single character, the EOB, so
1463
- * treat this as a final EOF.
1464
- */
1465
- return EOB_ACT_END_OF_FILE;
1466
- }
1467
-
1468
- else
1469
- {
1470
- /* We matched some text prior to the EOB, first
1471
- * process it.
1472
- */
1473
- return EOB_ACT_LAST_MATCH;
1474
- }
1475
- }
1476
-
1477
- /* Try to read more data. */
1478
-
1479
- /* First move last chars to start of buffer. */
1480
- number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1481
-
1482
- for ( i = 0; i < number_to_move; ++i )
1483
- *(dest++) = *(source++);
1484
-
1485
- if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1486
- /* don't do the read, it's not guaranteed to return an EOF,
1487
- * just force an EOF
1488
- */
1489
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1490
-
1491
- else
1492
- {
1493
- yy_size_t num_to_read =
1494
- YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1495
-
1496
- while ( num_to_read <= 0 )
1497
- { /* Not enough room in the buffer - grow it. */
1498
-
1499
- /* just a shorter name for the current buffer */
1500
- YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1501
-
1502
- int yy_c_buf_p_offset =
1503
- (int) ((yy_c_buf_p) - b->yy_ch_buf);
1504
-
1505
- if ( b->yy_is_our_buffer )
1506
- {
1507
- yy_size_t new_size = b->yy_buf_size * 2;
1508
-
1509
- if ( new_size <= 0 )
1510
- b->yy_buf_size += b->yy_buf_size / 8;
1511
- else
1512
- b->yy_buf_size *= 2;
1513
-
1514
- b->yy_ch_buf = (char *)
1515
- /* Include room in for 2 EOB chars. */
1516
- yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1517
- }
1518
- else
1519
- /* Can't grow it, we don't own it. */
1520
- b->yy_ch_buf = 0;
1521
-
1522
- if ( ! b->yy_ch_buf )
1523
- YY_FATAL_ERROR(
1524
- "fatal error - scanner input buffer overflow" );
1525
-
1526
- (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1527
-
1528
- num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1529
- number_to_move - 1;
1530
-
1531
- }
1532
-
1533
- if ( num_to_read > YY_READ_BUF_SIZE )
1534
- num_to_read = YY_READ_BUF_SIZE;
1535
-
1536
- /* Read in more data. */
1537
- YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1538
- (yy_n_chars), num_to_read );
1539
-
1540
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1541
- }
1542
-
1543
- if ( (yy_n_chars) == 0 )
1544
- {
1545
- if ( number_to_move == YY_MORE_ADJ )
1546
- {
1547
- ret_val = EOB_ACT_END_OF_FILE;
1548
- yyrestart(yyin );
1549
- }
1550
-
1551
- else
1552
- {
1553
- ret_val = EOB_ACT_LAST_MATCH;
1554
- YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1555
- YY_BUFFER_EOF_PENDING;
1556
- }
1557
- }
1558
-
1559
- else
1560
- ret_val = EOB_ACT_CONTINUE_SCAN;
1561
-
1562
- if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1563
- /* Extend the array by 50%, plus the number we really need. */
1564
- yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1565
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1566
- if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1567
- YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1568
- }
1569
-
1570
- (yy_n_chars) += number_to_move;
1571
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1572
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1573
-
1574
- (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1575
-
1576
- return ret_val;
1577
- }
1578
-
1579
- /* yy_get_previous_state - get the state just before the EOB char was reached */
1580
-
1581
- static yy_state_type yy_get_previous_state (void)
1582
- {
1583
- register yy_state_type yy_current_state;
1584
- register char *yy_cp;
1585
-
1586
- yy_current_state = (yy_start);
1587
-
1588
- for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1589
- {
1590
- register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1591
- if ( yy_accept[yy_current_state] )
1592
- {
1593
- (yy_last_accepting_state) = yy_current_state;
1594
- (yy_last_accepting_cpos) = yy_cp;
1595
- }
1596
- while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1597
- {
1598
- yy_current_state = (int) yy_def[yy_current_state];
1599
- if ( yy_current_state >= 181 )
1600
- yy_c = yy_meta[(unsigned int) yy_c];
1601
- }
1602
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1603
- }
1604
-
1605
- return yy_current_state;
1606
- }
1607
-
1608
- /* yy_try_NUL_trans - try to make a transition on the NUL character
1609
- *
1610
- * synopsis
1611
- * next_state = yy_try_NUL_trans( current_state );
1612
- */
1613
- static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1614
- {
1615
- register int yy_is_jam;
1616
- register char *yy_cp = (yy_c_buf_p);
1617
-
1618
- register YY_CHAR yy_c = 1;
1619
- if ( yy_accept[yy_current_state] )
1620
- {
1621
- (yy_last_accepting_state) = yy_current_state;
1622
- (yy_last_accepting_cpos) = yy_cp;
1623
- }
1624
- while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1625
- {
1626
- yy_current_state = (int) yy_def[yy_current_state];
1627
- if ( yy_current_state >= 181 )
1628
- yy_c = yy_meta[(unsigned int) yy_c];
1629
- }
1630
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1631
- yy_is_jam = (yy_current_state == 180);
1632
-
1633
- return yy_is_jam ? 0 : yy_current_state;
1634
- }
1635
-
1636
- static void yyunput (int c, register char * yy_bp )
1637
- {
1638
- register char *yy_cp;
1639
-
1640
- yy_cp = (yy_c_buf_p);
1641
-
1642
- /* undo effects of setting up yytext */
1643
- *yy_cp = (yy_hold_char);
1644
-
1645
- if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1646
- { /* need to shift things up to make room */
1647
- /* +2 for EOB chars. */
1648
- register yy_size_t number_to_move = (yy_n_chars) + 2;
1649
- register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1650
- YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1651
- register char *source =
1652
- &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1653
-
1654
- while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1655
- *--dest = *--source;
1656
-
1657
- yy_cp += (int) (dest - source);
1658
- yy_bp += (int) (dest - source);
1659
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1660
- (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1661
-
1662
- if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1663
- YY_FATAL_ERROR( "flex scanner push-back overflow" );
1664
- }
1665
-
1666
- *--yy_cp = (char) c;
1667
-
1668
- if ( c == '\n' ){
1669
- --yylineno;
1670
- }
1671
-
1672
- (yytext_ptr) = yy_bp;
1673
- (yy_hold_char) = *yy_cp;
1674
- (yy_c_buf_p) = yy_cp;
1675
- }
1676
-
1677
- #ifndef YY_NO_INPUT
1678
- #ifdef __cplusplus
1679
- static int yyinput (void)
1680
- #else
1681
- static int input (void)
1682
- #endif
1683
-
1684
- {
1685
- int c;
1686
-
1687
- *(yy_c_buf_p) = (yy_hold_char);
1688
-
1689
- if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1690
- {
1691
- /* yy_c_buf_p now points to the character we want to return.
1692
- * If this occurs *before* the EOB characters, then it's a
1693
- * valid NUL; if not, then we've hit the end of the buffer.
1694
- */
1695
- if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1696
- /* This was really a NUL. */
1697
- *(yy_c_buf_p) = '\0';
1698
-
1699
- else
1700
- { /* need more input */
1701
- yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
1702
- ++(yy_c_buf_p);
1703
-
1704
- switch ( yy_get_next_buffer( ) )
1705
- {
1706
- case EOB_ACT_LAST_MATCH:
1707
- /* This happens because yy_g_n_b()
1708
- * sees that we've accumulated a
1709
- * token and flags that we need to
1710
- * try matching the token before
1711
- * proceeding. But for input(),
1712
- * there's no matching to consider.
1713
- * So convert the EOB_ACT_LAST_MATCH
1714
- * to EOB_ACT_END_OF_FILE.
1715
- */
1716
-
1717
- /* Reset buffer status. */
1718
- yyrestart(yyin );
1719
-
1720
- /*FALLTHROUGH*/
1721
-
1722
- case EOB_ACT_END_OF_FILE:
1723
- {
1724
- if ( yywrap( ) )
1725
- return 0;
1726
-
1727
- if ( ! (yy_did_buffer_switch_on_eof) )
1728
- YY_NEW_FILE;
1729
- #ifdef __cplusplus
1730
- return yyinput();
1731
- #else
1732
- return input();
1733
- #endif
1734
- }
1735
-
1736
- case EOB_ACT_CONTINUE_SCAN:
1737
- (yy_c_buf_p) = (yytext_ptr) + offset;
1738
- break;
1739
- }
1740
- }
1741
- }
1742
-
1743
- c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1744
- *(yy_c_buf_p) = '\0'; /* preserve yytext */
1745
- (yy_hold_char) = *++(yy_c_buf_p);
1746
-
1747
- if ( c == '\n' )
1748
-
1749
- yylineno++;
1750
- ;
1751
-
1752
- return c;
1753
- }
1754
- #endif /* ifndef YY_NO_INPUT */
1755
-
1756
- /** Immediately switch to a different input stream.
1757
- * @param input_file A readable stream.
1758
- *
1759
- * @note This function does not reset the start condition to @c INITIAL .
1760
- */
1761
- void yyrestart (FILE * input_file )
1762
- {
1763
-
1764
- if ( ! YY_CURRENT_BUFFER ){
1765
- yyensure_buffer_stack ();
1766
- YY_CURRENT_BUFFER_LVALUE =
1767
- yy_create_buffer(yyin,YY_BUF_SIZE );
1768
- }
1769
-
1770
- yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1771
- yy_load_buffer_state( );
1772
- }
1773
-
1774
- /** Switch to a different input buffer.
1775
- * @param new_buffer The new input buffer.
1776
- *
1777
- */
1778
- void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1779
- {
1780
-
1781
- /* TODO. We should be able to replace this entire function body
1782
- * with
1783
- * yypop_buffer_state();
1784
- * yypush_buffer_state(new_buffer);
1785
- */
1786
- yyensure_buffer_stack ();
1787
- if ( YY_CURRENT_BUFFER == new_buffer )
1788
- return;
1789
-
1790
- if ( YY_CURRENT_BUFFER )
1791
- {
1792
- /* Flush out information for old buffer. */
1793
- *(yy_c_buf_p) = (yy_hold_char);
1794
- YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1795
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1796
- }
1797
-
1798
- YY_CURRENT_BUFFER_LVALUE = new_buffer;
1799
- yy_load_buffer_state( );
1800
-
1801
- /* We don't actually know whether we did this switch during
1802
- * EOF (yywrap()) processing, but the only time this flag
1803
- * is looked at is after yywrap() is called, so it's safe
1804
- * to go ahead and always set it.
1805
- */
1806
- (yy_did_buffer_switch_on_eof) = 1;
1807
- }
1808
-
1809
- static void yy_load_buffer_state (void)
1810
- {
1811
- (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1812
- (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1813
- yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1814
- (yy_hold_char) = *(yy_c_buf_p);
1815
- }
1816
-
1817
- /** Allocate and initialize an input buffer state.
1818
- * @param file A readable stream.
1819
- * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1820
- *
1821
- * @return the allocated buffer state.
1822
- */
1823
- YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1824
- {
1825
- YY_BUFFER_STATE b;
1826
-
1827
- b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1828
- if ( ! b )
1829
- YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1830
-
1831
- b->yy_buf_size = size;
1832
-
1833
- /* yy_ch_buf has to be 2 characters longer than the size given because
1834
- * we need to put in 2 end-of-buffer characters.
1835
- */
1836
- b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
1837
- if ( ! b->yy_ch_buf )
1838
- YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1839
-
1840
- b->yy_is_our_buffer = 1;
1841
-
1842
- yy_init_buffer(b,file );
1843
-
1844
- return b;
1845
- }
1846
-
1847
- /** Destroy the buffer.
1848
- * @param b a buffer created with yy_create_buffer()
1849
- *
1850
- */
1851
- void yy_delete_buffer (YY_BUFFER_STATE b )
1852
- {
1853
-
1854
- if ( ! b )
1855
- return;
1856
-
1857
- if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1858
- YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1859
-
1860
- if ( b->yy_is_our_buffer )
1861
- yyfree((void *) b->yy_ch_buf );
1862
-
1863
- yyfree((void *) b );
1864
- }
1865
-
1866
- #ifndef __cplusplus
1867
- extern int isatty (int );
1868
- #endif /* __cplusplus */
1869
-
1870
- /* Initializes or reinitializes a buffer.
1871
- * This function is sometimes called more than once on the same buffer,
1872
- * such as during a yyrestart() or at EOF.
1873
- */
1874
- static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1875
-
1876
- {
1877
- int oerrno = errno;
1878
-
1879
- yy_flush_buffer(b );
1880
-
1881
- b->yy_input_file = file;
1882
- b->yy_fill_buffer = 1;
1883
-
1884
- /* If b is the current buffer, then yy_init_buffer was _probably_
1885
- * called from yyrestart() or through yy_get_next_buffer.
1886
- * In that case, we don't want to reset the lineno or column.
1887
- */
1888
- if (b != YY_CURRENT_BUFFER){
1889
- b->yy_bs_lineno = 1;
1890
- b->yy_bs_column = 0;
1891
- }
1892
-
1893
- b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1894
-
1895
- errno = oerrno;
1896
- }
1897
-
1898
- /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1899
- * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1900
- *
1901
- */
1902
- void yy_flush_buffer (YY_BUFFER_STATE b )
1903
- {
1904
- if ( ! b )
1905
- return;
1906
-
1907
- b->yy_n_chars = 0;
1908
-
1909
- /* We always need two end-of-buffer characters. The first causes
1910
- * a transition to the end-of-buffer state. The second causes
1911
- * a jam in that state.
1912
- */
1913
- b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1914
- b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1915
-
1916
- b->yy_buf_pos = &b->yy_ch_buf[0];
1917
-
1918
- b->yy_at_bol = 1;
1919
- b->yy_buffer_status = YY_BUFFER_NEW;
1920
-
1921
- if ( b == YY_CURRENT_BUFFER )
1922
- yy_load_buffer_state( );
1923
- }
1924
-
1925
- /** Pushes the new state onto the stack. The new state becomes
1926
- * the current state. This function will allocate the stack
1927
- * if necessary.
1928
- * @param new_buffer The new state.
1929
- *
1930
- */
1931
- void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1932
- {
1933
- if (new_buffer == NULL)
1934
- return;
1935
-
1936
- yyensure_buffer_stack();
1937
-
1938
- /* This block is copied from yy_switch_to_buffer. */
1939
- if ( YY_CURRENT_BUFFER )
1940
- {
1941
- /* Flush out information for old buffer. */
1942
- *(yy_c_buf_p) = (yy_hold_char);
1943
- YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1944
- YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1945
- }
1946
-
1947
- /* Only push if top exists. Otherwise, replace top. */
1948
- if (YY_CURRENT_BUFFER)
1949
- (yy_buffer_stack_top)++;
1950
- YY_CURRENT_BUFFER_LVALUE = new_buffer;
1951
-
1952
- /* copied from yy_switch_to_buffer. */
1953
- yy_load_buffer_state( );
1954
- (yy_did_buffer_switch_on_eof) = 1;
1955
- }
1956
-
1957
- /** Removes and deletes the top of the stack, if present.
1958
- * The next element becomes the new top.
1959
- *
1960
- */
1961
- void yypop_buffer_state (void)
1962
- {
1963
- if (!YY_CURRENT_BUFFER)
1964
- return;
1965
-
1966
- yy_delete_buffer(YY_CURRENT_BUFFER );
1967
- YY_CURRENT_BUFFER_LVALUE = NULL;
1968
- if ((yy_buffer_stack_top) > 0)
1969
- --(yy_buffer_stack_top);
1970
-
1971
- if (YY_CURRENT_BUFFER) {
1972
- yy_load_buffer_state( );
1973
- (yy_did_buffer_switch_on_eof) = 1;
1974
- }
1975
- }
1976
-
1977
- /* Allocates the stack if it does not exist.
1978
- * Guarantees space for at least one push.
1979
- */
1980
- static void yyensure_buffer_stack (void)
1981
- {
1982
- yy_size_t num_to_alloc;
1983
-
1984
- if (!(yy_buffer_stack)) {
1985
-
1986
- /* First allocation is just for 2 elements, since we don't know if this
1987
- * scanner will even need a stack. We use 2 instead of 1 to avoid an
1988
- * immediate realloc on the next call.
1989
- */
1990
- num_to_alloc = 1;
1991
- (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1992
- (num_to_alloc * sizeof(struct yy_buffer_state*)
1993
- );
1994
- if ( ! (yy_buffer_stack) )
1995
- YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1996
-
1997
- memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1998
-
1999
- (yy_buffer_stack_max) = num_to_alloc;
2000
- (yy_buffer_stack_top) = 0;
2001
- return;
2002
- }
2003
-
2004
- if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
2005
-
2006
- /* Increase the buffer to prepare for a possible push. */
2007
- int grow_size = 8 /* arbitrary grow size */;
2008
-
2009
- num_to_alloc = (yy_buffer_stack_max) + grow_size;
2010
- (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
2011
- ((yy_buffer_stack),
2012
- num_to_alloc * sizeof(struct yy_buffer_state*)
2013
- );
2014
- if ( ! (yy_buffer_stack) )
2015
- YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2016
-
2017
- /* zero only the new slots.*/
2018
- memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
2019
- (yy_buffer_stack_max) = num_to_alloc;
2020
- }
2021
- }
2022
-
2023
- /** Setup the input buffer state to scan directly from a user-specified character buffer.
2024
- * @param base the character buffer
2025
- * @param size the size in bytes of the character buffer
2026
- *
2027
- * @return the newly allocated buffer state object.
2028
- */
2029
- YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
2030
- {
2031
- YY_BUFFER_STATE b;
2032
-
2033
- if ( size < 2 ||
2034
- base[size-2] != YY_END_OF_BUFFER_CHAR ||
2035
- base[size-1] != YY_END_OF_BUFFER_CHAR )
2036
- /* They forgot to leave room for the EOB's. */
2037
- return 0;
2038
-
2039
- b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
2040
- if ( ! b )
2041
- YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2042
-
2043
- b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
2044
- b->yy_buf_pos = b->yy_ch_buf = base;
2045
- b->yy_is_our_buffer = 0;
2046
- b->yy_input_file = 0;
2047
- b->yy_n_chars = b->yy_buf_size;
2048
- b->yy_is_interactive = 0;
2049
- b->yy_at_bol = 1;
2050
- b->yy_fill_buffer = 0;
2051
- b->yy_buffer_status = YY_BUFFER_NEW;
2052
-
2053
- yy_switch_to_buffer(b );
2054
-
2055
- return b;
2056
- }
2057
-
2058
- /** Setup the input buffer state to scan a string. The next call to yylex() will
2059
- * scan from a @e copy of @a str.
2060
- * @param yystr a NUL-terminated string to scan
2061
- *
2062
- * @return the newly allocated buffer state object.
2063
- * @note If you want to scan bytes that may contain NUL values, then use
2064
- * yy_scan_bytes() instead.
2065
- */
2066
- YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
2067
- {
2068
-
2069
- return yy_scan_bytes(yystr,strlen(yystr) );
2070
- }
2071
-
2072
- /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
2073
- * scan from a @e copy of @a bytes.
2074
- * @param bytes the byte buffer to scan
2075
- * @param len the number of bytes in the buffer pointed to by @a bytes.
2076
- *
2077
- * @return the newly allocated buffer state object.
2078
- */
2079
- YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
2080
- {
2081
- YY_BUFFER_STATE b;
2082
- char *buf;
2083
- yy_size_t n, i;
2084
-
2085
- /* Get memory for full buffer, including space for trailing EOB's. */
2086
- n = _yybytes_len + 2;
2087
- buf = (char *) yyalloc(n );
2088
- if ( ! buf )
2089
- YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2090
-
2091
- for ( i = 0; i < _yybytes_len; ++i )
2092
- buf[i] = yybytes[i];
2093
-
2094
- buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2095
-
2096
- b = yy_scan_buffer(buf,n );
2097
- if ( ! b )
2098
- YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2099
-
2100
- /* It's okay to grow etc. this buffer, and we should throw it
2101
- * away when we're done.
2102
- */
2103
- b->yy_is_our_buffer = 1;
2104
-
2105
- return b;
2106
- }
2107
-
2108
- #ifndef YY_EXIT_FAILURE
2109
- #define YY_EXIT_FAILURE 2
2110
- #endif
2111
-
2112
- static void yy_fatal_error (yyconst char* msg )
2113
- {
2114
- (void) fprintf( stderr, "%s\n", msg );
2115
- exit( YY_EXIT_FAILURE );
2116
- }
2117
-
2118
- /* Redefine yyless() so it works in section 3 code. */
2119
-
2120
- #undef yyless
2121
- #define yyless(n) \
2122
- do \
2123
- { \
2124
- /* Undo effects of setting up yytext. */ \
2125
- int yyless_macro_arg = (n); \
2126
- YY_LESS_LINENO(yyless_macro_arg);\
2127
- yytext[yyleng] = (yy_hold_char); \
2128
- (yy_c_buf_p) = yytext + yyless_macro_arg; \
2129
- (yy_hold_char) = *(yy_c_buf_p); \
2130
- *(yy_c_buf_p) = '\0'; \
2131
- yyleng = yyless_macro_arg; \
2132
- } \
2133
- while ( 0 )
2134
-
2135
- /* Accessor methods (get/set functions) to struct members. */
2136
-
2137
- /** Get the current line number.
2138
- *
2139
- */
2140
- int yyget_lineno (void)
2141
- {
2142
-
2143
- return yylineno;
2144
- }
2145
-
2146
- /** Get the input stream.
2147
- *
2148
- */
2149
- FILE *yyget_in (void)
2150
- {
2151
- return yyin;
2152
- }
2153
-
2154
- /** Get the output stream.
2155
- *
2156
- */
2157
- FILE *yyget_out (void)
2158
- {
2159
- return yyout;
2160
- }
2161
-
2162
- /** Get the length of the current token.
2163
- *
2164
- */
2165
- yy_size_t yyget_leng (void)
2166
- {
2167
- return yyleng;
2168
- }
2169
-
2170
- /** Get the current token.
2171
- *
2172
- */
2173
-
2174
- char *yyget_text (void)
2175
- {
2176
- return yytext;
2177
- }
2178
-
2179
- /** Set the current line number.
2180
- * @param line_number
2181
- *
2182
- */
2183
- void yyset_lineno (int line_number )
2184
- {
2185
-
2186
- yylineno = line_number;
2187
- }
2188
-
2189
- /** Set the input stream. This does not discard the current
2190
- * input buffer.
2191
- * @param in_str A readable stream.
2192
- *
2193
- * @see yy_switch_to_buffer
2194
- */
2195
- void yyset_in (FILE * in_str )
2196
- {
2197
- yyin = in_str ;
2198
- }
2199
-
2200
- void yyset_out (FILE * out_str )
2201
- {
2202
- yyout = out_str ;
2203
- }
2204
-
2205
- int yyget_debug (void)
2206
- {
2207
- return yy_flex_debug;
2208
- }
2209
-
2210
- void yyset_debug (int bdebug )
2211
- {
2212
- yy_flex_debug = bdebug ;
2213
- }
2214
-
2215
- static int yy_init_globals (void)
2216
- {
2217
- /* Initialization is the same as for the non-reentrant scanner.
2218
- * This function is called from yylex_destroy(), so don't allocate here.
2219
- */
2220
-
2221
- /* We do not touch yylineno unless the option is enabled. */
2222
- yylineno = 1;
2223
-
2224
- (yy_buffer_stack) = 0;
2225
- (yy_buffer_stack_top) = 0;
2226
- (yy_buffer_stack_max) = 0;
2227
- (yy_c_buf_p) = (char *) 0;
2228
- (yy_init) = 0;
2229
- (yy_start) = 0;
2230
-
2231
- /* Defined in main.c */
2232
- #ifdef YY_STDINIT
2233
- yyin = stdin;
2234
- yyout = stdout;
2235
- #else
2236
- yyin = (FILE *) 0;
2237
- yyout = (FILE *) 0;
2238
- #endif
2239
-
2240
- /* For future reference: Set errno on error, since we are called by
2241
- * yylex_init()
2242
- */
2243
- return 0;
2244
- }
2245
-
2246
- /* yylex_destroy is for both reentrant and non-reentrant scanners. */
2247
- int yylex_destroy (void)
2248
- {
2249
-
2250
- /* Pop the buffer stack, destroying each element. */
2251
- while(YY_CURRENT_BUFFER){
2252
- yy_delete_buffer(YY_CURRENT_BUFFER );
2253
- YY_CURRENT_BUFFER_LVALUE = NULL;
2254
- yypop_buffer_state();
2255
- }
2256
-
2257
- /* Destroy the stack itself. */
2258
- yyfree((yy_buffer_stack) );
2259
- (yy_buffer_stack) = NULL;
2260
-
2261
- /* Reset the globals. This is important in a non-reentrant scanner so the next time
2262
- * yylex() is called, initialization will occur. */
2263
- yy_init_globals( );
2264
-
2265
- return 0;
2266
- }
2267
-
2268
- /*
2269
- * Internal utility routines.
2270
- */
2271
-
2272
- #ifndef yytext_ptr
2273
- static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2274
- {
2275
- register int i;
2276
- for ( i = 0; i < n; ++i )
2277
- s1[i] = s2[i];
2278
- }
2279
- #endif
2280
-
2281
- #ifdef YY_NEED_STRLEN
2282
- static int yy_flex_strlen (yyconst char * s )
2283
- {
2284
- register int n;
2285
- for ( n = 0; s[n]; ++n )
2286
- ;
2287
-
2288
- return n;
2289
- }
2290
- #endif
2291
-
2292
- void *yyalloc (yy_size_t size )
2293
- {
2294
- return (void *) malloc( size );
2295
- }
2296
-
2297
- void *yyrealloc (void * ptr, yy_size_t size )
2298
- {
2299
- /* The cast to (char *) in the following accommodates both
2300
- * implementations that use char* generic pointers, and those
2301
- * that use void* generic pointers. It works with the latter
2302
- * because both ANSI C and C++ allow castless assignment from
2303
- * any pointer type to void*, and deal with argument conversions
2304
- * as though doing an assignment.
2305
- */
2306
- return (void *) realloc( (char *) ptr, size );
2307
- }
2308
-
2309
- void yyfree (void * ptr )
2310
- {
2311
- free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2312
- }
2313
-
2314
- #define YYTABLES_NAME "yytables"
2315
-
2316
- #line 181 "/Users/backtype/projects/fancy/boot/rbx-compiler/parser/lexer.lex"