# HG changeset patch # User John W. Eaton # Date 1361988458 18000 # Node ID 284e2ca86ef784016a59339b185787cfe5ddf762 # Parent a885686b732a4402d5c72bf0036e1f7632e81b33 execute parser using member function of octave_parser class * parse.h, oct-parse.yy (octave_parser::run): New function. (octave_parse_input): Delete. * toplev.cc (main_loop): Call octave_parser::run for curr_parser instead of calling octave_parse_input. * input.cc (get_debug_input): Likewise. * oct-parse.yy (eval_string, parse_fcn_file): Likewise. diff --git a/libinterp/interpfcn/input.cc b/libinterp/interpfcn/input.cc --- a/libinterp/interpfcn/input.cc +++ b/libinterp/interpfcn/input.cc @@ -704,7 +704,7 @@ symbol_table::scope_id scope = symbol_table::top_scope (); middle_frame.add_fcn (symbol_table::unmark_forced_variables, scope); - int retval = octave_parse_input (); + int retval = curr_parser->run (); if (retval == 0 && global_command) { diff --git a/libinterp/interpfcn/toplev.cc b/libinterp/interpfcn/toplev.cc --- a/libinterp/interpfcn/toplev.cc +++ b/libinterp/interpfcn/toplev.cc @@ -593,7 +593,7 @@ global_command = 0; - retval = octave_parse_input (); + retval = curr_parser->run (); if (retval == 0) { diff --git a/libinterp/parse-tree/oct-parse.yy b/libinterp/parse-tree/oct-parse.yy --- a/libinterp/parse-tree/oct-parse.yy +++ b/libinterp/parse-tree/oct-parse.yy @@ -1540,6 +1540,12 @@ parse_error ("%s", msg.c_str ()); } +int +octave_parser::run (void) +{ + return octave_parse (); +} + // Error mesages for mismatched end tokens. void @@ -3424,7 +3430,7 @@ global_command = 0; - int status = octave_parse_input (); + int status = curr_parser->run (); // Use an unwind-protect cleanup function so that the // global_command list will be deleted in the event of an @@ -4196,7 +4202,7 @@ symbol_table::scope_id scope = symbol_table::top_scope (); frame.add_fcn (symbol_table::unmark_forced_variables, scope); - parse_status = octave_parse_input (); + parse_status = curr_parser->run (); tree_statement_list *command_list = global_command; @@ -4305,12 +4311,6 @@ } } -int -octave_parse_input (void) -{ - return octave_parse (); -} - DEFUN (eval, args, nargout, "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} eval (@var{try})\n\ diff --git a/libinterp/parse-tree/parse.h b/libinterp/parse-tree/parse.h --- a/libinterp/parse-tree/parse.h +++ b/libinterp/parse-tree/parse.h @@ -131,8 +131,6 @@ extern OCTINTERP_API void cleanup_statement_list (tree_statement_list **lst); -extern OCTINTERP_API int octave_parse_input (void); - class octave_parser { @@ -142,6 +140,8 @@ ~octave_parser (void) { } + int run (void); + // Error mesages for mismatched end tokens. void end_error (const char *type, token::end_tok_type ettype, int l, int c);