Mercurial > hg > octave-lyh
comparison libinterp/parse-tree/oct-parse.yy @ 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 | 6434f70f0ee0 |
children | 7302f8a4df83 |
comparison
equal
deleted
inserted
replaced
16108:3cce6b4e0f7c | 16109:229eb14653fd |
---|---|
3585 | 3585 |
3586 frame.protect_var (global_command); | 3586 frame.protect_var (global_command); |
3587 | 3587 |
3588 global_command = 0; | 3588 global_command = 0; |
3589 | 3589 |
3590 int status = yyparse (); | 3590 int status = octave_parse_input (); |
3591 | 3591 |
3592 // Use an unwind-protect cleanup function so that the | 3592 // Use an unwind-protect cleanup function so that the |
3593 // global_command list will be deleted in the event of an | 3593 // global_command list will be deleted in the event of an |
3594 // interrupt. | 3594 // interrupt. |
3595 | 3595 |
4353 // forced variables will be unmarked in the event of an | 4353 // forced variables will be unmarked in the event of an |
4354 // interrupt. | 4354 // interrupt. |
4355 symbol_table::scope_id scope = symbol_table::top_scope (); | 4355 symbol_table::scope_id scope = symbol_table::top_scope (); |
4356 frame.add_fcn (symbol_table::unmark_forced_variables, scope); | 4356 frame.add_fcn (symbol_table::unmark_forced_variables, scope); |
4357 | 4357 |
4358 parse_status = yyparse (); | 4358 parse_status = octave_parse_input (); |
4359 | 4359 |
4360 tree_statement_list *command_list = global_command; | 4360 tree_statement_list *command_list = global_command; |
4361 | 4361 |
4362 // Unmark forced variables. | 4362 // Unmark forced variables. |
4363 // Restore previous value of global_command. | 4363 // Restore previous value of global_command. |
4460 if (*lst) | 4460 if (*lst) |
4461 { | 4461 { |
4462 delete *lst; | 4462 delete *lst; |
4463 *lst = 0; | 4463 *lst = 0; |
4464 } | 4464 } |
4465 } | |
4466 | |
4467 int | |
4468 octave_parse_input (void) | |
4469 { | |
4470 octave_parse (); | |
4465 } | 4471 } |
4466 | 4472 |
4467 DEFUN (eval, args, nargout, | 4473 DEFUN (eval, args, nargout, |
4468 "-*- texinfo -*-\n\ | 4474 "-*- texinfo -*-\n\ |
4469 @deftypefn {Built-in Function} {} eval (@var{try})\n\ | 4475 @deftypefn {Built-in Function} {} eval (@var{try})\n\ |