*** empty log message ***
[chuck-blob.git] / exile / v1 / src / chuck_win32.c
blob4c1448d9a33ec24ea21260cdb6a7c1afb007a580
1 /* A Bison parser, made by GNU Bison 1.875b. */
3 /* Skeleton parser for Yacc-like parsing with Bison,
4 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
21 /* As a special exception, when this file is copied by Bison into a
22 Bison output file, you may use that output file without restriction.
23 This special exception was added by the Free Software Foundation
24 in version 1.24 of Bison. */
26 /* Written by Richard Stallman by simplifying the original so called
27 ``semantic'' parser. */
29 /* All symbols defined below should begin with yy or YY, to avoid
30 infringing on user name space. This should be done even for local
31 variables, as they might otherwise be expanded by user macros.
32 There are some unavoidable exceptions within include files to
33 define necessary library symbols; they are noted "INFRINGES ON
34 USER NAME SPACE" below. */
36 /* Identify Bison output. */
37 #define YYBISON 1
39 /* Skeleton name. */
40 #define YYSKELETON_NAME "yacc.c"
42 /* Pure parsers. */
43 #define YYPURE 0
45 /* Using locations. */
46 #define YYLSP_NEEDED 0
50 /* Tokens. */
51 #ifndef YYTOKENTYPE
52 # define YYTOKENTYPE
53 /* Put the tokens into the symbol table, so that GDB and other debuggers
54 know about them. */
55 enum yytokentype {
56 ID = 258,
57 STRING_LIT = 259,
58 NUM = 260,
59 FLOAT = 261,
60 POUND = 262,
61 COMMA = 263,
62 COLON = 264,
63 SEMICOLON = 265,
64 LPAREN = 266,
65 RPAREN = 267,
66 LBRACK = 268,
67 RBRACK = 269,
68 LBRACE = 270,
69 RBRACE = 271,
70 DOT = 272,
71 PLUS = 273,
72 MINUS = 274,
73 TIMES = 275,
74 DIVIDE = 276,
75 PERCENT = 277,
76 EQ = 278,
77 NEQ = 279,
78 LT = 280,
79 LE = 281,
80 GT = 282,
81 GE = 283,
82 AND = 284,
83 OR = 285,
84 ASSIGN = 286,
85 IF = 287,
86 THEN = 288,
87 ELSE = 289,
88 WHILE = 290,
89 FOR = 291,
90 DO = 292,
91 BREAK = 293,
92 NULL_TOK = 294,
93 FUNCTION = 295,
94 RETURN = 296,
95 QUESTION = 297,
96 EXCLAMATION = 298,
97 S_OR = 299,
98 S_AND = 300,
99 S_XOR = 301,
100 PLUSPLUS = 302,
101 MINUSMINUS = 303,
102 SIMULT = 304,
103 PATTERN = 305,
104 CODE = 306,
105 TRANSPORT = 307,
106 HOST = 308,
107 TIME = 309,
108 WHENEVER = 310,
109 NEXT = 311,
110 UNTIL = 312,
111 EVERY = 313,
112 BEFORE = 314,
113 AFTER = 315,
114 AT = 316,
115 AT_SYM = 317,
116 ATAT_SYM = 318,
117 NEW = 319,
118 PLUS_CHUCK = 320,
119 MINUS_CHUCK = 321,
120 TIMES_CHUCK = 322,
121 DIVIDE_CHUCK = 323,
122 S_AND_CHUCK = 324,
123 S_OR_CHUCK = 325,
124 S_XOR_CHUCK = 326,
125 SHIFT_RIGHT_CHUCK = 327,
126 SHIFT_LEFT_CHUCK = 328,
127 PERCENT_CHUCK = 329,
128 SHIFT_RIGHT = 330,
129 SHIFT_LEFT = 331,
130 TILDA = 332,
131 CHUCK = 333,
132 COLONCOLON = 334,
133 S_CHUCK = 335,
134 AT_CHUCK = 336,
135 LEFT_S_CHUCK = 337,
136 UNCHUCK = 338,
137 CLASS = 339,
138 EXTENDS = 340,
139 IMPLEMENTS = 341,
140 PUBLIC = 342,
141 PROTECTED = 343,
142 PRIVATE = 344,
143 STATIC = 345,
144 CONST = 346,
145 SPORK = 347,
146 L_NSPC = 348,
147 R_NSPC = 349
149 #endif
150 #define ID 258
151 #define STRING_LIT 259
152 #define NUM 260
153 #define FLOAT 261
154 #define POUND 262
155 #define COMMA 263
156 #define COLON 264
157 #define SEMICOLON 265
158 #define LPAREN 266
159 #define RPAREN 267
160 #define LBRACK 268
161 #define RBRACK 269
162 #define LBRACE 270
163 #define RBRACE 271
164 #define DOT 272
165 #define PLUS 273
166 #define MINUS 274
167 #define TIMES 275
168 #define DIVIDE 276
169 #define PERCENT 277
170 #define EQ 278
171 #define NEQ 279
172 #define LT 280
173 #define LE 281
174 #define GT 282
175 #define GE 283
176 #define AND 284
177 #define OR 285
178 #define ASSIGN 286
179 #define IF 287
180 #define THEN 288
181 #define ELSE 289
182 #define WHILE 290
183 #define FOR 291
184 #define DO 292
185 #define BREAK 293
186 #define NULL_TOK 294
187 #define FUNCTION 295
188 #define RETURN 296
189 #define QUESTION 297
190 #define EXCLAMATION 298
191 #define S_OR 299
192 #define S_AND 300
193 #define S_XOR 301
194 #define PLUSPLUS 302
195 #define MINUSMINUS 303
196 #define SIMULT 304
197 #define PATTERN 305
198 #define CODE 306
199 #define TRANSPORT 307
200 #define HOST 308
201 #define TIME 309
202 #define WHENEVER 310
203 #define NEXT 311
204 #define UNTIL 312
205 #define EVERY 313
206 #define BEFORE 314
207 #define AFTER 315
208 #define AT 316
209 #define AT_SYM 317
210 #define ATAT_SYM 318
211 #define NEW 319
212 #define PLUS_CHUCK 320
213 #define MINUS_CHUCK 321
214 #define TIMES_CHUCK 322
215 #define DIVIDE_CHUCK 323
216 #define S_AND_CHUCK 324
217 #define S_OR_CHUCK 325
218 #define S_XOR_CHUCK 326
219 #define SHIFT_RIGHT_CHUCK 327
220 #define SHIFT_LEFT_CHUCK 328
221 #define PERCENT_CHUCK 329
222 #define SHIFT_RIGHT 330
223 #define SHIFT_LEFT 331
224 #define TILDA 332
225 #define CHUCK 333
226 #define COLONCOLON 334
227 #define S_CHUCK 335
228 #define AT_CHUCK 336
229 #define LEFT_S_CHUCK 337
230 #define UNCHUCK 338
231 #define CLASS 339
232 #define EXTENDS 340
233 #define IMPLEMENTS 341
234 #define PUBLIC 342
235 #define PROTECTED 343
236 #define PRIVATE 344
237 #define STATIC 345
238 #define CONST 346
239 #define SPORK 347
240 #define L_NSPC 348
241 #define R_NSPC 349
246 /* Copy the first part of user declarations. */
247 #line 1 "chuck.y"
250 /*----------------------------------------------------------------------------
251 ChucK Concurrent, On-the-fly Audio Programming Language
252 Compiler and Virtual Machine
254 Copyright (c) 2004 Ge Wang and Perry R. Cook. All rights reserved.
255 http://chuck.cs.princeton.edu/
256 http://soundlab.cs.princeton.edu/
258 This program is free software; you can redistribute it and/or modify
259 it under the terms of the GNU General Public License as published by
260 the Free Software Foundation; either version 2 of the License, or
261 (at your option) any later version.
263 This program is distributed in the hope that it will be useful,
264 but WITHOUT ANY WARRANTY; without even the implied warranty of
265 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
266 GNU General Public License for more details.
268 You should have received a copy of the GNU General Public License
269 along with this program; if not, write to the Free Software
270 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
271 U.S.A.
272 -----------------------------------------------------------------------------*/
274 //-----------------------------------------------------------------------------
275 // file: chuck.tab.c
276 // desc: chuck parser
278 // author: Ge Wang (gewang@cs.princeton.edu) - generated by yacc
279 // Perry R. Cook (prc@cs.princeton.edu)
281 // based in part on the ansi C grammar by Jeff Lee, maintained by Jutta Degener
283 // date: Summer 2002
284 //-----------------------------------------------------------------------------
285 #include <stdio.h>
286 #include <string.h>
287 #include <stdlib.h>
288 #include "chuck_utils.h"
289 #include "chuck_errmsg.h"
290 #include "chuck_absyn.h"
292 // function
293 int yylex( void );
295 void yyerror( char *s )
297 EM_error( EM_tokPos, "%s", s );
300 a_Program g_program = NULL;
304 /* Enabling traces. */
305 #ifndef YYDEBUG
306 # define YYDEBUG 0
307 #endif
309 /* Enabling verbose error messages. */
310 #ifdef YYERROR_VERBOSE
311 # undef YYERROR_VERBOSE
312 # define YYERROR_VERBOSE 1
313 #else
314 # define YYERROR_VERBOSE 0
315 #endif
317 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
318 #line 59 "chuck.y"
319 typedef union YYSTYPE {
320 int pos;
321 int ival;
322 double fval;
323 c_str sval;
325 a_Program program;
326 a_Section program_section;
327 a_Stmt_List stmt_list;
328 a_Class_Def class_def;
329 a_Class_Ext class_ext;
330 a_Class_Body class_body;
331 a_Stmt stmt;
332 a_Exp exp;
333 a_Func_Def func_def;
334 a_Var_Decl_List var_decl_list;
335 a_Var_Decl var_decl;
336 a_Type_Decl type_decl;
337 a_Arg_List arg_list;
338 a_Id_List id_list;
339 } YYSTYPE;
340 /* Line 191 of yacc.c. */
341 #line 342 "chuck.tab.c"
342 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
343 # define YYSTYPE_IS_DECLARED 1
344 # define YYSTYPE_IS_TRIVIAL 1
345 #endif
349 /* Copy the second part of user declarations. */
352 /* Line 214 of yacc.c. */
353 #line 354 "chuck.tab.c"
355 #if ! defined (yyoverflow) || YYERROR_VERBOSE
357 /* The parser invokes alloca or malloc; define the necessary symbols. */
359 # if YYSTACK_USE_ALLOCA
360 # define YYSTACK_ALLOC alloca
361 # else
362 # ifndef YYSTACK_USE_ALLOCA
363 # if defined (alloca) || defined (_ALLOCA_H)
364 # define YYSTACK_ALLOC alloca
365 # else
366 # ifdef __GNUC__
367 # define YYSTACK_ALLOC __builtin_alloca
368 # endif
369 # endif
370 # endif
371 # endif
373 # ifdef YYSTACK_ALLOC
374 /* Pacify GCC's `empty if-body' warning. */
375 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
376 # else
377 # if defined (__STDC__) || defined (__cplusplus)
378 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
379 # define YYSIZE_T size_t
380 # endif
381 # define YYSTACK_ALLOC malloc
382 # define YYSTACK_FREE free
383 # endif
384 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
387 #if (! defined (yyoverflow) \
388 && (! defined (__cplusplus) \
389 || (YYSTYPE_IS_TRIVIAL)))
391 /* A type that is properly aligned for any stack member. */
392 union yyalloc
394 short yyss;
395 YYSTYPE yyvs;
398 /* The size of the maximum gap between one aligned stack and the next. */
399 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
401 /* The size of an array large to enough to hold all stacks, each with
402 N elements. */
403 # define YYSTACK_BYTES(N) \
404 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
405 + YYSTACK_GAP_MAXIMUM)
407 /* Copy COUNT objects from FROM to TO. The source and destination do
408 not overlap. */
409 # ifndef YYCOPY
410 # if 1 < __GNUC__
411 # define YYCOPY(To, From, Count) \
412 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
413 # else
414 # define YYCOPY(To, From, Count) \
415 do \
417 register YYSIZE_T yyi; \
418 for (yyi = 0; yyi < (Count); yyi++) \
419 (To)[yyi] = (From)[yyi]; \
421 while (0)
422 # endif
423 # endif
425 /* Relocate STACK from its old location to the new one. The
426 local variables YYSIZE and YYSTACKSIZE give the old and new number of
427 elements in the stack, and YYPTR gives the new location of the
428 stack. Advance YYPTR to a properly aligned location for the next
429 stack. */
430 # define YYSTACK_RELOCATE(Stack) \
431 do \
433 YYSIZE_T yynewbytes; \
434 YYCOPY (&yyptr->Stack, Stack, yysize); \
435 Stack = &yyptr->Stack; \
436 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
437 yyptr += yynewbytes / sizeof (*yyptr); \
439 while (0)
441 #endif
443 #if defined (__STDC__) || defined (__cplusplus)
444 typedef signed char yysigned_char;
445 #else
446 typedef short yysigned_char;
447 #endif
449 /* YYFINAL -- State number of the termination state. */
450 #define YYFINAL 85
451 /* YYLAST -- Last index in YYTABLE. */
452 #define YYLAST 685
454 /* YYNTOKENS -- Number of terminals. */
455 #define YYNTOKENS 95
456 /* YYNNTS -- Number of nonterminals. */
457 #define YYNNTS 42
458 /* YYNRULES -- Number of rules. */
459 #define YYNRULES 134
460 /* YYNRULES -- Number of states. */
461 #define YYNSTATES 238
463 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
464 #define YYUNDEFTOK 2
465 #define YYMAXUTOK 349
467 #define YYTRANSLATE(YYX) \
468 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
470 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
471 static const unsigned char yytranslate[] =
473 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
474 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
475 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
476 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
477 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
478 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
479 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
480 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
481 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
482 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
483 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
484 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
485 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
486 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
487 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
488 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
489 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
490 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
491 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
492 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
493 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
494 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
495 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
496 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
497 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
498 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
499 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
500 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
501 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
502 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
503 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
504 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
505 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
506 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
507 85, 86, 87, 88, 89, 90, 91, 92, 93, 94
510 #if YYDEBUG
511 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
512 YYRHS. */
513 static const unsigned short yyprhs[] =
515 0, 0, 3, 5, 8, 10, 12, 14, 20, 27,
516 30, 35, 38, 43, 45, 48, 50, 52, 54, 58,
517 66, 73, 75, 77, 79, 81, 83, 87, 90, 95,
518 97, 100, 102, 104, 106, 108, 110, 113, 117, 123,
519 131, 137, 145, 152, 160, 166, 174, 177, 181, 183,
520 186, 188, 192, 194, 198, 200, 203, 206, 208, 210,
521 214, 219, 221, 223, 225, 227, 229, 231, 233, 235,
522 237, 239, 241, 243, 245, 247, 249, 255, 257, 261,
523 263, 267, 269, 273, 275, 279, 281, 285, 287, 291,
524 295, 297, 301, 305, 309, 313, 315, 319, 323, 325,
525 329, 333, 335, 339, 343, 347, 349, 353, 355, 360,
526 362, 365, 368, 371, 373, 375, 377, 379, 381, 383,
527 386, 388, 393, 397, 402, 406, 409, 412, 416, 418,
528 420, 422, 424, 427, 431
531 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
532 static const short yyrhs[] =
534 96, 0, -1, 97, -1, 97, 96, -1, 107, -1,
535 103, -1, 98, -1, 84, 3, 15, 100, 16, -1,
536 84, 3, 99, 15, 100, 16, -1, 86, 102, -1,
537 86, 102, 85, 3, -1, 85, 3, -1, 85, 3,
538 86, 102, -1, 101, -1, 101, 100, -1, 107, -1,
539 103, -1, 3, -1, 3, 8, 102, -1, 104, 105,
540 3, 11, 106, 12, 112, -1, 104, 105, 3, 11,
541 12, 112, -1, 40, -1, 87, -1, 88, -1, 89,
542 -1, 3, -1, 105, 13, 14, -1, 105, 3, -1,
543 105, 3, 8, 106, -1, 108, -1, 108, 107, -1,
544 113, -1, 111, -1, 110, -1, 109, -1, 112, -1,
545 41, 10, -1, 41, 114, 10, -1, 32, 11, 114,
546 12, 108, -1, 32, 11, 114, 12, 108, 34, 108,
547 -1, 35, 11, 114, 12, 108, -1, 37, 108, 35,
548 11, 114, 12, 10, -1, 36, 11, 113, 113, 12,
549 108, -1, 36, 11, 113, 113, 114, 12, 108, -1,
550 57, 11, 114, 12, 108, -1, 37, 108, 57, 11,
551 114, 12, 10, -1, 15, 16, -1, 15, 107, 16,
552 -1, 10, -1, 114, 10, -1, 115, -1, 115, 8,
553 114, -1, 116, -1, 115, 119, 116, -1, 120, -1,
554 3, 117, -1, 62, 117, -1, 118, -1, 3, -1,
555 118, 13, 14, -1, 118, 13, 114, 14, -1, 78,
556 -1, 80, -1, 81, -1, 65, -1, 66, -1, 67,
557 -1, 68, -1, 69, -1, 70, -1, 71, -1, 72,
558 -1, 73, -1, 74, -1, 83, -1, 121, -1, 121,
559 42, 114, 9, 120, -1, 122, -1, 121, 30, 122,
560 -1, 123, -1, 122, 29, 123, -1, 124, -1, 123,
561 44, 124, -1, 125, -1, 124, 46, 125, -1, 126,
562 -1, 125, 45, 126, -1, 127, -1, 126, 23, 127,
563 -1, 126, 24, 127, -1, 128, -1, 127, 25, 128,
564 -1, 127, 27, 128, -1, 127, 26, 128, -1, 127,
565 28, 128, -1, 129, -1, 128, 76, 129, -1, 128,
566 75, 129, -1, 130, -1, 129, 18, 130, -1, 129,
567 19, 130, -1, 131, -1, 130, 20, 131, -1, 130,
568 21, 131, -1, 130, 22, 131, -1, 132, -1, 131,
569 77, 132, -1, 133, -1, 11, 3, 12, 132, -1,
570 135, -1, 47, 133, -1, 48, 133, -1, 134, 132,
571 -1, 18, -1, 19, -1, 77, -1, 43, -1, 45,
572 -1, 20, -1, 92, 77, -1, 136, -1, 135, 13,
573 114, 14, -1, 135, 11, 12, -1, 135, 11, 114,
574 12, -1, 135, 17, 3, -1, 135, 47, -1, 135,
575 48, -1, 135, 79, 136, -1, 3, -1, 5, -1,
576 6, -1, 4, -1, 93, 94, -1, 93, 3, 94,
577 -1, 11, 114, 12, -1
580 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
581 static const unsigned short yyrline[] =
583 0, 159, 159, 160, 164, 165, 166, 170, 172, 177,
584 178, 179, 180, 184, 185, 189, 190, 194, 195, 199,
585 201, 206, 207, 208, 209, 213, 214, 218, 219, 223,
586 224, 228, 229, 230, 231, 233, 237, 238, 242, 244,
587 249, 251, 253, 255, 257, 259, 264, 265, 269, 270,
588 274, 275, 279, 281, 286, 287, 288, 292, 297, 298,
589 299, 303, 304, 305, 306, 307, 308, 309, 310, 311,
590 312, 313, 314, 315, 316, 320, 321, 326, 327, 332,
591 333, 338, 339, 344, 345, 350, 351, 356, 357, 359,
592 364, 365, 367, 369, 371, 376, 377, 379, 384, 385,
593 387, 392, 393, 395, 397, 402, 403, 408, 409, 414,
594 415, 417, 419, 425, 426, 427, 428, 429, 430, 431,
595 435, 436, 438, 440, 442, 444, 446, 448, 454, 455,
596 456, 457, 458, 459, 460
598 #endif
600 #if YYDEBUG || YYERROR_VERBOSE
601 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
602 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
603 static const char *const yytname[] =
605 "$end", "error", "$undefined", "ID", "STRING_LIT", "NUM", "FLOAT",
606 "POUND", "COMMA", "COLON", "SEMICOLON", "LPAREN", "RPAREN", "LBRACK",
607 "RBRACK", "LBRACE", "RBRACE", "DOT", "PLUS", "MINUS", "TIMES", "DIVIDE",
608 "PERCENT", "EQ", "NEQ", "LT", "LE", "GT", "GE", "AND", "OR", "ASSIGN",
609 "IF", "THEN", "ELSE", "WHILE", "FOR", "DO", "BREAK", "NULL_TOK",
610 "FUNCTION", "RETURN", "QUESTION", "EXCLAMATION", "S_OR", "S_AND",
611 "S_XOR", "PLUSPLUS", "MINUSMINUS", "SIMULT", "PATTERN", "CODE",
612 "TRANSPORT", "HOST", "TIME", "WHENEVER", "NEXT", "UNTIL", "EVERY",
613 "BEFORE", "AFTER", "AT", "AT_SYM", "ATAT_SYM", "NEW", "PLUS_CHUCK",
614 "MINUS_CHUCK", "TIMES_CHUCK", "DIVIDE_CHUCK", "S_AND_CHUCK",
615 "S_OR_CHUCK", "S_XOR_CHUCK", "SHIFT_RIGHT_CHUCK", "SHIFT_LEFT_CHUCK",
616 "PERCENT_CHUCK", "SHIFT_RIGHT", "SHIFT_LEFT", "TILDA", "CHUCK",
617 "COLONCOLON", "S_CHUCK", "AT_CHUCK", "LEFT_S_CHUCK", "UNCHUCK", "CLASS",
618 "EXTENDS", "IMPLEMENTS", "PUBLIC", "PROTECTED", "PRIVATE", "STATIC",
619 "CONST", "SPORK", "L_NSPC", "R_NSPC", "$accept", "program",
620 "program_section", "class_definition", "class_ext", "class_body",
621 "class_section", "id_list", "function_definition", "function_decl",
622 "type_decl", "arg_list", "statement_list", "statement",
623 "jump_statement", "selection_statement", "loop_statement",
624 "code_segment", "expression_statement", "expression",
625 "chuck_expression", "decl_expression", "var_decl_list", "var_decl",
626 "chuck_operator", "conditional_expression", "logical_or_expression",
627 "logical_and_expression", "inclusive_or_expression",
628 "exclusive_or_expression", "and_expression", "equality_expression",
629 "relational_expression", "shift_expression", "additive_expression",
630 "multiplicative_expression", "tilda_expression", "cast_expression",
631 "unary_expression", "unary_operator", "postfix_expression",
632 "primary_expression", 0
634 #endif
636 # ifdef YYPRINT
637 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
638 token YYLEX-NUM. */
639 static const unsigned short yytoknum[] =
641 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
642 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
643 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
644 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
645 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
646 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
647 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
648 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
649 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
650 345, 346, 347, 348, 349
652 # endif
654 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
655 static const unsigned char yyr1[] =
657 0, 95, 96, 96, 97, 97, 97, 98, 98, 99,
658 99, 99, 99, 100, 100, 101, 101, 102, 102, 103,
659 103, 104, 104, 104, 104, 105, 105, 106, 106, 107,
660 107, 108, 108, 108, 108, 108, 109, 109, 110, 110,
661 111, 111, 111, 111, 111, 111, 112, 112, 113, 113,
662 114, 114, 115, 115, 116, 116, 116, 117, 118, 118,
663 118, 119, 119, 119, 119, 119, 119, 119, 119, 119,
664 119, 119, 119, 119, 119, 120, 120, 121, 121, 122,
665 122, 123, 123, 124, 124, 125, 125, 126, 126, 126,
666 127, 127, 127, 127, 127, 128, 128, 128, 129, 129,
667 129, 130, 130, 130, 130, 131, 131, 132, 132, 133,
668 133, 133, 133, 134, 134, 134, 134, 134, 134, 134,
669 135, 135, 135, 135, 135, 135, 135, 135, 136, 136,
670 136, 136, 136, 136, 136
673 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
674 static const unsigned char yyr2[] =
676 0, 2, 1, 2, 1, 1, 1, 5, 6, 2,
677 4, 2, 4, 1, 2, 1, 1, 1, 3, 7,
678 6, 1, 1, 1, 1, 1, 3, 2, 4, 1,
679 2, 1, 1, 1, 1, 1, 2, 3, 5, 7,
680 5, 7, 6, 7, 5, 7, 2, 3, 1, 2,
681 1, 3, 1, 3, 1, 2, 2, 1, 1, 3,
682 4, 1, 1, 1, 1, 1, 1, 1, 1, 1,
683 1, 1, 1, 1, 1, 1, 5, 1, 3, 1,
684 3, 1, 3, 1, 3, 1, 3, 1, 3, 3,
685 1, 3, 3, 3, 3, 1, 3, 3, 1, 3,
686 3, 1, 3, 3, 3, 1, 3, 1, 4, 1,
687 2, 2, 2, 1, 1, 1, 1, 1, 1, 2,
688 1, 4, 3, 4, 3, 2, 2, 3, 1, 1,
689 1, 1, 2, 3, 3
692 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
693 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
694 means the default is an error. */
695 static const unsigned char yydefact[] =
697 0, 128, 131, 129, 130, 48, 0, 0, 113, 114,
698 118, 0, 0, 0, 0, 21, 0, 116, 117, 0,
699 0, 0, 0, 115, 0, 22, 23, 24, 0, 0,
700 0, 2, 6, 5, 0, 4, 29, 34, 33, 32,
701 35, 31, 0, 50, 52, 54, 75, 77, 79, 81,
702 83, 85, 87, 90, 95, 98, 101, 105, 107, 0,
703 109, 120, 58, 55, 57, 128, 0, 46, 0, 0,
704 0, 0, 0, 36, 0, 128, 0, 110, 111, 0,
705 56, 0, 119, 0, 132, 1, 3, 25, 0, 30,
706 49, 0, 64, 65, 66, 67, 68, 69, 70, 71,
707 72, 73, 61, 62, 63, 74, 0, 0, 0, 0,
708 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
709 0, 0, 0, 0, 0, 0, 0, 112, 0, 0,
710 0, 125, 126, 0, 0, 0, 134, 47, 0, 0,
711 0, 0, 0, 37, 0, 0, 0, 0, 0, 133,
712 0, 0, 51, 53, 78, 0, 80, 82, 84, 86,
713 88, 89, 91, 93, 92, 94, 97, 96, 99, 100,
714 102, 103, 104, 106, 122, 0, 0, 124, 127, 59,
715 0, 108, 0, 0, 0, 0, 0, 0, 0, 13,
716 16, 15, 11, 17, 9, 0, 0, 26, 0, 123,
717 121, 60, 38, 40, 0, 0, 0, 0, 44, 7,
718 14, 0, 0, 0, 0, 0, 0, 0, 76, 0,
719 42, 0, 0, 0, 12, 18, 10, 8, 20, 27,
720 0, 39, 43, 41, 45, 0, 19, 28
723 /* YYDEFGOTO[NTERM-NUM]. */
724 static const short yydefgoto[] =
726 -1, 30, 31, 32, 148, 188, 189, 194, 190, 34,
727 216, 217, 191, 36, 37, 38, 39, 40, 41, 42,
728 43, 44, 63, 64, 106, 45, 46, 47, 48, 49,
729 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
730 60, 61
733 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
734 STATE-NUM. */
735 #define YYPACT_NINF -202
736 static const short yypact[] =
738 13, 18, -202, -202, -202, -202, 463, 215, -202, -202,
739 -202, 33, 36, 46, 278, -202, 333, -202, -202, 561,
740 561, 48, 18, -202, 70, -202, -202, -202, 0, -1,
741 84, 13, -202, -202, 101, -202, 278, -202, -202, -202,
742 -202, -202, 112, 47, -202, -202, -4, 97, 87, 90,
743 92, 16, 41, -13, 73, 67, 62, -202, -202, 592,
744 127, -202, -202, -202, 128, 22, 130, -202, 129, 539,
745 539, 354, -22, -202, 133, -202, 539, -202, -202, 539,
746 -202, -7, -202, 52, -202, -202, -202, -202, 17, -202,
747 -202, 539, -202, -202, -202, -202, -202, -202, -202, -202,
748 -202, -202, -202, -202, -202, -202, 539, 592, 539, 592,
749 592, 592, 592, 592, 592, 592, 592, 592, 592, 592,
750 592, 592, 592, 592, 592, 592, 592, -202, 409, 539,
751 144, -202, -202, 1, 430, 592, -202, -202, 136, 137,
752 354, 139, 140, -202, 141, 152, 149, 151, 145, -202,
753 148, 147, -202, -202, 97, 155, 87, 90, 92, 16,
754 41, 41, -13, -13, -13, -13, 73, 73, 67, 67,
755 62, 62, 62, -202, -202, 153, 162, -202, -202, -202,
756 163, -202, 278, 278, 485, 539, 539, 278, 150, 152,
757 -202, -202, 96, 170, 98, 152, 40, -202, 592, -202,
758 -202, -202, 157, -202, 278, 173, 174, 182, -202, -202,
759 -202, 151, 151, 193, 185, 183, 24, 190, -202, 278,
760 -202, 278, 194, 198, -202, -202, -202, -202, -202, 195,
761 183, -202, -202, -202, -202, 101, -202, -202
764 /* YYPGOTO[NTERM-NUM]. */
765 static const short yypgoto[] =
767 -202, 179, -202, -202, -202, -153, -202, -116, 10, -202,
768 177, -23, 15, -14, -202, -202, -202, -201, -68, -5,
769 -202, 107, 200, -202, -202, 19, -202, 108, 114, 106,
770 113, 116, -15, -35, -9, 11, -16, -50, 115, -202,
771 -202, 94
774 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
775 positive, shift that token. If negative, reduce the rule which
776 number is the opposite. If zero, do what YYDEFACT says.
777 If YYTABLE_NINF, syntax error. */
778 #define YYTABLE_NINF -1
779 static const unsigned char yytable[] =
781 72, 66, 83, 140, 75, 2, 3, 4, 145, 127,
782 33, 74, 76, 141, 228, 35, 1, 2, 3, 4,
783 150, 62, 68, 5, 6, 62, 107, 229, 7, 236,
784 151, 8, 9, 10, 135, 142, 210, 151, 108, 113,
785 114, 33, 214, 87, 69, 11, 35, 70, 12, 13,
786 14, 89, 215, 15, 16, 91, 17, 71, 18, 79,
787 19, 20, 119, 120, 138, 139, 115, 116, 117, 118,
788 21, 66, 184, 81, 144, 22, 173, 82, 146, 147,
789 162, 163, 164, 165, 85, 181, 152, 123, 124, 125,
790 23, 121, 122, 84, 29, 224, 225, 24, 160, 161,
791 25, 26, 27, 155, 87, 28, 29, 170, 171, 172,
792 166, 167, 92, 93, 94, 95, 96, 97, 98, 99,
793 100, 101, 90, 175, 176, 102, 109, 103, 104, 180,
794 105, 110, 168, 169, 77, 78, 111, 112, 128, 126,
795 129, 134, 136, 143, 130, 137, 149, 177, 182, 183,
796 185, 186, 192, 187, 193, 1, 2, 3, 4, 196,
797 195, 197, 5, 6, 198, 199, 209, 7, 202, 203,
798 8, 9, 10, 208, 131, 132, 200, 201, 212, 205,
799 206, 207, 211, 213, 11, 221, 222, 12, 13, 14,
800 220, 219, 15, 16, 223, 17, 226, 18, 7, 19,
801 20, 227, 230, 235, 233, 231, 133, 232, 234, 21,
802 86, 88, 237, 153, 22, 154, 157, 218, 1, 2,
803 3, 4, 80, 156, 158, 5, 6, 178, 159, 23,
804 7, 67, 0, 8, 9, 10, 0, 0, 0, 25,
805 26, 27, 0, 0, 28, 29, 0, 11, 0, 0,
806 12, 13, 14, 0, 0, 0, 16, 0, 17, 0,
807 18, 0, 19, 20, 0, 0, 0, 0, 0, 0,
808 0, 0, 21, 0, 0, 0, 0, 22, 0, 0,
809 0, 1, 2, 3, 4, 0, 0, 0, 5, 6,
810 0, 0, 23, 7, 0, 0, 8, 9, 10, 0,
811 0, 0, 0, 0, 0, 0, 0, 28, 29, 0,
812 11, 0, 0, 12, 13, 14, 0, 0, 0, 16,
813 0, 17, 0, 18, 0, 19, 20, 0, 0, 0,
814 0, 0, 0, 0, 0, 21, 1, 2, 3, 4,
815 22, 0, 0, 73, 6, 0, 0, 0, 0, 0,
816 0, 8, 9, 10, 0, 23, 0, 1, 2, 3,
817 4, 0, 0, 0, 5, 6, 0, 0, 0, 0,
818 28, 29, 8, 9, 10, 0, 17, 0, 18, 0,
819 19, 20, 0, 0, 0, 0, 0, 0, 0, 0,
820 0, 0, 0, 0, 0, 22, 0, 17, 0, 18,
821 0, 19, 20, 0, 0, 0, 0, 0, 0, 0,
822 23, 0, 1, 2, 3, 4, 22, 0, 0, 0,
823 6, 174, 0, 0, 0, 28, 29, 8, 9, 10,
824 0, 23, 0, 1, 2, 3, 4, 0, 0, 0,
825 0, 6, 0, 0, 179, 0, 28, 29, 8, 9,
826 10, 0, 17, 0, 18, 0, 19, 20, 0, 0,
827 0, 0, 0, 0, 0, 0, 65, 2, 3, 4,
828 0, 22, 0, 17, 6, 18, 0, 19, 20, 0,
829 0, 8, 9, 10, 0, 0, 23, 0, 1, 2,
830 3, 4, 22, 0, 0, 0, 6, 204, 0, 0,
831 0, 28, 29, 8, 9, 10, 17, 23, 18, 0,
832 19, 20, 0, 0, 0, 0, 0, 0, 0, 0,
833 0, 0, 28, 29, 0, 22, 0, 0, 17, 0,
834 18, 0, 19, 20, 0, 0, 0, 0, 0, 0,
835 23, 0, 1, 2, 3, 4, 0, 22, 0, 0,
836 6, 0, 0, 0, 0, 28, 29, 8, 9, 10,
837 0, 0, 23, 0, 75, 2, 3, 4, 0, 0,
838 0, 0, 76, 0, 0, 0, 0, 28, 29, 8,
839 9, 10, 17, 0, 18, 0, 19, 20, 0, 0,
840 0, 0, 0, 0, 0, 75, 2, 3, 4, 0,
841 0, 22, 0, 6, 17, 0, 18, 0, 19, 20,
842 8, 9, 10, 0, 0, 0, 23, 0, 0, 0,
843 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
844 0, 28, 29, 0, 0, 17, 0, 18, 23, 19,
845 20, 0, 0, 0, 0, 0, 0, 0, 0, 0,
846 0, 0, 0, 28, 29, 0, 0, 0, 0, 0,
847 0, 0, 0, 0, 0, 0, 0, 0, 0, 23,
848 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
849 0, 0, 0, 0, 28, 29
852 static const short yycheck[] =
854 14, 6, 3, 71, 3, 4, 5, 6, 15, 59,
855 0, 16, 11, 35, 215, 0, 3, 4, 5, 6,
856 3, 3, 7, 10, 11, 3, 30, 3, 15, 230,
857 13, 18, 19, 20, 12, 57, 189, 13, 42, 23,
858 24, 31, 195, 3, 11, 32, 31, 11, 35, 36,
859 37, 36, 12, 40, 41, 8, 43, 11, 45, 11,
860 47, 48, 75, 76, 69, 70, 25, 26, 27, 28,
861 57, 76, 140, 3, 79, 62, 126, 77, 85, 86,
862 115, 116, 117, 118, 0, 135, 91, 20, 21, 22,
863 77, 18, 19, 94, 93, 211, 212, 84, 113, 114,
864 87, 88, 89, 108, 3, 92, 93, 123, 124, 125,
865 119, 120, 65, 66, 67, 68, 69, 70, 71, 72,
866 73, 74, 10, 128, 129, 78, 29, 80, 81, 134,
867 83, 44, 121, 122, 19, 20, 46, 45, 11, 77,
868 13, 13, 12, 10, 17, 16, 94, 3, 12, 12,
869 11, 11, 3, 12, 3, 3, 4, 5, 6, 11,
870 15, 14, 10, 11, 9, 12, 16, 15, 182, 183,
871 18, 19, 20, 187, 47, 48, 14, 14, 8, 184,
872 185, 186, 86, 85, 32, 12, 12, 35, 36, 37,
873 204, 34, 40, 41, 12, 43, 3, 45, 15, 47,
874 48, 16, 12, 8, 10, 219, 79, 221, 10, 57,
875 31, 34, 235, 106, 62, 107, 110, 198, 3, 4,
876 5, 6, 22, 109, 111, 10, 11, 133, 112, 77,
877 15, 16, -1, 18, 19, 20, -1, -1, -1, 87,
878 88, 89, -1, -1, 92, 93, -1, 32, -1, -1,
879 35, 36, 37, -1, -1, -1, 41, -1, 43, -1,
880 45, -1, 47, 48, -1, -1, -1, -1, -1, -1,
881 -1, -1, 57, -1, -1, -1, -1, 62, -1, -1,
882 -1, 3, 4, 5, 6, -1, -1, -1, 10, 11,
883 -1, -1, 77, 15, -1, -1, 18, 19, 20, -1,
884 -1, -1, -1, -1, -1, -1, -1, 92, 93, -1,
885 32, -1, -1, 35, 36, 37, -1, -1, -1, 41,
886 -1, 43, -1, 45, -1, 47, 48, -1, -1, -1,
887 -1, -1, -1, -1, -1, 57, 3, 4, 5, 6,
888 62, -1, -1, 10, 11, -1, -1, -1, -1, -1,
889 -1, 18, 19, 20, -1, 77, -1, 3, 4, 5,
890 6, -1, -1, -1, 10, 11, -1, -1, -1, -1,
891 92, 93, 18, 19, 20, -1, 43, -1, 45, -1,
892 47, 48, -1, -1, -1, -1, -1, -1, -1, -1,
893 -1, -1, -1, -1, -1, 62, -1, 43, -1, 45,
894 -1, 47, 48, -1, -1, -1, -1, -1, -1, -1,
895 77, -1, 3, 4, 5, 6, 62, -1, -1, -1,
896 11, 12, -1, -1, -1, 92, 93, 18, 19, 20,
897 -1, 77, -1, 3, 4, 5, 6, -1, -1, -1,
898 -1, 11, -1, -1, 14, -1, 92, 93, 18, 19,
899 20, -1, 43, -1, 45, -1, 47, 48, -1, -1,
900 -1, -1, -1, -1, -1, -1, 3, 4, 5, 6,
901 -1, 62, -1, 43, 11, 45, -1, 47, 48, -1,
902 -1, 18, 19, 20, -1, -1, 77, -1, 3, 4,
903 5, 6, 62, -1, -1, -1, 11, 12, -1, -1,
904 -1, 92, 93, 18, 19, 20, 43, 77, 45, -1,
905 47, 48, -1, -1, -1, -1, -1, -1, -1, -1,
906 -1, -1, 92, 93, -1, 62, -1, -1, 43, -1,
907 45, -1, 47, 48, -1, -1, -1, -1, -1, -1,
908 77, -1, 3, 4, 5, 6, -1, 62, -1, -1,
909 11, -1, -1, -1, -1, 92, 93, 18, 19, 20,
910 -1, -1, 77, -1, 3, 4, 5, 6, -1, -1,
911 -1, -1, 11, -1, -1, -1, -1, 92, 93, 18,
912 19, 20, 43, -1, 45, -1, 47, 48, -1, -1,
913 -1, -1, -1, -1, -1, 3, 4, 5, 6, -1,
914 -1, 62, -1, 11, 43, -1, 45, -1, 47, 48,
915 18, 19, 20, -1, -1, -1, 77, -1, -1, -1,
916 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
917 -1, 92, 93, -1, -1, 43, -1, 45, 77, 47,
918 48, -1, -1, -1, -1, -1, -1, -1, -1, -1,
919 -1, -1, -1, 92, 93, -1, -1, -1, -1, -1,
920 -1, -1, -1, -1, -1, -1, -1, -1, -1, 77,
921 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
922 -1, -1, -1, -1, 92, 93
925 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
926 symbol of state STATE-NUM. */
927 static const unsigned char yystos[] =
929 0, 3, 4, 5, 6, 10, 11, 15, 18, 19,
930 20, 32, 35, 36, 37, 40, 41, 43, 45, 47,
931 48, 57, 62, 77, 84, 87, 88, 89, 92, 93,
932 96, 97, 98, 103, 104, 107, 108, 109, 110, 111,
933 112, 113, 114, 115, 116, 120, 121, 122, 123, 124,
934 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
935 135, 136, 3, 117, 118, 3, 114, 16, 107, 11,
936 11, 11, 108, 10, 114, 3, 11, 133, 133, 11,
937 117, 3, 77, 3, 94, 0, 96, 3, 105, 107,
938 10, 8, 65, 66, 67, 68, 69, 70, 71, 72,
939 73, 74, 78, 80, 81, 83, 119, 30, 42, 29,
940 44, 46, 45, 23, 24, 25, 26, 27, 28, 75,
941 76, 18, 19, 20, 21, 22, 77, 132, 11, 13,
942 17, 47, 48, 79, 13, 12, 12, 16, 114, 114,
943 113, 35, 57, 10, 114, 15, 85, 86, 99, 94,
944 3, 13, 114, 116, 122, 114, 123, 124, 125, 126,
945 127, 127, 128, 128, 128, 128, 129, 129, 130, 130,
946 131, 131, 131, 132, 12, 114, 114, 3, 136, 14,
947 114, 132, 12, 12, 113, 11, 11, 12, 100, 101,
948 103, 107, 3, 3, 102, 15, 11, 14, 9, 12,
949 14, 14, 108, 108, 12, 114, 114, 114, 108, 16,
950 100, 86, 8, 85, 100, 12, 105, 106, 120, 34,
951 108, 12, 12, 12, 102, 102, 3, 16, 112, 3,
952 12, 108, 108, 10, 10, 8, 112, 106
955 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
956 # define YYSIZE_T __SIZE_TYPE__
957 #endif
958 #if ! defined (YYSIZE_T) && defined (size_t)
959 # define YYSIZE_T size_t
960 #endif
961 #if ! defined (YYSIZE_T)
962 # if defined (__STDC__) || defined (__cplusplus)
963 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
964 # define YYSIZE_T size_t
965 # endif
966 #endif
967 #if ! defined (YYSIZE_T)
968 # define YYSIZE_T unsigned int
969 #endif
971 #define yyerrok (yyerrstatus = 0)
972 #define yyclearin (yychar = YYEMPTY)
973 #define YYEMPTY (-2)
974 #define YYEOF 0
976 #define YYACCEPT goto yyacceptlab
977 #define YYABORT goto yyabortlab
978 #define YYERROR goto yyerrlab1
981 /* Like YYERROR except do call yyerror. This remains here temporarily
982 to ease the transition to the new meaning of YYERROR, for GCC.
983 Once GCC version 2 has supplanted version 1, this can go. */
985 #define YYFAIL goto yyerrlab
987 #define YYRECOVERING() (!!yyerrstatus)
989 #define YYBACKUP(Token, Value) \
990 do \
991 if (yychar == YYEMPTY && yylen == 1) \
993 yychar = (Token); \
994 yylval = (Value); \
995 yytoken = YYTRANSLATE (yychar); \
996 YYPOPSTACK; \
997 goto yybackup; \
999 else \
1001 yyerror ("syntax error: cannot back up");\
1002 YYERROR; \
1004 while (0)
1006 #define YYTERROR 1
1007 #define YYERRCODE 256
1009 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
1010 are run). */
1012 #ifndef YYLLOC_DEFAULT
1013 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1014 Current.first_line = Rhs[1].first_line; \
1015 Current.first_column = Rhs[1].first_column; \
1016 Current.last_line = Rhs[N].last_line; \
1017 Current.last_column = Rhs[N].last_column;
1018 #endif
1020 /* YYLEX -- calling `yylex' with the right arguments. */
1022 #ifdef YYLEX_PARAM
1023 # define YYLEX yylex (YYLEX_PARAM)
1024 #else
1025 # define YYLEX yylex ()
1026 #endif
1028 /* Enable debugging if requested. */
1029 #if YYDEBUG
1031 # ifndef YYFPRINTF
1032 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1033 # define YYFPRINTF fprintf
1034 # endif
1036 # define YYDPRINTF(Args) \
1037 do { \
1038 if (yydebug) \
1039 YYFPRINTF Args; \
1040 } while (0)
1042 # define YYDSYMPRINT(Args) \
1043 do { \
1044 if (yydebug) \
1045 yysymprint Args; \
1046 } while (0)
1048 # define YYDSYMPRINTF(Title, Token, Value, Location) \
1049 do { \
1050 if (yydebug) \
1052 YYFPRINTF (stderr, "%s ", Title); \
1053 yysymprint (stderr, \
1054 Token, Value); \
1055 YYFPRINTF (stderr, "\n"); \
1057 } while (0)
1059 /*------------------------------------------------------------------.
1060 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1061 | TOP (cinluded). |
1062 `------------------------------------------------------------------*/
1064 #if defined (__STDC__) || defined (__cplusplus)
1065 static void
1066 yy_stack_print (short *bottom, short *top)
1067 #else
1068 static void
1069 yy_stack_print (bottom, top)
1070 short *bottom;
1071 short *top;
1072 #endif
1074 YYFPRINTF (stderr, "Stack now");
1075 for (/* Nothing. */; bottom <= top; ++bottom)
1076 YYFPRINTF (stderr, " %d", *bottom);
1077 YYFPRINTF (stderr, "\n");
1080 # define YY_STACK_PRINT(Bottom, Top) \
1081 do { \
1082 if (yydebug) \
1083 yy_stack_print ((Bottom), (Top)); \
1084 } while (0)
1087 /*------------------------------------------------.
1088 | Report that the YYRULE is going to be reduced. |
1089 `------------------------------------------------*/
1091 #if defined (__STDC__) || defined (__cplusplus)
1092 static void
1093 yy_reduce_print (int yyrule)
1094 #else
1095 static void
1096 yy_reduce_print (yyrule)
1097 int yyrule;
1098 #endif
1100 int yyi;
1101 unsigned int yylno = yyrline[yyrule];
1102 YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
1103 yyrule - 1, yylno);
1104 /* Print the symbols being reduced, and their result. */
1105 for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
1106 YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
1107 YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
1110 # define YY_REDUCE_PRINT(Rule) \
1111 do { \
1112 if (yydebug) \
1113 yy_reduce_print (Rule); \
1114 } while (0)
1116 /* Nonzero means print parse trace. It is left uninitialized so that
1117 multiple parsers can coexist. */
1118 int yydebug;
1119 #else /* !YYDEBUG */
1120 # define YYDPRINTF(Args)
1121 # define YYDSYMPRINT(Args)
1122 # define YYDSYMPRINTF(Title, Token, Value, Location)
1123 # define YY_STACK_PRINT(Bottom, Top)
1124 # define YY_REDUCE_PRINT(Rule)
1125 #endif /* !YYDEBUG */
1128 /* YYINITDEPTH -- initial size of the parser's stacks. */
1129 #ifndef YYINITDEPTH
1130 # define YYINITDEPTH 200
1131 #endif
1133 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1134 if the built-in stack extension method is used).
1136 Do not make this value too large; the results are undefined if
1137 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
1138 evaluated with infinite-precision integer arithmetic. */
1140 #if YYMAXDEPTH == 0
1141 # undef YYMAXDEPTH
1142 #endif
1144 #ifndef YYMAXDEPTH
1145 # define YYMAXDEPTH 10000
1146 #endif
1150 #if YYERROR_VERBOSE
1152 # ifndef yystrlen
1153 # if defined (__GLIBC__) && defined (_STRING_H)
1154 # define yystrlen strlen
1155 # else
1156 /* Return the length of YYSTR. */
1157 static YYSIZE_T
1158 # if defined (__STDC__) || defined (__cplusplus)
1159 yystrlen (const char *yystr)
1160 # else
1161 yystrlen (yystr)
1162 const char *yystr;
1163 # endif
1165 register const char *yys = yystr;
1167 while (*yys++ != '\0')
1168 continue;
1170 return yys - yystr - 1;
1172 # endif
1173 # endif
1175 # ifndef yystpcpy
1176 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1177 # define yystpcpy stpcpy
1178 # else
1179 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1180 YYDEST. */
1181 static char *
1182 # if defined (__STDC__) || defined (__cplusplus)
1183 yystpcpy (char *yydest, const char *yysrc)
1184 # else
1185 yystpcpy (yydest, yysrc)
1186 char *yydest;
1187 const char *yysrc;
1188 # endif
1190 register char *yyd = yydest;
1191 register const char *yys = yysrc;
1193 while ((*yyd++ = *yys++) != '\0')
1194 continue;
1196 return yyd - 1;
1198 # endif
1199 # endif
1201 #endif /* !YYERROR_VERBOSE */
1205 #if YYDEBUG
1206 /*--------------------------------.
1207 | Print this symbol on YYOUTPUT. |
1208 `--------------------------------*/
1210 #if defined (__STDC__) || defined (__cplusplus)
1211 static void
1212 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
1213 #else
1214 static void
1215 yysymprint (yyoutput, yytype, yyvaluep)
1216 FILE *yyoutput;
1217 int yytype;
1218 YYSTYPE *yyvaluep;
1219 #endif
1221 /* Pacify ``unused variable'' warnings. */
1222 (void) yyvaluep;
1224 if (yytype < YYNTOKENS)
1226 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1227 # ifdef YYPRINT
1228 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1229 # endif
1231 else
1232 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1234 switch (yytype)
1236 default:
1237 break;
1239 YYFPRINTF (yyoutput, ")");
1242 #endif /* ! YYDEBUG */
1243 /*-----------------------------------------------.
1244 | Release the memory associated to this symbol. |
1245 `-----------------------------------------------*/
1247 #if defined (__STDC__) || defined (__cplusplus)
1248 static void
1249 yydestruct (int yytype, YYSTYPE *yyvaluep)
1250 #else
1251 static void
1252 yydestruct (yytype, yyvaluep)
1253 int yytype;
1254 YYSTYPE *yyvaluep;
1255 #endif
1257 /* Pacify ``unused variable'' warnings. */
1258 (void) yyvaluep;
1260 switch (yytype)
1263 default:
1264 break;
1269 /* Prevent warnings from -Wmissing-prototypes. */
1271 #ifdef YYPARSE_PARAM
1272 # if defined (__STDC__) || defined (__cplusplus)
1273 int yyparse (void *YYPARSE_PARAM);
1274 # else
1275 int yyparse ();
1276 # endif
1277 #else /* ! YYPARSE_PARAM */
1278 #if defined (__STDC__) || defined (__cplusplus)
1279 int yyparse (void);
1280 #else
1281 int yyparse ();
1282 #endif
1283 #endif /* ! YYPARSE_PARAM */
1287 /* The lookahead symbol. */
1288 int yychar;
1290 /* The semantic value of the lookahead symbol. */
1291 YYSTYPE yylval;
1293 /* Number of syntax errors so far. */
1294 int yynerrs;
1298 /*----------.
1299 | yyparse. |
1300 `----------*/
1302 #ifdef YYPARSE_PARAM
1303 # if defined (__STDC__) || defined (__cplusplus)
1304 int yyparse (void *YYPARSE_PARAM)
1305 # else
1306 int yyparse (YYPARSE_PARAM)
1307 void *YYPARSE_PARAM;
1308 # endif
1309 #else /* ! YYPARSE_PARAM */
1310 #if defined (__STDC__) || defined (__cplusplus)
1312 yyparse (void)
1313 #else
1315 yyparse ()
1317 #endif
1318 #endif
1321 register int yystate;
1322 register int yyn;
1323 int yyresult;
1324 /* Number of tokens to shift before error messages enabled. */
1325 int yyerrstatus;
1326 /* Lookahead token as an internal (translated) token number. */
1327 int yytoken = 0;
1329 /* Three stacks and their tools:
1330 `yyss': related to states,
1331 `yyvs': related to semantic values,
1332 `yyls': related to locations.
1334 Refer to the stacks thru separate pointers, to allow yyoverflow
1335 to reallocate them elsewhere. */
1337 /* The state stack. */
1338 short yyssa[YYINITDEPTH];
1339 short *yyss = yyssa;
1340 register short *yyssp;
1342 /* The semantic value stack. */
1343 YYSTYPE yyvsa[YYINITDEPTH];
1344 YYSTYPE *yyvs = yyvsa;
1345 register YYSTYPE *yyvsp;
1349 #define YYPOPSTACK (yyvsp--, yyssp--)
1351 YYSIZE_T yystacksize = YYINITDEPTH;
1353 /* The variables used to return semantic value and location from the
1354 action routines. */
1355 YYSTYPE yyval;
1358 /* When reducing, the number of symbols on the RHS of the reduced
1359 rule. */
1360 int yylen;
1362 YYDPRINTF ((stderr, "Starting parse\n"));
1364 yystate = 0;
1365 yyerrstatus = 0;
1366 yynerrs = 0;
1367 yychar = YYEMPTY; /* Cause a token to be read. */
1369 /* Initialize stack pointers.
1370 Waste one element of value and location stack
1371 so that they stay on the same level as the state stack.
1372 The wasted elements are never initialized. */
1374 yyssp = yyss;
1375 yyvsp = yyvs;
1377 goto yysetstate;
1379 /*------------------------------------------------------------.
1380 | yynewstate -- Push a new state, which is found in yystate. |
1381 `------------------------------------------------------------*/
1382 yynewstate:
1383 /* In all cases, when you get here, the value and location stacks
1384 have just been pushed. so pushing a state here evens the stacks.
1386 yyssp++;
1388 yysetstate:
1389 *yyssp = yystate;
1391 if (yyss + yystacksize - 1 <= yyssp)
1393 /* Get the current used size of the three stacks, in elements. */
1394 YYSIZE_T yysize = yyssp - yyss + 1;
1396 #ifdef yyoverflow
1398 /* Give user a chance to reallocate the stack. Use copies of
1399 these so that the &'s don't force the real ones into
1400 memory. */
1401 YYSTYPE *yyvs1 = yyvs;
1402 short *yyss1 = yyss;
1405 /* Each stack pointer address is followed by the size of the
1406 data in use in that stack, in bytes. This used to be a
1407 conditional around just the two extra args, but that might
1408 be undefined if yyoverflow is a macro. */
1409 yyoverflow ("parser stack overflow",
1410 &yyss1, yysize * sizeof (*yyssp),
1411 &yyvs1, yysize * sizeof (*yyvsp),
1413 &yystacksize);
1415 yyss = yyss1;
1416 yyvs = yyvs1;
1418 #else /* no yyoverflow */
1419 # ifndef YYSTACK_RELOCATE
1420 goto yyoverflowlab;
1421 # else
1422 /* Extend the stack our own way. */
1423 if (YYMAXDEPTH <= yystacksize)
1424 goto yyoverflowlab;
1425 yystacksize *= 2;
1426 if (YYMAXDEPTH < yystacksize)
1427 yystacksize = YYMAXDEPTH;
1430 short *yyss1 = yyss;
1431 union yyalloc *yyptr =
1432 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1433 if (! yyptr)
1434 goto yyoverflowlab;
1435 YYSTACK_RELOCATE (yyss);
1436 YYSTACK_RELOCATE (yyvs);
1438 # undef YYSTACK_RELOCATE
1439 if (yyss1 != yyssa)
1440 YYSTACK_FREE (yyss1);
1442 # endif
1443 #endif /* no yyoverflow */
1445 yyssp = yyss + yysize - 1;
1446 yyvsp = yyvs + yysize - 1;
1449 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1450 (unsigned long int) yystacksize));
1452 if (yyss + yystacksize - 1 <= yyssp)
1453 YYABORT;
1456 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1458 goto yybackup;
1460 /*-----------.
1461 | yybackup. |
1462 `-----------*/
1463 yybackup:
1465 /* Do appropriate processing given the current state. */
1466 /* Read a lookahead token if we need one and don't already have one. */
1467 /* yyresume: */
1469 /* First try to decide what to do without reference to lookahead token. */
1471 yyn = yypact[yystate];
1472 if (yyn == YYPACT_NINF)
1473 goto yydefault;
1475 /* Not known => get a lookahead token if don't already have one. */
1477 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1478 if (yychar == YYEMPTY)
1480 YYDPRINTF ((stderr, "Reading a token: "));
1481 yychar = YYLEX;
1484 if (yychar <= YYEOF)
1486 yychar = yytoken = YYEOF;
1487 YYDPRINTF ((stderr, "Now at end of input.\n"));
1489 else
1491 yytoken = YYTRANSLATE (yychar);
1492 YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
1495 /* If the proper action on seeing token YYTOKEN is to reduce or to
1496 detect an error, take that action. */
1497 yyn += yytoken;
1498 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1499 goto yydefault;
1500 yyn = yytable[yyn];
1501 if (yyn <= 0)
1503 if (yyn == 0 || yyn == YYTABLE_NINF)
1504 goto yyerrlab;
1505 yyn = -yyn;
1506 goto yyreduce;
1509 if (yyn == YYFINAL)
1510 YYACCEPT;
1512 /* Shift the lookahead token. */
1513 YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
1515 /* Discard the token being shifted unless it is eof. */
1516 if (yychar != YYEOF)
1517 yychar = YYEMPTY;
1519 *++yyvsp = yylval;
1522 /* Count tokens shifted since error; after three, turn off error
1523 status. */
1524 if (yyerrstatus)
1525 yyerrstatus--;
1527 yystate = yyn;
1528 goto yynewstate;
1531 /*-----------------------------------------------------------.
1532 | yydefault -- do the default action for the current state. |
1533 `-----------------------------------------------------------*/
1534 yydefault:
1535 yyn = yydefact[yystate];
1536 if (yyn == 0)
1537 goto yyerrlab;
1538 goto yyreduce;
1541 /*-----------------------------.
1542 | yyreduce -- Do a reduction. |
1543 `-----------------------------*/
1544 yyreduce:
1545 /* yyn is the number of a rule to reduce with. */
1546 yylen = yyr2[yyn];
1548 /* If YYLEN is nonzero, implement the default value of the action:
1549 `$$ = $1'.
1551 Otherwise, the following line sets YYVAL to garbage.
1552 This behavior is undocumented and Bison
1553 users should not rely upon it. Assigning to YYVAL
1554 unconditionally makes the parser a bit smaller, and it avoids a
1555 GCC warning that YYVAL may be used uninitialized. */
1556 yyval = yyvsp[1-yylen];
1559 YY_REDUCE_PRINT (yyn);
1560 switch (yyn)
1562 case 2:
1563 #line 159 "chuck.y"
1564 { yyval.program = g_program = new_program( yyvsp[0].program_section, EM_lineNum ); ;}
1565 break;
1567 case 3:
1568 #line 160 "chuck.y"
1569 { yyval.program = g_program = prepend_program( yyvsp[-1].program_section, yyvsp[0].program, EM_lineNum ); ;}
1570 break;
1572 case 4:
1573 #line 164 "chuck.y"
1574 { yyval.program_section = new_section_stmt( yyvsp[0].stmt_list, EM_lineNum ); ;}
1575 break;
1577 case 5:
1578 #line 165 "chuck.y"
1579 { yyval.program_section = new_section_func_def( yyvsp[0].func_def, EM_lineNum ); ;}
1580 break;
1582 case 6:
1583 #line 166 "chuck.y"
1584 { yyval.program_section = new_section_class_def( yyvsp[0].class_def, EM_lineNum ); ;}
1585 break;
1587 case 7:
1588 #line 171 "chuck.y"
1589 { yyval.class_def = new_class_def( yyvsp[-3].sval, NULL, yyvsp[-1].class_body, EM_lineNum ); ;}
1590 break;
1592 case 8:
1593 #line 173 "chuck.y"
1594 { yyval.class_def = new_class_def( yyvsp[-4].sval, yyvsp[-3].class_ext, yyvsp[-1].class_body, EM_lineNum ); ;}
1595 break;
1597 case 9:
1598 #line 177 "chuck.y"
1599 { yyval.class_ext = new_class_ext( NULL, yyvsp[0].id_list, EM_lineNum ); ;}
1600 break;
1602 case 10:
1603 #line 178 "chuck.y"
1604 { yyval.class_ext = new_class_ext( yyvsp[0].sval, yyvsp[-2].id_list, EM_lineNum ); ;}
1605 break;
1607 case 11:
1608 #line 179 "chuck.y"
1609 { yyval.class_ext = new_class_ext( yyvsp[0].sval, NULL, EM_lineNum ); ;}
1610 break;
1612 case 12:
1613 #line 180 "chuck.y"
1614 { yyval.class_ext = new_class_ext( yyvsp[-2].sval, yyvsp[0].id_list, EM_lineNum ); ;}
1615 break;
1617 case 13:
1618 #line 184 "chuck.y"
1619 { yyval.class_body = new_class_body( yyvsp[0].program_section, EM_lineNum ); ;}
1620 break;
1622 case 14:
1623 #line 185 "chuck.y"
1624 { yyval.class_body = prepend_class_body( yyvsp[-1].program_section, yyvsp[0].class_body, EM_lineNum ); ;}
1625 break;
1627 case 15:
1628 #line 189 "chuck.y"
1629 { yyval.program_section = new_section_stmt( yyvsp[0].stmt_list, EM_lineNum ); ;}
1630 break;
1632 case 16:
1633 #line 190 "chuck.y"
1634 { yyval.program_section = new_section_func_def( yyvsp[0].func_def, EM_lineNum ); ;}
1635 break;
1637 case 17:
1638 #line 194 "chuck.y"
1639 { yyval.id_list = new_id_list( yyvsp[0].sval, EM_lineNum ); ;}
1640 break;
1642 case 18:
1643 #line 195 "chuck.y"
1644 { yyval.id_list = prepend_id_list( yyvsp[-2].sval, yyvsp[0].id_list, EM_lineNum ); ;}
1645 break;
1647 case 19:
1648 #line 200 "chuck.y"
1649 { yyval.func_def = new_func_def( yyvsp[-6].ival, yyvsp[-5].type_decl, yyvsp[-4].sval, yyvsp[-2].arg_list, yyvsp[0].stmt, EM_lineNum ); ;}
1650 break;
1652 case 20:
1653 #line 202 "chuck.y"
1654 { yyval.func_def = new_func_def( yyvsp[-5].ival, yyvsp[-4].type_decl, yyvsp[-3].sval, NULL, yyvsp[0].stmt, EM_lineNum ); ;}
1655 break;
1657 case 21:
1658 #line 206 "chuck.y"
1659 { yyval.ival = ae_func_func; ;}
1660 break;
1662 case 22:
1663 #line 207 "chuck.y"
1664 { yyval.ival = ae_func_public; ;}
1665 break;
1667 case 23:
1668 #line 208 "chuck.y"
1669 { yyval.ival = ae_func_protected; ;}
1670 break;
1672 case 24:
1673 #line 209 "chuck.y"
1674 { yyval.ival = ae_func_private; ;}
1675 break;
1677 case 25:
1678 #line 213 "chuck.y"
1679 { yyval.type_decl = new_type_decl( yyvsp[0].sval, EM_lineNum ); ;}
1680 break;
1682 case 26:
1683 #line 214 "chuck.y"
1684 { yyval.type_decl = new_type_decl_array( yyvsp[-2].type_decl, EM_lineNum ); ;}
1685 break;
1687 case 27:
1688 #line 218 "chuck.y"
1689 { yyval.arg_list = new_arg_list( yyvsp[-1].type_decl, yyvsp[0].sval, EM_lineNum ); ;}
1690 break;
1692 case 28:
1693 #line 219 "chuck.y"
1694 { yyval.arg_list = prepend_arg_list( yyvsp[-3].type_decl, yyvsp[-2].sval, yyvsp[0].arg_list, EM_lineNum ); ;}
1695 break;
1697 case 29:
1698 #line 223 "chuck.y"
1699 { yyval.stmt_list = new_stmt_list( yyvsp[0].stmt, EM_lineNum ); ;}
1700 break;
1702 case 30:
1703 #line 224 "chuck.y"
1704 { yyval.stmt_list = prepend_stmt_list( yyvsp[-1].stmt, yyvsp[0].stmt_list, EM_lineNum ); ;}
1705 break;
1707 case 31:
1708 #line 228 "chuck.y"
1709 { yyval.stmt = yyvsp[0].stmt; ;}
1710 break;
1712 case 32:
1713 #line 229 "chuck.y"
1714 { yyval.stmt = yyvsp[0].stmt; ;}
1715 break;
1717 case 33:
1718 #line 230 "chuck.y"
1719 { yyval.stmt = yyvsp[0].stmt; ;}
1720 break;
1722 case 34:
1723 #line 231 "chuck.y"
1724 { yyval.stmt = yyvsp[0].stmt; ;}
1725 break;
1727 case 35:
1728 #line 233 "chuck.y"
1729 { yyval.stmt = yyvsp[0].stmt; ;}
1730 break;
1732 case 36:
1733 #line 237 "chuck.y"
1734 { yyval.stmt = new_stmt_from_return( NULL, EM_lineNum ); ;}
1735 break;
1737 case 37:
1738 #line 238 "chuck.y"
1739 { yyval.stmt = new_stmt_from_return( yyvsp[-1].exp, EM_lineNum ); ;}
1740 break;
1742 case 38:
1743 #line 243 "chuck.y"
1744 { yyval.stmt = new_stmt_from_if( yyvsp[-2].exp, yyvsp[0].stmt, NULL, EM_lineNum ); ;}
1745 break;
1747 case 39:
1748 #line 245 "chuck.y"
1749 { yyval.stmt = new_stmt_from_if( yyvsp[-4].exp, yyvsp[-2].stmt, yyvsp[0].stmt, EM_lineNum ); ;}
1750 break;
1752 case 40:
1753 #line 250 "chuck.y"
1754 { yyval.stmt = new_stmt_from_while( yyvsp[-2].exp, yyvsp[0].stmt, EM_lineNum ); ;}
1755 break;
1757 case 41:
1758 #line 252 "chuck.y"
1759 { yyval.stmt = new_stmt_from_do_while( yyvsp[-2].exp, yyvsp[-5].stmt, EM_lineNum ); ;}
1760 break;
1762 case 42:
1763 #line 254 "chuck.y"
1764 { yyval.stmt = new_stmt_from_for( yyvsp[-3].stmt, yyvsp[-2].stmt, NULL, yyvsp[0].stmt, EM_lineNum ); ;}
1765 break;
1767 case 43:
1768 #line 256 "chuck.y"
1769 { yyval.stmt = new_stmt_from_for( yyvsp[-4].stmt, yyvsp[-3].stmt, yyvsp[-2].exp, yyvsp[0].stmt, EM_lineNum ); ;}
1770 break;
1772 case 44:
1773 #line 258 "chuck.y"
1774 { yyval.stmt = new_stmt_from_until( yyvsp[-2].exp, yyvsp[0].stmt, EM_lineNum ); ;}
1775 break;
1777 case 45:
1778 #line 260 "chuck.y"
1779 { yyval.stmt = new_stmt_from_do_until( yyvsp[-2].exp, yyvsp[-5].stmt, EM_lineNum ); ;}
1780 break;
1782 case 46:
1783 #line 264 "chuck.y"
1784 { yyval.stmt = NULL; ;}
1785 break;
1787 case 47:
1788 #line 265 "chuck.y"
1789 { yyval.stmt = new_stmt_from_code( yyvsp[-1].stmt_list, EM_lineNum ); ;}
1790 break;
1792 case 48:
1793 #line 269 "chuck.y"
1794 { yyval.stmt = NULL; ;}
1795 break;
1797 case 49:
1798 #line 270 "chuck.y"
1799 { yyval.stmt = new_stmt_from_expression( yyvsp[-1].exp, EM_lineNum ); ;}
1800 break;
1802 case 50:
1803 #line 274 "chuck.y"
1804 { yyval.exp = yyvsp[0].exp; ;}
1805 break;
1807 case 51:
1808 #line 275 "chuck.y"
1809 { yyval.exp = prepend_expression( yyvsp[-2].exp, yyvsp[0].exp, EM_lineNum ); ;}
1810 break;
1812 case 52:
1813 #line 279 "chuck.y"
1814 { yyval.exp = yyvsp[0].exp; ;}
1815 break;
1817 case 53:
1818 #line 282 "chuck.y"
1819 { yyval.exp = new_exp_from_binary( yyvsp[-2].exp, yyvsp[-1].ival, yyvsp[0].exp, EM_lineNum ); ;}
1820 break;
1822 case 54:
1823 #line 286 "chuck.y"
1824 { yyval.exp = yyvsp[0].exp; ;}
1825 break;
1827 case 55:
1828 #line 287 "chuck.y"
1829 { yyval.exp = new_exp_decl( yyvsp[-1].sval, yyvsp[0].var_decl_list, EM_lineNum ); ;}
1830 break;
1832 case 56:
1833 #line 288 "chuck.y"
1834 { yyval.exp = new_exp_decl( NULL, yyvsp[0].var_decl_list, EM_lineNum ); ;}
1835 break;
1837 case 57:
1838 #line 292 "chuck.y"
1839 { yyval.var_decl_list = new_var_decl_list( yyvsp[0].var_decl, EM_lineNum ); ;}
1840 break;
1842 case 58:
1843 #line 297 "chuck.y"
1844 { yyval.var_decl = new_var_decl( yyvsp[0].sval, EM_lineNum ); ;}
1845 break;
1847 case 59:
1848 #line 298 "chuck.y"
1849 { yyval.var_decl = new_var_decl2( yyvsp[-2].var_decl, 1, NULL, EM_lineNum ); ;}
1850 break;
1852 case 60:
1853 #line 299 "chuck.y"
1854 { yyval.var_decl = new_var_decl2( yyvsp[-3].var_decl, 1, yyvsp[-1].exp, EM_lineNum ); ;}
1855 break;
1857 case 61:
1858 #line 303 "chuck.y"
1859 { yyval.ival = ae_op_chuck; ;}
1860 break;
1862 case 62:
1863 #line 304 "chuck.y"
1864 { yyval.ival = ae_op_s_chuck; ;}
1865 break;
1867 case 63:
1868 #line 305 "chuck.y"
1869 { yyval.ival = ae_op_at_chuck; ;}
1870 break;
1872 case 64:
1873 #line 306 "chuck.y"
1874 { yyval.ival = ae_op_plus_chuck; ;}
1875 break;
1877 case 65:
1878 #line 307 "chuck.y"
1879 { yyval.ival = ae_op_minus_chuck; ;}
1880 break;
1882 case 66:
1883 #line 308 "chuck.y"
1884 { yyval.ival = ae_op_times_chuck; ;}
1885 break;
1887 case 67:
1888 #line 309 "chuck.y"
1889 { yyval.ival = ae_op_divide_chuck; ;}
1890 break;
1892 case 68:
1893 #line 310 "chuck.y"
1894 { yyval.ival = ae_op_s_and_chuck; ;}
1895 break;
1897 case 69:
1898 #line 311 "chuck.y"
1899 { yyval.ival = ae_op_s_or_chuck; ;}
1900 break;
1902 case 70:
1903 #line 312 "chuck.y"
1904 { yyval.ival = ae_op_s_xor_chuck; ;}
1905 break;
1907 case 71:
1908 #line 313 "chuck.y"
1909 { yyval.ival = ae_op_shift_right_chuck; ;}
1910 break;
1912 case 72:
1913 #line 314 "chuck.y"
1914 { yyval.ival = ae_op_shift_left_chuck; ;}
1915 break;
1917 case 73:
1918 #line 315 "chuck.y"
1919 { yyval.ival = ae_op_percent_chuck; ;}
1920 break;
1922 case 74:
1923 #line 316 "chuck.y"
1924 { yyval.ival = ae_op_unchuck; ;}
1925 break;
1927 case 75:
1928 #line 320 "chuck.y"
1929 { yyval.exp = yyvsp[0].exp; ;}
1930 break;
1932 case 76:
1933 #line 322 "chuck.y"
1934 { yyval.exp = new_exp_from_if( yyvsp[-4].exp, yyvsp[-2].exp, yyvsp[0].exp, EM_lineNum ); ;}
1935 break;
1937 case 77:
1938 #line 326 "chuck.y"
1939 { yyval.exp = yyvsp[0].exp; ;}
1940 break;
1942 case 78:
1943 #line 328 "chuck.y"
1944 { yyval.exp = new_exp_from_binary( yyvsp[-2].exp, ae_op_or, yyvsp[0].exp, EM_lineNum ); ;}
1945 break;
1947 case 79:
1948 #line 332 "chuck.y"
1949 { yyval.exp = yyvsp[0].exp; ;}
1950 break;
1952 case 80:
1953 #line 334 "chuck.y"
1954 { yyval.exp = new_exp_from_binary( yyvsp[-2].exp, ae_op_and, yyvsp[0].exp, EM_lineNum ); ;}
1955 break;
1957 case 81:
1958 #line 338 "chuck.y"
1959 { yyval.exp = yyvsp[0].exp; ;}
1960 break;
1962 case 82:
1963 #line 340 "chuck.y"
1964 { yyval.exp = new_exp_from_binary( yyvsp[-2].exp, ae_op_s_or, yyvsp[0].exp, EM_lineNum ); ;}
1965 break;
1967 case 83:
1968 #line 344 "chuck.y"
1969 { yyval.exp = yyvsp[0].exp; ;}
1970 break;
1972 case 84:
1973 #line 346 "chuck.y"
1974 { yyval.exp = new_exp_from_binary( yyvsp[-2].exp, ae_op_s_xor, yyvsp[0].exp, EM_lineNum ); ;}
1975 break;
1977 case 85:
1978 #line 350 "chuck.y"
1979 { yyval.exp = yyvsp[0].exp; ;}
1980 break;
1982 case 86:
1983 #line 352 "chuck.y"
1984 { yyval.exp = new_exp_from_binary( yyvsp[-2].exp, ae_op_s_and, yyvsp[0].exp, EM_lineNum ); ;}
1985 break;
1987 case 87:
1988 #line 356 "chuck.y"
1989 { yyval.exp = yyvsp[0].exp; ;}
1990 break;
1992 case 88:
1993 #line 358 "chuck.y"
1994 { yyval.exp = new_exp_from_binary( yyvsp[-2].exp, ae_op_eq, yyvsp[0].exp, EM_lineNum ); ;}
1995 break;
1997 case 89:
1998 #line 360 "chuck.y"
1999 { yyval.exp = new_exp_from_binary( yyvsp[-2].exp, ae_op_neq, yyvsp[0].exp, EM_lineNum ); ;}
2000 break;
2002 case 90:
2003 #line 364 "chuck.y"
2004 { yyval.exp = yyvsp[0].exp; ;}
2005 break;
2007 case 91:
2008 #line 366 "chuck.y"
2009 { yyval.exp = new_exp_from_binary( yyvsp[-2].exp, ae_op_lt, yyvsp[0].exp, EM_lineNum ); ;}
2010 break;
2012 case 92:
2013 #line 368 "chuck.y"
2014 { yyval.exp = new_exp_from_binary( yyvsp[-2].exp, ae_op_gt, yyvsp[0].exp, EM_lineNum ); ;}
2015 break;
2017 case 93:
2018 #line 370 "chuck.y"
2019 { yyval.exp = new_exp_from_binary( yyvsp[-2].exp, ae_op_le, yyvsp[0].exp, EM_lineNum ); ;}
2020 break;
2022 case 94:
2023 #line 372 "chuck.y"
2024 { yyval.exp = new_exp_from_binary( yyvsp[-2].exp, ae_op_ge, yyvsp[0].exp, EM_lineNum ); ;}
2025 break;
2027 case 95:
2028 #line 376 "chuck.y"
2029 { yyval.exp = yyvsp[0].exp; ;}
2030 break;
2032 case 96:
2033 #line 378 "chuck.y"
2034 { yyval.exp = new_exp_from_binary( yyvsp[-2].exp, ae_op_shift_left, yyvsp[0].exp, EM_lineNum ); ;}
2035 break;
2037 case 97:
2038 #line 380 "chuck.y"
2039 { yyval.exp = new_exp_from_binary( yyvsp[-2].exp, ae_op_shift_right, yyvsp[0].exp, EM_lineNum ); ;}
2040 break;
2042 case 98:
2043 #line 384 "chuck.y"
2044 { yyval.exp = yyvsp[0].exp; ;}
2045 break;
2047 case 99:
2048 #line 386 "chuck.y"
2049 { yyval.exp = new_exp_from_binary( yyvsp[-2].exp, ae_op_plus, yyvsp[0].exp, EM_lineNum ); ;}
2050 break;
2052 case 100:
2053 #line 388 "chuck.y"
2054 { yyval.exp = new_exp_from_binary( yyvsp[-2].exp, ae_op_minus, yyvsp[0].exp, EM_lineNum ); ;}
2055 break;
2057 case 101:
2058 #line 392 "chuck.y"
2059 { yyval.exp = yyvsp[0].exp; ;}
2060 break;
2062 case 102:
2063 #line 394 "chuck.y"
2064 { yyval.exp = new_exp_from_binary( yyvsp[-2].exp, ae_op_times, yyvsp[0].exp, EM_lineNum ); ;}
2065 break;
2067 case 103:
2068 #line 396 "chuck.y"
2069 { yyval.exp = new_exp_from_binary( yyvsp[-2].exp, ae_op_divide, yyvsp[0].exp, EM_lineNum ); ;}
2070 break;
2072 case 104:
2073 #line 398 "chuck.y"
2074 { yyval.exp = new_exp_from_binary( yyvsp[-2].exp, ae_op_percent, yyvsp[0].exp, EM_lineNum ); ;}
2075 break;
2077 case 105:
2078 #line 402 "chuck.y"
2079 { yyval.exp = yyvsp[0].exp; ;}
2080 break;
2082 case 106:
2083 #line 404 "chuck.y"
2084 { yyval.exp = new_exp_from_binary( yyvsp[-2].exp, ae_op_tilda, yyvsp[0].exp, EM_lineNum ); ;}
2085 break;
2087 case 107:
2088 #line 408 "chuck.y"
2089 { yyval.exp = yyvsp[0].exp; ;}
2090 break;
2092 case 108:
2093 #line 409 "chuck.y"
2094 { yyval.exp = new_exp_from_cast( yyvsp[-2].sval, yyvsp[0].exp, EM_lineNum ); ;}
2095 break;
2097 case 109:
2098 #line 414 "chuck.y"
2099 { yyval.exp = yyvsp[0].exp; ;}
2100 break;
2102 case 110:
2103 #line 416 "chuck.y"
2104 { yyval.exp = new_exp_from_unary( ae_op_plusplus, yyvsp[0].exp, EM_lineNum ); ;}
2105 break;
2107 case 111:
2108 #line 418 "chuck.y"
2109 { yyval.exp = new_exp_from_unary( ae_op_minusminus, yyvsp[0].exp, EM_lineNum ); ;}
2110 break;
2112 case 112:
2113 #line 420 "chuck.y"
2114 { yyval.exp = new_exp_from_unary( yyvsp[-1].ival, yyvsp[0].exp, EM_lineNum ); ;}
2115 break;
2117 case 113:
2118 #line 425 "chuck.y"
2119 { yyval.ival = ae_op_plus; ;}
2120 break;
2122 case 114:
2123 #line 426 "chuck.y"
2124 { yyval.ival = ae_op_minus; ;}
2125 break;
2127 case 115:
2128 #line 427 "chuck.y"
2129 { yyval.ival = ae_op_tilda; ;}
2130 break;
2132 case 116:
2133 #line 428 "chuck.y"
2134 { yyval.ival = ae_op_exclamation; ;}
2135 break;
2137 case 117:
2138 #line 429 "chuck.y"
2139 { yyval.ival = ae_op_s_and; ;}
2140 break;
2142 case 118:
2143 #line 430 "chuck.y"
2144 { yyval.ival = ae_op_times; ;}
2145 break;
2147 case 119:
2148 #line 431 "chuck.y"
2149 { yyval.ival = ae_op_spork; ;}
2150 break;
2152 case 120:
2153 #line 435 "chuck.y"
2154 { yyval.exp = yyvsp[0].exp; ;}
2155 break;
2157 case 121:
2158 #line 437 "chuck.y"
2159 { yyval.exp = new_exp_from_array( yyvsp[-3].exp, yyvsp[-1].exp, EM_lineNum ); ;}
2160 break;
2162 case 122:
2163 #line 439 "chuck.y"
2164 { yyval.exp = new_exp_from_func_call( yyvsp[-2].exp, NULL, EM_lineNum ); ;}
2165 break;
2167 case 123:
2168 #line 441 "chuck.y"
2169 { yyval.exp = new_exp_from_func_call( yyvsp[-3].exp, yyvsp[-1].exp, EM_lineNum ); ;}
2170 break;
2172 case 124:
2173 #line 443 "chuck.y"
2174 { yyval.exp = new_exp_from_member_dot( yyvsp[-2].exp, yyvsp[0].sval, EM_lineNum ); ;}
2175 break;
2177 case 125:
2178 #line 445 "chuck.y"
2179 { yyval.exp = new_exp_from_postfix( yyvsp[-1].exp, ae_op_plusplus, EM_lineNum ); ;}
2180 break;
2182 case 126:
2183 #line 447 "chuck.y"
2184 { yyval.exp = new_exp_from_postfix( yyvsp[-1].exp, ae_op_minusminus, EM_lineNum ); ;}
2185 break;
2187 case 127:
2188 #line 449 "chuck.y"
2189 { yyval.exp = new_exp_from_dur( yyvsp[-2].exp, yyvsp[0].exp, EM_lineNum ); ;}
2190 break;
2192 case 128:
2193 #line 454 "chuck.y"
2194 { yyval.exp = new_exp_from_id( yyvsp[0].sval, EM_lineNum ); ;}
2195 break;
2197 case 129:
2198 #line 455 "chuck.y"
2199 { yyval.exp = new_exp_from_int( yyvsp[0].ival, EM_lineNum ); ;}
2200 break;
2202 case 130:
2203 #line 456 "chuck.y"
2204 { yyval.exp = new_exp_from_float( yyvsp[0].fval, EM_lineNum ); ;}
2205 break;
2207 case 131:
2208 #line 457 "chuck.y"
2209 { yyval.exp = new_exp_from_str( yyvsp[0].sval, EM_lineNum ); ;}
2210 break;
2212 case 132:
2213 #line 458 "chuck.y"
2214 { yyval.exp = new_exp_from_namespace( "", EM_lineNum ); ;}
2215 break;
2217 case 133:
2218 #line 459 "chuck.y"
2219 { yyval.exp = new_exp_from_namespace( yyvsp[-1].sval, EM_lineNum ); ;}
2220 break;
2222 case 134:
2223 #line 460 "chuck.y"
2224 { yyval.exp = yyvsp[-1].exp; ;}
2225 break;
2230 /* Line 999 of yacc.c. */
2231 #line 2232 "chuck.tab.c"
2233 yyvsp -= yylen;
2234 yyssp -= yylen;
2237 YY_STACK_PRINT (yyss, yyssp);
2239 *++yyvsp = yyval;
2242 /* Now `shift' the result of the reduction. Determine what state
2243 that goes to, based on the state we popped back to and the rule
2244 number reduced by. */
2246 yyn = yyr1[yyn];
2248 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
2249 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
2250 yystate = yytable[yystate];
2251 else
2252 yystate = yydefgoto[yyn - YYNTOKENS];
2254 goto yynewstate;
2257 /*------------------------------------.
2258 | yyerrlab -- here on detecting error |
2259 `------------------------------------*/
2260 yyerrlab:
2261 /* If not already recovering from an error, report this error. */
2262 if (!yyerrstatus)
2264 ++yynerrs;
2265 #if YYERROR_VERBOSE
2266 yyn = yypact[yystate];
2268 if (YYPACT_NINF < yyn && yyn < YYLAST)
2270 YYSIZE_T yysize = 0;
2271 int yytype = YYTRANSLATE (yychar);
2272 const char* yyprefix;
2273 char *yymsg;
2274 int yyx;
2276 /* Start YYX at -YYN if negative to avoid negative indexes in
2277 YYCHECK. */
2278 int yyxbegin = yyn < 0 ? -yyn : 0;
2280 /* Stay within bounds of both yycheck and yytname. */
2281 int yychecklim = YYLAST - yyn;
2282 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
2283 int yycount = 0;
2285 yyprefix = ", expecting ";
2286 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
2287 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
2289 yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
2290 yycount += 1;
2291 if (yycount == 5)
2293 yysize = 0;
2294 break;
2297 yysize += (sizeof ("syntax error, unexpected ")
2298 + yystrlen (yytname[yytype]));
2299 yymsg = (char *) YYSTACK_ALLOC (yysize);
2300 if (yymsg != 0)
2302 char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
2303 yyp = yystpcpy (yyp, yytname[yytype]);
2305 if (yycount < 5)
2307 yyprefix = ", expecting ";
2308 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
2309 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
2311 yyp = yystpcpy (yyp, yyprefix);
2312 yyp = yystpcpy (yyp, yytname[yyx]);
2313 yyprefix = " or ";
2316 yyerror (yymsg);
2317 YYSTACK_FREE (yymsg);
2319 else
2320 yyerror ("syntax error; also virtual memory exhausted");
2322 else
2323 #endif /* YYERROR_VERBOSE */
2324 yyerror ("syntax error");
2329 if (yyerrstatus == 3)
2331 /* If just tried and failed to reuse lookahead token after an
2332 error, discard it. */
2334 /* Return failure if at end of input. */
2335 if (yychar == YYEOF)
2337 /* Pop the error token. */
2338 YYPOPSTACK;
2339 /* Pop the rest of the stack. */
2340 while (yyss < yyssp)
2342 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
2343 yydestruct (yystos[*yyssp], yyvsp);
2344 YYPOPSTACK;
2346 YYABORT;
2349 YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
2350 yydestruct (yytoken, &yylval);
2351 yychar = YYEMPTY;
2355 /* Else will try to reuse lookahead token after shifting the error
2356 token. */
2357 goto yyerrlab1;
2360 /*----------------------------------------------------.
2361 | yyerrlab1 -- error raised explicitly by an action. |
2362 `----------------------------------------------------*/
2363 yyerrlab1:
2364 yyerrstatus = 3; /* Each real token shifted decrements this. */
2366 for (;;)
2368 yyn = yypact[yystate];
2369 if (yyn != YYPACT_NINF)
2371 yyn += YYTERROR;
2372 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2374 yyn = yytable[yyn];
2375 if (0 < yyn)
2376 break;
2380 /* Pop the current state because it cannot handle the error token. */
2381 if (yyssp == yyss)
2382 YYABORT;
2384 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
2385 yydestruct (yystos[yystate], yyvsp);
2386 yyvsp--;
2387 yystate = *--yyssp;
2389 YY_STACK_PRINT (yyss, yyssp);
2392 if (yyn == YYFINAL)
2393 YYACCEPT;
2395 YYDPRINTF ((stderr, "Shifting error token, "));
2397 *++yyvsp = yylval;
2400 yystate = yyn;
2401 goto yynewstate;
2404 /*-------------------------------------.
2405 | yyacceptlab -- YYACCEPT comes here. |
2406 `-------------------------------------*/
2407 yyacceptlab:
2408 yyresult = 0;
2409 goto yyreturn;
2411 /*-----------------------------------.
2412 | yyabortlab -- YYABORT comes here. |
2413 `-----------------------------------*/
2414 yyabortlab:
2415 yyresult = 1;
2416 goto yyreturn;
2418 #ifndef yyoverflow
2419 /*----------------------------------------------.
2420 | yyoverflowlab -- parser overflow comes here. |
2421 `----------------------------------------------*/
2422 yyoverflowlab:
2423 yyerror ("parser stack overflow");
2424 yyresult = 2;
2425 /* Fall through. */
2426 #endif
2428 yyreturn:
2429 #ifndef yyoverflow
2430 if (yyss != yyssa)
2431 YYSTACK_FREE (yyss);
2432 #endif
2433 return yyresult;
2438 #line 2 "chuck.yy.c"
2439 /* A lexical scanner generated by flex */
2441 /* Scanner skeleton version:
2442 * $Header: /cvs/chuck_dev/exile/v1/src/chuck_win32.c,v 1.1 2005/08/19 01:50:21 gw-chuck Exp $
2445 #define FLEX_SCANNER
2446 #define YY_FLEX_MAJOR_VERSION 2
2447 #define YY_FLEX_MINOR_VERSION 5
2449 #include <stdio.h>
2450 #include <errno.h>
2452 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
2453 #ifdef c_plusplus
2454 #ifndef __cplusplus
2455 #define __cplusplus
2456 #endif
2457 #endif
2460 #ifdef __cplusplus
2462 #include <stdlib.h>
2463 #ifndef _WIN32
2464 #include <unistd.h>
2465 #endif
2467 /* Use prototypes in function declarations. */
2468 #define YY_USE_PROTOS
2470 /* The "const" storage-class-modifier is valid. */
2471 #define YY_USE_CONST
2473 #else /* ! __cplusplus */
2475 #if __STDC__
2477 #define YY_USE_PROTOS
2478 #define YY_USE_CONST
2480 #endif /* __STDC__ */
2481 #endif /* ! __cplusplus */
2483 #ifdef __TURBOC__
2484 #pragma warn -rch
2485 #pragma warn -use
2486 #include <io.h>
2487 #include <stdlib.h>
2488 #define YY_USE_CONST
2489 #define YY_USE_PROTOS
2490 #endif
2492 #ifdef YY_USE_CONST
2493 #define yyconst const
2494 #else
2495 #define yyconst
2496 #endif
2499 #ifdef YY_USE_PROTOS
2500 #define YY_PROTO(proto) proto
2501 #else
2502 #define YY_PROTO(proto) ()
2503 #endif
2506 /* Returned upon end-of-file. */
2507 #define YY_NULL 0
2509 /* Promotes a possibly negative, possibly signed char to an unsigned
2510 * integer for use as an array index. If the signed char is negative,
2511 * we want to instead treat it as an 8-bit unsigned char, hence the
2512 * double cast.
2514 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
2516 /* Enter a start condition. This macro really ought to take a parameter,
2517 * but we do it the disgusting crufty way forced on us by the ()-less
2518 * definition of BEGIN.
2520 #define BEGIN yy_start = 1 + 2 *
2522 /* Translate the current start state into a value that can be later handed
2523 * to BEGIN to return to the state. The YYSTATE alias is for lex
2524 * compatibility.
2526 #define YY_START ((yy_start - 1) / 2)
2527 #define YYSTATE YY_START
2529 /* Action number for EOF rule of a given start state. */
2530 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
2532 /* Special action meaning "start processing a new file". */
2533 #define YY_NEW_FILE yyrestart( yyin )
2535 #define YY_END_OF_BUFFER_CHAR 0
2537 /* Size of default input buffer. */
2538 #define YY_BUF_SIZE 16384
2540 typedef struct yy_buffer_state *YY_BUFFER_STATE;
2542 extern int yyleng;
2543 extern FILE *yyin, *yyout;
2545 #define EOB_ACT_CONTINUE_SCAN 0
2546 #define EOB_ACT_END_OF_FILE 1
2547 #define EOB_ACT_LAST_MATCH 2
2549 /* The funky do-while in the following #define is used to turn the definition
2550 * int a single C statement (which needs a semi-colon terminator). This
2551 * avoids problems with code like:
2553 * if ( condition_holds )
2554 * yyless( 5 );
2555 * else
2556 * do_something_else();
2558 * Prior to using the do-while the compiler would get upset at the
2559 * "else" because it interpreted the "if" statement as being all
2560 * done when it reached the ';' after the yyless() call.
2563 /* Return all but the first 'n' matched characters back to the input stream. */
2565 #define yyless(n) \
2566 do \
2568 /* Undo effects of setting up yytext. */ \
2569 *yy_cp = yy_hold_char; \
2570 YY_RESTORE_YY_MORE_OFFSET \
2571 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
2572 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
2574 while ( 0 )
2576 #define unput(c) yyunput( c, yytext_ptr )
2578 /* The following is because we cannot portably get our hands on size_t
2579 * (without autoconf's help, which isn't available because we want
2580 * flex-generated scanners to compile on their own).
2582 typedef unsigned int yy_size_t;
2585 struct yy_buffer_state
2587 FILE *yy_input_file;
2589 char *yy_ch_buf; /* input buffer */
2590 char *yy_buf_pos; /* current position in input buffer */
2592 /* Size of input buffer in bytes, not including room for EOB
2593 * characters.
2595 yy_size_t yy_buf_size;
2597 /* Number of characters read into yy_ch_buf, not including EOB
2598 * characters.
2600 int yy_n_chars;
2602 /* Whether we "own" the buffer - i.e., we know we created it,
2603 * and can realloc() it to grow it, and should free() it to
2604 * delete it.
2606 int yy_is_our_buffer;
2608 /* Whether this is an "interactive" input source; if so, and
2609 * if we're using stdio for input, then we want to use getc()
2610 * instead of fread(), to make sure we stop fetching input after
2611 * each newline.
2613 int yy_is_interactive;
2615 /* Whether we're considered to be at the beginning of a line.
2616 * If so, '^' rules will be active on the next match, otherwise
2617 * not.
2619 int yy_at_bol;
2621 /* Whether to try to fill the input buffer when we reach the
2622 * end of it.
2624 int yy_fill_buffer;
2626 int yy_buffer_status;
2627 #define YY_BUFFER_NEW 0
2628 #define YY_BUFFER_NORMAL 1
2629 /* When an EOF's been seen but there's still some text to process
2630 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
2631 * shouldn't try reading from the input source any more. We might
2632 * still have a bunch of tokens to match, though, because of
2633 * possible backing-up.
2635 * When we actually see the EOF, we change the status to "new"
2636 * (via yyrestart()), so that the user can continue scanning by
2637 * just pointing yyin at a new input file.
2639 #define YY_BUFFER_EOF_PENDING 2
2642 static YY_BUFFER_STATE yy_current_buffer = 0;
2644 /* We provide macros for accessing buffer states in case in the
2645 * future we want to put the buffer states in a more general
2646 * "scanner state".
2648 #define YY_CURRENT_BUFFER yy_current_buffer
2651 /* yy_hold_char holds the character lost when yytext is formed. */
2652 static char yy_hold_char;
2654 static int yy_n_chars; /* number of characters read into yy_ch_buf */
2657 int yyleng;
2659 /* Points to current character in buffer. */
2660 static char *yy_c_buf_p = (char *) 0;
2661 static int yy_init = 1; /* whether we need to initialize */
2662 static int yy_start = 0; /* start state number */
2664 /* Flag which is used to allow yywrap()'s to do buffer switches
2665 * instead of setting up a fresh yyin. A bit of a hack ...
2667 static int yy_did_buffer_switch_on_eof;
2669 void yyrestart YY_PROTO(( FILE *input_file ));
2671 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
2672 void yy_load_buffer_state YY_PROTO(( void ));
2673 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
2674 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
2675 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
2676 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
2677 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
2679 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
2680 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
2681 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
2683 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
2684 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
2685 static void yy_flex_free YY_PROTO(( void * ));
2687 #define yy_new_buffer yy_create_buffer
2689 #define yy_set_interactive(is_interactive) \
2691 if ( ! yy_current_buffer ) \
2692 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
2693 yy_current_buffer->yy_is_interactive = is_interactive; \
2696 #define yy_set_bol(at_bol) \
2698 if ( ! yy_current_buffer ) \
2699 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
2700 yy_current_buffer->yy_at_bol = at_bol; \
2703 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
2705 typedef unsigned char YY_CHAR;
2706 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
2707 typedef int yy_state_type;
2708 extern char *yytext;
2709 #define yytext_ptr yytext
2711 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
2712 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
2713 static int yy_get_next_buffer YY_PROTO(( void ));
2714 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
2716 /* Done after the current pattern has been matched and before the
2717 * corresponding action - sets up yytext.
2719 #define YY_DO_BEFORE_ACTION \
2720 yytext_ptr = yy_bp; \
2721 yyleng = (int) (yy_cp - yy_bp); \
2722 yy_hold_char = *yy_cp; \
2723 *yy_cp = '\0'; \
2724 yy_c_buf_p = yy_cp;
2726 #define YY_NUM_RULES 104
2727 #define YY_END_OF_BUFFER 105
2728 static yyconst short int yy_accept[232] =
2729 { 0,
2730 0, 0, 105, 103, 3, 5, 103, 2, 42, 103,
2731 16, 15, 28, 34, 35, 13, 11, 8, 12, 10,
2732 14, 99, 99, 9, 40, 22, 33, 23, 41, 95,
2733 101, 101, 36, 37, 30, 101, 101, 101, 101, 101,
2734 101, 101, 101, 101, 101, 101, 101, 101, 38, 29,
2735 39, 43, 4, 21, 0, 102, 0, 0, 0, 26,
2736 0, 0, 17, 0, 0, 6, 0, 0, 7, 0,
2737 72, 100, 0, 1, 0, 100, 99, 0, 99, 0,
2738 18, 19, 73, 32, 24, 70, 20, 69, 25, 31,
2739 0, 96, 101, 101, 0, 0, 101, 56, 101, 101,
2741 101, 101, 101, 101, 101, 101, 47, 101, 101, 101,
2742 101, 101, 101, 101, 101, 101, 101, 101, 0, 0,
2743 27, 71, 83, 94, 78, 89, 76, 87, 74, 85,
2744 75, 86, 77, 88, 100, 98, 97, 0, 0, 0,
2745 0, 84, 101, 80, 91, 101, 101, 101, 101, 101,
2746 101, 101, 44, 58, 101, 59, 101, 101, 101, 101,
2747 101, 101, 101, 101, 101, 101, 79, 90, 98, 97,
2748 82, 93, 81, 92, 50, 101, 101, 101, 101, 101,
2749 48, 101, 101, 101, 51, 101, 101, 101, 101, 101,
2750 101, 49, 101, 101, 55, 101, 46, 60, 67, 101,
2752 101, 101, 101, 101, 101, 101, 68, 101, 53, 45,
2753 54, 101, 101, 101, 101, 101, 63, 52, 66, 61,
2754 101, 101, 65, 101, 57, 101, 101, 101, 64, 62,
2758 static yyconst int yy_ec[256] =
2759 { 0,
2760 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
2761 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
2762 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2763 1, 5, 6, 7, 8, 1, 9, 10, 1, 11,
2764 12, 13, 14, 15, 16, 17, 18, 19, 20, 20,
2765 20, 20, 20, 20, 20, 21, 21, 22, 23, 24,
2766 25, 26, 27, 28, 29, 29, 30, 29, 29, 29,
2767 31, 31, 31, 31, 31, 32, 31, 33, 31, 31,
2768 31, 31, 31, 31, 34, 31, 31, 35, 31, 31,
2769 36, 37, 38, 39, 31, 1, 40, 41, 42, 43,
2771 44, 45, 31, 46, 47, 31, 48, 49, 50, 51,
2772 52, 53, 31, 54, 55, 56, 57, 58, 59, 60,
2773 31, 31, 61, 62, 63, 64, 1, 1, 1, 1,
2774 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2775 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2776 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2777 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2778 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2779 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2780 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2782 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2783 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2784 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2785 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2786 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2787 1, 1, 1, 1, 1
2790 static yyconst int yy_meta[65] =
2791 { 0,
2792 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2793 1, 1, 1, 1, 1, 1, 1, 1, 2, 2,
2794 2, 1, 1, 1, 1, 1, 1, 1, 2, 2,
2795 3, 3, 3, 3, 3, 1, 1, 1, 1, 2,
2796 2, 2, 2, 2, 2, 3, 3, 3, 3, 3,
2797 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
2798 1, 1, 1, 1
2801 static yyconst short int yy_base[235] =
2802 { 0,
2803 0, 0, 303, 304, 304, 304, 299, 304, 276, 58,
2804 304, 50, 57, 278, 304, 52, 55, 304, 58, 66,
2805 54, 79, 73, 66, 304, 92, 77, 93, 304, 87,
2806 0, 265, 304, 304, 81, 75, 37, 74, 75, 75,
2807 84, 32, 83, 254, 85, 251, 245, 249, 304, 117,
2808 304, 304, 304, 268, 118, 304, 290, 266, 265, 304,
2809 264, 263, 304, 262, 261, 304, 260, 259, 258, 257,
2810 304, 124, 256, 304, 255, 127, 132, 137, 126, 0,
2811 304, 304, 304, 134, 304, 304, 304, 304, 304, 138,
2812 254, 304, 0, 247, 252, 251, 220, 0, 230, 230,
2814 233, 221, 216, 214, 215, 217, 0, 214, 207, 216,
2815 115, 223, 207, 210, 221, 216, 203, 211, 231, 230,
2816 304, 304, 304, 304, 304, 304, 304, 304, 304, 304,
2817 304, 304, 304, 304, 149, 152, 142, 229, 228, 227,
2818 226, 304, 219, 304, 304, 206, 197, 208, 192, 191,
2819 201, 200, 0, 201, 193, 0, 192, 182, 183, 189,
2820 180, 182, 179, 183, 186, 183, 304, 304, 146, 153,
2821 304, 304, 304, 304, 0, 177, 176, 181, 173, 171,
2822 0, 175, 169, 180, 0, 183, 178, 174, 166, 171,
2823 171, 0, 168, 172, 0, 164, 0, 0, 0, 164,
2825 159, 155, 148, 158, 156, 146, 0, 154, 0, 0,
2826 0, 139, 141, 148, 146, 132, 0, 0, 0, 0,
2827 131, 126, 0, 129, 0, 109, 118, 55, 0, 0,
2828 304, 210, 212, 102
2831 static yyconst short int yy_def[235] =
2832 { 0,
2833 231, 1, 231, 231, 231, 231, 231, 231, 231, 232,
2834 231, 231, 231, 231, 231, 231, 231, 231, 231, 231,
2835 231, 231, 231, 231, 231, 231, 231, 231, 231, 231,
2836 233, 233, 231, 231, 231, 233, 233, 233, 233, 233,
2837 233, 233, 233, 233, 233, 233, 233, 233, 231, 231,
2838 231, 231, 231, 231, 232, 231, 232, 231, 231, 231,
2839 231, 231, 231, 231, 231, 231, 231, 231, 231, 231,
2840 231, 231, 231, 231, 231, 231, 231, 231, 231, 234,
2841 231, 231, 231, 231, 231, 231, 231, 231, 231, 231,
2842 231, 231, 233, 233, 231, 231, 233, 233, 233, 233,
2844 233, 233, 233, 233, 233, 233, 233, 233, 233, 233,
2845 233, 233, 233, 233, 233, 233, 233, 233, 231, 231,
2846 231, 231, 231, 231, 231, 231, 231, 231, 231, 231,
2847 231, 231, 231, 231, 231, 231, 234, 231, 231, 231,
2848 231, 231, 233, 231, 231, 233, 233, 233, 233, 233,
2849 233, 233, 233, 233, 233, 233, 233, 233, 233, 233,
2850 233, 233, 233, 233, 233, 233, 231, 231, 231, 231,
2851 231, 231, 231, 231, 233, 233, 233, 233, 233, 233,
2852 233, 233, 233, 233, 233, 233, 233, 233, 233, 233,
2853 233, 233, 233, 233, 233, 233, 233, 233, 233, 233,
2855 233, 233, 233, 233, 233, 233, 233, 233, 233, 233,
2856 233, 233, 233, 233, 233, 233, 233, 233, 233, 233,
2857 233, 233, 233, 233, 233, 233, 233, 233, 233, 233,
2858 0, 231, 231, 231
2861 static yyconst short int yy_nxt[369] =
2862 { 0,
2863 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
2864 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
2865 23, 24, 25, 26, 27, 28, 29, 30, 31, 31,
2866 31, 31, 32, 31, 31, 33, 4, 34, 35, 36,
2867 37, 38, 31, 39, 40, 31, 41, 31, 31, 31,
2868 42, 31, 43, 44, 45, 46, 47, 31, 48, 31,
2869 49, 50, 51, 52, 56, 58, 60, 64, 66, 73,
2870 67, 74, 61, 69, 59, 109, 65, 81, 75, 68,
2871 99, 62, 70, 71, 72, 72, 72, 82, 110, 76,
2872 100, 77, 77, 77, 57, 76, 95, 77, 77, 77,
2874 86, 87, 88, 137, 79, 96, 79, 83, 78, 230,
2875 79, 91, 79, 80, 92, 84, 85, 89, 90, 97,
2876 78, 79, 101, 103, 56, 102, 105, 79, 107, 79,
2877 98, 106, 119, 108, 104, 79, 111, 114, 80, 112,
2878 115, 120, 72, 72, 72, 135, 135, 135, 76, 138,
2879 77, 77, 77, 140, 57, 136, 136, 79, 139, 79,
2880 229, 158, 141, 79, 228, 79, 159, 135, 135, 135,
2881 136, 136, 227, 170, 79, 170, 226, 169, 121, 169,
2882 79, 225, 79, 169, 170, 169, 170, 224, 79, 223,
2883 170, 222, 221, 220, 169, 219, 218, 217, 170, 216,
2885 169, 170, 169, 215, 214, 213, 212, 211, 169, 170,
2886 55, 55, 55, 93, 93, 210, 209, 208, 207, 206,
2887 205, 204, 203, 202, 201, 200, 199, 198, 197, 196,
2888 195, 194, 193, 192, 191, 190, 189, 188, 187, 186,
2889 185, 184, 183, 182, 181, 180, 179, 178, 177, 176,
2890 175, 174, 173, 172, 171, 168, 167, 166, 165, 164,
2891 163, 162, 161, 160, 157, 156, 155, 154, 153, 152,
2892 151, 150, 149, 148, 147, 146, 145, 144, 143, 142,
2893 134, 133, 132, 131, 130, 129, 128, 127, 126, 125,
2894 124, 123, 231, 122, 118, 117, 116, 113, 94, 63,
2896 54, 53, 231, 3, 231, 231, 231, 231, 231, 231,
2897 231, 231, 231, 231, 231, 231, 231, 231, 231, 231,
2898 231, 231, 231, 231, 231, 231, 231, 231, 231, 231,
2899 231, 231, 231, 231, 231, 231, 231, 231, 231, 231,
2900 231, 231, 231, 231, 231, 231, 231, 231, 231, 231,
2901 231, 231, 231, 231, 231, 231, 231, 231, 231, 231,
2902 231, 231, 231, 231, 231, 231, 231, 231
2905 static yyconst short int yy_chk[369] =
2906 { 0,
2907 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2908 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2909 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2910 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2911 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2912 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2913 1, 1, 1, 1, 10, 12, 13, 16, 17, 21,
2914 17, 21, 13, 19, 12, 42, 16, 24, 21, 17,
2915 37, 13, 19, 19, 20, 20, 20, 24, 42, 23,
2916 37, 23, 23, 23, 10, 22, 35, 22, 22, 22,
2918 27, 27, 27, 234, 23, 35, 23, 26, 22, 228,
2919 22, 30, 22, 22, 30, 26, 26, 28, 28, 36,
2920 22, 23, 38, 39, 55, 38, 40, 22, 41, 23,
2921 36, 40, 50, 41, 39, 22, 43, 45, 22, 43,
2922 45, 50, 72, 72, 72, 76, 76, 76, 77, 84,
2923 77, 77, 77, 90, 55, 78, 78, 79, 84, 79,
2924 227, 111, 90, 77, 226, 77, 111, 135, 135, 135,
2925 136, 136, 224, 137, 79, 137, 222, 169, 50, 169,
2926 77, 221, 79, 136, 170, 136, 170, 216, 77, 215,
2927 137, 214, 213, 212, 169, 208, 206, 205, 137, 204,
2929 136, 170, 169, 203, 202, 201, 200, 196, 136, 170,
2930 232, 232, 232, 233, 233, 194, 193, 191, 190, 189,
2931 188, 187, 186, 184, 183, 182, 180, 179, 178, 177,
2932 176, 166, 165, 164, 163, 162, 161, 160, 159, 158,
2933 157, 155, 154, 152, 151, 150, 149, 148, 147, 146,
2934 143, 141, 140, 139, 138, 120, 119, 118, 117, 116,
2935 115, 114, 113, 112, 110, 109, 108, 106, 105, 104,
2936 103, 102, 101, 100, 99, 97, 96, 95, 94, 91,
2937 75, 73, 70, 69, 68, 67, 65, 64, 62, 61,
2938 59, 58, 57, 54, 48, 47, 46, 44, 32, 14,
2940 9, 7, 3, 231, 231, 231, 231, 231, 231, 231,
2941 231, 231, 231, 231, 231, 231, 231, 231, 231, 231,
2942 231, 231, 231, 231, 231, 231, 231, 231, 231, 231,
2943 231, 231, 231, 231, 231, 231, 231, 231, 231, 231,
2944 231, 231, 231, 231, 231, 231, 231, 231, 231, 231,
2945 231, 231, 231, 231, 231, 231, 231, 231, 231, 231,
2946 231, 231, 231, 231, 231, 231, 231, 231
2949 static yy_state_type yy_last_accepting_state;
2950 static char *yy_last_accepting_cpos;
2952 /* The intent behind this definition is that it'll catch
2953 * any uses of REJECT which flex missed.
2955 #define REJECT reject_used_but_not_detected
2956 #define yymore() yymore_used_but_not_detected
2957 #define YY_MORE_ADJ 0
2958 #define YY_RESTORE_YY_MORE_OFFSET
2959 char *yytext;
2960 #line 1 "chuck.lex"
2961 #define INITIAL 0
2962 #line 10 "chuck.lex"
2963 /*----------------------------------------------------------------------------
2964 ChucK Concurrent, On-the-fly Audio Programming Language
2965 Compiler and Virtual Machine
2967 Copyright (c) 2004 Ge Wang and Perry R. Cook. All rights reserved.
2968 http://chuck.cs.princeton.edu/
2969 http://soundlab.cs.princeton.edu/
2971 This program is free software; you can redistribute it and/or modify
2972 it under the terms of the GNU General Public License as published by
2973 the Free Software Foundation; either version 2 of the License, or
2974 (at your option) any later version.
2976 This program is distributed in the hope that it will be useful,
2977 but WITHOUT ANY WARRANTY; without even the implied warranty of
2978 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2979 GNU General Public License for more details.
2981 You should have received a copy of the GNU General Public License
2982 along with this program; if not, write to the Free Software
2983 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
2984 U.S.A.
2985 -----------------------------------------------------------------------------*/
2987 //-----------------------------------------------------------------------------
2988 // file: chuck.yy.c
2989 // desc: chuck lexer
2991 // author: Ge Wang (gewang.cs.princeton.edu) - generated by lex
2992 // Perry R. Cook (prc@cs.princeton.edu)
2994 // based on the ansi C grammar by Jeff Lee, maintained by Jutta Degener
2996 // date: Summer 2002
2997 //-----------------------------------------------------------------------------
2999 #include <stdlib.h>
3000 #include <string.h>
3001 #include "chuck_utils.h"
3002 #include "chuck_absyn.h"
3003 #include "chuck_errmsg.h"
3005 #ifndef __PLATFORM_WIN32__
3006 #include "chuck.tab.h"
3007 #else
3008 #include "chuck_win32.h"
3009 #endif
3013 // globals
3014 extern YYSTYPE yylval;
3015 int char_pos = 1;
3017 // yywrap()
3018 int yywrap( void )
3020 char_pos = 1;
3021 return 1;
3024 // adjust()
3025 void adjust()
3027 EM_tokPos = char_pos;
3028 char_pos += yyleng;
3031 // strip
3032 c_str strip_lit( c_str str )
3034 str[strlen(str)-1] = '\0';
3035 return str+1;
3038 // alloc_str()
3039 c_str alloc_str( c_str str )
3041 c_str s = (c_str)malloc( strlen(str) + 1 );
3042 strcpy( s, str );
3044 return s;
3047 // to long
3048 long htol( c_str str )
3050 char * c = str;
3051 unsigned long n = 0;
3053 // skip over 0x
3054 c += 2;
3055 while( *c )
3057 n <<= 4;
3058 switch( *c )
3060 case '1': case '2': case '3': case '4': case '5':
3061 case '6': case '7': case '8': case '9': case '0':
3062 n += *c - '0';
3063 break;
3065 case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
3066 n += *c - 'a' + 10;
3067 break;
3069 case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
3070 n += *c - 'A' + 10;
3071 break;
3073 c++;
3076 return n;
3079 int comment();
3081 #line 645 "chuck.yy.c"
3083 /* Macros after this point can all be overridden by user definitions in
3084 * section 1.
3087 #ifndef YY_SKIP_YYWRAP
3088 #ifdef __cplusplus
3089 extern "C" int yywrap YY_PROTO(( void ));
3090 #else
3091 extern int yywrap YY_PROTO(( void ));
3092 #endif
3093 #endif
3095 #ifndef YY_NO_UNPUT
3096 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
3097 #endif
3099 #ifndef yytext_ptr
3100 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
3101 #endif
3103 #ifdef YY_NEED_STRLEN
3104 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
3105 #endif
3107 #ifndef YY_NO_INPUT
3108 #ifdef __cplusplus
3109 static int yyinput YY_PROTO(( void ));
3110 #else
3111 static int input YY_PROTO(( void ));
3112 #endif
3113 #endif
3115 #if YY_STACK_USED
3116 static int yy_start_stack_ptr = 0;
3117 static int yy_start_stack_depth = 0;
3118 static int *yy_start_stack = 0;
3119 #ifndef YY_NO_PUSH_STATE
3120 static void yy_push_state YY_PROTO(( int new_state ));
3121 #endif
3122 #ifndef YY_NO_POP_STATE
3123 static void yy_pop_state YY_PROTO(( void ));
3124 #endif
3125 #ifndef YY_NO_TOP_STATE
3126 static int yy_top_state YY_PROTO(( void ));
3127 #endif
3129 #else
3130 #define YY_NO_PUSH_STATE 1
3131 #define YY_NO_POP_STATE 1
3132 #define YY_NO_TOP_STATE 1
3133 #endif
3135 #ifdef YY_MALLOC_DECL
3136 YY_MALLOC_DECL
3137 #else
3138 #if __STDC__
3139 #ifndef __cplusplus
3140 #include <stdlib.h>
3141 #endif
3142 #else
3143 /* Just try to get by without declaring the routines. This will fail
3144 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
3145 * or sizeof(void*) != sizeof(int).
3147 #endif
3148 #endif
3150 /* Amount of stuff to slurp up with each read. */
3151 #ifndef YY_READ_BUF_SIZE
3152 #define YY_READ_BUF_SIZE 8192
3153 #endif
3155 /* Copy whatever the last rule matched to the standard output. */
3157 #ifndef ECHO
3158 /* This used to be an fputs(), but since the string might contain NUL's,
3159 * we now use fwrite().
3161 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
3162 #endif
3164 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
3165 * is returned in "result".
3167 #ifndef YY_INPUT
3168 #define YY_INPUT(buf,result,max_size) \
3169 if ( yy_current_buffer->yy_is_interactive ) \
3171 int c = '*', n; \
3172 for ( n = 0; n < max_size && \
3173 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
3174 buf[n] = (char) c; \
3175 if ( c == '\n' ) \
3176 buf[n++] = (char) c; \
3177 if ( c == EOF && ferror( yyin ) ) \
3178 YY_FATAL_ERROR( "input in flex scanner failed" ); \
3179 result = n; \
3181 else \
3183 errno=0; \
3184 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
3186 if( errno != EINTR) \
3188 YY_FATAL_ERROR( "input in flex scanner failed" ); \
3189 break; \
3191 errno=0; \
3192 clearerr(yyin); \
3195 #endif
3197 /* No semi-colon after return; correct usage is to write "yyterminate();" -
3198 * we don't want an extra ';' after the "return" because that will cause
3199 * some compilers to complain about unreachable statements.
3201 #ifndef yyterminate
3202 #define yyterminate() return YY_NULL
3203 #endif
3205 /* Number of entries by which start-condition stack grows. */
3206 #ifndef YY_START_STACK_INCR
3207 #define YY_START_STACK_INCR 25
3208 #endif
3210 /* Report a fatal error. */
3211 #ifndef YY_FATAL_ERROR
3212 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
3213 #endif
3215 /* Default declaration of generated scanner - a define so the user can
3216 * easily add parameters.
3218 #ifndef YY_DECL
3219 #define YY_DECL int yylex YY_PROTO(( void ))
3220 #endif
3222 /* Code executed at the beginning of each rule, after yytext and yyleng
3223 * have been set up.
3225 #ifndef YY_USER_ACTION
3226 #define YY_USER_ACTION
3227 #endif
3229 /* Code executed at the end of each rule. */
3230 #ifndef YY_BREAK
3231 #define YY_BREAK break;
3232 #endif
3234 #define YY_RULE_SETUP \
3235 YY_USER_ACTION
3237 YY_DECL
3239 register yy_state_type yy_current_state;
3240 register char *yy_cp, *yy_bp;
3241 register int yy_act;
3243 #line 130 "chuck.lex"
3246 #line 810 "chuck.yy.c"
3248 if ( yy_init )
3250 yy_init = 0;
3252 #ifdef YY_USER_INIT
3253 YY_USER_INIT;
3254 #endif
3256 if ( ! yy_start )
3257 yy_start = 1; /* first start state */
3259 if ( ! yyin )
3260 yyin = stdin;
3262 if ( ! yyout )
3263 yyout = stdout;
3265 if ( ! yy_current_buffer )
3266 yy_current_buffer =
3267 yy_create_buffer( yyin, YY_BUF_SIZE );
3269 yy_load_buffer_state();
3272 while ( 1 ) /* loops until end-of-file is reached */
3274 yy_cp = yy_c_buf_p;
3276 /* Support of yytext. */
3277 *yy_cp = yy_hold_char;
3279 /* yy_bp points to the position in yy_ch_buf of the start of
3280 * the current run.
3282 yy_bp = yy_cp;
3284 yy_current_state = yy_start;
3285 yy_match:
3288 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
3289 if ( yy_accept[yy_current_state] )
3291 yy_last_accepting_state = yy_current_state;
3292 yy_last_accepting_cpos = yy_cp;
3294 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
3296 yy_current_state = (int) yy_def[yy_current_state];
3297 if ( yy_current_state >= 232 )
3298 yy_c = yy_meta[(unsigned int) yy_c];
3300 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
3301 ++yy_cp;
3303 while ( yy_base[yy_current_state] != 304 );
3305 yy_find_action:
3306 yy_act = yy_accept[yy_current_state];
3307 if ( yy_act == 0 )
3308 { /* have to back up */
3309 yy_cp = yy_last_accepting_cpos;
3310 yy_current_state = yy_last_accepting_state;
3311 yy_act = yy_accept[yy_current_state];
3314 YY_DO_BEFORE_ACTION;
3317 do_action: /* This label is used only to access EOF actions. */
3320 switch ( yy_act )
3321 { /* beginning of action switch */
3322 case 0: /* must back up */
3323 /* undo the effects of YY_DO_BEFORE_ACTION */
3324 *yy_cp = yy_hold_char;
3325 yy_cp = yy_last_accepting_cpos;
3326 yy_current_state = yy_last_accepting_state;
3327 goto yy_find_action;
3329 case 1:
3330 YY_RULE_SETUP
3331 #line 132 "chuck.lex"
3332 { adjust(); comment(); continue; }
3333 YY_BREAK
3334 case 2:
3335 YY_RULE_SETUP
3336 #line 133 "chuck.lex"
3337 { adjust(); continue; }
3338 YY_BREAK
3339 case 3:
3340 YY_RULE_SETUP
3341 #line 134 "chuck.lex"
3342 { adjust(); continue; }
3343 YY_BREAK
3344 case 4:
3345 YY_RULE_SETUP
3346 #line 135 "chuck.lex"
3347 { adjust(); EM_newline(); continue; }
3348 YY_BREAK
3349 case 5:
3350 YY_RULE_SETUP
3351 #line 136 "chuck.lex"
3352 { adjust(); EM_newline(); continue; }
3353 YY_BREAK
3354 case 6:
3355 YY_RULE_SETUP
3356 #line 138 "chuck.lex"
3357 { adjust(); return PLUSPLUS; }
3358 YY_BREAK
3359 case 7:
3360 YY_RULE_SETUP
3361 #line 139 "chuck.lex"
3362 { adjust(); return MINUSMINUS; }
3363 YY_BREAK
3364 case 8:
3365 YY_RULE_SETUP
3366 #line 141 "chuck.lex"
3367 { adjust(); return COMMA; }
3368 YY_BREAK
3369 case 9:
3370 YY_RULE_SETUP
3371 #line 142 "chuck.lex"
3372 { adjust(); return COLON; }
3373 YY_BREAK
3374 case 10:
3375 YY_RULE_SETUP
3376 #line 143 "chuck.lex"
3377 { adjust(); return DOT; }
3378 YY_BREAK
3379 case 11:
3380 YY_RULE_SETUP
3381 #line 144 "chuck.lex"
3382 { adjust(); return PLUS; }
3383 YY_BREAK
3384 case 12:
3385 YY_RULE_SETUP
3386 #line 145 "chuck.lex"
3387 { adjust(); return MINUS; }
3388 YY_BREAK
3389 case 13:
3390 YY_RULE_SETUP
3391 #line 146 "chuck.lex"
3392 { adjust(); return TIMES; }
3393 YY_BREAK
3394 case 14:
3395 YY_RULE_SETUP
3396 #line 147 "chuck.lex"
3397 { adjust(); return DIVIDE; }
3398 YY_BREAK
3399 case 15:
3400 YY_RULE_SETUP
3401 #line 148 "chuck.lex"
3402 { adjust(); return PERCENT; }
3403 YY_BREAK
3404 case 16:
3405 YY_RULE_SETUP
3406 #line 149 "chuck.lex"
3407 { adjust(); return POUND; }
3408 YY_BREAK
3409 case 17:
3410 YY_RULE_SETUP
3411 #line 151 "chuck.lex"
3412 { adjust(); return L_NSPC; }
3413 YY_BREAK
3414 case 18:
3415 YY_RULE_SETUP
3416 #line 152 "chuck.lex"
3417 { adjust(); return R_NSPC; }
3418 YY_BREAK
3419 case 19:
3420 YY_RULE_SETUP
3421 #line 153 "chuck.lex"
3422 { adjust(); return COLONCOLON; }
3423 YY_BREAK
3424 case 20:
3425 YY_RULE_SETUP
3426 #line 154 "chuck.lex"
3427 { adjust(); return EQ; }
3428 YY_BREAK
3429 case 21:
3430 YY_RULE_SETUP
3431 #line 155 "chuck.lex"
3432 { adjust(); return NEQ; }
3433 YY_BREAK
3434 case 22:
3435 YY_RULE_SETUP
3436 #line 156 "chuck.lex"
3437 { adjust(); return LT; }
3438 YY_BREAK
3439 case 23:
3440 YY_RULE_SETUP
3441 #line 157 "chuck.lex"
3442 { adjust(); return GT; }
3443 YY_BREAK
3444 case 24:
3445 YY_RULE_SETUP
3446 #line 158 "chuck.lex"
3447 { adjust(); return LE; }
3448 YY_BREAK
3449 case 25:
3450 YY_RULE_SETUP
3451 #line 159 "chuck.lex"
3452 { adjust(); return GE; }
3453 YY_BREAK
3454 case 26:
3455 YY_RULE_SETUP
3456 #line 160 "chuck.lex"
3457 { adjust(); return AND; }
3458 YY_BREAK
3459 case 27:
3460 YY_RULE_SETUP
3461 #line 161 "chuck.lex"
3462 { adjust(); return OR; }
3463 YY_BREAK
3464 case 28:
3465 YY_RULE_SETUP
3466 #line 162 "chuck.lex"
3467 { adjust(); return S_AND; }
3468 YY_BREAK
3469 case 29:
3470 YY_RULE_SETUP
3471 #line 163 "chuck.lex"
3472 { adjust(); return S_OR; }
3473 YY_BREAK
3474 case 30:
3475 YY_RULE_SETUP
3476 #line 164 "chuck.lex"
3477 { adjust(); return S_XOR; }
3478 YY_BREAK
3479 case 31:
3480 YY_RULE_SETUP
3481 #line 165 "chuck.lex"
3482 { adjust(); return SHIFT_RIGHT; }
3483 YY_BREAK
3484 case 32:
3485 YY_RULE_SETUP
3486 #line 166 "chuck.lex"
3487 { adjust(); return SHIFT_LEFT; }
3488 YY_BREAK
3489 case 33:
3490 YY_RULE_SETUP
3491 #line 167 "chuck.lex"
3492 { adjust(); return ASSIGN; }
3493 YY_BREAK
3494 case 34:
3495 YY_RULE_SETUP
3496 #line 168 "chuck.lex"
3497 { adjust(); return LPAREN; }
3498 YY_BREAK
3499 case 35:
3500 YY_RULE_SETUP
3501 #line 169 "chuck.lex"
3502 { adjust(); return RPAREN; }
3503 YY_BREAK
3504 case 36:
3505 YY_RULE_SETUP
3506 #line 170 "chuck.lex"
3507 { adjust(); return LBRACK; }
3508 YY_BREAK
3509 case 37:
3510 YY_RULE_SETUP
3511 #line 171 "chuck.lex"
3512 { adjust(); return RBRACK; }
3513 YY_BREAK
3514 case 38:
3515 YY_RULE_SETUP
3516 #line 172 "chuck.lex"
3517 { adjust(); return LBRACE; }
3518 YY_BREAK
3519 case 39:
3520 YY_RULE_SETUP
3521 #line 173 "chuck.lex"
3522 { adjust(); return RBRACE; }
3523 YY_BREAK
3524 case 40:
3525 YY_RULE_SETUP
3526 #line 174 "chuck.lex"
3527 { adjust(); return SEMICOLON; }
3528 YY_BREAK
3529 case 41:
3530 YY_RULE_SETUP
3531 #line 175 "chuck.lex"
3532 { adjust(); return QUESTION; }
3533 YY_BREAK
3534 case 42:
3535 YY_RULE_SETUP
3536 #line 176 "chuck.lex"
3537 { adjust(); return EXCLAMATION; }
3538 YY_BREAK
3539 case 43:
3540 YY_RULE_SETUP
3541 #line 177 "chuck.lex"
3542 { adjust(); return TILDA; }
3543 YY_BREAK
3544 case 44:
3545 YY_RULE_SETUP
3546 #line 178 "chuck.lex"
3547 { adjust(); return FOR; }
3548 YY_BREAK
3549 case 45:
3550 YY_RULE_SETUP
3551 #line 179 "chuck.lex"
3552 { adjust(); return WHILE; }
3553 YY_BREAK
3554 case 46:
3555 YY_RULE_SETUP
3556 #line 180 "chuck.lex"
3557 { adjust(); return BREAK; }
3558 YY_BREAK
3559 case 47:
3560 YY_RULE_SETUP
3561 #line 181 "chuck.lex"
3562 { adjust(); return IF; }
3563 YY_BREAK
3564 case 48:
3565 YY_RULE_SETUP
3566 #line 182 "chuck.lex"
3567 { adjust(); return ELSE; }
3568 YY_BREAK
3569 case 49:
3570 YY_RULE_SETUP
3571 #line 183 "chuck.lex"
3572 { adjust(); return THEN; }
3573 YY_BREAK
3574 case 50:
3575 YY_RULE_SETUP
3576 #line 185 "chuck.lex"
3577 { adjust(); return NULL_TOK; }
3578 YY_BREAK
3579 case 51:
3580 YY_RULE_SETUP
3581 #line 186 "chuck.lex"
3582 { adjust(); return NULL_TOK; }
3583 YY_BREAK
3584 case 52:
3585 YY_RULE_SETUP
3586 #line 187 "chuck.lex"
3587 { adjust(); return RETURN; }
3588 YY_BREAK
3589 case 53:
3590 YY_RULE_SETUP
3591 #line 189 "chuck.lex"
3592 { adjust(); return UNTIL; }
3593 YY_BREAK
3594 case 54:
3595 YY_RULE_SETUP
3596 #line 190 "chuck.lex"
3597 { adjust(); return BEFORE; }
3598 YY_BREAK
3599 case 55:
3600 YY_RULE_SETUP
3601 #line 191 "chuck.lex"
3602 { adjust(); return AFTER; }
3603 YY_BREAK
3604 case 56:
3605 YY_RULE_SETUP
3606 #line 192 "chuck.lex"
3607 { adjust(); return AT; }
3608 YY_BREAK
3609 case 57:
3610 YY_RULE_SETUP
3611 #line 193 "chuck.lex"
3612 { adjust(); return FUNCTION; }
3613 YY_BREAK
3614 case 58:
3615 YY_RULE_SETUP
3616 #line 194 "chuck.lex"
3617 { adjust(); return FUNCTION; }
3618 YY_BREAK
3619 case 59:
3620 YY_RULE_SETUP
3621 #line 195 "chuck.lex"
3622 { adjust(); return NEW; }
3623 YY_BREAK
3624 case 60:
3625 YY_RULE_SETUP
3626 #line 196 "chuck.lex"
3627 { adjust(); return CLASS; }
3628 YY_BREAK
3629 case 61:
3630 YY_RULE_SETUP
3631 #line 197 "chuck.lex"
3632 { adjust(); return EXTENDS; }
3633 YY_BREAK
3634 case 62:
3635 YY_RULE_SETUP
3636 #line 198 "chuck.lex"
3637 { adjust(); return IMPLEMENTS; }
3638 YY_BREAK
3639 case 63:
3640 YY_RULE_SETUP
3641 #line 199 "chuck.lex"
3642 { adjust(); return PUBLIC; }
3643 YY_BREAK
3644 case 64:
3645 YY_RULE_SETUP
3646 #line 200 "chuck.lex"
3647 { adjust(); return PROTECTED; }
3648 YY_BREAK
3649 case 65:
3650 YY_RULE_SETUP
3651 #line 201 "chuck.lex"
3652 { adjust(); return PRIVATE; }
3653 YY_BREAK
3654 case 66:
3655 YY_RULE_SETUP
3656 #line 202 "chuck.lex"
3657 { adjust(); return STATIC; }
3658 YY_BREAK
3659 case 67:
3660 YY_RULE_SETUP
3661 #line 203 "chuck.lex"
3662 { adjust(); return CONST; }
3663 YY_BREAK
3664 case 68:
3665 YY_RULE_SETUP
3666 #line 204 "chuck.lex"
3667 { adjust(); return SPORK; }
3668 YY_BREAK
3669 case 69:
3670 YY_RULE_SETUP
3671 #line 206 "chuck.lex"
3672 { adjust(); return CHUCK; }
3673 YY_BREAK
3674 case 70:
3675 YY_RULE_SETUP
3676 #line 207 "chuck.lex"
3677 { adjust(); return UNCHUCK; }
3678 YY_BREAK
3679 case 71:
3680 YY_RULE_SETUP
3681 #line 208 "chuck.lex"
3682 { adjust(); return UNCHUCK; }
3683 YY_BREAK
3684 case 72:
3685 YY_RULE_SETUP
3686 #line 209 "chuck.lex"
3687 { adjust(); return S_CHUCK; }
3688 YY_BREAK
3689 case 73:
3690 YY_RULE_SETUP
3691 #line 210 "chuck.lex"
3692 { adjust(); return LEFT_S_CHUCK; }
3693 YY_BREAK
3694 case 74:
3695 YY_RULE_SETUP
3696 #line 211 "chuck.lex"
3697 { adjust(); return PLUS_CHUCK; }
3698 YY_BREAK
3699 case 75:
3700 YY_RULE_SETUP
3701 #line 212 "chuck.lex"
3702 { adjust(); return MINUS_CHUCK; }
3703 YY_BREAK
3704 case 76:
3705 YY_RULE_SETUP
3706 #line 213 "chuck.lex"
3707 { adjust(); return TIMES_CHUCK; }
3708 YY_BREAK
3709 case 77:
3710 YY_RULE_SETUP
3711 #line 214 "chuck.lex"
3712 { adjust(); return DIVIDE_CHUCK; }
3713 YY_BREAK
3714 case 78:
3715 YY_RULE_SETUP
3716 #line 215 "chuck.lex"
3717 { adjust(); return S_AND_CHUCK; }
3718 YY_BREAK
3719 case 79:
3720 YY_RULE_SETUP
3721 #line 216 "chuck.lex"
3722 { adjust(); return S_OR_CHUCK; }
3723 YY_BREAK
3724 case 80:
3725 YY_RULE_SETUP
3726 #line 217 "chuck.lex"
3727 { adjust(); return S_XOR_CHUCK; }
3728 YY_BREAK
3729 case 81:
3730 YY_RULE_SETUP
3731 #line 218 "chuck.lex"
3732 { adjust(); return SHIFT_RIGHT_CHUCK; }
3733 YY_BREAK
3734 case 82:
3735 YY_RULE_SETUP
3736 #line 219 "chuck.lex"
3737 { adjust(); return SHIFT_LEFT_CHUCK; }
3738 YY_BREAK
3739 case 83:
3740 YY_RULE_SETUP
3741 #line 220 "chuck.lex"
3742 { adjust(); return PERCENT_CHUCK; }
3743 YY_BREAK
3744 case 84:
3745 YY_RULE_SETUP
3746 #line 221 "chuck.lex"
3747 { adjust(); return AT_CHUCK; }
3748 YY_BREAK
3749 case 85:
3750 YY_RULE_SETUP
3751 #line 222 "chuck.lex"
3752 { adjust(); return PLUS_CHUCK; }
3753 YY_BREAK
3754 case 86:
3755 YY_RULE_SETUP
3756 #line 223 "chuck.lex"
3757 { adjust(); return MINUS_CHUCK; }
3758 YY_BREAK
3759 case 87:
3760 YY_RULE_SETUP
3761 #line 224 "chuck.lex"
3762 { adjust(); return TIMES_CHUCK; }
3763 YY_BREAK
3764 case 88:
3765 YY_RULE_SETUP
3766 #line 225 "chuck.lex"
3767 { adjust(); return DIVIDE_CHUCK; }
3768 YY_BREAK
3769 case 89:
3770 YY_RULE_SETUP
3771 #line 226 "chuck.lex"
3772 { adjust(); return S_AND_CHUCK; }
3773 YY_BREAK
3774 case 90:
3775 YY_RULE_SETUP
3776 #line 227 "chuck.lex"
3777 { adjust(); return S_OR_CHUCK; }
3778 YY_BREAK
3779 case 91:
3780 YY_RULE_SETUP
3781 #line 228 "chuck.lex"
3782 { adjust(); return S_XOR_CHUCK; }
3783 YY_BREAK
3784 case 92:
3785 YY_RULE_SETUP
3786 #line 229 "chuck.lex"
3787 { adjust(); return SHIFT_RIGHT_CHUCK; }
3788 YY_BREAK
3789 case 93:
3790 YY_RULE_SETUP
3791 #line 230 "chuck.lex"
3792 { adjust(); return SHIFT_LEFT_CHUCK; }
3793 YY_BREAK
3794 case 94:
3795 YY_RULE_SETUP
3796 #line 231 "chuck.lex"
3797 { adjust(); return PERCENT_CHUCK; }
3798 YY_BREAK
3799 case 95:
3800 YY_RULE_SETUP
3801 #line 232 "chuck.lex"
3802 { adjust(); return AT_SYM; }
3803 YY_BREAK
3804 case 96:
3805 YY_RULE_SETUP
3806 #line 233 "chuck.lex"
3807 { adjust(); return ATAT_SYM; }
3808 YY_BREAK
3809 case 97:
3810 YY_RULE_SETUP
3811 #line 235 "chuck.lex"
3812 { adjust(); yylval.ival=htol(yytext); return NUM; }
3813 YY_BREAK
3814 case 98:
3815 YY_RULE_SETUP
3816 #line 236 "chuck.lex"
3817 { adjust(); yylval.ival=atoi(yytext); return NUM; }
3818 YY_BREAK
3819 case 99:
3820 YY_RULE_SETUP
3821 #line 237 "chuck.lex"
3822 { adjust(); yylval.ival=atoi(yytext); return NUM; }
3823 YY_BREAK
3824 case 100:
3825 YY_RULE_SETUP
3826 #line 238 "chuck.lex"
3827 { adjust(); yylval.fval=atof(yytext); return FLOAT; }
3828 YY_BREAK
3829 case 101:
3830 YY_RULE_SETUP
3831 #line 239 "chuck.lex"
3832 { adjust(); yylval.sval=alloc_str(yytext); return ID; }
3833 YY_BREAK
3834 case 102:
3835 YY_RULE_SETUP
3836 #line 240 "chuck.lex"
3837 { adjust(); yylval.sval=alloc_str(strip_lit(yytext)); return STRING_LIT; }
3838 YY_BREAK
3839 case 103:
3840 YY_RULE_SETUP
3841 #line 242 "chuck.lex"
3842 { adjust(); EM_error( EM_tokPos, "illegal token" ); }
3843 YY_BREAK
3844 case 104:
3845 YY_RULE_SETUP
3846 #line 244 "chuck.lex"
3847 ECHO;
3848 YY_BREAK
3849 #line 1413 "chuck.yy.c"
3850 case YY_STATE_EOF(INITIAL):
3851 yyterminate();
3853 case YY_END_OF_BUFFER:
3855 /* Amount of text matched not including the EOB char. */
3856 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
3858 /* Undo the effects of YY_DO_BEFORE_ACTION. */
3859 *yy_cp = yy_hold_char;
3860 YY_RESTORE_YY_MORE_OFFSET
3862 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
3864 /* We're scanning a new file or input source. It's
3865 * possible that this happened because the user
3866 * just pointed yyin at a new source and called
3867 * yylex(). If so, then we have to assure
3868 * consistency between yy_current_buffer and our
3869 * globals. Here is the right place to do so, because
3870 * this is the first action (other than possibly a
3871 * back-up) that will match for the new input source.
3873 yy_n_chars = yy_current_buffer->yy_n_chars;
3874 yy_current_buffer->yy_input_file = yyin;
3875 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
3878 /* Note that here we test for yy_c_buf_p "<=" to the position
3879 * of the first EOB in the buffer, since yy_c_buf_p will
3880 * already have been incremented past the NUL character
3881 * (since all states make transitions on EOB to the
3882 * end-of-buffer state). Contrast this with the test
3883 * in input().
3885 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
3886 { /* This was really a NUL. */
3887 yy_state_type yy_next_state;
3889 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
3891 yy_current_state = yy_get_previous_state();
3893 /* Okay, we're now positioned to make the NUL
3894 * transition. We couldn't have
3895 * yy_get_previous_state() go ahead and do it
3896 * for us because it doesn't know how to deal
3897 * with the possibility of jamming (and we don't
3898 * want to build jamming into it because then it
3899 * will run more slowly).
3902 yy_next_state = yy_try_NUL_trans( yy_current_state );
3904 yy_bp = yytext_ptr + YY_MORE_ADJ;
3906 if ( yy_next_state )
3908 /* Consume the NUL. */
3909 yy_cp = ++yy_c_buf_p;
3910 yy_current_state = yy_next_state;
3911 goto yy_match;
3914 else
3916 yy_cp = yy_c_buf_p;
3917 goto yy_find_action;
3921 else switch ( yy_get_next_buffer() )
3923 case EOB_ACT_END_OF_FILE:
3925 yy_did_buffer_switch_on_eof = 0;
3927 if ( yywrap() )
3929 /* Note: because we've taken care in
3930 * yy_get_next_buffer() to have set up
3931 * yytext, we can now set up
3932 * yy_c_buf_p so that if some total
3933 * hoser (like flex itself) wants to
3934 * call the scanner after we return the
3935 * YY_NULL, it'll still work - another
3936 * YY_NULL will get returned.
3938 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
3940 yy_act = YY_STATE_EOF(YY_START);
3941 goto do_action;
3944 else
3946 if ( ! yy_did_buffer_switch_on_eof )
3947 YY_NEW_FILE;
3949 break;
3952 case EOB_ACT_CONTINUE_SCAN:
3953 yy_c_buf_p =
3954 yytext_ptr + yy_amount_of_matched_text;
3956 yy_current_state = yy_get_previous_state();
3958 yy_cp = yy_c_buf_p;
3959 yy_bp = yytext_ptr + YY_MORE_ADJ;
3960 goto yy_match;
3962 case EOB_ACT_LAST_MATCH:
3963 yy_c_buf_p =
3964 &yy_current_buffer->yy_ch_buf[yy_n_chars];
3966 yy_current_state = yy_get_previous_state();
3968 yy_cp = yy_c_buf_p;
3969 yy_bp = yytext_ptr + YY_MORE_ADJ;
3970 goto yy_find_action;
3972 break;
3975 default:
3976 YY_FATAL_ERROR(
3977 "fatal flex scanner internal error--no action found" );
3978 } /* end of action switch */
3979 } /* end of scanning one token */
3980 } /* end of yylex */
3983 /* yy_get_next_buffer - try to read in a new buffer
3985 * Returns a code representing an action:
3986 * EOB_ACT_LAST_MATCH -
3987 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
3988 * EOB_ACT_END_OF_FILE - end of file
3991 static int yy_get_next_buffer()
3993 register char *dest = yy_current_buffer->yy_ch_buf;
3994 register char *source = yytext_ptr;
3995 register int number_to_move, i;
3996 int ret_val;
3998 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
3999 YY_FATAL_ERROR(
4000 "fatal flex scanner internal error--end of buffer missed" );
4002 if ( yy_current_buffer->yy_fill_buffer == 0 )
4003 { /* Don't try to fill the buffer, so this is an EOF. */
4004 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
4006 /* We matched a single character, the EOB, so
4007 * treat this as a final EOF.
4009 return EOB_ACT_END_OF_FILE;
4012 else
4014 /* We matched some text prior to the EOB, first
4015 * process it.
4017 return EOB_ACT_LAST_MATCH;
4021 /* Try to read more data. */
4023 /* First move last chars to start of buffer. */
4024 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
4026 for ( i = 0; i < number_to_move; ++i )
4027 *(dest++) = *(source++);
4029 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
4030 /* don't do the read, it's not guaranteed to return an EOF,
4031 * just force an EOF
4033 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
4035 else
4037 int num_to_read =
4038 yy_current_buffer->yy_buf_size - number_to_move - 1;
4040 while ( num_to_read <= 0 )
4041 { /* Not enough room in the buffer - grow it. */
4042 #ifdef YY_USES_REJECT
4043 YY_FATAL_ERROR(
4044 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
4045 #else
4047 /* just a shorter name for the current buffer */
4048 YY_BUFFER_STATE b = yy_current_buffer;
4050 int yy_c_buf_p_offset =
4051 (int) (yy_c_buf_p - b->yy_ch_buf);
4053 if ( b->yy_is_our_buffer )
4055 int new_size = b->yy_buf_size * 2;
4057 if ( new_size <= 0 )
4058 b->yy_buf_size += b->yy_buf_size / 8;
4059 else
4060 b->yy_buf_size *= 2;
4062 b->yy_ch_buf = (char *)
4063 /* Include room in for 2 EOB chars. */
4064 yy_flex_realloc( (void *) b->yy_ch_buf,
4065 b->yy_buf_size + 2 );
4067 else
4068 /* Can't grow it, we don't own it. */
4069 b->yy_ch_buf = 0;
4071 if ( ! b->yy_ch_buf )
4072 YY_FATAL_ERROR(
4073 "fatal error - scanner input buffer overflow" );
4075 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
4077 num_to_read = yy_current_buffer->yy_buf_size -
4078 number_to_move - 1;
4079 #endif
4082 if ( num_to_read > YY_READ_BUF_SIZE )
4083 num_to_read = YY_READ_BUF_SIZE;
4085 /* Read in more data. */
4086 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
4087 yy_n_chars, num_to_read );
4089 yy_current_buffer->yy_n_chars = yy_n_chars;
4092 if ( yy_n_chars == 0 )
4094 if ( number_to_move == YY_MORE_ADJ )
4096 ret_val = EOB_ACT_END_OF_FILE;
4097 yyrestart( yyin );
4100 else
4102 ret_val = EOB_ACT_LAST_MATCH;
4103 yy_current_buffer->yy_buffer_status =
4104 YY_BUFFER_EOF_PENDING;
4108 else
4109 ret_val = EOB_ACT_CONTINUE_SCAN;
4111 yy_n_chars += number_to_move;
4112 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
4113 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
4115 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
4117 return ret_val;
4121 /* yy_get_previous_state - get the state just before the EOB char was reached */
4123 static yy_state_type yy_get_previous_state()
4125 register yy_state_type yy_current_state;
4126 register char *yy_cp;
4128 yy_current_state = yy_start;
4130 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
4132 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
4133 if ( yy_accept[yy_current_state] )
4135 yy_last_accepting_state = yy_current_state;
4136 yy_last_accepting_cpos = yy_cp;
4138 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
4140 yy_current_state = (int) yy_def[yy_current_state];
4141 if ( yy_current_state >= 232 )
4142 yy_c = yy_meta[(unsigned int) yy_c];
4144 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
4147 return yy_current_state;
4151 /* yy_try_NUL_trans - try to make a transition on the NUL character
4153 * synopsis
4154 * next_state = yy_try_NUL_trans( current_state );
4157 #ifdef YY_USE_PROTOS
4158 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
4159 #else
4160 static yy_state_type yy_try_NUL_trans( yy_current_state )
4161 yy_state_type yy_current_state;
4162 #endif
4164 register int yy_is_jam;
4165 register char *yy_cp = yy_c_buf_p;
4167 register YY_CHAR yy_c = 1;
4168 if ( yy_accept[yy_current_state] )
4170 yy_last_accepting_state = yy_current_state;
4171 yy_last_accepting_cpos = yy_cp;
4173 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
4175 yy_current_state = (int) yy_def[yy_current_state];
4176 if ( yy_current_state >= 232 )
4177 yy_c = yy_meta[(unsigned int) yy_c];
4179 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
4180 yy_is_jam = (yy_current_state == 231);
4182 return yy_is_jam ? 0 : yy_current_state;
4186 #ifndef YY_NO_UNPUT
4187 #ifdef YY_USE_PROTOS
4188 static void yyunput( int c, register char *yy_bp )
4189 #else
4190 static void yyunput( c, yy_bp )
4191 int c;
4192 register char *yy_bp;
4193 #endif
4195 register char *yy_cp = yy_c_buf_p;
4197 /* undo effects of setting up yytext */
4198 *yy_cp = yy_hold_char;
4200 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
4201 { /* need to shift things up to make room */
4202 /* +2 for EOB chars. */
4203 register int number_to_move = yy_n_chars + 2;
4204 register char *dest = &yy_current_buffer->yy_ch_buf[
4205 yy_current_buffer->yy_buf_size + 2];
4206 register char *source =
4207 &yy_current_buffer->yy_ch_buf[number_to_move];
4209 while ( source > yy_current_buffer->yy_ch_buf )
4210 *--dest = *--source;
4212 yy_cp += (int) (dest - source);
4213 yy_bp += (int) (dest - source);
4214 yy_current_buffer->yy_n_chars =
4215 yy_n_chars = yy_current_buffer->yy_buf_size;
4217 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
4218 YY_FATAL_ERROR( "flex scanner push-back overflow" );
4221 *--yy_cp = (char) c;
4224 yytext_ptr = yy_bp;
4225 yy_hold_char = *yy_cp;
4226 yy_c_buf_p = yy_cp;
4228 #endif /* ifndef YY_NO_UNPUT */
4231 #ifdef __cplusplus
4232 static int yyinput()
4233 #else
4234 static int input()
4235 #endif
4237 int c;
4239 *yy_c_buf_p = yy_hold_char;
4241 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
4243 /* yy_c_buf_p now points to the character we want to return.
4244 * If this occurs *before* the EOB characters, then it's a
4245 * valid NUL; if not, then we've hit the end of the buffer.
4247 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
4248 /* This was really a NUL. */
4249 *yy_c_buf_p = '\0';
4251 else
4252 { /* need more input */
4253 int offset = yy_c_buf_p - yytext_ptr;
4254 ++yy_c_buf_p;
4256 switch ( yy_get_next_buffer() )
4258 case EOB_ACT_LAST_MATCH:
4259 /* This happens because yy_g_n_b()
4260 * sees that we've accumulated a
4261 * token and flags that we need to
4262 * try matching the token before
4263 * proceeding. But for input(),
4264 * there's no matching to consider.
4265 * So convert the EOB_ACT_LAST_MATCH
4266 * to EOB_ACT_END_OF_FILE.
4269 /* Reset buffer status. */
4270 yyrestart( yyin );
4272 /* fall through */
4274 case EOB_ACT_END_OF_FILE:
4276 if ( yywrap() )
4277 return EOF;
4279 if ( ! yy_did_buffer_switch_on_eof )
4280 YY_NEW_FILE;
4281 #ifdef __cplusplus
4282 return yyinput();
4283 #else
4284 return input();
4285 #endif
4288 case EOB_ACT_CONTINUE_SCAN:
4289 yy_c_buf_p = yytext_ptr + offset;
4290 break;
4295 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
4296 *yy_c_buf_p = '\0'; /* preserve yytext */
4297 yy_hold_char = *++yy_c_buf_p;
4300 return c;
4304 #ifdef YY_USE_PROTOS
4305 void yyrestart( FILE *input_file )
4306 #else
4307 void yyrestart( input_file )
4308 FILE *input_file;
4309 #endif
4311 if ( ! yy_current_buffer )
4312 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
4314 yy_init_buffer( yy_current_buffer, input_file );
4315 yy_load_buffer_state();
4319 #ifdef YY_USE_PROTOS
4320 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
4321 #else
4322 void yy_switch_to_buffer( new_buffer )
4323 YY_BUFFER_STATE new_buffer;
4324 #endif
4326 if ( yy_current_buffer == new_buffer )
4327 return;
4329 if ( yy_current_buffer )
4331 /* Flush out information for old buffer. */
4332 *yy_c_buf_p = yy_hold_char;
4333 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
4334 yy_current_buffer->yy_n_chars = yy_n_chars;
4337 yy_current_buffer = new_buffer;
4338 yy_load_buffer_state();
4340 /* We don't actually know whether we did this switch during
4341 * EOF (yywrap()) processing, but the only time this flag
4342 * is looked at is after yywrap() is called, so it's safe
4343 * to go ahead and always set it.
4345 yy_did_buffer_switch_on_eof = 1;
4349 #ifdef YY_USE_PROTOS
4350 void yy_load_buffer_state( void )
4351 #else
4352 void yy_load_buffer_state()
4353 #endif
4355 yy_n_chars = yy_current_buffer->yy_n_chars;
4356 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
4357 yyin = yy_current_buffer->yy_input_file;
4358 yy_hold_char = *yy_c_buf_p;
4362 #ifdef YY_USE_PROTOS
4363 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
4364 #else
4365 YY_BUFFER_STATE yy_create_buffer( file, size )
4366 FILE *file;
4367 int size;
4368 #endif
4370 YY_BUFFER_STATE b;
4372 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
4373 if ( ! b )
4374 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
4376 b->yy_buf_size = size;
4378 /* yy_ch_buf has to be 2 characters longer than the size given because
4379 * we need to put in 2 end-of-buffer characters.
4381 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
4382 if ( ! b->yy_ch_buf )
4383 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
4385 b->yy_is_our_buffer = 1;
4387 yy_init_buffer( b, file );
4389 return b;
4393 #ifdef YY_USE_PROTOS
4394 void yy_delete_buffer( YY_BUFFER_STATE b )
4395 #else
4396 void yy_delete_buffer( b )
4397 YY_BUFFER_STATE b;
4398 #endif
4400 if ( ! b )
4401 return;
4403 if ( b == yy_current_buffer )
4404 yy_current_buffer = (YY_BUFFER_STATE) 0;
4406 if ( b->yy_is_our_buffer )
4407 yy_flex_free( (void *) b->yy_ch_buf );
4409 yy_flex_free( (void *) b );
4413 #ifndef _WIN32
4414 #include <unistd.h>
4415 #else
4416 #ifndef YY_ALWAYS_INTERACTIVE
4417 #ifndef YY_NEVER_INTERACTIVE
4418 extern int isatty YY_PROTO(( int ));
4419 #endif
4420 #endif
4421 #endif
4423 #ifdef YY_USE_PROTOS
4424 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
4425 #else
4426 void yy_init_buffer( b, file )
4427 YY_BUFFER_STATE b;
4428 FILE *file;
4429 #endif
4433 yy_flush_buffer( b );
4435 b->yy_input_file = file;
4436 b->yy_fill_buffer = 1;
4438 #if YY_ALWAYS_INTERACTIVE
4439 b->yy_is_interactive = 1;
4440 #else
4441 #if YY_NEVER_INTERACTIVE
4442 b->yy_is_interactive = 0;
4443 #else
4444 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
4445 #endif
4446 #endif
4450 #ifdef YY_USE_PROTOS
4451 void yy_flush_buffer( YY_BUFFER_STATE b )
4452 #else
4453 void yy_flush_buffer( b )
4454 YY_BUFFER_STATE b;
4455 #endif
4458 if ( ! b )
4459 return;
4461 b->yy_n_chars = 0;
4463 /* We always need two end-of-buffer characters. The first causes
4464 * a transition to the end-of-buffer state. The second causes
4465 * a jam in that state.
4467 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
4468 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
4470 b->yy_buf_pos = &b->yy_ch_buf[0];
4472 b->yy_at_bol = 1;
4473 b->yy_buffer_status = YY_BUFFER_NEW;
4475 if ( b == yy_current_buffer )
4476 yy_load_buffer_state();
4480 #ifndef YY_NO_SCAN_BUFFER
4481 #ifdef YY_USE_PROTOS
4482 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
4483 #else
4484 YY_BUFFER_STATE yy_scan_buffer( base, size )
4485 char *base;
4486 yy_size_t size;
4487 #endif
4489 YY_BUFFER_STATE b;
4491 if ( size < 2 ||
4492 base[size-2] != YY_END_OF_BUFFER_CHAR ||
4493 base[size-1] != YY_END_OF_BUFFER_CHAR )
4494 /* They forgot to leave room for the EOB's. */
4495 return 0;
4497 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
4498 if ( ! b )
4499 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
4501 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
4502 b->yy_buf_pos = b->yy_ch_buf = base;
4503 b->yy_is_our_buffer = 0;
4504 b->yy_input_file = 0;
4505 b->yy_n_chars = b->yy_buf_size;
4506 b->yy_is_interactive = 0;
4507 b->yy_at_bol = 1;
4508 b->yy_fill_buffer = 0;
4509 b->yy_buffer_status = YY_BUFFER_NEW;
4511 yy_switch_to_buffer( b );
4513 return b;
4515 #endif
4518 #ifndef YY_NO_SCAN_STRING
4519 #ifdef YY_USE_PROTOS
4520 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
4521 #else
4522 YY_BUFFER_STATE yy_scan_string( yy_str )
4523 yyconst char *yy_str;
4524 #endif
4526 int len;
4527 for ( len = 0; yy_str[len]; ++len )
4530 return yy_scan_bytes( yy_str, len );
4532 #endif
4535 #ifndef YY_NO_SCAN_BYTES
4536 #ifdef YY_USE_PROTOS
4537 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
4538 #else
4539 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
4540 yyconst char *bytes;
4541 int len;
4542 #endif
4544 YY_BUFFER_STATE b;
4545 char *buf;
4546 yy_size_t n;
4547 int i;
4549 /* Get memory for full buffer, including space for trailing EOB's. */
4550 n = len + 2;
4551 buf = (char *) yy_flex_alloc( n );
4552 if ( ! buf )
4553 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
4555 for ( i = 0; i < len; ++i )
4556 buf[i] = bytes[i];
4558 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
4560 b = yy_scan_buffer( buf, n );
4561 if ( ! b )
4562 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
4564 /* It's okay to grow etc. this buffer, and we should throw it
4565 * away when we're done.
4567 b->yy_is_our_buffer = 1;
4569 return b;
4571 #endif
4574 #ifndef YY_NO_PUSH_STATE
4575 #ifdef YY_USE_PROTOS
4576 static void yy_push_state( int new_state )
4577 #else
4578 static void yy_push_state( new_state )
4579 int new_state;
4580 #endif
4582 if ( yy_start_stack_ptr >= yy_start_stack_depth )
4584 yy_size_t new_size;
4586 yy_start_stack_depth += YY_START_STACK_INCR;
4587 new_size = yy_start_stack_depth * sizeof( int );
4589 if ( ! yy_start_stack )
4590 yy_start_stack = (int *) yy_flex_alloc( new_size );
4592 else
4593 yy_start_stack = (int *) yy_flex_realloc(
4594 (void *) yy_start_stack, new_size );
4596 if ( ! yy_start_stack )
4597 YY_FATAL_ERROR(
4598 "out of memory expanding start-condition stack" );
4601 yy_start_stack[yy_start_stack_ptr++] = YY_START;
4603 BEGIN(new_state);
4605 #endif
4608 #ifndef YY_NO_POP_STATE
4609 static void yy_pop_state()
4611 if ( --yy_start_stack_ptr < 0 )
4612 YY_FATAL_ERROR( "start-condition stack underflow" );
4614 BEGIN(yy_start_stack[yy_start_stack_ptr]);
4616 #endif
4619 #ifndef YY_NO_TOP_STATE
4620 static int yy_top_state()
4622 return yy_start_stack[yy_start_stack_ptr - 1];
4624 #endif
4626 #ifndef YY_EXIT_FAILURE
4627 #define YY_EXIT_FAILURE 2
4628 #endif
4630 #ifdef YY_USE_PROTOS
4631 static void yy_fatal_error( yyconst char msg[] )
4632 #else
4633 static void yy_fatal_error( msg )
4634 char msg[];
4635 #endif
4637 (void) fprintf( stderr, "%s\n", msg );
4638 exit( YY_EXIT_FAILURE );
4643 /* Redefine yyless() so it works in section 3 code. */
4645 #undef yyless
4646 #define yyless(n) \
4647 do \
4649 /* Undo effects of setting up yytext. */ \
4650 yytext[yyleng] = yy_hold_char; \
4651 yy_c_buf_p = yytext + n; \
4652 yy_hold_char = *yy_c_buf_p; \
4653 *yy_c_buf_p = '\0'; \
4654 yyleng = n; \
4656 while ( 0 )
4659 /* Internal utility routines. */
4661 #ifndef yytext_ptr
4662 #ifdef YY_USE_PROTOS
4663 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
4664 #else
4665 static void yy_flex_strncpy( s1, s2, n )
4666 char *s1;
4667 yyconst char *s2;
4668 int n;
4669 #endif
4671 register int i;
4672 for ( i = 0; i < n; ++i )
4673 s1[i] = s2[i];
4675 #endif
4677 #ifdef YY_NEED_STRLEN
4678 #ifdef YY_USE_PROTOS
4679 static int yy_flex_strlen( yyconst char *s )
4680 #else
4681 static int yy_flex_strlen( s )
4682 yyconst char *s;
4683 #endif
4685 register int n;
4686 for ( n = 0; s[n]; ++n )
4689 return n;
4691 #endif
4694 #ifdef YY_USE_PROTOS
4695 static void *yy_flex_alloc( yy_size_t size )
4696 #else
4697 static void *yy_flex_alloc( size )
4698 yy_size_t size;
4699 #endif
4701 return (void *) malloc( size );
4704 #ifdef YY_USE_PROTOS
4705 static void *yy_flex_realloc( void *ptr, yy_size_t size )
4706 #else
4707 static void *yy_flex_realloc( ptr, size )
4708 void *ptr;
4709 yy_size_t size;
4710 #endif
4712 /* The cast to (char *) in the following accommodates both
4713 * implementations that use char* generic pointers, and those
4714 * that use void* generic pointers. It works with the latter
4715 * because both ANSI C and C++ allow castless assignment from
4716 * any pointer type to void*, and deal with argument conversions
4717 * as though doing an assignment.
4719 return (void *) realloc( (char *) ptr, size );
4722 #ifdef YY_USE_PROTOS
4723 static void yy_flex_free( void *ptr )
4724 #else
4725 static void yy_flex_free( ptr )
4726 void *ptr;
4727 #endif
4729 free( ptr );
4732 #if YY_MAIN
4733 int main()
4735 yylex();
4736 return 0;
4738 #endif
4739 #line 244 "chuck.lex"
4742 // comment
4743 int comment()
4745 char c;
4747 while ((c = input()) != '\n' && c != '\r' && c != 0);
4749 if (c != 0) { adjust(); EM_newline(); }
4751 return 0;