#include "lex.h"
Classes | |
class | bbp_nesting_level |
class | symbol_table_context |
class | token_cache |
Public Member Functions | |
lexical_feedback (interpreter &interp) | |
~lexical_feedback () | |
void | init () |
void | mark_as_variable (const std::string &nm) |
void | mark_as_variables (const std::list< std::string > &lst) |
void | mark_previous_token_trailing_space () |
bool | previous_token_is_binop () const |
bool | previous_token_is_keyword () const |
bool | previous_token_may_be_command () const |
int | previous_token_value () const |
bool | previous_token_value_is (int tok_val) const |
void | reset () |
bool | space_follows_previous_token () const |
|
inline |
lexical_feedback::~lexical_feedback | ( | ) |
Definition at line 5021 of file lex.cc.
References lexical_feedback::token_cache::clear(), and m_tokens.
void lexical_feedback::init | ( | ) |
Definition at line 5027 of file lex.cc.
References m_looking_at_object_index.
void lexical_feedback::mark_as_variable | ( | const std::string & | nm | ) |
Definition at line 5151 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 5160 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(), and base_parser::validate_matrix_for_assignment().
void lexical_feedback::mark_previous_token_trailing_space | ( | ) |
Definition at line 5109 of file lex.cc.
References lexical_feedback::token_cache::front(), m_tokens, token::mark_trailing_space(), and previous_token_value_is().
bool lexical_feedback::previous_token_is_binop | ( | ) | const |
Definition at line 5124 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.
bool lexical_feedback::previous_token_is_keyword | ( | ) | const |
Definition at line 5144 of file lex.cc.
References lexical_feedback::token_cache::front(), token::iskeyword(), and m_tokens.
bool lexical_feedback::previous_token_may_be_command | ( | ) | const |
Definition at line 5169 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 | ( | ) | const |
Definition at line 5095 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 5102 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 | ( | ) |
Definition at line 5035 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_comment_uses_hash_char, 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_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 | ( | ) | const |
Definition at line 5117 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 352 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 383 of file lex.h.
Referenced by base_lexer::make_keyword_token(), and reset().
bool lexical_feedback::m_at_beginning_of_statement |
Definition at line 356 of file lex.h.
Referenced by base_lexer::handle_close_bracket(), base_lexer::handle_identifier(), base_lexer::handle_op(), base_lexer::make_keyword_token(), and reset().
int lexical_feedback::m_block_comment_nesting_level |
Definition at line 458 of file lex.h.
Referenced by base_lexer::handle_end_of_input(), and reset().
int lexical_feedback::m_braceflag |
Definition at line 446 of file lex.h.
Referenced by base_lexer::handle_close_bracket(), and reset().
int lexical_feedback::m_bracketflag |
Definition at line 443 of file lex.h.
Referenced by base_lexer::handle_close_bracket(), and reset().
bool lexical_feedback::m_buffer_function_text |
Definition at line 436 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 387 of file lex.h.
Referenced by base_lexer::make_keyword_token(), and reset().
int lexical_feedback::m_command_arg_paren_count |
Definition at line 461 of file lex.h.
Referenced by base_lexer::finish_command_arg(), and reset().
std::string lexical_feedback::m_comment_text |
bool lexical_feedback::m_comment_uses_hash_char |
Definition at line 440 of file lex.h.
Referenced by base_lexer::check_comment_for_hash_char(), and reset().
std::string lexical_feedback::m_current_input_line |
Definition at line 481 of file lex.h.
Referenced by lexer::fill_flex_buffer(), base_lexer::make_keyword_token(), and reset().
int lexical_feedback::m_defining_fcn |
Definition at line 452 of file lex.h.
Referenced by base_lexer::make_keyword_token(), base_parser::recover_from_parsing_function(), and reset().
std::string lexical_feedback::m_dir_name |
Definition at line 497 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 349 of file lex.h.
Referenced by base_parser::finish_input(), and reset().
std::string lexical_feedback::m_fcn_file_full_name |
Definition at line 494 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_lexer::maybe_warn_separator_insert(), reset(), 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 491 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 468 of file lex.h.
Referenced by base_parser::bison_error(), base_lexer::handle_end_of_input(), 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 423 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 488 of file lex.h.
Referenced by lexer::fill_flex_buffer(), base_parser::finish_function(), base_lexer::make_keyword_token(), and reset().
interpreter& lexical_feedback::m_interpreter |
Definition at line 346 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_parser::finish_array_list(), base_parser::finish_classdef_file(), base_lexer::increment_token_count(), base_lexer::input_from_tmp_history_file(), base_parser::make_colon_expression(), base_lexer::reset(), and base_parser::validate_matrix_for_assignment().
bool lexical_feedback::m_looking_at_anon_fcn_args |
bool lexical_feedback::m_looking_at_decl_list |
Definition at line 369 of file lex.h.
Referenced by base_lexer::make_keyword_token(), and reset().
int lexical_feedback::m_looking_at_function_handle |
bool lexical_feedback::m_looking_at_indirect_ref |
Definition at line 380 of file lex.h.
Referenced by base_lexer::handle_identifier(), base_parser::make_indirect_ref(), and reset().
bool lexical_feedback::m_looking_at_matrix_or_assign_lhs |
std::list<bool> lexical_feedback::m_looking_at_object_index |
Definition at line 504 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 365 of file lex.h.
Referenced by base_parser::recover_from_parsing_function(), and reset().
bool lexical_feedback::m_looking_at_return_list |
Definition at line 362 of file lex.h.
Referenced by base_lexer::make_keyword_token(), base_parser::recover_from_parsing_function(), and reset().
bool lexical_feedback::m_looking_for_object_index |
Definition at line 376 of file lex.h.
Referenced by base_lexer::handle_close_bracket(), base_lexer::handle_identifier(), base_lexer::handle_op(), and reset().
int lexical_feedback::m_looping |
Definition at line 449 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 410 of file lex.h.
Referenced by base_parser::make_fcn_name(), base_lexer::make_keyword_token(), and reset().
bbp_nesting_level lexical_feedback::m_nesting_level |
Definition at line 516 of file lex.h.
Referenced by base_lexer::handle_close_bracket(), reset(), and base_lexer::whitespace_is_significant().
std::string lexical_feedback::m_package_name |
Definition at line 500 of file lex.h.
Referenced by reset(), and base_parser::start_function().
std::stack<bool> lexical_feedback::m_parsed_function_name |
Definition at line 509 of file lex.h.
Referenced by base_parser::make_fcn_name(), base_lexer::make_keyword_token(), base_parser::recover_from_parsing_function(), and reset().
bool lexical_feedback::m_parsing_anon_fcn_body |
Definition at line 390 of file lex.h.
Referenced by base_lexer::handle_identifier(), and reset().
bool lexical_feedback::m_parsing_class_method |
Definition at line 393 of file lex.h.
Referenced by reset(), and base_parser::start_function().
bool lexical_feedback::m_parsing_classdef |
Definition at line 396 of file lex.h.
Referenced by base_parser::make_function(), reset(), and base_parser::start_function().
bool lexical_feedback::m_parsing_classdef_decl |
Definition at line 401 of file lex.h.
Referenced by base_lexer::handle_op(), and reset().
bool lexical_feedback::m_parsing_classdef_get_method |
Definition at line 413 of file lex.h.
Referenced by reset(), and base_parser::start_function().
bool lexical_feedback::m_parsing_classdef_set_method |
Definition at line 416 of file lex.h.
Referenced by reset(), and base_parser::start_function().
bool lexical_feedback::m_parsing_classdef_superclass |
Definition at line 405 of file lex.h.
Referenced by base_lexer::handle_op(), and reset().
bool lexical_feedback::m_quote_is_transpose |
bool lexical_feedback::m_reading_classdef_file |
Definition at line 432 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(), reset(), base_lexer::reset(), and base_parser::start_function().
bool lexical_feedback::m_reading_fcn_file |
Definition at line 426 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(), 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 429 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(), 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 478 of file lex.h.
Referenced by base_lexer::finish_command_arg(), and reset().
symbol_table_context lexical_feedback::m_symtab_context |
Definition at line 512 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(), 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 474 of file lex.h.
Referenced by base_lexer::count_token(), base_lexer::finish_command_arg(), base_lexer::handle_end_of_input(), base_lexer::handle_identifier(), base_lexer::handle_op(), 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 475 of file lex.h.
Referenced by base_lexer::count_token(), base_lexer::finish_command_arg(), base_lexer::handle_end_of_input(), base_lexer::handle_identifier(), base_lexer::handle_op(), 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 465 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 519 of file lex.h.
Referenced by ~lexical_feedback(), 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().