#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) |
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 |
void lexical_feedback::init | ( | void | ) |
Definition at line 5115 of file lex.cc.
References m_looking_at_object_index.
void lexical_feedback::mark_as_variable | ( | const std::string & | nm | ) |
Definition at line 5239 of file lex.cc.
References lexical_feedback::symbol_table_context::curr_scope(), m_symtab_context, and symbol_scope::mark_as_variable().
Referenced by base_parser::make_assign_op(), and base_parser::make_for_command().
void lexical_feedback::mark_as_variables | ( | const std::list< std::string > & | lst | ) |
Definition at line 5248 of file lex.cc.
References lexical_feedback::symbol_table_context::curr_scope(), m_symtab_context, and symbol_scope::mark_as_variables().
Referenced by base_parser::make_assign_op(), base_parser::make_decl_command(), base_parser::make_for_command(), octave_push_parse(), and base_parser::validate_matrix_for_assignment().
void lexical_feedback::mark_previous_token_trailing_space | ( | void | ) |
Definition at line 5197 of file lex.cc.
References lexical_feedback::token_cache::front(), m_tokens, token::mark_trailing_space(), and previous_token_value_is().
Referenced by base_lexer::handle_continuation().
|
delete |
bool lexical_feedback::previous_token_is_binop | ( | void | ) | const |
Definition at line 5212 of file lex.cc.
References ADD_EQ, AND_EQ, DIV_EQ, EDIV, EDIV_EQ, ELEFTDIV, ELEFTDIV_EQ, EMUL, EMUL_EQ, EPOW, EPOW_EQ, EXPR_AND, EXPR_AND_AND, EXPR_EQ, EXPR_GE, EXPR_GT, EXPR_LE, EXPR_LT, EXPR_NE, EXPR_OR, EXPR_OR_OR, LEFTDIV, LEFTDIV_EQ, MUL_EQ, OR_EQ, POW, POW_EQ, previous_token_value(), and SUB_EQ.
Referenced by base_lexer::maybe_unput_comma_before_unary_op().
bool lexical_feedback::previous_token_is_keyword | ( | void | ) | const |
Definition at line 5232 of file lex.cc.
References lexical_feedback::token_cache::front(), token::iskeyword(), and m_tokens.
bool lexical_feedback::previous_token_may_be_command | ( | void | ) | const |
Definition at line 5257 of file lex.cc.
References lexical_feedback::token_cache::front(), m_allow_command_syntax, m_tokens, and token::may_be_command().
Referenced by base_lexer::looks_like_command_arg().
int lexical_feedback::previous_token_value | ( | void | ) | const |
Definition at line 5183 of file lex.cc.
References lexical_feedback::token_cache::front(), m_tokens, and token::token_value().
Referenced by base_lexer::maybe_unput_comma_before_unary_op(), and previous_token_is_binop().
bool lexical_feedback::previous_token_value_is | ( | int | tok_val | ) | const |
Definition at line 5190 of file lex.cc.
References lexical_feedback::token_cache::front(), m_tokens, and token::token_value_is().
Referenced by mark_previous_token_trailing_space().
void lexical_feedback::reset | ( | void | ) |
Definition at line 5123 of file lex.cc.
References lexical_feedback::symbol_table_context::clear(), lexical_feedback::token_cache::clear(), m_allow_command_syntax, m_arguments_is_keyword, m_at_beginning_of_statement, m_block_comment_nesting_level, m_braceflag, m_bracketflag, m_buffer_function_text, m_classdef_element_names_are_keywords, m_command_arg_paren_count, m_comment_text, m_current_input_line, m_defining_fcn, 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_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_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 lexical_feedback::bbp_nesting_level::reset().
Referenced by base_lexer::reset().
bool lexical_feedback::space_follows_previous_token | ( | void | ) | const |
Definition at line 5205 of file lex.cc.
References lexical_feedback::token_cache::front(), m_tokens, and token::space_follows_token().
Referenced by base_lexer::looks_like_command_arg(), and base_lexer::maybe_unput_comma_before_unary_op().
bool lexical_feedback::m_allow_command_syntax |
Definition at line 358 of file lex.h.
Referenced by base_parser::disallow_command_syntax(), base_lexer::looks_like_command_arg(), previous_token_may_be_command(), and reset().
bool lexical_feedback::m_arguments_is_keyword |
Definition at line 389 of file lex.h.
Referenced by base_lexer::make_keyword_token(), octave_push_parse(), and reset().
bool lexical_feedback::m_at_beginning_of_statement |
Definition at line 362 of file lex.h.
Referenced by base_lexer::finish_comment(), base_lexer::handle_close_bracket(), base_lexer::handle_continuation(), base_lexer::handle_identifier(), base_lexer::handle_number(), base_lexer::handle_op(), base_lexer::make_keyword_token(), octave_push_parse(), and reset().
int lexical_feedback::m_block_comment_nesting_level |
Definition at line 460 of file lex.h.
Referenced by base_lexer::handle_end_of_input(), and reset().
int lexical_feedback::m_braceflag |
Definition at line 448 of file lex.h.
Referenced by base_lexer::handle_close_bracket(), and reset().
int lexical_feedback::m_bracketflag |
Definition at line 445 of file lex.h.
Referenced by base_lexer::handle_close_bracket(), and reset().
bool lexical_feedback::m_buffer_function_text |
Definition at line 442 of file lex.h.
Referenced by lexer::fill_flex_buffer(), base_parser::finish_function(), base_lexer::make_keyword_token(), and reset().
bool lexical_feedback::m_classdef_element_names_are_keywords |
Definition at line 393 of file lex.h.
Referenced by base_lexer::make_keyword_token(), octave_push_parse(), and reset().
int lexical_feedback::m_command_arg_paren_count |
Definition at line 463 of file lex.h.
Referenced by base_lexer::finish_command_arg(), and reset().
std::string lexical_feedback::m_comment_text |
Definition at line 486 of file lex.h.
Referenced by base_lexer::finish_comment(), base_lexer::handle_continuation(), and reset().
std::string lexical_feedback::m_current_input_line |
Definition at line 483 of file lex.h.
Referenced by push_lexer::append_input(), base_parser::bison_error(), lexer::fill_flex_buffer(), base_lexer::make_keyword_token(), and reset().
int lexical_feedback::m_defining_fcn |
Definition at line 454 of file lex.h.
Referenced by base_lexer::make_keyword_token(), octave_push_parse(), base_parser::recover_from_parsing_function(), and reset().
std::string lexical_feedback::m_dir_name |
Definition at line 501 of file lex.h.
Referenced by base_parser::finish_function(), base_parser::make_script(), reset(), and base_parser::start_function().
bool lexical_feedback::m_end_of_input |
Definition at line 355 of file lex.h.
Referenced by base_parser::finish_input(), and reset().
std::string lexical_feedback::m_fcn_file_full_name |
Definition at line 498 of file lex.h.
Referenced by base_parser::bison_error(), base_parser::make_anon_fcn_handle(), base_parser::make_classdef(), base_parser::make_decl_command(), base_lexer::make_keyword_token(), base_parser::make_script(), base_parser::maybe_warn_assign_as_truth_value(), base_parser::maybe_warn_missing_semi(), base_lexer::maybe_warn_separator_insert(), base_parser::maybe_warn_variable_switch_label(), reset(), push_parser::run(), parser::run(), base_parser::start_function(), base_lexer::warn_deprecated_syntax(), and base_lexer::warn_language_extension().
std::string lexical_feedback::m_fcn_file_name |
Definition at line 495 of file lex.h.
Referenced by base_lexer::handle_end_of_input(), base_parser::make_classdef(), base_parser::make_fcn_name(), base_parser::make_script(), reset(), and base_parser::start_function().
filepos lexical_feedback::m_filepos |
Definition at line 470 of file lex.h.
Referenced by base_lexer::begin_string(), base_parser::bison_error(), base_lexer::handle_continuation(), base_lexer::handle_end_of_input(), base_lexer::handle_fq_identifier(), base_lexer::handle_meta_identifier(), base_lexer::handle_superclass_identifier(), base_lexer::make_keyword_token(), base_lexer::maybe_warn_separator_insert(), reset(), base_lexer::update_token_positions(), base_lexer::warn_deprecated_syntax(), and base_lexer::warn_language_extension().
bool lexical_feedback::m_force_script |
Definition at line 429 of file lex.h.
Referenced by base_lexer::make_keyword_token(), reset(), and base_parser::start_function().
std::string lexical_feedback::m_function_text |
Definition at line 492 of file lex.h.
Referenced by lexer::fill_flex_buffer(), base_parser::finish_function(), base_lexer::make_keyword_token(), and reset().
std::string lexical_feedback::m_help_text |
Definition at line 489 of file lex.h.
Referenced by base_lexer::finish_comment(), base_parser::make_script(), reset(), and base_parser::start_function().
interpreter& lexical_feedback::m_interpreter |
Definition at line 352 of file lex.h.
Referenced by lexical_feedback::symbol_table_context::curr_scope(), base_lexer::debug_flag(), base_lexer::display_tokens(), lexer::fill_flex_buffer(), base_lexer::increment_token_count(), base_lexer::input_from_tmp_history_file(), and base_lexer::reset().
bool lexical_feedback::m_looking_at_anon_fcn_args |
Definition at line 365 of file lex.h.
Referenced by octave_push_parse(), and reset().
bool lexical_feedback::m_looking_at_decl_list |
Definition at line 375 of file lex.h.
Referenced by base_lexer::make_keyword_token(), octave_push_parse(), and reset().
int lexical_feedback::m_looking_at_function_handle |
Definition at line 457 of file lex.h.
Referenced by octave_push_parse(), and reset().
bool lexical_feedback::m_looking_at_indirect_ref |
Definition at line 386 of file lex.h.
Referenced by base_lexer::handle_identifier(), base_parser::make_indirect_ref(), octave_push_parse(), and reset().
bool lexical_feedback::m_looking_at_matrix_or_assign_lhs |
Definition at line 379 of file lex.h.
Referenced by octave_push_parse(), and reset().
std::list<bool> lexical_feedback::m_looking_at_object_index |
Definition at line 508 of file lex.h.
Referenced by base_lexer::handle_close_bracket(), init(), base_lexer::inside_any_object_index(), reset(), and base_lexer::whitespace_is_significant().
bool lexical_feedback::m_looking_at_parameter_list |
Definition at line 371 of file lex.h.
Referenced by octave_push_parse(), base_parser::recover_from_parsing_function(), and reset().
bool lexical_feedback::m_looking_at_return_list |
Definition at line 368 of file lex.h.
Referenced by base_lexer::make_keyword_token(), octave_push_parse(), base_parser::recover_from_parsing_function(), and reset().
bool lexical_feedback::m_looking_for_object_index |
Definition at line 382 of file lex.h.
Referenced by base_lexer::handle_close_bracket(), base_lexer::handle_identifier(), base_lexer::handle_number(), base_lexer::handle_op(), octave_push_parse(), and reset().
int lexical_feedback::m_looping |
Definition at line 451 of file lex.h.
Referenced by base_parser::make_break_command(), base_parser::make_continue_command(), base_parser::make_do_until_command(), base_parser::make_for_command(), base_lexer::make_keyword_token(), base_parser::make_while_command(), and reset().
bool lexical_feedback::m_maybe_classdef_get_set_method |
Definition at line 416 of file lex.h.
Referenced by base_parser::make_fcn_name(), base_lexer::make_keyword_token(), octave_push_parse(), and reset().
bbp_nesting_level lexical_feedback::m_nesting_level |
Definition at line 520 of file lex.h.
Referenced by base_lexer::finish_comment(), base_lexer::handle_close_bracket(), octave_push_parse(), reset(), and base_lexer::whitespace_is_significant().
std::string lexical_feedback::m_package_name |
Definition at line 504 of file lex.h.
Referenced by reset(), and base_parser::start_function().
std::stack<bool> lexical_feedback::m_parsed_function_name |
Definition at line 513 of file lex.h.
Referenced by base_parser::make_fcn_name(), base_lexer::make_keyword_token(), octave_push_parse(), base_parser::recover_from_parsing_function(), and reset().
bool lexical_feedback::m_parsing_anon_fcn_body |
Definition at line 396 of file lex.h.
Referenced by base_lexer::handle_identifier(), octave_push_parse(), and reset().
bool lexical_feedback::m_parsing_class_method |
Definition at line 399 of file lex.h.
Referenced by reset(), and base_parser::start_function().
bool lexical_feedback::m_parsing_classdef |
Definition at line 402 of file lex.h.
Referenced by octave_push_parse(), reset(), and base_parser::start_function().
bool lexical_feedback::m_parsing_classdef_decl |
Definition at line 407 of file lex.h.
Referenced by base_lexer::handle_op(), octave_push_parse(), and reset().
bool lexical_feedback::m_parsing_classdef_get_method |
Definition at line 419 of file lex.h.
Referenced by octave_push_parse(), reset(), and base_parser::start_function().
bool lexical_feedback::m_parsing_classdef_set_method |
Definition at line 422 of file lex.h.
Referenced by octave_push_parse(), reset(), and base_parser::start_function().
bool lexical_feedback::m_parsing_classdef_superclass |
Definition at line 411 of file lex.h.
Referenced by base_lexer::handle_op(), octave_push_parse(), and reset().
bool lexical_feedback::m_quote_is_transpose |
bool lexical_feedback::m_reading_classdef_file |
Definition at line 438 of file lex.h.
Referenced by base_parser::bison_error(), base_parser::finish_classdef_file(), base_lexer::handle_end_of_input(), base_lexer::make_keyword_token(), octave_push_parse(), reset(), base_lexer::reset(), and base_parser::start_function().
bool lexical_feedback::m_reading_fcn_file |
Definition at line 432 of file lex.h.
Referenced by base_parser::bison_error(), base_parser::finish_function(), base_lexer::handle_end_of_input(), base_lexer::make_keyword_token(), octave_push_parse(), base_parser::recover_from_parsing_function(), reset(), base_lexer::reset(), and base_parser::start_function().
bool lexical_feedback::m_reading_script_file |
Definition at line 435 of file lex.h.
Referenced by base_parser::bison_error(), base_lexer::handle_end_of_input(), base_parser::make_decl_command(), base_lexer::make_keyword_token(), octave_push_parse(), base_lexer::prep_for_file(), base_parser::push_fcn_symtab(), reset(), base_lexer::reset(), and base_parser::start_function().
std::string lexical_feedback::m_string_text |
Definition at line 480 of file lex.h.
Referenced by base_lexer::finish_command_arg(), and reset().
symbol_table_context lexical_feedback::m_symtab_context |
Definition at line 516 of file lex.h.
Referenced by base_parser::make_anon_fcn_handle(), base_parser::make_classdef(), base_parser::make_fcn_name(), base_parser::make_identifier(), base_parser::make_script(), mark_as_variable(), mark_as_variables(), octave_push_parse(), base_parser::push_fcn_symtab(), base_parser::recover_from_parsing_function(), reset(), base_lexer::reset(), and base_parser::start_function().
filepos lexical_feedback::m_tok_beg |
Definition at line 476 of file lex.h.
Referenced by base_lexer::begin_string(), base_lexer::count_token(), base_lexer::finish_command_arg(), base_lexer::handle_end_of_input(), base_lexer::handle_fq_identifier(), base_lexer::handle_identifier(), base_lexer::handle_meta_identifier(), base_lexer::handle_number(), base_lexer::handle_op(), base_lexer::handle_superclass_identifier(), base_lexer::handle_token(), base_lexer::make_keyword_token(), reset(), and base_lexer::update_token_positions().
filepos lexical_feedback::m_tok_end |
Definition at line 477 of file lex.h.
Referenced by base_lexer::count_token(), base_lexer::finish_command_arg(), base_lexer::handle_end_of_input(), base_lexer::handle_fq_identifier(), base_lexer::handle_identifier(), base_lexer::handle_meta_identifier(), base_lexer::handle_number(), base_lexer::handle_op(), base_lexer::handle_superclass_identifier(), base_lexer::handle_token(), base_lexer::make_keyword_token(), reset(), and base_lexer::update_token_positions().
std::size_t lexical_feedback::m_token_count |
Definition at line 467 of file lex.h.
Referenced by base_lexer::increment_token_count(), base_lexer::make_keyword_token(), and reset().
token_cache lexical_feedback::m_tokens |
Definition at line 523 of file lex.h.
Referenced by mark_previous_token_trailing_space(), base_lexer::pending_token_count(), previous_token_is_keyword(), previous_token_may_be_command(), previous_token_value(), previous_token_value_is(), base_lexer::push_token(), reset(), and space_follows_previous_token().