Logo Search packages:      
Sourcecode: heaplayers version File versions

parser.c

/* A Bison parser, made from parser.y, by GNU bison 1.75.  */

/* Skeleton parser for Yacc-like parsing with Bison,
   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc.

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2, or (at your option)
   any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.  */

/* As a special exception, when this file is copied by Bison into a
   Bison output file, you may use that output file without restriction.
   This special exception was added by the Free Software Foundation
   in version 1.24 of Bison.  */

/* Written by Richard Stallman by simplifying the original so called
   ``semantic'' parser.  */

/* All symbols defined below should begin with yy or YY, to avoid
   infringing on user name space.  This should be done even for local
   variables, as they might otherwise be expanded by user macros.
   There are some unavoidable exceptions within include files to
   define necessary library symbols; they are noted "INFRINGES ON
   USER NAME SPACE" below.  */

/* Identify Bison output.  */
#define YYBISON   1

/* Pure parsers.  */
#define YYPURE    0

/* Using locations.  */
#define YYLSP_NEEDED 0



/* Tokens.  */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
   /* Put the tokens into the symbol table, so that GDB and other debuggers
      know about them.  */
   enum yytokentype {
     FUNCTION = 258,
     IF = 259,
     ELSE = 260,
     WHILE = 261,
     ASSIGN = 262,
     QUOTE = 263,
     MEXIT = 264,
     LOOP = 265,
     INTEGER = 266,
     STRING = 267,
     SYMBOL = 268,
     MODULE = 269,
     LIBRARY = 270,
     IMPORTS = 271,
     DEFINES = 272,
     READS = 273,
     WRITES = 274,
     OR = 275,
     SC_OR = 276,
     AND = 277,
     SC_AND = 278,
     GE = 279,
     GT = 280,
     LE = 281,
     LT = 282,
     NE = 283,
     EQ = 284,
     SHIFT_RIGHT = 285,
     SHIFT_LEFT = 286,
     UMINUS = 287,
     NOT = 288
   };
#endif
#define FUNCTION 258
#define IF 259
#define ELSE 260
#define WHILE 261
#define ASSIGN 262
#define QUOTE 263
#define MEXIT 264
#define LOOP 265
#define INTEGER 266
#define STRING 267
#define SYMBOL 268
#define MODULE 269
#define LIBRARY 270
#define IMPORTS 271
#define DEFINES 272
#define READS 273
#define WRITES 274
#define OR 275
#define SC_OR 276
#define AND 277
#define SC_AND 278
#define GE 279
#define GT 280
#define LE 281
#define LT 282
#define NE 283
#define EQ 284
#define SHIFT_RIGHT 285
#define SHIFT_LEFT 286
#define UMINUS 287
#define NOT 288




/* Copy the first part of user declarations.  */
#line 1 "parser.y"

#include "mudlle.h"
#include "tree.h"
#include "utils.h"
#include "calloc.h"
#include "types.h"
#include "compile.h"
#include "mparser.h"
#include <stdlib.h>
#include <string.h>
#line 45 "parser.y"


#include "lexer.h"

static mfile parsed_code;
block_t parser_memory;

void yyerror(const char *s)
{
  error("%s around line %d of %s", s, lineno, filename);
}

static component make_binary(unsigned int op, component arg1, component arg2)
{
  return new_component(parser_memory, c_builtin, op, 2, arg1, arg2);
}

static component make_unary(unsigned int op, component arg)
{
  return new_component(parser_memory, c_builtin, op, 1, arg);
}

void parser_init(void)
{
}

static block_t line_memory;

mfile parse(block_t heap)
{
  int result;

  parser_memory = heap;
  line_memory = new_block();
  erred = FALSE;
  result = yyparse();
  free_block(line_memory);
  line_memory = parser_memory = NULL;

  return result == 0 && !erred ? parsed_code : NULL;
}

static struct lstack {
  struct lstack *next;
  int lineno;
  const char *filename;
} *lstack;

static void lpush(int lineno, const char *filename)
{
  struct lstack *newp = allocate(line_memory, sizeof *newp);

  newp->next = lstack;
  lstack = newp;

  newp->lineno = lineno;
  newp->filename = filename;
}

static void lpop(int *lineno, const char **filename)
{
  *lineno = lstack->lineno;
  *filename = lstack->filename;
  lstack = lstack->next;
}

struct mkeyword {
  char *name;
  mtype value;
};

static struct mkeyword types[] = {
  { "int", type_integer },
  { "string", type_string },
  { "vector", type_vector },
  { "pair", type_pair },
  { "symbol", type_symbol },
  { "table", type_table },
  { "object", type_object },
  { "character", type_character },
  { "gone", type_gone },
  { "function", stype_function },
  { "list", stype_list },
  { "none", stype_none },
  { "any", stype_any },
  { "null", type_null }
};
#define NTYPES (sizeof types / sizeof(struct mkeyword))

mtype find_type(const char *name)
{
  int i;

  for (i = 0; i < NTYPES; i++)
    if (!stricmp(name, types[i].name))
      return types[i].value;

  error("unknown type %s", name);
  return stype_none;
}



/* Enabling traces.  */
#ifndef YYDEBUG
# define YYDEBUG 1
#endif

/* Enabling verbose error messages.  */
#ifdef YYERROR_VERBOSE
# undef YYERROR_VERBOSE
# define YYERROR_VERBOSE 1
#else
# define YYERROR_VERBOSE 0
#endif

#ifndef YYSTYPE
typedef int yystype;
# define YYSTYPE yystype
# define YYSTYPE_IS_TRIVIAL 1
#endif

#ifndef YYLTYPE
typedef struct yyltype
{
  int first_line;
  int first_column;
  int last_line;
  int last_column;
} yyltype;
# define YYLTYPE yyltype
# define YYLTYPE_IS_TRIVIAL 1
#endif

/* Copy the second part of user declarations.  */


/* Line 213 of /usr/share/bison/yacc.c.  */
#line 273 "parser.tab.c"

#if ! defined (yyoverflow) || YYERROR_VERBOSE

/* The parser invokes alloca or malloc; define the necessary symbols.  */

# if YYSTACK_USE_ALLOCA
#  define YYSTACK_ALLOC alloca
# else
#  ifndef YYSTACK_USE_ALLOCA
#   if defined (alloca) || defined (_ALLOCA_H)
#    define YYSTACK_ALLOC alloca
#   else
#    ifdef __GNUC__
#     define YYSTACK_ALLOC __builtin_alloca
#    endif
#   endif
#  endif
# endif

# ifdef YYSTACK_ALLOC
   /* Pacify GCC's `empty if-body' warning. */
#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
# else
#  if defined (__STDC__) || defined (__cplusplus)
#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
#   define YYSIZE_T size_t
#  endif
#  define YYSTACK_ALLOC malloc
#  define YYSTACK_FREE free
# endif
#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */


#if (! defined (yyoverflow) \
     && (! defined (__cplusplus) \
       || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))

/* A type that is properly aligned for any stack member.  */
union yyalloc
{
  short yyss;
  YYSTYPE yyvs;
  };

/* The size of the maximum gap between one aligned stack and the next.  */
# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)

/* The size of an array large to enough to hold all stacks, each with
   N elements.  */
# define YYSTACK_BYTES(N) \
     ((N) * (sizeof (short) + sizeof (YYSTYPE))                   \
      + YYSTACK_GAP_MAX)

/* Copy COUNT objects from FROM to TO.  The source and destination do
   not overlap.  */
# ifndef YYCOPY
#  if 1 < __GNUC__
#   define YYCOPY(To, From, Count) \
      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
#  else
#   define YYCOPY(To, From, Count)        \
      do                            \
      {                             \
        register YYSIZE_T yyi;            \
        for (yyi = 0; yyi < (Count); yyi++)     \
          (To)[yyi] = (From)[yyi];  \
      }                             \
      while (0)
#  endif
# endif

/* Relocate STACK from its old location to the new one.  The
   local variables YYSIZE and YYSTACKSIZE give the old and new number of
   elements in the stack, and YYPTR gives the new location of the
   stack.  Advance YYPTR to a properly aligned location for the next
   stack.  */
# define YYSTACK_RELOCATE(Stack)                            \
    do                                                      \
      {                                                     \
      YYSIZE_T yynewbytes;                                  \
      YYCOPY (&yyptr->Stack, Stack, yysize);                      \
      Stack = &yyptr->Stack;                                \
      yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX;     \
      yyptr += yynewbytes / sizeof (*yyptr);                      \
      }                                                     \
    while (0)

#endif

#if defined (__STDC__) || defined (__cplusplus)
   typedef signed char yysigned_char;
#else
   typedef short yysigned_char;
#endif

/* YYFINAL -- State number of the termination state. */
#define YYFINAL  3
#define YYLAST   437

/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS  50
/* YYNNTS -- Number of nonterminals. */
#define YYNNTS  47
/* YYNRULES -- Number of rules. */
#define YYNRULES  112
/* YYNRULES -- Number of states. */
#define YYNSTATES  198

/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
#define YYUNDEFTOK  2
#define YYMAXUTOK   288

#define YYTRANSLATE(X) \
  ((unsigned)(X) <= YYMAXUTOK ? yytranslate[X] : YYUNDEFTOK)

/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
static const unsigned char yytranslate[] =
{
       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,    40,    33,     2,
      47,    48,    38,    36,    49,    37,    20,    39,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,    44,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,    45,     2,    46,    32,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,    31,     2,    41,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
       5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
      15,    16,    17,    18,    19,    21,    22,    23,    24,    25,
      26,    27,    28,    29,    30,    34,    35,    42,    43
};

#if YYDEBUG
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
   YYRHS.  */
static const unsigned short yyprhs[] =
{
       0,     0,     3,     4,     7,     9,    11,    13,    15,    23,
      32,    34,    35,    38,    39,    42,    45,    46,    49,    50,
      53,    57,    59,    60,    62,    64,    66,    69,    73,    75,
      76,    78,    80,    84,    91,    93,    95,    97,    99,   101,
     108,   109,   112,   118,   121,   125,   126,   133,   134,   136,
     140,   142,   143,   145,   150,   154,   157,   159,   160,   162,
     164,   168,   172,   176,   180,   184,   188,   192,   196,   200,
     204,   208,   212,   216,   220,   224,   228,   232,   236,   240,
     244,   248,   251,   254,   257,   259,   261,   263,   265,   267,
     270,   272,   276,   281,   286,   287,   289,   293,   295,   297,
     301,   305,   307,   309,   310,   313,   315,   320,   326,   333,
     334,   336,   340
};

/* YYRHS -- A `-1'-separated list of the rules' RHS. */
static const yysigned_char yyrhs[] =
{
      51,     0,    -1,    -1,    52,    53,    -1,    54,    -1,    56,
      -1,    55,    -1,    62,    -1,    14,    57,    58,    60,    61,
      94,    64,    -1,    15,    13,    58,    59,    60,    61,    94,
      64,    -1,    13,    -1,    -1,    16,    95,    -1,    -1,    17,
      95,    -1,    18,    95,    -1,    -1,    19,    95,    -1,    -1,
      63,    64,    -1,    63,    44,    65,    -1,    65,    -1,    -1,
      44,    -1,    66,    -1,    69,    -1,    67,    65,    -1,    28,
      13,    26,    -1,    67,    -1,    -1,    70,    -1,    76,    -1,
      93,     7,    65,    -1,    85,    45,    65,    46,     7,    65,
      -1,    84,    -1,    71,    -1,    73,    -1,    74,    -1,    75,
      -1,     4,    47,    65,    48,    65,    72,    -1,    -1,     5,
      65,    -1,     6,    47,    65,    48,    65,    -1,    10,    65,
      -1,     9,    68,    69,    -1,    -1,    82,     3,    77,    78,
      79,    65,    -1,    -1,    12,    -1,    47,    80,    48,    -1,
      93,    -1,    -1,    81,    -1,    81,    49,    83,    93,    -1,
      81,    49,    93,    -1,    83,    93,    -1,    93,    -1,    -1,
      83,    -1,    13,    -1,    84,    20,    84,    -1,    84,    22,
      84,    -1,    84,    21,    84,    -1,    84,    24,    84,    -1,
      84,    23,    84,    -1,    84,    30,    84,    -1,    84,    29,
      84,    -1,    84,    28,    84,    -1,    84,    27,    84,    -1,
      84,    26,    84,    -1,    84,    25,    84,    -1,    84,    31,
      84,    -1,    84,    32,    84,    -1,    84,    33,    84,    -1,
      84,    35,    84,    -1,    84,    34,    84,    -1,    84,    36,
      84,    -1,    84,    37,    84,    -1,    84,    38,    84,    -1,
      84,    39,    84,    -1,    84,    40,    84,    -1,    37,    84,
      -1,    43,    84,    -1,    41,    84,    -1,    85,    -1,    87,
      -1,    86,    -1,    93,    -1,    91,    -1,     8,    90,    -1,
      94,    -1,    47,    65,    48,    -1,    85,    45,    65,    46,
      -1,    85,    47,    88,    48,    -1,    -1,    89,    -1,    89,
      49,    65,    -1,    65,    -1,    91,    -1,    45,    92,    46,
      -1,    47,    92,    48,    -1,    11,    -1,    12,    -1,    -1,
      92,    90,    -1,    13,    -1,    45,    65,    64,    46,    -1,
      45,    65,    44,    62,    46,    -1,    45,    31,    95,    31,
      62,    46,    -1,    -1,    96,    -1,    96,    49,    93,    -1,
      93,    -1
};

/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
static const unsigned short yyrline[] =
{
       0,   150,   150,   150,   152,   153,   154,   157,   160,   163,
     166,   167,   170,   171,   174,   177,   178,   181,   182,   185,
     188,   189,   192,   192,   194,   194,   196,   201,   203,   204,
     206,   207,   208,   209,   211,   214,   214,   214,   214,   216,
     225,   226,   229,   235,   241,   248,   247,   262,   263,   266,
     267,   270,   271,   274,   275,   276,   277,   280,   281,   284,
     287,   288,   289,   290,   291,   292,   293,   294,   295,   296,
     297,   298,   299,   300,   301,   302,   303,   304,   305,   306,
     307,   308,   309,   310,   311,   314,   315,   316,   317,   318,
     319,   320,   323,   327,   331,   332,   335,   336,   339,   340,
     341,   344,   345,   348,   349,   352,   355,   357,   359,   363,
     364,   367,   368
};
#endif

#if YYDEBUG || YYERROR_VERBOSE
/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
   First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
{
  "$end", "error", "$undefined", "FUNCTION", "IF", "ELSE", "WHILE", 
  "ASSIGN", "QUOTE", "MEXIT", "LOOP", "INTEGER", "STRING", "SYMBOL", 
  "MODULE", "LIBRARY", "IMPORTS", "DEFINES", "READS", "WRITES", "'.'", 
  "OR", "SC_OR", "AND", "SC_AND", "GE", "GT", "LE", "LT", "NE", "EQ", 
  "'|'", "'^'", "'&'", "SHIFT_RIGHT", "SHIFT_LEFT", "'+'", "'-'", "'*'", 
  "'/'", "'%'", "'~'", "UMINUS", "NOT", "';'", "'['", "']'", "'('", "')'", 
  "','", "$accept", "start", "@1", "entry_types", "simple", "module", 
  "library", "optional_symbol", "imports", "defines", "reads", "writes", 
  "expression_list", "expression_list1", "optional_semi", "expression", 
  "labeled_expression", "label", "optional_label", "e0", 
  "control_expression", "if", "optional_else", "while", "loop", "exit", 
  "function_expression", "@2", "optional_help", "parameters", "plist", 
  "plist1", "optional_type", "type", "e1", "e2", "array_ref", 
  "function_call", "call_list", "call_list1", "constant", 
  "simple_constant", "constant_list", "variable", "code_block", 
  "variable_list", "variable_list1", 0
};
#endif

# ifdef YYPRINT
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
   token YYLEX-NUM.  */
static const unsigned short yytoknum[] =
{
       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
      46,   275,   276,   277,   278,   279,   280,   281,   282,   283,
     284,   124,    94,    38,   285,   286,    43,    45,    42,    47,
      37,   126,   287,   288,    59,    91,    93,    40,    41,    44
};
# endif

/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
static const unsigned char yyr1[] =
{
       0,    50,    52,    51,    53,    53,    53,    54,    55,    56,
      57,    57,    58,    58,    59,    60,    60,    61,    61,    62,
      63,    63,    64,    64,    65,    65,    66,    67,    68,    68,
      69,    69,    69,    69,    69,    70,    70,    70,    70,    71,
      72,    72,    73,    74,    75,    77,    76,    78,    78,    79,
      79,    80,    80,    81,    81,    81,    81,    82,    82,    83,
      84,    84,    84,    84,    84,    84,    84,    84,    84,    84,
      84,    84,    84,    84,    84,    84,    84,    84,    84,    84,
      84,    84,    84,    84,    84,    85,    85,    85,    85,    85,
      85,    85,    86,    87,    88,    88,    89,    89,    90,    90,
      90,    91,    91,    92,    92,    93,    94,    94,    94,    95,
      95,    96,    96
};

/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
static const unsigned char yyr2[] =
{
       0,     2,     0,     2,     1,     1,     1,     1,     7,     8,
       1,     0,     2,     0,     2,     2,     0,     2,     0,     2,
       3,     1,     0,     1,     1,     1,     2,     3,     1,     0,
       1,     1,     3,     6,     1,     1,     1,     1,     1,     6,
       0,     2,     5,     2,     3,     0,     6,     0,     1,     3,
       1,     0,     1,     4,     3,     2,     1,     0,     1,     1,
       3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
       3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
       3,     2,     2,     2,     1,     1,     1,     1,     1,     2,
       1,     3,     4,     4,     0,     1,     3,     1,     1,     3,
       3,     1,     1,     0,     2,     1,     4,     5,     6,     0,
       1,     3,     1
};

/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
   means the default is an error.  */
static const unsigned char yydefact[] =
{
       2,     0,    57,     1,     0,     0,     0,    29,    57,   101,
     102,   105,    11,     0,     0,     0,     0,     0,    57,    57,
       3,     4,     6,     5,     7,    22,    21,    24,    57,    25,
      30,    35,    36,    37,    38,    31,     0,    58,    34,    84,
      86,    85,    88,    87,    90,    57,    57,   103,   103,    89,
      98,    28,    57,    43,    10,    13,    13,     0,   105,    81,
      84,    87,    83,    82,   109,    22,     0,    23,    19,    26,
      45,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,     0,    57,    57,    57,     0,     0,     0,     0,    44,
     109,    16,     0,    27,    57,   112,     0,   110,    23,     0,
      91,    20,    47,    60,    62,    61,    64,    63,    70,    69,
      68,    67,    66,    65,    71,    72,    73,    75,    74,    76,
      77,    78,    79,    80,     0,    97,     0,    95,    32,    57,
      57,    99,   104,   100,    12,   109,    18,   109,    16,     0,
      57,     0,     0,   106,    48,     0,    92,    93,    57,    40,
      42,    15,   109,     0,    14,    18,    92,     0,   111,   107,
      51,    57,    50,    57,    96,    57,    39,    17,    22,     0,
     108,     0,    52,     0,    56,    46,    33,    41,    23,     8,
      22,    49,     0,    55,     9,     0,    54,    53
};

/* YYDEFGOTO[NTERM-NUM]. */
static const short yydefgoto[] =
{
      -1,     1,     2,    20,    21,    22,    23,    55,   101,   148,
     146,   163,    24,    25,    68,    26,    27,    28,    52,    29,
      30,    31,   176,    32,    33,    34,    35,   112,   155,   171,
     181,   182,    36,    37,    38,    60,    40,    41,   136,   137,
     142,    42,    97,    61,    44,   106,   107
};

/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
   STATE-NUM.  */
#define YYPACT_NINF -169
static const short yypact[] =
{
    -169,    27,   238,  -169,   -19,    -7,   135,    17,   295,  -169,
    -169,     5,    35,    43,    47,   322,   322,   322,   284,   295,
    -169,  -169,  -169,  -169,  -169,    20,  -169,  -169,   295,  -169,
    -169,  -169,  -169,  -169,  -169,  -169,    58,  -169,   363,   -14,
    -169,  -169,  -169,    73,  -169,   295,   295,  -169,  -169,  -169,
    -169,  -169,   335,  -169,  -169,    66,    66,    63,  -169,  -169,
      25,  -169,  -169,  -169,    91,    64,    59,    75,  -169,  -169,
    -169,   322,   322,   322,   322,   322,   322,   322,   322,   322,
     322,   322,   322,   322,   322,   322,   322,   322,   322,   322,
     322,   322,   295,    26,   295,    62,    65,    30,    10,  -169,
      91,    97,    94,  -169,   295,  -169,    86,    70,    75,    77,
    -169,  -169,   109,   363,   381,   381,   397,   397,   163,   163,
     163,   163,   163,   163,   178,   178,    93,   -25,   -25,    61,
      61,  -169,  -169,  -169,    79,  -169,    88,    90,  -169,   295,
     295,  -169,  -169,  -169,  -169,    91,   123,    91,    97,   104,
     295,    91,   106,  -169,  -169,    12,   147,  -169,   295,   152,
    -169,  -169,    91,   110,  -169,   123,  -169,   112,  -169,  -169,
     151,   295,  -169,   295,  -169,   295,  -169,  -169,   119,   110,
    -169,   122,   126,    91,  -169,  -169,  -169,  -169,  -169,  -169,
     119,  -169,   151,  -169,  -169,    91,  -169,  -169
};

/* YYPGOTO[NTERM-NUM].  */
static const short yypgoto[] =
{
    -169,  -169,  -169,  -169,  -169,  -169,  -169,  -169,   121,  -169,
      31,    13,   -98,  -169,   -64,   116,  -169,   177,  -169,   133,
    -169,  -169,  -169,  -169,  -169,  -169,  -169,  -169,  -169,  -169,
    -169,  -169,  -169,  -168,   150,     1,  -169,  -169,  -169,  -169,
     180,    -1,   139,    -2,  -156,   -96,  -169
};

/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
   positive, shift that token.  If negative, reduce the rule which
   number is the opposite.  If zero, do what YYDEFACT says.
   If YYTABLE_NINF, parse error.  */
#define YYTABLE_NINF -95
static const short yytable[] =
{
      43,   109,   183,    39,   144,    50,    43,   178,   -59,    39,
     152,    87,    88,    89,    90,    91,    43,    43,   -59,    39,
      39,     9,    10,   190,   195,    58,    43,     3,    45,    39,
       4,    92,     5,    93,     6,     7,     8,     9,    10,    11,
      46,     9,    10,    43,    43,    14,    39,    39,    54,   161,
      43,   164,   167,    39,    14,    47,    56,    48,   143,   170,
      57,    70,   105,    15,    67,    43,   177,    16,    39,    17,
     104,    18,    93,    19,   -94,    47,   141,    48,   -57,     4,
      94,     5,   100,     6,     7,     8,     9,    10,    11,   103,
      43,    43,    43,    39,    39,    39,    50,    50,   105,    89,
      90,    91,    43,    14,    58,    39,    43,   110,   108,    39,
     139,   147,    15,   140,   189,   145,    16,   150,    17,   151,
      18,   154,    19,   153,    53,   156,   194,    85,    86,    87,
      88,    89,    90,    91,    65,    66,   157,    43,    43,   158,
      39,    39,   162,   105,    69,   105,     9,    10,    43,   168,
     166,    39,   169,   172,   173,    18,    43,   175,   180,    39,
     105,    95,    96,   188,    11,    59,    62,    63,   184,    43,
     191,    43,    39,    43,    39,   192,    39,   102,   179,   165,
      47,   193,    48,   111,    51,    99,    49,    98,     0,     0,
     196,     0,     0,   197,    82,    83,    84,    85,    86,    87,
      88,    89,    90,    91,     0,     0,     0,     0,   134,   135,
     138,    84,    85,    86,    87,    88,    89,    90,    91,     0,
     149,   113,   114,   115,   116,   117,   118,   119,   120,   121,
     122,   123,   124,   125,   126,   127,   128,   129,   130,   131,
     132,   133,     4,     0,     5,     0,     6,     7,     8,     9,
      10,    11,    12,    13,     0,   159,   160,     0,     0,     0,
       0,     0,     0,     0,     0,     0,    14,     0,     0,     0,
       0,     0,     0,     0,   174,    15,     0,     0,     0,    16,
       0,    17,     0,    18,     0,    19,     0,   185,     4,   186,
       5,   187,     6,     7,     8,     9,    10,    11,     0,     4,
       0,     5,     0,     6,     7,     8,     9,    10,    11,     0,
       0,     0,    14,     0,     0,    64,     0,     0,     0,     0,
       0,    15,     0,    14,     0,    16,     0,    17,     0,    18,
       6,    19,    15,     9,    10,    58,    16,     0,    17,     4,
      18,     5,    19,     6,     7,     8,     9,    10,    11,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,    15,
       0,     0,     0,    16,     0,    17,     0,    18,     0,    19,
       0,     0,    15,     0,     0,     0,    16,     0,    17,     0,
      18,     0,    19,    71,    72,    73,    74,    75,    76,    77,
      78,    79,    80,    81,    82,    83,    84,    85,    86,    87,
      88,    89,    90,    91,    74,    75,    76,    77,    78,    79,
      80,    81,    82,    83,    84,    85,    86,    87,    88,    89,
      90,    91,    76,    77,    78,    79,    80,    81,    82,    83,
      84,    85,    86,    87,    88,    89,    90,    91
};

static const short yycheck[] =
{
       2,    65,   170,     2,   100,     6,     8,   163,     3,     8,
     108,    36,    37,    38,    39,    40,    18,    19,    13,    18,
      19,    11,    12,   179,   192,    13,    28,     0,    47,    28,
       4,    45,     6,    47,     8,     9,    10,    11,    12,    13,
      47,    11,    12,    45,    46,    28,    45,    46,    13,   145,
      52,   147,   150,    52,    28,    45,    13,    47,    48,    47,
      13,     3,    64,    37,    44,    67,   162,    41,    67,    43,
      45,    45,    47,    47,    48,    45,    46,    47,     3,     4,
       7,     6,    16,     8,     9,    10,    11,    12,    13,    26,
      92,    93,    94,    92,    93,    94,    97,    98,   100,    38,
      39,    40,   104,    28,    13,   104,   108,    48,    44,   108,
      48,    17,    37,    48,   178,    18,    41,    31,    43,    49,
      45,    12,    47,    46,     8,    46,   190,    34,    35,    36,
      37,    38,    39,    40,    18,    19,    48,   139,   140,    49,
     139,   140,    19,   145,    28,   147,    11,    12,   150,   151,
      46,   150,    46,   155,     7,    45,   158,     5,    46,   158,
     162,    45,    46,    44,    13,    15,    16,    17,   170,   171,
      48,   173,   171,   175,   173,    49,   175,    56,   165,   148,
      45,   183,    47,    67,     7,    52,     6,    48,    -1,    -1,
     192,    -1,    -1,   195,    31,    32,    33,    34,    35,    36,
      37,    38,    39,    40,    -1,    -1,    -1,    -1,    92,    93,
      94,    33,    34,    35,    36,    37,    38,    39,    40,    -1,
     104,    71,    72,    73,    74,    75,    76,    77,    78,    79,
      80,    81,    82,    83,    84,    85,    86,    87,    88,    89,
      90,    91,     4,    -1,     6,    -1,     8,     9,    10,    11,
      12,    13,    14,    15,    -1,   139,   140,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    28,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,   158,    37,    -1,    -1,    -1,    41,
      -1,    43,    -1,    45,    -1,    47,    -1,   171,     4,   173,
       6,   175,     8,     9,    10,    11,    12,    13,    -1,     4,
      -1,     6,    -1,     8,     9,    10,    11,    12,    13,    -1,
      -1,    -1,    28,    -1,    -1,    31,    -1,    -1,    -1,    -1,
      -1,    37,    -1,    28,    -1,    41,    -1,    43,    -1,    45,
       8,    47,    37,    11,    12,    13,    41,    -1,    43,     4,
      45,     6,    47,     8,     9,    10,    11,    12,    13,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    37,
      -1,    -1,    -1,    41,    -1,    43,    -1,    45,    -1,    47,
      -1,    -1,    37,    -1,    -1,    -1,    41,    -1,    43,    -1,
      45,    -1,    47,    20,    21,    22,    23,    24,    25,    26,
      27,    28,    29,    30,    31,    32,    33,    34,    35,    36,
      37,    38,    39,    40,    23,    24,    25,    26,    27,    28,
      29,    30,    31,    32,    33,    34,    35,    36,    37,    38,
      39,    40,    25,    26,    27,    28,    29,    30,    31,    32,
      33,    34,    35,    36,    37,    38,    39,    40
};

/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
   symbol of state STATE-NUM.  */
static const unsigned char yystos[] =
{
       0,    51,    52,     0,     4,     6,     8,     9,    10,    11,
      12,    13,    14,    15,    28,    37,    41,    43,    45,    47,
      53,    54,    55,    56,    62,    63,    65,    66,    67,    69,
      70,    71,    73,    74,    75,    76,    82,    83,    84,    85,
      86,    87,    91,    93,    94,    47,    47,    45,    47,    90,
      91,    67,    68,    65,    13,    57,    13,    13,    13,    84,
      85,    93,    84,    84,    31,    65,    65,    44,    64,    65,
       3,    20,    21,    22,    23,    24,    25,    26,    27,    28,
      29,    30,    31,    32,    33,    34,    35,    36,    37,    38,
      39,    40,    45,    47,     7,    65,    65,    92,    92,    69,
      16,    58,    58,    26,    45,    93,    95,    96,    44,    64,
      48,    65,    77,    84,    84,    84,    84,    84,    84,    84,
      84,    84,    84,    84,    84,    84,    84,    84,    84,    84,
      84,    84,    84,    84,    65,    65,    88,    89,    65,    48,
      48,    46,    90,    48,    95,    18,    60,    17,    59,    65,
      31,    49,    62,    46,    12,    78,    46,    48,    49,    65,
      65,    95,    19,    61,    95,    60,    46,    62,    93,    46,
      47,    79,    93,     7,    65,     5,    72,    95,    94,    61,
      46,    80,    81,    83,    93,    65,    65,    65,    44,    64,
      94,    48,    49,    93,    64,    83,    93,    93
};

#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
# define YYSIZE_T __SIZE_TYPE__
#endif
#if ! defined (YYSIZE_T) && defined (size_t)
# define YYSIZE_T size_t
#endif
#if ! defined (YYSIZE_T)
# if defined (__STDC__) || defined (__cplusplus)
#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
#  define YYSIZE_T size_t
# endif
#endif
#if ! defined (YYSIZE_T)
# define YYSIZE_T unsigned int
#endif

#define yyerrok         (yyerrstatus = 0)
#define yyclearin (yychar = YYEMPTY)
#define YYEMPTY         -2
#define YYEOF           0

#define YYACCEPT  goto yyacceptlab
#define YYABORT         goto yyabortlab
#define YYERROR         goto yyerrlab1

/* Like YYERROR except do call yyerror.  This remains here temporarily
   to ease the transition to the new meaning of YYERROR, for GCC.
   Once GCC version 2 has supplanted version 1, this can go.  */

#define YYFAIL          goto yyerrlab

#define YYRECOVERING()  (!!yyerrstatus)

#define YYBACKUP(Token, Value)                              \
do                                              \
  if (yychar == YYEMPTY && yylen == 1)                      \
    {                                           \
      yychar = (Token);                               \
      yylval = (Value);                               \
      yychar1 = YYTRANSLATE (yychar);                       \
      YYPOPSTACK;                               \
      goto yybackup;                                  \
    }                                           \
  else                                                \
    {                                                 \
      yyerror ("syntax error: cannot back up");             \
      YYERROR;                                        \
    }                                           \
while (0)

#define YYTERROR  1
#define YYERRCODE 256

/* YYLLOC_DEFAULT -- Compute the default location (before the actions
   are run).  */

#ifndef YYLLOC_DEFAULT
# define YYLLOC_DEFAULT(Current, Rhs, N)           \
  Current.first_line   = Rhs[1].first_line;      \
  Current.first_column = Rhs[1].first_column;    \
  Current.last_line    = Rhs[N].last_line;       \
  Current.last_column  = Rhs[N].last_column;
#endif

/* YYLEX -- calling `yylex' with the right arguments.  */

#define YYLEX     yylex ()

/* Enable debugging if requested.  */
#if YYDEBUG

# ifndef YYFPRINTF
#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
#  define YYFPRINTF fprintf
# endif

# define YYDPRINTF(Args)                  \
do {                                \
  if (yydebug)                            \
    YYFPRINTF Args;                       \
} while (0)
# define YYDSYMPRINT(Args)                \
do {                                \
  if (yydebug)                            \
    yysymprint Args;                      \
} while (0)
/* Nonzero means print parse trace.  It is left uninitialized so that
   multiple parsers can coexist.  */
int yydebug;
#else /* !YYDEBUG */
# define YYDPRINTF(Args)
# define YYDSYMPRINT(Args)
#endif /* !YYDEBUG */

/* YYINITDEPTH -- initial size of the parser's stacks.  */
#ifndef     YYINITDEPTH
# define YYINITDEPTH 200
#endif

/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
   if the built-in stack extension method is used).

   Do not make this value too large; the results are undefined if
   SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
   evaluated with infinite-precision integer arithmetic.  */

#if YYMAXDEPTH == 0
# undef YYMAXDEPTH
#endif

#ifndef YYMAXDEPTH
# define YYMAXDEPTH 10000
#endif



#if YYERROR_VERBOSE

# ifndef yystrlen
#  if defined (__GLIBC__) && defined (_STRING_H)
#   define yystrlen strlen
#  else
/* Return the length of YYSTR.  */
static YYSIZE_T
#   if defined (__STDC__) || defined (__cplusplus)
yystrlen (const char *yystr)
#   else
yystrlen (yystr)
     const char *yystr;
#   endif
{
  register const char *yys = yystr;

  while (*yys++ != '\0')
    continue;

  return yys - yystr - 1;
}
#  endif
# endif

# ifndef yystpcpy
#  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
#   define yystpcpy stpcpy
#  else
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
   YYDEST.  */
static char *
#   if defined (__STDC__) || defined (__cplusplus)
yystpcpy (char *yydest, const char *yysrc)
#   else
yystpcpy (yydest, yysrc)
     char *yydest;
     const char *yysrc;
#   endif
{
  register char *yyd = yydest;
  register const char *yys = yysrc;

  while ((*yyd++ = *yys++) != '\0')
    continue;

  return yyd - 1;
}
#  endif
# endif

#endif /* !YYERROR_VERBOSE */



#if YYDEBUG
/*-----------------------------.
| Print this symbol on YYOUT.  |
`-----------------------------*/

static void
#if defined (__STDC__) || defined (__cplusplus)
yysymprint (FILE* yyout, int yytype, YYSTYPE yyvalue)
#else
yysymprint (yyout, yytype, yyvalue)
    FILE* yyout;
    int yytype;
    YYSTYPE yyvalue;
#endif
{
  /* Pacify ``unused variable'' warnings.  */
  (void) yyvalue;

  if (yytype < YYNTOKENS)
    {
      YYFPRINTF (yyout, "token %s (", yytname[yytype]);
# ifdef YYPRINT
      YYPRINT (yyout, yytoknum[yytype], yyvalue);
# endif
    }
  else
    YYFPRINTF (yyout, "nterm %s (", yytname[yytype]);

  switch (yytype)
    {
      default:
        break;
    }
  YYFPRINTF (yyout, ")");
}
#endif /* YYDEBUG. */


/*-----------------------------------------------.
| Release the memory associated to this symbol.  |
`-----------------------------------------------*/

static void
#if defined (__STDC__) || defined (__cplusplus)
yydestruct (int yytype, YYSTYPE yyvalue)
#else
yydestruct (yytype, yyvalue)
    int yytype;
    YYSTYPE yyvalue;
#endif
{
  /* Pacify ``unused variable'' warnings.  */
  (void) yyvalue;

  switch (yytype)
    {
      default:
        break;
    }
}



/* The user can define YYPARSE_PARAM as the name of an argument to be passed
   into yyparse.  The argument should have type void *.
   It should actually point to an object.
   Grammar actions can access the variable by casting it
   to the proper pointer type.  */

#ifdef YYPARSE_PARAM
# if defined (__STDC__) || defined (__cplusplus)
#  define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
#  define YYPARSE_PARAM_DECL
# else
#  define YYPARSE_PARAM_ARG YYPARSE_PARAM
#  define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
# endif
#else /* !YYPARSE_PARAM */
# define YYPARSE_PARAM_ARG
# define YYPARSE_PARAM_DECL
#endif /* !YYPARSE_PARAM */

/* Prevent warning if -Wstrict-prototypes.  */
#ifdef __GNUC__
# ifdef YYPARSE_PARAM
int yyparse (void *);
# else
int yyparse (void);
# endif
#endif


/* The lookahead symbol.  */
int yychar;

/* The semantic value of the lookahead symbol.  */
YYSTYPE yylval;

/* Number of parse errors so far.  */
int yynerrs;


int
yyparse (YYPARSE_PARAM_ARG)
     YYPARSE_PARAM_DECL
{
  
  register int yystate;
  register int yyn;
  int yyresult;
  /* Number of tokens to shift before error messages enabled.  */
  int yyerrstatus;
  /* Lookahead token as an internal (translated) token number.  */
  int yychar1 = 0;

  /* Three stacks and their tools:
     `yyss': related to states,
     `yyvs': related to semantic values,
     `yyls': related to locations.

     Refer to the stacks thru separate pointers, to allow yyoverflow
     to reallocate them elsewhere.  */

  /* The state stack.  */
  short     yyssa[YYINITDEPTH];
  short *yyss = yyssa;
  register short *yyssp;

  /* The semantic value stack.  */
  YYSTYPE yyvsa[YYINITDEPTH];
  YYSTYPE *yyvs = yyvsa;
  register YYSTYPE *yyvsp;



#define YYPOPSTACK   (yyvsp--, yyssp--)

  YYSIZE_T yystacksize = YYINITDEPTH;

  /* The variables used to return semantic value and location from the
     action routines.  */
  YYSTYPE yyval;


  /* When reducing, the number of symbols on the RHS of the reduced
     rule.  */
  int yylen;

  YYDPRINTF ((stderr, "Starting parse\n"));

  yystate = 0;
  yyerrstatus = 0;
  yynerrs = 0;
  yychar = YYEMPTY;           /* Cause a token to be read.  */

  /* Initialize stack pointers.
     Waste one element of value and location stack
     so that they stay on the same level as the state stack.
     The wasted elements are never initialized.  */

  yyssp = yyss;
  yyvsp = yyvs;

  goto yysetstate;

/*------------------------------------------------------------.
| yynewstate -- Push a new state, which is found in yystate.  |
`------------------------------------------------------------*/
 yynewstate:
  /* In all cases, when you get here, the value and location stacks
     have just been pushed. so pushing a state here evens the stacks.
     */
  yyssp++;

 yysetstate:
  *yyssp = yystate;

  if (yyssp >= yyss + yystacksize - 1)
    {
      /* Get the current used size of the three stacks, in elements.  */
      YYSIZE_T yysize = yyssp - yyss + 1;

#ifdef yyoverflow
      {
      /* Give user a chance to reallocate the stack. Use copies of
         these so that the &'s don't force the real ones into
         memory.  */
      YYSTYPE *yyvs1 = yyvs;
      short *yyss1 = yyss;


      /* Each stack pointer address is followed by the size of the
         data in use in that stack, in bytes.  This used to be a
         conditional around just the two extra args, but that might
         be undefined if yyoverflow is a macro.  */
      yyoverflow ("parser stack overflow",
                &yyss1, yysize * sizeof (*yyssp),
                &yyvs1, yysize * sizeof (*yyvsp),

                &yystacksize);

      yyss = yyss1;
      yyvs = yyvs1;
      }
#else /* no yyoverflow */
# ifndef YYSTACK_RELOCATE
      goto yyoverflowlab;
# else
      /* Extend the stack our own way.  */
      if (yystacksize >= YYMAXDEPTH)
      goto yyoverflowlab;
      yystacksize *= 2;
      if (yystacksize > YYMAXDEPTH)
      yystacksize = YYMAXDEPTH;

      {
      short *yyss1 = yyss;
      union yyalloc *yyptr =
        (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
      if (! yyptr)
        goto yyoverflowlab;
      YYSTACK_RELOCATE (yyss);
      YYSTACK_RELOCATE (yyvs);

#  undef YYSTACK_RELOCATE
      if (yyss1 != yyssa)
        YYSTACK_FREE (yyss1);
      }
# endif
#endif /* no yyoverflow */

      yyssp = yyss + yysize - 1;
      yyvsp = yyvs + yysize - 1;


      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
              (unsigned long int) yystacksize));

      if (yyssp >= yyss + yystacksize - 1)
      YYABORT;
    }

  YYDPRINTF ((stderr, "Entering state %d\n", yystate));

  goto yybackup;

/*-----------.
| yybackup.  |
`-----------*/
yybackup:

/* Do appropriate processing given the current state.  */
/* Read a lookahead token if we need one and don't already have one.  */
/* yyresume: */

  /* First try to decide what to do without reference to lookahead token.  */

  yyn = yypact[yystate];
  if (yyn == YYPACT_NINF)
    goto yydefault;

  /* Not known => get a lookahead token if don't already have one.  */

  /* yychar is either YYEMPTY or YYEOF
     or a valid token in external form.  */

  if (yychar == YYEMPTY)
    {
      YYDPRINTF ((stderr, "Reading a token: "));
      yychar = YYLEX;
    }

  /* Convert token to internal form (in yychar1) for indexing tables with.  */

  if (yychar <= 0)            /* This means end of input.  */
    {
      yychar1 = 0;
      yychar = YYEOF;         /* Don't call YYLEX any more.  */

      YYDPRINTF ((stderr, "Now at end of input.\n"));
    }
  else
    {
      yychar1 = YYTRANSLATE (yychar);

      /* We have to keep this `#if YYDEBUG', since we use variables
       which are defined only if `YYDEBUG' is set.  */
      YYDPRINTF ((stderr, "Next token is "));
      YYDSYMPRINT ((stderr, yychar1, yylval));
      YYDPRINTF ((stderr, "\n"));
    }

  /* If the proper action on seeing token YYCHAR1 is to reduce or to
     detect an error, take that action.  */
  yyn += yychar1;
  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yychar1)
    goto yydefault;
  yyn = yytable[yyn];
  if (yyn <= 0)
    {
      if (yyn == 0 || yyn == YYTABLE_NINF)
      goto yyerrlab;
      yyn = -yyn;
      goto yyreduce;
    }

  if (yyn == YYFINAL)
    YYACCEPT;

  /* Shift the lookahead token.  */
  YYDPRINTF ((stderr, "Shifting token %d (%s), ",
            yychar, yytname[yychar1]));

  /* Discard the token being shifted unless it is eof.  */
  if (yychar != YYEOF)
    yychar = YYEMPTY;

  *++yyvsp = yylval;


  /* Count tokens shifted since error; after three, turn off error
     status.  */
  if (yyerrstatus)
    yyerrstatus--;

  yystate = yyn;
  goto yynewstate;


/*-----------------------------------------------------------.
| yydefault -- do the default action for the current state.  |
`-----------------------------------------------------------*/
yydefault:
  yyn = yydefact[yystate];
  if (yyn == 0)
    goto yyerrlab;
  goto yyreduce;


/*-----------------------------.
| yyreduce -- Do a reduction.  |
`-----------------------------*/
yyreduce:
  /* yyn is the number of a rule to reduce with.  */
  yylen = yyr2[yyn];

  /* If YYLEN is nonzero, implement the default value of the action:
     `$$ = $1'.

     Otherwise, the following line sets YYVAL to garbage.
     This behavior is undocumented and Bison
     users should not rely upon it.  Assigning to YYVAL
     unconditionally makes the parser a bit smaller, and it avoids a
     GCC warning that YYVAL may be used uninitialized.  */
  yyval = yyvsp[1-yylen];



#if YYDEBUG
  /* We have to keep this `#if YYDEBUG', since we use variables which
     are defined only if `YYDEBUG' is set.  */
  if (yydebug)
    {
      int yyi;

      YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
             yyn - 1, yyrline[yyn]);

      /* Print the symbols being reduced, and their result.  */
      for (yyi = yyprhs[yyn]; yyrhs[yyi] >= 0; yyi++)
      YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
      YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
    }
#endif
  switch (yyn)
    {
        case 2:
#line 150 "parser.y"
    { lstack = NULL; }
    break;

  case 3:
#line 150 "parser.y"
    { parsed_code = yyvsp[0].tfile; }
    break;

  case 7:
#line 158 "parser.y"
    { yyval.tfile = new_file(parser_memory, f_plain, NULL, NULL, NULL, NULL, NULL, new_codeblock(parser_memory, NULL, yyvsp[0].tclist)); }
    break;

  case 8:
#line 161 "parser.y"
    { yyval.tfile = new_file(parser_memory, f_module, yyvsp[-5].symbol, yyvsp[-4].tvlist, NULL, yyvsp[-3].tvlist, yyvsp[-2].tvlist, yyvsp[-1].tblock); }
    break;

  case 9:
#line 164 "parser.y"
    { yyval.tfile = new_file(parser_memory, f_library, yyvsp[-6].symbol, yyvsp[-5].tvlist, yyvsp[-4].tvlist, yyvsp[-3].tvlist, yyvsp[-2].tvlist, yyvsp[-1].tblock); }
    break;

  case 11:
#line 168 "parser.y"
    { yyval.symbol = NULL; }
    break;

  case 12:
#line 171 "parser.y"
    { yyval.tvlist = yyvsp[0].tvlist; }
    break;

  case 13:
#line 172 "parser.y"
    { yyval.tvlist = NULL; }
    break;

  case 14:
#line 175 "parser.y"
    { yyval.tvlist = yyvsp[0].tvlist; }
    break;

  case 15:
#line 178 "parser.y"
    { yyval.tvlist = yyvsp[0].tvlist; }
    break;

  case 16:
#line 179 "parser.y"
    { yyval.tvlist = NULL; }
    break;

  case 17:
#line 182 "parser.y"
    { yyval.tvlist = yyvsp[0].tvlist; }
    break;

  case 18:
#line 183 "parser.y"
    { yyval.tvlist = NULL; }
    break;

  case 19:
#line 186 "parser.y"
    { yyval.tclist = reverse_clist(yyvsp[-1].tclist); }
    break;

  case 20:
#line 189 "parser.y"
    { yyval.tclist = new_clist(parser_memory, yyvsp[0].tcomponent, yyvsp[-2].tclist); }
    break;

  case 21:
#line 190 "parser.y"
    { yyval.tclist = new_clist(parser_memory, yyvsp[0].tcomponent, NULL); }
    break;

  case 26:
#line 197 "parser.y"
    { 
    yyval.tcomponent = new_component(parser_memory, c_labeled, yyvsp[-1].symbol, yyvsp[0].tcomponent); 
  }
    break;

  case 27:
#line 201 "parser.y"
    { yyval.symbol = yyvsp[-1].symbol; }
    break;

  case 28:
#line 203 "parser.y"
    { yyval.symbol = yyvsp[0].symbol; }
    break;

  case 29:
#line 204 "parser.y"
    { yyval.symbol = NULL; }
    break;

  case 31:
#line 208 "parser.y"
    { yyval.tcomponent = new_component(parser_memory, c_closure, yyvsp[0].tfunction); }
    break;

  case 32:
#line 209 "parser.y"
    { yyval.tcomponent = new_component(parser_memory, c_assign, yyvsp[-2].symbol, yyvsp[0].tcomponent); }
    break;

  case 33:
#line 211 "parser.y"
    { yyval.tcomponent = new_component(parser_memory, c_builtin, b_set, 3, yyvsp[-5].tcomponent, yyvsp[-3].tcomponent, yyvsp[0].tcomponent); }
    break;

  case 39:
#line 218 "parser.y"
    {
      if (yyvsp[0].tcomponent)
        yyval.tcomponent = new_component(parser_memory, c_builtin, b_ifelse, 3, yyvsp[-3].tcomponent, yyvsp[-1].tcomponent, yyvsp[0].tcomponent);
      else
        yyval.tcomponent = new_component(parser_memory, c_builtin, b_if, 2, yyvsp[-3].tcomponent, yyvsp[-1].tcomponent);
    }
    break;

  case 40:
#line 226 "parser.y"
    { yyval.tcomponent = NULL; }
    break;

  case 41:
#line 227 "parser.y"
    { yyval.tcomponent = yyvsp[0].tcomponent; }
    break;

  case 42:
#line 231 "parser.y"
    {
      yyval.tcomponent = new_component(parser_memory, c_builtin, b_while, 2, yyvsp[-2].tcomponent, yyvsp[0].tcomponent);
    }
    break;

  case 43:
#line 237 "parser.y"
    {
      yyval.tcomponent = new_component(parser_memory, c_builtin, b_loop, 1, yyvsp[0].tcomponent);
    }
    break;

  case 44:
#line 243 "parser.y"
    {
      yyval.tcomponent = new_component(parser_memory, c_exit, yyvsp[-1].symbol, yyvsp[0].tcomponent);
    }
    break;

  case 45:
#line 248 "parser.y"
    { lpush(lineno, filename); }
    break;

  case 46:
#line 250 "parser.y"
    {
      int l;
      const char *f;

      lpop(&l, &f);
      if (yyvsp[-1].tparameters.varargs)
      yyval.tfunction = new_vfunction(parser_memory, yyvsp[-5].tmtype, yyvsp[-2].string, yyvsp[-1].tparameters.var, yyvsp[0].tcomponent, l, f);
      else
        yyval.tfunction = new_function(parser_memory, yyvsp[-5].tmtype, yyvsp[-2].string, yyvsp[-1].tparameters.args, yyvsp[0].tcomponent, l, f);
    }
    break;

  case 47:
#line 263 "parser.y"
    { yyval.string = NULL; }
    break;

  case 49:
#line 267 "parser.y"
    { yyval.tparameters.varargs = FALSE; yyval.tparameters.args = yyvsp[-1].tvlist; }
    break;

  case 50:
#line 268 "parser.y"
    { yyval.tparameters.varargs = TRUE; yyval.tparameters.var = yyvsp[0].symbol; }
    break;

  case 51:
#line 271 "parser.y"
    { yyval.tvlist = NULL; }
    break;

  case 53:
#line 275 "parser.y"
    { yyval.tvlist = new_vlist(parser_memory, yyvsp[0].symbol, yyvsp[-1].tmtype, yyvsp[-3].tvlist); }
    break;

  case 54:
#line 276 "parser.y"
    { yyval.tvlist = new_vlist(parser_memory, yyvsp[0].symbol, stype_any, yyvsp[-2].tvlist); }
    break;

  case 55:
#line 277 "parser.y"
    { yyval.tvlist = new_vlist(parser_memory, yyvsp[0].symbol, yyvsp[-1].tmtype, NULL); }
    break;

  case 56:
#line 278 "parser.y"
    { yyval.tvlist = new_vlist(parser_memory, yyvsp[0].symbol, stype_any, NULL); }
    break;

  case 57:
#line 281 "parser.y"
    { yyval.tmtype = stype_any; }
    break;

  case 59:
#line 285 "parser.y"
    { yyval.tmtype = find_type(yyvsp[0].symbol); }
    break;

  case 60:
#line 288 "parser.y"
    { yyval.tcomponent = make_binary(b_cons, yyvsp[-2].tcomponent, yyvsp[0].tcomponent); }
    break;

  case 61:
#line 289 "parser.y"
    { yyval.tcomponent = make_binary(b_sc_or, yyvsp[-2].tcomponent, yyvsp[0].tcomponent); }
    break;

  case 62:
#line 290 "parser.y"
    { yyval.tcomponent = make_binary(b_or, yyvsp[-2].tcomponent, yyvsp[0].tcomponent); }
    break;

  case 63:
#line 291 "parser.y"
    { yyval.tcomponent = make_binary(b_sc_and, yyvsp[-2].tcomponent, yyvsp[0].tcomponent); }
    break;

  case 64:
#line 292 "parser.y"
    { yyval.tcomponent = make_binary(b_and, yyvsp[-2].tcomponent, yyvsp[0].tcomponent); }
    break;

  case 65:
#line 293 "parser.y"
    { yyval.tcomponent = make_binary(b_eq, yyvsp[-2].tcomponent, yyvsp[0].tcomponent); }
    break;

  case 66:
#line 294 "parser.y"
    { yyval.tcomponent = make_binary(b_ne, yyvsp[-2].tcomponent, yyvsp[0].tcomponent); }
    break;

  case 67:
#line 295 "parser.y"
    { yyval.tcomponent = make_binary(b_lt, yyvsp[-2].tcomponent, yyvsp[0].tcomponent); }
    break;

  case 68:
#line 296 "parser.y"
    { yyval.tcomponent = make_binary(b_le, yyvsp[-2].tcomponent, yyvsp[0].tcomponent); }
    break;

  case 69:
#line 297 "parser.y"
    { yyval.tcomponent = make_binary(b_gt, yyvsp[-2].tcomponent, yyvsp[0].tcomponent); }
    break;

  case 70:
#line 298 "parser.y"
    { yyval.tcomponent = make_binary(b_ge, yyvsp[-2].tcomponent, yyvsp[0].tcomponent); }
    break;

  case 71:
#line 299 "parser.y"
    { yyval.tcomponent = make_binary(b_bitor, yyvsp[-2].tcomponent, yyvsp[0].tcomponent); }
    break;

  case 72:
#line 300 "parser.y"
    { yyval.tcomponent = make_binary(b_bitxor, yyvsp[-2].tcomponent, yyvsp[0].tcomponent); }
    break;

  case 73:
#line 301 "parser.y"
    { yyval.tcomponent = make_binary(b_bitand, yyvsp[-2].tcomponent, yyvsp[0].tcomponent); }
    break;

  case 74:
#line 302 "parser.y"
    { yyval.tcomponent = make_binary(b_shift_left, yyvsp[-2].tcomponent, yyvsp[0].tcomponent); }
    break;

  case 75:
#line 303 "parser.y"
    { yyval.tcomponent = make_binary(b_shift_right, yyvsp[-2].tcomponent, yyvsp[0].tcomponent); }
    break;

  case 76:
#line 304 "parser.y"
    { yyval.tcomponent = make_binary(b_add, yyvsp[-2].tcomponent, yyvsp[0].tcomponent); }
    break;

  case 77:
#line 305 "parser.y"
    { yyval.tcomponent = make_binary(b_subtract, yyvsp[-2].tcomponent, yyvsp[0].tcomponent); }
    break;

  case 78:
#line 306 "parser.y"
    { yyval.tcomponent = make_binary(b_multiply, yyvsp[-2].tcomponent, yyvsp[0].tcomponent); }
    break;

  case 79:
#line 307 "parser.y"
    { yyval.tcomponent = make_binary(b_divide, yyvsp[-2].tcomponent, yyvsp[0].tcomponent); }
    break;

  case 80:
#line 308 "parser.y"
    { yyval.tcomponent = make_binary(b_remainder, yyvsp[-2].tcomponent, yyvsp[0].tcomponent); }
    break;

  case 81:
#line 309 "parser.y"
    { yyval.tcomponent = make_unary(b_negate, yyvsp[0].tcomponent); }
    break;

  case 82:
#line 310 "parser.y"
    { yyval.tcomponent = make_unary(b_not, yyvsp[0].tcomponent); }
    break;

  case 83:
#line 311 "parser.y"
    { yyval.tcomponent = make_unary(b_bitnot, yyvsp[0].tcomponent); }
    break;

  case 87:
#line 317 "parser.y"
    { yyval.tcomponent = new_component(parser_memory, c_recall, yyvsp[0].symbol); }
    break;

  case 88:
#line 318 "parser.y"
    { yyval.tcomponent = new_component(parser_memory, c_constant, yyvsp[0].tconstant); }
    break;

  case 89:
#line 319 "parser.y"
    { yyval.tcomponent = new_component(parser_memory, c_constant, yyvsp[0].tconstant); }
    break;

  case 90:
#line 320 "parser.y"
    { yyval.tcomponent = new_component(parser_memory, c_block, yyvsp[0].tblock); }
    break;

  case 91:
#line 321 "parser.y"
    { yyval.tcomponent = yyvsp[-1].tcomponent; }
    break;

  case 92:
#line 325 "parser.y"
    { yyval.tcomponent = new_component(parser_memory, c_builtin, b_ref, 2, yyvsp[-3].tcomponent, yyvsp[-1].tcomponent); }
    break;

  case 93:
#line 329 "parser.y"
    { yyval.tcomponent = new_component(parser_memory, c_execute, new_clist(parser_memory, yyvsp[-3].tcomponent, yyvsp[-1].tclist)); }
    break;

  case 94:
#line 332 "parser.y"
    { yyval.tclist = NULL; }
    break;

  case 95:
#line 333 "parser.y"
    { yyval.tclist = reverse_clist(yyvsp[0].tclist); }
    break;

  case 96:
#line 336 "parser.y"
    { yyval.tclist = new_clist(parser_memory, yyvsp[0].tcomponent, yyvsp[-2].tclist); }
    break;

  case 97:
#line 337 "parser.y"
    { yyval.tclist = new_clist(parser_memory, yyvsp[0].tcomponent, NULL); }
    break;

  case 99:
#line 341 "parser.y"
    { yyval.tconstant = new_constant(parser_memory, cst_array, yyvsp[-1].tcstlist); }
    break;

  case 100:
#line 342 "parser.y"
    { yyval.tconstant = new_constant(parser_memory, cst_list, yyvsp[-1].tcstlist); }
    break;

  case 101:
#line 345 "parser.y"
    { yyval.tconstant = new_constant(parser_memory, cst_int, yyvsp[0].integer); }
    break;

  case 102:
#line 346 "parser.y"
    { yyval.tconstant = new_constant(parser_memory, cst_string, yyvsp[0].string); }
    break;

  case 103:
#line 349 "parser.y"
    { yyval.tcstlist = NULL; }
    break;

  case 104:
#line 350 "parser.y"
    { yyval.tcstlist = new_cstlist(parser_memory, yyvsp[0].tconstant, yyvsp[-1].tcstlist); }
    break;

  case 106:
#line 357 "parser.y"
    { yyval.tblock = new_codeblock(parser_memory, NULL, new_clist(parser_memory, yyvsp[-2].tcomponent, NULL)); }
    break;

  case 107:
#line 359 "parser.y"
    { yyval.tblock = new_codeblock(parser_memory, NULL, new_clist(parser_memory, yyvsp[-3].tcomponent, yyvsp[-1].tclist)); }
    break;

  case 108:
#line 361 "parser.y"
    { yyval.tblock = new_codeblock(parser_memory, yyvsp[-3].tvlist, yyvsp[-1].tclist); }
    break;

  case 109:
#line 364 "parser.y"
    { yyval.tvlist = NULL; }
    break;

  case 111:
#line 368 "parser.y"
    { yyval.tvlist = new_vlist(parser_memory, yyvsp[0].symbol, stype_none, yyvsp[-2].tvlist); }
    break;

  case 112:
#line 369 "parser.y"
    { yyval.tvlist = new_vlist(parser_memory, yyvsp[0].symbol, stype_none, NULL); }
    break;


    }

/* Line 1016 of /usr/share/bison/yacc.c.  */
#line 1785 "parser.tab.c"

  yyvsp -= yylen;
  yyssp -= yylen;


#if YYDEBUG
  if (yydebug)
    {
      short *yyssp1 = yyss - 1;
      YYFPRINTF (stderr, "state stack now");
      while (yyssp1 != yyssp)
      YYFPRINTF (stderr, " %d", *++yyssp1);
      YYFPRINTF (stderr, "\n");
    }
#endif

  *++yyvsp = yyval;


  /* Now `shift' the result of the reduction.  Determine what state
     that goes to, based on the state we popped back to and the rule
     number reduced by.  */

  yyn = yyr1[yyn];

  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
    yystate = yytable[yystate];
  else
    yystate = yydefgoto[yyn - YYNTOKENS];

  goto yynewstate;


/*------------------------------------.
| yyerrlab -- here on detecting error |
`------------------------------------*/
yyerrlab:
  /* If not already recovering from an error, report this error.  */
  if (!yyerrstatus)
    {
      ++yynerrs;
#if YYERROR_VERBOSE
      yyn = yypact[yystate];

      if (YYPACT_NINF < yyn && yyn < YYLAST)
      {
        YYSIZE_T yysize = 0;
        int yytype = YYTRANSLATE (yychar);
        char *yymsg;
        int yyx, yycount;

        yycount = 0;
        /* Start YYX at -YYN if negative to avoid negative indexes in
           YYCHECK.  */
        for (yyx = yyn < 0 ? -yyn : 0;
             yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
          if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
            yysize += yystrlen (yytname[yyx]) + 15, yycount++;
        yysize += yystrlen ("parse error, unexpected ") + 1;
        yysize += yystrlen (yytname[yytype]);
        yymsg = (char *) YYSTACK_ALLOC (yysize);
        if (yymsg != 0)
          {
            char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
            yyp = yystpcpy (yyp, yytname[yytype]);

            if (yycount < 5)
            {
              yycount = 0;
              for (yyx = yyn < 0 ? -yyn : 0;
                   yyx < (int) (sizeof (yytname) / sizeof (char *));
                   yyx++)
                if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
                  {
                  const char *yyq = ! yycount ? ", expecting " : " or ";
                  yyp = yystpcpy (yyp, yyq);
                  yyp = yystpcpy (yyp, yytname[yyx]);
                  yycount++;
                  }
            }
            yyerror (yymsg);
            YYSTACK_FREE (yymsg);
          }
        else
          yyerror ("parse error; also virtual memory exhausted");
      }
      else
#endif /* YYERROR_VERBOSE */
      yyerror ("parse error");
    }
  goto yyerrlab1;


/*----------------------------------------------------.
| yyerrlab1 -- error raised explicitly by an action.  |
`----------------------------------------------------*/
yyerrlab1:
  if (yyerrstatus == 3)
    {
      /* If just tried and failed to reuse lookahead token after an
       error, discard it.  */

      /* Return failure if at end of input.  */
      if (yychar == YYEOF)
        {
        /* Pop the error token.  */
          YYPOPSTACK;
        /* Pop the rest of the stack.  */
        while (yyssp > yyss)
          {
            YYDPRINTF ((stderr, "Error: popping "));
            YYDSYMPRINT ((stderr,
                      yystos[*yyssp],
                      *yyvsp));
            YYDPRINTF ((stderr, "\n"));
            yydestruct (yystos[*yyssp], *yyvsp);
            YYPOPSTACK;
          }
        YYABORT;
        }

      YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
              yychar, yytname[yychar1]));
      yydestruct (yychar1, yylval);
      yychar = YYEMPTY;
    }

  /* Else will try to reuse lookahead token after shifting the error
     token.  */

  yyerrstatus = 3;      /* Each real token shifted decrements this.  */

  for (;;)
    {
      yyn = yypact[yystate];
      if (yyn != YYPACT_NINF)
      {
        yyn += YYTERROR;
        if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
          {
            yyn = yytable[yyn];
            if (0 < yyn)
            break;
          }
      }

      /* Pop the current state because it cannot handle the error token.  */
      if (yyssp == yyss)
      YYABORT;

      YYDPRINTF ((stderr, "Error: popping "));
      YYDSYMPRINT ((stderr,
                yystos[*yyssp], *yyvsp));
      YYDPRINTF ((stderr, "\n"));

      yydestruct (yystos[yystate], *yyvsp);
      yyvsp--;
      yystate = *--yyssp;


#if YYDEBUG
      if (yydebug)
      {
        short *yyssp1 = yyss - 1;
        YYFPRINTF (stderr, "Error: state stack now");
        while (yyssp1 != yyssp)
          YYFPRINTF (stderr, " %d", *++yyssp1);
        YYFPRINTF (stderr, "\n");
      }
#endif
    }

  if (yyn == YYFINAL)
    YYACCEPT;

  YYDPRINTF ((stderr, "Shifting error token, "));

  *++yyvsp = yylval;


  yystate = yyn;
  goto yynewstate;


/*-------------------------------------.
| yyacceptlab -- YYACCEPT comes here.  |
`-------------------------------------*/
yyacceptlab:
  yyresult = 0;
  goto yyreturn;

/*-----------------------------------.
| yyabortlab -- YYABORT comes here.  |
`-----------------------------------*/
yyabortlab:
  yyresult = 1;
  goto yyreturn;

#ifndef yyoverflow
/*----------------------------------------------.
| yyoverflowlab -- parser overflow comes here.  |
`----------------------------------------------*/
yyoverflowlab:
  yyerror ("parser stack overflow");
  yyresult = 2;
  /* Fall through.  */
#endif

yyreturn:
#ifndef yyoverflow
  if (yyss != yyssa)
    YYSTACK_FREE (yyss);
#endif
  return yyresult;
}


#line 371 "parser.y"



Generated by  Doxygen 1.6.0   Back to index