Mercurial > hg > octave-nkf
changeset 16109:229eb14653fd
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.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 26 Feb 2013 00:45:43 -0500 |
parents | 3cce6b4e0f7c |
children | 7302f8a4df83 |
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(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- 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) {
--- 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) {
--- 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\
--- 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