Mercurial > hg > octave-lyh
changeset 16138:284e2ca86ef7
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.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 27 Feb 2013 13:07:38 -0500 |
parents | a885686b732a |
children | 2fd39ab12209 |
files | libinterp/interpfcn/input.cc libinterp/interpfcn/toplev.cc libinterp/parse-tree/oct-parse.yy libinterp/parse-tree/parse.h |
diffstat | 4 files changed, 12 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- 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) {
--- 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) {
--- 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\
--- 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);