Mercurial > hg > octave-lyh
diff libinterp/parse-tree/parse.h @ 16177:a7669b4d27f6
eliminate global global_command variable
* toplev.h, toplev.cc (global_command): Delete.
* parse.h, oct-parse.in.yy (octave_parser::stmt_list):
New member variable.
(octave_parser::octave_parser): Initialize it to zero.
(octave_parser:~octave_parser): Delete it.
(octave_parser::reset): Delete it and set it to zero.
* toplev.cc (main_loop): Use curr_parser->stmt_list instead of
global_command.
* input.cc (get_debug_input): Likewise.
* oct-parse.in.yy (eval_string, parse_fcn_file): Likewise.
(ABORT_PARSE): Don't set global_command to zero.
(input): Set curr_parser->stmt_list instead of global_command.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 02 Mar 2013 19:31:26 -0500 |
parents | c5bfdc4c0963 |
children | b52d2f9294b6 |
line wrap: on
line diff
--- a/libinterp/parse-tree/parse.h +++ b/libinterp/parse-tree/parse.h @@ -144,6 +144,7 @@ parsing_subfunctions (false), max_fcn_depth (0), curr_fcn_depth (0), primary_fcn_scope (-1), curr_class_name (), function_scopes (), primary_fcn_ptr (0), + stmt_list (0), curr_lexer (new octave_lexer ()), parser_state (0) { init (); @@ -153,10 +154,7 @@ void init (void); - void reset (void) - { - curr_lexer->reset (); - } + void reset (void); int run (void); @@ -382,6 +380,9 @@ // Pointer to the primary user function or user script function. octave_function *primary_fcn_ptr; + // Result of parsing input. + tree_statement_list *stmt_list; + // State of the lexer. octave_lexer *curr_lexer;