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)
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. */
40 #define YYSKELETON_NAME "yacc.c"
45 /* Using locations. */
46 #define YYLSP_NEEDED 0
53 /* Put the tokens into the symbol table, so that GDB and other debuggers
125 SHIFT_RIGHT_CHUCK
= 327,
126 SHIFT_LEFT_CHUCK
= 328,
151 #define STRING_LIT 259
157 #define SEMICOLON 265
190 #define EXCLAMATION 298
195 #define MINUSMINUS 303
199 #define TRANSPORT 307
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
226 #define COLONCOLON 334
229 #define LEFT_S_CHUCK 337
233 #define IMPLEMENTS 341
235 #define PROTECTED 343
246 /* Copy the first part of user declarations. */
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
272 -----------------------------------------------------------------------------*/
274 //-----------------------------------------------------------------------------
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
284 //-----------------------------------------------------------------------------
288 #include "chuck_utils.h"
289 #include "chuck_errmsg.h"
290 #include "chuck_absyn.h"
295 void yyerror( char *s
)
297 EM_error( EM_tokPos
, "%s", s
);
300 a_Program g_program
= NULL
;
304 /* Enabling traces. */
309 /* Enabling verbose error messages. */
310 #ifdef YYERROR_VERBOSE
311 # undef YYERROR_VERBOSE
312 # define YYERROR_VERBOSE 1
314 # define YYERROR_VERBOSE 0
317 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
319 typedef union YYSTYPE
{
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
;
334 a_Var_Decl_List var_decl_list
;
336 a_Type_Decl type_decl
;
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
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
362 # ifndef YYSTACK_USE_ALLOCA
363 # if defined (alloca) || defined (_ALLOCA_H)
364 # define YYSTACK_ALLOC alloca
367 # define YYSTACK_ALLOC __builtin_alloca
373 # ifdef YYSTACK_ALLOC
374 /* Pacify GCC's `empty if-body' warning. */
375 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
377 # if defined (__STDC__) || defined (__cplusplus)
378 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
379 # define YYSIZE_T size_t
381 # define YYSTACK_ALLOC malloc
382 # define YYSTACK_FREE free
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. */
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
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
411 # define YYCOPY(To, From, Count) \
412 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
414 # define YYCOPY(To, From, Count) \
417 register YYSIZE_T yyi; \
418 for (yyi = 0; yyi < (Count); yyi++) \
419 (To)[yyi] = (From)[yyi]; \
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
430 # define YYSTACK_RELOCATE(Stack) \
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); \
443 #if defined (__STDC__) || defined (__cplusplus)
444 typedef signed char yysigned_char
;
446 typedef short yysigned_char
;
449 /* YYFINAL -- State number of the termination state. */
451 /* YYLAST -- Last index in YYTABLE. */
454 /* YYNTOKENS -- Number of terminals. */
456 /* YYNNTS -- Number of nonterminals. */
458 /* YYNRULES -- Number of rules. */
460 /* YYNRULES -- Number of states. */
461 #define YYNSTATES 238
463 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
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
511 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
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,
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
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
637 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
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
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,
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,
733 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
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,
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,
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__
958 #if ! defined (YYSIZE_T) && defined (size_t)
959 # define YYSIZE_T size_t
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
967 #if ! defined (YYSIZE_T)
968 # define YYSIZE_T unsigned int
971 #define yyerrok (yyerrstatus = 0)
972 #define yyclearin (yychar = YYEMPTY)
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) \
991 if (yychar == YYEMPTY && yylen == 1) \
995 yytoken = YYTRANSLATE (yychar); \
1001 yyerror ("syntax error: cannot back up");\
1007 #define YYERRCODE 256
1009 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
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;
1020 /* YYLEX -- calling `yylex' with the right arguments. */
1023 # define YYLEX yylex (YYLEX_PARAM)
1025 # define YYLEX yylex ()
1028 /* Enable debugging if requested. */
1032 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1033 # define YYFPRINTF fprintf
1036 # define YYDPRINTF(Args) \
1042 # define YYDSYMPRINT(Args) \
1048 # define YYDSYMPRINTF(Title, Token, Value, Location) \
1052 YYFPRINTF (stderr, "%s ", Title); \
1053 yysymprint (stderr, \
1055 YYFPRINTF (stderr, "\n"); \
1059 /*------------------------------------------------------------------.
1060 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1062 `------------------------------------------------------------------*/
1064 #if defined (__STDC__) || defined (__cplusplus)
1066 yy_stack_print (short *bottom
, short *top
)
1069 yy_stack_print (bottom
, top
)
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) \
1083 yy_stack_print ((Bottom), (Top)); \
1087 /*------------------------------------------------.
1088 | Report that the YYRULE is going to be reduced. |
1089 `------------------------------------------------*/
1091 #if defined (__STDC__) || defined (__cplusplus)
1093 yy_reduce_print (int yyrule
)
1096 yy_reduce_print (yyrule
)
1101 unsigned int yylno
= yyrline
[yyrule
];
1102 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %u), ",
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) \
1113 yy_reduce_print (Rule); \
1116 /* Nonzero means print parse trace. It is left uninitialized so that
1117 multiple parsers can coexist. */
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. */
1130 # define YYINITDEPTH 200
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. */
1145 # define YYMAXDEPTH 10000
1153 # if defined (__GLIBC__) && defined (_STRING_H)
1154 # define yystrlen strlen
1156 /* Return the length of YYSTR. */
1158 # if defined (__STDC__) || defined (__cplusplus)
1159 yystrlen (const char *yystr
)
1165 register const char *yys
= yystr
;
1167 while (*yys
++ != '\0')
1170 return yys
- yystr
- 1;
1176 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
1177 # define yystpcpy stpcpy
1179 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1182 # if defined (__STDC__) || defined (__cplusplus)
1183 yystpcpy (char *yydest
, const char *yysrc
)
1185 yystpcpy (yydest
, yysrc
)
1190 register char *yyd
= yydest
;
1191 register const char *yys
= yysrc
;
1193 while ((*yyd
++ = *yys
++) != '\0')
1201 #endif /* !YYERROR_VERBOSE */
1206 /*--------------------------------.
1207 | Print this symbol on YYOUTPUT. |
1208 `--------------------------------*/
1210 #if defined (__STDC__) || defined (__cplusplus)
1212 yysymprint (FILE *yyoutput
, int yytype
, YYSTYPE
*yyvaluep
)
1215 yysymprint (yyoutput
, yytype
, yyvaluep
)
1221 /* Pacify ``unused variable'' warnings. */
1224 if (yytype
< YYNTOKENS
)
1226 YYFPRINTF (yyoutput
, "token %s (", yytname
[yytype
]);
1228 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
1232 YYFPRINTF (yyoutput
, "nterm %s (", yytname
[yytype
]);
1239 YYFPRINTF (yyoutput
, ")");
1242 #endif /* ! YYDEBUG */
1243 /*-----------------------------------------------.
1244 | Release the memory associated to this symbol. |
1245 `-----------------------------------------------*/
1247 #if defined (__STDC__) || defined (__cplusplus)
1249 yydestruct (int yytype
, YYSTYPE
*yyvaluep
)
1252 yydestruct (yytype
, yyvaluep
)
1257 /* Pacify ``unused variable'' warnings. */
1269 /* Prevent warnings from -Wmissing-prototypes. */
1271 #ifdef YYPARSE_PARAM
1272 # if defined (__STDC__) || defined (__cplusplus)
1273 int yyparse (void *YYPARSE_PARAM
);
1277 #else /* ! YYPARSE_PARAM */
1278 #if defined (__STDC__) || defined (__cplusplus)
1283 #endif /* ! YYPARSE_PARAM */
1287 /* The lookahead symbol. */
1290 /* The semantic value of the lookahead symbol. */
1293 /* Number of syntax errors so far. */
1302 #ifdef YYPARSE_PARAM
1303 # if defined (__STDC__) || defined (__cplusplus)
1304 int yyparse (void *YYPARSE_PARAM
)
1306 int yyparse (YYPARSE_PARAM
)
1307 void *YYPARSE_PARAM
;
1309 #else /* ! YYPARSE_PARAM */
1310 #if defined (__STDC__) || defined (__cplusplus)
1321 register int yystate
;
1324 /* Number of tokens to shift before error messages enabled. */
1326 /* Lookahead token as an internal (translated) token number. */
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
1358 /* When reducing, the number of symbols on the RHS of the reduced
1362 YYDPRINTF ((stderr
, "Starting parse\n"));
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. */
1379 /*------------------------------------------------------------.
1380 | yynewstate -- Push a new state, which is found in yystate. |
1381 `------------------------------------------------------------*/
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.
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;
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
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
),
1418 #else /* no yyoverflow */
1419 # ifndef YYSTACK_RELOCATE
1422 /* Extend the stack our own way. */
1423 if (YYMAXDEPTH
<= yystacksize
)
1426 if (YYMAXDEPTH
< yystacksize
)
1427 yystacksize
= YYMAXDEPTH
;
1430 short *yyss1
= yyss
;
1431 union yyalloc
*yyptr
=
1432 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1435 YYSTACK_RELOCATE (yyss
);
1436 YYSTACK_RELOCATE (yyvs
);
1438 # undef YYSTACK_RELOCATE
1440 YYSTACK_FREE (yyss1
);
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
)
1456 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1465 /* Do appropriate processing given the current state. */
1466 /* Read a lookahead token if we need one and don't already have one. */
1469 /* First try to decide what to do without reference to lookahead token. */
1471 yyn
= yypact
[yystate
];
1472 if (yyn
== YYPACT_NINF
)
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: "));
1484 if (yychar
<= YYEOF
)
1486 yychar
= yytoken
= YYEOF
;
1487 YYDPRINTF ((stderr
, "Now at end of input.\n"));
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. */
1498 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1503 if (yyn
== 0 || yyn
== YYTABLE_NINF
)
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
)
1522 /* Count tokens shifted since error; after three, turn off error
1531 /*-----------------------------------------------------------.
1532 | yydefault -- do the default action for the current state. |
1533 `-----------------------------------------------------------*/
1535 yyn
= yydefact
[yystate
];
1541 /*-----------------------------.
1542 | yyreduce -- Do a reduction. |
1543 `-----------------------------*/
1545 /* yyn is the number of a rule to reduce with. */
1548 /* If YYLEN is nonzero, implement the default value of the action:
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
);
1564 { yyval
.program
= g_program
= new_program( yyvsp
[0].program_section
, EM_lineNum
); ;}
1569 { yyval
.program
= g_program
= prepend_program( yyvsp
[-1].program_section
, yyvsp
[0].program
, EM_lineNum
); ;}
1574 { yyval
.program_section
= new_section_stmt( yyvsp
[0].stmt_list
, EM_lineNum
); ;}
1579 { yyval
.program_section
= new_section_func_def( yyvsp
[0].func_def
, EM_lineNum
); ;}
1584 { yyval
.program_section
= new_section_class_def( yyvsp
[0].class_def
, EM_lineNum
); ;}
1589 { yyval
.class_def
= new_class_def( yyvsp
[-3].sval
, NULL
, yyvsp
[-1].class_body
, EM_lineNum
); ;}
1594 { yyval
.class_def
= new_class_def( yyvsp
[-4].sval
, yyvsp
[-3].class_ext
, yyvsp
[-1].class_body
, EM_lineNum
); ;}
1599 { yyval
.class_ext
= new_class_ext( NULL
, yyvsp
[0].id_list
, EM_lineNum
); ;}
1604 { yyval
.class_ext
= new_class_ext( yyvsp
[0].sval
, yyvsp
[-2].id_list
, EM_lineNum
); ;}
1609 { yyval
.class_ext
= new_class_ext( yyvsp
[0].sval
, NULL
, EM_lineNum
); ;}
1614 { yyval
.class_ext
= new_class_ext( yyvsp
[-2].sval
, yyvsp
[0].id_list
, EM_lineNum
); ;}
1619 { yyval
.class_body
= new_class_body( yyvsp
[0].program_section
, EM_lineNum
); ;}
1624 { yyval
.class_body
= prepend_class_body( yyvsp
[-1].program_section
, yyvsp
[0].class_body
, EM_lineNum
); ;}
1629 { yyval
.program_section
= new_section_stmt( yyvsp
[0].stmt_list
, EM_lineNum
); ;}
1634 { yyval
.program_section
= new_section_func_def( yyvsp
[0].func_def
, EM_lineNum
); ;}
1639 { yyval
.id_list
= new_id_list( yyvsp
[0].sval
, EM_lineNum
); ;}
1644 { yyval
.id_list
= prepend_id_list( yyvsp
[-2].sval
, yyvsp
[0].id_list
, EM_lineNum
); ;}
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
); ;}
1654 { yyval
.func_def
= new_func_def( yyvsp
[-5].ival
, yyvsp
[-4].type_decl
, yyvsp
[-3].sval
, NULL
, yyvsp
[0].stmt
, EM_lineNum
); ;}
1659 { yyval
.ival
= ae_func_func
; ;}
1664 { yyval
.ival
= ae_func_public
; ;}
1669 { yyval
.ival
= ae_func_protected
; ;}
1674 { yyval
.ival
= ae_func_private
; ;}
1679 { yyval
.type_decl
= new_type_decl( yyvsp
[0].sval
, EM_lineNum
); ;}
1684 { yyval
.type_decl
= new_type_decl_array( yyvsp
[-2].type_decl
, EM_lineNum
); ;}
1689 { yyval
.arg_list
= new_arg_list( yyvsp
[-1].type_decl
, yyvsp
[0].sval
, EM_lineNum
); ;}
1694 { yyval
.arg_list
= prepend_arg_list( yyvsp
[-3].type_decl
, yyvsp
[-2].sval
, yyvsp
[0].arg_list
, EM_lineNum
); ;}
1699 { yyval
.stmt_list
= new_stmt_list( yyvsp
[0].stmt
, EM_lineNum
); ;}
1704 { yyval
.stmt_list
= prepend_stmt_list( yyvsp
[-1].stmt
, yyvsp
[0].stmt_list
, EM_lineNum
); ;}
1709 { yyval
.stmt
= yyvsp
[0].stmt
; ;}
1714 { yyval
.stmt
= yyvsp
[0].stmt
; ;}
1719 { yyval
.stmt
= yyvsp
[0].stmt
; ;}
1724 { yyval
.stmt
= yyvsp
[0].stmt
; ;}
1729 { yyval
.stmt
= yyvsp
[0].stmt
; ;}
1734 { yyval
.stmt
= new_stmt_from_return( NULL
, EM_lineNum
); ;}
1739 { yyval
.stmt
= new_stmt_from_return( yyvsp
[-1].exp
, EM_lineNum
); ;}
1744 { yyval
.stmt
= new_stmt_from_if( yyvsp
[-2].exp
, yyvsp
[0].stmt
, NULL
, EM_lineNum
); ;}
1749 { yyval
.stmt
= new_stmt_from_if( yyvsp
[-4].exp
, yyvsp
[-2].stmt
, yyvsp
[0].stmt
, EM_lineNum
); ;}
1754 { yyval
.stmt
= new_stmt_from_while( yyvsp
[-2].exp
, yyvsp
[0].stmt
, EM_lineNum
); ;}
1759 { yyval
.stmt
= new_stmt_from_do_while( yyvsp
[-2].exp
, yyvsp
[-5].stmt
, EM_lineNum
); ;}
1764 { yyval
.stmt
= new_stmt_from_for( yyvsp
[-3].stmt
, yyvsp
[-2].stmt
, NULL
, yyvsp
[0].stmt
, EM_lineNum
); ;}
1769 { yyval
.stmt
= new_stmt_from_for( yyvsp
[-4].stmt
, yyvsp
[-3].stmt
, yyvsp
[-2].exp
, yyvsp
[0].stmt
, EM_lineNum
); ;}
1774 { yyval
.stmt
= new_stmt_from_until( yyvsp
[-2].exp
, yyvsp
[0].stmt
, EM_lineNum
); ;}
1779 { yyval
.stmt
= new_stmt_from_do_until( yyvsp
[-2].exp
, yyvsp
[-5].stmt
, EM_lineNum
); ;}
1784 { yyval
.stmt
= NULL
; ;}
1789 { yyval
.stmt
= new_stmt_from_code( yyvsp
[-1].stmt_list
, EM_lineNum
); ;}
1794 { yyval
.stmt
= NULL
; ;}
1799 { yyval
.stmt
= new_stmt_from_expression( yyvsp
[-1].exp
, EM_lineNum
); ;}
1804 { yyval
.exp
= yyvsp
[0].exp
; ;}
1809 { yyval
.exp
= prepend_expression( yyvsp
[-2].exp
, yyvsp
[0].exp
, EM_lineNum
); ;}
1814 { yyval
.exp
= yyvsp
[0].exp
; ;}
1819 { yyval
.exp
= new_exp_from_binary( yyvsp
[-2].exp
, yyvsp
[-1].ival
, yyvsp
[0].exp
, EM_lineNum
); ;}
1824 { yyval
.exp
= yyvsp
[0].exp
; ;}
1829 { yyval
.exp
= new_exp_decl( yyvsp
[-1].sval
, yyvsp
[0].var_decl_list
, EM_lineNum
); ;}
1834 { yyval
.exp
= new_exp_decl( NULL
, yyvsp
[0].var_decl_list
, EM_lineNum
); ;}
1839 { yyval
.var_decl_list
= new_var_decl_list( yyvsp
[0].var_decl
, EM_lineNum
); ;}
1844 { yyval
.var_decl
= new_var_decl( yyvsp
[0].sval
, EM_lineNum
); ;}
1849 { yyval
.var_decl
= new_var_decl2( yyvsp
[-2].var_decl
, 1, NULL
, EM_lineNum
); ;}
1854 { yyval
.var_decl
= new_var_decl2( yyvsp
[-3].var_decl
, 1, yyvsp
[-1].exp
, EM_lineNum
); ;}
1859 { yyval
.ival
= ae_op_chuck
; ;}
1864 { yyval
.ival
= ae_op_s_chuck
; ;}
1869 { yyval
.ival
= ae_op_at_chuck
; ;}
1874 { yyval
.ival
= ae_op_plus_chuck
; ;}
1879 { yyval
.ival
= ae_op_minus_chuck
; ;}
1884 { yyval
.ival
= ae_op_times_chuck
; ;}
1889 { yyval
.ival
= ae_op_divide_chuck
; ;}
1894 { yyval
.ival
= ae_op_s_and_chuck
; ;}
1899 { yyval
.ival
= ae_op_s_or_chuck
; ;}
1904 { yyval
.ival
= ae_op_s_xor_chuck
; ;}
1909 { yyval
.ival
= ae_op_shift_right_chuck
; ;}
1914 { yyval
.ival
= ae_op_shift_left_chuck
; ;}
1919 { yyval
.ival
= ae_op_percent_chuck
; ;}
1924 { yyval
.ival
= ae_op_unchuck
; ;}
1929 { yyval
.exp
= yyvsp
[0].exp
; ;}
1934 { yyval
.exp
= new_exp_from_if( yyvsp
[-4].exp
, yyvsp
[-2].exp
, yyvsp
[0].exp
, EM_lineNum
); ;}
1939 { yyval
.exp
= yyvsp
[0].exp
; ;}
1944 { yyval
.exp
= new_exp_from_binary( yyvsp
[-2].exp
, ae_op_or
, yyvsp
[0].exp
, EM_lineNum
); ;}
1949 { yyval
.exp
= yyvsp
[0].exp
; ;}
1954 { yyval
.exp
= new_exp_from_binary( yyvsp
[-2].exp
, ae_op_and
, yyvsp
[0].exp
, EM_lineNum
); ;}
1959 { yyval
.exp
= yyvsp
[0].exp
; ;}
1964 { yyval
.exp
= new_exp_from_binary( yyvsp
[-2].exp
, ae_op_s_or
, yyvsp
[0].exp
, EM_lineNum
); ;}
1969 { yyval
.exp
= yyvsp
[0].exp
; ;}
1974 { yyval
.exp
= new_exp_from_binary( yyvsp
[-2].exp
, ae_op_s_xor
, yyvsp
[0].exp
, EM_lineNum
); ;}
1979 { yyval
.exp
= yyvsp
[0].exp
; ;}
1984 { yyval
.exp
= new_exp_from_binary( yyvsp
[-2].exp
, ae_op_s_and
, yyvsp
[0].exp
, EM_lineNum
); ;}
1989 { yyval
.exp
= yyvsp
[0].exp
; ;}
1994 { yyval
.exp
= new_exp_from_binary( yyvsp
[-2].exp
, ae_op_eq
, yyvsp
[0].exp
, EM_lineNum
); ;}
1999 { yyval
.exp
= new_exp_from_binary( yyvsp
[-2].exp
, ae_op_neq
, yyvsp
[0].exp
, EM_lineNum
); ;}
2004 { yyval
.exp
= yyvsp
[0].exp
; ;}
2009 { yyval
.exp
= new_exp_from_binary( yyvsp
[-2].exp
, ae_op_lt
, yyvsp
[0].exp
, EM_lineNum
); ;}
2014 { yyval
.exp
= new_exp_from_binary( yyvsp
[-2].exp
, ae_op_gt
, yyvsp
[0].exp
, EM_lineNum
); ;}
2019 { yyval
.exp
= new_exp_from_binary( yyvsp
[-2].exp
, ae_op_le
, yyvsp
[0].exp
, EM_lineNum
); ;}
2024 { yyval
.exp
= new_exp_from_binary( yyvsp
[-2].exp
, ae_op_ge
, yyvsp
[0].exp
, EM_lineNum
); ;}
2029 { yyval
.exp
= yyvsp
[0].exp
; ;}
2034 { yyval
.exp
= new_exp_from_binary( yyvsp
[-2].exp
, ae_op_shift_left
, yyvsp
[0].exp
, EM_lineNum
); ;}
2039 { yyval
.exp
= new_exp_from_binary( yyvsp
[-2].exp
, ae_op_shift_right
, yyvsp
[0].exp
, EM_lineNum
); ;}
2044 { yyval
.exp
= yyvsp
[0].exp
; ;}
2049 { yyval
.exp
= new_exp_from_binary( yyvsp
[-2].exp
, ae_op_plus
, yyvsp
[0].exp
, EM_lineNum
); ;}
2054 { yyval
.exp
= new_exp_from_binary( yyvsp
[-2].exp
, ae_op_minus
, yyvsp
[0].exp
, EM_lineNum
); ;}
2059 { yyval
.exp
= yyvsp
[0].exp
; ;}
2064 { yyval
.exp
= new_exp_from_binary( yyvsp
[-2].exp
, ae_op_times
, yyvsp
[0].exp
, EM_lineNum
); ;}
2069 { yyval
.exp
= new_exp_from_binary( yyvsp
[-2].exp
, ae_op_divide
, yyvsp
[0].exp
, EM_lineNum
); ;}
2074 { yyval
.exp
= new_exp_from_binary( yyvsp
[-2].exp
, ae_op_percent
, yyvsp
[0].exp
, EM_lineNum
); ;}
2079 { yyval
.exp
= yyvsp
[0].exp
; ;}
2084 { yyval
.exp
= new_exp_from_binary( yyvsp
[-2].exp
, ae_op_tilda
, yyvsp
[0].exp
, EM_lineNum
); ;}
2089 { yyval
.exp
= yyvsp
[0].exp
; ;}
2094 { yyval
.exp
= new_exp_from_cast( yyvsp
[-2].sval
, yyvsp
[0].exp
, EM_lineNum
); ;}
2099 { yyval
.exp
= yyvsp
[0].exp
; ;}
2104 { yyval
.exp
= new_exp_from_unary( ae_op_plusplus
, yyvsp
[0].exp
, EM_lineNum
); ;}
2109 { yyval
.exp
= new_exp_from_unary( ae_op_minusminus
, yyvsp
[0].exp
, EM_lineNum
); ;}
2114 { yyval
.exp
= new_exp_from_unary( yyvsp
[-1].ival
, yyvsp
[0].exp
, EM_lineNum
); ;}
2119 { yyval
.ival
= ae_op_plus
; ;}
2124 { yyval
.ival
= ae_op_minus
; ;}
2129 { yyval
.ival
= ae_op_tilda
; ;}
2134 { yyval
.ival
= ae_op_exclamation
; ;}
2139 { yyval
.ival
= ae_op_s_and
; ;}
2144 { yyval
.ival
= ae_op_times
; ;}
2149 { yyval
.ival
= ae_op_spork
; ;}
2154 { yyval
.exp
= yyvsp
[0].exp
; ;}
2159 { yyval
.exp
= new_exp_from_array( yyvsp
[-3].exp
, yyvsp
[-1].exp
, EM_lineNum
); ;}
2164 { yyval
.exp
= new_exp_from_func_call( yyvsp
[-2].exp
, NULL
, EM_lineNum
); ;}
2169 { yyval
.exp
= new_exp_from_func_call( yyvsp
[-3].exp
, yyvsp
[-1].exp
, EM_lineNum
); ;}
2174 { yyval
.exp
= new_exp_from_member_dot( yyvsp
[-2].exp
, yyvsp
[0].sval
, EM_lineNum
); ;}
2179 { yyval
.exp
= new_exp_from_postfix( yyvsp
[-1].exp
, ae_op_plusplus
, EM_lineNum
); ;}
2184 { yyval
.exp
= new_exp_from_postfix( yyvsp
[-1].exp
, ae_op_minusminus
, EM_lineNum
); ;}
2189 { yyval
.exp
= new_exp_from_dur( yyvsp
[-2].exp
, yyvsp
[0].exp
, EM_lineNum
); ;}
2194 { yyval
.exp
= new_exp_from_id( yyvsp
[0].sval
, EM_lineNum
); ;}
2199 { yyval
.exp
= new_exp_from_int( yyvsp
[0].ival
, EM_lineNum
); ;}
2204 { yyval
.exp
= new_exp_from_float( yyvsp
[0].fval
, EM_lineNum
); ;}
2209 { yyval
.exp
= new_exp_from_str( yyvsp
[0].sval
, EM_lineNum
); ;}
2214 { yyval
.exp
= new_exp_from_namespace( "", EM_lineNum
); ;}
2219 { yyval
.exp
= new_exp_from_namespace( yyvsp
[-1].sval
, EM_lineNum
); ;}
2224 { yyval
.exp
= yyvsp
[-1].exp
; ;}
2230 /* Line 999 of yacc.c. */
2231 #line 2232 "chuck.tab.c"
2237 YY_STACK_PRINT (yyss
, yyssp
);
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. */
2248 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2249 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2250 yystate
= yytable
[yystate
];
2252 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2257 /*------------------------------------.
2258 | yyerrlab -- here on detecting error |
2259 `------------------------------------*/
2261 /* If not already recovering from an error, report this error. */
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
;
2276 /* Start YYX at -YYN if negative to avoid negative indexes in
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
;
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
]);
2297 yysize
+= (sizeof ("syntax error, unexpected ")
2298 + yystrlen (yytname
[yytype
]));
2299 yymsg
= (char *) YYSTACK_ALLOC (yysize
);
2302 char *yyp
= yystpcpy (yymsg
, "syntax error, unexpected ");
2303 yyp
= yystpcpy (yyp
, yytname
[yytype
]);
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
]);
2317 YYSTACK_FREE (yymsg
);
2320 yyerror ("syntax error; also virtual memory exhausted");
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. */
2339 /* Pop the rest of the stack. */
2340 while (yyss
< yyssp
)
2342 YYDSYMPRINTF ("Error: popping", yystos
[*yyssp
], yyvsp
, yylsp
);
2343 yydestruct (yystos
[*yyssp
], yyvsp
);
2349 YYDSYMPRINTF ("Error: discarding", yytoken
, &yylval
, &yylloc
);
2350 yydestruct (yytoken
, &yylval
);
2355 /* Else will try to reuse lookahead token after shifting the error
2360 /*----------------------------------------------------.
2361 | yyerrlab1 -- error raised explicitly by an action. |
2362 `----------------------------------------------------*/
2364 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2368 yyn
= yypact
[yystate
];
2369 if (yyn
!= YYPACT_NINF
)
2372 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2380 /* Pop the current state because it cannot handle the error token. */
2384 YYDSYMPRINTF ("Error: popping", yystos
[*yyssp
], yyvsp
, yylsp
);
2385 yydestruct (yystos
[yystate
], yyvsp
);
2389 YY_STACK_PRINT (yyss
, yyssp
);
2395 YYDPRINTF ((stderr
, "Shifting error token, "));
2404 /*-------------------------------------.
2405 | yyacceptlab -- YYACCEPT comes here. |
2406 `-------------------------------------*/
2411 /*-----------------------------------.
2412 | yyabortlab -- YYABORT comes here. |
2413 `-----------------------------------*/
2419 /*----------------------------------------------.
2420 | yyoverflowlab -- parser overflow comes here. |
2421 `----------------------------------------------*/
2423 yyerror ("parser stack overflow");
2431 YYSTACK_FREE (yyss
);
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
2452 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
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 */
2477 #define YY_USE_PROTOS
2478 #define YY_USE_CONST
2480 #endif /* __STDC__ */
2481 #endif /* ! __cplusplus */
2488 #define YY_USE_CONST
2489 #define YY_USE_PROTOS
2493 #define yyconst const
2499 #ifdef YY_USE_PROTOS
2500 #define YY_PROTO(proto) proto
2502 #define YY_PROTO(proto) ()
2506 /* Returned upon end-of-file. */
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
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
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
;
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 )
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. */
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 */ \
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
2595 yy_size_t yy_buf_size
;
2597 /* Number of characters read into yy_ch_buf, not including EOB
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
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
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
2621 /* Whether to try to fill the input buffer when we reach the
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
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 */
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; \
2726 #define YY_NUM_RULES 104
2727 #define YY_END_OF_BUFFER 105
2728 static yyconst
short int yy_accept
[232] =
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] =
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,
2790 static yyconst
int yy_meta
[65] =
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,
2801 static yyconst
short int yy_base
[235] =
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,
2831 static yyconst
short int yy_def
[235] =
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,
2861 static yyconst
short int yy_nxt
[369] =
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] =
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
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
2985 -----------------------------------------------------------------------------*/
2987 //-----------------------------------------------------------------------------
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 //-----------------------------------------------------------------------------
3001 #include "chuck_utils.h"
3002 #include "chuck_absyn.h"
3003 #include "chuck_errmsg.h"
3005 #ifndef __PLATFORM_WIN32__
3006 #include "chuck.tab.h"
3008 #include "chuck_win32.h"
3014 extern YYSTYPE yylval
;
3027 EM_tokPos
= char_pos
;
3032 c_str
strip_lit( c_str str
)
3034 str
[strlen(str
)-1] = '\0';
3039 c_str
alloc_str( c_str str
)
3041 c_str s
= (c_str
)malloc( strlen(str
) + 1 );
3048 long htol( c_str str
)
3051 unsigned long n
= 0;
3060 case '1': case '2': case '3': case '4': case '5':
3061 case '6': case '7': case '8': case '9': case '0':
3065 case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
3069 case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
3081 #line 645 "chuck.yy.c"
3083 /* Macros after this point can all be overridden by user definitions in
3087 #ifndef YY_SKIP_YYWRAP
3089 extern "C" int yywrap
YY_PROTO(( void ));
3091 extern int yywrap
YY_PROTO(( void ));
3096 static void yyunput
YY_PROTO(( int c
, char *buf_ptr
));
3100 static void yy_flex_strncpy
YY_PROTO(( char *, yyconst
char *, int ));
3103 #ifdef YY_NEED_STRLEN
3104 static int yy_flex_strlen
YY_PROTO(( yyconst
char * ));
3109 static int yyinput
YY_PROTO(( void ));
3111 static int input
YY_PROTO(( void ));
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
));
3122 #ifndef YY_NO_POP_STATE
3123 static void yy_pop_state
YY_PROTO(( void ));
3125 #ifndef YY_NO_TOP_STATE
3126 static int yy_top_state
YY_PROTO(( void ));
3130 #define YY_NO_PUSH_STATE 1
3131 #define YY_NO_POP_STATE 1
3132 #define YY_NO_TOP_STATE 1
3135 #ifdef YY_MALLOC_DECL
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).
3150 /* Amount of stuff to slurp up with each read. */
3151 #ifndef YY_READ_BUF_SIZE
3152 #define YY_READ_BUF_SIZE 8192
3155 /* Copy whatever the last rule matched to the standard output. */
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 )
3164 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
3165 * is returned in "result".
3168 #define YY_INPUT(buf,result,max_size) \
3169 if ( yy_current_buffer->yy_is_interactive ) \
3172 for ( n = 0; n < max_size && \
3173 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
3174 buf[n] = (char) c; \
3176 buf[n++] = (char) c; \
3177 if ( c == EOF && ferror( yyin ) ) \
3178 YY_FATAL_ERROR( "input in flex scanner failed" ); \
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" ); \
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.
3202 #define yyterminate() return YY_NULL
3205 /* Number of entries by which start-condition stack grows. */
3206 #ifndef YY_START_STACK_INCR
3207 #define YY_START_STACK_INCR 25
3210 /* Report a fatal error. */
3211 #ifndef YY_FATAL_ERROR
3212 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
3215 /* Default declaration of generated scanner - a define so the user can
3216 * easily add parameters.
3219 #define YY_DECL int yylex YY_PROTO(( void ))
3222 /* Code executed at the beginning of each rule, after yytext and yyleng
3225 #ifndef YY_USER_ACTION
3226 #define YY_USER_ACTION
3229 /* Code executed at the end of each rule. */
3231 #define YY_BREAK break;
3234 #define YY_RULE_SETUP \
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"
3257 yy_start
= 1; /* first start state */
3265 if ( ! 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 */
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
3284 yy_current_state
= yy_start
;
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
];
3303 while ( yy_base
[yy_current_state
] != 304 );
3306 yy_act
= yy_accept
[yy_current_state
];
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. */
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
;
3331 #line 132 "chuck.lex"
3332 { adjust(); comment(); continue; }
3336 #line 133 "chuck.lex"
3337 { adjust(); continue; }
3341 #line 134 "chuck.lex"
3342 { adjust(); continue; }
3346 #line 135 "chuck.lex"
3347 { adjust(); EM_newline(); continue; }
3351 #line 136 "chuck.lex"
3352 { adjust(); EM_newline(); continue; }
3356 #line 138 "chuck.lex"
3357 { adjust(); return PLUSPLUS
; }
3361 #line 139 "chuck.lex"
3362 { adjust(); return MINUSMINUS
; }
3366 #line 141 "chuck.lex"
3367 { adjust(); return COMMA
; }
3371 #line 142 "chuck.lex"
3372 { adjust(); return COLON
; }
3376 #line 143 "chuck.lex"
3377 { adjust(); return DOT
; }
3381 #line 144 "chuck.lex"
3382 { adjust(); return PLUS
; }
3386 #line 145 "chuck.lex"
3387 { adjust(); return MINUS
; }
3391 #line 146 "chuck.lex"
3392 { adjust(); return TIMES
; }
3396 #line 147 "chuck.lex"
3397 { adjust(); return DIVIDE
; }
3401 #line 148 "chuck.lex"
3402 { adjust(); return PERCENT
; }
3406 #line 149 "chuck.lex"
3407 { adjust(); return POUND
; }
3411 #line 151 "chuck.lex"
3412 { adjust(); return L_NSPC
; }
3416 #line 152 "chuck.lex"
3417 { adjust(); return R_NSPC
; }
3421 #line 153 "chuck.lex"
3422 { adjust(); return COLONCOLON
; }
3426 #line 154 "chuck.lex"
3427 { adjust(); return EQ
; }
3431 #line 155 "chuck.lex"
3432 { adjust(); return NEQ
; }
3436 #line 156 "chuck.lex"
3437 { adjust(); return LT
; }
3441 #line 157 "chuck.lex"
3442 { adjust(); return GT
; }
3446 #line 158 "chuck.lex"
3447 { adjust(); return LE
; }
3451 #line 159 "chuck.lex"
3452 { adjust(); return GE
; }
3456 #line 160 "chuck.lex"
3457 { adjust(); return AND
; }
3461 #line 161 "chuck.lex"
3462 { adjust(); return OR
; }
3466 #line 162 "chuck.lex"
3467 { adjust(); return S_AND
; }
3471 #line 163 "chuck.lex"
3472 { adjust(); return S_OR
; }
3476 #line 164 "chuck.lex"
3477 { adjust(); return S_XOR
; }
3481 #line 165 "chuck.lex"
3482 { adjust(); return SHIFT_RIGHT
; }
3486 #line 166 "chuck.lex"
3487 { adjust(); return SHIFT_LEFT
; }
3491 #line 167 "chuck.lex"
3492 { adjust(); return ASSIGN
; }
3496 #line 168 "chuck.lex"
3497 { adjust(); return LPAREN
; }
3501 #line 169 "chuck.lex"
3502 { adjust(); return RPAREN
; }
3506 #line 170 "chuck.lex"
3507 { adjust(); return LBRACK
; }
3511 #line 171 "chuck.lex"
3512 { adjust(); return RBRACK
; }
3516 #line 172 "chuck.lex"
3517 { adjust(); return LBRACE
; }
3521 #line 173 "chuck.lex"
3522 { adjust(); return RBRACE
; }
3526 #line 174 "chuck.lex"
3527 { adjust(); return SEMICOLON
; }
3531 #line 175 "chuck.lex"
3532 { adjust(); return QUESTION
; }
3536 #line 176 "chuck.lex"
3537 { adjust(); return EXCLAMATION
; }
3541 #line 177 "chuck.lex"
3542 { adjust(); return TILDA
; }
3546 #line 178 "chuck.lex"
3547 { adjust(); return FOR
; }
3551 #line 179 "chuck.lex"
3552 { adjust(); return WHILE
; }
3556 #line 180 "chuck.lex"
3557 { adjust(); return BREAK
; }
3561 #line 181 "chuck.lex"
3562 { adjust(); return IF
; }
3566 #line 182 "chuck.lex"
3567 { adjust(); return ELSE
; }
3571 #line 183 "chuck.lex"
3572 { adjust(); return THEN
; }
3576 #line 185 "chuck.lex"
3577 { adjust(); return NULL_TOK
; }
3581 #line 186 "chuck.lex"
3582 { adjust(); return NULL_TOK
; }
3586 #line 187 "chuck.lex"
3587 { adjust(); return RETURN
; }
3591 #line 189 "chuck.lex"
3592 { adjust(); return UNTIL
; }
3596 #line 190 "chuck.lex"
3597 { adjust(); return BEFORE
; }
3601 #line 191 "chuck.lex"
3602 { adjust(); return AFTER
; }
3606 #line 192 "chuck.lex"
3607 { adjust(); return AT
; }
3611 #line 193 "chuck.lex"
3612 { adjust(); return FUNCTION
; }
3616 #line 194 "chuck.lex"
3617 { adjust(); return FUNCTION
; }
3621 #line 195 "chuck.lex"
3622 { adjust(); return NEW
; }
3626 #line 196 "chuck.lex"
3627 { adjust(); return CLASS
; }
3631 #line 197 "chuck.lex"
3632 { adjust(); return EXTENDS
; }
3636 #line 198 "chuck.lex"
3637 { adjust(); return IMPLEMENTS
; }
3641 #line 199 "chuck.lex"
3642 { adjust(); return PUBLIC
; }
3646 #line 200 "chuck.lex"
3647 { adjust(); return PROTECTED
; }
3651 #line 201 "chuck.lex"
3652 { adjust(); return PRIVATE
; }
3656 #line 202 "chuck.lex"
3657 { adjust(); return STATIC
; }
3661 #line 203 "chuck.lex"
3662 { adjust(); return CONST
; }
3666 #line 204 "chuck.lex"
3667 { adjust(); return SPORK
; }
3671 #line 206 "chuck.lex"
3672 { adjust(); return CHUCK
; }
3676 #line 207 "chuck.lex"
3677 { adjust(); return UNCHUCK
; }
3681 #line 208 "chuck.lex"
3682 { adjust(); return UNCHUCK
; }
3686 #line 209 "chuck.lex"
3687 { adjust(); return S_CHUCK
; }
3691 #line 210 "chuck.lex"
3692 { adjust(); return LEFT_S_CHUCK
; }
3696 #line 211 "chuck.lex"
3697 { adjust(); return PLUS_CHUCK
; }
3701 #line 212 "chuck.lex"
3702 { adjust(); return MINUS_CHUCK
; }
3706 #line 213 "chuck.lex"
3707 { adjust(); return TIMES_CHUCK
; }
3711 #line 214 "chuck.lex"
3712 { adjust(); return DIVIDE_CHUCK
; }
3716 #line 215 "chuck.lex"
3717 { adjust(); return S_AND_CHUCK
; }
3721 #line 216 "chuck.lex"
3722 { adjust(); return S_OR_CHUCK
; }
3726 #line 217 "chuck.lex"
3727 { adjust(); return S_XOR_CHUCK
; }
3731 #line 218 "chuck.lex"
3732 { adjust(); return SHIFT_RIGHT_CHUCK
; }
3736 #line 219 "chuck.lex"
3737 { adjust(); return SHIFT_LEFT_CHUCK
; }
3741 #line 220 "chuck.lex"
3742 { adjust(); return PERCENT_CHUCK
; }
3746 #line 221 "chuck.lex"
3747 { adjust(); return AT_CHUCK
; }
3751 #line 222 "chuck.lex"
3752 { adjust(); return PLUS_CHUCK
; }
3756 #line 223 "chuck.lex"
3757 { adjust(); return MINUS_CHUCK
; }
3761 #line 224 "chuck.lex"
3762 { adjust(); return TIMES_CHUCK
; }
3766 #line 225 "chuck.lex"
3767 { adjust(); return DIVIDE_CHUCK
; }
3771 #line 226 "chuck.lex"
3772 { adjust(); return S_AND_CHUCK
; }
3776 #line 227 "chuck.lex"
3777 { adjust(); return S_OR_CHUCK
; }
3781 #line 228 "chuck.lex"
3782 { adjust(); return S_XOR_CHUCK
; }
3786 #line 229 "chuck.lex"
3787 { adjust(); return SHIFT_RIGHT_CHUCK
; }
3791 #line 230 "chuck.lex"
3792 { adjust(); return SHIFT_LEFT_CHUCK
; }
3796 #line 231 "chuck.lex"
3797 { adjust(); return PERCENT_CHUCK
; }
3801 #line 232 "chuck.lex"
3802 { adjust(); return AT_SYM
; }
3806 #line 233 "chuck.lex"
3807 { adjust(); return ATAT_SYM
; }
3811 #line 235 "chuck.lex"
3812 { adjust(); yylval
.ival
=htol(yytext
); return NUM
; }
3816 #line 236 "chuck.lex"
3817 { adjust(); yylval
.ival
=atoi(yytext
); return NUM
; }
3821 #line 237 "chuck.lex"
3822 { adjust(); yylval
.ival
=atoi(yytext
); return NUM
; }
3826 #line 238 "chuck.lex"
3827 { adjust(); yylval
.fval
=atof(yytext
); return FLOAT
; }
3831 #line 239 "chuck.lex"
3832 { adjust(); yylval
.sval
=alloc_str(yytext
); return ID
; }
3836 #line 240 "chuck.lex"
3837 { adjust(); yylval
.sval
=alloc_str(strip_lit(yytext
)); return STRING_LIT
; }
3841 #line 242 "chuck.lex"
3842 { adjust(); EM_error( EM_tokPos
, "illegal token" ); }
3846 #line 244 "chuck.lex"
3849 #line 1413 "chuck.yy.c"
3850 case YY_STATE_EOF(INITIAL
):
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
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
;
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;
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
);
3946 if ( ! yy_did_buffer_switch_on_eof
)
3952 case EOB_ACT_CONTINUE_SCAN
:
3954 yytext_ptr
+ yy_amount_of_matched_text
;
3956 yy_current_state
= yy_get_previous_state();
3959 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
3962 case EOB_ACT_LAST_MATCH
:
3964 &yy_current_buffer
->yy_ch_buf
[yy_n_chars
];
3966 yy_current_state
= yy_get_previous_state();
3969 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
3970 goto yy_find_action
;
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
;
3998 if ( yy_c_buf_p
> &yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] )
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
;
4014 /* We matched some text prior to the EOB, first
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,
4033 yy_current_buffer
->yy_n_chars
= yy_n_chars
= 0;
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
4044 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
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;
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 );
4068 /* Can't grow it, we don't own it. */
4071 if ( ! b
->yy_ch_buf
)
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
-
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
;
4102 ret_val
= EOB_ACT_LAST_MATCH
;
4103 yy_current_buffer
->yy_buffer_status
=
4104 YY_BUFFER_EOF_PENDING
;
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];
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
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
)
4160 static yy_state_type
yy_try_NUL_trans( yy_current_state
)
4161 yy_state_type yy_current_state
;
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
;
4187 #ifdef YY_USE_PROTOS
4188 static void yyunput( int c
, register char *yy_bp
)
4190 static void yyunput( c
, yy_bp
)
4192 register char *yy_bp
;
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
;
4225 yy_hold_char
= *yy_cp
;
4228 #endif /* ifndef YY_NO_UNPUT */
4232 static int yyinput()
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. */
4252 { /* need more input */
4253 int offset
= yy_c_buf_p
- yytext_ptr
;
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. */
4274 case EOB_ACT_END_OF_FILE
:
4279 if ( ! yy_did_buffer_switch_on_eof
)
4288 case EOB_ACT_CONTINUE_SCAN
:
4289 yy_c_buf_p
= yytext_ptr
+ offset
;
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
;
4304 #ifdef YY_USE_PROTOS
4305 void yyrestart( FILE *input_file
)
4307 void yyrestart( input_file
)
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
)
4322 void yy_switch_to_buffer( new_buffer
)
4323 YY_BUFFER_STATE new_buffer
;
4326 if ( yy_current_buffer
== new_buffer
)
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 )
4352 void yy_load_buffer_state()
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
)
4365 YY_BUFFER_STATE
yy_create_buffer( file
, size
)
4372 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
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
);
4393 #ifdef YY_USE_PROTOS
4394 void yy_delete_buffer( YY_BUFFER_STATE b
)
4396 void yy_delete_buffer( b
)
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
);
4416 #ifndef YY_ALWAYS_INTERACTIVE
4417 #ifndef YY_NEVER_INTERACTIVE
4418 extern int isatty
YY_PROTO(( int ));
4423 #ifdef YY_USE_PROTOS
4424 void yy_init_buffer( YY_BUFFER_STATE b
, FILE *file
)
4426 void yy_init_buffer( b
, file
)
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;
4441 #if YY_NEVER_INTERACTIVE
4442 b
->yy_is_interactive
= 0;
4444 b
->yy_is_interactive
= file
? (isatty( fileno(file
) ) > 0) : 0;
4450 #ifdef YY_USE_PROTOS
4451 void yy_flush_buffer( YY_BUFFER_STATE b
)
4453 void yy_flush_buffer( b
)
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];
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
)
4484 YY_BUFFER_STATE
yy_scan_buffer( base
, size
)
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. */
4497 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
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;
4508 b
->yy_fill_buffer
= 0;
4509 b
->yy_buffer_status
= YY_BUFFER_NEW
;
4511 yy_switch_to_buffer( b
);
4518 #ifndef YY_NO_SCAN_STRING
4519 #ifdef YY_USE_PROTOS
4520 YY_BUFFER_STATE
yy_scan_string( yyconst
char *yy_str
)
4522 YY_BUFFER_STATE
yy_scan_string( yy_str
)
4523 yyconst
char *yy_str
;
4527 for ( len
= 0; yy_str
[len
]; ++len
)
4530 return yy_scan_bytes( yy_str
, len
);
4535 #ifndef YY_NO_SCAN_BYTES
4536 #ifdef YY_USE_PROTOS
4537 YY_BUFFER_STATE
yy_scan_bytes( yyconst
char *bytes
, int len
)
4539 YY_BUFFER_STATE
yy_scan_bytes( bytes
, len
)
4540 yyconst
char *bytes
;
4549 /* Get memory for full buffer, including space for trailing EOB's. */
4551 buf
= (char *) yy_flex_alloc( n
);
4553 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
4555 for ( i
= 0; i
< len
; ++i
)
4558 buf
[len
] = buf
[len
+1] = YY_END_OF_BUFFER_CHAR
;
4560 b
= yy_scan_buffer( buf
, n
);
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;
4574 #ifndef YY_NO_PUSH_STATE
4575 #ifdef YY_USE_PROTOS
4576 static void yy_push_state( int new_state
)
4578 static void yy_push_state( new_state
)
4582 if ( yy_start_stack_ptr
>= yy_start_stack_depth
)
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
);
4593 yy_start_stack
= (int *) yy_flex_realloc(
4594 (void *) yy_start_stack
, new_size
);
4596 if ( ! yy_start_stack
)
4598 "out of memory expanding start-condition stack" );
4601 yy_start_stack
[yy_start_stack_ptr
++] = YY_START
;
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
]);
4619 #ifndef YY_NO_TOP_STATE
4620 static int yy_top_state()
4622 return yy_start_stack
[yy_start_stack_ptr
- 1];
4626 #ifndef YY_EXIT_FAILURE
4627 #define YY_EXIT_FAILURE 2
4630 #ifdef YY_USE_PROTOS
4631 static void yy_fatal_error( yyconst
char msg
[] )
4633 static void yy_fatal_error( msg
)
4637 (void) fprintf( stderr
, "%s\n", msg
);
4638 exit( YY_EXIT_FAILURE
);
4643 /* Redefine yyless() so it works in section 3 code. */
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'; \
4659 /* Internal utility routines. */
4662 #ifdef YY_USE_PROTOS
4663 static void yy_flex_strncpy( char *s1
, yyconst
char *s2
, int n
)
4665 static void yy_flex_strncpy( s1
, s2
, n
)
4672 for ( i
= 0; i
< n
; ++i
)
4677 #ifdef YY_NEED_STRLEN
4678 #ifdef YY_USE_PROTOS
4679 static int yy_flex_strlen( yyconst
char *s
)
4681 static int yy_flex_strlen( s
)
4686 for ( n
= 0; s
[n
]; ++n
)
4694 #ifdef YY_USE_PROTOS
4695 static void *yy_flex_alloc( yy_size_t size
)
4697 static void *yy_flex_alloc( size
)
4701 return (void *) malloc( size
);
4704 #ifdef YY_USE_PROTOS
4705 static void *yy_flex_realloc( void *ptr
, yy_size_t size
)
4707 static void *yy_flex_realloc( ptr
, size
)
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
)
4725 static void yy_flex_free( ptr
)
4739 #line 244 "chuck.lex"
4747 while ((c
= input()) != '\n' && c
!= '\r' && c
!= 0);
4749 if (c
!= 0) { adjust(); EM_newline(); }