# HG changeset patch # User John W. Eaton # Date 1361857543 18000 # Node ID 229eb14653fd45952e1108f4a687a9733b474229 # Parent 3cce6b4e0f7c21ab8a2363d5a5ac223fbbe8f431 new entry point for parser * oct-parse.yy (octave_parse_input): New function. (parse_fcn_file, eval_string): Use it instead of yyparse. * toplev.cc (main_loop): Use it instead of octave_parse. * input.cc (get_debug_input): Use it instead of octave_parse. * oct-parse.h (octave_parse_input): Provide decl. (octave_parse): Delete decl. diff --git a/libinterp/interpfcn/input.cc b/libinterp/interpfcn/input.cc --- a/libinterp/interpfcn/input.cc +++ b/libinterp/interpfcn/input.cc @@ -694,8 +694,7 @@ symbol_table::scope_id scope = symbol_table::top_scope (); frame.add_fcn (symbol_table::unmark_forced_variables, scope); - // This is the same as yyparse in parse.y. - int retval = octave_parse (); + int retval = octave_parse_input (); 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 @@ -583,8 +583,7 @@ global_command = 0; - // This is the same as yyparse in parse.y. - retval = octave_parse (); + retval = octave_parse_input (); 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 @@ -3587,7 +3587,7 @@ global_command = 0; - int status = yyparse (); + int status = octave_parse_input (); // Use an unwind-protect cleanup function so that the // global_command list will be deleted in the event of an @@ -4355,7 +4355,7 @@ symbol_table::scope_id scope = symbol_table::top_scope (); frame.add_fcn (symbol_table::unmark_forced_variables, scope); - parse_status = yyparse (); + parse_status = octave_parse_input (); tree_statement_list *command_list = global_command; @@ -4464,6 +4464,12 @@ } } +int +octave_parse_input (void) +{ + 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 @@ -31,7 +31,6 @@ extern void reset_parser (void); extern int octave_lex (void); -extern int octave_parse (void); class tree; class tree_matrix; @@ -107,4 +106,6 @@ extern OCTINTERP_API void cleanup_statement_list (tree_statement_list **lst); +extern OCTINTERP_API int octave_parse_input (void); + #endif