Logo Search packages:      
Sourcecode: octave2.0 version File versions

parse.cc

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

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

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

#line 27 "parse.y"

#define YYDEBUG 1

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#ifdef YYBYACC
#include <cstdlib>
#endif

#include <strstream.h>

#include "Matrix.h"
#include "file-ops.h"

#include "defun.h"
#include "error.h"
#include "input.h"
#include "lex.h"
#include "oct-hist.h"
#include "toplev.h"
#include "pager.h"
#include "parse.h"
#include "pt-cmd.h"
#include "pt-const.h"
#include "pt-fcn.h"
#include "pt-fvc.h"
#include "pt-mat.h"
#include "pt-mvr.h"
#include "pt-exp.h"
#include "pt-misc.h"
#include "pt-plot.h"
#include "pt-pr-code.h"
#include "symtab.h"
#include "token.h"
#include "unwind-prot.h"
#include "utils.h"
#include "variables.h"

// If TRUE, generate a warning for the assignment in things like
//
//   octave> if (a = 2 < n)
//
// but not
//
//   octave> if ((a = 2) < n)
//
static bool Vwarn_assign_as_truth_value;

// If TRUE, generate a warning for variable swich labels.
static bool Vwarn_variable_switch_label;

// If TRUE, generate a warning for the comma in things like
//
//   octave> global a, b = 2
//
static bool Vwarn_comma_in_global_decl;

// If TRUE, generate warning if declared function name disagrees with
// the name of the file in which it is defined.
static bool Vwarn_function_name_clash;

// TRUE means warn about function files that have time stamps in the future.
bool Vwarn_future_time_stamp;

// If TRUE, generate warning if a statement in a function is not
// terminated with a semicolon.  Useful for checking functions that
// should only produce output using explicit printing statements.
static bool Vwarn_missing_semicolon;

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

// 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.
string help_buf;

// 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 built-in 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);

// Maybe print a warning about switch labels that aren't constants.
static void maybe_warn_variable_switch_label (tree_expression *expr);

// Create a plot command.
static tree_plot_command *make_plot_command
       (token *tok, plot_limits *range, subplot_list *list);

// Finish building a range.
static tree_expression *finish_colon_expression (tree_colon_expression *e);

// Build a constant.
static tree_constant *make_constant (int op, token *tok_val);

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

// Build a boolean expression.
static tree_expression *make_boolean_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);

// Build an unwind-protect command.
static tree_command *make_unwind_command
       (token *unwind_tok, tree_statement_list *body,
        tree_statement_list *cleanup, token *end_tok);

// Build a try-catch command.
static tree_command *make_try_command
       (token *try_tok, tree_statement_list *body,
        tree_statement_list *cleanup, token *end_tok);

// Build a while command.
static tree_command *make_while_command
       (token *while_tok, tree_expression *expr,
        tree_statement_list *body, token *end_tok);

// Build a for command.
static tree_command *make_for_command
       (token *for_tok, tree_index_expression *var,
        tree_expression *expr, tree_statement_list *body,
        token *end_tok);

// Build a for command a different way.
static tree_command *make_for_command
       (token *for_tok, tree_matrix_row *mr, tree_expression *expr,
        tree_statement_list *body, token *end_tok);

// Build a break command.
static tree_command *make_break_command (token *break_tok);

// Build a continue command.
static tree_command *make_continue_command (token *continue_tok);

// Build a return command.
static tree_command *make_return_command (token *return_tok);

// Start an if command.
static tree_if_command_list *start_if_command
       (tree_expression *expr, tree_statement_list *list);

// Finish an if command.
static tree_if_command *finish_if_command
       (token *if_tok, tree_if_command_list *list, token *end_tok);

// Build an elseif clause.
static tree_if_clause *make_elseif_clause
       (tree_expression *expr, tree_statement_list *list);

// Finish a switch command.
static tree_switch_command *finish_switch_command
       (token *switch_tok, tree_expression *expr,
        tree_switch_case_list *list, token *end_tok);

// Build a switch case.
static tree_switch_case *make_switch_case
       (tree_expression *expr, tree_statement_list *list);

// Build an assignment to a variable.
static tree_expression *make_simple_assignment
       (tree_index_expression *var, token *eq_tok, tree_expression *expr);

// Make an expression that handles assignment of multiple values.
static tree_expression *make_multi_val_ret
       (tree_matrix_row *mr, tree_expression *rhs, token *eq_tok);

// Begin defining a function.
static tree_function *start_function_def
       (tree_parameter_list *param_list, tree_statement_list *body);

// Do most of the work for defining a function.
static tree_function *frob_function_def
       (tree_identifier *id, tree_function *fcn);

// Finish defining a function.
static tree_function *finish_function_def (token *var, tree_function *fcn);

// Finish defining a function a different way.
static tree_function *finish_function_def
       (tree_parameter_list *ret_list, tree_function *fcn);

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

// Finish building a matrix list.
static tree_expression *finish_matrix (tree_matrix *m);

// Maybe print a warning.  Duh.
static void maybe_warn_missing_semi (tree_statement_list *);

// Set the print flag for a statement based on the separator type.
static void set_stmt_print_flag (tree_statement_list *, char, bool);

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


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

// Types for the nonterminals we generate.
  char sep_type;
  tree *tree_type;
  tree_matrix *tree_matrix_type;
  tree_matrix_row *tree_matrix_row_type;
  tree_expression *tree_expression_type;
  tree_constant *tree_constant_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_switch_command *tree_switch_command_type;
  tree_switch_case *tree_switch_case_type;
  tree_switch_case_list *tree_switch_case_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;
  subplot_axes *subplot_axes_type;
} yystype;
# define YYSTYPE yystype
#endif
#ifndef YYDEBUG
# define YYDEBUG 0
#endif



#define     YYFINAL           348
#define     YYFLAG            -32768
#define     YYNTBASE    81

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

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

#if YYDEBUG
static const short yyprhs[] =
{
       0,     0,     2,     4,     7,     9,    11,    13,    16,    19,
      21,    23,    26,    28,    32,    33,    35,    38,    40,    44,
      46,    48,    51,    53,    56,    59,    63,    65,    68,    72,
      78,    83,    88,    92,    95,    97,   101,   103,   106,   108,
     110,   112,   114,   117,   120,   123,   126,   129,   131,   134,
     137,   141,   144,   147,   151,   156,   158,   161,   163,   167,
     169,   173,   174,   176,   178,   180,   182,   184,   186,   194,
     202,   208,   216,   227,   229,   231,   233,   237,   239,   242,
     246,   249,   255,   259,   265,   267,   270,   272,   275,   281,
     285,   286,   288,   292,   294,   296,   298,   300,   304,   306,
     308,   310,   312,   315,   319,   322,   325,   328,   331,   334,
     338,   345,   348,   351,   354,   357,   361,   365,   369,   373,
     377,   381,   385,   389,   393,   397,   401,   405,   409,   413,
     417,   421,   425,   429,   433,   437,   441,   445,   449,   453,
     456,   458,   461,   462,   463,   464,   465,   466,   471,   476,
     482,   487,   492,   495,   499,   502,   507,   510,   513,   517,
     522,   527,   531,   533,   535,   537,   539,   540,   545,   547,
     551,   556,   559,   561,   563,   566,   570,   573,   578,   581,
     585,   588,   592,   594,   596,   598,   600,   604,   608,   612,
     617,   619,   622,   624,   628,   630,   633,   635,   639,   641,
     643,   646,   649,   650,   652,   654,   656,   658,   661,   664,
     667,   668
};
static const short yyrhs[] =
{
      82,     0,    63,     0,    84,    83,     0,    83,     0,    74,
       0,    84,     0,    84,    74,     0,    84,    63,     0,    58,
       0,     1,     0,    85,   153,     0,    89,     0,    85,   152,
      89,     0,     0,    87,     0,    88,   155,     0,    89,     0,
      88,   154,    89,     0,   106,     0,   101,     0,    37,    71,
       0,    37,     0,    37,    91,     0,    37,    93,     0,    37,
      91,    93,     0,    92,     0,    92,    92,     0,    92,    92,
      92,     0,    69,   118,    68,   118,    70,     0,    69,    68,
     118,    70,     0,    69,   118,    68,    70,     0,    69,    68,
      70,     0,    69,    70,     0,    94,     0,    93,    73,    94,
       0,   118,     0,   118,    95,     0,    97,     0,    99,     0,
     100,     0,    96,     0,    95,    97,     0,    95,    99,     0,
      95,   100,     0,    95,    96,     0,    67,    40,     0,    98,
       0,    98,   118,     0,    64,   118,     0,    98,    68,   118,
       0,    65,   118,     0,    66,    39,     0,    66,    39,   118,
       0,    66,    39,   118,   118,     0,   118,     0,    56,   103,
       0,   104,     0,   103,   105,   104,     0,   145,     0,   145,
       3,   118,     0,     0,    73,     0,    90,     0,   129,     0,
     102,     0,   112,     0,   107,     0,    52,   155,    86,    53,
     155,    86,    36,     0,    54,   155,    86,    55,   155,    86,
      36,     0,    42,   118,   155,    86,    36,     0,    41,   140,
       3,   118,   155,    86,    36,     0,    41,    76,   117,   150,
      60,     3,   118,   155,    86,    36,     0,    49,     0,    50,
       0,    51,     0,    43,   108,    36,     0,   109,     0,   109,
     111,     0,   118,   155,    86,     0,   109,   110,     0,    44,
     155,   118,   155,    86,     0,    45,   155,    86,     0,    46,
     118,   155,   113,    36,     0,   114,     0,   114,   116,     0,
     115,     0,   114,   115,     0,    47,   155,   118,   155,    87,
       0,    48,   155,    86,     0,     0,   119,     0,    32,     3,
     118,     0,   120,     0,    32,     0,    33,     0,    38,     0,
      77,   119,    78,     0,   122,     0,   140,     0,   121,     0,
     147,     0,    76,    79,     0,    76,    72,    79,     0,    28,
     145,     0,    29,   145,     0,    13,   119,     0,     6,   119,
       0,     5,   119,     0,   140,     3,   119,     0,    76,   117,
     150,    60,     3,   119,     0,   145,    28,     0,   145,    29,
       0,   119,    26,     0,   119,    27,     0,   119,    30,   119,
       0,   119,    31,   119,     0,   119,     6,   119,     0,   119,
       5,   119,     0,   119,     7,   119,     0,   119,     8,   119,
       0,   119,    24,   119,     0,   119,    25,   119,     0,   119,
      21,   119,     0,   119,    22,   119,     0,   119,    20,   119,
       0,   119,    23,   119,     0,   119,    14,   119,     0,   119,
      15,   119,     0,   119,    16,   119,     0,   119,    18,   119,
       0,   119,    19,   119,     0,   119,    17,   119,     0,   119,
      11,   119,     0,   119,    12,   119,     0,   119,     9,   119,
       0,   119,    10,   119,     0,   119,     4,   119,     0,   121,
       4,   119,     0,   145,   123,     0,    38,     0,   123,    38,
       0,     0,     0,     0,     0,     0,    59,   124,   128,   130,
       0,    59,   124,   128,   134,     0,    35,   127,   124,     3,
     134,     0,   132,   124,     3,   134,     0,    76,   127,   126,
     125,     0,   131,    79,     0,   131,    61,    79,     0,   133,
      79,     0,   133,    73,    61,    79,     0,   131,   145,     0,
     131,     1,     0,   133,    73,   145,     0,   145,   127,   126,
     135,     0,   143,   155,    86,   136,     0,   155,    86,   136,
       0,    36,     0,    63,     0,   138,     0,   145,     0,     0,
     138,    80,   139,    57,     0,   137,     0,   137,    77,    78,
       0,   137,    77,   146,    78,     0,   137,    76,     0,    77,
       0,    78,     0,   141,   142,     0,   141,    61,   142,     0,
     144,   142,     0,   144,    73,    61,   142,     0,   141,   145,
       0,   144,    73,   145,     0,   141,     1,     0,   144,    73,
       1,     0,    34,     0,     4,     0,   118,     0,    62,     0,
     146,    73,     4,     0,   146,    73,   118,     0,   146,    73,
      62,     0,    76,   117,   148,    79,     0,   149,     0,   149,
      72,     0,   150,     0,   149,    72,   150,     0,   151,     0,
     151,    73,     0,   118,     0,   151,    73,   118,     0,    73,
       0,    72,     0,   152,    73,     0,   152,    72,     0,     0,
     152,     0,    73,     0,    72,     0,    74,     0,   154,    73,
       0,   154,    72,     0,   154,    74,     0,     0,   154,     0
};

#endif

#if YYDEBUG
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const short yyrline[] =
{
       0,   403,   409,   415,   417,   421,   423,   425,   427,   431,
     433,   436,   443,   445,   453,   455,   459,   466,   471,   479,
     481,   483,   491,   496,   501,   506,   513,   515,   517,   521,
     523,   525,   527,   529,   533,   535,   542,   544,   548,   553,
     558,   563,   568,   576,   584,   592,   602,   609,   614,   621,
     626,   630,   634,   636,   638,   642,   646,   653,   655,   661,
     663,   672,   673,   681,   683,   685,   687,   689,   691,   696,
     701,   706,   711,   717,   722,   727,   734,   741,   743,   750,
     752,   759,   763,   767,   774,   776,   783,   785,   792,   796,
     800,   804,   806,   817,   824,   826,   828,   830,   835,   837,
     839,   841,   843,   845,   847,   849,   851,   853,   855,   857,
     859,   864,   866,   868,   870,   872,   874,   876,   878,   880,
     882,   884,   886,   888,   890,   892,   894,   896,   898,   900,
     902,   904,   906,   908,   910,   912,   914,   918,   923,   930,
     937,   942,   952,   956,   960,   964,   968,   972,   978,   986,
     988,   992,   995,  1000,  1007,  1012,  1020,  1022,  1028,  1035,
    1042,  1044,  1048,  1056,  1063,  1069,  1074,  1074,  1079,  1081,
    1083,  1085,  1094,  1098,  1102,  1107,  1114,  1120,  1129,  1131,
    1136,  1142,  1150,  1157,  1163,  1165,  1171,  1178,  1183,  1192,
    1196,  1198,  1202,  1204,  1211,  1213,  1217,  1219,  1226,  1228,
    1230,  1232,  1236,  1238,  1242,  1244,  1246,  1248,  1250,  1252,
    1256,  1258
};
#endif


#if (YYDEBUG) || defined YYERROR_VERBOSE

/* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
static const char *const yytname[] =
{
  "$", "error", "$undefined.", "'='", "':'", "'-'", "'+'", "'*'", "'/'", 
  "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", "EPLUS", "EMINUS", "QUOTE", 
  "TRANSPOSE", "PLUS_PLUS", "MINUS_MINUS", "POW", "EPOW", "NUM", 
  "IMAG_NUM", "NAME", "SCREW", "END", "PLOT", "TEXT", "STYLE", "AXES_TAG", 
  "FOR", "WHILE", "IF", "ELSEIF", "ELSE", "SWITCH", "CASE", "OTHERWISE", 
  "BREAK", "CONTINUE", "FUNC_RET", "UNWIND", "CLEANUP", "TRY", "CATCH", 
  "GLOBAL", "TEXT_ID", "LEXICAL_ERROR", "FCN", "SCREW_TWO", "ELLIPSIS", 
  "ALL_VA_ARGS", "END_OF_INPUT", "USING", "TITLE", "WITH", "AXES", 
  "COLON", "OPEN_BRACE", "CLOSE_BRACE", "CLEAR", "';'", "','", "'\\n'", 
  "UNARY", "'['", "'('", "')'", "']'", "'.'", "input", "input1", 
  "parse_error", "simple_list", "simple_list1", "opt_list", "list", 
  "list1", "statement", "plot_command", "ranges", "ranges1", 
  "plot_command1", "plot_command2", "plot_options", "axes", "using", 
  "using1", "title", "style", "ans_expression", "global_decl", 
  "global_decl1", "global_decl2", "optcomma", "command", "if_command", 
  "if_cmd_list", "if_cmd_list1", "elseif_clause", "else_clause", 
  "switch_command", "case_list", "case_list1", "switch_case", 
  "default_case", "screwed_again", "expression", "simple_expr", 
  "simple_expr1", "colon_expr", "word_list_cmd", "word_list", "g_symtab", 
  "in_return_list", "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_beg", "param_list_end", 
  "param_list", "param_list1", "identifier", "arg_list", "matrix", "rows", 
  "rows1", "matrix_row", "matrix_row1", "sep_no_nl", "opt_sep_no_nl", 
  "sep", "opt_sep", NULL
};
#endif

/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const short yyr1[] =
{
       0,    81,    81,    81,    81,    82,    82,    82,    82,    83,
      83,    84,    85,    85,    86,    86,    87,    88,    88,    89,
      89,    89,    90,    90,    90,    90,    91,    91,    91,    92,
      92,    92,    92,    92,    93,    93,    94,    94,    95,    95,
      95,    95,    95,    95,    95,    95,    96,    97,    97,    98,
      98,    99,   100,   100,   100,   101,   102,   103,   103,   104,
     104,   105,   105,   106,   106,   106,   106,   106,   106,   106,
     106,   106,   106,   106,   106,   106,   107,   108,   108,   109,
     109,   110,   111,   112,   113,   113,   114,   114,   115,   116,
     117,   118,   118,   119,   120,   120,   120,   120,   120,   120,
     120,   120,   120,   120,   120,   120,   120,   120,   120,   120,
     120,   120,   120,   120,   120,   120,   120,   120,   120,   120,
     120,   120,   120,   120,   120,   120,   120,   120,   120,   120,
     120,   120,   120,   120,   120,   120,   120,   121,   121,   122,
     123,   123,   124,   125,   126,   127,   128,   129,   129,   130,
     130,   131,   132,   132,   132,   132,   133,   133,   133,   134,
     135,   135,   136,   136,   137,   138,   139,   138,   140,   140,
     140,   140,   141,   142,   143,   143,   143,   143,   144,   144,
     144,   144,   145,   146,   146,   146,   146,   146,   146,   147,
     148,   148,   149,   149,   150,   150,   151,   151,   152,   152,
     152,   152,   153,   153,   154,   154,   154,   154,   154,   154,
     155,   155
};

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

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

static const short yydefgoto[] =
{
     346,    28,    29,    30,    31,   157,   158,   159,   160,    33,
      59,    60,    61,    62,   138,   139,   140,   141,   142,   143,
      34,    35,    78,    79,   163,    36,    37,    68,    69,   150,
     151,    38,   230,   231,   232,   268,    84,    39,    40,    41,
      42,    43,   126,    81,   313,   298,   272,   165,    44,   241,
     242,   243,   244,   245,   317,   342,    45,    46,   205,    47,
     318,   328,   319,   320,    48,   204,    49,   168,   169,   170,
     171,    91,    92,    75,    76
};

static const short yypact[] =
{
     287,-32768,   618,   618,   618,   -11,   -11,    32,-32768,-32768,
      51,-32768,   -21,   632,   632,   632,-32768,-32768,-32768,   -35,
     -35,   -11,-32768,-32768,-32768,-32768,   -43,   618,-32768,-32768,
      77,    18,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
     706,-32768,    43,-32768,-32768,    -3,   -26,    55,     2,-32768,
  -32768,   103,   103,   103,-32768,-32768,   632,   541,-32768,   632,
      -7,     3,-32768,   108,-32768,    79,-32768,   -35,    57,   125,
     -35,   -35,-32768,-32768,-32768,    93,   507,   507,   -23,-32768,
     122,-32768,    50,-32768,   632,   361,-32768,-32768,-32768,-32768,
  -32768,   455,-32768,   618,   618,   618,   618,   618,   618,   618,
     618,   618,   618,   618,   618,   618,   618,   618,   618,   618,
     618,   618,   618,   618,-32768,-32768,   618,   618,   618,-32768,
     158,-32768,   618,-32768,-32768,-32768,    98,-32768,   559,-32768,
      76,     3,    -7,   632,   632,   632,   111,   115,   108,-32768,
  -32768,   276,-32768,-32768,   632,   632,   507,-32768,   -35,   -35,
  -32768,-32768,   507,   112,-32768,-32768,-32768,   126,-32768,   -35,
  -32768,   106,-32768,   -11,   632,    -9,-32768,-32768,    99,   109,
     120,   110,-32768,-32768,-32768,-32768,   789,   495,   495,   116,
     116,   734,   734,   762,   762,   676,   676,   676,   676,   676,
     676,   116,   116,   116,   116,   495,   495,   103,   103,   789,
  -32768,-32768,-32768,-32768,   -27,   127,   706,-32768,-32768,   118,
     572,-32768,-32768,-32768,-32768,   632,-32768,-32768,-32768,-32768,
  -32768,   632,-32768,   133,   -35,   146,   632,   507,-32768,   -35,
     149,   129,-32768,   -35,   403,-32768,   -35,-32768,-32768,-32768,
  -32768,-32768,     7,-32768,    -8,-32768,-32768,-32768,   632,   191,
     632,   389,-32768,-32768,-32768,-32768,   131,   632,-32768,   192,
     507,-32768,   -35,-32768,   632,-32768,   -35,-32768,-32768,   507,
  -32768,   507,-32768,-32768,-32768,   123,-32768,-32768,   194,   -13,
  -32768,-32768,-32768,   618,-32768,-32768,-32768,-32768,-32768,-32768,
     632,   163,   507,   -35,   507,   167,   168,   202,-32768,-32768,
     -11,   128,-32768,    80,   706,   -35,-32768,-32768,   507,-32768,
  -32768,-32768,   -11,-32768,-32768,-32768,-32768,-32768,     9,   -35,
      48,   507,   507,-32768,-32768,-32768,   130,-32768,-32768,-32768,
     507,     8,-32768,    -4,   173,-32768,    -4,-32768,   130,-32768,
  -32768,-32768,-32768,-32768,-32768,-32768,   210,   212,-32768
};

static const short yypgoto[] =
{
  -32768,-32768,   183,-32768,-32768,   -71,   -92,-32768,    24,-32768,
  -32768,   -40,   165,    84,-32768,    88,    89,-32768,    90,    91,
  -32768,-32768,-32768,    59,-32768,-32768,-32768,-32768,-32768,-32768,
  -32768,-32768,-32768,-32768,     0,-32768,   169,     4,     1,-32768,
  -32768,-32768,-32768,  -228,-32768,   -49,  -174,-32768,-32768,-32768,
  -32768,-32768,-32768,  -278,-32768,   -98,-32768,-32768,-32768,   227,
  -32768,  -293,-32768,-32768,    -5,-32768,-32768,-32768,-32768,  -132,
  -32768,-32768,-32768,    81,   -18
};


#define     YYLAST            820


static const short yytable[] =
{
      54,    55,    77,    51,    52,    53,   161,    66,   274,   337,
     325,   -61,   223,     9,    63,   278,    80,    67,    70,    71,
     132,     9,   314,     9,    32,     9,   239,   332,    85,    82,
     123,   124,   340,   335,   324,    56,    83,    72,    73,    74,
     125,     9,     9,     9,   297,   345,   251,   118,   301,   146,
     162,   252,   152,   153,   121,    64,     2,     3,   122,   341,
     127,   130,    57,    63,     4,   279,   273,   240,   275,   338,
     326,   280,   281,   119,   120,   225,   133,    -6,     1,     5,
       6,   228,   145,     7,     8,     9,   276,   327,   167,    11,
      89,    90,   211,   147,   176,   177,   178,   179,   180,   181,
     182,   183,   184,   185,   186,   187,   188,   189,   190,   191,
     192,   193,   194,   195,   196,   175,   282,   197,   198,   199,
      57,   331,    58,   206,   203,   164,   327,    26,    27,   166,
     226,   227,   209,   116,   117,    22,   207,    63,   213,   214,
      86,   235,   114,   115,   210,   222,   116,   117,   167,   224,
     215,    87,    72,    73,    74,   216,   263,   316,    80,   229,
     246,   236,   200,     2,     3,   154,   155,   156,   238,   148,
     149,     4,   134,   135,   136,   137,   229,   266,   247,   233,
     249,   248,   261,   250,   253,   265,     5,     6,   254,   291,
       7,     8,     9,   259,   283,   290,    11,   300,   295,   306,
     296,   288,   299,   310,   311,   312,   260,   315,   327,   343,
     347,   264,   348,    88,   256,   269,   323,   212,   271,   257,
     201,   307,   237,   309,   131,   258,   217,   218,   219,   220,
     262,   267,   303,   144,    26,    27,   202,   277,   344,    65,
     234,     0,     0,     0,   292,     0,     0,     0,   294,     0,
     333,   334,   167,     0,   284,   287,     0,     0,   270,   336,
       0,   289,     0,     0,     0,     0,     0,     0,   293,     0,
       0,     0,     0,     0,   302,   308,     0,     0,     0,     0,
       0,     2,     3,     0,   304,   321,     0,   322,     1,     4,
       0,     0,     2,     3,   305,   246,     0,     0,     0,     0,
       4,   330,     0,     0,     5,     6,     0,   246,     7,     8,
       9,     0,     0,   329,    11,     5,     6,     0,     0,     7,
       8,     9,     0,     0,    10,    11,   339,     0,    12,    13,
      14,     0,     0,    15,     0,     0,    16,    17,    18,    19,
       0,    20,     0,    21,   221,    22,    23,     0,     0,     0,
      24,     0,    26,    27,     0,     0,     0,     0,     0,     0,
       0,    25,     0,    26,    27,    93,    94,    95,    96,    97,
      98,    99,   100,   101,     0,   102,   103,   104,   105,   106,
     107,   108,   109,   110,   111,   112,   113,   114,   115,     0,
       0,   116,   117,   285,     2,     3,     0,     0,     0,     0,
       0,     0,     4,     0,     0,     0,     0,     0,     2,     3,
       0,     0,     0,     0,     0,     0,     4,     5,     6,     0,
       0,     7,     8,     9,     0,     0,     0,    11,     0,     0,
       0,     5,     6,     0,     0,     7,     8,     9,     0,   172,
      10,    11,     0,     0,    12,    13,    14,     0,     0,    15,
       0,   286,    16,    17,    18,    19,     0,    20,     0,    21,
       2,     3,    23,     0,     0,    26,    27,     0,     4,     0,
       0,     0,     0,     0,     0,   154,   155,   156,     0,    26,
      27,     0,     0,     5,     6,     0,     0,     7,     8,     9,
       0,     0,    10,    11,     0,     0,    12,    13,    14,     0,
       0,    15,    96,    97,    16,    17,    18,    19,     0,    20,
       0,    21,     2,     3,    23,   108,   109,   110,   111,     0,
       4,   114,   115,     0,     0,   116,   117,   173,   174,     0,
       0,    26,    27,     0,     0,     5,     6,     0,     0,     7,
       8,     9,     0,     0,    10,    11,     2,     3,    12,    13,
      14,     0,     0,    15,     4,     0,    16,    17,    18,    19,
       0,    20,     0,    21,     2,     3,    23,     0,     0,     5,
       6,     0,     4,     7,     8,     9,     0,     2,     3,    11,
       0,     0,     0,    26,    27,     4,     0,     5,     6,     0,
       0,     7,     8,     9,     0,     0,     0,    11,     0,     0,
       5,     6,     0,     0,     7,     8,     9,     0,     0,   128,
      11,   129,     0,     0,     0,     0,     0,    26,    27,     0,
       0,     0,     0,     2,     3,     0,     0,     0,     0,   208,
       0,     4,     0,     0,     0,    26,    27,     2,     3,     0,
       0,     0,   255,     0,     0,     4,     5,     6,    26,    27,
      50,     8,     9,     0,     0,     0,    11,     0,     0,     0,
       5,     6,     0,     0,     7,     8,     9,     0,     0,     0,
      11,     0,     0,     0,     0,     0,     0,     0,     0,     0,
      93,    94,    95,    96,    97,     0,     0,     0,     0,     0,
       0,     0,     0,     0,    26,    27,   108,   109,   110,   111,
     112,   113,   114,   115,     0,     0,   116,   117,    26,    27,
      93,    94,    95,    96,    97,    98,    99,   100,   101,     0,
     102,   103,   104,   105,   106,   107,   108,   109,   110,   111,
     112,   113,   114,   115,     0,     0,   116,   117,    93,    94,
      95,    96,    97,     0,     0,   100,   101,     0,   102,   103,
     104,   105,   106,   107,   108,   109,   110,   111,   112,   113,
     114,   115,     0,     0,   116,   117,    93,    94,    95,    96,
      97,     0,     0,     0,     0,     0,   102,   103,   104,   105,
     106,   107,   108,   109,   110,   111,   112,   113,   114,   115,
       0,     0,   116,   117,    94,    95,    96,    97,     0,     0,
       0,     0,     0,     0,     0,     0,     0,     0,     0,   108,
     109,   110,   111,   112,   113,   114,   115,     0,     0,   116,
     117
};

static const short yycheck[] =
{
       5,     6,    20,     2,     3,     4,    77,    12,     1,     1,
       1,    34,   144,    34,    10,   243,    21,    13,    14,    15,
      60,    34,   300,    34,     0,    34,    35,   320,    27,    72,
      28,    29,    36,   326,   312,     3,    79,    72,    73,    74,
      38,    34,    34,    34,   272,   338,    73,     4,    61,    67,
      73,    78,    70,    71,    80,    76,     5,     6,     3,    63,
      56,    57,    69,    59,    13,    73,   240,    76,    61,    61,
      61,    79,   246,    76,    77,   146,    73,     0,     1,    28,
      29,   152,     3,    32,    33,    34,    79,    78,    84,    38,
      72,    73,   132,    36,    93,    94,    95,    96,    97,    98,
      99,   100,   101,   102,   103,   104,   105,   106,   107,   108,
     109,   110,   111,   112,   113,    91,   248,   116,   117,   118,
      69,    73,    71,   122,   120,     3,    78,    76,    77,    79,
     148,   149,   128,    30,    31,    58,    38,   133,   134,   135,
      63,   159,    26,    27,    68,   141,    30,    31,   144,   145,
      39,    74,    72,    73,    74,    40,   227,    77,   163,    47,
     165,    55,     4,     5,     6,    72,    73,    74,   164,    44,
      45,    13,    64,    65,    66,    67,    47,    48,    79,    53,
      60,    72,    36,    73,    57,    36,    28,    29,    70,   260,
      32,    33,    34,    60,     3,     3,    38,     3,   269,    36,
     271,    70,    79,    36,    36,     3,   224,    79,    78,    36,
       0,   229,     0,    30,   210,   233,   308,   133,   236,   215,
      62,   292,   163,   294,    59,   221,   138,   138,   138,   138,
     226,   231,   281,    64,    76,    77,    78,   242,   336,    12,
     159,    -1,    -1,    -1,   262,    -1,    -1,    -1,   266,    -1,
     321,   322,   248,    -1,   250,   251,    -1,    -1,   234,   330,
      -1,   257,    -1,    -1,    -1,    -1,    -1,    -1,   264,    -1,
      -1,    -1,    -1,    -1,   279,   293,    -1,    -1,    -1,    -1,
      -1,     5,     6,    -1,   283,   303,    -1,   305,     1,    13,
      -1,    -1,     5,     6,   290,   300,    -1,    -1,    -1,    -1,
      13,   319,    -1,    -1,    28,    29,    -1,   312,    32,    33,
      34,    -1,    -1,   318,    38,    28,    29,    -1,    -1,    32,
      33,    34,    -1,    -1,    37,    38,   331,    -1,    41,    42,
      43,    -1,    -1,    46,    -1,    -1,    49,    50,    51,    52,
      -1,    54,    -1,    56,    68,    58,    59,    -1,    -1,    -1,
      63,    -1,    76,    77,    -1,    -1,    -1,    -1,    -1,    -1,
      -1,    74,    -1,    76,    77,     4,     5,     6,     7,     8,
       9,    10,    11,    12,    -1,    14,    15,    16,    17,    18,
      19,    20,    21,    22,    23,    24,    25,    26,    27,    -1,
      -1,    30,    31,     4,     5,     6,    -1,    -1,    -1,    -1,
      -1,    -1,    13,    -1,    -1,    -1,    -1,    -1,     5,     6,
      -1,    -1,    -1,    -1,    -1,    -1,    13,    28,    29,    -1,
      -1,    32,    33,    34,    -1,    -1,    -1,    38,    -1,    -1,
      -1,    28,    29,    -1,    -1,    32,    33,    34,    -1,    78,
      37,    38,    -1,    -1,    41,    42,    43,    -1,    -1,    46,
      -1,    62,    49,    50,    51,    52,    -1,    54,    -1,    56,
       5,     6,    59,    -1,    -1,    76,    77,    -1,    13,    -1,
      -1,    -1,    -1,    -1,    -1,    72,    73,    74,    -1,    76,
      77,    -1,    -1,    28,    29,    -1,    -1,    32,    33,    34,
      -1,    -1,    37,    38,    -1,    -1,    41,    42,    43,    -1,
      -1,    46,     7,     8,    49,    50,    51,    52,    -1,    54,
      -1,    56,     5,     6,    59,    20,    21,    22,    23,    -1,
      13,    26,    27,    -1,    -1,    30,    31,    72,    73,    -1,
      -1,    76,    77,    -1,    -1,    28,    29,    -1,    -1,    32,
      33,    34,    -1,    -1,    37,    38,     5,     6,    41,    42,
      43,    -1,    -1,    46,    13,    -1,    49,    50,    51,    52,
      -1,    54,    -1,    56,     5,     6,    59,    -1,    -1,    28,
      29,    -1,    13,    32,    33,    34,    -1,     5,     6,    38,
      -1,    -1,    -1,    76,    77,    13,    -1,    28,    29,    -1,
      -1,    32,    33,    34,    -1,    -1,    -1,    38,    -1,    -1,
      28,    29,    -1,    -1,    32,    33,    34,    -1,    -1,    68,
      38,    70,    -1,    -1,    -1,    -1,    -1,    76,    77,    -1,
      -1,    -1,    -1,     5,     6,    -1,    -1,    -1,    -1,    70,
      -1,    13,    -1,    -1,    -1,    76,    77,     5,     6,    -1,
      -1,    -1,    70,    -1,    -1,    13,    28,    29,    76,    77,
      32,    33,    34,    -1,    -1,    -1,    38,    -1,    -1,    -1,
      28,    29,    -1,    -1,    32,    33,    34,    -1,    -1,    -1,
      38,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
       4,     5,     6,     7,     8,    -1,    -1,    -1,    -1,    -1,
      -1,    -1,    -1,    -1,    76,    77,    20,    21,    22,    23,
      24,    25,    26,    27,    -1,    -1,    30,    31,    76,    77,
       4,     5,     6,     7,     8,     9,    10,    11,    12,    -1,
      14,    15,    16,    17,    18,    19,    20,    21,    22,    23,
      24,    25,    26,    27,    -1,    -1,    30,    31,     4,     5,
       6,     7,     8,    -1,    -1,    11,    12,    -1,    14,    15,
      16,    17,    18,    19,    20,    21,    22,    23,    24,    25,
      26,    27,    -1,    -1,    30,    31,     4,     5,     6,     7,
       8,    -1,    -1,    -1,    -1,    -1,    14,    15,    16,    17,
      18,    19,    20,    21,    22,    23,    24,    25,    26,    27,
      -1,    -1,    30,    31,     5,     6,     7,     8,    -1,    -1,
      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    20,
      21,    22,    23,    24,    25,    26,    27,    -1,    -1,    30,
      31
};
/* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
#line 3 "/usr/share/bison/bison.simple"

/* Skeleton output parser for bison,
   Copyright (C) 1984, 1989, 1990, 2000, 2001 Free Software Foundation, Inc.

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

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

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

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

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

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

#ifdef __cplusplus
# define YYSTD(x) std::x
#else
# define YYSTD(x) x
#endif

#if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)

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

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

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

/* A type that is properly aligned for any stack member.  */
union yyalloc
{
  short yyss;
  YYSTYPE yyvs;
# if YYLSP_NEEDED
  YYLTYPE yyls;
# endif
};

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

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

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

#endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */


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

#define yyerrok         (yyerrstatus = 0)
#define yyclearin (yychar = YYEMPTY)
#define YYEMPTY         -2
#define YYEOF           0
#define YYACCEPT  goto yyacceptlab
#define YYABORT   goto yyabortlab
#define YYERROR         goto yyerrlab1
/* Like YYERROR except do call yyerror.  This remains here temporarily
   to ease the transition to the new meaning of YYERROR, for GCC.
   Once GCC version 2 has supplanted version 1, this can go.  */
#define YYFAIL          goto yyerrlab
#define YYRECOVERING()  (!!yyerrstatus)
#define YYBACKUP(Token, Value)                              \
do                                              \
  if (yychar == YYEMPTY && yylen == 1)                      \
    {                                           \
      yychar = (Token);                               \
      yylval = (Value);                               \
      yychar1 = YYTRANSLATE (yychar);                       \
      YYPOPSTACK;                               \
      goto yybackup;                                  \
    }                                           \
  else                                                \
    {                                                 \
      yyerror ("syntax error: cannot back up");             \
      YYERROR;                                        \
    }                                           \
while (0)

#define YYTERROR  1
#define YYERRCODE 256


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

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

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


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

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


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

# ifndef YYFPRINTF
#  ifdef __cplusplus
#   include <cstdio>  /* INFRINGES ON USER NAME SPACE */
#  else
#   include <stdio.h> /* INFRINGES ON USER NAME SPACE */
#  endif
#  define YYFPRINTF YYSTD (fprintf)
# endif

# define YYDPRINTF(Args)                  \
do {                                \
  if (yydebug)                            \
    YYFPRINTF Args;                       \
} while (0)
/* Nonzero means print parse trace. [The following comment makes no
   sense to me.  Could someone clarify it?  --akim] Since this is
   uninitialized, it does not stop multiple parsers from coexisting.
   */
int yydebug;
#else /* !YYDEBUG */
# define YYDPRINTF(Args)
#endif /* !YYDEBUG */

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

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

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

#if YYMAXDEPTH == 0
# undef YYMAXDEPTH
#endif

#ifndef YYMAXDEPTH
# define YYMAXDEPTH 10000
#endif

#if ! defined (yyoverflow) && ! defined (yymemcpy)
# if __GNUC__ > 1       /* GNU C and GNU C++ define this.  */
#  define yymemcpy __builtin_memcpy
# else                        /* not GNU C or C++ */

/* This is the most reliable way to avoid incompatibilities
   in available built-in functions on various systems.  */
static void
#  if defined (__STDC__) || defined (__cplusplus)
yymemcpy (char *yyto, const char *yyfrom, YYSIZE_T yycount)
#  else
yymemcpy (yyto, yyfrom, yycount)
     char *yyto;
     const char *yyfrom;
     YYSIZE_T yycount;
#  endif
{
  register const char *yyf = yyfrom;
  register char *yyt = yyto;
  register YYSIZE_T yyi = yycount;

  while (yyi-- != 0)
    *yyt++ = *yyf++;
}
# endif
#endif

#ifdef YYERROR_VERBOSE

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

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

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

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

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

  return yyd - 1;
}
#  endif
# endif
#endif

#line 341 "/usr/share/bison/bison.simple"


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

#ifdef YYPARSE_PARAM
# ifdef __cplusplus
#  define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
#  define YYPARSE_PARAM_DECL
# else /* !__cplusplus */
#  define YYPARSE_PARAM_ARG YYPARSE_PARAM
#  define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
# endif /* !__cplusplus */
#else /* !YYPARSE_PARAM */
# define YYPARSE_PARAM_ARG
# define YYPARSE_PARAM_DECL
#endif /* !YYPARSE_PARAM */

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

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

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

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


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

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

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

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

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

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

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

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

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

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

  YYSIZE_T yystacksize = YYINITDEPTH;


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

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

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

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

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

  yyssp = yyss;
  yyvsp = yyvs;
#if YYLSP_NEEDED
  yylsp = yyls;
#endif
  goto yysetstate;

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

 yysetstate:
  *yyssp = yystate;

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

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

      /* Each stack pointer address is followed by the size of the
         data in use in that stack, in bytes.  */
# if YYLSP_NEEDED
      YYLTYPE *yyls1 = yyls;
      /* This used to be a conditional around just the two extra args,
         but that might be undefined if yyoverflow is a macro.  */
      yyoverflow ("parser stack overflow",
                &yyss1, yysize * sizeof (*yyssp),
                &yyvs1, yysize * sizeof (*yyvsp),
                &yyls1, yysize * sizeof (*yylsp),
                &yystacksize);
      yyls = yyls1;
# else
      yyoverflow ("parser stack overflow",
                &yyss1, yysize * sizeof (*yyssp),
                &yyvs1, yysize * sizeof (*yyvsp),
                &yystacksize);
# endif
      yyss = yyss1;
      yyvs = yyvs1;
      }
#else /* no yyoverflow */
      /* Extend the stack our own way.  */
      if (yystacksize >= YYMAXDEPTH)
      goto yyoverflowlab;
      yystacksize *= 2;
      if (yystacksize > YYMAXDEPTH)
      yystacksize = YYMAXDEPTH;

      {
      short *yyss1 = yyss;
      union yyalloc *yyptr =
        (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
      if (! yyptr)
        goto yyoverflowlab;
      YYSTACK_RELOCATE (short, yyss);
      YYSTACK_RELOCATE (YYSTYPE, yyvs);
# if YYLSP_NEEDED
      YYSTACK_RELOCATE (YYLTYPE, yyls);
# endif
# undef YYSTACK_RELOCATE
      if (yyss1 != yyssa)
        YYSTACK_FREE (yyss1);
      }
#endif /* no yyoverflow */

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

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

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

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

  goto yybackup;


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

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

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

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

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

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

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

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

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

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

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

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

  yyn = yytable[yyn];

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

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

  if (yyn == YYFINAL)
    YYACCEPT;

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

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

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

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

  yystate = yyn;
  goto yynewstate;


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


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

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

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

#if YYLSP_NEEDED
  /* Similarly for the default location.  Let the user run additional
     commands if for instance locations are ranges.  */
  yyloc = yylsp[1-yylen];
  YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
#endif

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

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

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

  switch (yyn) {

case 1:
#line 404 "parse.y"
{
                global_command = yyvsp[0].tree_statement_list_type;
                promptflag = 1;
                YYACCEPT;
              }
    break;
case 2:
#line 410 "parse.y"
{
                global_command = 0;
                promptflag = 1;
                YYABORT;
              }
    break;
case 3:
#line 416 "parse.y"
{ ABORT_PARSE; }
    break;
case 4:
#line 418 "parse.y"
{ ABORT_PARSE; }
    break;
case 5:
#line 422 "parse.y"
{ yyval.tree_statement_list_type = 0; }
    break;
case 6:
#line 424 "parse.y"
{ yyval.tree_statement_list_type = yyvsp[0].tree_statement_list_type; }
    break;
case 7:
#line 426 "parse.y"
{ yyval.tree_statement_list_type = yyvsp[-1].tree_statement_list_type; }
    break;
case 8:
#line 428 "parse.y"
{ yyval.tree_statement_list_type = yyvsp[-1].tree_statement_list_type; }
    break;
case 9:
#line 432 "parse.y"
{ yyerror ("parse error"); }
    break;
case 11:
#line 437 "parse.y"
{
                set_stmt_print_flag (yyvsp[-1].tree_statement_list_type, yyvsp[0].sep_type, false);
                yyval.tree_statement_list_type = yyvsp[-1].tree_statement_list_type;
              }
    break;
case 12:
#line 444 "parse.y"
{ yyval.tree_statement_list_type = new tree_statement_list (yyvsp[0].tree_statement_type); }
    break;
case 13:
#line 446 "parse.y"
{
                set_stmt_print_flag (yyvsp[-2].tree_statement_list_type, yyvsp[-1].sep_type, false);
                yyvsp[-2].tree_statement_list_type->append (yyvsp[0].tree_statement_type);
                yyval.tree_statement_list_type = yyvsp[-2].tree_statement_list_type;
              }
    break;
case 14:
#line 454 "parse.y"
{ yyval.tree_statement_list_type = new tree_statement_list (); }
    break;
case 15:
#line 456 "parse.y"
{ yyval.tree_statement_list_type = yyvsp[0].tree_statement_list_type; }
    break;
case 16:
#line 460 "parse.y"
{
                set_stmt_print_flag (yyvsp[-1].tree_statement_list_type, yyvsp[0].sep_type, true);
                yyval.tree_statement_list_type = yyvsp[-1].tree_statement_list_type;
              }
    break;
case 17:
#line 467 "parse.y"
{
                lexer_flags.beginning_of_function = 0;
                yyval.tree_statement_list_type = new tree_statement_list (yyvsp[0].tree_statement_type);
              }
    break;
case 18:
#line 472 "parse.y"
{
                set_stmt_print_flag (yyvsp[-2].tree_statement_list_type, yyvsp[-1].sep_type, true);
                yyvsp[-2].tree_statement_list_type->append (yyvsp[0].tree_statement_type);
                yyval.tree_statement_list_type = yyvsp[-2].tree_statement_list_type;
              }
    break;
case 19:
#line 480 "parse.y"
{ yyval.tree_statement_type = new tree_statement (yyvsp[0].tree_command_type); }
    break;
case 20:
#line 482 "parse.y"
{ yyval.tree_statement_type = new tree_statement (yyvsp[0].tree_expression_type); }
    break;
case 21:
#line 484 "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 22:
#line 492 "parse.y"
{
                if (! (yyval.tree_plot_command_type = make_plot_command (yyvsp[0].tok_val, 0, 0)))
                  ABORT_PARSE;
              }
    break;
case 23:
#line 497 "parse.y"
{
                if (! (yyval.tree_plot_command_type = make_plot_command (yyvsp[-1].tok_val, yyvsp[0].plot_limits_type, 0)))
                  ABORT_PARSE;
              }
    break;
case 24:
#line 502 "parse.y"
{
                if (! (yyval.tree_plot_command_type = make_plot_command (yyvsp[-1].tok_val, 0, yyvsp[0].subplot_list_type)))
                  ABORT_PARSE;
              }
    break;
case 25:
#line 507 "parse.y"
{
                if (! (yyval.tree_plot_command_type = make_plot_command (yyvsp[-2].tok_val, yyvsp[-1].plot_limits_type, yyvsp[0].subplot_list_type)))
                  ABORT_PARSE;
              }
    break;
case 26:
#line 514 "parse.y"
{ yyval.plot_limits_type = new plot_limits (yyvsp[0].plot_range_type); }
    break;
case 27:
#line 516 "parse.y"
{ yyval.plot_limits_type = new plot_limits (yyvsp[-1].plot_range_type, yyvsp[0].plot_range_type); }
    break;
case 28:
#line 518 "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 29:
#line 522 "parse.y"
{ yyval.plot_range_type = new plot_range (yyvsp[-3].tree_expression_type, yyvsp[-1].tree_expression_type); }
    break;
case 30:
#line 524 "parse.y"
{ yyval.plot_range_type = new plot_range (0, yyvsp[-1].tree_expression_type); }
    break;
case 31:
#line 526 "parse.y"
{ yyval.plot_range_type = new plot_range (yyvsp[-2].tree_expression_type, 0); }
    break;
case 32:
#line 528 "parse.y"
{ yyval.plot_range_type = new plot_range (); }
    break;
case 33:
#line 530 "parse.y"
{ yyval.plot_range_type = new plot_range (); }
    break;
case 34:
#line 534 "parse.y"
{ yyval.subplot_list_type = new subplot_list (yyvsp[0].subplot_type); }
    break;
case 35:
#line 536 "parse.y"
{
                yyvsp[-2].subplot_list_type->append (yyvsp[0].subplot_type);
                yyval.subplot_list_type = yyvsp[-2].subplot_list_type;
              }
    break;
case 36:
#line 543 "parse.y"
{ yyval.subplot_type = new subplot (yyvsp[0].tree_expression_type); }
    break;
case 37:
#line 545 "parse.y"
{ yyval.subplot_type = yyvsp[0].subplot_type->add_data (yyvsp[-1].tree_expression_type); }
    break;
case 38:
#line 549 "parse.y"
{
                subplot *tmp = new subplot ();
                yyval.subplot_type = tmp->add_clause (yyvsp[0].subplot_using_type);
              }
    break;
case 39:
#line 554 "parse.y"
{
                subplot *tmp = new subplot ();
                yyval.subplot_type = tmp->add_clause (yyvsp[0].tree_expression_type);
              }
    break;
case 40:
#line 559 "parse.y"
{
                subplot *tmp = new subplot ();
                yyval.subplot_type = tmp->add_clause (yyvsp[0].subplot_style_type);
              }
    break;
case 41:
#line 564 "parse.y"
{
                subplot *tmp = new subplot ();
                yyval.subplot_type = tmp->add_clause (yyvsp[0].subplot_axes_type);
              }
    break;
case 42:
#line 569 "parse.y"
{
                if (! (yyval.subplot_type = yyvsp[-1].subplot_type->add_clause (yyvsp[0].subplot_using_type)))
                  {
                  yyerror ("only one using option may be specified");
                  ABORT_PARSE;
                  }
              }
    break;
case 43:
#line 577 "parse.y"
{
                if (! (yyval.subplot_type = yyvsp[-1].subplot_type->add_clause (yyvsp[0].tree_expression_type)))
                  {
                  yyerror ("only one title option my be specified");
                  ABORT_PARSE;
                  }
              }
    break;
case 44:
#line 585 "parse.y"
{
                if (! (yyval.subplot_type = yyvsp[-1].subplot_type->add_clause (yyvsp[0].subplot_style_type)))
                  {
                  yyerror ("only one style option my be specified");
                  ABORT_PARSE;
                  }
              }
    break;
case 45:
#line 593 "parse.y"
{
                if (! (yyval.subplot_type = yyvsp[-1].subplot_type->add_clause (yyvsp[0].subplot_axes_type)))
                  {
                  yyerror ("only one axes option may be specified");
                  ABORT_PARSE;
                  }
              }
    break;
case 46:
#line 603 "parse.y"
{
                lexer_flags.in_plot_axes = 0;
                yyval.subplot_axes_type = new subplot_axes (yyvsp[0].tok_val->text ());
              }
    break;
case 47:
#line 610 "parse.y"
{
                lexer_flags.in_plot_using = 0;
                yyval.subplot_using_type = yyvsp[0].subplot_using_type;
              }
    break;
case 48:
#line 615 "parse.y"
{
                lexer_flags.in_plot_using = 0;
                yyval.subplot_using_type = yyvsp[-1].subplot_using_type->set_format (yyvsp[0].tree_expression_type);
              }
    break;
case 49:
#line 622 "parse.y"
{
                subplot_using *tmp = new subplot_using ();
                yyval.subplot_using_type = tmp->add_qualifier (yyvsp[0].tree_expression_type);
              }
    break;
case 50:
#line 627 "parse.y"
{ yyval.subplot_using_type = yyvsp[-2].subplot_using_type->add_qualifier (yyvsp[0].tree_expression_type); }
    break;
case 51:
#line 631 "parse.y"
{ yyval.tree_expression_type = yyvsp[0].tree_expression_type; }
    break;
case 52:
#line 635 "parse.y"
{ yyval.subplot_style_type = new subplot_style (yyvsp[0].tok_val->text ()); }
    break;
case 53:
#line 637 "parse.y"
{ yyval.subplot_style_type = new subplot_style (yyvsp[-1].tok_val->text (), yyvsp[0].tree_expression_type); }
    break;
case 54:
#line 639 "parse.y"
{ yyval.subplot_style_type = new subplot_style (yyvsp[-2].tok_val->text (), yyvsp[-1].tree_expression_type, yyvsp[0].tree_expression_type); }
    break;
case 55:
#line 643 "parse.y"
{ yyval.tree_expression_type = maybe_convert_to_ans_assign (yyvsp[0].tree_expression_type); }
    break;
case 56:
#line 647 "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 57:
#line 654 "parse.y"
{ yyval.tree_global_init_list_type = new tree_global_init_list (yyvsp[0].tree_global_type); }
    break;
case 58:
#line 656 "parse.y"
{
                yyvsp[-2].tree_global_init_list_type->append (yyvsp[0].tree_global_type);
                yyval.tree_global_init_list_type = yyvsp[-2].tree_global_init_list_type;
              }
    break;
case 59:
#line 662 "parse.y"
{ yyval.tree_global_type = new tree_global (yyvsp[0].tree_identifier_type); }
    break;
case 60:
#line 664 "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 62:
#line 674 "parse.y"
{
                if (Vwarn_comma_in_global_decl)
                  warning ("comma in global declaration not\
 interpreted as a command separator");
              }
    break;
case 63:
#line 682 "parse.y"
{ yyval.tree_command_type = yyvsp[0].tree_plot_command_type; }
    break;
case 64:
#line 684 "parse.y"
{ yyval.tree_command_type = yyvsp[0].tree_command_type; }
    break;
case 65:
#line 686 "parse.y"
{ yyval.tree_command_type = yyvsp[0].tree_global_command_type; }
    break;
case 66:
#line 688 "parse.y"
{ yyval.tree_command_type = yyvsp[0].tree_switch_command_type; }
    break;
case 67:
#line 690 "parse.y"
{ yyval.tree_command_type = yyvsp[0].tree_if_command_type; }
    break;
case 68:
#line 692 "parse.y"
{
                if (! (yyval.tree_command_type = make_unwind_command (yyvsp[-6].tok_val, yyvsp[-4].tree_statement_list_type, yyvsp[-1].tree_statement_list_type, yyvsp[0].tok_val)))
                  ABORT_PARSE;
              }
    break;
case 69:
#line 697 "parse.y"
{
                if (! (yyval.tree_command_type = make_try_command (yyvsp[-6].tok_val, yyvsp[-4].tree_statement_list_type, yyvsp[-1].tree_statement_list_type, yyvsp[0].tok_val)))
                  ABORT_PARSE;
              }
    break;
case 70:
#line 702 "parse.y"
{
                if (! (yyval.tree_command_type = make_while_command (yyvsp[-4].tok_val, yyvsp[-3].tree_expression_type, yyvsp[-1].tree_statement_list_type, yyvsp[0].tok_val)))
                  ABORT_PARSE;
              }
    break;
case 71:
#line 707 "parse.y"
{
                if (! (yyval.tree_command_type = make_for_command (yyvsp[-6].tok_val, yyvsp[-5].tree_index_expression_type, yyvsp[-3].tree_expression_type, yyvsp[-1].tree_statement_list_type, yyvsp[0].tok_val)))
                  ABORT_PARSE;
              }
    break;
case 72:
#line 713 "parse.y"
{
                if (! (yyval.tree_command_type = make_for_command (yyvsp[-9].tok_val, yyvsp[-6].tree_matrix_row_type, yyvsp[-3].tree_expression_type, yyvsp[-1].tree_statement_list_type, yyvsp[0].tok_val)))
                  ABORT_PARSE;
              }
    break;
case 73:
#line 718 "parse.y"
{
                if (! (yyval.tree_command_type = make_break_command (yyvsp[0].tok_val)))
                  ABORT_PARSE;
              }
    break;
case 74:
#line 723 "parse.y"
{
                if (! (yyval.tree_command_type = make_continue_command (yyvsp[0].tok_val)))
                  ABORT_PARSE;
              }
    break;
case 75:
#line 728 "parse.y"
{
                if (! (yyval.tree_command_type = make_return_command (yyvsp[0].tok_val)))
                  ABORT_PARSE;
              }
    break;
case 76:
#line 735 "parse.y"
{
                if (! (yyval.tree_if_command_type = finish_if_command (yyvsp[-2].tok_val, yyvsp[-1].tree_if_command_list_type, yyvsp[0].tok_val)))
                  ABORT_PARSE;
              }
    break;
case 77:
#line 742 "parse.y"
{ yyval.tree_if_command_list_type = yyvsp[0].tree_if_command_list_type; }
    break;
case 78:
#line 744 "parse.y"
{
                yyvsp[-1].tree_if_command_list_type->append (yyvsp[0].tree_if_clause_type);
                yyval.tree_if_command_list_type = yyvsp[-1].tree_if_command_list_type;
              }
    break;
case 79:
#line 751 "parse.y"
{ yyval.tree_if_command_list_type = start_if_command (yyvsp[-2].tree_expression_type, yyvsp[0].tree_statement_list_type); }
    break;
case 80:
#line 753 "parse.y"
{
                yyvsp[-1].tree_if_command_list_type->append (yyvsp[0].tree_if_clause_type);
                yyval.tree_if_command_list_type = yyvsp[-1].tree_if_command_list_type;
              }
    break;
case 81:
#line 760 "parse.y"
{ yyval.tree_if_clause_type = make_elseif_clause (yyvsp[-2].tree_expression_type, yyvsp[0].tree_statement_list_type); }
    break;
case 82:
#line 764 "parse.y"
{ yyval.tree_if_clause_type = new tree_if_clause (yyvsp[0].tree_statement_list_type); }
    break;
case 83:
#line 768 "parse.y"
{
                if (! (yyval.tree_switch_command_type = finish_switch_command (yyvsp[-4].tok_val, yyvsp[-3].tree_expression_type, yyvsp[-1].tree_switch_case_list_type, yyvsp[0].tok_val)))
                  ABORT_PARSE;
              }
    break;
case 84:
#line 775 "parse.y"
{ yyval.tree_switch_case_list_type = yyvsp[0].tree_switch_case_list_type; }
    break;
case 85:
#line 777 "parse.y"
{
                yyvsp[-1].tree_switch_case_list_type->append (yyvsp[0].tree_switch_case_type);
                yyval.tree_switch_case_list_type = yyvsp[-1].tree_switch_case_list_type;
              }
    break;
case 86:
#line 784 "parse.y"
{ yyval.tree_switch_case_list_type = new tree_switch_case_list (yyvsp[0].tree_switch_case_type); }
    break;
case 87:
#line 786 "parse.y"
{
                yyvsp[-1].tree_switch_case_list_type->append (yyvsp[0].tree_switch_case_type);
                yyval.tree_switch_case_list_type = yyvsp[-1].tree_switch_case_list_type;
              }
    break;
case 88:
#line 793 "parse.y"
{ yyval.tree_switch_case_type = make_switch_case (yyvsp[-2].tree_expression_type, yyvsp[0].tree_statement_list_type); }
    break;
case 89:
#line 797 "parse.y"
{ yyval.tree_switch_case_type = new tree_switch_case (yyvsp[0].tree_statement_list_type); }
    break;
case 90:
#line 801 "parse.y"
{ lexer_flags.maybe_screwed_again++; }
    break;
case 91:
#line 805 "parse.y"
{ yyval.tree_expression_type = yyvsp[0].tree_expression_type; }
    break;
case 92:
#line 807 "parse.y"
{
                yyerror ("invalid assignment to a number");
                yyval.tree_expression_type = 0;
                ABORT_PARSE;
              }
    break;
case 93:
#line 818 "parse.y"
{
                if (! (yyval.tree_expression_type = yyvsp[0].tree_expression_type))
                  ABORT_PARSE;
              }
    break;
case 94:
#line 825 "parse.y"
{ yyval.tree_expression_type = make_constant (NUM, yyvsp[0].tok_val); }
    break;
case 95:
#line 827 "parse.y"
{ yyval.tree_expression_type = make_constant (IMAG_NUM, yyvsp[0].tok_val); }
    break;
case 96:
#line 829 "parse.y"
{ yyval.tree_expression_type = make_constant (TEXT, yyvsp[0].tok_val); }
    break;
case 97:
#line 831 "parse.y"
{
                yyvsp[-1].tree_expression_type->mark_in_parens ();
                yyval.tree_expression_type = yyvsp[-1].tree_expression_type;
              }
    break;
case 98:
#line 836 "parse.y"
{ yyval.tree_expression_type = yyvsp[0].tree_index_expression_type; }
    break;
case 99:
#line 838 "parse.y"
{ yyval.tree_expression_type = yyvsp[0].tree_index_expression_type; }
    break;
case 100:
#line 840 "parse.y"
{ yyval.tree_expression_type = finish_colon_expression (yyvsp[0].tree_colon_expression_type); }
    break;
case 101:
#line 842 "parse.y"
{ yyval.tree_expression_type = yyvsp[0].tree_expression_type; }
    break;
case 102:
#line 844 "parse.y"
{ yyval.tree_expression_type = new tree_constant (Matrix ()); }
    break;
case 103:
#line 846 "parse.y"
{ yyval.tree_expression_type = new tree_constant (Matrix ()); }
    break;
case 104:
#line 848 "parse.y"
{ yyval.tree_expression_type = make_prefix_op (PLUS_PLUS, yyvsp[0].tree_identifier_type, yyvsp[-1].tok_val); }
    break;
case 105:
#line 850 "parse.y"
{ yyval.tree_expression_type = make_prefix_op (MINUS_MINUS, yyvsp[0].tree_identifier_type, yyvsp[-1].tok_val); }
    break;
case 106:
#line 852 "parse.y"
{ yyval.tree_expression_type = make_unary_op (EXPR_NOT, yyvsp[0].tree_expression_type, yyvsp[-1].tok_val); }
    break;
case 107:
#line 854 "parse.y"
{ yyval.tree_expression_type = yyvsp[0].tree_expression_type; }
    break;
case 108:
#line 856 "parse.y"
{ yyval.tree_expression_type = make_unary_op ('-', yyvsp[0].tree_expression_type, yyvsp[-1].tok_val); }
    break;
case 109:
#line 858 "parse.y"
{ yyval.tree_expression_type = make_simple_assignment (yyvsp[-2].tree_index_expression_type, yyvsp[-1].tok_val, yyvsp[0].tree_expression_type); }
    break;
case 110:
#line 860 "parse.y"
{
                if (! (yyval.tree_expression_type = make_multi_val_ret (yyvsp[-3].tree_matrix_row_type, yyvsp[0].tree_expression_type, yyvsp[-1].tok_val)))
                  ABORT_PARSE;
              }
    break;
case 111:
#line 865 "parse.y"
{ yyval.tree_expression_type = make_postfix_op (PLUS_PLUS, yyvsp[-1].tree_identifier_type, yyvsp[0].tok_val); }
    break;
case 112:
#line 867 "parse.y"
{ yyval.tree_expression_type = make_postfix_op (MINUS_MINUS, yyvsp[-1].tree_identifier_type, yyvsp[0].tok_val); }
    break;
case 113:
#line 869 "parse.y"
{ yyval.tree_expression_type = make_unary_op (QUOTE, yyvsp[-1].tree_expression_type, yyvsp[0].tok_val); }
    break;
case 114:
#line 871 "parse.y"
{ yyval.tree_expression_type = make_unary_op (TRANSPOSE, yyvsp[-1].tree_expression_type, yyvsp[0].tok_val); }
    break;
case 115:
#line 873 "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 116:
#line 875 "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 117:
#line 877 "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 118:
#line 879 "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 119:
#line 881 "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 120:
#line 883 "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 121:
#line 885 "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 122:
#line 887 "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 123:
#line 889 "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 124:
#line 891 "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 125:
#line 893 "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 126:
#line 895 "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 127:
#line 897 "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 128:
#line 899 "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 129:
#line 901 "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 130:
#line 903 "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 131:
#line 905 "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 132:
#line 907 "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 133:
#line 909 "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 134:
#line 911 "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 135:
#line 913 "parse.y"
{ yyval.tree_expression_type = make_boolean_op (EXPR_AND_AND, yyvsp[-2].tree_expression_type, yyvsp[-1].tok_val, yyvsp[0].tree_expression_type); }
    break;
case 136:
#line 915 "parse.y"
{ yyval.tree_expression_type = make_boolean_op (EXPR_OR_OR, yyvsp[-2].tree_expression_type, yyvsp[-1].tok_val, yyvsp[0].tree_expression_type); }
    break;
case 137:
#line 919 "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 138:
#line 924 "parse.y"
{
                if (! (yyval.tree_colon_expression_type = yyvsp[-2].tree_colon_expression_type->chain (yyvsp[0].tree_expression_type)))
                  ABORT_PARSE;
              }
    break;
case 139:
#line 931 "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 140:
#line 938 "parse.y"
{
                tree_constant *tmp = make_constant (TEXT, yyvsp[0].tok_val);
                yyval.tree_argument_list_type = new tree_argument_list (tmp);
              }
    break;
case 141:
#line 943 "parse.y"
{
                tree_constant *tmp = make_constant (TEXT, yyvsp[0].tok_val);
                yyvsp[-1].tree_argument_list_type->append (tmp);
                yyval.tree_argument_list_type = yyvsp[-1].tree_argument_list_type;
              }
    break;
case 142:
#line 953 "parse.y"
{ curr_sym_tab = global_sym_tab; }
    break;
case 143:
#line 957 "parse.y"
{ lexer_flags.looking_at_return_list = 1; }
    break;
case 144:
#line 961 "parse.y"
{ curr_sym_tab = tmp_local_sym_tab; }
    break;
case 145:
#line 965 "parse.y"
{ lexer_flags.maybe_screwed = 0; }
    break;
case 146:
#line 969 "parse.y"
{ lexer_flags.maybe_screwed = 1; }
    break;
case 147:
#line 973 "parse.y"
{
                curr_sym_tab = top_level_sym_tab;
                lexer_flags.defining_func = 0;
                yyval.tree_command_type = 0;
              }
    break;
case 148:
#line 979 "parse.y"
{
                curr_sym_tab = top_level_sym_tab;
                lexer_flags.defining_func = 0;
                yyval.tree_command_type = 0;
              }
    break;
case 149:
#line 987 "parse.y"
{ yyval.tree_function_type = finish_function_def (yyvsp[-4].tok_val, yyvsp[0].tree_function_type); }
    break;
case 150:
#line 989 "parse.y"
{ yyval.tree_function_type = finish_function_def (yyvsp[-3].tree_parameter_list_type, yyvsp[0].tree_function_type); }
    break;
case 152:
#line 996 "parse.y"
{
                lexer_flags.looking_at_return_list = 0;
                yyval.tree_parameter_list_type = new tree_parameter_list ();
              }
    break;
case 153:
#line 1001 "parse.y"
{
                lexer_flags.looking_at_return_list = 0;
                tree_parameter_list *tmp = new tree_parameter_list ();
                tmp->mark_varargs_only ();
                yyval.tree_parameter_list_type = tmp;
              }
    break;
case 154:
#line 1008 "parse.y"
{
                lexer_flags.looking_at_return_list = 0;
                yyval.tree_parameter_list_type = yyvsp[-1].tree_parameter_list_type;
              }
    break;
case 155:
#line 1013 "parse.y"
{
                lexer_flags.looking_at_return_list = 0;
                yyvsp[-3].tree_parameter_list_type->mark_varargs ();
                yyval.tree_parameter_list_type = yyvsp[-3].tree_parameter_list_type;
              }
    break;
case 156:
#line 1021 "parse.y"
{ yyval.tree_parameter_list_type = new tree_parameter_list (yyvsp[0].tree_identifier_type); }
    break;
case 157:
#line 1023 "parse.y"
{
                yyerror ("invalid function return list");
                yyval.tree_parameter_list_type = 0;
                ABORT_PARSE;
              }
    break;
case 158:
#line 1029 "parse.y"
{
                yyvsp[-2].tree_parameter_list_type->append (yyvsp[0].tree_identifier_type);
                yyval.tree_parameter_list_type = yyvsp[-2].tree_parameter_list_type;
              }
    break;
case 159:
#line 1036 "parse.y"
{
                if (! (yyval.tree_function_type = frob_function_def (yyvsp[-3].tree_identifier_type, yyvsp[0].tree_function_type)))
                  ABORT_PARSE;
              }
    break;
case 160:
#line 1043 "parse.y"
{ yyval.tree_function_type = start_function_def (yyvsp[-3].tree_parameter_list_type, yyvsp[-1].tree_statement_list_type); }
    break;
case 161:
#line 1045 "parse.y"
{ yyval.tree_function_type = start_function_def (0, yyvsp[-1].tree_statement_list_type); }
    break;
case 162:
#line 1049 "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 163:
#line 1057 "parse.y"
{
                if (! (reading_fcn_file || reading_script_file))
                  YYABORT;
              }
    break;
case 164:
#line 1064 "parse.y"
{
                lexer_flags.looking_at_indirect_ref = 0;
                yyval.tree_indirect_ref_type = yyvsp[0].tree_indirect_ref_type;
              }
    break;
case 165:
#line 1070 "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 166:
#line 1075 "parse.y"
{ lexer_flags.looking_at_indirect_ref = 1; }
    break;
case 167:
#line 1076 "parse.y"
{ yyval.tree_indirect_ref_type = new tree_indirect_ref (yyvsp[-3].tree_indirect_ref_type, yyvsp[0].tok_val->text ()); }
    break;
case 168:
#line 1080 "parse.y"
{ yyval.tree_index_expression_type = make_index_expression (yyvsp[0].tree_indirect_ref_type, 0); }
    break;
case 169:
#line 1082 "parse.y"
{ yyval.tree_index_expression_type = make_index_expression (yyvsp[-2].tree_indirect_ref_type, 0); }
    break;
case 170:
#line 1084 "parse.y"
{ yyval.tree_index_expression_type = make_index_expression (yyvsp[-3].tree_indirect_ref_type, yyvsp[-1].tree_argument_list_type); }
    break;
case 171:
#line 1086 "parse.y"
{
                yyerror ("use `(\' and `)\' as index operators, not\
 `[\' and `]\'"); 
                yyval.tree_index_expression_type = 0;
                ABORT_PARSE;
              }
    break;
case 172:
#line 1095 "parse.y"
{ lexer_flags.looking_at_parameter_list = 1; }
    break;
case 173:
#line 1099 "parse.y"
{ lexer_flags.looking_at_parameter_list = 0; }
    break;
case 174:
#line 1103 "parse.y"
{
                lexer_flags.quote_is_transpose = 0;
                yyval.tree_parameter_list_type = 0;
              }
    break;
case 175:
#line 1108 "parse.y"
{
                lexer_flags.quote_is_transpose = 0;
                tree_parameter_list *tmp = new tree_parameter_list ();
                tmp->mark_varargs_only ();
                yyval.tree_parameter_list_type = tmp;
              }
    break;
case 176:
#line 1115 "parse.y"
{
                lexer_flags.quote_is_transpose = 0;
                yyvsp[-1].tree_parameter_list_type->mark_as_formal_parameters ();
                yyval.tree_parameter_list_type = yyvsp[-1].tree_parameter_list_type;
              }
    break;
case 177:
#line 1121 "parse.y"
{
                lexer_flags.quote_is_transpose = 0;
                yyvsp[-3].tree_parameter_list_type->mark_as_formal_parameters ();
                yyvsp[-3].tree_parameter_list_type->mark_varargs ();
                yyval.tree_parameter_list_type = yyvsp[-3].tree_parameter_list_type;
              }
    break;
case 178:
#line 1130 "parse.y"
{ yyval.tree_parameter_list_type = new tree_parameter_list (yyvsp[0].tree_identifier_type); }
    break;
case 179:
#line 1132 "parse.y"
{
                yyvsp[-2].tree_parameter_list_type->append (yyvsp[0].tree_identifier_type);
                yyval.tree_parameter_list_type = yyvsp[-2].tree_parameter_list_type;
              }
    break;
case 180:
#line 1137 "parse.y"
{
                yyerror ("invalid parameter list");
                yyval.tree_parameter_list_type = 0;
                ABORT_PARSE;
              }
    break;
case 181:
#line 1143 "parse.y"
{
                yyerror ("invalid parameter list");
                yyval.tree_parameter_list_type = 0;
                ABORT_PARSE;
              }
    break;
case 182:
#line 1151 "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 183:
#line 1158 "parse.y"
{
                tree_constant *colon =
                  new tree_constant (tree_constant::magic_colon_t);
                yyval.tree_argument_list_type = new tree_argument_list (colon);
              }
    break;
case 184:
#line 1164 "parse.y"
{ yyval.tree_argument_list_type = new tree_argument_list (yyvsp[0].tree_expression_type); }
    break;
case 185:
#line 1166 "parse.y"
{
                tree_constant *all_va_args =
                  new tree_constant (tree_constant::all_va_args_t);
                yyval.tree_argument_list_type = new tree_argument_list (all_va_args);
              }
    break;
case 186:
#line 1172 "parse.y"
{
                tree_constant *colon =
                  new tree_constant (tree_constant::magic_colon_t);
                yyvsp[-2].tree_argument_list_type->append (colon);
                yyval.tree_argument_list_type = yyvsp[-2].tree_argument_list_type;
              }
    break;
case 187:
#line 1179 "parse.y"
{
                yyvsp[-2].tree_argument_list_type->append (yyvsp[0].tree_expression_type);
                yyval.tree_argument_list_type = yyvsp[-2].tree_argument_list_type;
              }
    break;
case 188:
#line 1184 "parse.y"
{
                tree_constant *all_va_args =
                  new tree_constant (tree_constant::all_va_args_t);
                yyvsp[-2].tree_argument_list_type->append (all_va_args);
                yyval.tree_argument_list_type = yyvsp[-2].tree_argument_list_type;
              }
    break;
case 189:
#line 1193 "parse.y"
{ yyval.tree_expression_type = finish_matrix (yyvsp[-1].tree_matrix_type); }
    break;
case 190:
#line 1197 "parse.y"
{ yyval.tree_matrix_type = yyvsp[0].tree_matrix_type; }
    break;
case 191:
#line 1199 "parse.y"
{ yyval.tree_matrix_type = yyvsp[-1].tree_matrix_type; }
    break;
case 192:
#line 1203 "parse.y"
{ yyval.tree_matrix_type = new tree_matrix (yyvsp[0].tree_matrix_row_type); }
    break;
case 193:
#line 1205 "parse.y"
{
                yyvsp[-2].tree_matrix_type->append (yyvsp[0].tree_matrix_row_type);
                yyval.tree_matrix_type = yyvsp[-2].tree_matrix_type;
              }
    break;
case 194:
#line 1212 "parse.y"
{ yyval.tree_matrix_row_type = yyvsp[0].tree_matrix_row_type; }
    break;
case 195:
#line 1214 "parse.y"
{ yyval.tree_matrix_row_type = yyvsp[-1].tree_matrix_row_type; }
    break;
case 196:
#line 1218 "parse.y"
{ yyval.tree_matrix_row_type = new tree_matrix_row (yyvsp[0].tree_expression_type); }
    break;
case 197:
#line 1220 "parse.y"
{
                yyvsp[-2].tree_matrix_row_type->append (yyvsp[0].tree_expression_type);
                yyval.tree_matrix_row_type = yyvsp[-2].tree_matrix_row_type;
              }
    break;
case 198:
#line 1227 "parse.y"
{ yyval.sep_type = ','; }
    break;
case 199:
#line 1229 "parse.y"
{ yyval.sep_type = ';'; }
    break;
case 200:
#line 1231 "parse.y"
{ yyval.sep_type = yyvsp[-1].sep_type; }
    break;
case 201:
#line 1233 "parse.y"
{ yyval.sep_type = yyvsp[-1].sep_type; }
    break;
case 202:
#line 1237 "parse.y"
{ yyval.sep_type = 0; }
    break;
case 203:
#line 1239 "parse.y"
{ yyval.sep_type = yyvsp[0].sep_type; }
    break;
case 204:
#line 1243 "parse.y"
{ yyval.sep_type = ','; }
    break;
case 205:
#line 1245 "parse.y"
{ yyval.sep_type = ';'; }
    break;
case 206:
#line 1247 "parse.y"
{ yyval.sep_type = '\n'; }
    break;
case 207:
#line 1249 "parse.y"
{ yyval.sep_type = yyvsp[-1].sep_type; }
    break;
case 208:
#line 1251 "parse.y"
{ yyval.sep_type = yyvsp[-1].sep_type; }
    break;
case 209:
#line 1253 "parse.y"
{ yyval.sep_type = yyvsp[-1].sep_type; }
    break;
case 210:
#line 1257 "parse.y"
{ yyval.sep_type = 0; }
    break;
case 211:
#line 1259 "parse.y"
{ yyval.sep_type = yyvsp[0].sep_type; }
    break;
}

#line 727 "/usr/share/bison/bison.simple"

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

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

  *++yyvsp = yyval;
#if YYLSP_NEEDED
  *++yylsp = yyloc;
#endif

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

  yyn = yyr1[yyn];

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

  goto yynewstate;


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

#ifdef YYERROR_VERBOSE
      yyn = yypact[yystate];

      if (yyn > YYFLAG && yyn < YYLAST)
      {
        YYSIZE_T yysize = 0;
        char *yymsg;
        int yyx, yycount;

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

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


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

      /* return failure if at end of input */
      if (yychar == YYEOF)
      YYABORT;
      YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
              yychar, yytname[yychar1]));
      yychar = YYEMPTY;
    }

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

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

  goto yyerrhandle;


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

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


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

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

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

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

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

  if (yyn == YYFINAL)
    YYACCEPT;

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

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

  yystate = yyn;
  goto yynewstate;


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

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

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

yyreturn:
#ifndef yyoverflow
  if (yyss != yyssa)
    YYSTACK_FREE (yyss);
#endif
  return yyresult;
}
#line 1262 "parse.y"


// Generic error messages.

static void
yyerror (char *s)
{
  int err_col = current_input_column - 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_full_name;
  else
    output_buf << "parse error:";

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

  output_buf << "\n\n";

  if (! current_input_line.empty ())
    {
      size_t len = current_input_line.length ();

      if (current_input_line[len-1] == '\n')
        current_input_line.resize (len-1);

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

      output_buf << ">>> " << current_input_line << "\n";

      if (err_col == 0)
      err_col = len;

      for (int i = 0; i < err_col + 3; i++)
      output_buf << " ";

      output_buf << "^";
    }

  output_buf << "\n" << ends;

  char *msg = output_buf.str ();

  parse_error ("%s", 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;

    case token::unwind_protect_end:
      error (fmt, type, "end_unwind_protect", 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::try_catch_end:
        end_error ("try", ettype, l, c);
        break;

      case token::switch_end:
        end_error ("switch", ettype, l, c);
        break;

      case token::unwind_protect_end:
        end_error ("unwind_protect", 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 built-in variable ans.
//
// Need to make sure that the expression is not already an identifier
// that has a name, or an assignment expression.
//
// Note that an expression can not be just an identifier now -- it
// must at least be an index expression (see the definition of the
// non-terminal variable above).

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
    {
      // XXX FIXME XXX -- making ans_id static, passing its address to
      // tree_simple_assignment_expression along with a flag to not
      // delete it seems to create a memory leak.  Hmm.

      static symbol_record *sr = global_sym_tab->lookup ("ans", 1, 0);
      tree_identifier *ans_id = new tree_identifier (sr);

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

      return new tree_simple_assignment_expression (ans_id, expr, 0, 1, l, c);
    }
}

// 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 (Vwarn_assign_as_truth_value
      && expr->is_assignment_expression ()
      && expr->is_in_parens () < 2)
    {
      warning ("suggest parenthesis around assignment used as truth value");
    }
}

// Maybe print a warning about switch labels that aren't constants.

static void
maybe_warn_variable_switch_label (tree_expression *expr)
{
  if (Vwarn_variable_switch_label && ! expr->is_constant ())
    {
      warning ("variable switch label");
    }
}

// Create a plot command.

static tree_plot_command *
make_plot_command (token *tok, plot_limits *range, subplot_list *list)
{
  if (range)
    {
      if (tok->pttype () == token::replot)
      {
        yyerror ("cannot specify new ranges with replot");
        return 0;
      }
    }
  else if (! list && tok->pttype () != token::replot)
    {
      yyerror ("must have something to plot");
      return 0;
    }

  lexer_flags.plotting = 0;
  lexer_flags.past_plot_range = 0;
  lexer_flags.in_plot_range = 0;
  lexer_flags.in_plot_using = 0;
  lexer_flags.in_plot_style = 0;
  
  return new tree_plot_command (list, range, tok->pttype ());
}

static tree_expression *
fold (tree_binary_expression *e)
{
  tree_expression *retval = e;

  begin_unwind_frame ("fold_binary_expression");

  unwind_protect_int (error_state);

  tree_expression *op1 = e->lhs ();
  tree_expression *op2 = e->rhs ();

  if (op1->is_constant () && op2->is_constant ())
    {
      octave_value tmp = e->eval (0);

      if (! error_state)
      {
        tree_constant *tc_retval = new tree_constant (tmp);

        ostrstream buf;

        tree_print_code tpc (buf);

        e->accept (tpc);

        buf << ends;

        char *s = buf.str ();

        tc_retval->stash_original_text (s);

        delete [] s;

        delete e;

        retval = tc_retval;
      }
    }

  run_unwind_frame ("fold_binary_expression");

  return retval;
}

static tree_expression *
fold (tree_unary_expression *e)
{
  tree_expression *retval = e;

  begin_unwind_frame ("fold_unary_expression");

  unwind_protect_int (error_state);

  tree_expression *op1 = e->operand ();

  if (op1->is_constant ())
    {
      octave_value tmp = e->eval (0);

      if (! error_state)
      {
        tree_constant *tc_retval = new tree_constant (tmp);

        ostrstream buf;

        tree_print_code tpc (buf);

        e->accept (tpc);

        buf << ends;

        char *s = buf.str ();

        tc_retval->stash_original_text (s);

        delete [] s;

        delete e;

        retval = tc_retval;
      }
    }

  run_unwind_frame ("fold_unary_expression");

  return retval;
}

// Finish building a range.

static tree_expression *
finish_colon_expression (tree_colon_expression *e)
{
  tree_expression *retval = e;

  begin_unwind_frame ("finish_colon_expression");

  unwind_protect_int (error_state);

  tree_expression *base = e->base ();
  tree_expression *limit = e->limit ();
  tree_expression *incr = e->increment ();

  if (base->is_constant () && limit->is_constant ()
      && (! incr || (incr && incr->is_constant ())))
    {
      octave_value tmp = e->eval (0);

      if (! error_state)
      {
        tree_constant *tc_retval = new tree_constant (tmp);

        ostrstream buf;

        tree_print_code tpc (buf);

        e->accept (tpc);

        buf << ends;

        char *s = buf.str ();

        tc_retval->stash_original_text (s);

        delete [] s;

        delete e;

        retval = tc_retval;
      }
    }

  run_unwind_frame ("finish_colon_expression");

  return retval;
}

// Make a constant.

static tree_constant *
make_constant (int op, token *tok_val)
{
  int l = tok_val->line ();
  int c = tok_val->column ();

  tree_constant *retval;

  switch (op)
    {
    case NUM:
      {
      retval = new tree_constant (tok_val->number (), l, c);
      retval->stash_original_text (tok_val->text_rep ());
      }
      break;

    case IMAG_NUM:
      {
      Complex C (0.0, tok_val->number ());
      retval = new tree_constant (C, l, c);
      retval->stash_original_text (tok_val->text_rep ());
      }
      break;

    case TEXT:
      retval = new tree_constant (tok_val->text (), l, c);
      break;

    default:
      panic_impossible ();
      break;
    }

  return retval;
}

// Build a binary expression.

static tree_expression *
make_binary_op (int op, tree_expression *op1, token *tok_val,
            tree_expression *op2)
{
  tree_binary_expression::type t;

  switch (op)
    {
    case POW:
      t = tree_binary_expression::power;
      break;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    default:
      panic_impossible ();
      break;
    }

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

  tree_binary_expression *e
    = new tree_binary_expression (op1, op2, l, c, t);

  return fold (e);
}

// Build a boolean expression.

static tree_expression *
make_boolean_op (int op, tree_expression *op1, token *tok_val,
             tree_expression *op2)
{
  tree_boolean_expression::type t;

  switch (op)
    {
    case EXPR_AND_AND:
      t = tree_boolean_expression::and;
      break;

    case EXPR_OR_OR:
      t = tree_boolean_expression::or;
      break;

    default:
      panic_impossible ();
      break;
    }

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

  tree_boolean_expression *e
    = new tree_boolean_expression (op1, op2, l, c, t);

  return fold (e);
}

// Build a prefix expression.

static tree_expression *
make_prefix_op (int op, tree_identifier *op1, token *tok_val)
{
  tree_prefix_expression::type t;

  switch (op)
    {
    case PLUS_PLUS:
      t = tree_prefix_expression::increment;
      break;

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

    default:
      panic_impossible ();
      break;
    }

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

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

// Build a postfix expression.

static tree_expression *
make_postfix_op (int op, tree_identifier *op1, token *tok_val)
{
  tree_postfix_expression::type t;

  switch (op)
    {
    case PLUS_PLUS:
      t = tree_postfix_expression::increment;
      break;

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

    default:
      panic_impossible ();
      break;
    }

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

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

// Build a unary expression.

static tree_expression *
make_unary_op (int op, tree_expression *op1, token *tok_val)
{
  tree_unary_expression::type t;

  switch (op)
    {
    case QUOTE:
      t = tree_unary_expression::hermitian;
      break;

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

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

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

    default:
      panic_impossible ();
      break;
    }

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

  tree_unary_expression *e
    = new tree_unary_expression (op1, l, c, t);

  return fold (e);
}

// Build an unwind-protect command.

static tree_command *
make_unwind_command (token *unwind_tok, tree_statement_list *body,
                 tree_statement_list *cleanup, token *end_tok)
{
  tree_command *retval = 0;

  if (! check_end (end_tok, token::unwind_protect_end))
    {
      int l = unwind_tok->line ();
      int c = unwind_tok->column ();

      retval = new tree_unwind_protect_command (body, cleanup, l, c);
    }

  return retval;
}

// Build a try-catch command.

static tree_command *
make_try_command (token *try_tok, tree_statement_list *body,
              tree_statement_list *cleanup, token *end_tok)
{
  tree_command *retval = 0;

  if (! check_end (end_tok, token::try_catch_end))
    {
      int l = try_tok->line ();
      int c = try_tok->column ();

      retval = new tree_try_catch_command (body, cleanup, l, c);
    }

  return retval;
}

// Build a while command.

static tree_command *
make_while_command (token *while_tok, tree_expression *expr,
                tree_statement_list *body, token *end_tok)
{
  tree_command *retval = 0;

  maybe_warn_assign_as_truth_value (expr);

  if (! check_end (end_tok, token::while_end))
    {
      lexer_flags.looping--;

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

      retval = new tree_while_command (expr, body, l, c);
    }

  return retval;
}

// Build a for command.

static tree_command *
make_for_command (token *for_tok, tree_index_expression *var,
              tree_expression *expr, tree_statement_list *body,
              token *end_tok)
{
  tree_command *retval = 0;

  if (! check_end (end_tok, token::for_end))
    {
      lexer_flags.looping--;

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

      retval = new tree_for_command (var, expr, body, l, c);
    }

  return retval;
}

// Build a for command a different way.

static tree_command *
make_for_command (token *for_tok, tree_matrix_row *mr,
              tree_expression *expr, tree_statement_list *body,
              token *end_tok)
{
  tree_command *retval = 0;

  if (! check_end (end_tok, token::for_end))
    {
      lexer_flags.looping--;

      tree_return_list *id_list = mr->to_return_list ();

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

      retval = new tree_for_command (id_list, expr, body, l, c);
    }

  return retval;
}

// Build a break command.

static tree_command *
make_break_command (token *break_tok)
{
  tree_command *retval = 0;

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

  if (lexer_flags.looping || lexer_flags.defining_func || reading_script_file)
    retval = new tree_break_command (l, c);
  else
    retval = new tree_no_op_command ("break", l, c);

  return retval;
}

// Build a continue command.

static tree_command *
make_continue_command (token *continue_tok)
{
  tree_command *retval = 0;

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

  if (lexer_flags.looping)
    retval = new tree_continue_command (l, c);
  else
    retval = new tree_no_op_command ("continue", l, c);

  return retval;
}

// Build a return command.

static tree_command *
make_return_command (token *return_tok)
{
  tree_command *retval = 0;

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

//  if (lexer_flags.defining_func || reading_script_file)
    retval = new tree_return_command (l, c);
//  else
//    retval = new tree_no_op_command ("return", l, c);

  return retval;
}

// Start an if command.

static tree_if_command_list *
start_if_command (tree_expression *expr, tree_statement_list *list)
{
  maybe_warn_assign_as_truth_value (expr);

  tree_if_clause *t = new tree_if_clause (expr, list);

  return new tree_if_command_list (t);
}

// Finish an if command.

static tree_if_command *
finish_if_command (token *if_tok, tree_if_command_list *list,
               token *end_tok)
{
  tree_if_command *retval = 0;

  if (! check_end (end_tok, token::if_end))
    {
      int l = if_tok->line ();
      int c = if_tok->column ();

      retval = new tree_if_command (list, l, c);
    }

  return retval;
}

// Build an elseif clause.

static tree_if_clause *
make_elseif_clause (tree_expression *expr, tree_statement_list *list)
{
  maybe_warn_assign_as_truth_value (expr);

  return new tree_if_clause (expr, list);
}

// Finish a switch command.

static tree_switch_command *
finish_switch_command (token *switch_tok, tree_expression *expr,
                   tree_switch_case_list *list, token *end_tok)
{
  tree_switch_command *retval = 0;

  if (! check_end (end_tok, token::switch_end))
    {
      int l = switch_tok->line ();
      int c = switch_tok->column ();

      retval = new tree_switch_command (expr, list, l, c);
    }

  return retval;
}

// Build a switch case.

static tree_switch_case *
make_switch_case (tree_expression *expr, tree_statement_list *list)
{
  maybe_warn_variable_switch_label (expr);

  return new tree_switch_case (expr, list);
}

// Build an assignment to a variable.

static tree_expression *
make_simple_assignment (tree_index_expression *var, token *eq_tok,
                  tree_expression *expr)
{
  int l = eq_tok->line ();
  int c = eq_tok->column ();

  return new tree_simple_assignment_expression (var, expr, 0, 0, l, c);
}

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

static tree_expression *
make_multi_val_ret (tree_matrix_row *mr, tree_expression *rhs, token *eq_tok)
{
// 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;

  lexer_flags.maybe_screwed_again--;

  tree_return_list *id_list = mr->to_return_list ();

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

      if (list_len == 1)
      {
        tree_index_expression *lhs = id_list->remove_front ();

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

        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;

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

            retval = new tree_multi_assignment_expression (id_list, t,
                                               0, 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;
}

// Begin defining a function.

static tree_function *
start_function_def (tree_parameter_list *param_list,
                tree_statement_list *body)
{
  body->mark_as_function_body ();

  tree_function *fcn = new tree_function (body, curr_sym_tab);

  fcn->define_param_list (param_list);

  return fcn;
}

// Do most of the work for defining a function.

static tree_function *
frob_function_def (tree_identifier *id, tree_function *fcn)
{
  string id_name = id->name ();

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

  fcn->stash_function_name (id_name);

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

        global_sym_tab->rename (id_name, curr_fcn_file_name);

        if (error_state)
          return 0;

        id_name = id->name ();
      }

      time_t now = time (0);

      fcn->stash_function_name (id_name);
      fcn->stash_fcn_file_name ();
      fcn->stash_fcn_file_time (now);
      fcn->mark_as_system_fcn_file ();

      if (Vwarn_future_time_stamp)
      {
        string nm = fcn->fcn_file_name ();

        file_stat fs (nm);

        if (fs && fs.is_newer (now))
          warning ("time stamp for `%s' is in the future", nm.c_str ());
      }
    }
  else if (! (input_from_tmp_history_file || input_from_startup_file)
         && reading_script_file
         && curr_fcn_file_name == id_name)
    {
      warning ("function `%s' defined within script file `%s'",
             id_name.c_str (), curr_fcn_file_full_name.c_str ());
    }

  top_level_sym_tab->clear (id_name);

  id->define (fcn);

  id->document (help_buf);

  return fcn;
}

// Finish defining a function.

static tree_function *
finish_function_def (token *var, tree_function *fcn)
{
  symbol_record *sr = var->sym_rec ();

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

  tree_identifier *tmp = new tree_identifier (sr, l, c);

  tree_parameter_list *tpl = new tree_parameter_list (tmp);

  tpl->mark_as_formal_parameters ();

  return fcn->define_ret_list (tpl);
}

// Finish defining a function a different way.

static tree_function *
finish_function_def (tree_parameter_list *ret_list, tree_function *fcn)
{
  ret_list->mark_as_formal_parameters ();

  return fcn->define_ret_list (ret_list);
}

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;
}

// Finish building a matrix list.

static tree_expression *
finish_matrix (tree_matrix *m)
{
  tree_expression *retval = m;

  begin_unwind_frame ("finish_matrix");

  unwind_protect_int (error_state);

  lexer_flags.maybe_screwed_again--;

  if (m->all_elements_are_constant ())
    {
      octave_value tmp = m->eval (0);

      if (! error_state)
      {
        tree_constant *tc_retval = new tree_constant (tmp);

        ostrstream buf;

        tree_print_code tpc (buf);

        m->accept (tpc);

        buf << ends;

        char *s = buf.str ();

        tc_retval->stash_original_text (s);

        delete [] s;

        delete m;

        retval = tc_retval;
      }
    }

  run_unwind_frame ("finish_matrix");

  return retval;
}

static void
maybe_warn_missing_semi (tree_statement_list *t)
{
  if (lexer_flags.defining_func && Vwarn_missing_semicolon)
    {
      tree_statement *tmp = t->rear();

      if (tmp->is_expression ())
      warning ("missing semicolon near line %d, column %d in file `%s'",
             tmp->line (), tmp->column (),
             curr_fcn_file_full_name.c_str ());
    }
}

static void
set_stmt_print_flag (tree_statement_list *list, char sep,
                 bool warn_missing_semi)
{
  switch (sep)
    {
    case ';':
      {
      tree_statement *tmp = list->rear ();
      tmp->set_print_flag (0);
      }
      break;

    case 0:
    case ',':
    case '\n':
      if (warn_missing_semi)
      maybe_warn_missing_semi (list);
      break;

    default:
      warning ("unrecognized separator type!");
      break;
    }
}

static int
warn_assign_as_truth_value (void)
{
  Vwarn_assign_as_truth_value
    = check_preference ("warn_assign_as_truth_value");

  return 0;
}

static int
warn_comma_in_global_decl (void)
{
  Vwarn_comma_in_global_decl = check_preference ("warn_comma_in_global_decl");

  return 0;
}

static int
warn_function_name_clash (void)
{
  Vwarn_function_name_clash = check_preference ("warn_function_name_clash");

  return 0;
}

static int
warn_future_time_stamp (void)
{
  Vwarn_future_time_stamp = check_preference ("warn_future_time_stamp");

  return 0;
}

static int
warn_missing_semicolon (void)
{
  Vwarn_missing_semicolon = check_preference ("warn_missing_semicolon");

  return 0;
}

static int
warn_variable_switch_label (void)
{
  Vwarn_variable_switch_label
    = check_preference ("warn_variable_switch_label");

  return 0;
}

void
symbols_of_parse (void)
{
  DEFVAR (warn_assign_as_truth_value, 1.0, 0, warn_assign_as_truth_value,
    "produce warning for assignments used as truth values");

  DEFVAR (warn_comma_in_global_decl, 1.0, 0, warn_comma_in_global_decl,
    "produce warning for commas in global declarations");

  DEFVAR (warn_function_name_clash, 1.0, 0, warn_function_name_clash,
    "produce warning if function name conflicts with file name");

  DEFVAR (warn_future_time_stamp, 1.0, 0, warn_future_time_stamp,
    "warn if a function file has a time stamp that is in the future");

  DEFVAR (warn_missing_semicolon, 0.0, 0, warn_missing_semicolon,
    "produce a warning if a statement in a function file is not\n\
terminated with a semicolon");

  DEFVAR (warn_variable_switch_label, 0.0, 0, warn_variable_switch_label,
    "produce warning for variables used as switch labels");
}

/*
;;; Local Variables: ***
;;; mode: text ***
;;; End: ***
*/

Generated by  Doxygen 1.6.0   Back to index