#include "lex.h"
Classes | |
class | bbp_nesting_level |
class | symbol_table_context |
class | token_cache |
Public Member Functions | |
lexical_feedback (const lexical_feedback &)=delete | |
lexical_feedback (interpreter &interp) | |
~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) |
lexical_feedback & | operator= (const lexical_feedback &)=delete |
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 |
|
inline |
|
delete |
octave::lexical_feedback::~lexical_feedback | ( | void | ) |
Definition at line 5062 of file lex.cc.
References octave::lexical_feedback::token_cache::clear(), and m_tokens.
void octave::lexical_feedback::init | ( | void | ) |
Definition at line 5068 of file lex.cc.
References m_looking_at_object_index.
void octave::lexical_feedback::mark_as_variable | ( | const std::string & | nm | ) |
void octave::lexical_feedback::mark_as_variables | ( | const std::list< std::string > & | lst | ) |
Definition at line 5211 of file lex.cc.
References m_pending_local_variables.
Referenced by octave::base_parser::make_decl_command(), and octave::base_parser::validate_matrix_for_assignment().
void octave::lexical_feedback::mark_previous_token_trailing_space | ( | void | ) |
Definition at line 5150 of file lex.cc.
References octave::lexical_feedback::token_cache::front(), m_tokens, octave::token::mark_trailing_space(), and previous_token_value_is().
Referenced by octave::base_lexer::handle_continuation().
void octave::lexical_feedback::maybe_mark_previous_token_as_variable | ( | void | ) |
Definition at line 5202 of file lex.cc.
References octave::lexical_feedback::token_cache::front(), octave::token::is_symbol(), m_pending_local_variables, m_tokens, and octave::token::symbol_name().
|
delete |
bool octave::lexical_feedback::previous_token_is_binop | ( | void | ) | const |
Definition at line 5165 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, MUL_EQ, OR_EQ, POW, POW_EQ, previous_token_value(), and SUB_EQ.
Referenced by octave::base_lexer::maybe_unput_comma_before_unary_op().
bool octave::lexical_feedback::previous_token_is_keyword | ( | void | ) | const |
Definition at line 5185 of file lex.cc.
References octave::lexical_feedback::token_cache::front(), octave::token::iskeyword(), and m_tokens.
bool octave::lexical_feedback::previous_token_may_be_command | ( | void | ) | const |
Definition at line 5192 of file lex.cc.
References octave::lexical_feedback::token_cache::front(), m_allow_command_syntax, m_tokens, and octave::token::may_be_command().
Referenced by octave::base_lexer::looks_like_command_arg().
int octave::lexical_feedback::previous_token_value | ( | void | ) | const |
Definition at line 5136 of file lex.cc.
References octave::lexical_feedback::token_cache::front(), m_tokens, and octave::token::token_value().
Referenced by octave::base_lexer::maybe_unput_comma_before_unary_op(), and previous_token_is_binop().
bool octave::lexical_feedback::previous_token_value_is | ( | int | tok_val | ) | const |
Definition at line 5143 of file lex.cc.
References octave::lexical_feedback::token_cache::front(), m_tokens, and octave::token::token_value_is().
Referenced by mark_previous_token_trailing_space().
void octave::lexical_feedback::reset | ( | void | ) |
Definition at line 5076 of file lex.cc.
References octave::lexical_feedback::symbol_table_context::clear(), octave::lexical_feedback::token_cache::clear(), m_allow_command_syntax, m_at_beginning_of_statement, m_block_comment_nesting_level, m_braceflag, m_bracketflag, m_buffer_function_text, m_command_arg_paren_count, m_comment_text, m_current_input_line, m_defining_func, m_dir_name, m_end_of_input, m_fcn_file_full_name, m_fcn_file_name, m_filepos, m_force_script, m_function_text, m_help_text, m_looking_at_anon_fcn_args, m_looking_at_decl_list, m_looking_at_function_handle, m_looking_at_indirect_ref, m_looking_at_initializer_expression, m_looking_at_matrix_or_assign_lhs, m_looking_at_object_index, m_looking_at_parameter_list, m_looking_at_return_list, m_looking_for_object_index, m_looping, m_maybe_classdef_get_set_method, m_nesting_level, m_package_name, m_parsed_function_name, m_parsing_anon_fcn_body, m_parsing_class_method, m_parsing_classdef, m_parsing_classdef_decl, m_parsing_classdef_get_method, m_parsing_classdef_set_method, m_parsing_classdef_superclass, m_pending_local_variables, m_quote_is_transpose, m_reading_classdef_file, m_reading_fcn_file, m_reading_script_file, m_string_text, m_symtab_context, m_tok_beg, m_tok_end, m_token_count, m_tokens, and octave::lexical_feedback::bbp_nesting_level::reset().
Referenced by octave::base_lexer::reset().
bool octave::lexical_feedback::space_follows_previous_token | ( | void | ) | const |
Definition at line 5158 of file lex.cc.
References octave::lexical_feedback::token_cache::front(), m_tokens, and octave::token::space_follows_token().
Referenced by octave::base_lexer::looks_like_command_arg(), and octave::base_lexer::maybe_unput_comma_before_unary_op().
bool octave::lexical_feedback::m_allow_command_syntax |
Definition at line 360 of file lex.h.
Referenced by octave::base_parser::disallow_command_syntax(), octave::base_lexer::looks_like_command_arg(), previous_token_may_be_command(), and reset().
bool octave::lexical_feedback::m_at_beginning_of_statement |
Definition at line 364 of file lex.h.
Referenced by octave::base_lexer::finish_comment(), octave::base_lexer::handle_close_bracket(), octave::base_lexer::handle_continuation(), octave::base_lexer::handle_identifier(), octave::base_lexer::handle_number(), octave::base_lexer::handle_op(), octave::base_lexer::make_keyword_token(), and reset().
int octave::lexical_feedback::m_block_comment_nesting_level |
Definition at line 459 of file lex.h.
Referenced by octave::base_lexer::handle_end_of_input(), and reset().
int octave::lexical_feedback::m_braceflag |
Definition at line 447 of file lex.h.
Referenced by octave::base_lexer::handle_close_bracket(), and reset().
int octave::lexical_feedback::m_bracketflag |
Definition at line 444 of file lex.h.
Referenced by octave::base_lexer::handle_close_bracket(), and reset().
bool octave::lexical_feedback::m_buffer_function_text |
Definition at line 441 of file lex.h.
Referenced by octave::lexer::fill_flex_buffer(), octave::base_parser::finish_function(), octave::base_lexer::make_keyword_token(), and reset().
int octave::lexical_feedback::m_command_arg_paren_count |
Definition at line 462 of file lex.h.
Referenced by octave::base_lexer::finish_command_arg(), and reset().
std::string octave::lexical_feedback::m_comment_text |
Definition at line 485 of file lex.h.
Referenced by octave::base_lexer::finish_comment(), octave::base_lexer::handle_continuation(), and reset().
std::string octave::lexical_feedback::m_current_input_line |
Definition at line 482 of file lex.h.
Referenced by octave::push_lexer::append_input(), octave::base_parser::bison_error(), octave::lexer::fill_flex_buffer(), octave::base_lexer::make_keyword_token(), and reset().
int octave::lexical_feedback::m_defining_func |
Definition at line 453 of file lex.h.
Referenced by octave::base_lexer::make_keyword_token(), octave::base_parser::recover_from_parsing_function(), and reset().
std::string octave::lexical_feedback::m_dir_name |
Definition at line 500 of file lex.h.
Referenced by octave::base_parser::finish_function(), octave::base_parser::make_script(), reset(), and octave::base_parser::start_function().
bool octave::lexical_feedback::m_end_of_input |
Definition at line 357 of file lex.h.
Referenced by octave::base_parser::at_end_of_input(), and reset().
std::string octave::lexical_feedback::m_fcn_file_full_name |
Definition at line 497 of file lex.h.
Referenced by octave::base_parser::bison_error(), octave::base_parser::make_anon_fcn_handle(), octave::base_parser::make_decl_command(), octave::base_lexer::make_keyword_token(), 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(), reset(), octave::push_parser::run(), octave::parser::run(), octave::base_parser::start_function(), octave::base_lexer::warn_language_extension(), and octave::base_lexer::warn_single_quote_string().
std::string octave::lexical_feedback::m_fcn_file_name |
Definition at line 494 of file lex.h.
Referenced by octave::base_parser::finish_function(), octave::base_lexer::handle_end_of_input(), octave::base_parser::make_classdef(), octave::base_parser::make_fcn_name(), octave::base_parser::make_script(), reset(), and octave::base_parser::start_function().
filepos octave::lexical_feedback::m_filepos |
Definition at line 469 of file lex.h.
Referenced by octave::base_lexer::begin_string(), octave::base_parser::bison_error(), octave::base_lexer::handle_continuation(), octave::base_lexer::handle_end_of_input(), octave::base_lexer::handle_fq_identifier(), octave::base_lexer::handle_meta_identifier(), octave::base_lexer::handle_superclass_identifier(), octave::base_lexer::make_keyword_token(), octave::base_lexer::maybe_warn_separator_insert(), reset(), octave::base_lexer::update_token_positions(), octave::base_lexer::warn_language_extension(), and octave::base_lexer::warn_single_quote_string().
bool octave::lexical_feedback::m_force_script |
Definition at line 428 of file lex.h.
Referenced by octave::base_lexer::make_keyword_token(), reset(), and octave::base_parser::start_function().
std::string octave::lexical_feedback::m_function_text |
Definition at line 491 of file lex.h.
Referenced by octave::lexer::fill_flex_buffer(), octave::base_parser::finish_function(), octave::base_lexer::make_keyword_token(), and reset().
std::string octave::lexical_feedback::m_help_text |
Definition at line 488 of file lex.h.
Referenced by octave::base_lexer::finish_comment(), octave::base_parser::make_script(), reset(), and octave::base_parser::start_function().
interpreter& octave::lexical_feedback::m_interpreter |
Definition at line 354 of file lex.h.
Referenced by octave::lexical_feedback::symbol_table_context::curr_scope(), octave::base_lexer::debug_flag(), octave::base_lexer::display_tokens(), octave::lexer::fill_flex_buffer(), octave::base_lexer::increment_token_count(), octave::base_lexer::input_from_tmp_history_file(), octave::base_lexer::is_variable(), and octave::base_lexer::reset().
bool octave::lexical_feedback::m_looking_at_anon_fcn_args |
bool octave::lexical_feedback::m_looking_at_decl_list |
Definition at line 377 of file lex.h.
Referenced by octave::base_lexer::make_keyword_token(), and reset().
int octave::lexical_feedback::m_looking_at_function_handle |
bool octave::lexical_feedback::m_looking_at_indirect_ref |
Definition at line 392 of file lex.h.
Referenced by octave::base_lexer::handle_identifier(), octave::base_parser::make_indirect_ref(), and reset().
bool octave::lexical_feedback::m_looking_at_initializer_expression |
bool octave::lexical_feedback::m_looking_at_matrix_or_assign_lhs |
std::list<bool> octave::lexical_feedback::m_looking_at_object_index |
Definition at line 507 of file lex.h.
Referenced by octave::base_lexer::handle_close_bracket(), init(), octave::base_lexer::inside_any_object_index(), reset(), and octave::base_lexer::whitespace_is_significant().
bool octave::lexical_feedback::m_looking_at_parameter_list |
Definition at line 373 of file lex.h.
Referenced by octave::base_parser::recover_from_parsing_function(), and reset().
bool octave::lexical_feedback::m_looking_at_return_list |
Definition at line 370 of file lex.h.
Referenced by octave::base_lexer::make_keyword_token(), octave::base_parser::recover_from_parsing_function(), and reset().
bool octave::lexical_feedback::m_looking_for_object_index |
Definition at line 388 of file lex.h.
Referenced by octave::base_lexer::handle_close_bracket(), octave::base_lexer::handle_identifier(), octave::base_lexer::handle_number(), octave::base_lexer::handle_op(), and reset().
int octave::lexical_feedback::m_looping |
Definition at line 450 of file lex.h.
Referenced by octave::base_parser::make_break_command(), octave::base_parser::make_continue_command(), octave::base_parser::make_do_until_command(), octave::base_parser::make_for_command(), octave::base_lexer::make_keyword_token(), octave::base_parser::make_while_command(), and reset().
bool octave::lexical_feedback::m_maybe_classdef_get_set_method |
Definition at line 415 of file lex.h.
Referenced by octave::base_parser::make_fcn_name(), octave::base_lexer::make_keyword_token(), and reset().
bbp_nesting_level octave::lexical_feedback::m_nesting_level |
Definition at line 522 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::string octave::lexical_feedback::m_package_name |
Definition at line 503 of file lex.h.
Referenced by reset(), and octave::base_parser::start_function().
std::stack<bool> octave::lexical_feedback::m_parsed_function_name |
Definition at line 512 of file lex.h.
Referenced by octave::base_parser::make_fcn_name(), octave::base_lexer::make_keyword_token(), octave::base_parser::recover_from_parsing_function(), and reset().
bool octave::lexical_feedback::m_parsing_anon_fcn_body |
Definition at line 395 of file lex.h.
Referenced by octave::base_lexer::handle_identifier(), and reset().
bool octave::lexical_feedback::m_parsing_class_method |
Definition at line 398 of file lex.h.
Referenced by reset(), and octave::base_parser::start_function().
bool octave::lexical_feedback::m_parsing_classdef |
Definition at line 401 of file lex.h.
Referenced by octave::base_lexer::make_keyword_token(), reset(), and octave::base_parser::start_function().
bool octave::lexical_feedback::m_parsing_classdef_decl |
Definition at line 406 of file lex.h.
Referenced by octave::base_lexer::handle_op(), and reset().
bool octave::lexical_feedback::m_parsing_classdef_get_method |
Definition at line 418 of file lex.h.
Referenced by reset(), and octave::base_parser::start_function().
bool octave::lexical_feedback::m_parsing_classdef_set_method |
Definition at line 421 of file lex.h.
Referenced by reset(), and octave::base_parser::start_function().
bool octave::lexical_feedback::m_parsing_classdef_superclass |
Definition at line 410 of file lex.h.
Referenced by octave::base_lexer::handle_op(), and reset().
std::set<std::string> octave::lexical_feedback::m_pending_local_variables |
Definition at line 515 of file lex.h.
Referenced by octave::base_lexer::is_variable(), mark_as_variables(), maybe_mark_previous_token_as_variable(), and reset().
bool octave::lexical_feedback::m_quote_is_transpose |
bool octave::lexical_feedback::m_reading_classdef_file |
Definition at line 437 of file lex.h.
Referenced by octave::base_parser::bison_error(), octave::base_parser::finish_classdef_file(), octave::base_lexer::handle_end_of_input(), octave::base_lexer::make_keyword_token(), reset(), octave::base_lexer::reset(), and octave::base_parser::start_function().
bool octave::lexical_feedback::m_reading_fcn_file |
Definition at line 431 of file lex.h.
Referenced by octave::base_parser::bison_error(), octave::base_parser::finish_function(), octave::base_lexer::handle_end_of_input(), octave::base_lexer::make_keyword_token(), octave::base_parser::recover_from_parsing_function(), reset(), octave::base_lexer::reset(), and octave::base_parser::start_function().
bool octave::lexical_feedback::m_reading_script_file |
Definition at line 434 of file lex.h.
Referenced by octave::base_parser::bison_error(), octave::base_lexer::handle_end_of_input(), octave::base_parser::make_decl_command(), octave::base_lexer::make_keyword_token(), octave::base_lexer::prep_for_file(), octave::base_parser::push_fcn_symtab(), reset(), octave::base_lexer::reset(), and octave::base_parser::start_function().
std::string octave::lexical_feedback::m_string_text |
Definition at line 479 of file lex.h.
Referenced by octave::base_lexer::finish_command_arg(), and reset().
symbol_table_context octave::lexical_feedback::m_symtab_context |
Definition at line 518 of file lex.h.
Referenced by octave::base_lexer::handle_identifier(), octave::base_parser::make_anon_fcn_handle(), octave::base_parser::make_classdef(), octave::base_parser::make_fcn_name(), octave::base_parser::make_script(), octave::base_parser::push_fcn_symtab(), octave::base_parser::recover_from_parsing_function(), reset(), octave::base_lexer::reset(), and octave::base_parser::start_function().
filepos octave::lexical_feedback::m_tok_beg |
Definition at line 475 of file lex.h.
Referenced by octave::base_lexer::begin_string(), octave::base_lexer::count_token(), octave::base_lexer::finish_command_arg(), 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(), octave::base_lexer::handle_superclass_identifier(), octave::base_lexer::handle_token(), octave::base_lexer::make_keyword_token(), reset(), and octave::base_lexer::update_token_positions().
filepos octave::lexical_feedback::m_tok_end |
Definition at line 476 of file lex.h.
Referenced by octave::base_lexer::count_token(), octave::base_lexer::finish_command_arg(), 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(), octave::base_lexer::handle_superclass_identifier(), octave::base_lexer::handle_token(), octave::base_lexer::make_keyword_token(), reset(), and octave::base_lexer::update_token_positions().
size_t octave::lexical_feedback::m_token_count |
Definition at line 466 of file lex.h.
Referenced by octave::base_lexer::increment_token_count(), octave::base_lexer::make_keyword_token(), and reset().
token_cache octave::lexical_feedback::m_tokens |
Definition at line 525 of file lex.h.
Referenced by ~lexical_feedback(), mark_previous_token_trailing_space(), maybe_mark_previous_token_as_variable(), octave::base_lexer::pending_token_count(), previous_token_is_keyword(), previous_token_may_be_command(), previous_token_value(), previous_token_value_is(), octave::base_lexer::push_token(), reset(), and space_follows_previous_token().