
/*  A Bison parser, made from parse.y with Bison version GNU Bison version 1.22
  */

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

#define	EXPR_AND_AND	258
#define	EXPR_OR_OR	259
#define	EXPR_AND	260
#define	EXPR_OR	261
#define	EXPR_NOT	262
#define	EXPR_LT	263
#define	EXPR_LE	264
#define	EXPR_EQ	265
#define	EXPR_NE	266
#define	EXPR_GE	267
#define	EXPR_GT	268
#define	LEFTDIV	269
#define	EMUL	270
#define	EDIV	271
#define	ELEFTDIV	272
#define	QUOTE	273
#define	TRANSPOSE	274
#define	PLUS_PLUS	275
#define	MINUS_MINUS	276
#define	POW	277
#define	EPOW	278
#define	NUM	279
#define	IMAG_NUM	280
#define	NAME	281
#define	SCREW	282
#define	END	283
#define	PLOT	284
#define	TEXT	285
#define	STYLE	286
#define	FOR	287
#define	WHILE	288
#define	IF	289
#define	ELSEIF	290
#define	ELSE	291
#define	BREAK	292
#define	CONTINUE	293
#define	FUNC_RET	294
#define	UNWIND	295
#define	CLEANUP	296
#define	GLOBAL	297
#define	TEXT_ID	298
#define	LEXICAL_ERROR	299
#define	FCN	300
#define	SCREW_TWO	301
#define	ELLIPSIS	302
#define	ALL_VA_ARGS	303
#define	END_OF_INPUT	304
#define	USING	305
#define	TITLE	306
#define	WITH	307
#define	COLON	308
#define	OPEN_BRACE	309
#define	CLOSE_BRACE	310
#define	CLEAR	311
#define	UNARY	312

#line 27 "parse.y"

#define YYDEBUG 1

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <strstream.h>

#include "SLStack.h"

#include "Matrix.h"

#include "octave-hist.h"
#include "user-prefs.h"
#include "tree-base.h"
#include "tree-expr.h"
#include "tree-cmd.h"
#include "tree-const.h"
#include "tree-misc.h"
#include "variables.h"
#include "tree-plot.h"
#include "octave.h"
#include "symtab.h"
#include "parse.h"
#include "token.h"
#include "error.h"
#include "pager.h"
#include "input.h"
#include "utils.h"
#include "lex.h"

// Nonzero means we're in the middle of defining a function.
int defining_func = 0;

// Nonzero means we're in the middle of defining a loop.
int looping = 0;

// Nonzero means we're in the middle of defining a conditional expression.
int iffing = 0;

// Nonzero means we need to do some extra lookahead to avoid being
// screwed by bogus function syntax.
int maybe_screwed = 0;

// Nonzero means we need to do some extra lookahead to avoid being
// screwed by bogus function syntax.
int maybe_screwed_again = 0;

// Temporary symbol table pointer used to cope with bogus function syntax.
symbol_table *tmp_local_sym_tab = 0;

// Stack to hold list of literal matrices.
SLStack <tree_matrix *> ml;

// A nonzero element corresponding to an element of ml means we just
// started reading a new matrix.  This should probably be part of a
// new struct for matrix lists... 
SLStack <int> mlnm;

// The current input line number.
int input_line_number = 0;

// The column of the current token.
int current_input_column = 1;

// Buffer for help text snagged from function files.
char *help_buf = 0;

// Nonzero means we're working on a plot command.
int plotting = 0;

// Nonzero means we've seen something that means we must be past the
// range part of a plot command.
int past_plot_range = 0;

// Nonzero means we're looking at the range part of a plot command.
int in_plot_range = 0;

// Nonzero means we're looking at the using part of a plot command.
int in_plot_using = 0;

// Nonzero means we're looking at the style part of a plot command.
int in_plot_style = 0;

// Nonzero means we're looking at an indirect reference to a structure
// element.
int looking_at_indirect_ref = 0;

// Forward declarations for some functions defined at the bottom of
// the file.

// Generic error messages.
static void yyerror (char *s);

// Error mesages for mismatched end tokens.
static void end_error (char *type, token::end_tok_type ettype, int l, int c);

// Check to see that end tokens are properly matched.
static int check_end (token *tok, token::end_tok_type expected);

// Try to figure out early if an expression should become an
// assignment to the builtin variable ans.
static tree_expression *maybe_convert_to_ans_assign (tree_expression *expr);

// Maybe print a warning if an assignment expression is used as the
// test in a logical expression.
static void maybe_warn_assign_as_truth_value (tree_expression *expr);

// Build a binary expression.
static tree_expression *make_binary_op
	 (int op, tree_expression *op1,	token *tok_val, tree_expression *op2);

// Build a prefix expression.
static tree_expression *make_prefix_op
	 (int op, tree_identifier *op1, token *tok_val);

// Build a postfix expression.
static tree_expression *make_postfix_op
	 (int op, tree_identifier *op1, token *tok_val);

// Build a binary expression.
static tree_expression *make_unary_op
	 (int op, tree_expression *op1, token *tok_val);

// Make an expression that handles assignment of multiple values.
static tree_expression *make_multi_val_ret
	 (tree_expression *rhs, int l = -1, int c = -1);

// Make an index expression.
static tree_index_expression *make_index_expression
	 (tree_indirect_ref *indir, tree_argument_list *args);

#define ABORT_PARSE \
  do \
    { \
      global_command = 0; \
      yyerrok; \
      if (interactive) \
	YYACCEPT; \
      else \
	YYABORT; \
    } \
  while (0)


#line 176 "parse.y"
typedef union
{
// The type of the basic tokens returned by the lexer.
  token *tok_val;

// Types for the nonterminals we generate.
  tree *tree_type;
  tree_expression *tree_expression_type;
  tree_constant *tree_constant_type;
  tree_matrix *tree_matrix_type;
  tree_identifier *tree_identifier_type;
  tree_indirect_ref *tree_indirect_ref_type;
  tree_function *tree_function_type;
  tree_index_expression *tree_index_expression_type;
  tree_colon_expression *tree_colon_expression_type;
  tree_argument_list *tree_argument_list_type;
  tree_parameter_list *tree_parameter_list_type;
  tree_command *tree_command_type;
  tree_if_command *tree_if_command_type;
  tree_if_clause *tree_if_clause_type;
  tree_if_command_list *tree_if_command_list_type;
  tree_global *tree_global_type;
  tree_global_init_list *tree_global_init_list_type;
  tree_global_command *tree_global_command_type;
  tree_statement *tree_statement_type;
  tree_statement_list *tree_statement_list_type;
  tree_plot_command *tree_plot_command_type;
  subplot *subplot_type;
  subplot_list *subplot_list_type;
  plot_limits *plot_limits_type;
  plot_range *plot_range_type;
  subplot_using *subplot_using_type;
  subplot_style *subplot_style_type;
} YYSTYPE;

#ifndef YYLTYPE
typedef
  struct yyltype
    {
      int timestamp;
      int first_line;
      int first_column;
      int last_line;
      int last_column;
      char *text;
   }
  yyltype;

#define YYLTYPE yyltype
#endif

#include <stdio.h>

#ifndef __cplusplus
#ifndef __STDC__
#define const
#endif
#endif



#define	YYFINAL		328
#define	YYFLAG		-32768
#define	YYNTBASE	72

#define YYTRANSLATE(x) ((unsigned)(x) <= 312 ? yytranslate[x] : 139)

static const char yytranslate[] = {     0,
     2,     2,     2,     2,     2,     2,     2,     2,     2,    65,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,    68,
    69,     7,     6,    64,     5,    71,     8,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     4,    63,     2,
     3,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
    67,     2,    70,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
     2,     2,     2,     2,     2,     1,     2,     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,    66
};

#if YYDEBUG != 0
static const short yyprhs[] = {     0,
     0,     2,     4,     7,     9,    11,    13,    16,    19,    21,
    23,    25,    27,    29,    32,    35,    37,    40,    43,    47,
    51,    53,    56,    59,    61,    64,    67,    69,    71,    74,
    76,    79,    80,    82,    84,    87,    90,    92,    96,   100,
   102,   104,   107,   110,   114,   116,   119,   123,   129,   134,
   139,   143,   146,   147,   149,   153,   155,   158,   160,   162,
   164,   167,   170,   173,   176,   179,   182,   186,   190,   194,
   198,   202,   206,   208,   211,   214,   218,   221,   224,   228,
   234,   235,   237,   240,   242,   246,   248,   252,   253,   255,
   257,   259,   261,   263,   271,   277,   285,   287,   289,   291,
   295,   297,   300,   304,   307,   313,   317,   318,   320,   322,
   324,   326,   329,   332,   335,   336,   340,   344,   351,   353,
   355,   358,   361,   364,   367,   371,   375,   379,   383,   387,
   391,   395,   399,   403,   407,   411,   415,   419,   423,   427,
   431,   435,   439,   443,   447,   449,   451,   453,   457,   459,
   461,   463,   466,   470,   472,   475,   478,   481,   484,   487,
   491,   495,   498,   500,   503,   504,   505,   506,   507,   512,
   517,   523,   528,   532,   535,   539,   542,   547,   550,   553,
   557,   562,   567,   571,   573,   575,   577,   579,   580,   585,
   587,   591,   596,   599,   602,   606,   609,   614,   617,   621,
   624,   628,   630,   632,   634,   636,   640,   644,   648,   653,
   655,   658,   662,   664,   667
};

static const short yyrhs[] = {    73,
     0,    55,     0,    75,    74,     0,    74,     0,    65,     0,
    75,     0,    75,    65,     0,    75,    55,     0,    50,     0,
     1,     0,    77,     0,    78,     0,    76,     0,    76,    77,
     0,    76,    78,     0,    84,     0,    77,    84,     0,    78,
    84,     0,    76,    77,    84,     0,    76,    78,    84,     0,
    63,     0,    77,    64,     0,    77,    63,     0,    64,     0,
    78,    63,     0,    78,    64,     0,    64,     0,    65,     0,
    79,   108,     0,    63,     0,    80,   108,     0,     0,    82,
     0,    83,     0,    83,    79,     0,    83,    80,     0,    84,
     0,    83,    79,    84,     0,    83,    80,    84,     0,   101,
     0,    96,     0,    35,    62,     0,    35,    88,     0,    35,
    86,    88,     0,    87,     0,    87,    87,     0,    87,    87,
    87,     0,    60,   110,    59,   110,    61,     0,    60,    59,
   110,    61,     0,    60,   110,    59,    61,     0,    60,    59,
    61,     0,    60,    61,     0,     0,    89,     0,    88,    64,
    89,     0,   110,     0,   110,    90,     0,    91,     0,    93,
     0,    94,     0,    91,    93,     0,    93,    91,     0,    91,
    94,     0,    94,    91,     0,    93,    94,     0,    94,    93,
     0,    91,    93,    94,     0,    91,    94,    93,     0,    93,
    91,    94,     0,    93,    94,    91,     0,    94,    91,    93,
     0,    94,    93,    91,     0,    92,     0,    92,   110,     0,
    56,   110,     0,    92,    59,   110,     0,    57,   110,     0,
    58,    37,     0,    58,    37,   110,     0,    58,    37,   110,
    95,   110,     0,     0,   110,     0,    48,    98,     0,    99,
     0,    98,   100,    99,     0,   134,     0,   134,     3,   110,
     0,     0,    64,     0,    85,     0,   120,     0,    97,     0,
   102,     0,    46,   107,    81,    47,   107,    81,    34,     0,
    39,   110,   107,    81,    34,     0,    38,   131,     3,   110,
   107,    81,    34,     0,    43,     0,    44,     0,    45,     0,
    40,   103,    34,     0,   104,     0,   104,   106,     0,   110,
   107,    81,     0,   104,   105,     0,    41,   107,   110,   107,
    81,     0,    42,   107,    81,     0,     0,   108,     0,    64,
     0,    63,     0,    65,     0,   108,    64,     0,   108,    63,
     0,   108,    65,     0,     0,   131,     3,   110,     0,    30,
     3,   110,     0,    67,   109,   138,    52,     3,   110,     0,
   111,     0,   112,     0,   134,    26,     0,   134,    27,     0,
   111,    24,     0,   111,    25,     0,   111,    28,   111,     0,
   111,    29,   111,     0,   111,     6,   111,     0,   111,     5,
   111,     0,   111,     7,   111,     0,   111,     8,   111,     0,
   111,    21,   111,     0,   111,    22,   111,     0,   111,    20,
   111,     0,   111,    23,   111,     0,   111,    14,   111,     0,
   111,    15,   111,     0,   111,    16,   111,     0,   111,    18,
   111,     0,   111,    19,   111,     0,   111,    17,   111,     0,
   111,     9,   111,     0,   111,    10,   111,     0,   111,    11,
   111,     0,   111,    12,   111,     0,    30,     0,    31,     0,
    36,     0,    68,   110,    69,     0,   114,     0,   131,     0,
   136,     0,    67,    70,     0,    67,    63,    70,     0,   113,
     0,    26,   134,     0,    27,   134,     0,    13,   111,     0,
     6,   111,     0,     5,   111,     0,   111,     4,   111,     0,
   113,     4,   111,     0,   134,   115,     0,    36,     0,   115,
    36,     0,     0,     0,     0,     0,    51,   116,   119,   121,
     0,    51,   116,   119,   125,     0,    33,   118,   116,     3,
   125,     0,   123,   116,     3,   125,     0,    67,   118,   117,
     0,   122,    70,     0,   122,    53,    70,     0,   124,    70,
     0,   124,    64,    53,    70,     0,   122,   134,     0,   122,
     1,     0,   124,    64,   134,     0,   134,   118,   117,   126,
     0,   132,   107,    81,   127,     0,   107,    81,   127,     0,
    34,     0,    55,     0,   129,     0,   134,     0,     0,   129,
    71,   130,    49,     0,   128,     0,   128,    68,    69,     0,
   128,    68,   135,    69,     0,   128,    67,     0,    68,    69,
     0,    68,    53,    69,     0,   133,    69,     0,   133,    64,
    53,    69,     0,    68,   134,     0,   133,    64,   134,     0,
    68,     1,     0,   133,    64,     1,     0,    32,     0,     4,
     0,   110,     0,    54,     0,   135,    64,     4,     0,   135,
    64,   110,     0,   135,    64,    54,     0,    67,   109,   137,
    70,     0,   138,     0,   137,    63,     0,   137,    63,   138,
     0,   110,     0,   138,    64,     0,   138,    64,   110,     0
};

#endif

#if YYDEBUG != 0
static const short yyrline[] = { 0,
   290,   296,   302,   304,   308,   310,   312,   314,   318,   319,
   322,   324,   326,   328,   333,   337,   339,   341,   343,   349,
   353,   354,   355,   358,   359,   360,   363,   364,   365,   368,
   369,   372,   374,   378,   380,   382,   389,   394,   396,   404,
   406,   408,   416,   433,   452,   454,   456,   460,   462,   464,
   466,   468,   472,   474,   476,   480,   482,   489,   491,   493,
   495,   497,   499,   501,   503,   505,   507,   509,   511,   513,
   515,   517,   521,   526,   533,   538,   542,   546,   548,   550,
   554,   557,   561,   568,   570,   573,   575,   584,   585,   593,
   595,   597,   599,   605,   613,   622,   630,   640,   651,   662,
   670,   672,   676,   682,   686,   693,   697,   698,   701,   702,
   703,   704,   705,   706,   709,   713,   716,   722,   729,   733,
   735,   737,   739,   741,   743,   745,   747,   749,   751,   753,
   755,   757,   759,   761,   763,   765,   767,   769,   771,   773,
   775,   777,   779,   781,   785,   791,   798,   800,   805,   807,
   809,   811,   816,   821,   823,   825,   827,   829,   831,   835,
   838,   846,   853,   858,   867,   871,   875,   879,   883,   889,
   897,   905,   912,   915,   917,   923,   925,   932,   934,   939,
   943,   997,  1002,  1006,  1014,  1021,  1027,  1032,  1033,  1036,
  1038,  1040,  1042,  1051,  1056,  1063,  1068,  1076,  1078,  1080,
  1085,  1092,  1099,  1106,  1108,  1115,  1122,  1124,  1133,  1142,
  1143,  1144,  1147,  1164,  1165
};

static const char * const yytname[] = {   "$","error","$illegal.","'='","':'",
"'-'","'+'","'*'","'/'","EXPR_AND_AND","EXPR_OR_OR","EXPR_AND","EXPR_OR","EXPR_NOT",
"EXPR_LT","EXPR_LE","EXPR_EQ","EXPR_NE","EXPR_GE","EXPR_GT","LEFTDIV","EMUL",
"EDIV","ELEFTDIV","QUOTE","TRANSPOSE","PLUS_PLUS","MINUS_MINUS","POW","EPOW",
"NUM","IMAG_NUM","NAME","SCREW","END","PLOT","TEXT","STYLE","FOR","WHILE","IF",
"ELSEIF","ELSE","BREAK","CONTINUE","FUNC_RET","UNWIND","CLEANUP","GLOBAL","TEXT_ID",
"LEXICAL_ERROR","FCN","SCREW_TWO","ELLIPSIS","ALL_VA_ARGS","END_OF_INPUT","USING",
"TITLE","WITH","COLON","OPEN_BRACE","CLOSE_BRACE","CLEAR","';'","','","'\\n'",
"UNARY","'['","'('","')'","']'","'.'","input","input1","parse_error","simple_list",
"simple_list1","semi_comma","comma_semi","comma_nl_sep","semi_sep","opt_list",
"list","list1","statement","plot_command","ranges","ranges1","plot_command1",
"plot_command2","plot_options","using","using1","title","style","bogus_syntax",
"ans_expression","global_decl","global_decl1","global_decl2","optcomma","command",
"if_command","if_cmd_list","if_cmd_list1","elseif_clause","else_clause","optsep",
"sep","screwed_again","expression","simple_expr","simple_expr1","colon_expr",
"word_list_cmd","word_list","g_symtab","local_symtab","safe","are_we_screwed",
"func_def","func_def1","return_list_x","return_list","return_list1","func_def2",
"func_def3","fcn_end_or_eof","indirect_ref","indirect_ref1","@1","variable",
"param_list","param_list1","identifier","arg_list","matrix","rows","matrix_row",
""
};
#endif

static const short yyr1[] = {     0,
    72,    72,    72,    72,    73,    73,    73,    73,    74,    74,
    75,    75,    75,    75,    75,    76,    76,    76,    76,    76,
    77,    77,    77,    78,    78,    78,    79,    79,    79,    80,
    80,    81,    81,    82,    82,    82,    83,    83,    83,    84,
    84,    84,    85,    85,    86,    86,    86,    87,    87,    87,
    87,    87,    88,    88,    88,    89,    89,    90,    90,    90,
    90,    90,    90,    90,    90,    90,    90,    90,    90,    90,
    90,    90,    91,    91,    92,    92,    93,    94,    94,    94,
    95,    96,    97,    98,    98,    99,    99,   100,   100,   101,
   101,   101,   101,   101,   101,   101,   101,   101,   101,   102,
   103,   103,   104,   104,   105,   106,   107,   107,   108,   108,
   108,   108,   108,   108,   109,   110,   110,   110,   110,   111,
   111,   111,   111,   111,   111,   111,   111,   111,   111,   111,
   111,   111,   111,   111,   111,   111,   111,   111,   111,   111,
   111,   111,   111,   111,   112,   112,   112,   112,   112,   112,
   112,   112,   112,   112,   112,   112,   112,   112,   112,   113,
   113,   114,   115,   115,   116,   117,   118,   119,   120,   120,
   121,   121,   122,   123,   123,   123,   123,   124,   124,   124,
   125,   126,   126,   127,   127,   128,   129,   130,   129,   131,
   131,   131,   131,   132,   132,   132,   132,   133,   133,   133,
   133,   134,   135,   135,   135,   135,   135,   135,   136,   137,
   137,   137,   138,   138,   138
};

static const short yyr2[] = {     0,
     1,     1,     2,     1,     1,     1,     2,     2,     1,     1,
     1,     1,     1,     2,     2,     1,     2,     2,     3,     3,
     1,     2,     2,     1,     2,     2,     1,     1,     2,     1,
     2,     0,     1,     1,     2,     2,     1,     3,     3,     1,
     1,     2,     2,     3,     1,     2,     3,     5,     4,     4,
     3,     2,     0,     1,     3,     1,     2,     1,     1,     1,
     2,     2,     2,     2,     2,     2,     3,     3,     3,     3,
     3,     3,     1,     2,     2,     3,     2,     2,     3,     5,
     0,     1,     2,     1,     3,     1,     3,     0,     1,     1,
     1,     1,     1,     7,     5,     7,     1,     1,     1,     3,
     1,     2,     3,     2,     5,     3,     0,     1,     1,     1,
     1,     2,     2,     2,     0,     3,     3,     6,     1,     1,
     2,     2,     2,     2,     3,     3,     3,     3,     3,     3,
     3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
     3,     3,     3,     3,     1,     1,     1,     3,     1,     1,
     1,     2,     3,     1,     2,     2,     2,     2,     2,     3,
     3,     2,     1,     2,     0,     0,     0,     0,     4,     4,
     5,     4,     3,     2,     3,     2,     4,     2,     2,     3,
     4,     4,     3,     1,     1,     1,     1,     0,     4,     1,
     3,     4,     2,     2,     3,     2,     4,     2,     3,     2,
     3,     1,     1,     1,     1,     3,     3,     3,     4,     1,
     2,     3,     1,     2,     3
};

static const short yydefact[] = {     0,
    10,     0,     0,     0,     0,     0,   145,   146,   202,    53,
   147,     0,     0,     0,    97,    98,    99,   107,     0,     9,
   165,     2,    21,    24,     5,   115,     0,     1,     4,     0,
    13,    11,    12,    16,    90,    41,    92,    40,    93,    82,
   119,   120,   154,   149,    91,   190,   186,   150,   187,   151,
   145,   115,   159,   150,   158,   157,   155,   156,     0,     0,
    42,    53,    45,    43,    54,    56,     0,   187,   107,     0,
   101,   107,   110,   109,   111,    32,   108,    83,    84,    86,
   168,     0,   152,     0,     0,     8,     7,     3,    14,    15,
    23,    22,    17,    25,    26,    18,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,   123,   124,     0,     0,     0,
   193,     0,   188,     0,   121,   122,   163,   162,     0,   117,
     0,    52,     0,    44,    46,     0,     0,     0,     0,    57,
    58,    73,    59,    60,     0,    32,   100,   107,   107,   104,
   102,    32,     0,    33,    34,    37,   113,   112,   114,    89,
     0,     0,     0,   153,   213,     0,   210,   148,    19,    20,
   160,   128,   127,   129,   130,   141,   142,   143,   144,   135,
   136,   137,   140,   138,   139,   133,   131,   132,   134,   125,
   126,   161,   203,   205,   191,   204,     0,     0,   116,   164,
   210,    51,     0,     0,    47,    55,    75,    77,    78,    61,
    63,     0,    74,    62,    65,    64,    66,   107,     0,     0,
    32,   103,   107,    30,    27,    28,    35,    36,    85,    87,
   167,   167,   169,     0,   165,     0,   170,   167,   211,   209,
     0,   214,     0,   192,   189,    49,    50,     0,    79,    67,
    68,    76,    69,    70,    71,    72,    32,    95,   107,   106,
    32,    38,    29,    39,    31,   165,   166,   179,     0,   174,
   178,     0,     0,   176,   166,   212,     0,   215,   206,   208,
   207,    48,     0,     0,    32,     0,     0,   173,   175,     0,
     0,   180,   107,   118,    80,    96,   105,    94,     0,   172,
   177,     0,    32,   181,   107,     0,   171,   200,     0,   194,
   198,     0,    32,     0,   196,   195,   184,   185,   183,     0,
   201,     0,   199,   182,   197,     0,     0,     0
};

static const short yydefgoto[] = {   326,
    28,    29,    30,    31,    32,    33,   227,   228,   153,   154,
   155,   156,    35,    62,    63,    64,    65,   140,   141,   142,
   143,   144,   283,    36,    37,    78,    79,   161,    38,    39,
    70,    71,   150,   151,    76,    77,    84,    40,    41,    42,
    43,    44,   128,    81,   288,   266,   163,    45,   233,   234,
   235,   236,   237,   304,   319,    46,    47,   198,    48,   305,
   306,    49,   197,    50,   166,   167
};

static const short yypact[] = {   353,
-32768,   662,   662,   662,    13,    13,    56,-32768,-32768,    34,
-32768,    13,   690,   690,-32768,-32768,-32768,   -33,    13,-32768,
-32768,-32768,-32768,-32768,-32768,   -27,   690,-32768,-32768,    27,
    54,   479,   523,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
   766,-32768,    76,-32768,-32768,    74,     7,    97,    36,-32768,
-32768,   -27,   107,-32768,   107,   107,-32768,-32768,   690,   240,
-32768,   690,    50,    58,-32768,    68,   117,-32768,   -33,    93,
   109,   -33,-32768,-32768,-32768,   567,    75,    -7,-32768,   130,
-32768,    85,-32768,   690,   112,-32768,-32768,-32768,   479,   523,
-32768,-32768,-32768,-32768,-32768,-32768,   662,   662,   662,   662,
   662,   662,   662,   662,   662,   662,   662,   662,   662,   662,
   662,   662,   662,   662,   662,-32768,-32768,   662,   662,   662,
-32768,   159,-32768,   690,-32768,-32768,-32768,   143,   690,-32768,
   595,-32768,   121,    58,    50,   690,   690,   690,   145,-32768,
   102,   611,    15,   110,   690,   567,-32768,   -33,   -33,-32768,
-32768,   567,   136,-32768,   111,-32768,-32768,-32768,-32768,-32768,
    13,   690,     1,-32768,-32768,   -14,   -26,-32768,-32768,-32768,
   854,   124,   124,    80,    80,   792,   792,   818,   818,   844,
   844,   844,   844,   844,   844,    80,    80,    80,    80,   107,
   107,   854,-32768,-32768,-32768,-32768,    42,   135,-32768,-32768,
   123,-32768,   127,   623,-32768,-32768,-32768,-32768,   690,   134,
   137,   690,-32768,   134,   141,   137,   141,   -33,   165,   690,
   567,-32768,   -33,-32768,-32768,-32768,   435,   435,-32768,-32768,
-32768,-32768,-32768,    21,-32768,    11,-32768,-32768,   690,-32768,
   190,   690,   401,-32768,-32768,-32768,-32768,   139,   701,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,   567,-32768,   -33,-32768,
   567,-32768,    75,-32768,    75,-32768,-32768,-32768,   132,-32768,
-32768,   200,    -3,-32768,-32768,   123,   690,-32768,-32768,-32768,
-32768,-32768,   690,   171,   567,   172,   204,-32768,-32768,    13,
   138,-32768,   105,-32768,-32768,-32768,-32768,-32768,    13,-32768,
-32768,    14,   567,-32768,   -33,    43,-32768,-32768,   140,-32768,
-32768,     3,   567,    16,-32768,-32768,-32768,-32768,-32768,     3,
-32768,   142,-32768,-32768,-32768,   210,   214,-32768
};

static const short yypgoto[] = {-32768,
-32768,   188,-32768,-32768,   189,   191,-32768,-32768,  -142,-32768,
-32768,     9,-32768,-32768,   -42,   157,    87,-32768,  -131,-32768,
  -121,  -125,-32768,-32768,-32768,-32768,    60,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,   -61,   -50,   178,    -8,   237,-32768,
-32768,-32768,-32768,  -211,   -51,  -135,-32768,-32768,-32768,-32768,
-32768,-32768,  -255,-32768,   -87,-32768,-32768,-32768,   213,-32768,
-32768,    -5,-32768,-32768,-32768,  -126
};


#define	YYLAST		883


static const short yytable[] = {    57,
    58,    66,   201,   219,    69,    72,    68,   146,    34,   222,
   152,   214,   216,    80,   308,   211,   321,   215,    85,   210,
   135,   268,   217,   272,   -88,   241,    -6,     1,     9,    73,
    74,    75,     9,   231,   300,    82,   317,   242,     2,     3,
    93,    96,    83,   307,     9,     9,     4,     9,   239,   291,
   130,   133,     9,    66,   287,   240,   160,   318,    59,     5,
     6,   125,   126,     7,     8,     9,   309,   232,   322,    11,
   137,   127,   139,   269,   273,   165,    20,   123,   260,   120,
   274,    86,   310,   254,   250,   256,   220,   221,   253,   251,
   270,    87,   205,    60,   255,    61,   267,   169,   170,   124,
    26,    27,   275,   116,   117,   243,   314,   118,   119,    60,
   244,   315,   276,   196,   284,   199,    23,    24,   286,   145,
   165,   136,   203,   137,   138,   139,   147,    66,   207,   208,
   100,   101,   162,   213,   118,   119,   218,   157,   158,   159,
   121,   122,   297,   112,   113,   114,   115,   116,   117,   148,
   149,   118,   119,   230,   164,    80,   257,   238,   138,   139,
   312,   261,   193,     2,     3,   137,   138,    73,    74,    75,
   320,     4,   302,   224,   225,   226,   263,   265,   200,   204,
   168,   209,   223,   245,     5,     6,   242,   246,     7,     8,
     9,   139,   277,   138,    11,   248,   137,   285,   258,   282,
   249,   289,   290,   252,   296,   298,   299,   301,   316,   327,
   325,   259,   194,   328,    54,    54,    54,    88,   134,    89,
   229,    90,   206,   293,    67,    26,    27,   195,   271,   129,
   165,   303,   324,   278,   281,   262,   264,     0,    53,    55,
    56,     0,     0,   313,     2,     3,     0,     0,     0,     0,
     0,     0,     4,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     5,     6,   292,   294,     7,
     8,     9,     0,     0,   295,    11,     0,     0,     0,     0,
     0,     0,     0,     0,   238,     0,     0,     0,     0,     0,
     0,     0,     0,   238,     0,     0,   311,     0,   131,     0,
   132,     0,     0,     0,     0,     0,    26,    27,   323,    54,
    54,    54,    54,    54,    54,    54,    54,    54,    54,    54,
    54,    54,    54,    54,    54,    54,    54,    54,     0,     0,
    54,    54,    54,   171,   172,   173,   174,   175,   176,   177,
   178,   179,   180,   181,   182,   183,   184,   185,   186,   187,
   188,   189,     0,     1,   190,   191,   192,     2,     3,     0,
     0,     0,     0,     0,     0,     4,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     5,     6,
     0,     0,     7,     8,     9,     0,     0,    10,    11,     0,
    12,    13,    14,     0,     0,    15,    16,    17,    18,     0,
    19,     0,    20,    21,   279,     2,     3,    22,     0,     0,
     0,     0,     0,     4,     0,    23,    24,    25,     0,    26,
    27,     0,     0,     0,     0,     0,     5,     6,     0,     0,
     7,     8,     9,     0,     0,     0,    11,     0,     0,     2,
     3,     0,     0,     0,     0,     0,     0,     4,     0,     0,
     0,     0,     0,     0,   280,     0,     0,     0,     0,     0,
     5,     6,     0,     0,     7,     8,     9,    26,    27,    10,
    11,     0,    12,    13,    14,     0,     0,    15,    16,    17,
    18,     0,    19,     2,     3,    21,     0,     0,     0,     0,
     0,     4,     0,     0,     0,     0,     0,    73,    74,    75,
     0,    26,    27,     0,     5,     6,     0,     0,     7,     8,
     9,     0,     0,    10,    11,     0,    12,    13,    14,     0,
     0,    15,    16,    17,    18,     0,    19,     2,     3,    21,
     0,     0,     0,     0,     0,     4,     0,     0,     0,     0,
     0,    91,    92,     0,     0,    26,    27,     0,     5,     6,
     0,     0,     7,     8,     9,     0,     0,    10,    11,     0,
    12,    13,    14,     0,     0,    15,    16,    17,    18,     0,
    19,     2,     3,    21,     0,     0,     0,     0,     0,     4,
     0,     0,     0,     0,     0,    94,    95,     0,     0,    26,
    27,     0,     5,     6,     0,     0,     7,     8,     9,     2,
     3,    10,    11,     0,    12,    13,    14,     4,     0,    15,
    16,    17,    18,     0,    19,     2,     3,    21,     0,     0,
     5,     6,     0,     4,     7,     8,     9,     2,     3,     0,
    11,     0,     0,    26,    27,     4,     5,     6,     0,     0,
     7,     8,     9,     0,     0,     0,    11,     0,     5,     6,
     0,     0,     7,     8,     9,   202,     0,     0,    11,     0,
     0,    26,    27,     0,     0,     0,     2,     3,     0,   212,
     0,     0,     0,     0,     4,     0,     0,    26,    27,     0,
     0,     0,     0,   247,     0,     0,     0,     5,     6,    26,
    27,    51,     8,     9,     2,     3,     0,    11,     0,     0,
     0,     0,     4,     0,     0,   -81,   -81,     0,     0,     0,
     0,     0,     0,   -81,     0,     5,     6,     0,     0,     7,
     8,     9,     0,     0,     0,    11,   -81,   -81,    52,    27,
   -81,   -81,   -81,     0,     0,     0,   -81,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,    26,    27,     0,     0,
     0,     0,     0,     0,     0,     0,     0,   -81,   -81,    97,
    98,    99,   100,   101,   102,   103,   104,   105,     0,   106,
   107,   108,   109,   110,   111,   112,   113,   114,   115,   116,
   117,     0,     0,   118,   119,    97,    98,    99,   100,   101,
     0,     0,   104,   105,     0,   106,   107,   108,   109,   110,
   111,   112,   113,   114,   115,   116,   117,     0,     0,   118,
   119,    97,    98,    99,   100,   101,     0,     0,     0,     0,
     0,   106,   107,   108,   109,   110,   111,   112,   113,   114,
   115,   116,   117,     0,     0,   118,   119,    97,    98,    99,
   100,   101,     0,     0,     0,     0,     0,     0,    98,    99,
   100,   101,     0,   112,   113,   114,   115,   116,   117,     0,
     0,   118,   119,   112,   113,   114,   115,   116,   117,     0,
     0,   118,   119
};

static const short yycheck[] = {     5,
     6,    10,   129,   146,    13,    14,    12,    69,     0,   152,
    72,   143,   144,    19,     1,   141,     1,   143,    27,   141,
    63,     1,   144,   235,    32,    52,     0,     1,    32,    63,
    64,    65,    32,    33,   290,    63,    34,    64,     5,     6,
    32,    33,    70,   299,    32,    32,    13,    32,    63,    53,
    59,    60,    32,    62,   266,    70,    64,    55,     3,    26,
    27,    26,    27,    30,    31,    32,    53,    67,    53,    36,
    56,    36,    58,    53,    64,    84,    50,    71,   221,     4,
    70,    55,    69,   215,   210,   217,   148,   149,   214,   211,
    70,    65,   135,    60,   216,    62,   232,    89,    90,     3,
    67,    68,   238,    24,    25,    64,    64,    28,    29,    60,
    69,    69,   239,   122,   257,   124,    63,    64,   261,     3,
   129,    64,   131,    56,    57,    58,    34,   136,   137,   138,
     7,     8,     3,   142,    28,    29,   145,    63,    64,    65,
    67,    68,   285,    20,    21,    22,    23,    24,    25,    41,
    42,    28,    29,   162,    70,   161,   218,   163,    57,    58,
   303,   223,     4,     5,     6,    56,    57,    63,    64,    65,
   313,    13,    68,    63,    64,    65,   227,   228,    36,    59,
    69,    37,    47,    49,    26,    27,    64,    61,    30,    31,
    32,    58,     3,    57,    36,   204,    56,   259,    34,    61,
   209,    70,     3,   212,    34,    34,     3,    70,    69,     0,
    69,   220,    54,     0,     2,     3,     4,    30,    62,    31,
   161,    31,   136,   275,    12,    67,    68,    69,   234,    52,
   239,   293,   320,   242,   243,   227,   228,    -1,     2,     3,
     4,    -1,    -1,   305,     5,     6,    -1,    -1,    -1,    -1,
    -1,    -1,    13,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    26,    27,   273,   277,    30,
    31,    32,    -1,    -1,   283,    36,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,   290,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,   299,    -1,    -1,   302,    -1,    59,    -1,
    61,    -1,    -1,    -1,    -1,    -1,    67,    68,   314,    97,
    98,    99,   100,   101,   102,   103,   104,   105,   106,   107,
   108,   109,   110,   111,   112,   113,   114,   115,    -1,    -1,
   118,   119,   120,    97,    98,    99,   100,   101,   102,   103,
   104,   105,   106,   107,   108,   109,   110,   111,   112,   113,
   114,   115,    -1,     1,   118,   119,   120,     5,     6,    -1,
    -1,    -1,    -1,    -1,    -1,    13,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    26,    27,
    -1,    -1,    30,    31,    32,    -1,    -1,    35,    36,    -1,
    38,    39,    40,    -1,    -1,    43,    44,    45,    46,    -1,
    48,    -1,    50,    51,     4,     5,     6,    55,    -1,    -1,
    -1,    -1,    -1,    13,    -1,    63,    64,    65,    -1,    67,
    68,    -1,    -1,    -1,    -1,    -1,    26,    27,    -1,    -1,
    30,    31,    32,    -1,    -1,    -1,    36,    -1,    -1,     5,
     6,    -1,    -1,    -1,    -1,    -1,    -1,    13,    -1,    -1,
    -1,    -1,    -1,    -1,    54,    -1,    -1,    -1,    -1,    -1,
    26,    27,    -1,    -1,    30,    31,    32,    67,    68,    35,
    36,    -1,    38,    39,    40,    -1,    -1,    43,    44,    45,
    46,    -1,    48,     5,     6,    51,    -1,    -1,    -1,    -1,
    -1,    13,    -1,    -1,    -1,    -1,    -1,    63,    64,    65,
    -1,    67,    68,    -1,    26,    27,    -1,    -1,    30,    31,
    32,    -1,    -1,    35,    36,    -1,    38,    39,    40,    -1,
    -1,    43,    44,    45,    46,    -1,    48,     5,     6,    51,
    -1,    -1,    -1,    -1,    -1,    13,    -1,    -1,    -1,    -1,
    -1,    63,    64,    -1,    -1,    67,    68,    -1,    26,    27,
    -1,    -1,    30,    31,    32,    -1,    -1,    35,    36,    -1,
    38,    39,    40,    -1,    -1,    43,    44,    45,    46,    -1,
    48,     5,     6,    51,    -1,    -1,    -1,    -1,    -1,    13,
    -1,    -1,    -1,    -1,    -1,    63,    64,    -1,    -1,    67,
    68,    -1,    26,    27,    -1,    -1,    30,    31,    32,     5,
     6,    35,    36,    -1,    38,    39,    40,    13,    -1,    43,
    44,    45,    46,    -1,    48,     5,     6,    51,    -1,    -1,
    26,    27,    -1,    13,    30,    31,    32,     5,     6,    -1,
    36,    -1,    -1,    67,    68,    13,    26,    27,    -1,    -1,
    30,    31,    32,    -1,    -1,    -1,    36,    -1,    26,    27,
    -1,    -1,    30,    31,    32,    61,    -1,    -1,    36,    -1,
    -1,    67,    68,    -1,    -1,    -1,     5,     6,    -1,    59,
    -1,    -1,    -1,    -1,    13,    -1,    -1,    67,    68,    -1,
    -1,    -1,    -1,    61,    -1,    -1,    -1,    26,    27,    67,
    68,    30,    31,    32,     5,     6,    -1,    36,    -1,    -1,
    -1,    -1,    13,    -1,    -1,     5,     6,    -1,    -1,    -1,
    -1,    -1,    -1,    13,    -1,    26,    27,    -1,    -1,    30,
    31,    32,    -1,    -1,    -1,    36,    26,    27,    67,    68,
    30,    31,    32,    -1,    -1,    -1,    36,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    67,    68,    -1,    -1,
    -1,    -1,    -1,    -1,    -1,    -1,    -1,    67,    68,     4,
     5,     6,     7,     8,     9,    10,    11,    12,    -1,    14,
    15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
    25,    -1,    -1,    28,    29,     4,     5,     6,     7,     8,
    -1,    -1,    11,    12,    -1,    14,    15,    16,    17,    18,
    19,    20,    21,    22,    23,    24,    25,    -1,    -1,    28,
    29,     4,     5,     6,     7,     8,    -1,    -1,    -1,    -1,
    -1,    14,    15,    16,    17,    18,    19,    20,    21,    22,
    23,    24,    25,    -1,    -1,    28,    29,     4,     5,     6,
     7,     8,    -1,    -1,    -1,    -1,    -1,    -1,     5,     6,
     7,     8,    -1,    20,    21,    22,    23,    24,    25,    -1,
    -1,    28,    29,    20,    21,    22,    23,    24,    25,    -1,
    -1,    28,    29
};
/* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
#line 3 "/usr/local/gnu/lib/bison.simple"

/* Skeleton output parser for bison,
   Copyright (C) 1984, 1989, 1990 Bob Corbett and Richard Stallman

   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 1, 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., 675 Mass Ave, Cambridge, MA 02139, USA.  */


#ifndef alloca
#ifdef __GNUC__
#define alloca __builtin_alloca
#else /* not GNU C.  */
#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)
#include <alloca.h>
#else /* not sparc */
#if defined (MSDOS) && !defined (__TURBOC__)
#include <malloc.h>
#else /* not MSDOS, or __TURBOC__ */
#if defined(_AIX)
#include <malloc.h>
 #pragma alloca
#else /* not MSDOS, __TURBOC__, or _AIX */
#ifdef __hpux
#ifdef __cplusplus
extern "C" {
void *alloca (unsigned int);
};
#else /* not __cplusplus */
void *alloca ();
#endif /* not __cplusplus */
#endif /* __hpux */
#endif /* not _AIX */
#endif /* not MSDOS, or __TURBOC__ */
#endif /* not sparc.  */
#endif /* not GNU C.  */
#endif /* alloca not defined.  */

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

/* Note: there must be only one dollar sign in this file.
   It is replaced by the list of actions, each action
   as one case of the switch.  */

#define yyerrok		(yyerrstatus = 0)
#define yyclearin	(yychar = YYEMPTY)
#define YYEMPTY		-2
#define YYEOF		0
#define YYACCEPT	return(0)
#define YYABORT 	return(1)
#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

#ifndef YYPURE
#define YYLEX		yylex()
#endif

#ifdef YYPURE
#ifdef YYLSP_NEEDED
#define YYLEX		yylex(&yylval, &yylloc)
#else
#define YYLEX		yylex(&yylval)
#endif
#endif

/* If nonreentrant, generate the variables here */

#ifndef YYPURE

int	yychar;			/*  the lookahead symbol		*/
YYSTYPE	yylval;			/*  the semantic value of the		*/
				/*  lookahead symbol			*/

#ifdef YYLSP_NEEDED
YYLTYPE yylloc;			/*  location data for the lookahead	*/
				/*  symbol				*/
#endif

int yynerrs;			/*  number of parse errors so far       */
#endif  /* not YYPURE */

#if YYDEBUG != 0
int yydebug;			/*  nonzero means print parse trace	*/
/* Since this is uninitialized, it does not stop multiple parsers
   from coexisting.  */
#endif

/*  YYINITDEPTH indicates the initial size of the parser's stacks	*/

#ifndef	YYINITDEPTH
#define YYINITDEPTH 200
#endif

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

#if YYMAXDEPTH == 0
#undef YYMAXDEPTH
#endif

#ifndef YYMAXDEPTH
#define YYMAXDEPTH 10000
#endif

/* Prevent warning if -Wstrict-prototypes.  */
#ifdef __GNUC__
int yyparse (void);
#endif

#if __GNUC__ > 1		/* GNU C and GNU C++ define this.  */
#define __yy_bcopy(FROM,TO,COUNT)	__builtin_memcpy(TO,FROM,COUNT)
#else				/* not GNU C or C++ */
#ifndef __cplusplus

/* This is the most reliable way to avoid incompatibilities
   in available built-in functions on various systems.  */
static void
__yy_bcopy (from, to, count)
     char *from;
     char *to;
     int count;
{
  register char *f = from;
  register char *t = to;
  register int i = count;

  while (i-- > 0)
    *t++ = *f++;
}

#else /* __cplusplus */

/* This is the most reliable way to avoid incompatibilities
   in available built-in functions on various systems.  */
static void
__yy_bcopy (char *from, char *to, int count)
{
  register char *f = from;
  register char *t = to;
  register int i = count;

  while (i-- > 0)
    *t++ = *f++;
}

#endif
#endif

#line 184 "/usr/local/gnu/lib/bison.simple"
int
yyparse()
{
  register int yystate;
  register int yyn;
  register short *yyssp;
  register YYSTYPE *yyvsp;
  int yyerrstatus;	/*  number of tokens to shift before error messages enabled */
  int yychar1 = 0;		/*  lookahead token as an internal (translated) token number */

  short	yyssa[YYINITDEPTH];	/*  the state stack			*/
  YYSTYPE yyvsa[YYINITDEPTH];	/*  the semantic value stack		*/

  short *yyss = yyssa;		/*  refer to the stacks thru separate pointers */
  YYSTYPE *yyvs = yyvsa;	/*  to allow yyoverflow to reallocate them elsewhere */

#ifdef YYLSP_NEEDED
  YYLTYPE yylsa[YYINITDEPTH];	/*  the location stack			*/
  YYLTYPE *yyls = yylsa;
  YYLTYPE *yylsp;

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

  int yystacksize = YYINITDEPTH;

#ifdef YYPURE
  int yychar;
  YYSTYPE yylval;
  int yynerrs;
#ifdef YYLSP_NEEDED
  YYLTYPE yylloc;
#endif
#endif

  YYSTYPE yyval;		/*  the variable used to return		*/
				/*  semantic values from the action	*/
				/*  routines				*/

  int yylen;

#if YYDEBUG != 0
  if (yydebug)
    fprintf(stderr, "Starting parse\n");
#endif

  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 - 1;
  yyvsp = yyvs;
#ifdef YYLSP_NEEDED
  yylsp = yyls;
#endif

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

  *++yyssp = yystate;

  if (yyssp >= yyss + yystacksize - 1)
    {
      /* 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;
#ifdef YYLSP_NEEDED
      YYLTYPE *yyls1 = yyls;
#endif

      /* Get the current used size of the three stacks, in elements.  */
      int size = yyssp - yyss + 1;

#ifdef yyoverflow
      /* Each stack pointer address is followed by the size of
	 the data in use in that stack, in bytes.  */
#ifdef YYLSP_NEEDED
      /* 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, size * sizeof (*yyssp),
		 &yyvs1, size * sizeof (*yyvsp),
		 &yyls1, size * sizeof (*yylsp),
		 &yystacksize);
#else
      yyoverflow("parser stack overflow",
		 &yyss1, size * sizeof (*yyssp),
		 &yyvs1, size * sizeof (*yyvsp),
		 &yystacksize);
#endif

      yyss = yyss1; yyvs = yyvs1;
#ifdef YYLSP_NEEDED
      yyls = yyls1;
#endif
#else /* no yyoverflow */
      /* Extend the stack our own way.  */
      if (yystacksize >= YYMAXDEPTH)
	{
	  yyerror("parser stack overflow");
	  return 2;
	}
      yystacksize *= 2;
      if (yystacksize > YYMAXDEPTH)
	yystacksize = YYMAXDEPTH;
      yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
      __yy_bcopy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp));
      yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
      __yy_bcopy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp));
#ifdef YYLSP_NEEDED
      yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
      __yy_bcopy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp));
#endif
#endif /* no yyoverflow */

      yyssp = yyss + size - 1;
      yyvsp = yyvs + size - 1;
#ifdef YYLSP_NEEDED
      yylsp = yyls + size - 1;
#endif

#if YYDEBUG != 0
      if (yydebug)
	fprintf(stderr, "Stack size increased to %d\n", yystacksize);
#endif

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

#if YYDEBUG != 0
  if (yydebug)
    fprintf(stderr, "Entering state %d\n", yystate);
#endif

  goto 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)
    {
#if YYDEBUG != 0
      if (yydebug)
	fprintf(stderr, "Reading a token: ");
#endif
      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 */

#if YYDEBUG != 0
      if (yydebug)
	fprintf(stderr, "Now at end of input.\n");
#endif
    }
  else
    {
      yychar1 = YYTRANSLATE(yychar);

#if YYDEBUG != 0
      if (yydebug)
	{
	  fprintf (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
	  fprintf (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.  */

#if YYDEBUG != 0
  if (yydebug)
    fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
#endif

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

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

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

  yystate = yyn;
  goto yynewstate;

/* Do the default action for the current state.  */
yydefault:

  yyn = yydefact[yystate];
  if (yyn == 0)
    goto yyerrlab;

/* Do a reduction.  yyn is the number of a rule to reduce with.  */
yyreduce:
  yylen = yyr2[yyn];
  if (yylen > 0)
    yyval = yyvsp[1-yylen]; /* implement default value of the action */

#if YYDEBUG != 0
  if (yydebug)
    {
      int i;

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

      /* Print the symbols being reduced, and their result.  */
      for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
	fprintf (stderr, "%s ", yytname[yyrhs[i]]);
      fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
    }
#endif


  switch (yyn) {

case 1:
#line 291 "parse.y"
{
		    global_command = yyvsp[0].tree_statement_list_type;
		    promptflag = 1;
		    YYACCEPT;
		  ;
    break;}
case 2:
#line 297 "parse.y"
{
		    global_command = 0;
		    promptflag = 1;
		    YYABORT;
		  ;
    break;}
case 3:
#line 303 "parse.y"
{ ABORT_PARSE; ;
    break;}
case 4:
#line 305 "parse.y"
{ ABORT_PARSE; ;
    break;}
case 5:
#line 309 "parse.y"
{ yyval.tree_statement_list_type = 0; ;
    break;}
case 6:
#line 311 "parse.y"
{ yyval.tree_statement_list_type = yyvsp[0].tree_statement_list_type; ;
    break;}
case 7:
#line 313 "parse.y"
{ yyval.tree_statement_list_type = yyvsp[-1].tree_statement_list_type; ;
    break;}
case 8:
#line 315 "parse.y"
{ yyval.tree_statement_list_type = yyvsp[-1].tree_statement_list_type; ;
    break;}
case 11:
#line 323 "parse.y"
{ yyval.tree_statement_list_type = 0; ;
    break;}
case 12:
#line 325 "parse.y"
{ yyval.tree_statement_list_type = 0; ;
    break;}
case 13:
#line 327 "parse.y"
{ yyval.tree_statement_list_type = yyvsp[0].tree_statement_list_type; ;
    break;}
case 14:
#line 329 "parse.y"
{
		    tree_statement *tmp = yyvsp[-1].tree_statement_list_type->rear ();
		    tmp->set_print_flag (0);
		  ;
    break;}
case 15:
#line 334 "parse.y"
{ yyval.tree_statement_list_type = yyvsp[-1].tree_statement_list_type; ;
    break;}
case 16:
#line 338 "parse.y"
{ yyval.tree_statement_list_type = new tree_statement_list (yyvsp[0].tree_statement_type); ;
    break;}
case 17:
#line 340 "parse.y"
{ yyval.tree_statement_list_type = new tree_statement_list (yyvsp[0].tree_statement_type); ;
    break;}
case 18:
#line 342 "parse.y"
{ yyval.tree_statement_list_type = new tree_statement_list (yyvsp[0].tree_statement_type); ;
    break;}
case 19:
#line 344 "parse.y"
{
		    tree_statement *tmp = yyvsp[-2].tree_statement_list_type->rear ();
		    tmp->set_print_flag (0);
		    yyvsp[-2].tree_statement_list_type->append (yyvsp[0].tree_statement_type);
		  ;
    break;}
case 20:
#line 350 "parse.y"
{ yyvsp[-2].tree_statement_list_type->append (yyvsp[0].tree_statement_type); ;
    break;}
case 32:
#line 373 "parse.y"
{ yyval.tree_statement_list_type = new tree_statement_list (); ;
    break;}
case 33:
#line 375 "parse.y"
{ yyval.tree_statement_list_type = yyvsp[0].tree_statement_list_type; ;
    break;}
case 34:
#line 379 "parse.y"
{ yyval.tree_statement_list_type = yyvsp[0].tree_statement_list_type; ;
    break;}
case 35:
#line 381 "parse.y"
{ yyval.tree_statement_list_type = yyvsp[-1].tree_statement_list_type; ;
    break;}
case 36:
#line 383 "parse.y"
{
		    tree_statement *tmp = yyvsp[-1].tree_statement_list_type->rear ();
		    tmp->set_print_flag (0);
		  ;
    break;}
case 37:
#line 390 "parse.y"
{
		    beginning_of_function = 0;
		    yyval.tree_statement_list_type = new tree_statement_list (yyvsp[0].tree_statement_type);
		  ;
    break;}
case 38:
#line 395 "parse.y"
{ yyvsp[-2].tree_statement_list_type->append (yyvsp[0].tree_statement_type); ;
    break;}
case 39:
#line 397 "parse.y"
{
		    tree_statement *tmp = yyvsp[-2].tree_statement_list_type->rear ();
		    tmp->set_print_flag (0);
		    yyvsp[-2].tree_statement_list_type->append (yyvsp[0].tree_statement_type);
		  ;
    break;}
case 40:
#line 405 "parse.y"
{ yyval.tree_statement_type = new tree_statement (yyvsp[0].tree_command_type); ;
    break;}
case 41:
#line 407 "parse.y"
{ yyval.tree_statement_type = new tree_statement (yyvsp[0].tree_expression_type); ;
    break;}
case 42:
#line 409 "parse.y"
{
		    symbol_record *sr = lookup_by_name ("clearplot", 0);
		    tree_identifier *id = new tree_identifier (sr);
		    yyval.tree_statement_type = new tree_statement (id);
		  ;
    break;}
case 43:
#line 417 "parse.y"
{
		    if (! yyvsp[0].subplot_list_type && yyvsp[-1].tok_val->pttype () != token::replot)
		      {
			yyerror ("must have something to plot");
			ABORT_PARSE;
		      }
		    else
		      {
			yyval.tree_plot_command_type = new tree_plot_command (yyvsp[0].subplot_list_type, yyvsp[-1].tok_val->pttype ());
			plotting = 0;
			past_plot_range = 0;
			in_plot_range = 0;
			in_plot_using = 0;
			in_plot_style = 0;
		      }
		  ;
    break;}
case 44:
#line 434 "parse.y"
{
		    if (yyvsp[-2].tok_val->pttype () == token::replot)
		      {
			yyerror ("cannot specify new ranges with replot");
			ABORT_PARSE;
		      }
		    else
		      {
			yyval.tree_plot_command_type = new tree_plot_command (yyvsp[0].subplot_list_type, yyvsp[-1].plot_limits_type, yyvsp[-2].tok_val->pttype ());
			plotting = 0;
			past_plot_range = 0;
			in_plot_range = 0;
			in_plot_using = 0;
			in_plot_style = 0;
		      }
		  ;
    break;}
case 45:
#line 453 "parse.y"
{ yyval.plot_limits_type = new plot_limits (yyvsp[0].plot_range_type); ;
    break;}
case 46:
#line 455 "parse.y"
{ yyval.plot_limits_type = new plot_limits (yyvsp[-1].plot_range_type, yyvsp[0].plot_range_type); ;
    break;}
case 47:
#line 457 "parse.y"
{ yyval.plot_limits_type = new plot_limits (yyvsp[-2].plot_range_type, yyvsp[-1].plot_range_type, yyvsp[0].plot_range_type); ;
    break;}
case 48:
#line 461 "parse.y"
{ yyval.plot_range_type = new plot_range (yyvsp[-3].tree_expression_type, yyvsp[-1].tree_expression_type); ;
    break;}
case 49:
#line 463 "parse.y"
{ yyval.plot_range_type = new plot_range (0, yyvsp[-1].tree_expression_type); ;
    break;}
case 50:
#line 465 "parse.y"
{ yyval.plot_range_type = new plot_range (yyvsp[-2].tree_expression_type, 0); ;
    break;}
case 51:
#line 467 "parse.y"
{ yyval.plot_range_type = new plot_range (); ;
    break;}
case 52:
#line 469 "parse.y"
{ yyval.plot_range_type = new plot_range (); ;
    break;}
case 53:
#line 473 "parse.y"
{ yyval.subplot_list_type = 0; ;
    break;}
case 54:
#line 475 "parse.y"
{ yyval.subplot_list_type = new subplot_list (yyvsp[0].subplot_type); ;
    break;}
case 55:
#line 477 "parse.y"
{ yyvsp[-2].subplot_list_type->append (yyvsp[0].subplot_type); ;
    break;}
case 56:
#line 481 "parse.y"
{ yyval.subplot_type = new subplot (yyvsp[0].tree_expression_type); ;
    break;}
case 57:
#line 483 "parse.y"
{
		    yyvsp[0].subplot_type->set_data (yyvsp[-1].tree_expression_type);
		    yyval.subplot_type = yyvsp[0].subplot_type;
		  ;
    break;}
case 58:
#line 490 "parse.y"
{ yyval.subplot_type = new subplot (yyvsp[0].subplot_using_type, 0, 0); ;
    break;}
case 59:
#line 492 "parse.y"
{ yyval.subplot_type = new subplot (0, yyvsp[0].tree_expression_type, 0); ;
    break;}
case 60:
#line 494 "parse.y"
{ yyval.subplot_type = new subplot (0, 0, yyvsp[0].subplot_style_type); ;
    break;}
case 61:
#line 496 "parse.y"
{ yyval.subplot_type = new subplot (yyvsp[-1].subplot_using_type, yyvsp[0].tree_expression_type, 0); ;
    break;}
case 62:
#line 498 "parse.y"
{ yyval.subplot_type = new subplot (yyvsp[0].subplot_using_type, yyvsp[-1].tree_expression_type, 0); ;
    break;}
case 63:
#line 500 "parse.y"
{ yyval.subplot_type = new subplot (yyvsp[-1].subplot_using_type, 0, yyvsp[0].subplot_style_type); ;
    break;}
case 64:
#line 502 "parse.y"
{ yyval.subplot_type = new subplot (yyvsp[0].subplot_using_type, 0, yyvsp[-1].subplot_style_type); ;
    break;}
case 65:
#line 504 "parse.y"
{ yyval.subplot_type = new subplot (0, yyvsp[-1].tree_expression_type, yyvsp[0].subplot_style_type); ;
    break;}
case 66:
#line 506 "parse.y"
{ yyval.subplot_type = new subplot (0, yyvsp[0].tree_expression_type, yyvsp[-1].subplot_style_type); ;
    break;}
case 67:
#line 508 "parse.y"
{ yyval.subplot_type = new subplot (yyvsp[-2].subplot_using_type, yyvsp[-1].tree_expression_type, yyvsp[0].subplot_style_type); ;
    break;}
case 68:
#line 510 "parse.y"
{ yyval.subplot_type = new subplot (yyvsp[-2].subplot_using_type, yyvsp[0].tree_expression_type, yyvsp[-1].subplot_style_type); ;
    break;}
case 69:
#line 512 "parse.y"
{ yyval.subplot_type = new subplot (yyvsp[-1].subplot_using_type, yyvsp[-2].tree_expression_type, yyvsp[0].subplot_style_type); ;
    break;}
case 70:
#line 514 "parse.y"
{ yyval.subplot_type = new subplot (yyvsp[0].subplot_using_type, yyvsp[-2].tree_expression_type, yyvsp[-1].subplot_style_type); ;
    break;}
case 71:
#line 516 "parse.y"
{ yyval.subplot_type = new subplot (yyvsp[-1].subplot_using_type, yyvsp[0].tree_expression_type, yyvsp[-2].subplot_style_type); ;
    break;}
case 72:
#line 518 "parse.y"
{ yyval.subplot_type = new subplot (yyvsp[0].subplot_using_type, yyvsp[-1].tree_expression_type, yyvsp[-2].subplot_style_type); ;
    break;}
case 73:
#line 522 "parse.y"
{
		    in_plot_using = 0;
		    yyval.subplot_using_type = yyvsp[0].subplot_using_type;
		  ;
    break;}
case 74:
#line 527 "parse.y"
{
		    in_plot_using = 0;
		    yyval.subplot_using_type = yyvsp[-1].subplot_using_type->set_format (yyvsp[0].tree_expression_type);
		  ;
    break;}
case 75:
#line 534 "parse.y"
{
		    subplot_using *tmp = new subplot_using ();
		    yyval.subplot_using_type = tmp->add_qualifier (yyvsp[0].tree_expression_type);
		  ;
    break;}
case 76:
#line 539 "parse.y"
{ yyval.subplot_using_type = yyvsp[-2].subplot_using_type->add_qualifier (yyvsp[0].tree_expression_type); ;
    break;}
case 77:
#line 543 "parse.y"
{ yyval.tree_expression_type = yyvsp[0].tree_expression_type; ;
    break;}
case 78:
#line 547 "parse.y"
{ yyval.subplot_style_type = new subplot_style (yyvsp[0].tok_val->string ()); ;
    break;}
case 79:
#line 549 "parse.y"
{ yyval.subplot_style_type = new subplot_style (yyvsp[-1].tok_val->string (), yyvsp[0].tree_expression_type); ;
    break;}
case 80:
#line 551 "parse.y"
{ yyval.subplot_style_type = new subplot_style (yyvsp[-3].tok_val->string (), yyvsp[-2].tree_expression_type, yyvsp[0].tree_expression_type); ;
    break;}
case 82:
#line 558 "parse.y"
{ yyval.tree_expression_type = maybe_convert_to_ans_assign (yyvsp[0].tree_expression_type); ;
    break;}
case 83:
#line 562 "parse.y"
{
		    yyval.tree_global_command_type = new tree_global_command (yyvsp[0].tree_global_init_list_type, yyvsp[-1].tok_val->line (),
						  yyvsp[-1].tok_val->column ());
		  ;
    break;}
case 84:
#line 569 "parse.y"
{ yyval.tree_global_init_list_type = new tree_global_init_list (yyvsp[0].tree_global_type); ;
    break;}
case 85:
#line 571 "parse.y"
{ yyvsp[-2].tree_global_init_list_type->append (yyvsp[0].tree_global_type); ;
    break;}
case 86:
#line 574 "parse.y"
{ yyval.tree_global_type = new tree_global (yyvsp[0].tree_identifier_type); ;
    break;}
case 87:
#line 576 "parse.y"
{
		    tree_simple_assignment_expression *tmp_ass;
		    tmp_ass = new tree_simple_assignment_expression
		      (yyvsp[-2].tree_identifier_type, yyvsp[0].tree_expression_type, 0, 0, yyvsp[-1].tok_val->line (), yyvsp[-1].tok_val->column ());
		    yyval.tree_global_type = new tree_global (tmp_ass);
		  ;
    break;}
case 89:
#line 586 "parse.y"
{
		    if (user_pref.warn_comma_in_global_decl)
		      warning ("comma in global declaration not\
 interpreted as a command separator");
		  ;
    break;}
case 90:
#line 594 "parse.y"
{ yyval.tree_command_type = yyvsp[0].tree_plot_command_type; ;
    break;}
case 91:
#line 596 "parse.y"
{ yyval.tree_command_type = yyvsp[0].tree_command_type; ;
    break;}
case 92:
#line 598 "parse.y"
{ yyval.tree_command_type = yyvsp[0].tree_global_command_type; ;
    break;}
case 93:
#line 600 "parse.y"
{
		    iffing--;
		    yyval.tree_command_type = yyvsp[0].tree_if_command_type;
		  ;
    break;}
case 94:
#line 606 "parse.y"
{
		    if (check_end (yyvsp[0].tok_val, token::unwind_protect_end))
		      ABORT_PARSE;

		    yyval.tree_command_type = new tree_unwind_protect_command (yyvsp[-4].tree_statement_list_type, yyvsp[-1].tree_statement_list_type, yyvsp[-6].tok_val->line (),
							  yyvsp[-6].tok_val->column ());
		  ;
    break;}
case 95:
#line 614 "parse.y"
{
		    maybe_warn_assign_as_truth_value (yyvsp[-3].tree_expression_type);
		    if (check_end (yyvsp[0].tok_val, token::while_end))
		      ABORT_PARSE;
		    looping--;
		    yyval.tree_command_type = new tree_while_command (yyvsp[-3].tree_expression_type, yyvsp[-1].tree_statement_list_type, yyvsp[-4].tok_val->line (),
						 yyvsp[-4].tok_val->column ());
		  ;
    break;}
case 96:
#line 623 "parse.y"
{
		    if (check_end (yyvsp[0].tok_val, token::for_end))
		      ABORT_PARSE;
		    looping--;
		    yyval.tree_command_type = new tree_for_command (yyvsp[-5].tree_index_expression_type, yyvsp[-3].tree_expression_type, yyvsp[-1].tree_statement_list_type,
					       yyvsp[-6].tok_val->line (), yyvsp[-6].tok_val->column ());
		  ;
    break;}
case 97:
#line 631 "parse.y"
{
		    if (!looping)
		      {
			yyerror ("break: only meaningful within a `for'\
 or `while' loop");
			ABORT_PARSE;
		      }
		    yyval.tree_command_type = new tree_break_command (yyvsp[0].tok_val->line (), yyvsp[0].tok_val->column ());
		  ;
    break;}
case 98:
#line 641 "parse.y"
{
		    if (!looping)
		      {
			yyerror ("continue: only meaningful within a\
 `for' or `while' loop");
			ABORT_PARSE;
		      }
		    yyval.tree_command_type = new tree_continue_command (yyvsp[0].tok_val->line (),
						    yyvsp[0].tok_val->column ());
		  ;
    break;}
case 99:
#line 652 "parse.y"
{
		    if (!defining_func)
		      {
			yyerror ("return: only meaningful within a function");
			ABORT_PARSE;
		      }
		    yyval.tree_command_type = new tree_return_command (yyvsp[0].tok_val->line (), yyvsp[0].tok_val->column ());
		  ;
    break;}
case 100:
#line 663 "parse.y"
{
		    if (check_end (yyvsp[0].tok_val, token::if_end))
		      ABORT_PARSE;
		    yyval.tree_if_command_type = new tree_if_command (yyvsp[-1].tree_if_command_list_type, yyvsp[-2].tok_val->line (), yyvsp[-2].tok_val->column ());
		  ;
    break;}
case 101:
#line 671 "parse.y"
{ yyval.tree_if_command_list_type = yyvsp[0].tree_if_command_list_type ;
    break;}
case 102:
#line 673 "parse.y"
{ yyvsp[-1].tree_if_command_list_type->append (yyvsp[0].tree_if_clause_type); ;
    break;}
case 103:
#line 677 "parse.y"
{
		    maybe_warn_assign_as_truth_value (yyvsp[-2].tree_expression_type);
		    tree_if_clause *t = new tree_if_clause (yyvsp[-2].tree_expression_type, yyvsp[0].tree_statement_list_type);
		    yyval.tree_if_command_list_type = new tree_if_command_list (t);
		  ;
    break;}
case 104:
#line 683 "parse.y"
{ yyvsp[-1].tree_if_command_list_type->append (yyvsp[0].tree_if_clause_type); ;
    break;}
case 105:
#line 687 "parse.y"
{
		    maybe_warn_assign_as_truth_value (yyvsp[-2].tree_expression_type);
		    yyval.tree_if_clause_type = new tree_if_clause (yyvsp[-2].tree_expression_type, yyvsp[0].tree_statement_list_type);
		  ;
    break;}
case 106:
#line 694 "parse.y"
{ yyval.tree_if_clause_type = new tree_if_clause (yyvsp[0].tree_statement_list_type); ;
    break;}
case 115:
#line 710 "parse.y"
{ maybe_screwed_again++; ;
    break;}
case 116:
#line 714 "parse.y"
{ yyval.tree_expression_type = new tree_simple_assignment_expression
		      (yyvsp[-2].tree_index_expression_type, yyvsp[0].tree_expression_type, 0, 0, yyvsp[-1].tok_val->line (), yyvsp[-1].tok_val->column ()); ;
    break;}
case 117:
#line 717 "parse.y"
{
		    yyerror ("invalid assignment to a number");
		    yyval.tree_expression_type = 0;
		    ABORT_PARSE;
		  ;
    break;}
case 118:
#line 723 "parse.y"
{
		    yyval.tree_expression_type = make_multi_val_ret (yyvsp[0].tree_expression_type, yyvsp[-1].tok_val->line (), yyvsp[-1].tok_val->column ());

		    if (! yyval.tree_expression_type)
		      ABORT_PARSE;
		  ;
    break;}
case 119:
#line 730 "parse.y"
{ yyval.tree_expression_type = yyvsp[0].tree_expression_type; ;
    break;}
case 120:
#line 734 "parse.y"
{ yyval.tree_expression_type = yyvsp[0].tree_expression_type; ;
    break;}
case 121:
#line 736 "parse.y"
{ yyval.tree_expression_type = make_postfix_op (PLUS_PLUS, yyvsp[-1].tree_identifier_type, yyvsp[0].tok_val); ;
    break;}
case 122:
#line 738 "parse.y"
{ yyval.tree_expression_type = make_postfix_op (MINUS_MINUS, yyvsp[-1].tree_identifier_type, yyvsp[0].tok_val); ;
    break;}
case 123:
#line 740 "parse.y"
{ yyval.tree_expression_type = make_unary_op (QUOTE, yyvsp[-1].tree_expression_type, yyvsp[0].tok_val); ;
    break;}
case 124:
#line 742 "parse.y"
{ yyval.tree_expression_type = make_unary_op (TRANSPOSE, yyvsp[-1].tree_expression_type, yyvsp[0].tok_val); ;
    break;}
case 125:
#line 744 "parse.y"
{ yyval.tree_expression_type = make_binary_op (POW, yyvsp[-2].tree_expression_type, yyvsp[-1].tok_val, yyvsp[0].tree_expression_type); ;
    break;}
case 126:
#line 746 "parse.y"
{ yyval.tree_expression_type = make_binary_op (EPOW, yyvsp[-2].tree_expression_type, yyvsp[-1].tok_val, yyvsp[0].tree_expression_type); ;
    break;}
case 127:
#line 748 "parse.y"
{ yyval.tree_expression_type = make_binary_op ('+', yyvsp[-2].tree_expression_type, yyvsp[-1].tok_val, yyvsp[0].tree_expression_type); ;
    break;}
case 128:
#line 750 "parse.y"
{ yyval.tree_expression_type = make_binary_op ('-', yyvsp[-2].tree_expression_type, yyvsp[-1].tok_val, yyvsp[0].tree_expression_type); ;
    break;}
case 129:
#line 752 "parse.y"
{ yyval.tree_expression_type = make_binary_op ('*', yyvsp[-2].tree_expression_type, yyvsp[-1].tok_val, yyvsp[0].tree_expression_type); ;
    break;}
case 130:
#line 754 "parse.y"
{ yyval.tree_expression_type = make_binary_op ('/', yyvsp[-2].tree_expression_type, yyvsp[-1].tok_val, yyvsp[0].tree_expression_type); ;
    break;}
case 131:
#line 756 "parse.y"
{ yyval.tree_expression_type = make_binary_op (EMUL, yyvsp[-2].tree_expression_type, yyvsp[-1].tok_val, yyvsp[0].tree_expression_type); ;
    break;}
case 132:
#line 758 "parse.y"
{ yyval.tree_expression_type = make_binary_op (EDIV, yyvsp[-2].tree_expression_type, yyvsp[-1].tok_val, yyvsp[0].tree_expression_type); ;
    break;}
case 133:
#line 760 "parse.y"
{ yyval.tree_expression_type = make_binary_op (LEFTDIV, yyvsp[-2].tree_expression_type, yyvsp[-1].tok_val, yyvsp[0].tree_expression_type); ;
    break;}
case 134:
#line 762 "parse.y"
{ yyval.tree_expression_type = make_binary_op (ELEFTDIV, yyvsp[-2].tree_expression_type, yyvsp[-1].tok_val, yyvsp[0].tree_expression_type); ;
    break;}
case 135:
#line 764 "parse.y"
{ yyval.tree_expression_type = make_binary_op (EXPR_LT, yyvsp[-2].tree_expression_type, yyvsp[-1].tok_val, yyvsp[0].tree_expression_type); ;
    break;}
case 136:
#line 766 "parse.y"
{ yyval.tree_expression_type = make_binary_op (EXPR_LE, yyvsp[-2].tree_expression_type, yyvsp[-1].tok_val, yyvsp[0].tree_expression_type); ;
    break;}
case 137:
#line 768 "parse.y"
{ yyval.tree_expression_type = make_binary_op (EXPR_EQ, yyvsp[-2].tree_expression_type, yyvsp[-1].tok_val, yyvsp[0].tree_expression_type); ;
    break;}
case 138:
#line 770 "parse.y"
{ yyval.tree_expression_type = make_binary_op (EXPR_GE, yyvsp[-2].tree_expression_type, yyvsp[-1].tok_val, yyvsp[0].tree_expression_type); ;
    break;}
case 139:
#line 772 "parse.y"
{ yyval.tree_expression_type = make_binary_op (EXPR_GT, yyvsp[-2].tree_expression_type, yyvsp[-1].tok_val, yyvsp[0].tree_expression_type); ;
    break;}
case 140:
#line 774 "parse.y"
{ yyval.tree_expression_type = make_binary_op (EXPR_NE, yyvsp[-2].tree_expression_type, yyvsp[-1].tok_val, yyvsp[0].tree_expression_type); ;
    break;}
case 141:
#line 776 "parse.y"
{ yyval.tree_expression_type = make_binary_op (EXPR_AND_AND, yyvsp[-2].tree_expression_type, yyvsp[-1].tok_val, yyvsp[0].tree_expression_type); ;
    break;}
case 142:
#line 778 "parse.y"
{ yyval.tree_expression_type = make_binary_op (EXPR_OR_OR, yyvsp[-2].tree_expression_type, yyvsp[-1].tok_val, yyvsp[0].tree_expression_type); ;
    break;}
case 143:
#line 780 "parse.y"
{ yyval.tree_expression_type = make_binary_op (EXPR_AND, yyvsp[-2].tree_expression_type, yyvsp[-1].tok_val, yyvsp[0].tree_expression_type); ;
    break;}
case 144:
#line 782 "parse.y"
{ yyval.tree_expression_type = make_binary_op (EXPR_OR, yyvsp[-2].tree_expression_type, yyvsp[-1].tok_val, yyvsp[0].tree_expression_type); ;
    break;}
case 145:
#line 786 "parse.y"
{
		    tree_constant *tmp = new tree_constant (yyvsp[0].tok_val->number ());
		    tmp->stash_original_text (yyvsp[0].tok_val->text_rep ());
		    yyval.tree_expression_type = tmp;
		  ;
    break;}
case 146:
#line 792 "parse.y"
{
		    Complex c (0.0, yyvsp[0].tok_val->number ());
		    tree_constant *tmp = new tree_constant (c);
		    tmp->stash_original_text (yyvsp[0].tok_val->text_rep ());
		    yyval.tree_expression_type = tmp;
		  ;
    break;}
case 147:
#line 799 "parse.y"
{ yyval.tree_expression_type = new tree_constant (yyvsp[0].tok_val->string ()); ;
    break;}
case 148:
#line 801 "parse.y"
{
		    yyvsp[-1].tree_expression_type->in_parens++;
		    yyval.tree_expression_type = yyvsp[-1].tree_expression_type;
		  ;
    break;}
case 149:
#line 806 "parse.y"
{ yyval.tree_expression_type = yyvsp[0].tree_index_expression_type; ;
    break;}
case 150:
#line 808 "parse.y"
{ yyval.tree_expression_type = yyvsp[0].tree_index_expression_type; ;
    break;}
case 151:
#line 810 "parse.y"
{ yyval.tree_expression_type = yyvsp[0].tree_matrix_type; ;
    break;}
case 152:
#line 812 "parse.y"
{
		    mlnm.pop ();
		    yyval.tree_expression_type = new tree_constant (Matrix ());
		  ;
    break;}
case 153:
#line 817 "parse.y"
{
		    mlnm.pop ();
		    yyval.tree_expression_type = new tree_constant (Matrix ());
		  ;
    break;}
case 154:
#line 822 "parse.y"
{ yyval.tree_expression_type = yyvsp[0].tree_colon_expression_type; ;
    break;}
case 155:
#line 824 "parse.y"
{ yyval.tree_expression_type = make_prefix_op (PLUS_PLUS, yyvsp[0].tree_identifier_type, yyvsp[-1].tok_val); ;
    break;}
case 156:
#line 826 "parse.y"
{ yyval.tree_expression_type = make_prefix_op (MINUS_MINUS, yyvsp[0].tree_identifier_type, yyvsp[-1].tok_val); ;
    break;}
case 157:
#line 828 "parse.y"
{ yyval.tree_expression_type = make_unary_op (EXPR_NOT, yyvsp[0].tree_expression_type, yyvsp[-1].tok_val); ;
    break;}
case 158:
#line 830 "parse.y"
{ yyval.tree_expression_type = yyvsp[0].tree_expression_type; ;
    break;}
case 159:
#line 832 "parse.y"
{ yyval.tree_expression_type = make_unary_op ('-', yyvsp[0].tree_expression_type, yyvsp[-1].tok_val); ;
    break;}
case 160:
#line 836 "parse.y"
{ yyval.tree_colon_expression_type = new tree_colon_expression
		      (yyvsp[-2].tree_expression_type, yyvsp[0].tree_expression_type, yyvsp[-1].tok_val->line (), yyvsp[-1].tok_val->column ()); ;
    break;}
case 161:
#line 839 "parse.y"
{
		    yyval.tree_colon_expression_type = yyvsp[-2].tree_colon_expression_type->chain (yyvsp[0].tree_expression_type);
		    if (! yyval.tree_colon_expression_type)
		      ABORT_PARSE;
		  ;
    break;}
case 162:
#line 847 "parse.y"
{
		    yyval.tree_index_expression_type = new tree_index_expression
			   (yyvsp[-1].tree_identifier_type, yyvsp[0].tree_argument_list_type, yyvsp[-1].tree_identifier_type->line (), yyvsp[-1].tree_identifier_type->column ());
		  ;
    break;}
case 163:
#line 854 "parse.y"
{
		    tree_constant *tmp = new tree_constant (yyvsp[0].tok_val->string ());
		    yyval.tree_argument_list_type = new tree_argument_list (tmp);
		  ;
    break;}
case 164:
#line 859 "parse.y"
{
		    tree_constant *tmp = new tree_constant (yyvsp[0].tok_val->string ());
		    yyvsp[-1].tree_argument_list_type->append (tmp);
		  ;
    break;}
case 165:
#line 868 "parse.y"
{ curr_sym_tab = global_sym_tab; ;
    break;}
case 166:
#line 872 "parse.y"
{ curr_sym_tab = tmp_local_sym_tab; ;
    break;}
case 167:
#line 876 "parse.y"
{ maybe_screwed = 0; ;
    break;}
case 168:
#line 880 "parse.y"
{ maybe_screwed = 1; ;
    break;}
case 169:
#line 884 "parse.y"
{
		    curr_sym_tab = top_level_sym_tab;
		    defining_func = 0;
		    yyval.tree_command_type = 0;
		  ;
    break;}
case 170:
#line 890 "parse.y"
{
		    curr_sym_tab = top_level_sym_tab;
		    defining_func = 0;
		    yyval.tree_command_type = 0;
		  ;
    break;}
case 171:
#line 898 "parse.y"
{
		    tree_identifier *tmp = new tree_identifier
		      (yyvsp[-4].tok_val->sym_rec (), yyvsp[-4].tok_val->line (), yyvsp[-4].tok_val->column ());
		    tree_parameter_list *tpl = new tree_parameter_list (tmp);
		    tpl->mark_as_formal_parameters ();
		    yyval.tree_function_type = yyvsp[0].tree_function_type->define_ret_list (tpl);
		  ;
    break;}
case 172:
#line 906 "parse.y"
{
		    yyvsp[-3].tree_parameter_list_type->mark_as_formal_parameters ();
		    yyval.tree_function_type = yyvsp[0].tree_function_type->define_ret_list (yyvsp[-3].tree_parameter_list_type);
		  ;
    break;}
case 174:
#line 916 "parse.y"
{ yyval.tree_parameter_list_type = new tree_parameter_list (); ;
    break;}
case 175:
#line 918 "parse.y"
{
		    tree_parameter_list *tmp = new tree_parameter_list ();
		    tmp->mark_varargs_only ();
		    yyval.tree_parameter_list_type = tmp;
		  ;
    break;}
case 176:
#line 924 "parse.y"
{ yyval.tree_parameter_list_type = yyvsp[-1].tree_parameter_list_type; ;
    break;}
case 177:
#line 926 "parse.y"
{
		    yyvsp[-3].tree_parameter_list_type->mark_varargs ();
		    yyval.tree_parameter_list_type = yyvsp[-3].tree_parameter_list_type;
		  ;
    break;}
case 178:
#line 933 "parse.y"
{ yyval.tree_parameter_list_type = new tree_parameter_list (yyvsp[0].tree_identifier_type); ;
    break;}
case 179:
#line 935 "parse.y"
{
		    yyerror ("invalid function return list");
		    ABORT_PARSE;
		  ;
    break;}
case 180:
#line 940 "parse.y"
{ yyvsp[-2].tree_parameter_list_type->append (yyvsp[0].tree_identifier_type); ;
    break;}
case 181:
#line 944 "parse.y"
{
		    char *id_name = yyvsp[-3].tree_identifier_type->name ();
//		    if (is_text_function_name (id_name))
//		      {
//			yyerror ("invalid use of reserved word %s", id_name);
//			ABORT_PARSE;
//		      }

// If input is coming from a file, issue a warning if the name of the
// file does not match the name of the function stated in the file.
// Matlab doesn't provide a diagnostic (it ignores the stated name).

		    yyvsp[0].tree_function_type->stash_function_name (id_name);

		    if (reading_fcn_file)
		      {
			if (strcmp (curr_fcn_file_name, id_name) != 0)
			  {
			    warning ("function name `%s' does not agree\
 with function file name `%s.m'", id_name, curr_fcn_file_name);

			    global_sym_tab->rename (id_name,
						    curr_fcn_file_name);

			    if (error_state)
			      ABORT_PARSE;

			    id_name = yyvsp[-3].tree_identifier_type->name ();
			  }

			yyvsp[0].tree_function_type->stash_function_name (id_name);
			yyvsp[0].tree_function_type->stash_fcn_file_name ();
			yyvsp[0].tree_function_type->stash_fcn_file_time (time (0));
			yyvsp[0].tree_function_type->mark_as_system_fcn_file ();
		      }
		    else if (! (input_from_tmp_history_file
				|| input_from_startup_file)
			     && reading_script_file
			     && strcmp (curr_fcn_file_name, id_name) == 0)
		      {
			warning ("function `%s' defined within\
 script file `%s.m'", id_name, curr_fcn_file_name);
		      }

		    top_level_sym_tab->clear (id_name);

		    yyvsp[-3].tree_identifier_type->define (yyvsp[0].tree_function_type);
		    yyvsp[-3].tree_identifier_type->document (help_buf);

		    yyval.tree_function_type = yyvsp[0].tree_function_type;
		  ;
    break;}
case 182:
#line 998 "parse.y"
{
		    tree_function *fcn = new tree_function (yyvsp[-1].tree_statement_list_type, curr_sym_tab);
		    yyval.tree_function_type = fcn->define_param_list (yyvsp[-3].tree_parameter_list_type);
		  ;
    break;}
case 183:
#line 1003 "parse.y"
{ yyval.tree_function_type = new tree_function (yyvsp[-1].tree_statement_list_type, curr_sym_tab); ;
    break;}
case 184:
#line 1007 "parse.y"
{
		    if (check_end (yyvsp[0].tok_val, token::function_end))
			ABORT_PARSE;

		    if (reading_fcn_file)
		      check_for_garbage_after_fcn_def ();
		  ;
    break;}
case 185:
#line 1015 "parse.y"
{
		    if (! (reading_fcn_file || reading_script_file))
		      YYABORT;
		  ;
    break;}
case 186:
#line 1022 "parse.y"
{
		    looking_at_indirect_ref = 0;
		    yyval.tree_indirect_ref_type = yyvsp[0].tree_indirect_ref_type;
		  ;
    break;}
case 187:
#line 1028 "parse.y"
{
		    yyval.tree_indirect_ref_type = new tree_indirect_ref (yyvsp[0].tree_identifier_type, yyvsp[0].tree_identifier_type->line (),
						yyvsp[0].tree_identifier_type->column ());
		  ;
    break;}
case 188:
#line 1032 "parse.y"
{ looking_at_indirect_ref = 1; ;
    break;}
case 189:
#line 1033 "parse.y"
{ yyval.tree_indirect_ref_type = yyvsp[-3].tree_indirect_ref_type->chain (yyvsp[0].tok_val->string ()); ;
    break;}
case 190:
#line 1037 "parse.y"
{ yyval.tree_index_expression_type = make_index_expression (yyvsp[0].tree_indirect_ref_type, 0); ;
    break;}
case 191:
#line 1039 "parse.y"
{ yyval.tree_index_expression_type = make_index_expression (yyvsp[-2].tree_indirect_ref_type, 0); ;
    break;}
case 192:
#line 1041 "parse.y"
{ yyval.tree_index_expression_type = make_index_expression (yyvsp[-3].tree_indirect_ref_type, yyvsp[-1].tree_argument_list_type); ;
    break;}
case 193:
#line 1043 "parse.y"
{
		    yyerror ("use `(\' and `)\' as index operators, not\
 `[\' and `]\'"); 
		    yyval.tree_index_expression_type = 0;
		    ABORT_PARSE;
		  ;
    break;}
case 194:
#line 1052 "parse.y"
{
		    quote_is_transpose = 0;
		    yyval.tree_parameter_list_type = 0;
		  ;
    break;}
case 195:
#line 1057 "parse.y"
{
		    quote_is_transpose = 0;
		    tree_parameter_list *tmp = new tree_parameter_list ();
		    tmp->mark_varargs_only ();
		    yyval.tree_parameter_list_type = tmp;
		  ;
    break;}
case 196:
#line 1064 "parse.y"
{
		    quote_is_transpose = 0;
		    yyvsp[-1].tree_parameter_list_type->mark_as_formal_parameters ();
		  ;
    break;}
case 197:
#line 1069 "parse.y"
{
		    quote_is_transpose = 0;
		    yyvsp[-3].tree_parameter_list_type->mark_as_formal_parameters ();
		    yyvsp[-3].tree_parameter_list_type->mark_varargs ();
		  ;
    break;}
case 198:
#line 1077 "parse.y"
{ yyval.tree_parameter_list_type = new tree_parameter_list (yyvsp[0].tree_identifier_type); ;
    break;}
case 199:
#line 1079 "parse.y"
{ yyvsp[-2].tree_parameter_list_type->append (yyvsp[0].tree_identifier_type); ;
    break;}
case 200:
#line 1081 "parse.y"
{
		    yyerror ("invalid parameter list");
		    ABORT_PARSE;
		  ;
    break;}
case 201:
#line 1086 "parse.y"
{
		    yyerror ("invalid parameter list");
		    ABORT_PARSE;
		  ;
    break;}
case 202:
#line 1093 "parse.y"
{
		    yyval.tree_identifier_type = new tree_identifier
		      (yyvsp[0].tok_val->sym_rec (), yyvsp[0].tok_val->line (), yyvsp[0].tok_val->column ());
		  ;
    break;}
case 203:
#line 1100 "parse.y"
{
		    tree_constant *colon;
		    tree_constant::magic_colon t;
		    colon = new tree_constant (t);
		    yyval.tree_argument_list_type = new tree_argument_list (colon);
		  ;
    break;}
case 204:
#line 1107 "parse.y"
{ yyval.tree_argument_list_type = new tree_argument_list (yyvsp[0].tree_expression_type); ;
    break;}
case 205:
#line 1109 "parse.y"
{
		    tree_constant *all_va_args;
		    tree_constant::all_va_args t;
		    all_va_args = new tree_constant (t);
		    yyval.tree_argument_list_type = new tree_argument_list (all_va_args);
		  ;
    break;}
case 206:
#line 1116 "parse.y"
{
		    tree_constant *colon;
		    tree_constant::magic_colon t;
		    colon = new tree_constant (t);
		    yyvsp[-2].tree_argument_list_type->append (colon);
		  ;
    break;}
case 207:
#line 1123 "parse.y"
{ yyvsp[-2].tree_argument_list_type->append (yyvsp[0].tree_expression_type); ;
    break;}
case 208:
#line 1125 "parse.y"
{
		    tree_constant *all_va_args;
		    tree_constant::all_va_args t;
		    all_va_args = new tree_constant (t);
		    yyvsp[-2].tree_argument_list_type->append (all_va_args);
		  ;
    break;}
case 209:
#line 1134 "parse.y"
{
		    mlnm.pop ();
		    maybe_screwed_again--;
		    tree_matrix *tmp = ml.pop ();
		    yyval.tree_matrix_type = tmp->reverse ();
		  ;
    break;}
case 213:
#line 1148 "parse.y"
{
		    if (mlnm.top ())
		      {
			mlnm.pop ();
			mlnm.push (0);
			tree_matrix *tmp = new tree_matrix
			  (yyvsp[0].tree_expression_type, tree_matrix::md_none);
			ml.push (tmp);
		      }
		    else
		      {
			tree_matrix *tmp = ml.pop ();
			tmp = tmp->chain (yyvsp[0].tree_expression_type, tree_matrix::md_down);
			ml.push (tmp);
		      }
		  ;
    break;}
case 215:
#line 1166 "parse.y"
{
		    tree_matrix *tmp = ml.pop ();
		    tmp = tmp->chain (yyvsp[0].tree_expression_type, tree_matrix::md_right);
		    ml.push (tmp);
		  ;
    break;}
}
   /* the action file gets copied in in place of this dollarsign */
#line 465 "/usr/local/gnu/lib/bison.simple"

  yyvsp -= yylen;
  yyssp -= yylen;
#ifdef YYLSP_NEEDED
  yylsp -= yylen;
#endif

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

  *++yyvsp = yyval;

#ifdef YYLSP_NEEDED
  yylsp++;
  if (yylen == 0)
    {
      yylsp->first_line = yylloc.first_line;
      yylsp->first_column = yylloc.first_column;
      yylsp->last_line = (yylsp-1)->last_line;
      yylsp->last_column = (yylsp-1)->last_column;
      yylsp->text = 0;
    }
  else
    {
      yylsp->last_line = (yylsp+yylen-1)->last_line;
      yylsp->last_column = (yylsp+yylen-1)->last_column;
    }
#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 */

  if (! yyerrstatus)
    /* If not already recovering from an error, report this error.  */
    {
      ++yynerrs;

#ifdef YYERROR_VERBOSE
      yyn = yypact[yystate];

      if (yyn > YYFLAG && yyn < YYLAST)
	{
	  int size = 0;
	  char *msg;
	  int x, count;

	  count = 0;
	  /* Start X at -yyn if nec to avoid negative indexes in yycheck.  */
	  for (x = (yyn < 0 ? -yyn : 0);
	       x < (sizeof(yytname) / sizeof(char *)); x++)
	    if (yycheck[x + yyn] == x)
	      size += strlen(yytname[x]) + 15, count++;
	  msg = (char *) malloc(size + 15);
	  if (msg != 0)
	    {
	      strcpy(msg, "parse error");

	      if (count < 5)
		{
		  count = 0;
		  for (x = (yyn < 0 ? -yyn : 0);
		       x < (sizeof(yytname) / sizeof(char *)); x++)
		    if (yycheck[x + yyn] == x)
		      {
			strcat(msg, count == 0 ? ", expecting `" : " or `");
			strcat(msg, yytname[x]);
			strcat(msg, "'");
			count++;
		      }
		}
	      yyerror(msg);
	      free(msg);
	    }
	  else
	    yyerror ("parse error; also virtual memory exceeded");
	}
      else
#endif /* YYERROR_VERBOSE */
	yyerror("parse error");
    }

  goto yyerrlab1;
yyerrlab1:   /* here on error raised explicitly by an action */

  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;

#if YYDEBUG != 0
      if (yydebug)
	fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
#endif

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

#if 0
  /* This is wrong; only states that explicitly want error tokens
     should shift them.  */
  yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
  if (yyn) goto yydefault;
#endif

yyerrpop:   /* pop the current state because it cannot handle the error token */

  if (yyssp == yyss) YYABORT;
  yyvsp--;
  yystate = *--yyssp;
#ifdef YYLSP_NEEDED
  yylsp--;
#endif

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

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;

#if YYDEBUG != 0
  if (yydebug)
    fprintf(stderr, "Shifting error token, ");
#endif

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

  yystate = yyn;
  goto yynewstate;
}
#line 1173 "parse.y"


// Generic error messages.

static void
yyerror (char *s)
{
  char *line = current_input_line;
  int err_col = current_input_column - 1;
  if (err_col == 0 && line)
    err_col = strlen (line) + 1;

  ostrstream output_buf;

  if (reading_fcn_file || reading_script_file)
    output_buf << "parse error near line " << input_line_number
	       << " of file " << curr_fcn_file_name << ".m:";
  else
    output_buf << "parse error:";

  if (s && strcmp (s, "parse error") != 0)
    output_buf << "\n\n  " << s;

  output_buf << "\n\n";

  if (line)
    {
      int len = strlen (line);
      if (line[len-1] == '\n')
        {
          len--;
          line[len] = '\0';
        }

// Print the line, maybe with a pointer near the error token.

      output_buf << "  " << line << "\n";
      if (err_col <= len)
	{
	  for (int i = 0; i < err_col + 1; i++)
	    output_buf << " ";
	  output_buf << "^";
	}
    }

  output_buf << "\n" << ends;

  char *msg = output_buf.str ();

  parse_error (msg);

  delete [] msg;
}

// Error mesages for mismatched end tokens.

static void
end_error (char *type, token::end_tok_type ettype, int l, int c)
{
  static char *fmt = "`%s' command matched by `%s' near line %d column %d";

  switch (ettype)
    {
    case token::simple_end:
      error (fmt, type, "end", l, c);
      break;

    case token::for_end:
      error (fmt, type, "endfor", l, c);
      break;

    case token::function_end:
      error (fmt, type, "endfunction", l, c);
      break;

    case token::if_end:
      error (fmt, type, "endif", l, c);
      break;

    case token::while_end:
      error (fmt, type, "endwhile", l, c); 
      break;

    default:
      panic_impossible ();
      break;
    }
}

// Check to see that end tokens are properly matched.

static int
check_end (token *tok, token::end_tok_type expected)
{
  token::end_tok_type ettype = tok->ettype ();
  if (ettype != expected && ettype != token::simple_end)
    {
      yyerror ("parse error");

      int l = tok->line ();
      int c = tok->column ();

      switch (expected)
	{
	case token::for_end:
	  end_error ("for", ettype, l, c);
	  break;

	case token::function_end:
	  end_error ("function", ettype, l, c);
	  break;

	case token::if_end:
	  end_error ("if", ettype, l, c);
	  break;

	case token::while_end:
	  end_error ("while", ettype, l, c);
	  break;

	default:
	  panic_impossible ();
	  break;
	}
      return 1;
    }
  else
    return 0;
}

// Try to figure out early if an expression should become an
// assignment to the builtin variable ans.
//
// Need to make sure that the expression isn't already an identifier
// that has a name, or an assignment expression.
//
// Note that an expression can't be just an identifier anymore -- it
// must at least be an index expression (see the definition of the
// non-terminal `variable' above).
//
// XXX FIXME XXX.  This isn't quite sufficient.  For example, try the
// command `x = 4, x' for `x' previously undefined.
//
// XXX FIXME XXX -- we should probably delay doing this until eval-time.

static tree_expression *
maybe_convert_to_ans_assign (tree_expression *expr)
{
  if (expr->is_index_expression ())
    {
      expr->mark_for_possible_ans_assign ();
      return expr;
    }
  else if (expr->is_assignment_expression ()
	   || expr->is_prefix_expression ())
    {
      return expr;
    }
  else
    {
      symbol_record *sr = global_sym_tab->lookup ("ans", 1, 0);

      assert (sr);
      
      tree_identifier *ans = new tree_identifier (sr);

      return new tree_simple_assignment_expression (ans, expr, 0, 1);
    }
}

// Maybe print a warning if an assignment expression is used as the
// test in a logical expression.

static void
maybe_warn_assign_as_truth_value (tree_expression *expr)
{
  if (user_pref.warn_assign_as_truth_value
      && expr->is_assignment_expression ()
      && expr->in_parens < 2)
    {
      warning ("suggest parenthesis around assignment used as truth value");
    }
}

// Build a binary expression.

static tree_expression *
make_binary_op (int op, tree_expression *op1, token *tok_val,
		tree_expression *op2)
{
  tree_expression::type t;
  switch (op)
    {
    case POW:
      t = tree_expression::power;
      break;

    case EPOW:
      t = tree_expression::elem_pow;
      break;

    case '+':
      t = tree_expression::add;
      break;

    case '-':
      t = tree_expression::subtract;
      break;

    case '*':
      t = tree_expression::multiply;
      break;

    case '/':
      t = tree_expression::divide;
      break;

    case EMUL:
      t = tree_expression::el_mul;
      break;

    case EDIV:
      t = tree_expression::el_div;
      break;

    case LEFTDIV:
      t = tree_expression::leftdiv;
      break;

    case ELEFTDIV:
      t = tree_expression::el_leftdiv;
      break;

    case EXPR_LT:
      t = tree_expression::cmp_lt;
      break;

    case EXPR_LE:
      t = tree_expression::cmp_le;
      break;

    case EXPR_EQ:
      t = tree_expression::cmp_eq;
      break;

    case EXPR_GE:
      t = tree_expression::cmp_ge;
      break;

    case EXPR_GT:
      t = tree_expression::cmp_gt;
      break;

    case EXPR_NE:
      t = tree_expression::cmp_ne;
      break;

    case EXPR_AND_AND:
      t = tree_expression::and_and;
      break;

    case EXPR_OR_OR:
      t = tree_expression::or_or;
      break;

    case EXPR_AND:
      t = tree_expression::and;
      break;

    case EXPR_OR:
      t = tree_expression::or;
      break;

    default:
      panic_impossible ();
      break;
    }

  int l = tok_val->line ();
  int c = tok_val->column ();

  return new tree_binary_expression (op1, op2, t, l, c);
}

// Build a prefix expression.

static tree_expression *
make_prefix_op (int op, tree_identifier *op1, token *tok_val)
{
  tree_expression::type t;
  switch (op)
    {
    case PLUS_PLUS:
      t = tree_expression::increment;
      break;

    case MINUS_MINUS:
      t = tree_expression::decrement;
      break;

    default:
      panic_impossible ();
      break;
    }

  int l = tok_val->line ();
  int c = tok_val->column ();

  return new tree_prefix_expression (op1, t, l, c);
}

// Build a postfix expression.

static tree_expression *
make_postfix_op (int op, tree_identifier *op1, token *tok_val)
{
  tree_expression::type t;
  switch (op)
    {
    case PLUS_PLUS:
      t = tree_expression::increment;
      break;

    case MINUS_MINUS:
      t = tree_expression::decrement;
      break;

    default:
      panic_impossible ();
      break;
    }

  int l = tok_val->line ();
  int c = tok_val->column ();

  return new tree_postfix_expression (op1, t, l, c);
}

// Build a unary expression.

static tree_expression *
make_unary_op (int op, tree_expression *op1, token *tok_val)
{
  tree_expression::type t;
  switch (op)
    {
    case QUOTE:
      t = tree_expression::hermitian;
      break;

    case TRANSPOSE:
      t = tree_expression::transpose;
      break;

    case EXPR_NOT:
      t = tree_expression::not;
      break;

    case '-':
      t = tree_expression::uminus;
      break;

    default:
      panic_impossible ();
      break;
    }

  int l = tok_val->line ();
  int c = tok_val->column ();

  return new tree_unary_expression (op1, t, l, c);
}

// Make an expression that handles assignment of multiple values.

static tree_expression *
make_multi_val_ret (tree_expression *rhs, int l, int c) 
{
// Convert the matrix list to a list of identifiers.  If that fails,
// we can abort here, without losing anything -- no other possible
// syntax is valid if we've seen the equals sign as the next token
// after the `]'. 

  tree_expression *retval = 0;

  maybe_screwed_again--;

  tree_matrix *tmp = ml.pop ();

  tmp = tmp->reverse ();

  tree_return_list *id_list = tmp->to_return_list ();

  if (id_list)
    {
      int list_len = id_list->length ();

      if (list_len == 1)
	{
	  tree_index_expression *lhs = id_list->remove_front ();
	  retval = new tree_simple_assignment_expression (lhs, rhs,
							  0, 0, l, c);
	  
	}
      else if (list_len > 1)
	{
	  if (rhs->is_multi_val_ret_expression ())
	    {
	      tree_multi_val_ret *t = (tree_multi_val_ret *) rhs;
	      retval = new tree_multi_assignment_expression (id_list, t, l, c);
	    }
	  else
	    yyerror ("RHS must be an expression that returns multiple values");
	}
      else
	panic_impossible ();
    }
  else
    yyerror ("invalid identifier list for assignment");

  return retval;
}

static tree_index_expression *
make_index_expression (tree_indirect_ref *indir, tree_argument_list *args)
{
  tree_index_expression *retval = 0;

  int l = indir->line ();
  int c = indir->column ();

  if (indir->is_identifier_only ())
    {
      indir->preserve_identifier ();
      retval = new tree_index_expression (indir->ident (), args, l, c);
      delete indir;
    }
  else
    retval =  new tree_index_expression (indir, args, l, c);

  return retval;
}
