xcc.tab.c


    1 /* A Bison parser, made by GNU Bison 1.875b.  */
    2 
    3 /* Skeleton parser for Yacc-like parsing with Bison,
    4    Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
    5 
    6    This program is free software; you can redistribute it and/or modify
    7    it under the terms of the GNU General Public License as published by
    8    the Free Software Foundation; either version 2, or (at your option)
    9    any later version.
   10 
   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.
   15 
   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.  */
   20 
   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.  */
   25 
   26 /* Written by Richard Stallman by simplifying the original so called
   27    ``semantic'' parser.  */
   28 
   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.  */
   35 
   36 /* Identify Bison output.  */
   37 #define YYBISON 1
   38 
   39 /* Skeleton name.  */
   40 #define YYSKELETON_NAME "yacc.c"
   41 
   42 /* Pure parsers.  */
   43 #define YYPURE 0
   44 
   45 /* Using locations.  */
   46 #define YYLSP_NEEDED 0
   47 
   48 
   49 
   50 /* Tokens.  */
   51 #ifndef YYTOKENTYPE
   52 # define YYTOKENTYPE
   53    /* Put the tokens into the symbol table, so that GDB and other debuggers
   54       know about them.  */
   55    enum yytokentype {
   56      CHAR = 258,
   57      ELSE = 259,
   58      GOTO = 260,
   59      IF = 261,
   60      INT = 262,
   61      RETURN = 263,
   62      VOID = 264,
   63      WHILE = 265,
   64      IDENTIFIER = 266,
   65      INTEGER = 267,
   66      CHARACTER = 268,
   67      STRING = 269,
   68      EQ = 270,
   69      NEQ = 271,
   70      LEQ = 272,
   71      GEQ = 273,
   72      AND = 274,
   73      OR = 275,
   74      UNARY_OPERATOR = 276
   75    };
   76 #endif
   77 #define CHAR 258
   78 #define ELSE 259
   79 #define GOTO 260
   80 #define IF 261
   81 #define INT 262
   82 #define RETURN 263
   83 #define VOID 264
   84 #define WHILE 265
   85 #define IDENTIFIER 266
   86 #define INTEGER 267
   87 #define CHARACTER 268
   88 #define STRING 269
   89 #define EQ 270
   90 #define NEQ 271
   91 #define LEQ 272
   92 #define GEQ 273
   93 #define AND 274
   94 #define OR 275
   95 #define UNARY_OPERATOR 276
   96 
   97 
   98 
   99 
  100 /* Copy the first part of user declarations.  */
  101 #line 1 "xcc.y"
  102 
  103 #include <stdio.h>
  104 #include <stddef.h>
  105 #include <stdlib.h>
  106 #include <assert.h>
  107 #include "xcc.h"
  108 #include "AST.h"
  109 #include "type.h"
  110 #include "symbol.h"
  111 #include "debug.h"
  112 #include "codegen.h"
  113 #define YYERROR_VERBOSE
  114 
  115 static void init(int argc, char *argv[]);
  116 
  117 struct AST *ast_root;
  118 int AST_is_local = 0;
  119 FILE *xcc_out;
  120 
  121 
  122 /* Enabling traces.  */
  123 #ifndef YYDEBUG
  124 # define YYDEBUG 0
  125 #endif
  126 
  127 /* Enabling verbose error messages.  */
  128 #ifdef YYERROR_VERBOSE
  129 # undef YYERROR_VERBOSE
  130 # define YYERROR_VERBOSE 1
  131 #else
  132 # define YYERROR_VERBOSE 0
  133 #endif
  134 
  135 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
  136 typedef int YYSTYPE;
  137 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
  138 # define YYSTYPE_IS_DECLARED 1
  139 # define YYSTYPE_IS_TRIVIAL 1
  140 #endif
  141 
  142 
  143 
  144 /* Copy the second part of user declarations.  */
  145 
  146 
  147 /* Line 214 of yacc.c.  */
  148 #line 149 "xcc.tab.c"
  149 
  150 #if ! defined (yyoverflow) || YYERROR_VERBOSE
  151 
  152 /* The parser invokes alloca or malloc; define the necessary symbols.  */
  153 
  154 # if YYSTACK_USE_ALLOCA
  155 #  define YYSTACK_ALLOC alloca
  156 # else
  157 #  ifndef YYSTACK_USE_ALLOCA
  158 #   if defined (alloca) || defined (_ALLOCA_H)
  159 #    define YYSTACK_ALLOC alloca
  160 #   else
  161 #    ifdef __GNUC__
  162 #     define YYSTACK_ALLOC __builtin_alloca
  163 #    endif
  164 #   endif
  165 #  endif
  166 # endif
  167 
  168 # ifdef YYSTACK_ALLOC
  169    /* Pacify GCC's `empty if-body' warning. */
  170 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
  171 # else
  172 #  if defined (__STDC__) || defined (__cplusplus)
  173 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
  174 #   define YYSIZE_T size_t
  175 #  endif
  176 #  define YYSTACK_ALLOC malloc
  177 #  define YYSTACK_FREE free
  178 # endif
  179 #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
  180 
  181 
  182 #if (! defined (yyoverflow) \
  183      && (! defined (__cplusplus) \
  184 	 || (YYSTYPE_IS_TRIVIAL)))
  185 
  186 /* A type that is properly aligned for any stack member.  */
  187 union yyalloc
  188 {
  189   short yyss;
  190   YYSTYPE yyvs;
  191   };
  192 
  193 /* The size of the maximum gap between one aligned stack and the next.  */
  194 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
  195 
  196 /* The size of an array large to enough to hold all stacks, each with
  197    N elements.  */
  198 # define YYSTACK_BYTES(N) \
  199      ((N) * (sizeof (short) + sizeof (YYSTYPE))				\
  200       + YYSTACK_GAP_MAXIMUM)
  201 
  202 /* Copy COUNT objects from FROM to TO.  The source and destination do
  203    not overlap.  */
  204 # ifndef YYCOPY
  205 #  if 1 < __GNUC__
  206 #   define YYCOPY(To, From, Count) \
  207       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
  208 #  else
  209 #   define YYCOPY(To, From, Count)		\
  210       do					\
  211 	{					\
  212 	  register YYSIZE_T yyi;		\
  213 	  for (yyi = 0; yyi < (Count); yyi++)	\
  214 	    (To)[yyi] = (From)[yyi];		\
  215 	}					\
  216       while (0)
  217 #  endif
  218 # endif
  219 
  220 /* Relocate STACK from its old location to the new one.  The
  221    local variables YYSIZE and YYSTACKSIZE give the old and new number of
  222    elements in the stack, and YYPTR gives the new location of the
  223    stack.  Advance YYPTR to a properly aligned location for the next
  224    stack.  */
  225 # define YYSTACK_RELOCATE(Stack)					\
  226     do									\
  227       {									\
  228 	YYSIZE_T yynewbytes;						\
  229 	YYCOPY (&yyptr->Stack, Stack, yysize);				\
  230 	Stack = &yyptr->Stack;						\
  231 	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
  232 	yyptr += yynewbytes / sizeof (*yyptr);				\
  233       }									\
  234     while (0)
  235 
  236 #endif
  237 
  238 #if defined (__STDC__) || defined (__cplusplus)
  239    typedef signed char yysigned_char;
  240 #else
  241    typedef short yysigned_char;
  242 #endif
  243 
  244 /* YYFINAL -- State number of the termination state. */
  245 #define YYFINAL  9
  246 /* YYLAST -- Last index in YYTABLE.  */
  247 #define YYLAST   324
  248 
  249 /* YYNTOKENS -- Number of terminals. */
  250 #define YYNTOKENS  39
  251 /* YYNNTS -- Number of nonterminals. */
  252 #define YYNNTS  18
  253 /* YYNRULES -- Number of rules. */
  254 #define YYNRULES  64
  255 /* YYNRULES -- Number of states. */
  256 #define YYNSTATES  119
  257 
  258 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
  259 #define YYUNDEFTOK  2
  260 #define YYMAXUTOK   276
  261 
  262 #define YYTRANSLATE(YYX) 						\
  263   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
  264 
  265 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
  266 static const unsigned char yytranslate[] =
  267 {
  268        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  269        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  270        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  271        2,     2,     2,    38,     2,     2,     2,    28,    37,     2,
  272       30,    31,    26,    24,    33,    25,     2,    27,     2,     2,
  273        2,     2,     2,     2,     2,     2,     2,     2,    34,    32,
  274       22,    21,    23,     2,     2,     2,     2,     2,     2,     2,
  275        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  276        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  277        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  278        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  279        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  280        2,     2,     2,    35,     2,    36,     2,     2,     2,     2,
  281        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  282        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  283        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  284        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  285        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  286        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  287        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  288        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  289        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  290        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  291        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  292        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  293        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
  294        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
  295       15,    16,    17,    18,    19,    20,    29
  296 };
  297 
  298 #if YYDEBUG
  299 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
  300    YYRHS.  */
  301 static const unsigned char yyprhs[] =
  302 {
  303        0,     0,     3,     5,     8,    10,    12,    13,    18,    19,
  304       22,    26,    28,    30,    32,    34,    37,    41,    46,    50,
  305       52,    56,    59,    61,    64,    66,    69,    71,    77,    85,
  306       91,    95,    99,   103,   106,   107,   108,   115,   117,   119,
  307      121,   123,   127,   131,   135,   139,   143,   147,   151,   155,
  308      159,   163,   167,   171,   175,   179,   182,   185,   188,   191,
  309      194,   199,   203,   207,   209
  310 };
  311 
  312 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
  313 static const yysigned_char yyrhs[] =
  314 {
  315       40,     0,    -1,    41,    -1,    40,    41,    -1,    42,    -1,
  316       45,    -1,    -1,    46,    47,    43,    52,    -1,    -1,    44,
  317       45,    -1,    46,    47,    32,    -1,     9,    -1,     7,    -1,
  318        3,    -1,    11,    -1,    26,    47,    -1,    30,    47,    31,
  319       -1,    47,    30,    48,    31,    -1,    47,    30,    31,    -1,
  320       49,    -1,    48,    33,    49,    -1,    46,    47,    -1,    51,
  321       -1,    50,    51,    -1,    32,    -1,    55,    32,    -1,    52,
  322       -1,     6,    30,    55,    31,    51,    -1,     6,    30,    55,
  323       31,    51,     4,    51,    -1,    10,    30,    55,    31,    51,
  324       -1,     5,    11,    32,    -1,    11,    34,    51,    -1,     8,
  325       55,    32,    -1,     8,    32,    -1,    -1,    -1,    35,    53,
  326       44,    54,    50,    36,    -1,    11,    -1,    12,    -1,    13,
  327       -1,    14,    -1,    55,    21,    55,    -1,    55,    22,    55,
  328       -1,    55,    23,    55,    -1,    55,    15,    55,    -1,    55,
  329       16,    55,    -1,    55,    17,    55,    -1,    55,    18,    55,
  330       -1,    55,    19,    55,    -1,    55,    20,    55,    -1,    55,
  331       24,    55,    -1,    55,    25,    55,    -1,    55,    26,    55,
  332       -1,    55,    27,    55,    -1,    55,    28,    55,    -1,    37,
  333       55,    -1,    26,    55,    -1,    24,    55,    -1,    25,    55,
  334       -1,    38,    55,    -1,    55,    30,    56,    31,    -1,    55,
  335       30,    31,    -1,    30,    55,    31,    -1,    55,    -1,    56,
  336       33,    55,    -1
  337 };
  338 
  339 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
  340 static const unsigned short yyrline[] =
  341 {
  342        0,    58,    58,    61,    67,    69,    78,    77,    91,    92,
  343       97,   104,   107,   110,   116,   118,   120,   122,   124,   129,
  344      131,   136,   143,   145,   150,   152,   154,   156,   158,   160,
  345      162,   164,   167,   169,   175,   177,   174,   184,   189,   192,
  346      195,   199,   202,   205,   208,   211,   214,   217,   220,   223,
  347      226,   229,   232,   235,   238,   241,   244,   247,   250,   253,
  348      256,   261,   264,   270,   273
  349 };
  350 #endif
  351 
  352 #if YYDEBUG || YYERROR_VERBOSE
  353 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
  354    First, the terminals, then, starting at YYNTOKENS, nonterminals. */
  355 static const char *const yytname[] =
  356 {
  357   "$end", "error", "$undefined", "\"char\"", "\"else\"", "\"goto\"", 
  358   "\"if\"", "\"int\"", "\"return\"", "\"void\"", "\"while\"", 
  359   "IDENTIFIER", "INTEGER", "CHARACTER", "STRING", "\"==\"", "\"!=\"", 
  360   "\"<=\"", "\">=\"", "\"&&\"", "\"||\"", "'='", "'<'", "'>'", "'+'", 
  361   "'-'", "'*'", "'/'", "'%'", "UNARY_OPERATOR", "'('", "')'", "';'", 
  362   "','", "':'", "'{'", "'}'", "'&'", "'!'", "$accept", "translation_unit", 
  363   "external_declaration", "function_definition", "@1", "declaration_list", 
  364   "declaration", "type_specifier", "declarator", "parameter_list", 
  365   "parameter_declaration", "statement_list", "statement", 
  366   "compound_statement", "@2", "@3", "expression", 
  367   "argument_expression_list", 0
  368 };
  369 #endif
  370 
  371 # ifdef YYPRINT
  372 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
  373    token YYLEX-NUM.  */
  374 static const unsigned short yytoknum[] =
  375 {
  376        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
  377      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
  378      275,    61,    60,    62,    43,    45,    42,    47,    37,   276,
  379       40,    41,    59,    44,    58,   123,   125,    38,    33
  380 };
  381 # endif
  382 
  383 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
  384 static const unsigned char yyr1[] =
  385 {
  386        0,    39,    40,    40,    41,    41,    43,    42,    44,    44,
  387       45,    46,    46,    46,    47,    47,    47,    47,    47,    48,
  388       48,    49,    50,    50,    51,    51,    51,    51,    51,    51,
  389       51,    51,    51,    51,    53,    54,    52,    55,    55,    55,
  390       55,    55,    55,    55,    55,    55,    55,    55,    55,    55,
  391       55,    55,    55,    55,    55,    55,    55,    55,    55,    55,
  392       55,    55,    55,    56,    56
  393 };
  394 
  395 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
  396 static const unsigned char yyr2[] =
  397 {
  398        0,     2,     1,     2,     1,     1,     0,     4,     0,     2,
  399        3,     1,     1,     1,     1,     2,     3,     4,     3,     1,
  400        3,     2,     1,     2,     1,     2,     1,     5,     7,     5,
  401        3,     3,     3,     2,     0,     0,     6,     1,     1,     1,
  402        1,     3,     3,     3,     3,     3,     3,     3,     3,     3,
  403        3,     3,     3,     3,     3,     2,     2,     2,     2,     2,
  404        4,     3,     3,     1,     3
  405 };
  406 
  407 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
  408    STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
  409    means the default is an error.  */
  410 static const unsigned char yydefact[] =
  411 {
  412        0,    13,    12,    11,     0,     2,     4,     5,     0,     1,
  413        3,    14,     0,     0,     6,    15,     0,     0,    10,     0,
  414       16,    18,     0,     0,    19,    34,     7,    21,    17,     0,
  415        8,    20,    35,     9,     0,     0,     0,     0,     0,     0,
  416        0,    37,    38,    39,    40,     0,     0,     0,     0,    24,
  417        0,     0,     0,    22,    26,     0,     0,     0,    37,    33,
  418        0,     0,     0,    57,    58,    56,     0,    55,    59,    36,
  419       23,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  420        0,     0,     0,     0,     0,     0,    25,    30,     0,    32,
  421        0,    31,    62,    44,    45,    46,    47,    48,    49,    41,
  422       42,    43,    50,    51,    52,    53,    54,    61,    63,     0,
  423        0,     0,    60,     0,    27,    29,    64,     0,    28
  424 };
  425 
  426 /* YYDEFGOTO[NTERM-NUM]. */
  427 static const yysigned_char yydefgoto[] =
  428 {
  429       -1,     4,     5,     6,    19,    32,     7,     8,    14,    23,
  430       24,    52,    53,    54,    30,    35,    55,   109
  431 };
  432 
  433 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
  434    STATE-NUM.  */
  435 #define YYPACT_NINF -50
  436 static const short yypact[] =
  437 {
  438       57,   -50,   -50,   -50,    99,   -50,   -50,   -50,   -10,   -50,
  439      -50,   -50,   -10,   -10,    -1,   -28,    18,    16,   -50,   -25,
  440      -50,   -50,   -10,    21,   -50,   -50,   -50,   -28,   -50,    57,
  441      -50,   -50,    57,   -50,   -10,    79,    -1,     6,    -9,   107,
  442       -6,    33,   -50,   -50,   -50,   137,   137,   137,   137,   -50,
  443      137,   137,    45,   -50,   -50,   161,    -4,   137,   -50,   -50,
  444      179,   137,    79,    42,    42,    42,   197,    42,    42,   -50,
  445      -50,   137,   137,   137,   137,   137,   137,   137,   137,   137,
  446      137,   137,   137,   137,   137,   116,   -50,   -50,   214,   -50,
  447      231,   -50,   -50,   294,   294,    70,    70,   280,   264,   248,
  448       70,    70,    96,    96,    42,    42,    42,   -50,   248,    32,
  449       79,    79,   -50,   137,    69,   -50,   248,    79,   -50
  450 };
  451 
  452 /* YYPGOTO[NTERM-NUM].  */
  453 static const yysigned_char yypgoto[] =
  454 {
  455      -50,   -50,    72,   -50,   -50,   -50,    46,    -2,    -8,   -50,
  456       50,   -50,   -49,    67,   -50,   -50,   -39,   -50
  457 };
  458 
  459 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
  460    positive, shift that token.  If negative, reduce the rule which
  461    number is the opposite.  If zero, do what YYDEFACT says.
  462    If YYTABLE_NINF, syntax error.  */
  463 #define YYTABLE_NINF -1
  464 static const unsigned char yytable[] =
  465 {
  466       60,    11,    17,    70,    15,    16,    63,    64,    65,    66,
  467       25,    67,    68,    91,    27,    22,    12,    56,    88,     1,
  468       13,    57,    90,     2,    61,     3,    36,    22,    87,    17,
  469       34,    18,    93,    94,    95,    96,    97,    98,    99,   100,
  470      101,   102,   103,   104,   105,   106,   108,    21,    17,    20,
  471       37,    38,    28,    39,    29,    40,    41,    42,    43,    44,
  472        1,   114,   115,   112,     2,   113,     3,    62,   118,    45,
  473       46,    47,    85,   117,   116,    48,    10,    49,    33,    31,
  474       25,    69,    50,    51,    37,    38,    26,    39,     0,    40,
  475       41,    42,    43,    44,    80,    81,    82,    83,    84,     9,
  476       85,     0,     1,    45,    46,    47,     2,     0,     3,    48,
  477        0,    49,     0,     0,    25,     0,    50,    51,    58,    42,
  478       43,    44,    82,    83,    84,     0,    85,    58,    42,    43,
  479       44,    45,    46,    47,     0,     0,     0,    48,     0,    59,
  480       45,    46,    47,     0,    50,    51,    48,   107,    58,    42,
  481       43,    44,     0,    50,    51,     0,     0,     0,     0,     0,
  482        0,    45,    46,    47,     0,     0,     0,    48,     0,     0,
  483        0,     0,     0,     0,    50,    51,    71,    72,    73,    74,
  484       75,    76,    77,    78,    79,    80,    81,    82,    83,    84,
  485        0,    85,     0,    86,    71,    72,    73,    74,    75,    76,
  486       77,    78,    79,    80,    81,    82,    83,    84,     0,    85,
  487        0,    89,    71,    72,    73,    74,    75,    76,    77,    78,
  488       79,    80,    81,    82,    83,    84,     0,    85,    92,    71,
  489       72,    73,    74,    75,    76,    77,    78,    79,    80,    81,
  490       82,    83,    84,     0,    85,   110,    71,    72,    73,    74,
  491       75,    76,    77,    78,    79,    80,    81,    82,    83,    84,
  492        0,    85,   111,    71,    72,    73,    74,    75,    76,    77,
  493       78,    79,    80,    81,    82,    83,    84,     0,    85,    71,
  494       72,    73,    74,    75,     0,     0,    78,    79,    80,    81,
  495       82,    83,    84,     0,    85,    71,    72,    73,    74,     0,
  496        0,     0,    78,    79,    80,    81,    82,    83,    84,     0,
  497       85,    73,    74,     0,     0,     0,    78,    79,    80,    81,
  498       82,    83,    84,     0,    85
  499 };
  500 
  501 static const yysigned_char yycheck[] =
  502 {
  503       39,    11,    30,    52,    12,    13,    45,    46,    47,    48,
  504       35,    50,    51,    62,    22,    17,    26,    11,    57,     3,
  505       30,    30,    61,     7,    30,     9,    34,    29,    32,    30,
  506       32,    32,    71,    72,    73,    74,    75,    76,    77,    78,
  507       79,    80,    81,    82,    83,    84,    85,    31,    30,    31,
  508        5,     6,    31,     8,    33,    10,    11,    12,    13,    14,
  509        3,   110,   111,    31,     7,    33,     9,    34,   117,    24,
  510       25,    26,    30,     4,   113,    30,     4,    32,    32,    29,
  511       35,    36,    37,    38,     5,     6,    19,     8,    -1,    10,
  512       11,    12,    13,    14,    24,    25,    26,    27,    28,     0,
  513       30,    -1,     3,    24,    25,    26,     7,    -1,     9,    30,
  514       -1,    32,    -1,    -1,    35,    -1,    37,    38,    11,    12,
  515       13,    14,    26,    27,    28,    -1,    30,    11,    12,    13,
  516       14,    24,    25,    26,    -1,    -1,    -1,    30,    -1,    32,
  517       24,    25,    26,    -1,    37,    38,    30,    31,    11,    12,
  518       13,    14,    -1,    37,    38,    -1,    -1,    -1,    -1,    -1,
  519       -1,    24,    25,    26,    -1,    -1,    -1,    30,    -1,    -1,
  520       -1,    -1,    -1,    -1,    37,    38,    15,    16,    17,    18,
  521       19,    20,    21,    22,    23,    24,    25,    26,    27,    28,
  522       -1,    30,    -1,    32,    15,    16,    17,    18,    19,    20,
  523       21,    22,    23,    24,    25,    26,    27,    28,    -1,    30,
  524       -1,    32,    15,    16,    17,    18,    19,    20,    21,    22,
  525       23,    24,    25,    26,    27,    28,    -1,    30,    31,    15,
  526       16,    17,    18,    19,    20,    21,    22,    23,    24,    25,
  527       26,    27,    28,    -1,    30,    31,    15,    16,    17,    18,
  528       19,    20,    21,    22,    23,    24,    25,    26,    27,    28,
  529       -1,    30,    31,    15,    16,    17,    18,    19,    20,    21,
  530       22,    23,    24,    25,    26,    27,    28,    -1,    30,    15,
  531       16,    17,    18,    19,    -1,    -1,    22,    23,    24,    25,
  532       26,    27,    28,    -1,    30,    15,    16,    17,    18,    -1,
  533       -1,    -1,    22,    23,    24,    25,    26,    27,    28,    -1,
  534       30,    17,    18,    -1,    -1,    -1,    22,    23,    24,    25,
  535       26,    27,    28,    -1,    30
  536 };
  537 
  538 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
  539    symbol of state STATE-NUM.  */
  540 static const unsigned char yystos[] =
  541 {
  542        0,     3,     7,     9,    40,    41,    42,    45,    46,     0,
  543       41,    11,    26,    30,    47,    47,    47,    30,    32,    43,
  544       31,    31,    46,    48,    49,    35,    52,    47,    31,    33,
  545       53,    49,    44,    45,    46,    54,    47,     5,     6,     8,
  546       10,    11,    12,    13,    14,    24,    25,    26,    30,    32,
  547       37,    38,    50,    51,    52,    55,    11,    30,    11,    32,
  548       55,    30,    34,    55,    55,    55,    55,    55,    55,    36,
  549       51,    15,    16,    17,    18,    19,    20,    21,    22,    23,
  550       24,    25,    26,    27,    28,    30,    32,    32,    55,    32,
  551       55,    51,    31,    55,    55,    55,    55,    55,    55,    55,
  552       55,    55,    55,    55,    55,    55,    55,    31,    55,    56,
  553       31,    31,    31,    33,    51,    51,    55,     4,    51
  554 };
  555 
  556 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
  557 # define YYSIZE_T __SIZE_TYPE__
  558 #endif
  559 #if ! defined (YYSIZE_T) && defined (size_t)
  560 # define YYSIZE_T size_t
  561 #endif
  562 #if ! defined (YYSIZE_T)
  563 # if defined (__STDC__) || defined (__cplusplus)
  564 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
  565 #  define YYSIZE_T size_t
  566 # endif
  567 #endif
  568 #if ! defined (YYSIZE_T)
  569 # define YYSIZE_T unsigned int
  570 #endif
  571 
  572 #define yyerrok		(yyerrstatus = 0)
  573 #define yyclearin	(yychar = YYEMPTY)
  574 #define YYEMPTY		(-2)
  575 #define YYEOF		0
  576 
  577 #define YYACCEPT	goto yyacceptlab
  578 #define YYABORT		goto yyabortlab
  579 #define YYERROR		goto yyerrlab1
  580 
  581 
  582 /* Like YYERROR except do call yyerror.  This remains here temporarily
  583    to ease the transition to the new meaning of YYERROR, for GCC.
  584    Once GCC version 2 has supplanted version 1, this can go.  */
  585 
  586 #define YYFAIL		goto yyerrlab
  587 
  588 #define YYRECOVERING()  (!!yyerrstatus)
  589 
  590 #define YYBACKUP(Token, Value)					\
  591 do								\
  592   if (yychar == YYEMPTY && yylen == 1)				\
  593     {								\
  594       yychar = (Token);						\
  595       yylval = (Value);						\
  596       yytoken = YYTRANSLATE (yychar);				\
  597       YYPOPSTACK;						\
  598       goto yybackup;						\
  599     }								\
  600   else								\
  601     { 								\
  602       yyerror ("syntax error: cannot back up");\
  603       YYERROR;							\
  604     }								\
  605 while (0)
  606 
  607 #define YYTERROR	1
  608 #define YYERRCODE	256
  609 
  610 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
  611    are run).  */
  612 
  613 #ifndef YYLLOC_DEFAULT
  614 # define YYLLOC_DEFAULT(Current, Rhs, N)         \
  615   Current.first_line   = Rhs[1].first_line;      \
  616   Current.first_column = Rhs[1].first_column;    \
  617   Current.last_line    = Rhs[N].last_line;       \
  618   Current.last_column  = Rhs[N].last_column;
  619 #endif
  620 
  621 /* YYLEX -- calling `yylex' with the right arguments.  */
  622 
  623 #ifdef YYLEX_PARAM
  624 # define YYLEX yylex (YYLEX_PARAM)
  625 #else
  626 # define YYLEX yylex ()
  627 #endif
  628 
  629 /* Enable debugging if requested.  */
  630 #if YYDEBUG
  631 
  632 # ifndef YYFPRINTF
  633 #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
  634 #  define YYFPRINTF fprintf
  635 # endif
  636 
  637 # define YYDPRINTF(Args)			\
  638 do {						\
  639   if (yydebug)					\
  640     YYFPRINTF Args;				\
  641 } while (0)
  642 
  643 # define YYDSYMPRINT(Args)			\
  644 do {						\
  645   if (yydebug)					\
  646     yysymprint Args;				\
  647 } while (0)
  648 
  649 # define YYDSYMPRINTF(Title, Token, Value, Location)		\
  650 do {								\
  651   if (yydebug)							\
  652     {								\
  653       YYFPRINTF (stderr, "%s ", Title);				\
  654       yysymprint (stderr, 					\
  655                   Token, Value);	\
  656       YYFPRINTF (stderr, "\n");					\
  657     }								\
  658 } while (0)
  659 
  660 /*------------------------------------------------------------------.
  661 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
  662 | TOP (cinluded).                                                   |
  663 `------------------------------------------------------------------*/
  664 
  665 #if defined (__STDC__) || defined (__cplusplus)
  666 static void
  667 yy_stack_print (short *bottom, short *top)
  668 #else
  669 static void
  670 yy_stack_print (bottom, top)
  671     short *bottom;
  672     short *top;
  673 #endif
  674 {
  675   YYFPRINTF (stderr, "Stack now");
  676   for (/* Nothing. */; bottom <= top; ++bottom)
  677     YYFPRINTF (stderr, " %d", *bottom);
  678   YYFPRINTF (stderr, "\n");
  679 }
  680 
  681 # define YY_STACK_PRINT(Bottom, Top)				\
  682 do {								\
  683   if (yydebug)							\
  684     yy_stack_print ((Bottom), (Top));				\
  685 } while (0)
  686 
  687 
  688 /*------------------------------------------------.
  689 | Report that the YYRULE is going to be reduced.  |
  690 `------------------------------------------------*/
  691 
  692 #if defined (__STDC__) || defined (__cplusplus)
  693 static void
  694 yy_reduce_print (int yyrule)
  695 #else
  696 static void
  697 yy_reduce_print (yyrule)
  698     int yyrule;
  699 #endif
  700 {
  701   int yyi;
  702   unsigned int yylno = yyrline[yyrule];
  703   YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
  704              yyrule - 1, yylno);
  705   /* Print the symbols being reduced, and their result.  */
  706   for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
  707     YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
  708   YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
  709 }
  710 
  711 # define YY_REDUCE_PRINT(Rule)		\
  712 do {					\
  713   if (yydebug)				\
  714     yy_reduce_print (Rule);		\
  715 } while (0)
  716 
  717 /* Nonzero means print parse trace.  It is left uninitialized so that
  718    multiple parsers can coexist.  */
  719 int yydebug;
  720 #else /* !YYDEBUG */
  721 # define YYDPRINTF(Args)
  722 # define YYDSYMPRINT(Args)
  723 # define YYDSYMPRINTF(Title, Token, Value, Location)
  724 # define YY_STACK_PRINT(Bottom, Top)
  725 # define YY_REDUCE_PRINT(Rule)
  726 #endif /* !YYDEBUG */
  727 
  728 
  729 /* YYINITDEPTH -- initial size of the parser's stacks.  */
  730 #ifndef	YYINITDEPTH
  731 # define YYINITDEPTH 200
  732 #endif
  733 
  734 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
  735    if the built-in stack extension method is used).
  736 
  737    Do not make this value too large; the results are undefined if
  738    SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
  739    evaluated with infinite-precision integer arithmetic.  */
  740 
  741 #if YYMAXDEPTH == 0
  742 # undef YYMAXDEPTH
  743 #endif
  744 
  745 #ifndef YYMAXDEPTH
  746 # define YYMAXDEPTH 10000
  747 #endif
  748 
  749 
  750 
  751 #if YYERROR_VERBOSE
  752 
  753 # ifndef yystrlen
  754 #  if defined (__GLIBC__) && defined (_STRING_H)
  755 #   define yystrlen strlen
  756 #  else
  757 /* Return the length of YYSTR.  */
  758 static YYSIZE_T
  759 #   if defined (__STDC__) || defined (__cplusplus)
  760 yystrlen (const char *yystr)
  761 #   else
  762 yystrlen (yystr)
  763      const char *yystr;
  764 #   endif
  765 {
  766   register const char *yys = yystr;
  767 
  768   while (*yys++ != '\0')
  769     continue;
  770 
  771   return yys - yystr - 1;
  772 }
  773 #  endif
  774 # endif
  775 
  776 # ifndef yystpcpy
  777 #  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
  778 #   define yystpcpy stpcpy
  779 #  else
  780 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
  781    YYDEST.  */
  782 static char *
  783 #   if defined (__STDC__) || defined (__cplusplus)
  784 yystpcpy (char *yydest, const char *yysrc)
  785 #   else
  786 yystpcpy (yydest, yysrc)
  787      char *yydest;
  788      const char *yysrc;
  789 #   endif
  790 {
  791   register char *yyd = yydest;
  792   register const char *yys = yysrc;
  793 
  794   while ((*yyd++ = *yys++) != '\0')
  795     continue;
  796 
  797   return yyd - 1;
  798 }
  799 #  endif
  800 # endif
  801 
  802 #endif /* !YYERROR_VERBOSE */
  803 
  804 
  805 
  806 #if YYDEBUG
  807 /*--------------------------------.
  808 | Print this symbol on YYOUTPUT.  |
  809 `--------------------------------*/
  810 
  811 #if defined (__STDC__) || defined (__cplusplus)
  812 static void
  813 yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
  814 #else
  815 static void
  816 yysymprint (yyoutput, yytype, yyvaluep)
  817     FILE *yyoutput;
  818     int yytype;
  819     YYSTYPE *yyvaluep;
  820 #endif
  821 {
  822   /* Pacify ``unused variable'' warnings.  */
  823   (void) yyvaluep;
  824 
  825   if (yytype < YYNTOKENS)
  826     {
  827       YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
  828 # ifdef YYPRINT
  829       YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
  830 # endif
  831     }
  832   else
  833     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
  834 
  835   switch (yytype)
  836     {
  837       default:
  838         break;
  839     }
  840   YYFPRINTF (yyoutput, ")");
  841 }
  842 
  843 #endif /* ! YYDEBUG */
  844 /*-----------------------------------------------.
  845 | Release the memory associated to this symbol.  |
  846 `-----------------------------------------------*/
  847 
  848 #if defined (__STDC__) || defined (__cplusplus)
  849 static void
  850 yydestruct (int yytype, YYSTYPE *yyvaluep)
  851 #else
  852 static void
  853 yydestruct (yytype, yyvaluep)
  854     int yytype;
  855     YYSTYPE *yyvaluep;
  856 #endif
  857 {
  858   /* Pacify ``unused variable'' warnings.  */
  859   (void) yyvaluep;
  860 
  861   switch (yytype)
  862     {
  863 
  864       default:
  865         break;
  866     }
  867 }
  868 
  869 
  870 /* Prevent warnings from -Wmissing-prototypes.  */
  871 
  872 #ifdef YYPARSE_PARAM
  873 # if defined (__STDC__) || defined (__cplusplus)
  874 int yyparse (void *YYPARSE_PARAM);
  875 # else
  876 int yyparse ();
  877 # endif
  878 #else /* ! YYPARSE_PARAM */
  879 #if defined (__STDC__) || defined (__cplusplus)
  880 int yyparse (void);
  881 #else
  882 int yyparse ();
  883 #endif
  884 #endif /* ! YYPARSE_PARAM */
  885 
  886 
  887 
  888 /* The lookahead symbol.  */
  889 int yychar;
  890 
  891 /* The semantic value of the lookahead symbol.  */
  892 YYSTYPE yylval;
  893 
  894 /* Number of syntax errors so far.  */
  895 int yynerrs;
  896 
  897 
  898 
  899 /*----------.
  900 | yyparse.  |
  901 `----------*/
  902 
  903 #ifdef YYPARSE_PARAM
  904 # if defined (__STDC__) || defined (__cplusplus)
  905 int yyparse (void *YYPARSE_PARAM)
  906 # else
  907 int yyparse (YYPARSE_PARAM)
  908   void *YYPARSE_PARAM;
  909 # endif
  910 #else /* ! YYPARSE_PARAM */
  911 #if defined (__STDC__) || defined (__cplusplus)
  912 int
  913 yyparse (void)
  914 #else
  915 int
  916 yyparse ()
  917 
  918 #endif
  919 #endif
  920 {
  921   
  922   register int yystate;
  923   register int yyn;
  924   int yyresult;
  925   /* Number of tokens to shift before error messages enabled.  */
  926   int yyerrstatus;
  927   /* Lookahead token as an internal (translated) token number.  */
  928   int yytoken = 0;
  929 
  930   /* Three stacks and their tools:
  931      `yyss': related to states,
  932      `yyvs': related to semantic values,
  933      `yyls': related to locations.
  934 
  935      Refer to the stacks thru separate pointers, to allow yyoverflow
  936      to reallocate them elsewhere.  */
  937 
  938   /* The state stack.  */
  939   short	yyssa[YYINITDEPTH];
  940   short *yyss = yyssa;
  941   register short *yyssp;
  942 
  943   /* The semantic value stack.  */
  944   YYSTYPE yyvsa[YYINITDEPTH];
  945   YYSTYPE *yyvs = yyvsa;
  946   register YYSTYPE *yyvsp;
  947 
  948 
  949 
  950 #define YYPOPSTACK   (yyvsp--, yyssp--)
  951 
  952   YYSIZE_T yystacksize = YYINITDEPTH;
  953 
  954   /* The variables used to return semantic value and location from the
  955      action routines.  */
  956   YYSTYPE yyval;
  957 
  958 
  959   /* When reducing, the number of symbols on the RHS of the reduced
  960      rule.  */
  961   int yylen;
  962 
  963   YYDPRINTF ((stderr, "Starting parse\n"));
  964 
  965   yystate = 0;
  966   yyerrstatus = 0;
  967   yynerrs = 0;
  968   yychar = YYEMPTY;		/* Cause a token to be read.  */
  969 
  970   /* Initialize stack pointers.
  971      Waste one element of value and location stack
  972      so that they stay on the same level as the state stack.
  973      The wasted elements are never initialized.  */
  974 
  975   yyssp = yyss;
  976   yyvsp = yyvs;
  977 
  978   goto yysetstate;
  979 
  980 /*------------------------------------------------------------.
  981 | yynewstate -- Push a new state, which is found in yystate.  |
  982 `------------------------------------------------------------*/
  983  yynewstate:
  984   /* In all cases, when you get here, the value and location stacks
  985      have just been pushed. so pushing a state here evens the stacks.
  986      */
  987   yyssp++;
  988 
  989  yysetstate:
  990   *yyssp = yystate;
  991 
  992   if (yyss + yystacksize - 1 <= yyssp)
  993     {
  994       /* Get the current used size of the three stacks, in elements.  */
  995       YYSIZE_T yysize = yyssp - yyss + 1;
  996 
  997 #ifdef yyoverflow
  998       {
  999 	/* Give user a chance to reallocate the stack. Use copies of
 1000 	   these so that the &'s don't force the real ones into
 1001 	   memory.  */
 1002 	YYSTYPE *yyvs1 = yyvs;
 1003 	short *yyss1 = yyss;
 1004 
 1005 
 1006 	/* Each stack pointer address is followed by the size of the
 1007 	   data in use in that stack, in bytes.  This used to be a
 1008 	   conditional around just the two extra args, but that might
 1009 	   be undefined if yyoverflow is a macro.  */
 1010 	yyoverflow ("parser stack overflow",
 1011 		    &yyss1, yysize * sizeof (*yyssp),
 1012 		    &yyvs1, yysize * sizeof (*yyvsp),
 1013 
 1014 		    &yystacksize);
 1015 
 1016 	yyss = yyss1;
 1017 	yyvs = yyvs1;
 1018       }
 1019 #else /* no yyoverflow */
 1020 # ifndef YYSTACK_RELOCATE
 1021       goto yyoverflowlab;
 1022 # else
 1023       /* Extend the stack our own way.  */
 1024       if (YYMAXDEPTH <= yystacksize)
 1025 	goto yyoverflowlab;
 1026       yystacksize *= 2;
 1027       if (YYMAXDEPTH < yystacksize)
 1028 	yystacksize = YYMAXDEPTH;
 1029 
 1030       {
 1031 	short *yyss1 = yyss;
 1032 	union yyalloc *yyptr =
 1033 	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
 1034 	if (! yyptr)
 1035 	  goto yyoverflowlab;
 1036 	YYSTACK_RELOCATE (yyss);
 1037 	YYSTACK_RELOCATE (yyvs);
 1038 
 1039 #  undef YYSTACK_RELOCATE
 1040 	if (yyss1 != yyssa)
 1041 	  YYSTACK_FREE (yyss1);
 1042       }
 1043 # endif
 1044 #endif /* no yyoverflow */
 1045 
 1046       yyssp = yyss + yysize - 1;
 1047       yyvsp = yyvs + yysize - 1;
 1048 
 1049 
 1050       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
 1051 		  (unsigned long int) yystacksize));
 1052 
 1053       if (yyss + yystacksize - 1 <= yyssp)
 1054 	YYABORT;
 1055     }
 1056 
 1057   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
 1058 
 1059   goto yybackup;
 1060 
 1061 /*-----------.
 1062 | yybackup.  |
 1063 `-----------*/
 1064 yybackup:
 1065 
 1066 /* Do appropriate processing given the current state.  */
 1067 /* Read a lookahead token if we need one and don't already have one.  */
 1068 /* yyresume: */
 1069 
 1070   /* First try to decide what to do without reference to lookahead token.  */
 1071 
 1072   yyn = yypact[yystate];
 1073   if (yyn == YYPACT_NINF)
 1074     goto yydefault;
 1075 
 1076   /* Not known => get a lookahead token if don't already have one.  */
 1077 
 1078   /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
 1079   if (yychar == YYEMPTY)
 1080     {
 1081       YYDPRINTF ((stderr, "Reading a token: "));
 1082       yychar = YYLEX;
 1083     }
 1084 
 1085   if (yychar <= YYEOF)
 1086     {
 1087       yychar = yytoken = YYEOF;
 1088       YYDPRINTF ((stderr, "Now at end of input.\n"));
 1089     }
 1090   else
 1091     {
 1092       yytoken = YYTRANSLATE (yychar);
 1093       YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
 1094     }
 1095 
 1096   /* If the proper action on seeing token YYTOKEN is to reduce or to
 1097      detect an error, take that action.  */
 1098   yyn += yytoken;
 1099   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
 1100     goto yydefault;
 1101   yyn = yytable[yyn];
 1102   if (yyn <= 0)
 1103     {
 1104       if (yyn == 0 || yyn == YYTABLE_NINF)
 1105 	goto yyerrlab;
 1106       yyn = -yyn;
 1107       goto yyreduce;
 1108     }
 1109 
 1110   if (yyn == YYFINAL)
 1111     YYACCEPT;
 1112 
 1113   /* Shift the lookahead token.  */
 1114   YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
 1115 
 1116   /* Discard the token being shifted unless it is eof.  */
 1117   if (yychar != YYEOF)
 1118     yychar = YYEMPTY;
 1119 
 1120   *++yyvsp = yylval;
 1121 
 1122 
 1123   /* Count tokens shifted since error; after three, turn off error
 1124      status.  */
 1125   if (yyerrstatus)
 1126     yyerrstatus--;
 1127 
 1128   yystate = yyn;
 1129   goto yynewstate;
 1130 
 1131 
 1132 /*-----------------------------------------------------------.
 1133 | yydefault -- do the default action for the current state.  |
 1134 `-----------------------------------------------------------*/
 1135 yydefault:
 1136   yyn = yydefact[yystate];
 1137   if (yyn == 0)
 1138     goto yyerrlab;
 1139   goto yyreduce;
 1140 
 1141 
 1142 /*-----------------------------.
 1143 | yyreduce -- Do a reduction.  |
 1144 `-----------------------------*/
 1145 yyreduce:
 1146   /* yyn is the number of a rule to reduce with.  */
 1147   yylen = yyr2[yyn];
 1148 
 1149   /* If YYLEN is nonzero, implement the default value of the action:
 1150      `$$ = $1'.
 1151 
 1152      Otherwise, the following line sets YYVAL to garbage.
 1153      This behavior is undocumented and Bison
 1154      users should not rely upon it.  Assigning to YYVAL
 1155      unconditionally makes the parser a bit smaller, and it avoids a
 1156      GCC warning that YYVAL may be used uninitialized.  */
 1157   yyval = yyvsp[1-yylen];
 1158 
 1159 
 1160   YY_REDUCE_PRINT (yyn);
 1161   switch (yyn)
 1162     {
 1163         case 2:
 1164 #line 59 "xcc.y"
 1165     { yyval = create_AST(AST_translation_unit_single, 1, yyvsp[0]);
 1166 	  ast_root = yyval; ;}
 1167     break;
 1168 
 1169   case 3:
 1170 #line 62 "xcc.y"
 1171     { yyval = create_AST(AST_translation_unit_pair, 2, yyvsp[-1], yyvsp[0]);
 1172 	  ast_root = yyval; ;}
 1173     break;
 1174 
 1175   case 4:
 1176 #line 68 "xcc.y"
 1177     { yyval = create_AST(AST_external_declaration_func, 1, yyvsp[0]); ;}
 1178     break;
 1179 
 1180   case 5:
 1181 #line 70 "xcc.y"
 1182     { yyval = create_AST(AST_external_declaration_dec, 1, yyvsp[0]);
 1183 	  symbol_table.arg = NULL;
 1184 	  symbol_table.label = NULL;
 1185 	  symbol_table.string = NULL; ;}
 1186     break;
 1187 
 1188   case 6:
 1189 #line 78 "xcc.y"
 1190     { yyval = create_AST(AST_dummy, 2, yyvsp[-1], yyvsp[0]);
 1191 	  yyval->type = type_analyze_declarator(yyvsp[0], yyvsp[-1]->type);
 1192 	  symbol_entry_param(yyval->type);
 1193 	  symbol_entry(yyval);
 1194 	  symbol_begin_function(); ;}
 1195     break;
 1196 
 1197   case 7:
 1198 #line 84 "xcc.y"
 1199     { yyval = create_AST(AST_function_definition, 3, yyvsp[-3], yyvsp[-1], yyvsp[0]);
 1200 	  symbol_backpatch(yyval, yyvsp[-1]->type);
 1201 	  symbol_end_function(yyval); ;}
 1202     break;
 1203 
 1204   case 8:
 1205 #line 91 "xcc.y"
 1206     { yyval = create_AST(AST_declaration_list_null, 0); ;}
 1207     break;
 1208 
 1209   case 9:
 1210 #line 93 "xcc.y"
 1211     { yyval = create_AST(AST_declaration_list_pair, 2, yyvsp[-1], yyvsp[0]); ;}
 1212     break;
 1213 
 1214   case 10:
 1215 #line 98 "xcc.y"
 1216     { yyval = create_AST(AST_declaration, 2, yyvsp[-2], yyvsp[-1]);
 1217 	  yyval->type = type_analyze_declarator(yyvsp[-1], yyvsp[-2]->type);
 1218 	  symbol_entry(yyval); ;}
 1219     break;
 1220 
 1221   case 11:
 1222 #line 105 "xcc.y"
 1223     { yyval = create_AST(AST_type_specifier_void, 0);
 1224 	  yyval->type = create_prim_type(PRIM_TYPE_VOID); ;}
 1225     break;
 1226 
 1227   case 12:
 1228 #line 108 "xcc.y"
 1229     { yyval = create_AST(AST_type_specifier_int, 0);
 1230 	  yyval->type = create_prim_type(PRIM_TYPE_INT); ;}
 1231     break;
 1232 
 1233   case 13:
 1234 #line 111 "xcc.y"
 1235     { yyval = create_AST(AST_type_specifier_char, 0);
 1236 	  yyval->type = create_prim_type(PRIM_TYPE_CHAR); ;}
 1237     break;
 1238 
 1239   case 14:
 1240 #line 117 "xcc.y"
 1241     { yyval = create_AST(AST_declarator_id, 1, yyvsp[0]); ;}
 1242     break;
 1243 
 1244   case 15:
 1245 #line 119 "xcc.y"
 1246     { yyval = create_AST(AST_declarator_pointer, 1, yyvsp[0]); ;}
 1247     break;
 1248 
 1249   case 16:
 1250 #line 121 "xcc.y"
 1251     { yyval = create_AST(AST_declarator_paren, 1, yyvsp[-1]); ;}
 1252     break;
 1253 
 1254   case 17:
 1255 #line 123 "xcc.y"
 1256     { yyval = create_AST(AST_declarator_func, 2, yyvsp[-3], yyvsp[-1]); ;}
 1257     break;
 1258 
 1259   case 18:
 1260 #line 125 "xcc.y"
 1261     { yyval = create_AST(AST_declarator_func_null, 1, yyvsp[-2]); ;}
 1262     break;
 1263 
 1264   case 19:
 1265 #line 130 "xcc.y"
 1266     { yyval = create_AST(AST_parameter_list_single, 1, yyvsp[0]); ;}
 1267     break;
 1268 
 1269   case 20:
 1270 #line 132 "xcc.y"
 1271     { yyval = create_AST(AST_parameter_list_pair, 2, yyvsp[-2], yyvsp[0]); ;}
 1272     break;
 1273 
 1274   case 21:
 1275 #line 137 "xcc.y"
 1276     { yyval = create_AST(AST_parameter_declaration, 2, yyvsp[-1], yyvsp[0]);
 1277 	  yyval->type = type_analyze_declarator(yyvsp[0], yyvsp[-1]->type);
 1278 	  /* symbol_entry($$); */ ;}
 1279     break;
 1280 
 1281   case 22:
 1282 #line 144 "xcc.y"
 1283     { yyval = create_AST(AST_statement_list_single, 1, yyvsp[0]); ;}
 1284     break;
 1285 
 1286   case 23:
 1287 #line 146 "xcc.y"
 1288     { yyval = create_AST(AST_statement_list_pair, 2, yyvsp[-1], yyvsp[0]); ;}
 1289     break;
 1290 
 1291   case 24:
 1292 #line 151 "xcc.y"
 1293     { yyval = create_AST(AST_statement_null, 0); ;}
 1294     break;
 1295 
 1296   case 25:
 1297 #line 153 "xcc.y"
 1298     { yyval = create_AST(AST_statement_exp, 1, yyvsp[-1]); ;}
 1299     break;
 1300 
 1301   case 26:
 1302 #line 155 "xcc.y"
 1303     { yyval = create_AST(AST_statement_comp, 1, yyvsp[0]); ;}
 1304     break;
 1305 
 1306   case 27:
 1307 #line 157 "xcc.y"
 1308     { yyval = create_AST(AST_statement_if, 2, yyvsp[-2], yyvsp[0]); ;}
 1309     break;
 1310 
 1311   case 28:
 1312 #line 159 "xcc.y"
 1313     { yyval = create_AST(AST_statement_if_else, 3, yyvsp[-4], yyvsp[-2], yyvsp[0]); ;}
 1314     break;
 1315 
 1316   case 29:
 1317 #line 161 "xcc.y"
 1318     { yyval = create_AST(AST_statement_while, 2, yyvsp[-2], yyvsp[0]); ;}
 1319     break;
 1320 
 1321   case 30:
 1322 #line 163 "xcc.y"
 1323     { yyval = create_AST(AST_statement_goto, 1, yyvsp[-1]); ;}
 1324     break;
 1325 
 1326   case 31:
 1327 #line 165 "xcc.y"
 1328     { yyval = create_AST(AST_statement_label, 2, yyvsp[-2], yyvsp[0]);
 1329 	  symbol_entry(yyval); ;}
 1330     break;
 1331 
 1332   case 32:
 1333 #line 168 "xcc.y"
 1334     { yyval = create_AST(AST_statement_return, 1, yyvsp[-1]); ;}
 1335     break;
 1336 
 1337   case 33:
 1338 #line 170 "xcc.y"
 1339     { yyval = create_AST(AST_statement_return_null, 0); ;}
 1340     break;
 1341 
 1342   case 34:
 1343 #line 175 "xcc.y"
 1344     { symbol_begin_block(); ;}
 1345     break;
 1346 
 1347   case 35:
 1348 #line 177 "xcc.y"
 1349     { symbol_middle_block(); ;}
 1350     break;
 1351 
 1352   case 36:
 1353 #line 179 "xcc.y"
 1354     { yyval = create_AST(AST_compound_statement, 2, yyvsp[-3], yyvsp[-1]);
 1355 	  symbol_end_block(yyval); ;}
 1356     break;
 1357 
 1358   case 37:
 1359 #line 185 "xcc.y"
 1360     { struct Symbol *symbol;
 1361 	  yyval = create_AST(AST_expression_id, 1, yyvsp[0]);
 1362 	  symbol = symbol_check_var_decl(yyval);
 1363 	  yyval->type = symbol->type; ;}
 1364     break;
 1365 
 1366   case 38:
 1367 #line 190 "xcc.y"
 1368     { yyval = create_AST(AST_expression_int, 1, atoi(yytext));
 1369 	  yyval->type = types.t_int; ;}
 1370     break;
 1371 
 1372   case 39:
 1373 #line 193 "xcc.y"
 1374     { yyval = create_AST(AST_expression_char, 1, yytext[1]);
 1375 	  yyval->type = types.t_int; ;}
 1376     break;
 1377 
 1378   case 40:
 1379 #line 196 "xcc.y"
 1380     { yyval = create_AST(AST_expression_string, 1, string_buf);
 1381 	  yyval->type = types.t_char_p;
 1382 	  string_entry(yyval->u.id); ;}
 1383     break;
 1384 
 1385   case 41:
 1386 #line 200 "xcc.y"
 1387     { yyval = create_AST(AST_expression_assign, 2, yyvsp[-2], yyvsp[0]);
 1388 	  yyval->type = yyvsp[-2]->type; ;}
 1389     break;
 1390 
 1391   case 42:
 1392 #line 203 "xcc.y"
 1393     { yyval = create_AST(AST_expression_lss, 2, yyvsp[-2], yyvsp[0]);
 1394 	  yyval->type = types.t_int; ;}
 1395     break;
 1396 
 1397   case 43:
 1398 #line 206 "xcc.y"
 1399     { yyval = create_AST(AST_expression_gtr, 2, yyvsp[-2], yyvsp[0]);
 1400 	  yyval->type = types.t_int; ;}
 1401     break;
 1402 
 1403   case 44:
 1404 #line 209 "xcc.y"
 1405     { yyval = create_AST(AST_expression_eq, 2, yyvsp[-2], yyvsp[0]);
 1406 	  yyval->type = types.t_int; ;}
 1407     break;
 1408 
 1409   case 45:
 1410 #line 212 "xcc.y"
 1411     { yyval = create_AST(AST_expression_neq, 2, yyvsp[-2], yyvsp[0]);
 1412 	  yyval->type = types.t_int; ;}
 1413     break;
 1414 
 1415   case 46:
 1416 #line 215 "xcc.y"
 1417     { yyval = create_AST(AST_expression_leq, 2, yyvsp[-2], yyvsp[0]);
 1418 	  yyval->type = types.t_int; ;}
 1419     break;
 1420 
 1421   case 47:
 1422 #line 218 "xcc.y"
 1423     { yyval = create_AST(AST_expression_geq, 2, yyvsp[-2], yyvsp[0]);
 1424 	  yyval->type = types.t_int; ;}
 1425     break;
 1426 
 1427   case 48:
 1428 #line 221 "xcc.y"
 1429     { yyval = create_AST(AST_expression_and, 2, yyvsp[-2], yyvsp[0]);
 1430 	  yyval->type = types.t_int; ;}
 1431     break;
 1432 
 1433   case 49:
 1434 #line 224 "xcc.y"
 1435     { yyval = create_AST(AST_expression_or, 2, yyvsp[-2], yyvsp[0]);
 1436 	  yyval->type = types.t_int; ;}
 1437     break;
 1438 
 1439   case 50:
 1440 #line 227 "xcc.y"
 1441     { yyval = create_AST(AST_expression_add, 2, yyvsp[-2], yyvsp[0]);
 1442 	  yyval->type = type_add(yyvsp[-2]->type, yyvsp[0]->type); ;}
 1443     break;
 1444 
 1445   case 51:
 1446 #line 230 "xcc.y"
 1447     { yyval = create_AST(AST_expression_sub, 2, yyvsp[-2], yyvsp[0]);
 1448 	  yyval->type = type_sub(yyvsp[-2]->type, yyvsp[0]->type); ;}
 1449     break;
 1450 
 1451   case 52:
 1452 #line 233 "xcc.y"
 1453     { yyval = create_AST(AST_expression_mult, 2, yyvsp[-2], yyvsp[0]);
 1454 	  yyval->type = types.t_int; ;}
 1455     break;
 1456 
 1457   case 53:
 1458 #line 236 "xcc.y"
 1459     { yyval = create_AST(AST_expression_div, 2, yyvsp[-2], yyvsp[0]);
 1460 	  yyval->type = types.t_int; ;}
 1461     break;
 1462 
 1463   case 54:
 1464 #line 239 "xcc.y"
 1465     { yyval = create_AST(AST_expression_mod, 2, yyvsp[-2], yyvsp[0]);
 1466 	  yyval->type = types.t_int; ;}
 1467     break;
 1468 
 1469   case 55:
 1470 #line 242 "xcc.y"
 1471     { yyval = create_AST(AST_expression_unary_address, 1, yyvsp[-1]);
 1472 	  yyval->type = create_pointer_type(yyvsp[-1]->type); ;}
 1473     break;
 1474 
 1475   case 56:
 1476 #line 245 "xcc.y"
 1477     { yyval = create_AST(AST_expression_unary_deref, 1, yyvsp[-1]);
 1478 	  yyval->type = type_check_pointer_deref(yyval, yyvsp[0]->type); ;}
 1479     break;
 1480 
 1481   case 57:
 1482 #line 248 "xcc.y"
 1483     { yyval = create_AST(AST_expression_unary_plus, 1, yyvsp[-1]);
 1484 	  yyval->type = types.t_int; ;}
 1485     break;
 1486 
 1487   case 58:
 1488 #line 251 "xcc.y"
 1489     { yyval = create_AST(AST_expression_unary_minus, 1, yyvsp[-1]);
 1490 	  yyval->type = types.t_int; ;}
 1491     break;
 1492 
 1493   case 59:
 1494 #line 254 "xcc.y"
 1495     { yyval = create_AST(AST_expression_unary_negative, 1, yyvsp[-1]);
 1496 	  yyval->type = types.t_int; ;}
 1497     break;
 1498 
 1499   case 60:
 1500 #line 257 "xcc.y"
 1501     { yyval = create_AST(AST_expression_func, 2, yyvsp[-3], yyvsp[-1]);
 1502 	  yyval->type = yyvsp[-3]->type->u.t_function.ret_type;
 1503 	  if (yyvsp[-1]->u2.arg_size - 24 > total_arg_size)
 1504 		total_arg_size = yyvsp[-1]->u2.arg_size - 24; ;}
 1505     break;
 1506 
 1507   case 61:
 1508 #line 262 "xcc.y"
 1509     { yyval = create_AST(AST_expression_func_null, 1, yyvsp[-2]);
 1510 	  yyval->type = yyvsp[-2]->type->u.t_function.ret_type; ;}
 1511     break;
 1512 
 1513   case 62:
 1514 #line 265 "xcc.y"
 1515     { yyval = create_AST(AST_expression_paren, 1, yyvsp[-1]);
 1516 	  yyval->type = yyvsp[-1]->type; ;}
 1517     break;
 1518 
 1519   case 63:
 1520 #line 271 "xcc.y"
 1521     { yyval = create_AST(AST_argument_expression_list_single, 1, yyvsp[0]);
 1522 	  yyval->u2.arg_size = ROUNDUP(yyvsp[0]->type->size, 4); ;}
 1523     break;
 1524 
 1525   case 64:
 1526 #line 274 "xcc.y"
 1527     { yyval = create_AST(AST_argument_expression_list_pair, 2, yyvsp[-2], yyvsp[0]);
 1528 	  yyval->u2.arg_size = yyvsp[-2]->u2.arg_size + ROUNDUP(yyvsp[0]->type->size, 4); ;}
 1529     break;
 1530 
 1531 
 1532     }
 1533 
 1534 /* Line 999 of yacc.c.  */
 1535 #line 1536 "xcc.tab.c"
 1536 
 1537   yyvsp -= yylen;
 1538   yyssp -= yylen;
 1539 
 1540 
 1541   YY_STACK_PRINT (yyss, yyssp);
 1542 
 1543   *++yyvsp = yyval;
 1544 
 1545 
 1546   /* Now `shift' the result of the reduction.  Determine what state
 1547      that goes to, based on the state we popped back to and the rule
 1548      number reduced by.  */
 1549 
 1550   yyn = yyr1[yyn];
 1551 
 1552   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
 1553   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
 1554     yystate = yytable[yystate];
 1555   else
 1556     yystate = yydefgoto[yyn - YYNTOKENS];
 1557 
 1558   goto yynewstate;
 1559 
 1560 
 1561 /*------------------------------------.
 1562 | yyerrlab -- here on detecting error |
 1563 `------------------------------------*/
 1564 yyerrlab:
 1565   /* If not already recovering from an error, report this error.  */
 1566   if (!yyerrstatus)
 1567     {
 1568       ++yynerrs;
 1569 #if YYERROR_VERBOSE
 1570       yyn = yypact[yystate];
 1571 
 1572       if (YYPACT_NINF < yyn && yyn < YYLAST)
 1573 	{
 1574 	  YYSIZE_T yysize = 0;
 1575 	  int yytype = YYTRANSLATE (yychar);
 1576 	  const char* yyprefix;
 1577 	  char *yymsg;
 1578 	  int yyx;
 1579 
 1580 	  /* Start YYX at -YYN if negative to avoid negative indexes in
 1581 	     YYCHECK.  */
 1582 	  int yyxbegin = yyn < 0 ? -yyn : 0;
 1583 
 1584 	  /* Stay within bounds of both yycheck and yytname.  */
 1585 	  int yychecklim = YYLAST - yyn;
 1586 	  int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
 1587 	  int yycount = 0;
 1588 
 1589 	  yyprefix = ", expecting ";
 1590 	  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
 1591 	    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
 1592 	      {
 1593 		yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
 1594 		yycount += 1;
 1595 		if (yycount == 5)
 1596 		  {
 1597 		    yysize = 0;
 1598 		    break;
 1599 		  }
 1600 	      }
 1601 	  yysize += (sizeof ("syntax error, unexpected ")
 1602 		     + yystrlen (yytname[yytype]));
 1603 	  yymsg = (char *) YYSTACK_ALLOC (yysize);
 1604 	  if (yymsg != 0)
 1605 	    {
 1606 	      char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
 1607 	      yyp = yystpcpy (yyp, yytname[yytype]);
 1608 
 1609 	      if (yycount < 5)
 1610 		{
 1611 		  yyprefix = ", expecting ";
 1612 		  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
 1613 		    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
 1614 		      {
 1615 			yyp = yystpcpy (yyp, yyprefix);
 1616 			yyp = yystpcpy (yyp, yytname[yyx]);
 1617 			yyprefix = " or ";
 1618 		      }
 1619 		}
 1620 	      yyerror (yymsg);
 1621 	      YYSTACK_FREE (yymsg);
 1622 	    }
 1623 	  else
 1624 	    yyerror ("syntax error; also virtual memory exhausted");
 1625 	}
 1626       else
 1627 #endif /* YYERROR_VERBOSE */
 1628 	yyerror ("syntax error");
 1629     }
 1630 
 1631 
 1632 
 1633   if (yyerrstatus == 3)
 1634     {
 1635       /* If just tried and failed to reuse lookahead token after an
 1636 	 error, discard it.  */
 1637 
 1638       /* Return failure if at end of input.  */
 1639       if (yychar == YYEOF)
 1640         {
 1641 	  /* Pop the error token.  */
 1642           YYPOPSTACK;
 1643 	  /* Pop the rest of the stack.  */
 1644 	  while (yyss < yyssp)
 1645 	    {
 1646 	      YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
 1647 	      yydestruct (yystos[*yyssp], yyvsp);
 1648 	      YYPOPSTACK;
 1649 	    }
 1650 	  YYABORT;
 1651         }
 1652 
 1653       YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
 1654       yydestruct (yytoken, &yylval);
 1655       yychar = YYEMPTY;
 1656 
 1657     }
 1658 
 1659   /* Else will try to reuse lookahead token after shifting the error
 1660      token.  */
 1661   goto yyerrlab1;
 1662 
 1663 
 1664 /*----------------------------------------------------.
 1665 | yyerrlab1 -- error raised explicitly by an action.  |
 1666 `----------------------------------------------------*/
 1667 yyerrlab1:
 1668   yyerrstatus = 3;	/* Each real token shifted decrements this.  */
 1669 
 1670   for (;;)
 1671     {
 1672       yyn = yypact[yystate];
 1673       if (yyn != YYPACT_NINF)
 1674 	{
 1675 	  yyn += YYTERROR;
 1676 	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
 1677 	    {
 1678 	      yyn = yytable[yyn];
 1679 	      if (0 < yyn)
 1680 		break;
 1681 	    }
 1682 	}
 1683 
 1684       /* Pop the current state because it cannot handle the error token.  */
 1685       if (yyssp == yyss)
 1686 	YYABORT;
 1687 
 1688       YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
 1689       yydestruct (yystos[yystate], yyvsp);
 1690       yyvsp--;
 1691       yystate = *--yyssp;
 1692 
 1693       YY_STACK_PRINT (yyss, yyssp);
 1694     }
 1695 
 1696   if (yyn == YYFINAL)
 1697     YYACCEPT;
 1698 
 1699   YYDPRINTF ((stderr, "Shifting error token, "));
 1700 
 1701   *++yyvsp = yylval;
 1702 
 1703 
 1704   yystate = yyn;
 1705   goto yynewstate;
 1706 
 1707 
 1708 /*-------------------------------------.
 1709 | yyacceptlab -- YYACCEPT comes here.  |
 1710 `-------------------------------------*/
 1711 yyacceptlab:
 1712   yyresult = 0;
 1713   goto yyreturn;
 1714 
 1715 /*-----------------------------------.
 1716 | yyabortlab -- YYABORT comes here.  |
 1717 `-----------------------------------*/
 1718 yyabortlab:
 1719   yyresult = 1;
 1720   goto yyreturn;
 1721 
 1722 #ifndef yyoverflow
 1723 /*----------------------------------------------.
 1724 | yyoverflowlab -- parser overflow comes here.  |
 1725 `----------------------------------------------*/
 1726 yyoverflowlab:
 1727   yyerror ("parser stack overflow");
 1728   yyresult = 2;
 1729   /* Fall through.  */
 1730 #endif
 1731 
 1732 yyreturn:
 1733 #ifndef yyoverflow
 1734   if (yyss != yyssa)
 1735     YYSTACK_FREE (yyss);
 1736 #endif
 1737   return yyresult;
 1738 }
 1739 
 1740 
 1741 #line 278 "xcc.y"
 1742 
 1743 static void init(int argc, char *argv[]) {
 1744 	if (argc != 2) {
 1745 		fprintf(stderr, "Usage: %s filename\n", argv[0]);
 1746 		exit(1);
 1747 	}
 1748 	yyin = fopen(argv[1], "r");
 1749 	if (yyin == NULL) {
 1750 		fprintf(stderr, "can't open %s\n", argv[1]);
 1751 		exit(1);
 1752 	}
 1753 	types.t_void = create_prim_type(PRIM_TYPE_VOID);
 1754 	types.t_int = create_prim_type(PRIM_TYPE_INT);
 1755 	types.t_char = create_prim_type(PRIM_TYPE_CHAR);
 1756 	types.t_char_p = create_pointer_type(types.t_char);
 1757 	xcc_out = stdout;
 1758 }
 1759 
 1760 int yyerror(char *mesg) {
 1761 	fprintf(stderr, "yyerror: %d: %s around `%s'\n", line_index, mesg, yytext);
 1762 	exit(1);
 1763 }
 1764 
 1765 void *emalloc(size_t nbytes) {
 1766 	void *p = malloc(nbytes);
 1767 
 1768 	if (p == NULL)
 1769 		perror("malloc");
 1770 	return p;
 1771 }
 1772 
 1773 void efree(void *ptr) {
 1774 	free (ptr);
 1775 }
 1776 
 1777 int main(int argc, char *argv[]) {
 1778 	FILE *fp;
 1779 
 1780 	init(argc, argv);
 1781 	yyparse();
 1782 #if DEBUG
 1783 	fp = fopen("debug.xml", "w");
 1784 	if (fp == NULL) {
 1785 		fprintf(stderr, "can't open %debug.xml\n");
 1786 		exit(1);
 1787 	}
 1788 	debug(ast_root, fp);
 1789 	fclose(fp);
 1790 #endif
 1791 	start_code(argv[1]);
 1792 	codegen(ast_root);
 1793 	end_code();
 1794 	fclose(yyin);
 1795 }
 1796