/* A Bison parser, made from parser.yy
   by GNU bison 1.35.  */

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

# define	ID	257
# define	LIT_INT	258
# define	LIT_REAL	259
# define	LIT_STRING	260
# define	LIT_CHR	261
# define	SEMI	262
# define	MODULE	263
# define	LBRACE	264
# define	RBRACE	265
# define	INTERFACE	266
# define	COLON	267
# define	EQUAL	268
# define	OR	269
# define	XOR	270
# define	AND	271
# define	LSHIFT	272
# define	RSHIFT	273
# define	ADD	274
# define	SUB	275
# define	MUL	276
# define	DIV	277
# define	MOD	278
# define	NEG	279
# define	SCOPE	280
# define	LPAREN	281
# define	RPAREN	282
# define	BTRUE	283
# define	BFALSE	284
# define	TYPEDEF	285
# define	COMMA	286
# define	FLOAT	287
# define	DOUBLE	288
# define	LONG	289
# define	SHORT	290
# define	UNSIGNED	291
# define	INT	292
# define	CHAR	293
# define	BOOLEAN	294
# define	OCTET	295
# define	ANY	296
# define	CONST	297
# define	STRUCT	298
# define	UNION	299
# define	SWITCH	300
# define	CASE	301
# define	DEFAULT	302
# define	ENUM	303
# define	SEQUENCE	304
# define	LT	305
# define	GT	306
# define	STRING	307
# define	LBRACK	308
# define	RBRACK	309
# define	EXCEPTION	310
# define	ONEWAY	311
# define	VOID	312
# define	IN	313
# define	INOUT	314
# define	OUT	315
# define	RAISES	316
# define	CONTEXT	317
# define	ATTRIBUTE	318
# define	READONLY	319
# define	OBJECT	320

#line 22 "parser.yy"

  /* .c file output stuff */

#include "helpers.hh"
#include "Errors.hh"
#include <mom/compiler.h>
#include <stdlib.h>
#include <string.h>

  void yyerror(const char *); 
  int yylex();
  int scope;
  aoi cur_aoi;
  int aoi_length;
  int saved_aoi_len;
  char *curr_struct_id;
  aoi_interface *cur_interface;
  char DISCRM[3] = {'_', 'd', 0};
  char UNION_LABEL[3] = {'_', 'u', 0};
  aoi_field *default_union;
  int enum_val;
  int last_pos;
  int in_oneway; /* 1 if parsing a oneway operation, 0 otherwise */
  io_file_index builtin_file;

#line 50 "parser.yy"
#ifndef YYSTYPE
typedef union {
  char			*id;	// for identifiers (not strings) 
  unsigned int		integer;// for any integer token 
  double		real;	// for any real value token 
  char			*str;	// for string tokens 
  char			chr;	// for character literals tokens 
  struct aoi_def	*defn;	// this is the definition 
  unsigned int		kind;	// this is for a const type specifier 
  struct aoi_operation	*op;	// this is for interface operations 
  unsigned int		ref;	// for references 
  struct aoi_type_u	*type;	// for type descriptors 
  struct aoi_field	*field; // for passing names fields 
  struct VoidArray	*array; // for lists of anything... 
  struct Declaration	*decl;	// for complex declarations 
  struct aoi_const_u	*cnst;	// for constants... 
  struct aoi_parameter	*parm;	// for parameters... 
  void			*tmp;	// for misc pointers
} yystype;
# define YYSTYPE yystype
# define YYSTYPE_IS_TRIVIAL 1
#endif
#ifndef YYDEBUG
# define YYDEBUG 0
#endif



#define	YYFINAL		338
#define	YYFLAG		-32768
#define	YYNTBASE	67

/* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
#define YYTRANSLATE(x) ((unsigned)(x) <= 320 ? yytranslate[x] : 176)

/* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
static const 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,     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,     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,     3,     4,     5,
       6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
      16,    17,    18,    19,    20,    21,    22,    23,    24,    25,
      26,    27,    28,    29,    30,    31,    32,    33,    34,    35,
      36,    37,    38,    39,    40,    41,    42,    43,    44,    45,
      46,    47,    48,    49,    50,    51,    52,    53,    54,    55,
      56,    57,    58,    59,    60,    61,    62,    63,    64,    65,
      66
};

#if YYDEBUG
static const short yyprhs[] =
{
       0,     0,     1,     4,     5,     8,    11,    14,    17,    20,
      23,    24,    28,    29,    36,    38,    40,    41,    47,    50,
      54,    55,    58,    61,    64,    67,    70,    73,    74,    78,
      81,    82,    84,    88,    90,    92,    94,    97,   101,   107,
     111,   113,   115,   117,   119,   121,   123,   125,   127,   131,
     133,   137,   139,   143,   145,   149,   153,   155,   159,   163,
     165,   169,   173,   177,   179,   182,   185,   188,   190,   192,
     196,   198,   200,   202,   204,   206,   208,   210,   212,   214,
     217,   219,   221,   223,   224,   229,   232,   234,   236,   238,
     240,   242,   244,   246,   248,   250,   252,   254,   256,   258,
     260,   262,   264,   266,   268,   270,   272,   274,   276,   278,
     282,   284,   286,   288,   290,   292,   294,   296,   298,   301,
     304,   307,   311,   314,   317,   319,   321,   323,   325,   327,
     328,   329,   337,   340,   342,   345,   347,   351,   352,   353,
     365,   368,   370,   372,   374,   376,   378,   380,   382,   385,
     389,   392,   394,   397,   401,   404,   407,   413,   415,   419,
     421,   428,   433,   438,   440,   443,   445,   448,   452,   453,
     460,   461,   464,   467,   468,   476,   477,   479,   480,   482,
     483,   485,   487,   489,   493,   496,   498,   502,   506,   507,
     512,   514,   516,   518,   520,   522,   524,   526,   528,   530,
     535,   540,   544,   546,   550,   554,   559,   560,   562,   564,
     568,   570,   573,   576,   578,   580,   582,   584,   586,   588,
     590,   592,   594,   596,   598,   600,   602,   604,   606,   608,
     610,   612,   614,   616
};
static const short yyrhs[] =
{
      -1,    68,    69,     0,     0,    69,    70,     0,   100,   170,
       0,    86,   170,     0,   143,   170,     0,    74,   170,     0,
      72,   170,     0,     0,     1,    71,     8,     0,     0,     9,
     165,   173,    73,    69,    11,     0,    75,     0,    77,     0,
       0,    78,    10,    76,    79,    11,     0,    12,   165,     0,
      12,   165,    82,     0,     0,    79,    80,     0,   100,   170,
       0,    86,   170,     0,   143,   170,     0,   162,   170,     0,
     146,   170,     0,     0,     1,    81,     8,     0,    13,    83,
       0,     0,    84,     0,    83,    32,    84,     0,    85,     0,
       1,     0,     3,     0,    26,   165,     0,    85,    26,   165,
       0,    43,    87,   165,   169,    88,     0,    43,     1,     8,
       0,   116,     0,   117,     0,   118,     0,   115,     0,   139,
       0,    85,     0,    89,     0,    90,     0,    89,    15,    90,
       0,    91,     0,    90,    16,    91,     0,    92,     0,    91,
      17,    92,     0,    93,     0,    92,    18,    93,     0,    92,
      19,    93,     0,    94,     0,    93,    20,    94,     0,    93,
      21,    94,     0,    95,     0,    94,    22,    95,     0,    94,
      23,    95,     0,    94,    24,    95,     0,    96,     0,    25,
      96,     0,    20,    96,     0,    21,    96,     0,    85,     0,
      97,     0,    27,    88,   172,     0,     1,     0,     4,     0,
       6,     0,     7,     0,     5,     0,    98,     0,    29,     0,
      30,     0,    88,     0,    31,   102,     0,   121,     0,   126,
       0,   135,     0,     0,    31,     1,   101,     8,     0,   103,
     111,     0,   104,     0,     1,     0,   106,     0,   109,     0,
     106,     0,     1,     0,   107,     0,   108,     0,    85,     0,
     115,     0,   116,     0,   117,     0,   118,     0,   119,     0,
     120,     0,    66,     0,   138,     0,   139,     0,   110,     0,
     121,     0,   126,     0,   135,     0,   112,     0,   111,    32,
     112,     0,   113,     0,   114,     0,   165,     0,   140,     0,
      33,     0,    34,     0,    35,     0,    36,     0,    35,    35,
       0,    37,    35,     0,    37,    36,     0,    37,    35,    35,
       0,    37,    38,     0,    37,     1,     0,    38,     0,    39,
       0,    40,     0,    41,     0,    42,     0,     0,     0,    44,
     165,   122,    10,   123,   124,   174,     0,    44,   165,     0,
     125,     0,   124,   125,     0,     1,     0,   104,   111,   170,
       0,     0,     0,    45,   165,    46,   171,   127,   129,   172,
     173,   128,   130,    11,     0,    45,   165,     0,   116,     0,
     117,     0,   118,     0,   135,     0,    85,     0,     1,     0,
     131,     0,   130,   131,     0,   132,   134,   170,     0,     1,
       8,     0,   133,     0,   132,   133,     0,    47,    88,   168,
       0,    48,   168,     0,   103,   112,     0,    49,   165,   173,
     136,   174,     0,   137,     0,   136,    32,   137,     0,   165,
       0,    50,   166,   105,    32,    99,   167,     0,    50,   166,
     105,   167,     0,    53,    51,    99,   167,     0,    53,     0,
     165,   141,     0,   142,     0,   141,   142,     0,    54,    99,
     175,     0,     0,    56,   165,   173,   144,   145,    11,     0,
       0,   145,   125,     0,   145,     1,     0,     0,   148,   151,
     147,   165,   152,   149,   150,     0,     0,    57,     0,     0,
     159,     0,     0,   160,     0,    58,     0,   158,     0,   171,
     153,   172,     0,   171,   172,     0,   154,     0,   153,    32,
     154,     0,   153,    32,     1,     0,     0,   156,   155,   157,
     113,     0,    59,     0,    60,     0,    61,     0,   158,     0,
       1,     0,   107,     0,   139,     0,    85,     0,   138,     0,
      62,   171,    83,   172,     0,    63,   171,   161,   172,     0,
      63,   171,   172,     0,     6,     0,   161,    32,     6,     0,
     161,    32,     1,     0,   163,    64,   157,   164,     0,     0,
      65,     0,   113,     0,   164,    32,   113,     0,     3,     0,
       4,   165,     0,    22,   165,     0,     1,     0,    51,     0,
       1,     0,    52,     0,     1,     0,    13,     0,     1,     0,
      14,     0,     1,     0,     8,     0,     1,     0,    27,     0,
       1,     0,    28,     0,     1,     0,    10,     0,     1,     0,
      11,     0,     1,     0,    55,     0,     1,     0
};

#endif

#if YYDEBUG
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const short yyrline[] =
{
       0,   208,   208,   211,   212,   215,   216,   217,   218,   219,
     220,   220,   223,   223,   234,   235,   238,   238,   258,   270,
     275,   276,   279,   280,   281,   282,   283,   284,   284,   287,
     290,   293,   297,   303,   304,   310,   313,   316,   321,   324,
     329,   330,   331,   332,   333,   334,   337,   340,   341,   346,
     347,   352,   353,   358,   359,   362,   367,   368,   371,   376,
     377,   380,   383,   388,   389,   392,   395,   400,   403,   404,
     405,   411,   412,   413,   414,   415,   418,   419,   422,   425,
     426,   427,   428,   429,   429,   432,   440,   441,   446,   447,
     450,   451,   456,   457,   458,   463,   464,   465,   466,   467,
     468,   469,   472,   473,   476,   481,   482,   483,   486,   490,
     496,   501,   504,   507,   510,   511,   514,   515,   516,   517,
     518,   519,   520,   523,   527,   532,   535,   538,   541,   544,
     544,   544,   561,   574,   577,   598,   607,   626,   626,   626,
     668,   681,   682,   683,   684,   690,   691,   697,   698,   717,
     733,   741,   745,   751,   752,   755,   762,   822,   837,   853,
     856,   867,   880,   895,   912,   919,   923,   929,   934,   934,
     952,   958,   964,   971,   971,   992,   993,   996,  1002,  1005,
    1006,  1009,  1013,  1016,  1017,  1024,  1028,  1032,  1041,  1041,
    1053,  1054,  1055,  1058,  1059,  1065,  1066,  1067,  1070,  1078,
    1090,  1091,  1096,  1097,  1098,  1101,  1135,  1136,  1139,  1143,
    1149,  1150,  1154,  1158,  1168,  1169,  1171,  1172,  1174,  1175,
    1177,  1178,  1180,  1181,  1183,  1184,  1186,  1187,  1189,  1190,
    1192,  1193,  1195,  1196
};
#endif


#if (YYDEBUG) || defined YYERROR_VERBOSE

/* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
static const char *const yytname[] =
{
  "$", "error", "$undefined.", "ID", "LIT_INT", "LIT_REAL", "LIT_STRING", 
  "LIT_CHR", "SEMI", "MODULE", "LBRACE", "RBRACE", "INTERFACE", "COLON", 
  "EQUAL", "OR", "XOR", "AND", "LSHIFT", "RSHIFT", "ADD", "SUB", "MUL", 
  "DIV", "MOD", "NEG", "SCOPE", "LPAREN", "RPAREN", "BTRUE", "BFALSE", 
  "TYPEDEF", "COMMA", "FLOAT", "DOUBLE", "LONG", "SHORT", "UNSIGNED", 
  "INT", "CHAR", "BOOLEAN", "OCTET", "ANY", "CONST", "STRUCT", "UNION", 
  "SWITCH", "CASE", "DEFAULT", "ENUM", "SEQUENCE", "LT", "GT", "STRING", 
  "LBRACK", "RBRACK", "EXCEPTION", "ONEWAY", "VOID", "IN", "INOUT", "OUT", 
  "RAISES", "CONTEXT", "ATTRIBUTE", "READONLY", "OBJECT", "mystart", "@1", 
  "specification", "definition", "@2", "module", "@3", "interface", 
  "interface_dcl", "@4", "forward_dcl", "interface_header", 
  "interface_body", "export", "@5", "inheritance_spec", "_scoped_names", 
  "scoped_name_or_error", "scoped_name", "const_dcl", "const_type", 
  "const_expr", "or_expr", "xor_expr", "and_expr", "shift_expr", 
  "add_expr", "mult_expr", "unary_expr", "primary_expr", "literal", 
  "boolean_literal", "pos_int_const", "type_dcl", "@6", "type_declarator", 
  "type_spec_or_error", "type_spec", "simple_type_spec_or_error", 
  "simple_type_spec", "base_type_spec", "template_type_spec", 
  "constr_type_spec", "_constr_type", "declarators", "declarator", 
  "simple_declarator", "complex_declarator", "real_type", "integer_type", 
  "char_type", "boolean_type", "octet_type", "any_type", "struct_type", 
  "@7", "@8", "member_list", "member", "union_type", "@9", "@10", 
  "switch_type_spec", "switch_body", "case", "_case_labels", "case_label", 
  "element_spec", "enum_type", "_enumerators", "enumerator", 
  "sequence_type", "string_type", "array_declarator", "_fixed_arrays", 
  "fixed_array_size", "except_dcl", "@11", "_members", "op_dcl", "@12", 
  "_op_attribute", "_raises_expr", "_context_expr", "op_type_spec", 
  "parameter_dcls", "_param_dcls", "param_dcl", "@13", "param_attribute", 
  "param_type_spec_or_error", "param_type_spec", "raises_expr", 
  "context_expr", "_string_literals", "attr_dcl", "_readonly", 
  "_simple_declarators", "id", "lt", "gt", "colon", "equal", "semi", 
  "lparen", "rparen", "lbrace", "rbrace", "rbrack", 0
};
#endif

/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const short yyr1[] =
{
       0,    68,    67,    69,    69,    70,    70,    70,    70,    70,
      71,    70,    73,    72,    74,    74,    76,    75,    77,    78,
      79,    79,    80,    80,    80,    80,    80,    81,    80,    82,
      82,    83,    83,    84,    84,    85,    85,    85,    86,    86,
      87,    87,    87,    87,    87,    87,    88,    89,    89,    90,
      90,    91,    91,    92,    92,    92,    93,    93,    93,    94,
      94,    94,    94,    95,    95,    95,    95,    96,    96,    96,
      96,    97,    97,    97,    97,    97,    98,    98,    99,   100,
     100,   100,   100,   101,   100,   102,   103,   103,   104,   104,
     105,   105,   106,   106,   106,   107,   107,   107,   107,   107,
     107,   107,   108,   108,   109,   110,   110,   110,   111,   111,
     112,   112,   113,   114,   115,   115,   116,   116,   116,   116,
     116,   116,   116,   116,   116,   117,   118,   119,   120,   122,
     123,   121,   121,   124,   124,   124,   125,   127,   128,   126,
     126,   129,   129,   129,   129,   129,   129,   130,   130,   131,
     131,   132,   132,   133,   133,   134,   135,   136,   136,   137,
     138,   138,   139,   139,   140,   141,   141,   142,   144,   143,
     145,   145,   145,   147,   146,   148,   148,   149,   149,   150,
     150,   151,   151,   152,   152,   153,   153,   153,   155,   154,
     156,   156,   156,   157,   157,   158,   158,   158,   158,   159,
     160,   160,   161,   161,   161,   162,   163,   163,   164,   164,
     165,   165,   165,   165,   166,   166,   167,   167,   168,   168,
     169,   169,   170,   170,   171,   171,   172,   172,   173,   173,
     174,   174,   175,   175
};

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

/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
   doesn't specify something else to do.  Zero means the default is an
   error. */
static const short yydefact[] =
{
       1,     3,     0,    10,     0,     0,     0,     0,     0,     0,
       0,     0,     4,     0,     0,    14,    15,     0,     0,     0,
      80,    81,    82,     0,     0,   213,   210,     0,     0,     0,
      18,    87,    35,     0,   114,   115,   116,   117,     0,   124,
     125,   126,   127,   128,     0,   163,   101,    94,    79,     0,
      86,    88,    92,    93,    89,   104,    95,    96,    97,    98,
      99,   100,   105,   106,   107,   102,   103,     0,    45,     0,
      43,    40,    41,    42,    44,   132,   140,     0,     0,   223,
     222,     9,     8,    16,     6,     5,     7,    11,   211,   212,
     229,   228,    12,     0,    19,     0,    36,   118,   123,   119,
     120,   122,   215,   214,     0,     0,     0,    85,   108,   110,
     111,   113,   112,    39,     0,     0,     0,     0,   168,    20,
       3,    34,    29,    31,    33,    84,   121,    91,     0,    90,
      70,    71,    74,    72,    73,     0,     0,     0,     0,    76,
      77,    67,    78,    46,    47,    49,    51,    53,    56,    59,
      63,    68,    75,     0,    37,     0,     0,   164,   165,   221,
     220,     0,   130,   225,   224,   137,     0,   157,   159,   170,
       0,     0,     0,   217,     0,   216,   161,    65,    66,    64,
       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
       0,   162,   109,     0,   166,    38,     0,     0,   231,   230,
       0,   156,     0,    27,    17,   176,   207,    21,     0,     0,
       0,     0,     0,     0,     0,    13,    32,     0,   227,   226,
      69,    48,    50,    52,    54,    55,    57,    58,    60,    61,
      62,   233,   232,   167,   135,     0,     0,   133,   146,   145,
     141,   142,   143,     0,   144,   158,   172,   169,   171,     0,
      23,    22,    24,    26,   181,   197,   195,   198,   196,   173,
     182,    25,     0,   160,     0,   134,   131,     0,    28,     0,
     194,     0,   193,   136,   138,     0,   208,   205,   112,     0,
     177,     0,     0,     0,     0,     0,     0,   147,     0,   151,
       0,   179,   178,   190,   191,   192,     0,   185,   188,   184,
     209,   150,     0,   219,   218,   154,   139,   148,    87,     0,
     152,     0,     0,     0,   174,   180,     0,   183,     0,   153,
     155,   149,     0,     0,   187,   186,     0,   199,   202,     0,
     201,   189,     0,   200,   204,   203,     0,     0,     0
};

static const short yydefgoto[] =
{
     336,     1,     2,    12,    24,    13,   120,    14,    15,   119,
      16,    17,   170,   207,   249,    94,   122,   123,   141,    18,
      69,   142,   143,   144,   145,   146,   147,   148,   149,   150,
     151,   152,   153,    19,    95,    48,    49,   235,   128,    51,
      52,    53,    54,    55,   107,   108,   109,   110,    56,    57,
      58,    59,    60,    61,    62,   115,   196,   236,   237,    63,
     197,   279,   243,   286,   287,   288,   289,   311,    64,   166,
     167,    65,    66,   111,   157,   158,    23,   169,   202,   211,
     269,   212,   291,   314,   259,   280,   296,   297,   318,   298,
     271,   272,   292,   315,   329,   213,   214,   277,   112,   104,
     176,   305,   161,    81,   165,   220,    92,   201,   233
};

static const short yypact[] =
{
  -32768,-32768,   225,-32768,   279,   279,   404,   380,   279,   279,
     279,   279,-32768,   159,   159,-32768,-32768,   105,   159,   159,
  -32768,-32768,-32768,   159,   113,-32768,-32768,   279,   279,    54,
      27,   115,-32768,   279,-32768,-32768,    90,-32768,    33,-32768,
  -32768,-32768,-32768,-32768,    47,    76,-32768,   126,-32768,   279,
  -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
  -32768,-32768,-32768,-32768,-32768,-32768,-32768,   150,   126,   279,
  -32768,-32768,-32768,-32768,-32768,   156,   127,    54,    54,-32768,
  -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
  -32768,-32768,-32768,   167,-32768,   181,-32768,-32768,-32768,   149,
  -32768,-32768,-32768,-32768,    50,   526,   279,   155,-32768,-32768,
  -32768,-32768,   138,-32768,    46,   187,   119,   279,-32768,-32768,
  -32768,-32768,   168,-32768,   126,-32768,-32768,-32768,    42,-32768,
  -32768,-32768,-32768,-32768,-32768,   534,   534,   534,   526,-32768,
  -32768,   126,-32768,   194,   186,   195,   176,    41,   207,-32768,
  -32768,-32768,-32768,    45,-32768,   279,   526,   138,-32768,-32768,
  -32768,   526,-32768,-32768,-32768,-32768,    43,-32768,-32768,-32768,
      98,   179,   167,-32768,   526,-32768,-32768,-32768,-32768,-32768,
      35,   526,   526,   526,   526,   526,   526,   526,   526,   526,
     526,-32768,-32768,    38,-32768,-32768,   449,   425,-32768,-32768,
     279,-32768,   314,-32768,-32768,-32768,-32768,-32768,   159,   159,
     159,   159,   470,   159,   157,-32768,-32768,    45,-32768,-32768,
  -32768,   186,   195,   176,    41,    41,   207,   207,-32768,-32768,
  -32768,-32768,-32768,-32768,-32768,   279,   359,-32768,-32768,   126,
  -32768,-32768,-32768,    35,-32768,-32768,-32768,-32768,-32768,   211,
  -32768,-32768,-32768,-32768,-32768,   126,-32768,-32768,-32768,-32768,
  -32768,-32768,   210,-32768,    48,-32768,-32768,    54,-32768,   279,
  -32768,   279,-32768,-32768,-32768,   119,-32768,   200,-32768,    57,
     165,    51,   279,   231,   526,    44,    30,-32768,   258,-32768,
     119,   170,-32768,-32768,-32768,-32768,   121,-32768,-32768,-32768,
  -32768,-32768,    44,-32768,-32768,-32768,-32768,-32768,-32768,   279,
  -32768,   159,   167,   119,-32768,-32768,    58,-32768,   210,-32768,
  -32768,-32768,   129,   144,-32768,-32768,   279,-32768,-32768,   143,
  -32768,-32768,   175,-32768,-32768,-32768,   262,   266,-32768
};

static const short yypgoto[] =
{
  -32768,-32768,   169,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
  -32768,-32768,-32768,-32768,-32768,-32768,   -54,   103,     2,   107,
  -32768,  -119,-32768,   123,    97,   133,    88,   100,    52,   118,
  -32768,-32768,     3,   139,-32768,-32768,     0,    -3,-32768,   206,
    -192,-32768,-32768,-32768,    77,  -140,  -244,-32768,   312,     6,
       9,    11,-32768,-32768,    12,-32768,-32768,-32768,  -169,    15,
  -32768,-32768,-32768,-32768,    37,-32768,    39,-32768,     8,-32768,
     128,  -190,    -5,-32768,-32768,   164,   160,-32768,-32768,-32768,
  -32768,-32768,-32768,-32768,-32768,-32768,-32768,    10,-32768,-32768,
      13,   117,-32768,-32768,-32768,-32768,-32768,-32768,    -4,-32768,
    -121,    31,-32768,     7,  -240,  -215,   -66,    96,-32768
};


#define	YYLAST		564


static const short yytable[] =
{
      29,    30,    74,    50,    75,    76,    77,    78,    47,    68,
      22,   117,   118,    71,    20,   192,    72,    21,    73,   180,
     256,    82,   257,    88,    89,    84,    85,   276,   267,    96,
      86,   283,   191,   248,    98,   281,   218,   -30,   300,   231,
      93,   306,   195,   173,   198,   303,   173,   159,   102,    79,
     312,   127,   218,    32,   199,    90,    80,   304,   283,   324,
     160,   186,   187,   219,    91,   114,   299,   265,    99,   100,
     256,   101,   257,   323,   174,   200,    33,   284,   285,   219,
     155,   317,   331,    34,    35,    36,    37,    38,    39,    40,
      41,    42,    43,   232,   175,   124,   263,   175,   103,   203,
      44,  -175,   154,    45,   284,   285,    47,   327,   330,   204,
     293,   294,   295,   168,   333,    83,    46,   293,   294,   295,
     163,    87,   218,   -83,  -175,    97,   256,   105,   257,     6,
     218,  -175,  -175,  -175,  -175,  -175,  -175,  -175,  -175,  -175,
    -175,     7,     8,     9,   218,   218,   164,    10,  -175,   219,
     328,  -175,   106,   316,    11,   205,  -175,   219,   113,   193,
      79,   172,  -206,   206,  -175,   302,  -129,    80,   121,   320,
      32,   219,   219,   116,   124,   332,   334,   217,    22,    22,
       3,   335,    20,    20,   126,    21,    21,   155,     4,   125,
     215,     5,   156,    33,   184,   185,   168,   162,    47,   239,
     172,   274,   182,   240,    47,   244,   241,   258,   242,   181,
       6,   270,   183,    32,   255,   250,   251,   252,   253,   268,
     261,   262,     7,     8,     9,    -2,     3,   290,    10,   188,
     189,   190,   282,   313,     4,    11,    33,     5,    47,   301,
     228,   229,   230,    34,    35,    36,    37,    38,    39,    40,
      41,    42,    43,   177,   178,   179,     6,   258,   322,   308,
      44,    32,   337,    45,   255,   275,   338,   278,     7,     8,
       9,   273,   224,   225,    10,   216,    46,   208,   278,   222,
      25,    11,    26,    27,    33,    50,   226,   227,   309,   171,
      47,    34,    35,    36,    37,    38,    39,    40,    41,    42,
      43,    28,     8,     9,   221,   284,   285,    10,    44,   209,
     129,    45,   264,   258,   124,   246,   223,    32,   321,    70,
     255,   194,   278,   307,    46,   247,   325,   310,   245,   260,
     210,   326,   266,   319,     0,     0,     0,     0,     0,     0,
      33,     0,     0,     0,     0,     0,     0,    34,    35,    36,
      37,    38,    39,    40,    41,    42,    43,     0,     8,     9,
     198,     0,    32,    10,    44,     0,     0,    45,     0,     0,
     199,     0,     0,     0,     0,     0,     0,     0,     0,     0,
      46,    67,     0,    32,     0,    33,     0,     0,     0,     0,
       0,     0,    34,    35,    36,    37,    38,    39,    40,    41,
      42,    43,     0,     8,     9,    31,    33,    32,    10,    44,
       0,     0,    45,    34,    35,    36,    37,    38,    39,    40,
      41,     0,     0,     0,     0,    46,   238,     0,    32,     0,
      33,     0,     0,    45,     0,     0,     0,    34,    35,    36,
      37,    38,    39,    40,    41,    42,    43,     0,     8,     9,
     234,    33,    32,    10,    44,     0,     0,    45,     0,     0,
      36,    37,    38,    39,    40,    41,     0,     0,     0,     0,
      46,     0,     0,    32,    10,    33,     0,     0,     0,     0,
       0,     0,    34,    35,    36,    37,    38,    39,    40,    41,
      42,    43,     0,     8,     9,     0,    33,     0,    10,    44,
       0,     0,    45,    34,    35,    36,    37,    38,    39,    40,
      41,    42,    43,     0,     0,    46,     0,     0,     0,     0,
      44,     0,     0,    45,     0,     0,     0,   130,   254,    32,
     131,   132,   133,   134,     0,   130,    46,    32,   131,   132,
     133,   134,     0,     0,     0,     0,   135,   136,     0,     0,
       0,   137,    33,   138,     0,   139,   140,     0,     0,     0,
      33,   138,     0,   139,   140
};

static const short yycheck[] =
{
       4,     5,     7,     6,     8,     9,    10,    11,     6,     7,
       2,    77,    78,     7,     2,   155,     7,     2,     7,   138,
     212,    14,   212,    27,    28,    18,    19,   271,   243,    33,
      23,     1,   153,   202,     1,   275,     1,    10,   282,     1,
      13,    11,   161,     1,     1,     1,     1,     1,     1,     1,
     290,     1,     1,     3,    11,     1,     8,    13,     1,     1,
      14,    20,    21,    28,    10,    69,   281,   236,    35,    36,
     262,    38,   262,   313,    32,    32,    26,    47,    48,    28,
      32,   296,   326,    33,    34,    35,    36,    37,    38,    39,
      40,    41,    42,    55,    52,    93,   217,    52,    51,     1,
      50,     3,   106,    53,    47,    48,   104,   322,   323,    11,
      59,    60,    61,   117,   329,    10,    66,    59,    60,    61,
       1,     8,     1,     8,    26,    35,   318,    51,   318,    31,
       1,    33,    34,    35,    36,    37,    38,    39,    40,    41,
      42,    43,    44,    45,     1,     1,    27,    49,    50,    28,
       6,    53,    26,    32,    56,    57,    58,    28,     8,   156,
       1,    32,    64,    65,    66,   284,    10,     8,     1,   309,
       3,    28,    28,    46,   172,    32,     1,   174,   170,   171,
       1,     6,   170,   171,    35,   170,   171,    32,     9,     8,
      11,    12,    54,    26,    18,    19,   200,    10,   196,   197,
      32,   267,    16,   197,   202,   197,   197,   212,   197,    15,
      31,     1,    17,     3,   212,   208,   209,   210,   211,     8,
     213,    64,    43,    44,    45,     0,     1,    62,    49,    22,
      23,    24,    32,    63,     9,    56,    26,    12,   236,     8,
     188,   189,   190,    33,    34,    35,    36,    37,    38,    39,
      40,    41,    42,   135,   136,   137,    31,   262,   312,     1,
      50,     3,     0,    53,   262,   269,     0,   271,    43,    44,
      45,   264,   184,   185,    49,   172,    66,   170,   282,   182,
       1,    56,     3,     4,    26,   288,   186,   187,   288,   120,
     288,    33,    34,    35,    36,    37,    38,    39,    40,    41,
      42,    22,    44,    45,   181,    47,    48,    49,    50,   170,
     104,    53,   235,   318,   312,     1,   183,     3,   311,     7,
     318,   157,   326,   286,    66,    11,   316,   288,   200,   212,
     170,   318,   236,   302,    -1,    -1,    -1,    -1,    -1,    -1,
      26,    -1,    -1,    -1,    -1,    -1,    -1,    33,    34,    35,
      36,    37,    38,    39,    40,    41,    42,    -1,    44,    45,
       1,    -1,     3,    49,    50,    -1,    -1,    53,    -1,    -1,
      11,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
      66,     1,    -1,     3,    -1,    26,    -1,    -1,    -1,    -1,
      -1,    -1,    33,    34,    35,    36,    37,    38,    39,    40,
      41,    42,    -1,    44,    45,     1,    26,     3,    49,    50,
      -1,    -1,    53,    33,    34,    35,    36,    37,    38,    39,
      40,    -1,    -1,    -1,    -1,    66,     1,    -1,     3,    -1,
      26,    -1,    -1,    53,    -1,    -1,    -1,    33,    34,    35,
      36,    37,    38,    39,    40,    41,    42,    -1,    44,    45,
       1,    26,     3,    49,    50,    -1,    -1,    53,    -1,    -1,
      35,    36,    37,    38,    39,    40,    -1,    -1,    -1,    -1,
      66,    -1,    -1,     3,    49,    26,    -1,    -1,    -1,    -1,
      -1,    -1,    33,    34,    35,    36,    37,    38,    39,    40,
      41,    42,    -1,    44,    45,    -1,    26,    -1,    49,    50,
      -1,    -1,    53,    33,    34,    35,    36,    37,    38,    39,
      40,    41,    42,    -1,    -1,    66,    -1,    -1,    -1,    -1,
      50,    -1,    -1,    53,    -1,    -1,    -1,     1,    58,     3,
       4,     5,     6,     7,    -1,     1,    66,     3,     4,     5,
       6,     7,    -1,    -1,    -1,    -1,    20,    21,    -1,    -1,
      -1,    25,    26,    27,    -1,    29,    30,    -1,    -1,    -1,
      26,    27,    -1,    29,    30
};
/* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
#line 3 "/usr/local/share/bison/bison.simple"

/* Skeleton output parser for 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.  */

/* This is the parser code that is written into each bison parser when
   the %semantic_parser declaration is not specified in the grammar.
   It was written by Richard Stallman by simplifying the hairy parser
   used when %semantic_parser is specified.  */

/* 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.  */

#if ! defined (yyoverflow) || defined (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) || defined (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;
# if YYLSP_NEEDED
  YYLTYPE yyls;
# endif
};

/* 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.  */
# if YYLSP_NEEDED
#  define YYSTACK_BYTES(N) \
     ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE))	\
      + 2 * YYSTACK_GAP_MAX)
# else
#  define YYSTACK_BYTES(N) \
     ((N) * (sizeof (short) + sizeof (YYSTYPE))				\
      + YYSTACK_GAP_MAX)
# endif

/* 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 (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).

   When YYLLOC_DEFAULT is run, CURRENT is set the location of the
   first token.  By default, to implement support for ranges, extend
   its range to the last symbol.  */

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


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

#if YYPURE
# if YYLSP_NEEDED
#  ifdef YYLEX_PARAM
#   define YYLEX		yylex (&yylval, &yylloc, YYLEX_PARAM)
#  else
#   define YYLEX		yylex (&yylval, &yylloc)
#  endif
# else /* !YYLSP_NEEDED */
#  ifdef YYLEX_PARAM
#   define YYLEX		yylex (&yylval, YYLEX_PARAM)
#  else
#   define YYLEX		yylex (&yylval)
#  endif
# endif /* !YYLSP_NEEDED */
#else /* !YYPURE */
# define YYLEX			yylex ()
#endif /* !YYPURE */


/* 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)
/* Nonzero means print parse trace.  It is left uninitialized so that
   multiple parsers can coexist.  */
int yydebug;
#else /* !YYDEBUG */
# define YYDPRINTF(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

#ifdef 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

#line 315 "/usr/local/share/bison/bison.simple"


/* 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

/* YY_DECL_VARIABLES -- depending whether we use a pure parser,
   variables are global, or local to YYPARSE.  */

#define YY_DECL_NON_LSP_VARIABLES			\
/* The lookahead symbol.  */				\
int yychar;						\
							\
/* The semantic value of the lookahead symbol. */	\
YYSTYPE yylval;						\
							\
/* Number of parse errors so far.  */			\
int yynerrs;

#if YYLSP_NEEDED
# define YY_DECL_VARIABLES			\
YY_DECL_NON_LSP_VARIABLES			\
						\
/* Location data for the lookahead symbol.  */	\
YYLTYPE yylloc;
#else
# define YY_DECL_VARIABLES			\
YY_DECL_NON_LSP_VARIABLES
#endif


/* If nonreentrant, generate the variables here. */

#if !YYPURE
YY_DECL_VARIABLES
#endif  /* !YYPURE */

int
yyparse (YYPARSE_PARAM_ARG)
     YYPARSE_PARAM_DECL
{
  /* If reentrant, generate the variables here. */
#if YYPURE
  YY_DECL_VARIABLES
#endif  /* !YYPURE */

  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;

#if YYLSP_NEEDED
  /* The location stack.  */
  YYLTYPE yylsa[YYINITDEPTH];
  YYLTYPE *yyls = yylsa;
  YYLTYPE *yylsp;
#endif

#if YYLSP_NEEDED
# define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
#else
# define YYPOPSTACK   (yyvsp--, yyssp--)
#endif

  YYSIZE_T yystacksize = YYINITDEPTH;


  /* The variables used to return semantic value and location from the
     action routines.  */
  YYSTYPE yyval;
#if YYLSP_NEEDED
  YYLTYPE yyloc;
#endif

  /* 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;
#if YYLSP_NEEDED
  yylsp = yyls;
#endif
  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.  */
# if YYLSP_NEEDED
	YYLTYPE *yyls1 = yyls;
	/* 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),
		    &yyls1, yysize * sizeof (*yylsp),
		    &yystacksize);
	yyls = yyls1;
# else
	yyoverflow ("parser stack overflow",
		    &yyss1, yysize * sizeof (*yyssp),
		    &yyvs1, yysize * sizeof (*yyvsp),
		    &yystacksize);
# endif
	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);
# if YYLSP_NEEDED
	YYSTACK_RELOCATE (yyls);
# endif
# undef YYSTACK_RELOCATE
	if (yyss1 != yyssa)
	  YYSTACK_FREE (yyss1);
      }
# endif
#endif /* no yyoverflow */

      yyssp = yyss + yysize - 1;
      yyvsp = yyvs + yysize - 1;
#if YYLSP_NEEDED
      yylsp = yyls + yysize - 1;
#endif

      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 == YYFLAG)
    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);

#if YYDEBUG
     /* We have to keep this `#if YYDEBUG', since we use variables
	which are defined only if `YYDEBUG' is set.  */
      if (yydebug)
	{
	  YYFPRINTF (stderr, "Next token is %d (%s",
		     yychar, yytname[yychar1]);
	  /* Give the individual parser a way to print the precise
	     meaning of a token, for further debugging info.  */
# ifdef YYPRINT
	  YYPRINT (stderr, yychar, yylval);
# endif
	  YYFPRINTF (stderr, ")\n");
	}
#endif
    }

  yyn += yychar1;
  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
    goto yydefault;

  yyn = yytable[yyn];

  /* yyn is what to do for this token type in this state.
     Negative => reduce, -yyn is rule number.
     Positive => shift, yyn is new state.
       New state is final state => don't bother to shift,
       just return success.
     0, or most negative number => error.  */

  if (yyn < 0)
    {
      if (yyn == YYFLAG)
	goto yyerrlab;
      yyn = -yyn;
      goto yyreduce;
    }
  else if (yyn == 0)
    goto yyerrlab;

  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;
#if YYLSP_NEEDED
  *++yylsp = yylloc;
#endif

  /* 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 the semantic value of
     the lookahead token.  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 YYLSP_NEEDED
  /* Similarly for the default location.  Let the user run additional
     commands if for instance locations are ranges.  */
  yyloc = yylsp[1-yylen];
  YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
#endif

#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, 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 1:
#line 208 "parser.yy"
{Start();}
    break;
case 2:
#line 208 "parser.yy"
{Finish();}
    break;
case 10:
#line 220 "parser.yy"
{ParseError("invalid definition");}
    break;
case 12:
#line 223 "parser.yy"
{
		  aoi_def *def_tmp = new_aoi_def(yyvsp[-1].id,scope);
		  def_tmp->binding = (aoi_type)mustcalloc(sizeof(aoi_type_u));
		  def_tmp->binding->kind = AOI_NAMESPACE;
		  AddDef(def_tmp, AOI_NAMESPACE);
		  AddScope(yyvsp[-1].id);
		}
    break;
case 13:
#line 229 "parser.yy"
{
		  DelScope();
		}
    break;
case 16:
#line 238 "parser.yy"
{
		  aoi_def *tmp = new_aoi_def(yyvsp[-1].str, scope);
		  last_pos = cur_aoi.defs.defs_len;
		  AddDef(tmp, AOI_INTERFACE);
		  cur_aoi.defs.defs_val[last_pos].binding =
		    (aoi_type)mustcalloc(sizeof(aoi_type_u));
		  cur_aoi.defs.defs_val[last_pos].binding->kind =
		    AOI_INTERFACE;
		  cur_aoi.defs.defs_val[last_pos].binding->aoi_type_u_u.
		    interface_def = *cur_interface;
		  cur_interface = &cur_aoi.defs.defs_val[last_pos].binding->
				  aoi_type_u_u.interface_def;
		  AddScope(yyvsp[-1].str);
		}
    break;
case 17:
#line 251 "parser.yy"
{
		  DelScope();
		  cur_interface->code = GetInterfaceCode(yyvsp[-4].str);
		  cur_interface = GetNewInterface();
		}
    break;
case 18:
#line 258 "parser.yy"
{
		  if (FindLocalName(yyvsp[0].id, 0) == -1) {
		    aoi_def *def_tmp = new_aoi_def(yyvsp[0].id,scope);
		    def_tmp->binding =
		      (aoi_type)mustcalloc(sizeof(aoi_type_u));
		    def_tmp->binding->kind = AOI_FWD_INTRFC;
		    def_tmp->binding->aoi_type_u_u.fwd_intrfc_def = -1;
		    AddDef(def_tmp, AOI_FWD_INTRFC);
		  }
		}
    break;
case 19:
#line 270 "parser.yy"
{
		  yyval.str = yyvsp[-1].id;
		}
    break;
case 25:
#line 282 "parser.yy"
{AddAttrs(yyvsp[-1].array);}
    break;
case 26:
#line 283 "parser.yy"
{AddOp(yyvsp[-1].op);}
    break;
case 27:
#line 284 "parser.yy"
{ParseError("invalid interface export"); }
    break;
case 29:
#line 287 "parser.yy"
{
		  AddParents(yyvsp[0].array);
		}
    break;
case 31:
#line 293 "parser.yy"
{
		  yyval.array = (VoidArray *)mustcalloc(sizeof(VoidArray));
		  NEW_ARRAY(*yyval.array, int, yyvsp[0].ref);
		}
    break;
case 32:
#line 297 "parser.yy"
{
		  yyval.array = yyvsp[-2].array;
		  ADD_TO_ARRAY(*yyval.array, int, yyvsp[0].ref);
		}
    break;
case 33:
#line 303 "parser.yy"
{yyval.ref = yyvsp[0].ref;}
    break;
case 34:
#line 304 "parser.yy"
{
		  ParseError("expecting identifier");
		  yyval.ref = 0;
		}
    break;
case 35:
#line 310 "parser.yy"
{
		  yyval.ref = FindLocalName(yyvsp[0].id);
		}
    break;
case 36:
#line 313 "parser.yy"
{
		  yyval.ref = FindGlobalName(yyvsp[0].id);
		}
    break;
case 37:
#line 316 "parser.yy"
{
		  yyval.ref = FindScopedName(yyvsp[0].id, yyvsp[-2].ref);
		}
    break;
case 38:
#line 321 "parser.yy"
{
		  AddDef(AoiConst(yyvsp[-3].kind, yyvsp[-2].id, yyvsp[0].cnst), AOI_CONST);
		}
    break;
case 39:
#line 324 "parser.yy"
{
		  ParseError("invalid constant type");
		}
    break;
case 40:
#line 329 "parser.yy"
{yyval.kind = yyvsp[0].kind;}
    break;
case 41:
#line 330 "parser.yy"
{yyval.kind = yyvsp[0].kind;}
    break;
case 42:
#line 331 "parser.yy"
{yyval.kind = yyvsp[0].kind;}
    break;
case 43:
#line 332 "parser.yy"
{yyval.kind = yyvsp[0].kind;}
    break;
case 44:
#line 333 "parser.yy"
{yyval.kind = kSTRING;}
    break;
case 45:
#line 334 "parser.yy"
{yyval.kind = GetConstType(yyvsp[0].ref);}
    break;
case 46:
#line 337 "parser.yy"
{yyval.cnst = yyvsp[0].cnst;}
    break;
case 47:
#line 340 "parser.yy"
{yyval.cnst = yyvsp[0].cnst;}
    break;
case 48:
#line 341 "parser.yy"
{
		  yyval.cnst = const_or(yyvsp[-2].cnst, yyvsp[0].cnst);
		}
    break;
case 49:
#line 346 "parser.yy"
{yyval.cnst = yyvsp[0].cnst;}
    break;
case 50:
#line 347 "parser.yy"
{
		  yyval.cnst = const_xor(yyvsp[-2].cnst, yyvsp[0].cnst);
		}
    break;
case 51:
#line 352 "parser.yy"
{yyval.cnst = yyvsp[0].cnst;}
    break;
case 52:
#line 353 "parser.yy"
{
		  yyval.cnst = const_and(yyvsp[-2].cnst, yyvsp[0].cnst);
		}
    break;
case 53:
#line 358 "parser.yy"
{yyval.cnst = yyvsp[0].cnst;}
    break;
case 54:
#line 359 "parser.yy"
{
		  yyval.cnst = const_lshft(yyvsp[-2].cnst, yyvsp[0].cnst);
		}
    break;
case 55:
#line 362 "parser.yy"
{
		  yyval.cnst = const_rshft(yyvsp[-2].cnst, yyvsp[0].cnst);
		}
    break;
case 56:
#line 367 "parser.yy"
{yyval.cnst = yyvsp[0].cnst;}
    break;
case 57:
#line 368 "parser.yy"
{
		  yyval.cnst = const_add(yyvsp[-2].cnst,yyvsp[0].cnst);
		}
    break;
case 58:
#line 371 "parser.yy"
{
		  yyval.cnst = const_sub(yyvsp[-2].cnst,yyvsp[0].cnst);
		}
    break;
case 59:
#line 376 "parser.yy"
{yyval.cnst = yyvsp[0].cnst;}
    break;
case 60:
#line 377 "parser.yy"
{
		  yyval.cnst = const_mul(yyvsp[-2].cnst,yyvsp[0].cnst);
		}
    break;
case 61:
#line 380 "parser.yy"
{
		  yyval.cnst = const_div(yyvsp[-2].cnst,yyvsp[0].cnst);
		}
    break;
case 62:
#line 383 "parser.yy"
{
		  yyval.cnst = const_mod(yyvsp[-2].cnst,yyvsp[0].cnst);
		}
    break;
case 63:
#line 388 "parser.yy"
{yyval.cnst = yyvsp[0].cnst;}
    break;
case 64:
#line 389 "parser.yy"
{
		  yyval.cnst = const_bit(yyvsp[0].cnst);
		}
    break;
case 65:
#line 392 "parser.yy"
{
		  yyval.cnst = const_pos(yyvsp[0].cnst);
		}
    break;
case 66:
#line 395 "parser.yy"
{
		  yyval.cnst = const_neg(yyvsp[0].cnst);
		}
    break;
case 67:
#line 400 "parser.yy"
{
		  yyval.cnst = GetConstVal(yyvsp[0].ref);
		}
    break;
case 68:
#line 403 "parser.yy"
{yyval.cnst = yyvsp[0].cnst;}
    break;
case 69:
#line 404 "parser.yy"
{yyval.cnst = yyvsp[-1].cnst;}
    break;
case 70:
#line 405 "parser.yy"
{
		  ParseError("invalid constant expression");
		  yyval.cnst = MakeConstInt(1);
		}
    break;
case 71:
#line 411 "parser.yy"
{yyval.cnst = MakeConstInt(yyvsp[0].integer);}
    break;
case 72:
#line 412 "parser.yy"
{yyval.cnst = MakeConstString(yyvsp[0].str);}
    break;
case 73:
#line 413 "parser.yy"
{yyval.cnst = MakeConstChar(yyvsp[0].chr);}
    break;
case 74:
#line 414 "parser.yy"
{yyval.cnst = MakeConstReal(yyvsp[0].real);}
    break;
case 75:
#line 415 "parser.yy"
{yyval.cnst = MakeConstInt(yyvsp[0].integer);}
    break;
case 76:
#line 418 "parser.yy"
{yyval.integer = 1;}
    break;
case 77:
#line 419 "parser.yy"
{yyval.integer = 0;}
    break;
case 78:
#line 422 "parser.yy"
{yyval.integer = GetPosInt(yyvsp[0].cnst);}
    break;
case 79:
#line 425 "parser.yy"
{AddDef(yyvsp[0].defn, AOI_STRUCT);}
    break;
case 80:
#line 426 "parser.yy"
{}
    break;
case 81:
#line 427 "parser.yy"
{}
    break;
case 82:
#line 428 "parser.yy"
{}
    break;
case 83:
#line 429 "parser.yy"
{ParseError("invalid type");}
    break;
case 85:
#line 432 "parser.yy"
{
		  int zz;
		  for (zz = 0; zz < yyvsp[0].array->cur_num - 1; zz++)  {
		    AddDef(GetAoiDefFromDecl(yyvsp[-1].type, ARRAY_REF(*yyvsp[0].array, Declaration, zz)), AOI_STRUCT);
		  }
		  yyval.defn = GetAoiDefFromDecl(yyvsp[-1].type, ARRAY_REF(*yyvsp[0].array, Declaration, zz));
		}
    break;
case 86:
#line 440 "parser.yy"
{yyval.type = yyvsp[0].type;}
    break;
case 87:
#line 441 "parser.yy"
{
		  ParseError("invalid type"); 
   		  yyval.type = MakeAoiType(kSLONG);
		}
    break;
case 88:
#line 446 "parser.yy"
{yyval.type = yyvsp[0].type;}
    break;
case 89:
#line 447 "parser.yy"
{yyval.type = yyvsp[0].type;}
    break;
case 90:
#line 450 "parser.yy"
{yyval.type = yyvsp[0].type;}
    break;
case 91:
#line 451 "parser.yy"
{
			  ParseError("invalid type"); 
			  yyval.type = MakeAoiType(kSLONG);
			}
    break;
case 92:
#line 456 "parser.yy"
{yyval.type = yyvsp[0].type;}
    break;
case 93:
#line 457 "parser.yy"
{yyval.type = yyvsp[0].type;}
    break;
case 94:
#line 458 "parser.yy"
{
		  yyval.type = GetAoiType(yyvsp[0].ref);
		}
    break;
case 95:
#line 463 "parser.yy"
{yyval.type = MakeAoiType(yyvsp[0].kind);}
    break;
case 96:
#line 464 "parser.yy"
{yyval.type = MakeAoiType(yyvsp[0].kind);}
    break;
case 97:
#line 465 "parser.yy"
{yyval.type = MakeAoiType(yyvsp[0].kind);}
    break;
case 98:
#line 466 "parser.yy"
{yyval.type = MakeAoiType(yyvsp[0].kind);}
    break;
case 99:
#line 467 "parser.yy"
{yyval.type = MakeAoiType(yyvsp[0].kind);}
    break;
case 100:
#line 468 "parser.yy"
{yyval.type = MakeAoiType(yyvsp[0].kind);}
    break;
case 101:
#line 469 "parser.yy"
{yyval.type = MakeAoiType(kOBJECT);}
    break;
case 102:
#line 472 "parser.yy"
{yyval.type = yyvsp[0].type;}
    break;
case 103:
#line 473 "parser.yy"
{yyval.type = yyvsp[0].type;}
    break;
case 104:
#line 476 "parser.yy"
{
		  yyval.type = GetAoiType(yyvsp[0].ref);
		}
    break;
case 105:
#line 481 "parser.yy"
{ yyval.ref = yyvsp[0].ref;}
    break;
case 106:
#line 482 "parser.yy"
{ yyval.ref = yyvsp[0].ref;}
    break;
case 107:
#line 483 "parser.yy"
{ yyval.ref = yyvsp[0].ref;}
    break;
case 108:
#line 486 "parser.yy"
{
		  yyval.array = (VoidArray *)mustcalloc(sizeof(VoidArray));
		  NEW_ARRAY(*yyval.array, Declaration, *yyvsp[0].decl);
		}
    break;
case 109:
#line 490 "parser.yy"
{
		  yyval.array = yyvsp[-2].array;
		  ADD_TO_ARRAY(*yyval.array, Declaration, *yyvsp[0].decl);
		}
    break;
case 110:
#line 496 "parser.yy"
{
		  yyval.decl = (Declaration *)mustcalloc(sizeof(Declaration));
		  yyval.decl->sizes.cur_num = 0;
		  yyval.decl->name = yyvsp[0].str;
		}
    break;
case 111:
#line 501 "parser.yy"
{yyval.decl = yyvsp[0].decl;}
    break;
case 112:
#line 504 "parser.yy"
{yyval.str = yyvsp[0].id;}
    break;
case 113:
#line 507 "parser.yy"
{yyval.decl = yyvsp[0].decl;}
    break;
case 114:
#line 510 "parser.yy"
{yyval.kind = kFLOAT;}
    break;
case 115:
#line 511 "parser.yy"
{yyval.kind = kDOUBLE;}
    break;
case 116:
#line 514 "parser.yy"
{yyval.kind = kSLONG;}
    break;
case 117:
#line 515 "parser.yy"
{yyval.kind = kSSHORT;}
    break;
case 118:
#line 516 "parser.yy"
{yyval.kind = kSLLONG;}
    break;
case 119:
#line 517 "parser.yy"
{yyval.kind = kULONG;}
    break;
case 120:
#line 518 "parser.yy"
{yyval.kind = kUSHORT;}
    break;
case 121:
#line 519 "parser.yy"
{yyval.kind = kULLONG;}
    break;
case 122:
#line 520 "parser.yy"
{
		  GrammarError("use `long' or `short' instead of `int'");
		  yyval.kind = kULONG; }
    break;
case 123:
#line 523 "parser.yy"
{
		  ParseError("`unsigned' must be followed by `long' or `short'");
		  yyval.kind = kULONG;
		}
    break;
case 124:
#line 527 "parser.yy"
{ 
		  GrammarError("use `long' or `short' instead of `int'");
		  yyval.kind = kSLONG; }
    break;
case 125:
#line 532 "parser.yy"
{yyval.kind = kCHAR;}
    break;
case 126:
#line 535 "parser.yy"
{yyval.kind = kBOOL;}
    break;
case 127:
#line 538 "parser.yy"
{yyval.kind = kOCTET;}
    break;
case 128:
#line 541 "parser.yy"
{yyval.kind = kANY;}
    break;
case 129:
#line 544 "parser.yy"
{ yyval.str=curr_struct_id; curr_struct_id = yyvsp[0].id; }
    break;
case 130:
#line 545 "parser.yy"
{
		  yyval.ref = cur_aoi.defs.defs_len;  
		  aoi_def *tmp = new_aoi_def(yyvsp[-2].id,scope);
		  tmp->binding = (aoi_type)mustcalloc(sizeof(aoi_type_u));
		  tmp->binding->kind = AOI_STRUCT;
		  AddDef(tmp, AOI_STRUCT);
		  AddScope(yyvsp[-2].id);
		}
    break;
case 131:
#line 552 "parser.yy"
{
		  yyval.ref = yyvsp[-2].ref;
		  DelScope();
		  cur_aoi.defs.defs_val[yyval.ref].binding->aoi_type_u_u.struct_def.
		    slots.slots_len = yyvsp[-1].array->cur_num;
		  cur_aoi.defs.defs_val[yyval.ref].binding->aoi_type_u_u.struct_def.
		    slots.slots_val = &(ARRAY_REF(*yyvsp[-1].array,aoi_field,0));
		  curr_struct_id = yyvsp[-4].str;
		}
    break;
case 132:
#line 561 "parser.yy"
{
		  yyval.ref = FindLocalName(yyvsp[0].id,FALSE);
		  if ((signed)yyval.ref == -1) {
 		    GrammarError("missing `{' in struct definition");
		    yyval.ref = new_error_ref(yyvsp[0].id);
		  }
		  else {
		    GrammarError(("missing `{'.  (Hint: omit `struct' when "
				  "using a defined structure type)"));
		  }
		}
    break;
case 133:
#line 574 "parser.yy"
{
		  yyval.array = yyvsp[0].array;
		}
    break;
case 134:
#line 577 "parser.yy"
{
		  aoi_def fake_def;
		  
		  fake_def.binding = 0;
		  fake_def.name = 0;
		  fake_def.scope = scope;
		  yyval.array = yyvsp[-1].array;
		  for (int zz = 0; zz < yyvsp[0].array->cur_num; zz++) {
		    for (int xx = 0; xx < yyval.array->cur_num; xx++) {
		      if( (ARRAY_REF(*yyval.array, aoi_field, xx).name) &&
		          !strcmp(ARRAY_REF(*yyval.array, aoi_field, xx).name,
				  ARRAY_REF(*yyvsp[0].array,aoi_field,zz).name)) {
			SemanticError("'%s' already used",
				      ARRAY_REF(*yyvsp[0].array,aoi_field,zz).name);
		      }
		      fake_def.name = ARRAY_REF(*yyvsp[0].array,aoi_field,zz).name;
		      DupeError(&fake_def, AOI_STRUCT);
		    }
		    ADD_TO_ARRAY(*yyval.array, aoi_field, ARRAY_REF(*yyvsp[0].array,aoi_field,zz));
		  }
		}
    break;
case 135:
#line 598 "parser.yy"
{
	 	  ParseError("invalid member of structure `%s'",
			     curr_struct_id);
		  yyval.array = (VoidArray *)mustcalloc(sizeof(VoidArray));
		  yyval.array->cur_num = 0;
		  yyval.array->act_num = 0;
 		}
    break;
case 136:
#line 607 "parser.yy"
{
		  /*
		   * By doing `yyerrok' here, we often improve error reporting
		   * for the next member.
		   */
		  yyerrok;
		  yyval.array = (VoidArray *)mustcalloc(sizeof(VoidArray));
		  yyval.array->cur_num = yyvsp[-1].array->cur_num;
		  yyval.array->act_num = yyvsp[-1].array->act_num;
		  yyval.array->data = (void *)mustcalloc(sizeof(aoi_field)*yyval.array->act_num);
		  for (int zz = 0; zz < yyvsp[-1].array->cur_num; zz++) {
		    aoi_field the_field;
		    the_field.name = ARRAY_REF(*yyvsp[-1].array, Declaration, zz).name;
		    the_field.type = GetAoiTypeFromDecl(yyvsp[-2].type, ARRAY_REF(*yyvsp[-1].array, Declaration, zz));
		    ARRAY_REF(*yyval.array, aoi_field, zz) = the_field;
		  }
		}
    break;
case 137:
#line 626 "parser.yy"
{
		  aoi_def *tmp = new_aoi_def(yyvsp[-2].id,scope);
		  tmp->binding = (aoi_type)mustcalloc(sizeof(aoi_type_u));
		  tmp->binding->kind = AOI_UNION;
		  yyval.integer = cur_aoi.defs.defs_len; 
		  AddDef(tmp, AOI_UNION);
		  AddScope(yyvsp[-2].id);
		}
    break;
case 138:
#line 633 "parser.yy"
{  
		  yyval.field = default_union;
		  default_union = 0;
		}
    break;
case 139:
#line 636 "parser.yy"
{
		  yyval.ref = yyvsp[-6].integer;
		  cur_aoi.defs.defs_val[yyval.ref].binding->aoi_type_u_u.union_def.
			discriminator.name = &(DISCRM[0]);
		  cur_aoi.defs.defs_val[yyval.ref].binding->aoi_type_u_u.union_def.
			discriminator.type = yyvsp[-5].type;
		  cur_aoi.defs.defs_val[yyval.ref].binding->aoi_type_u_u.union_def.
			union_label = &(UNION_LABEL[0]);
		  cur_aoi.defs.defs_val[yyval.ref].binding->aoi_type_u_u.union_def.
			cases.cases_len = yyvsp[-1].array->cur_num;
		  cur_aoi.defs.defs_val[yyval.ref].binding->aoi_type_u_u.union_def.
			cases.cases_val = &(ARRAY_REF(*yyvsp[-1].array, aoi_union_case,0));
		  if (!default_union) {
		    /*
		     * CORBA IDL-defined unions have an implicit void default
		     * branch, if no explicit default branch is specified.
		     * This is the semantics of the IDL, not an artifact of any
		     * particular presentation.
		     */
		    default_union = (aoi_field *)
				    mustcalloc(sizeof(aoi_field));
		    /* `default_union->name' is unused, since type is void. */
		    default_union->name = ir_strlit("");
		    default_union->type = (aoi_type)
					  mustcalloc(sizeof(aoi_type_u));
		    default_union->type->kind = AOI_VOID;
		  }
		  cur_aoi.defs.defs_val[yyval.ref].binding->aoi_type_u_u.union_def.
			dfault = default_union;
		  default_union = yyvsp[-2].field;
		  DelScope();
		}
    break;
case 140:
#line 668 "parser.yy"
{
		  yyval.ref = FindLocalName(yyvsp[0].id,FALSE);
		  if ((signed)yyval.ref == -1) {
 		    GrammarError("missing `switch' in union definition");
		    yyval.ref = new_error_ref(yyvsp[0].id);
		  }
		  else {
		    GrammarError(("missing `switch'.  (Hint: omit `union' "
				  "when using a defined union type)"));
		  }
		}
    break;
case 141:
#line 681 "parser.yy"
{yyval.type = MakeAoiType(yyvsp[0].kind);}
    break;
case 142:
#line 682 "parser.yy"
{yyval.type = MakeAoiType(yyvsp[0].kind);}
    break;
case 143:
#line 683 "parser.yy"
{yyval.type = MakeAoiType(yyvsp[0].kind);}
    break;
case 144:
#line 684 "parser.yy"
{
		  yyval.type = (aoi_type)mustcalloc(sizeof(aoi_type_u));
		  yyval.type->kind = AOI_INTEGER;
		  yyval.type->aoi_type_u_u.integer_def.min = 0;
		  yyval.type->aoi_type_u_u.integer_def.range = ~0;
		}
    break;
case 145:
#line 690 "parser.yy"
{yyval.type = GetAoiType(yyvsp[0].ref);}
    break;
case 146:
#line 691 "parser.yy"
{
		  ParseError("invalid switch type"); 
		  yyval.type = MakeAoiType(kSLONG);
		}
    break;
case 147:
#line 697 "parser.yy"
{yyval.array = yyvsp[0].array;}
    break;
case 148:
#line 698 "parser.yy"
{
		  yyval.array = yyvsp[-1].array;
		  for (int zz = 0; zz < yyvsp[0].array->cur_num; zz++) {
		    if (ARRAY_REF(*yyvsp[0].array,aoi_union_case,zz).val) {
		      CheckUnionCaseDuplicate(
			yyval.array,
			&ARRAY_REF(*yyvsp[0].array, aoi_union_case, zz));
		      ADD_TO_ARRAY(*yyval.array,
				   aoi_union_case,
				   ARRAY_REF(*yyvsp[0].array, aoi_union_case, zz));
		    } else {
		      if (default_union)
			SemanticError("more than one `default' case in union");
		      default_union = &(ARRAY_REF(*yyvsp[0].array,aoi_union_case,zz).var);
		    }
		  }
		}
    break;
case 149:
#line 717 "parser.yy"
{
		  /*
		   * By doing `yyerrok' here, we often improve error reporting
		   * for the next case.
		   */
		  yyerrok;
		  yyval.array = (VoidArray *)mustcalloc(sizeof(VoidArray));
		  aoi_union_case tmp;
		  tmp.var = *yyvsp[-1].field;
		  tmp.val = ARRAY_REF(*yyvsp[-2].array, aoi_const, 0);
		  NEW_ARRAY(*yyval.array, aoi_union_case, tmp);
		  for (int itmp = 1; itmp < yyvsp[-2].array->cur_num; itmp++) {
		    tmp.val = ARRAY_REF(*yyvsp[-2].array, aoi_const, itmp);
		    ADD_TO_ARRAY(*yyval.array, aoi_union_case, tmp);
		  }
		}
    break;
case 150:
#line 733 "parser.yy"
{
		  ParseError("invalid case");
		  yyval.array = (VoidArray *)mustcalloc(sizeof(VoidArray));
		  NEW_ARRAY(*yyval.array, int, 1);
		  (*yyval.array).cur_num = 0; /* empty */
		}
    break;
case 151:
#line 741 "parser.yy"
{
		  yyval.array = (VoidArray *)mustcalloc(sizeof(VoidArray));
		  NEW_ARRAY(*yyval.array, aoi_const, yyvsp[0].cnst);
		}
    break;
case 152:
#line 745 "parser.yy"
{
		  yyval.array = yyvsp[-1].array;
		  ADD_TO_ARRAY(*yyval.array, aoi_const, yyvsp[0].cnst);
		}
    break;
case 153:
#line 751 "parser.yy"
{yyval.cnst = yyvsp[-1].cnst;}
    break;
case 154:
#line 752 "parser.yy"
{yyval.cnst = 0;}
    break;
case 155:
#line 755 "parser.yy"
{
		  yyval.field = (aoi_field *)mustcalloc(sizeof(aoi_field));
		  yyval.field->name = yyvsp[0].decl->name;
		  yyval.field->type = GetAoiTypeFromDecl(yyvsp[-1].type, *yyvsp[0].decl);
		}
    break;
case 156:
#line 762 "parser.yy"
{
		  aoi_def *tmp = new_aoi_def(yyvsp[-3].id,scope);
		  tmp->binding = (aoi_type)mustcalloc(sizeof(aoi_type_u));
		  tmp->binding->kind = AOI_ENUM;
		  tmp->binding->aoi_type_u_u.enum_def.enum_label = yyvsp[-3].id;
		  /*
		   * XXX --- HACK!
		   *
		   * Here we have a problem: The names of the enumeration
		   * members must have AOI definitions (`aoi_def's) in order
		   * for the `scoped_name' production to find them, as it must
		   * (for example) when the values are used as case labels in
		   * a discriminated union.  But AOI enumeration members don't
		   * generally have AOI definitions (`aoi_def's); they are not
		   * indexable by any `aoi_ref' but are instead contained in an
		   * AOI_ENUM.
		   *
		   * Our ``solution'' is to make the `enum' be empty and to
		   * create AOI_CONSTs for the members.  This solution works
		   * with the standard CORBA C presentation of enumerations.
		   * However, it presumably isn't equivalent under all present-
		   * ation styles, so we really shouldn't be doing things this
		   * way.
		   *
		   * (An alternate solution would be to create two definitions
		   * for each member: one within the AOI_ENUM, and one special
		   * `aoi_def' that carries the member's value.  The front end
		   * would use the latter in order to parse IDL input; the
		   * presentation generator would uses the former to generate
		   * code and would ignore the latter entirely.  This solution
		   * would require adding a new kind of AOI type, however, and
		   * I wanted to contain this hack as much as possible.)
		   * - Addendum - Well not really...  Its been changed to
		   * output the AOI_CONSTs as IMPLIED so that the consts can
		   * still be referenced without a problem.
		   *
		   * When we get around to redoing AOI, this hack should be
		   * eliminated.
		   */
		  /* We SHOULD do this: */
		  tmp->binding->aoi_type_u_u.enum_def.defs.defs_len
			 = yyvsp[-1].array->cur_num;
		  tmp->binding->aoi_type_u_u.enum_def.defs.defs_val
			 = &(ARRAY_REF(*yyvsp[-1].array, aoi_field, 0));
		  AddDef(tmp, AOI_CONST);
		  yyval.ref = cur_aoi.defs.defs_len - 1;
		  /*
		   * And we are then forced to make `aoi_def's for the members
		   * of the enumeration.
		   */
		  for (int zztmp = 0; zztmp < yyvsp[-1].array->cur_num; zztmp++) {
		    aoi_def temp;
		    temp.name = ARRAY_REF(*yyvsp[-1].array, aoi_field, zztmp).name;
		    temp.scope = scope;
		    temp.binding = ARRAY_REF(*yyvsp[-1].array, aoi_field, zztmp).type;
		    AddDef(&temp, AOI_CONST)->idl_file = builtin_file;
		  }
		}
    break;
case 157:
#line 822 "parser.yy"
{
		  yyval.array = (VoidArray *)mustcalloc(sizeof(VoidArray));
		  enum_val = 0;
		  aoi_field tmp;
		  tmp.name = yyvsp[0].str;
		  tmp.type = (aoi_type)mustcalloc(sizeof(aoi_type_u));
		  tmp.type->kind = AOI_CONST;
		  tmp.type->aoi_type_u_u.const_def.type = MakeAoiType(kSLONG);
		  tmp.type->aoi_type_u_u.const_def.value =
		    (aoi_const)mustcalloc(sizeof(aoi_const_u));
		  tmp.type->aoi_type_u_u.const_def.value->kind = AOI_CONST_INT;
		  tmp.type->aoi_type_u_u.const_def.value->aoi_const_u_u.
		    const_int = enum_val;
		  NEW_ARRAY(*yyval.array, aoi_field, tmp);
		}
    break;
case 158:
#line 837 "parser.yy"
{
		  yyval.array = yyvsp[-2].array;
		  aoi_field tmp;
		  tmp.name = yyvsp[0].str;
		  tmp.type = (aoi_type)mustcalloc(sizeof(aoi_type_u));
		  tmp.type->kind = AOI_CONST;
		  tmp.type->aoi_type_u_u.const_def.type = MakeAoiType(kSLONG);
		  tmp.type->aoi_type_u_u.const_def.value =
		    (aoi_const)mustcalloc(sizeof(aoi_const_u));
		  tmp.type->aoi_type_u_u.const_def.value->kind = AOI_CONST_INT;
		  tmp.type->aoi_type_u_u.const_def.value->aoi_const_u_u.
		    const_int = ++enum_val;
		  ADD_TO_ARRAY(*yyval.array, aoi_field, tmp);
		}
    break;
case 159:
#line 853 "parser.yy"
{yyval.str = yyvsp[0].id;}
    break;
case 160:
#line 856 "parser.yy"
{
		  yyval.type = (aoi_type)mustcalloc(sizeof(aoi_type_u));
		  yyval.type->kind = AOI_ARRAY;
		  yyval.type->aoi_type_u_u.array_def.element_type = yyvsp[-3].type;
		  yyval.type->aoi_type_u_u.array_def.flgs = AOI_ARRAY_FLAG_NONE;
		  aoi_type length = (aoi_type)mustcalloc(sizeof(aoi_type_u));
		  length->kind = AOI_INTEGER;
		  length->aoi_type_u_u.integer_def.min = 0;
		  length->aoi_type_u_u.integer_def.range = yyvsp[-1].integer;
		  yyval.type->aoi_type_u_u.array_def.length_type = length;
		}
    break;
case 161:
#line 867 "parser.yy"
{
		  yyval.type = (aoi_type)mustcalloc(sizeof(aoi_type_u));
		  yyval.type->kind = AOI_ARRAY;
		  yyval.type->aoi_type_u_u.array_def.element_type = yyvsp[-1].type;
		  yyval.type->aoi_type_u_u.array_def.flgs = AOI_ARRAY_FLAG_NONE;
		  aoi_type length = (aoi_type)mustcalloc(sizeof(aoi_type_u));
		  length->kind = AOI_INTEGER;
		  length->aoi_type_u_u.integer_def.min = 0;
		  length->aoi_type_u_u.integer_def.range = ~0;
		  yyval.type->aoi_type_u_u.array_def.length_type = length;
		}
    break;
case 162:
#line 880 "parser.yy"
{
		  yyval.type = (aoi_type)mustcalloc(sizeof(aoi_type_u));
		  yyval.type->kind = AOI_ARRAY;
		  aoi_type element = (aoi_type)mustcalloc(sizeof(aoi_type_u));
		  element->kind = AOI_CHAR;
		  element->aoi_type_u_u.char_def.bits = 8;
		  element->aoi_type_u_u.char_def.flags = AOI_CHAR_FLAG_NONE;
		  yyval.type->aoi_type_u_u.array_def.element_type = element;
		  yyval.type->aoi_type_u_u.array_def.flgs = AOI_ARRAY_FLAG_NULL_TERMINATED_STRING;
		  aoi_type length = (aoi_type)mustcalloc(sizeof(aoi_type_u));
		  length->kind = AOI_INTEGER;
		  length->aoi_type_u_u.integer_def.min = 0;
		  length->aoi_type_u_u.integer_def.range = yyvsp[-1].integer;
		  yyval.type->aoi_type_u_u.array_def.length_type = length;
		}
    break;
case 163:
#line 895 "parser.yy"
{
		  yyval.type = (aoi_type)mustcalloc(sizeof(aoi_type_u));
		  yyval.type->kind = AOI_ARRAY;
		  aoi_type element = (aoi_type)mustcalloc(sizeof(aoi_type_u));
		  element->kind = AOI_CHAR;
		  element->aoi_type_u_u.char_def.bits = 8;
		  element->aoi_type_u_u.char_def.flags = AOI_CHAR_FLAG_NONE;
		  yyval.type->aoi_type_u_u.array_def.element_type = element;
		  yyval.type->aoi_type_u_u.array_def.flgs = AOI_ARRAY_FLAG_NULL_TERMINATED_STRING;
		  aoi_type length = (aoi_type)mustcalloc(sizeof(aoi_type_u));
		  length->kind = AOI_INTEGER;
		  length->aoi_type_u_u.integer_def.min = 0;
		  length->aoi_type_u_u.integer_def.range = ~0;
		  yyval.type->aoi_type_u_u.array_def.length_type = length;
		}
    break;
case 164:
#line 912 "parser.yy"
{
		  yyval.decl = (Declaration *)mustcalloc(sizeof(Declaration));
		  yyval.decl->name = yyvsp[-1].id;
		  yyval.decl->sizes = *yyvsp[0].array;
		}
    break;
case 165:
#line 919 "parser.yy"
{
		  yyval.array = (VoidArray *)mustcalloc(sizeof(VoidArray));
		  NEW_ARRAY(*yyval.array, unsigned int, yyvsp[0].integer);
		}
    break;
case 166:
#line 923 "parser.yy"
{
		  yyval.array = yyvsp[-1].array;
		  ADD_TO_ARRAY(*yyval.array, unsigned int, yyvsp[0].integer);
		}
    break;
case 167:
#line 929 "parser.yy"
{
		  yyval.integer = yyvsp[-1].integer;
		}
    break;
case 168:
#line 934 "parser.yy"
{
		  aoi_def *tmp = new_aoi_def(yyvsp[-1].id,scope);
		  yyval.integer = cur_aoi.defs.defs_len;
		  AddDef(tmp, AOI_STRUCT);
		  AddScope(yyvsp[-1].id);
		}
    break;
case 169:
#line 939 "parser.yy"
{
		  DelScope();
		  cur_aoi.defs.defs_val[yyvsp[-2].integer].binding 
		    = (aoi_type)mustcalloc(sizeof(aoi_type_u));
		  cur_aoi.defs.defs_val[yyvsp[-2].integer].binding->kind 
		    = AOI_EXCEPTION;
		  cur_aoi.defs.defs_val[yyvsp[-2].integer].binding->aoi_type_u_u.exception_def.slots.slots_len 
		    = yyvsp[-1].array->cur_num;
		  cur_aoi.defs.defs_val[yyvsp[-2].integer].binding->aoi_type_u_u.exception_def.slots.slots_val 
		    = &(ARRAY_REF(*yyvsp[-1].array,aoi_field,0));
		}
    break;
case 170:
#line 952 "parser.yy"
{
		  yyval.array = (VoidArray *)mustcalloc(sizeof(VoidArray));
		  yyval.array->cur_num = 0;
		  yyval.array->act_num = 0;
		  yyval.array->data = 0;
		}
    break;
case 171:
#line 958 "parser.yy"
{
		  yyval.array = yyvsp[-1].array;
		  for (int zz = 0; zz < yyvsp[0].array->cur_num; zz++) {
		    ADD_TO_ARRAY(*yyval.array, aoi_field, ARRAY_REF(*yyvsp[0].array,aoi_field,zz));
		  }
		}
    break;
case 172:
#line 964 "parser.yy"
{
	 	  ParseError("invalid member of exception declaration");
		  yyval.array = yyvsp[-1].array;
 		}
    break;
case 173:
#line 971 "parser.yy"
{
			  if ((yyvsp[-1].integer) && (yyvsp[0].type->kind != AOI_VOID)) {
			    SemanticError("oneway operations must return void");
			  }
		}
    break;
case 174:
#line 975 "parser.yy"
{
			  // XXX - need to add support for context expressions
			  yyval.op = (aoi_operation *)mustcalloc(sizeof(aoi_operation));
			  yyval.op->name = yyvsp[-3].id;
			  yyval.op->return_type = yyvsp[-5].type;
			  yyval.op->flags = (aoi_op_flags)
				      (yyvsp[-6].integer ? AOI_OP_FLAG_ONEWAY :
					    AOI_OP_FLAG_NONE);
			  yyval.op->params.params_len = yyvsp[-2].array->cur_num;
			  yyval.op->params.params_val = &(ARRAY_REF(*yyvsp[-2].array, aoi_parameter, 0));
			  yyval.op->exceps.exceps_len = yyvsp[-1].array->cur_num;
			  yyval.op->exceps.exceps_val = &(ARRAY_REF(*yyvsp[-1].array, aoi_type, 0));
			  yyval.op->request_code = GetRequest(yyvsp[-3].id);
			  yyval.op->reply_code = GetReply(yyvsp[-3].id);
		}
    break;
case 175:
#line 992 "parser.yy"
{yyval.integer = in_oneway = 0;}
    break;
case 176:
#line 993 "parser.yy"
{yyval.integer = in_oneway = 1;}
    break;
case 177:
#line 996 "parser.yy"
{
		  yyval.array = (VoidArray *)mustcalloc(sizeof(VoidArray));
		  yyval.array->cur_num = 0;
		  yyval.array->act_num = 0;
		  yyval.array->data = (void *)mustcalloc(sizeof(int)*10);
		}
    break;
case 178:
#line 1002 "parser.yy"
{yyval.array = yyvsp[0].array;}
    break;
case 181:
#line 1009 "parser.yy"
{
		  yyval.type = (aoi_type)mustcalloc(sizeof(aoi_type_u));
		  yyval.type->kind = AOI_VOID;
		}
    break;
case 182:
#line 1013 "parser.yy"
{yyval.type = yyvsp[0].type;}
    break;
case 183:
#line 1016 "parser.yy"
{yyval.array = yyvsp[-1].array;}
    break;
case 184:
#line 1017 "parser.yy"
{
		  yyval.array = (VoidArray *)mustcalloc(sizeof(VoidArray));
		  yyval.array->cur_num = 0;
		  yyval.array->data = (void *)mustcalloc(sizeof(int));
		}
    break;
case 185:
#line 1024 "parser.yy"
{
		  yyval.array = (VoidArray *)mustcalloc(sizeof(VoidArray));
		  NEW_ARRAY(*yyval.array, aoi_parameter, *yyvsp[0].parm);
		}
    break;
case 186:
#line 1028 "parser.yy"
{
		  yyval.array = yyvsp[-2].array;
		  ADD_TO_ARRAY(*yyval.array, aoi_parameter, *yyvsp[0].parm);
		}
    break;
case 187:
#line 1032 "parser.yy"
{
		  if (in_oneway)
		    ParseError("expecting `in'");
		  else
  		    ParseError("expecting `in', `inout', or `out'");
		  yyval.array = yyvsp[-2].array;
		}
    break;
case 188:
#line 1041 "parser.yy"
{
		  if (in_oneway && (yyvsp[0].integer != AOI_DIR_IN)) {
		    SemanticError("oneway operations allow `in' parameters only");
		  }
		}
    break;
case 189:
#line 1045 "parser.yy"
{
		  yyval.parm = (aoi_parameter *)mustcalloc(sizeof(aoi_parameter));
		  yyval.parm->name = yyvsp[0].str;
		  yyval.parm->type = yyvsp[-1].type;
		  yyval.parm->direction = (aoi_direction) yyvsp[-3].integer;
		}
    break;
case 190:
#line 1053 "parser.yy"
{yyval.integer = AOI_DIR_IN;}
    break;
case 191:
#line 1054 "parser.yy"
{ yyval.integer = AOI_DIR_INOUT;}
    break;
case 192:
#line 1055 "parser.yy"
{yyval.integer = AOI_DIR_OUT;}
    break;
case 193:
#line 1058 "parser.yy"
{yyval.type = yyvsp[0].type;}
    break;
case 194:
#line 1059 "parser.yy"
{
			  ParseError("invalid type"); 
			  yyval.type = MakeAoiType(kSLONG); 
			}
    break;
case 195:
#line 1065 "parser.yy"
{yyval.type = yyvsp[0].type;}
    break;
case 196:
#line 1066 "parser.yy"
{yyval.type = yyvsp[0].type;}
    break;
case 197:
#line 1067 "parser.yy"
{
		  yyval.type = GetAoiType(yyvsp[0].ref);
		}
    break;
case 198:
#line 1070 "parser.yy"
{
		  GrammarError(("`sequence<...>' cannot be used as a "
				"parameter type.  (Hint: use a `typedef'ed "
				"sequence type)"));
		  yyval.type = yyvsp[0].type;
		}
    break;
case 199:
#line 1078 "parser.yy"
{
		  yyval.array = (VoidArray *)mustcalloc(sizeof(VoidArray));
		  yyval.array->cur_num = yyvsp[-1].array->cur_num;
		  yyval.array->act_num = yyvsp[-1].array->cur_num;
		  yyval.array->data = (VoidArray *)mustcalloc(sizeof(aoi_type) * yyvsp[-1].array->cur_num);
		  for (int zz = 0; zz < yyvsp[-1].array->cur_num; zz++) {
		    ARRAY_REF(*yyval.array, aoi_type, zz)
		      = GetAoiType(ARRAY_REF(*yyvsp[-1].array, int, zz));
		  }
		}
    break;
case 201:
#line 1091 "parser.yy"
{
		  GrammarError("context expression missing string");
		}
    break;
case 202:
#line 1096 "parser.yy"
{}
    break;
case 203:
#line 1097 "parser.yy"
{}
    break;
case 204:
#line 1098 "parser.yy"
{ParseError("expecting string");}
    break;
case 205:
#line 1101 "parser.yy"
{
		  aoi_def fake_def;
		  
		  fake_def.binding = 0;
		  fake_def.scope = scope;
		  fake_def.name = 0;
		  yyval.array = (VoidArray *)mustcalloc(sizeof(VoidArray));
		  for (int zz = 0; zz < yyvsp[0].array->cur_num; zz++) {
		    aoi_attribute a;
		    a.name = ARRAY_REF(*yyvsp[0].array, char*, zz);
		    a.type = yyvsp[-1].type;
		    a.readonly = yyvsp[-3].integer;
		    a.read_request_code = GetReadRequest(a.name);
		    a.read_reply_code = GetReadReply(a.name);
		    a.write_request_code = GetWriteRequest(a.name, a.readonly);
		    a.write_reply_code = GetWriteReply(a.name, a.readonly);
		    fake_def.name = a.name;
		    DupeError(&fake_def, AOI_STRUCT);
		    if (zz) {
		      for (int xx = 0; xx < yyval.array->cur_num; xx++) {
		        if (ARRAY_REF(*yyval.array, aoi_attribute, xx).name &&
			    !strcmp(ARRAY_REF(*yyval.array, aoi_attribute, xx).name,
			            a.name)) {
			  SemanticError("`%s' already defined", a.name);
			}
		      }
		      ADD_TO_ARRAY(*yyval.array, aoi_attribute, a);
		    } else {
		      NEW_ARRAY(*yyval.array, aoi_attribute, a);
		    }
		  }
		}
    break;
case 206:
#line 1135 "parser.yy"
{yyval.integer = 0;}
    break;
case 207:
#line 1136 "parser.yy"
{yyval.integer = 1;}
    break;
case 208:
#line 1139 "parser.yy"
{
		  yyval.array = (VoidArray *)mustcalloc(sizeof(VoidArray));
		  NEW_ARRAY(*yyval.array, char*, yyvsp[0].str);
		}
    break;
case 209:
#line 1143 "parser.yy"
{
		  yyval.array = yyvsp[-2].array;
		  ADD_TO_ARRAY(*yyval.array, char* ,yyvsp[0].str);
		}
    break;
case 210:
#line 1149 "parser.yy"
{ yyval.id = yyvsp[0].id; }
    break;
case 211:
#line 1150 "parser.yy"
{
		  GrammarError("number not expected"); 
		  yyval.id = yyvsp[0].id; 
		}
    break;
case 212:
#line 1154 "parser.yy"
{ 
		  GrammarError("explicit pointers not allowed"); 
		  yyval.id = yyvsp[0].id; 
		}
    break;
case 213:
#line 1158 "parser.yy"
{
		  ParseError("expecting identifier");
		  /*
		   * "" is `const char *' in modern C++; `muststrdup' lets us
		   * avoid a warning about assigning "" to a `char *'.
		   */
		  yyval.id = muststrdup("");
		}
    break;
case 215:
#line 1169 "parser.yy"
{ ParseError("expecting `<'"); }
    break;
case 217:
#line 1172 "parser.yy"
{ ParseError("expecting `>'"); }
    break;
case 219:
#line 1175 "parser.yy"
{ ParseError("expecting `:'"); }
    break;
case 221:
#line 1178 "parser.yy"
{ ParseError("expecting `='"); }
    break;
case 223:
#line 1181 "parser.yy"
{ ParseError("expecting `;'"); }
    break;
case 225:
#line 1184 "parser.yy"
{ ParseError("expecting `('"); }
    break;
case 227:
#line 1187 "parser.yy"
{ ParseError("expecting `)'"); }
    break;
case 229:
#line 1190 "parser.yy"
{ ParseError("expecting `{'"); }
    break;
case 231:
#line 1193 "parser.yy"
{ ParseError("expecting `}'"); }
    break;
case 233:
#line 1196 "parser.yy"
{ ParseError("expecting `]'"); }
    break;
}

#line 705 "/usr/local/share/bison/bison.simple"


  yyvsp -= yylen;
  yyssp -= yylen;
#if YYLSP_NEEDED
  yylsp -= yylen;
#endif

#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;
#if YYLSP_NEEDED
  *++yylsp = yyloc;
#endif

  /* 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 - YYNTBASE] + *yyssp;
  if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
    yystate = yytable[yystate];
  else
    yystate = yydefgoto[yyn - YYNTBASE];

  goto yynewstate;


/*------------------------------------.
| yyerrlab -- here on detecting error |
`------------------------------------*/
yyerrlab:
  /* If not already recovering from an error, report this error.  */
  if (!yyerrstatus)
    {
      ++yynerrs;

#ifdef YYERROR_VERBOSE
      yyn = yypact[yystate];

      if (yyn > YYFLAG && yyn < YYLAST)
	{
	  YYSIZE_T yysize = 0;
	  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)
	      yysize += yystrlen (yytname[yyx]) + 15, yycount++;
	  yysize += yystrlen ("parse error, unexpected ") + 1;
	  yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
	  yymsg = (char *) YYSTACK_ALLOC (yysize);
	  if (yymsg != 0)
	    {
	      char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
	      yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);

	      if (yycount < 5)
		{
		  yycount = 0;
		  for (yyx = yyn < 0 ? -yyn : 0;
		       yyx < (int) (sizeof (yytname) / sizeof (char *));
		       yyx++)
		    if (yycheck[yyx + yyn] == yyx)
		      {
			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 /* defined (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)
	YYABORT;
      YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
		  yychar, yytname[yychar1]));
      yychar = YYEMPTY;
    }

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

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

  goto yyerrhandle;


/*-------------------------------------------------------------------.
| yyerrdefault -- current state does not do anything special for the |
| error token.                                                       |
`-------------------------------------------------------------------*/
yyerrdefault:
#if 0
  /* This is wrong; only states that explicitly want error tokens
     should shift them.  */

  /* If its default is to accept any token, ok.  Otherwise pop it.  */
  yyn = yydefact[yystate];
  if (yyn)
    goto yydefault;
#endif


/*---------------------------------------------------------------.
| yyerrpop -- pop the current state because it cannot handle the |
| error token                                                    |
`---------------------------------------------------------------*/
yyerrpop:
  if (yyssp == yyss)
    YYABORT;
  yyvsp--;
  yystate = *--yyssp;
#if YYLSP_NEEDED
  yylsp--;
#endif

#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

/*--------------.
| yyerrhandle.  |
`--------------*/
yyerrhandle:
  yyn = yypact[yystate];
  if (yyn == YYFLAG)
    goto yyerrdefault;

  yyn += YYTERROR;
  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
    goto yyerrdefault;

  yyn = yytable[yyn];
  if (yyn < 0)
    {
      if (yyn == YYFLAG)
	goto yyerrpop;
      yyn = -yyn;
      goto yyreduce;
    }
  else if (yyn == 0)
    goto yyerrpop;

  if (yyn == YYFINAL)
    YYACCEPT;

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

  *++yyvsp = yylval;
#if YYLSP_NEEDED
  *++yylsp = yylloc;
#endif

  yystate = yyn;
  goto yynewstate;


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

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

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

yyreturn:
#ifndef yyoverflow
  if (yyss != yyssa)
    YYSTACK_FREE (yyss);
#endif
  return yyresult;
}
#line 1199 "parser.yy"


void
yyerror(const char * /* s */)
{
  fail = 1;
  errorflag = lineno;
  strcpy(errorlinebuf,linebuf);
  errorPos = tokenPos;
}

/* End of file. */



syntax highlighted by Code2HTML, v. 0.9.1