#include "lex.h"
Classes | |
class | comment_buffer |
class | input_buffer |
Public Member Functions | |
base_lexer (const base_lexer &)=delete | |
base_lexer (interpreter &interp) | |
virtual | ~base_lexer (void) |
bool | at_end_of_buffer (void) const |
bool | at_end_of_file (void) const |
void | begin_string (int state) |
void | clear_start_state (void) |
int | count_token (int tok) |
int | count_token_internal (int tok) |
token * | current_token (void) |
bool | debug_flag (void) const |
void | display_start_state (void) const |
void | display_token (int tok) |
bool | display_tokens (void) const |
void | fatal_error (const char *msg) |
virtual int | fill_flex_buffer (char *buf, unsigned int max_size)=0 |
int | finish_command_arg (void) |
void | finish_comment (comment_elt::comment_type typ) |
int | flex_yyleng (void) |
char * | flex_yytext (void) |
bool | fq_identifier_contains_keyword (const std::string &s) |
comment_list * | get_comment (void) |
int | handle_close_bracket (int bracket_type) |
void | handle_continuation (void) |
int | handle_end_of_input (void) |
int | handle_fq_identifier (void) |
int | handle_identifier (void) |
int | handle_meta_identifier (void) |
void | handle_number (void) |
int | handle_op (int tok, bool bos=false, bool compat=true) |
int | handle_superclass_identifier (void) |
int | handle_token (int tok, token *tok_val=nullptr) |
void | increment_token_count (void) |
void | init (void) |
virtual bool | input_from_eval_string (void) const |
virtual bool | input_from_file (void) const |
virtual bool | input_from_terminal (void) const |
bool | input_from_tmp_history_file (void) |
virtual std::string | input_source (void) const |
bool | inside_any_object_index (void) |
virtual bool | is_push_lexer (void) const |
bool | is_variable (const std::string &name, const symbol_scope &scope) |
void | lexer_debug (const char *pattern) |
bool | looking_at_space (void) |
bool | looks_like_command_arg (void) |
int | make_keyword_token (const std::string &s) |
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 | maybe_unput_comma_before_unary_op (int tok) |
void | maybe_warn_language_extension_comment (char c) |
void | maybe_warn_separator_insert (char sep) |
base_lexer & | operator= (const base_lexer &)=delete |
size_t | pending_token_count (void) const |
void | pop_start_state (void) |
void | prep_for_file (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 | push_start_state (int state) |
void | push_token (token *) |
virtual void | reset (void) |
int | show_token (int tok) |
bool | space_follows_previous_token (void) const |
int | start_state (void) const |
int | text_yyinput (void) |
void | update_token_positions (int tok_len) |
void | warn_language_extension (const std::string &msg) |
void | warn_language_extension_continuation (void) |
void | warn_language_extension_operator (const std::string &op) |
void | warn_single_quote_string (void) |
bool | whitespace_is_significant (void) |
void | xunput (char c) |
void | xunput (char c, char *buf) |
Protected Attributes | |
std::stack< int > | start_state_stack |
|
inline |
|
delete |
|
virtual |
Definition at line 5307 of file lex.cc.
References m_scanner, and yylex_destroy.
|
inline |
Definition at line 634 of file lex.h.
Referenced by octave::push_parser::run().
void octave::base_lexer::begin_string | ( | int | state | ) |
Definition at line 5365 of file lex.cc.
References octave::lexical_feedback::m_filepos, octave::lexical_feedback::m_tok_beg, push_start_state(), and octave::state.
void octave::base_lexer::clear_start_state | ( | void | ) |
Definition at line 6461 of file lex.cc.
References INITIAL, push_start_state(), and start_state_stack.
int octave::base_lexer::count_token | ( | int | tok | ) |
Definition at line 6605 of file lex.cc.
References count_token_internal(), octave::lexical_feedback::m_tok_beg, octave::lexical_feedback::m_tok_end, and push_token().
Referenced by handle_close_bracket().
int octave::base_lexer::count_token_internal | ( | int | tok | ) |
Definition at line 6615 of file lex.cc.
References increment_token_count(), and show_token().
Referenced by count_token(), handle_end_of_input(), handle_fq_identifier(), handle_identifier(), handle_meta_identifier(), handle_op(), handle_superclass_identifier(), and handle_token().
token * octave::base_lexer::current_token | ( | void | ) |
Definition at line 6248 of file lex.cc.
References m_scanner, yyget_lval, and YYSTYPE.
Referenced by display_token().
bool octave::base_lexer::debug_flag | ( | void | ) | const |
Definition at line 6396 of file lex.cc.
References octave::interpreter::get_settings(), octave::settings::lexer_debug_flag(), and octave::lexical_feedback::m_interpreter.
Referenced by lexer_debug(), show_token(), text_yyinput(), and xunput().
void octave::base_lexer::display_start_state | ( | void | ) | const |
Definition at line 6470 of file lex.cc.
References BLOCK_COMMENT_START, COMMAND_START, DQ_STRING_START, FQ_IDENT_START, INITIAL, INPUT_FILE_START, LINE_COMMENT_START, MATRIX_START, SQ_STRING_START, and start_state().
Referenced by lexer_debug().
void octave::base_lexer::display_token | ( | int | tok | ) |
Definition at line 6261 of file lex.cc.
References ADD_EQ, AND_EQ, BREAK, CASE, CATCH, CLASSDEF, CLEANUP, CONTINUE, current_token(), DIV_EQ, DO, DQ_STRING, EDIV, EDIV_EQ, ELEFTDIV, ELEFTDIV_EQ, ELSE, ELSEIF, EMINUS, EMUL, EMUL_EQ, END, END_OF_INPUT, EPLUS, EPOW, EPOW_EQ, EVENTS, EXPR_AND, EXPR_AND_AND, EXPR_EQ, EXPR_GE, EXPR_GT, EXPR_LE, EXPR_LT, EXPR_NE, EXPR_NOT, EXPR_OR, EXPR_OR_OR, FCN, FCN_HANDLE, FOR, FUNC_RET, GET, GLOBAL, HERMITIAN, IF, IMAG_NUM, INPUT_FILE, LEFTDIV, LEFTDIV_EQ, LEXICAL_ERROR, METAQUERY, METHODS, MINUS_MINUS, MUL_EQ, octave::symbol_record::name(), NAME, NUM, octave::token::number(), OR_EQ, OTHERWISE, PERSISTENT, PLUS_PLUS, POW, POW_EQ, PROPERTIES, SET, SQ_STRING, STRUCT_ELT, SUB_EQ, SUPERCLASSREF, SWITCH, octave::token::sym_rec(), octave::token::text(), TRANSPOSE, TRY, UNTIL, UNWIND, and WHILE.
Referenced by show_token().
bool octave::base_lexer::display_tokens | ( | void | ) | const |
Definition at line 6403 of file lex.cc.
References octave::settings::display_tokens(), octave::interpreter::get_settings(), and octave::lexical_feedback::m_interpreter.
Referenced by show_token().
void octave::base_lexer::fatal_error | ( | const char * | msg | ) |
|
pure virtual |
Implemented in octave::push_lexer, and octave::lexer.
int octave::base_lexer::finish_command_arg | ( | void | ) |
Definition at line 6581 of file lex.cc.
References handle_token(), octave::lexical_feedback::m_command_arg_paren_count, octave::lexical_feedback::m_string_text, octave::lexical_feedback::m_tok_beg, octave::lexical_feedback::m_tok_end, and SQ_STRING.
void octave::base_lexer::finish_comment | ( | comment_elt::comment_type | typ | ) |
Definition at line 5941 of file lex.cc.
References octave::base_lexer::comment_buffer::append(), octave::comment_elt::copyright, looks_like_copyright(), looks_like_shebang(), octave::lexical_feedback::m_at_beginning_of_statement, m_comment_buf, octave::lexical_feedback::m_comment_text, octave::lexical_feedback::m_help_text, octave::lexical_feedback::m_nesting_level, and octave::lexical_feedback::bbp_nesting_level::none().
Referenced by handle_continuation().
int octave::base_lexer::flex_yyleng | ( | void | ) |
Definition at line 5404 of file lex.cc.
References m_scanner, and yyget_leng.
Referenced by handle_continuation(), handle_fq_identifier(), handle_identifier(), handle_meta_identifier(), handle_number(), handle_op(), and handle_superclass_identifier().
char * octave::base_lexer::flex_yytext | ( | void | ) |
Definition at line 5398 of file lex.cc.
References m_scanner, and yyget_text.
Referenced by handle_continuation(), handle_fq_identifier(), handle_identifier(), handle_meta_identifier(), handle_number(), handle_op(), handle_superclass_identifier(), lexer_debug(), and xunput().
bool octave::base_lexer::fq_identifier_contains_keyword | ( | const std::string & | s | ) |
Definition at line 5761 of file lex.cc.
References octave::iskeyword().
Referenced by handle_fq_identifier(), handle_meta_identifier(), and handle_superclass_identifier().
|
inline |
Definition at line 670 of file lex.h.
Referenced by octave::base_parser::make_statement().
int octave::base_lexer::handle_close_bracket | ( | int | bracket_type | ) |
Definition at line 5960 of file lex.cc.
References count_token(), octave::lexical_feedback::m_at_beginning_of_statement, octave::lexical_feedback::m_braceflag, octave::lexical_feedback::m_bracketflag, octave::lexical_feedback::m_looking_at_object_index, octave::lexical_feedback::m_looking_for_object_index, octave::lexical_feedback::m_nesting_level, octave::lexical_feedback::bbp_nesting_level::none(), panic_impossible, pop_start_state(), and octave::lexical_feedback::bbp_nesting_level::remove().
void octave::base_lexer::handle_continuation | ( | void | ) |
Definition at line 5882 of file lex.cc.
References octave::comment_elt::end_of_line, finish_comment(), flex_yyleng(), flex_yytext(), is_space_or_tab(), octave::lexical_feedback::m_at_beginning_of_statement, octave::lexical_feedback::m_comment_text, octave::lexical_feedback::m_filepos, octave::lexical_feedback::mark_previous_token_trailing_space(), octave::filepos::next_line(), and warn_language_extension_continuation().
int octave::base_lexer::handle_end_of_input | ( | void | ) |
Definition at line 5373 of file lex.cc.
References count_token_internal(), END_OF_INPUT, lexer_debug(), octave::filepos::line(), octave::lexical_feedback::m_block_comment_nesting_level, octave::lexical_feedback::m_fcn_file_name, octave::lexical_feedback::m_filepos, octave::lexical_feedback::m_reading_classdef_file, octave::lexical_feedback::m_reading_fcn_file, octave::lexical_feedback::m_reading_script_file, octave::lexical_feedback::m_tok_beg, octave::lexical_feedback::m_tok_end, push_token(), and warning().
int octave::base_lexer::handle_fq_identifier | ( | void | ) |
Definition at line 6063 of file lex.cc.
References count_token_internal(), flex_yyleng(), flex_yytext(), FQ_IDENT, fq_identifier_contains_keyword(), octave::filepos::increment_column(), is_space_or_tab(), LEXICAL_ERROR, octave::lexical_feedback::m_filepos, octave::lexical_feedback::m_tok_beg, octave::lexical_feedback::m_tok_end, and push_token().
int octave::base_lexer::handle_identifier | ( | void | ) |
Definition at line 6097 of file lex.cc.
References count_token_internal(), octave::lexical_feedback::symbol_table_context::curr_scope(), flex_yyleng(), flex_yytext(), octave::symbol_scope::insert(), is_variable(), octave::lexical_feedback::m_at_beginning_of_statement, octave::lexical_feedback::m_looking_at_indirect_ref, octave::lexical_feedback::m_looking_for_object_index, octave::lexical_feedback::m_parsing_anon_fcn_body, octave::lexical_feedback::m_symtab_context, octave::lexical_feedback::m_tok_beg, octave::lexical_feedback::m_tok_end, make_keyword_token(), octave::token::mark_may_be_command(), NAME, push_token(), STRUCT_ELT, and update_token_positions().
int octave::base_lexer::handle_meta_identifier | ( | void | ) |
Definition at line 6032 of file lex.cc.
References count_token_internal(), flex_yyleng(), flex_yytext(), fq_identifier_contains_keyword(), octave::filepos::increment_column(), is_space_or_tab(), LEXICAL_ERROR, octave::lexical_feedback::m_filepos, octave::lexical_feedback::m_tok_beg, octave::lexical_feedback::m_tok_end, METAQUERY, and push_token().
void octave::base_lexer::handle_number | ( | void | ) |
Definition at line 5812 of file lex.cc.
References flex_yyleng(), flex_yytext(), looks_like_bin(), looks_like_hex(), octave::lexical_feedback::m_at_beginning_of_statement, octave::lexical_feedback::m_looking_for_object_index, octave::lexical_feedback::m_tok_beg, octave::lexical_feedback::m_tok_end, NUM, push_token(), strlen(), strsave(), and update_token_positions().
int octave::base_lexer::handle_op | ( | int | tok, |
bool | bos = false , |
||
bool | compat = true |
||
) |
Definition at line 6542 of file lex.cc.
References count_token_internal(), EXPR_AND, EXPR_LT, flex_yyleng(), flex_yytext(), FQ_IDENT_START, octave::lexical_feedback::m_at_beginning_of_statement, octave::lexical_feedback::m_looking_for_object_index, octave::lexical_feedback::m_parsing_classdef_decl, octave::lexical_feedback::m_parsing_classdef_superclass, octave::lexical_feedback::m_tok_beg, octave::lexical_feedback::m_tok_end, push_start_state(), push_token(), update_token_positions(), and warn_language_extension_operator().
int octave::base_lexer::handle_superclass_identifier | ( | void | ) |
Definition at line 5998 of file lex.cc.
References count_token_internal(), flex_yyleng(), flex_yytext(), fq_identifier_contains_keyword(), octave::filepos::increment_column(), is_space_or_tab(), octave::iskeyword(), LEXICAL_ERROR, octave::lexical_feedback::m_filepos, octave::lexical_feedback::m_tok_beg, octave::lexical_feedback::m_tok_end, push_token(), SUPERCLASSREF, and update_token_positions().
int octave::base_lexer::handle_token | ( | int | tok, |
token * | tok_val = nullptr |
||
) |
Definition at line 6594 of file lex.cc.
References count_token_internal(), octave::lexical_feedback::m_tok_beg, octave::lexical_feedback::m_tok_end, and push_token().
Referenced by finish_command_arg().
void octave::base_lexer::increment_token_count | ( | void | ) |
Definition at line 6410 of file lex.cc.
References octave::interpreter::get_settings(), octave::settings::increment_token_count(), octave::lexical_feedback::m_interpreter, and octave::lexical_feedback::m_token_count.
Referenced by count_token_internal().
void octave::base_lexer::init | ( | void | ) |
Definition at line 5313 of file lex.cc.
References clear_start_state(), m_scanner, yylex_init, and yyset_extra.
|
inlinevirtual |
Reimplemented in octave::lexer.
Definition at line 729 of file lex.h.
Referenced by octave::base_parser::make_anon_fcn_handle(), and reset().
|
inlinevirtual |
Reimplemented in octave::lexer.
Definition at line 727 of file lex.h.
Referenced by make_keyword_token().
|
inlinevirtual |
Reimplemented in octave::lexer.
Definition at line 725 of file lex.h.
Referenced by octave::base_parser::make_anon_fcn_handle().
bool octave::base_lexer::input_from_tmp_history_file | ( | void | ) |
Definition at line 6433 of file lex.cc.
References octave::interpreter::get_history_system(), octave::history_system::input_from_tmp_file(), and octave::lexical_feedback::m_interpreter.
Referenced by octave::base_parser::start_function().
|
inlinevirtual |
Reimplemented in octave::push_lexer, and octave::lexer.
bool octave::base_lexer::inside_any_object_index | ( | void | ) |
Definition at line 5489 of file lex.cc.
References octave::lexical_feedback::m_looking_at_object_index, and retval.
Referenced by make_keyword_token().
|
inlinevirtual |
Reimplemented in octave::push_lexer.
bool octave::base_lexer::is_variable | ( | const std::string & | name, |
const symbol_scope & | scope | ||
) |
Definition at line 5506 of file lex.cc.
References octave::interpreter::at_top_level(), octave::interpreter::is_variable(), octave::lexical_feedback::m_interpreter, octave::lexical_feedback::m_pending_local_variables, and name.
Referenced by handle_identifier().
void octave::base_lexer::lexer_debug | ( | const char * | pattern | ) |
Definition at line 6419 of file lex.cc.
References debug_flag(), display_start_state(), and flex_yytext().
Referenced by handle_end_of_input().
bool octave::base_lexer::looking_at_space | ( | void | ) |
Definition at line 5481 of file lex.cc.
References is_space_or_tab(), text_yyinput(), and xunput().
Referenced by looks_like_command_arg().
bool octave::base_lexer::looks_like_command_arg | ( | void | ) |
Definition at line 5985 of file lex.cc.
References looking_at_space(), octave::lexical_feedback::m_allow_command_syntax, octave::lexical_feedback::previous_token_may_be_command(), and octave::lexical_feedback::space_follows_previous_token().
int octave::base_lexer::make_keyword_token | ( | const std::string & | s | ) |
Definition at line 5516 of file lex.cc.
References break_kw, case_kw, catch_kw, octave::token::classdef_end, classdef_kw, continue_kw, do_kw, else_kw, elseif_kw, end_kw, end_try_catch_kw, end_unwind_protect_kw, endclassdef_kw, endenumeration_kw, endevents_kw, endfor_kw, endfunction_kw, endif_kw, endmethods_kw, endparfor_kw, endproperties_kw, endswitch_kw, endwhile_kw, octave::token::enumeration_end, enumeration_kw, octave::token::events_end, events_kw, octave::token::for_end, for_kw, octave::token::function_end, function_kw, get_kw, global_kw, octave::token::if_end, if_kw, octave_kw_hash::in_word_set(), input_from_file(), inside_any_object_index(), octave_kw::kw_id, octave::filepos::line(), octave::lexical_feedback::m_at_beginning_of_statement, octave::lexical_feedback::m_buffer_function_text, octave::lexical_feedback::m_current_input_line, octave::lexical_feedback::m_defining_func, octave::lexical_feedback::m_fcn_file_full_name, octave::lexical_feedback::m_filepos, octave::lexical_feedback::m_force_script, octave::lexical_feedback::m_function_text, octave::lexical_feedback::m_looking_at_decl_list, octave::lexical_feedback::m_looking_at_return_list, octave::lexical_feedback::m_looping, octave::lexical_feedback::m_maybe_classdef_get_set_method, octave::lexical_feedback::m_parsed_function_name, octave::lexical_feedback::m_parsing_classdef, octave::lexical_feedback::m_reading_classdef_file, octave::lexical_feedback::m_reading_fcn_file, octave::lexical_feedback::m_reading_script_file, octave::lexical_feedback::m_tok_beg, octave::lexical_feedback::m_tok_end, octave::lexical_feedback::m_token_count, magic_file_kw, magic_line_kw, octave::token::methods_end, methods_kw, otherwise_kw, panic_impossible, octave::token::parfor_end, parfor_kw, persistent_kw, octave::token::properties_end, properties_kw, push_token(), return_kw, set_kw, octave::token::simple_end, octave::token::switch_end, switch_kw, octave_kw::tok, octave::token::try_catch_end, try_kw, until_kw, unwind_protect_cleanup_kw, octave::token::unwind_protect_end, unwind_protect_kw, update_token_positions(), octave::token::while_end, and while_kw.
Referenced by handle_identifier().
|
inherited |
|
inherited |
Definition at line 5211 of file lex.cc.
References octave::lexical_feedback::m_pending_local_variables.
Referenced by octave::base_parser::make_decl_command(), and octave::base_parser::validate_matrix_for_assignment().
|
inherited |
Definition at line 5150 of file lex.cc.
References octave::lexical_feedback::token_cache::front(), octave::lexical_feedback::m_tokens, octave::token::mark_trailing_space(), and octave::lexical_feedback::previous_token_value_is().
Referenced by handle_continuation().
|
inherited |
Definition at line 5202 of file lex.cc.
References octave::lexical_feedback::token_cache::front(), octave::token::is_symbol(), octave::lexical_feedback::m_pending_local_variables, octave::lexical_feedback::m_tokens, and octave::token::symbol_name().
bool octave::base_lexer::maybe_unput_comma_before_unary_op | ( | int | tok | ) |
Definition at line 6519 of file lex.cc.
References is_space_or_tab(), octave::lexical_feedback::previous_token_is_binop(), octave::lexical_feedback::previous_token_value(), octave::lexical_feedback::space_follows_previous_token(), text_yyinput(), whitespace_is_significant(), and xunput().
void octave::base_lexer::maybe_warn_language_extension_comment | ( | char | c | ) |
Definition at line 6217 of file lex.cc.
References warn_language_extension().
void octave::base_lexer::maybe_warn_separator_insert | ( | char | sep | ) |
Definition at line 6172 of file lex.cc.
References octave::filepos::line(), octave::lexical_feedback::m_fcn_file_full_name, octave::lexical_feedback::m_filepos, and warning_with_id().
|
delete |
size_t octave::base_lexer::pending_token_count | ( | void | ) | const |
Definition at line 6255 of file lex.cc.
References octave::lexical_feedback::m_tokens, and octave::lexical_feedback::token_cache::size().
void octave::base_lexer::pop_start_state | ( | void | ) |
Definition at line 6451 of file lex.cc.
References BEGIN, OCTAVE_YYG, start_state(), and start_state_stack.
Referenced by handle_close_bracket().
void octave::base_lexer::prep_for_file | ( | void | ) |
Definition at line 5357 of file lex.cc.
References INPUT_FILE_START, octave::lexical_feedback::m_reading_script_file, and push_start_state().
|
inherited |
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, octave::lexical_feedback::previous_token_value(), and SUB_EQ.
Referenced by maybe_unput_comma_before_unary_op().
|
inherited |
Definition at line 5185 of file lex.cc.
References octave::lexical_feedback::token_cache::front(), octave::token::iskeyword(), and octave::lexical_feedback::m_tokens.
|
inherited |
Definition at line 5192 of file lex.cc.
References octave::lexical_feedback::token_cache::front(), octave::lexical_feedback::m_allow_command_syntax, octave::lexical_feedback::m_tokens, and octave::token::may_be_command().
Referenced by looks_like_command_arg().
|
inherited |
Definition at line 5136 of file lex.cc.
References octave::lexical_feedback::token_cache::front(), octave::lexical_feedback::m_tokens, and octave::token::token_value().
Referenced by maybe_unput_comma_before_unary_op(), and octave::lexical_feedback::previous_token_is_binop().
|
inherited |
Definition at line 5143 of file lex.cc.
References octave::lexical_feedback::token_cache::front(), octave::lexical_feedback::m_tokens, and octave::token::token_value_is().
Referenced by octave::lexical_feedback::mark_previous_token_trailing_space().
void octave::base_lexer::push_start_state | ( | int | state | ) |
Definition at line 6441 of file lex.cc.
References BEGIN, OCTAVE_YYG, start_state(), start_state_stack, and octave::state.
Referenced by begin_string(), clear_start_state(), handle_op(), and prep_for_file().
void octave::base_lexer::push_token | ( | token * | tok | ) |
Definition at line 6240 of file lex.cc.
References m_scanner, octave::lexical_feedback::m_tokens, octave::lexical_feedback::token_cache::push(), yyget_lval, and YYSTYPE.
Referenced by count_token(), handle_end_of_input(), handle_fq_identifier(), handle_identifier(), handle_meta_identifier(), handle_number(), handle_op(), handle_superclass_identifier(), handle_token(), and make_keyword_token().
|
virtual |
Reimplemented in octave::lexer.
Definition at line 5334 of file lex.cc.
References octave::lexical_feedback::symbol_table_context::clear(), clear_start_state(), input_from_eval_string(), octave::interpreter::interactive(), m_comment_buf, octave::lexical_feedback::m_interpreter, octave::lexical_feedback::m_reading_classdef_file, octave::lexical_feedback::m_reading_fcn_file, octave::lexical_feedback::m_reading_script_file, m_scanner, octave::lexical_feedback::m_symtab_context, octave::lexical_feedback::reset(), octave::base_lexer::comment_buffer::reset(), and yyrestart.
Referenced by octave::lexer::reset(), and octave::base_parser::reset().
int octave::base_lexer::show_token | ( | int | tok | ) |
Definition at line 6624 of file lex.cc.
References debug_flag(), display_token(), and display_tokens().
Referenced by count_token_internal().
|
inherited |
Definition at line 5158 of file lex.cc.
References octave::lexical_feedback::token_cache::front(), octave::lexical_feedback::m_tokens, and octave::token::space_follows_token().
Referenced by looks_like_command_arg(), and maybe_unput_comma_before_unary_op().
|
inline |
Definition at line 739 of file lex.h.
Referenced by display_start_state(), pop_start_state(), and push_start_state().
int octave::base_lexer::text_yyinput | ( | void | ) |
Definition at line 5410 of file lex.cc.
References debug_flag(), display_character(), m_scanner, and xunput().
Referenced by looking_at_space(), and maybe_unput_comma_before_unary_op().
void octave::base_lexer::update_token_positions | ( | int | tok_len | ) |
Definition at line 5469 of file lex.cc.
References octave::filepos::increment_column(), octave::lexical_feedback::m_filepos, octave::lexical_feedback::m_tok_beg, and octave::lexical_feedback::m_tok_end.
Referenced by handle_identifier(), handle_number(), handle_op(), handle_superclass_identifier(), and make_keyword_token().
void octave::base_lexer::warn_language_extension | ( | const std::string & | msg | ) |
Definition at line 6202 of file lex.cc.
References octave::filepos::line(), octave::lexical_feedback::m_fcn_file_full_name, octave::lexical_feedback::m_filepos, and warning_with_id().
Referenced by maybe_warn_language_extension_comment(), warn_language_extension_continuation(), and warn_language_extension_operator().
void octave::base_lexer::warn_language_extension_continuation | ( | void | ) |
Definition at line 6224 of file lex.cc.
References warn_language_extension().
Referenced by handle_continuation().
void octave::base_lexer::warn_language_extension_operator | ( | const std::string & | op | ) |
Definition at line 6230 of file lex.cc.
References n, and warn_language_extension().
Referenced by handle_op().
void octave::base_lexer::warn_single_quote_string | ( | void | ) |
Definition at line 6187 of file lex.cc.
References octave::filepos::line(), octave::lexical_feedback::m_fcn_file_full_name, octave::lexical_feedback::m_filepos, and warning_with_id().
bool octave::base_lexer::whitespace_is_significant | ( | void | ) |
Definition at line 5789 of file lex.cc.
References octave::lexical_feedback::bbp_nesting_level::is_brace(), octave::lexical_feedback::bbp_nesting_level::is_bracket(), octave::lexical_feedback::m_looking_at_object_index, and octave::lexical_feedback::m_nesting_level.
Referenced by maybe_unput_comma_before_unary_op().
void octave::base_lexer::xunput | ( | char | c | ) |
Definition at line 5461 of file lex.cc.
References flex_yytext(), and xunput().
void octave::base_lexer::xunput | ( | char | c, |
char * | buf | ||
) |
Definition at line 5445 of file lex.cc.
References debug_flag(), display_character(), m_scanner, and yyunput().
Referenced by looking_at_space(), maybe_unput_comma_before_unary_op(), text_yyinput(), and xunput().
|
inherited |
Definition at line 360 of file lex.h.
Referenced by octave::base_parser::disallow_command_syntax(), looks_like_command_arg(), octave::lexical_feedback::previous_token_may_be_command(), and octave::lexical_feedback::reset().
|
inherited |
Definition at line 364 of file lex.h.
Referenced by finish_comment(), handle_close_bracket(), handle_continuation(), handle_identifier(), handle_number(), handle_op(), make_keyword_token(), and octave::lexical_feedback::reset().
|
inherited |
Definition at line 459 of file lex.h.
Referenced by handle_end_of_input(), and octave::lexical_feedback::reset().
|
inherited |
Definition at line 447 of file lex.h.
Referenced by handle_close_bracket(), and octave::lexical_feedback::reset().
|
inherited |
Definition at line 444 of file lex.h.
Referenced by handle_close_bracket(), and octave::lexical_feedback::reset().
|
inherited |
Definition at line 441 of file lex.h.
Referenced by octave::lexer::fill_flex_buffer(), octave::base_parser::finish_function(), make_keyword_token(), and octave::lexical_feedback::reset().
|
inherited |
Definition at line 462 of file lex.h.
Referenced by finish_command_arg(), and octave::lexical_feedback::reset().
comment_buffer octave::base_lexer::m_comment_buf |
Definition at line 721 of file lex.h.
Referenced by finish_comment(), octave::base_parser::finish_if_command(), octave::base_parser::finish_switch_command(), octave::base_parser::make_do_until_command(), octave::base_parser::make_for_command(), octave::base_parser::make_try_command(), octave::base_parser::make_unwind_command(), octave::base_parser::make_while_command(), reset(), and octave::base_parser::start_function().
|
inherited |
Definition at line 485 of file lex.h.
Referenced by finish_comment(), handle_continuation(), and octave::lexical_feedback::reset().
|
inherited |
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(), make_keyword_token(), and octave::lexical_feedback::reset().
|
inherited |
Definition at line 453 of file lex.h.
Referenced by make_keyword_token(), octave::base_parser::recover_from_parsing_function(), and octave::lexical_feedback::reset().
|
inherited |
Definition at line 500 of file lex.h.
Referenced by octave::base_parser::finish_function(), octave::base_parser::make_script(), octave::lexical_feedback::reset(), and octave::base_parser::start_function().
|
inherited |
Definition at line 357 of file lex.h.
Referenced by octave::base_parser::at_end_of_input(), and octave::lexical_feedback::reset().
|
inherited |
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(), make_keyword_token(), octave::base_parser::make_script(), octave::base_parser::maybe_warn_assign_as_truth_value(), octave::base_parser::maybe_warn_missing_semi(), maybe_warn_separator_insert(), octave::base_parser::maybe_warn_variable_switch_label(), octave::lexical_feedback::reset(), octave::push_parser::run(), octave::parser::run(), octave::base_parser::start_function(), warn_language_extension(), and warn_single_quote_string().
|
inherited |
Definition at line 494 of file lex.h.
Referenced by octave::base_parser::finish_function(), handle_end_of_input(), octave::base_parser::make_classdef(), octave::base_parser::make_fcn_name(), octave::base_parser::make_script(), octave::lexical_feedback::reset(), and octave::base_parser::start_function().
|
inherited |
Definition at line 469 of file lex.h.
Referenced by begin_string(), octave::base_parser::bison_error(), handle_continuation(), handle_end_of_input(), handle_fq_identifier(), handle_meta_identifier(), handle_superclass_identifier(), make_keyword_token(), maybe_warn_separator_insert(), octave::lexical_feedback::reset(), update_token_positions(), warn_language_extension(), and warn_single_quote_string().
|
inherited |
Definition at line 428 of file lex.h.
Referenced by make_keyword_token(), octave::lexical_feedback::reset(), and octave::base_parser::start_function().
|
inherited |
Definition at line 491 of file lex.h.
Referenced by octave::lexer::fill_flex_buffer(), octave::base_parser::finish_function(), make_keyword_token(), and octave::lexical_feedback::reset().
|
inherited |
Definition at line 488 of file lex.h.
Referenced by finish_comment(), octave::base_parser::make_script(), octave::lexical_feedback::reset(), and octave::base_parser::start_function().
input_buffer octave::base_lexer::m_input_buf |
Definition at line 718 of file lex.h.
Referenced by octave::push_lexer::append_input(), octave::lexer::fill_flex_buffer(), and octave::push_lexer::fill_flex_buffer().
|
inherited |
Definition at line 354 of file lex.h.
Referenced by octave::lexical_feedback::symbol_table_context::curr_scope(), debug_flag(), display_tokens(), octave::lexer::fill_flex_buffer(), increment_token_count(), input_from_tmp_history_file(), is_variable(), and reset().
|
inherited |
Definition at line 367 of file lex.h.
Referenced by octave::lexical_feedback::reset().
|
inherited |
Definition at line 377 of file lex.h.
Referenced by make_keyword_token(), and octave::lexical_feedback::reset().
|
inherited |
Definition at line 456 of file lex.h.
Referenced by octave::lexical_feedback::reset().
|
inherited |
Definition at line 392 of file lex.h.
Referenced by handle_identifier(), octave::base_parser::make_indirect_ref(), and octave::lexical_feedback::reset().
|
inherited |
Definition at line 381 of file lex.h.
Referenced by octave::lexical_feedback::reset().
|
inherited |
Definition at line 385 of file lex.h.
Referenced by octave::lexical_feedback::reset().
|
inherited |
Definition at line 507 of file lex.h.
Referenced by handle_close_bracket(), octave::lexical_feedback::init(), inside_any_object_index(), octave::lexical_feedback::reset(), and whitespace_is_significant().
|
inherited |
Definition at line 373 of file lex.h.
Referenced by octave::base_parser::recover_from_parsing_function(), and octave::lexical_feedback::reset().
|
inherited |
Definition at line 370 of file lex.h.
Referenced by make_keyword_token(), octave::base_parser::recover_from_parsing_function(), and octave::lexical_feedback::reset().
|
inherited |
Definition at line 388 of file lex.h.
Referenced by handle_close_bracket(), handle_identifier(), handle_number(), handle_op(), and octave::lexical_feedback::reset().
|
inherited |
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(), make_keyword_token(), octave::base_parser::make_while_command(), and octave::lexical_feedback::reset().
|
inherited |
Definition at line 415 of file lex.h.
Referenced by octave::base_parser::make_fcn_name(), make_keyword_token(), and octave::lexical_feedback::reset().
|
inherited |
Definition at line 522 of file lex.h.
Referenced by finish_comment(), handle_close_bracket(), octave::lexical_feedback::reset(), and whitespace_is_significant().
|
inherited |
Definition at line 503 of file lex.h.
Referenced by octave::lexical_feedback::reset(), and octave::base_parser::start_function().
|
inherited |
Definition at line 512 of file lex.h.
Referenced by octave::base_parser::make_fcn_name(), make_keyword_token(), octave::base_parser::recover_from_parsing_function(), and octave::lexical_feedback::reset().
|
inherited |
Definition at line 395 of file lex.h.
Referenced by handle_identifier(), and octave::lexical_feedback::reset().
|
inherited |
Definition at line 398 of file lex.h.
Referenced by octave::lexical_feedback::reset(), and octave::base_parser::start_function().
|
inherited |
Definition at line 401 of file lex.h.
Referenced by make_keyword_token(), octave::lexical_feedback::reset(), and octave::base_parser::start_function().
|
inherited |
Definition at line 406 of file lex.h.
Referenced by handle_op(), and octave::lexical_feedback::reset().
|
inherited |
Definition at line 418 of file lex.h.
Referenced by octave::lexical_feedback::reset(), and octave::base_parser::start_function().
|
inherited |
Definition at line 421 of file lex.h.
Referenced by octave::lexical_feedback::reset(), and octave::base_parser::start_function().
|
inherited |
Definition at line 410 of file lex.h.
Referenced by handle_op(), and octave::lexical_feedback::reset().
|
inherited |
Definition at line 515 of file lex.h.
Referenced by is_variable(), octave::lexical_feedback::mark_as_variables(), octave::lexical_feedback::maybe_mark_previous_token_as_variable(), and octave::lexical_feedback::reset().
|
inherited |
Definition at line 424 of file lex.h.
Referenced by octave::lexical_feedback::reset().
|
inherited |
Definition at line 437 of file lex.h.
Referenced by octave::base_parser::bison_error(), octave::base_parser::finish_classdef_file(), handle_end_of_input(), make_keyword_token(), octave::lexical_feedback::reset(), reset(), and octave::base_parser::start_function().
|
inherited |
Definition at line 431 of file lex.h.
Referenced by octave::base_parser::bison_error(), octave::base_parser::finish_function(), handle_end_of_input(), make_keyword_token(), octave::base_parser::recover_from_parsing_function(), octave::lexical_feedback::reset(), reset(), and octave::base_parser::start_function().
|
inherited |
Definition at line 434 of file lex.h.
Referenced by octave::base_parser::bison_error(), handle_end_of_input(), octave::base_parser::make_decl_command(), make_keyword_token(), prep_for_file(), octave::base_parser::push_fcn_symtab(), octave::lexical_feedback::reset(), reset(), and octave::base_parser::start_function().
void* octave::base_lexer::m_scanner |
Definition at line 715 of file lex.h.
Referenced by ~base_lexer(), current_token(), flex_yyleng(), flex_yytext(), init(), push_token(), reset(), octave::push_parser::run(), text_yyinput(), and xunput().
|
inherited |
Definition at line 479 of file lex.h.
Referenced by finish_command_arg(), and octave::lexical_feedback::reset().
|
inherited |
Definition at line 518 of file lex.h.
Referenced by 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(), octave::lexical_feedback::reset(), reset(), and octave::base_parser::start_function().
|
inherited |
Definition at line 475 of file lex.h.
Referenced by begin_string(), count_token(), finish_command_arg(), handle_end_of_input(), handle_fq_identifier(), handle_identifier(), handle_meta_identifier(), handle_number(), handle_op(), handle_superclass_identifier(), handle_token(), make_keyword_token(), octave::lexical_feedback::reset(), and update_token_positions().
|
inherited |
Definition at line 476 of file lex.h.
Referenced by count_token(), finish_command_arg(), handle_end_of_input(), handle_fq_identifier(), handle_identifier(), handle_meta_identifier(), handle_number(), handle_op(), handle_superclass_identifier(), handle_token(), make_keyword_token(), octave::lexical_feedback::reset(), and update_token_positions().
|
inherited |
Definition at line 466 of file lex.h.
Referenced by increment_token_count(), make_keyword_token(), and octave::lexical_feedback::reset().
|
inherited |
Definition at line 525 of file lex.h.
Referenced by octave::lexical_feedback::~lexical_feedback(), octave::lexical_feedback::mark_previous_token_trailing_space(), octave::lexical_feedback::maybe_mark_previous_token_as_variable(), pending_token_count(), octave::lexical_feedback::previous_token_is_keyword(), octave::lexical_feedback::previous_token_may_be_command(), octave::lexical_feedback::previous_token_value(), octave::lexical_feedback::previous_token_value_is(), push_token(), octave::lexical_feedback::reset(), and octave::lexical_feedback::space_follows_previous_token().
|
protected |
Definition at line 759 of file lex.h.
Referenced by clear_start_state(), pop_start_state(), and push_start_state().