GNU Octave
4.0.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
|
#include "lex.h"
Classes | |
class | bbp_nesting_level |
class | symbol_table_context |
class | token_cache |
Public Member Functions | |
lexical_feedback (void) | |
~lexical_feedback (void) | |
void | init (void) |
void | mark_as_variable (const std::string &nm) |
void | mark_as_variables (const std::list< std::string > &lst) |
void | mark_previous_token_trailing_space (void) |
void | maybe_mark_previous_token_as_variable (void) |
bool | previous_token_is_binop (void) const |
bool | previous_token_is_keyword (void) const |
bool | previous_token_may_be_command (void) const |
int | previous_token_value (void) const |
bool | previous_token_value_is (int tok_val) const |
void | reset (void) |
bool | space_follows_previous_token (void) const |
Private Member Functions | |
lexical_feedback (const lexical_feedback &) | |
lexical_feedback & | operator= (const lexical_feedback &) |
lexical_feedback::~lexical_feedback | ( | void | ) |
Definition at line 4630 of file lex.cc.
References lexical_feedback::token_cache::clear(), and tokens.
|
private |
void lexical_feedback::init | ( | void | ) |
Definition at line 4636 of file lex.cc.
References looking_at_object_index.
void lexical_feedback::mark_as_variable | ( | const std::string & | nm | ) |
void lexical_feedback::mark_as_variables | ( | const std::list< std::string > & | lst | ) |
Definition at line 4768 of file lex.cc.
References pending_local_variables.
Referenced by octave_base_parser::validate_matrix_for_assignment().
void lexical_feedback::mark_previous_token_trailing_space | ( | void | ) |
Definition at line 4709 of file lex.cc.
References lexical_feedback::token_cache::front(), token::mark_trailing_space(), previous_token_value_is(), and tokens.
Referenced by octave_base_lexer::handle_continuation().
void lexical_feedback::maybe_mark_previous_token_as_variable | ( | void | ) |
Definition at line 4759 of file lex.cc.
References lexical_feedback::token_cache::front(), token::is_symbol(), pending_local_variables, token::symbol_name(), and tokens.
|
private |
bool lexical_feedback::previous_token_is_binop | ( | void | ) | const |
Definition at line 4724 of file lex.cc.
References ADD_EQ, AND_EQ, DIV_EQ, EDIV, EDIV_EQ, ELEFTDIV, ELEFTDIV_EQ, EMINUS, EMUL, EMUL_EQ, EPOW, EPOW_EQ, EXPR_AND, EXPR_AND_AND, EXPR_EQ, EXPR_GE, EXPR_GT, EXPR_LE, EXPR_LT, EXPR_NE, EXPR_NOT, EXPR_OR, EXPR_OR_OR, LEFTDIV, LEFTDIV_EQ, LSHIFT, LSHIFT_EQ, MUL_EQ, OR_EQ, POW, POW_EQ, previous_token_value(), RSHIFT, RSHIFT_EQ, and SUB_EQ.
Referenced by octave_base_lexer::maybe_unput_comma_before_unary_op().
bool lexical_feedback::previous_token_is_keyword | ( | void | ) | const |
Definition at line 4745 of file lex.cc.
References lexical_feedback::token_cache::front(), token::is_keyword(), and tokens.
bool lexical_feedback::previous_token_may_be_command | ( | void | ) | const |
Definition at line 4752 of file lex.cc.
References lexical_feedback::token_cache::front(), token::may_be_command(), and tokens.
Referenced by octave_base_lexer::looks_like_command_arg().
int lexical_feedback::previous_token_value | ( | void | ) | const |
Definition at line 4695 of file lex.cc.
References lexical_feedback::token_cache::front(), token::token_value(), and tokens.
Referenced by octave_base_lexer::maybe_unput_comma_before_unary_op(), and previous_token_is_binop().
Definition at line 4702 of file lex.cc.
References lexical_feedback::token_cache::front(), token::token_value_is(), and tokens.
Referenced by mark_previous_token_trailing_space().
void lexical_feedback::reset | ( | void | ) |
Definition at line 4644 of file lex.cc.
References at_beginning_of_statement, block_comment_nesting_level, braceflag, bracketflag, lexical_feedback::token_cache::clear(), command_arg_paren_count, comment_text, current_input_column, current_input_line, defining_func, end_of_input, fcn_file_full_name, fcn_file_name, force_script, help_text, input_line_number, looking_at_anon_fcn_args, looking_at_decl_list, looking_at_function_handle, looking_at_indirect_ref, looking_at_initializer_expression, looking_at_matrix_or_assign_lhs, looking_at_object_index, looking_at_parameter_list, looking_at_return_list, looking_for_object_index, looping, maybe_classdef_get_set_method, nesting_level, parsed_function_name, parsing_class_method, parsing_classdef, parsing_classdef_get_method, parsing_classdef_set_method, reading_classdef_file, reading_fcn_file, reading_script_file, lexical_feedback::bbp_nesting_level::reset(), string_column, string_line, string_text, token_count, and tokens.
Referenced by octave_base_lexer::reset().
bool lexical_feedback::space_follows_previous_token | ( | void | ) | const |
Definition at line 4717 of file lex.cc.
References lexical_feedback::token_cache::front(), token::space_follows_token(), and tokens.
Referenced by octave_base_lexer::looks_like_command_arg(), and octave_base_lexer::maybe_unput_comma_before_unary_op().
bool lexical_feedback::at_beginning_of_statement |
Definition at line 313 of file lex.h.
Referenced by octave_base_lexer::finish_comment(), octave_base_lexer::handle_continuation(), octave_base_lexer::handle_identifier(), octave_base_lexer::handle_number(), octave_base_lexer::handle_op_internal(), octave_base_lexer::is_keyword_token(), and reset().
int lexical_feedback::block_comment_nesting_level |
Definition at line 398 of file lex.h.
Referenced by octave_base_lexer::handle_end_of_input(), and reset().
int lexical_feedback::braceflag |
Definition at line 386 of file lex.h.
Referenced by octave_base_lexer::handle_close_bracket(), and reset().
int lexical_feedback::bracketflag |
Definition at line 383 of file lex.h.
Referenced by octave_base_lexer::handle_close_bracket(), and reset().
int lexical_feedback::command_arg_paren_count |
std::string lexical_feedback::comment_text |
Definition at line 411 of file lex.h.
Referenced by octave_base_lexer::finish_comment(), octave_base_lexer::handle_continuation(), and reset().
int lexical_feedback::current_input_column |
Definition at line 380 of file lex.h.
Referenced by octave_base_lexer::begin_string(), octave_base_parser::bison_error(), octave_base_lexer::count_token(), octave_base_lexer::handle_continuation(), octave_base_lexer::handle_fq_identifier(), octave_base_lexer::handle_identifier(), octave_base_lexer::handle_meta_identifier(), octave_base_lexer::handle_number(), octave_base_lexer::handle_op_internal(), octave_base_lexer::handle_superclass_identifier(), octave_base_lexer::handle_token(), octave_base_lexer::is_keyword_token(), octave_base_parser::make_anon_fcn_handle(), and reset().
std::string lexical_feedback::current_input_line |
Definition at line 408 of file lex.h.
Referenced by octave_base_parser::bison_error(), octave_lexer::fill_flex_buffer(), and reset().
int lexical_feedback::defining_func |
Definition at line 392 of file lex.h.
Referenced by octave_base_lexer::is_keyword_token(), octave_base_parser::recover_from_parsing_function(), and reset().
bool lexical_feedback::end_of_input |
Definition at line 309 of file lex.h.
Referenced by eval_string(), main_loop(), and reset().
std::string lexical_feedback::fcn_file_full_name |
Definition at line 427 of file lex.h.
Referenced by octave_base_parser::bison_error(), octave_base_parser::frob_function(), octave_base_lexer::gripe_language_extension(), octave_base_lexer::gripe_single_quote_string(), octave_base_lexer::is_keyword_token(), octave_base_parser::make_decl_command(), octave_base_parser::make_script(), octave_base_parser::maybe_warn_assign_as_truth_value(), octave_base_parser::maybe_warn_missing_semi(), octave_base_lexer::maybe_warn_separator_insert(), octave_base_parser::maybe_warn_variable_switch_label(), parse_fcn_file(), and reset().
std::string lexical_feedback::fcn_file_name |
Definition at line 424 of file lex.h.
Referenced by octave_base_parser::frob_function(), octave_base_lexer::handle_end_of_input(), octave_base_parser::make_classdef(), octave_base_parser::make_script(), parse_fcn_file(), and reset().
bool lexical_feedback::force_script |
Definition at line 365 of file lex.h.
Referenced by octave_base_parser::frob_function(), octave_base_lexer::is_keyword_token(), parse_fcn_file(), and reset().
std::string lexical_feedback::help_text |
Definition at line 414 of file lex.h.
Referenced by octave_base_lexer::finish_comment(), octave_base_parser::frob_function(), octave_base_parser::make_script(), and reset().
int lexical_feedback::input_line_number |
Definition at line 377 of file lex.h.
Referenced by octave_base_lexer::begin_string(), octave_base_parser::bison_error(), octave_base_lexer::count_token(), octave_base_lexer::gripe_language_extension(), octave_base_lexer::gripe_single_quote_string(), octave_base_lexer::handle_continuation(), octave_base_lexer::handle_end_of_input(), octave_base_lexer::handle_fq_identifier(), octave_base_lexer::handle_identifier(), octave_base_lexer::handle_meta_identifier(), octave_base_lexer::handle_number(), octave_base_lexer::handle_op_internal(), octave_base_lexer::handle_superclass_identifier(), octave_base_lexer::handle_token(), octave_base_lexer::is_keyword_token(), octave_base_parser::make_anon_fcn_handle(), octave_base_lexer::maybe_warn_separator_insert(), and reset().
bool lexical_feedback::looking_at_anon_fcn_args |
bool lexical_feedback::looking_at_decl_list |
Definition at line 326 of file lex.h.
Referenced by octave_base_lexer::is_keyword_token(), and reset().
int lexical_feedback::looking_at_function_handle |
Definition at line 395 of file lex.h.
Referenced by octave_base_lexer::handle_identifier(), and reset().
bool lexical_feedback::looking_at_indirect_ref |
Definition at line 341 of file lex.h.
Referenced by octave_base_lexer::handle_identifier(), octave_base_parser::make_indirect_ref(), and reset().
bool lexical_feedback::looking_at_initializer_expression |
bool lexical_feedback::looking_at_matrix_or_assign_lhs |
std::list<bool> lexical_feedback::looking_at_object_index |
Definition at line 431 of file lex.h.
Referenced by init(), octave_base_lexer::inside_any_object_index(), reset(), and octave_base_lexer::whitespace_is_significant().
bool lexical_feedback::looking_at_parameter_list |
Definition at line 322 of file lex.h.
Referenced by octave_base_parser::recover_from_parsing_function(), and reset().
bool lexical_feedback::looking_at_return_list |
Definition at line 319 of file lex.h.
Referenced by octave_base_lexer::is_keyword_token(), octave_base_parser::recover_from_parsing_function(), and reset().
bool lexical_feedback::looking_for_object_index |
Definition at line 337 of file lex.h.
Referenced by octave_base_lexer::handle_identifier(), octave_base_lexer::handle_number(), octave_base_lexer::handle_op_internal(), and reset().
int lexical_feedback::looping |
Definition at line 389 of file lex.h.
Referenced by octave_base_lexer::is_keyword_token(), octave_base_parser::make_do_until_command(), octave_base_parser::make_for_command(), octave_base_parser::make_while_command(), and reset().
bool lexical_feedback::maybe_classdef_get_set_method |
Definition at line 352 of file lex.h.
Referenced by octave_base_lexer::is_keyword_token(), and reset().
bbp_nesting_level lexical_feedback::nesting_level |
Definition at line 446 of file lex.h.
Referenced by octave_base_lexer::finish_comment(), octave_base_lexer::handle_close_bracket(), reset(), and octave_base_lexer::whitespace_is_significant().
std::stack<bool> lexical_feedback::parsed_function_name |
Definition at line 436 of file lex.h.
Referenced by octave_base_lexer::is_keyword_token(), octave_base_parser::recover_from_parsing_function(), and reset().
bool lexical_feedback::parsing_class_method |
Definition at line 344 of file lex.h.
Referenced by octave_base_parser::frob_function(), parse_fcn_file(), and reset().
bool lexical_feedback::parsing_classdef |
Definition at line 347 of file lex.h.
Referenced by octave_base_lexer::is_keyword_token(), and reset().
bool lexical_feedback::parsing_classdef_get_method |
bool lexical_feedback::parsing_classdef_set_method |
std::set<std::string> lexical_feedback::pending_local_variables |
Definition at line 439 of file lex.h.
Referenced by octave_base_lexer::is_variable(), mark_as_variables(), and maybe_mark_previous_token_as_variable().
bool lexical_feedback::reading_classdef_file |
Definition at line 374 of file lex.h.
Referenced by octave_base_parser::bison_error(), octave_base_parser::frob_function(), octave_base_lexer::handle_end_of_input(), octave_base_lexer::is_keyword_token(), parse_fcn_file(), octave_base_reader::reading_classdef_file(), reset(), and octave_base_lexer::reset().
bool lexical_feedback::reading_fcn_file |
Definition at line 368 of file lex.h.
Referenced by octave_base_parser::bison_error(), octave_base_parser::finish_function(), octave_base_parser::frob_function(), octave_base_lexer::handle_end_of_input(), octave_base_lexer::is_keyword_token(), octave_base_reader::reading_fcn_file(), octave_base_parser::recover_from_parsing_function(), reset(), and octave_base_lexer::reset().
bool lexical_feedback::reading_script_file |
Definition at line 371 of file lex.h.
Referenced by octave_base_parser::bison_error(), octave_base_parser::frob_function(), octave_base_lexer::handle_end_of_input(), octave_base_lexer::is_keyword_token(), octave_base_parser::make_decl_command(), octave_base_lexer::prep_for_file(), octave_base_reader::reading_script_file(), reset(), and octave_base_lexer::reset().
int lexical_feedback::string_column |
Definition at line 421 of file lex.h.
Referenced by octave_base_lexer::begin_string(), and reset().
int lexical_feedback::string_line |
Definition at line 420 of file lex.h.
Referenced by octave_base_lexer::begin_string(), and reset().
std::string lexical_feedback::string_text |
symbol_table_context lexical_feedback::symtab_context |
Definition at line 442 of file lex.h.
Referenced by octave_base_lexer::handle_identifier(), octave_base_parser::make_anon_fcn_handle(), octave_base_parser::recover_from_parsing_function(), octave_base_lexer::reset(), and octave_base_parser::start_function().
size_t lexical_feedback::token_count |
Definition at line 405 of file lex.h.
Referenced by octave_base_lexer::count_token_internal(), octave_base_lexer::is_keyword_token(), and reset().
token_cache lexical_feedback::tokens |
Definition at line 449 of file lex.h.
Referenced by mark_previous_token_trailing_space(), maybe_mark_previous_token_as_variable(), previous_token_is_keyword(), previous_token_may_be_command(), previous_token_value(), previous_token_value_is(), octave_base_lexer::push_token(), reset(), space_follows_previous_token(), and ~lexical_feedback().