#include "lex.h"
Classes | |
class | comment_buffer |
class | input_buffer |
Protected Attributes | |
std::stack< int > | start_state_stack |
|
inline |
|
virtual |
Definition at line 5265 of file lex.cc.
References m_scanner, and yylex_destroy.
void base_lexer::check_comment_for_hash_char | ( | const char * | txt, |
std::size_t | len | ||
) |
Definition at line 6415 of file lex.cc.
References len, and lexical_feedback::m_comment_uses_hash_char.
int base_lexer::count_token | ( | int | tok | ) |
Definition at line 6856 of file lex.cc.
References lexical_feedback::m_tok_beg, and lexical_feedback::m_tok_end.
token * base_lexer::current_token | ( | ) |
Definition at line 6500 of file lex.cc.
References m_scanner, yyget_lval, and YYSTYPE.
bool base_lexer::debug_flag | ( | ) | const |
Definition at line 6647 of file lex.cc.
References interpreter::get_settings(), settings::lexer_debug_flag(), and lexical_feedback::m_interpreter.
void base_lexer::display_start_state | ( | ) | const |
Definition at line 6721 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, and SQ_STRING_START.
void base_lexer::display_token | ( | int | tok | ) |
Definition at line 6513 of file lex.cc.
References ADD_EQ, AND_EQ, BREAK, CASE, CATCH, CLASSDEF, CLEANUP, CONTINUE, DIV_EQ, DO, DQ_STRING, EDIV, EDIV_EQ, ELEFTDIV, ELEFTDIV_EQ, ELSE, ELSEIF, EMUL, EMUL_EQ, END, END_OF_INPUT, EPOW, EPOW_EQ, EVENTS, EXPR_AND, EXPR_AND_AND, EXPR_EQ, EXPR_GE, EXPR_GT, EXPR_LE, EXPR_LT, EXPR_NE, EXPR_OR, EXPR_OR_OR, FCN, FCN_HANDLE, FOR, FUNC_RET, GET, GLOBAL, HERMITIAN, IF, INPUT_FILE, LEFTDIV, LEFTDIV_EQ, LEXICAL_ERROR, METAQUERY, METHODS, MINUS_MINUS, MUL_EQ, NAME, NUMBER, token::number(), OR_EQ, OTHERWISE, PERSISTENT, PLUS_PLUS, POW, POW_EQ, octave_value::print_raw(), PROPERTIES, SET, SQ_STRING, STRUCT_ELT, SUB_EQ, SUPERCLASSREF, SWITCH, token::text(), TRANSPOSE, TRY, UNTIL, UNWIND, and WHILE.
bool base_lexer::display_tokens | ( | ) | const |
Definition at line 6654 of file lex.cc.
References settings::display_tokens(), interpreter::get_settings(), and lexical_feedback::m_interpreter.
void base_lexer::fatal_error | ( | const char * | msg | ) |
|
pure virtual |
Implemented in push_lexer, and lexer.
int base_lexer::finish_command_arg | ( | ) |
Definition at line 6832 of file lex.cc.
References lexical_feedback::m_command_arg_paren_count, lexical_feedback::m_string_text, lexical_feedback::m_tok_beg, lexical_feedback::m_tok_end, and SQ_STRING.
void base_lexer::finish_comment | ( | comment_elt::comment_type | typ | ) |
int base_lexer::flex_yyleng | ( | ) |
Definition at line 5362 of file lex.cc.
References m_scanner, and yyget_leng.
char * base_lexer::flex_yytext | ( | ) |
Definition at line 5356 of file lex.cc.
References m_scanner, and yyget_text.
bool base_lexer::fq_identifier_contains_keyword | ( | const std::string & | s | ) |
Definition at line 5746 of file lex.cc.
References iskeyword().
|
inline |
Definition at line 664 of file lex.h.
Referenced by base_parser::make_statement().
int base_lexer::handle_close_bracket | ( | int | bracket_type | ) |
Definition at line 6209 of file lex.cc.
References lexical_feedback::m_at_beginning_of_statement, lexical_feedback::m_braceflag, lexical_feedback::m_bracketflag, lexical_feedback::m_looking_at_object_index, lexical_feedback::m_looking_for_object_index, lexical_feedback::m_nesting_level, lexical_feedback::bbp_nesting_level::none(), panic_impossible, and lexical_feedback::bbp_nesting_level::remove().
int base_lexer::handle_end_of_input | ( | ) |
Definition at line 5331 of file lex.cc.
References END_OF_INPUT, filepos::line(), lexical_feedback::m_block_comment_nesting_level, lexical_feedback::m_fcn_file_name, lexical_feedback::m_filepos, lexical_feedback::m_reading_classdef_file, lexical_feedback::m_reading_fcn_file, lexical_feedback::m_reading_script_file, lexical_feedback::m_tok_beg, lexical_feedback::m_tok_end, and warning().
int base_lexer::handle_identifier | ( | ) |
Definition at line 6346 of file lex.cc.
References lexical_feedback::m_at_beginning_of_statement, lexical_feedback::m_looking_at_indirect_ref, lexical_feedback::m_looking_for_object_index, lexical_feedback::m_parsing_anon_fcn_body, lexical_feedback::m_tok_beg, lexical_feedback::m_tok_end, token::mark_may_be_command(), NAME, and STRUCT_ELT.
int base_lexer::handle_number | ( | ) |
Definition at line 5937 of file lex.cc.
References imag(), and OCTAVE_LOCAL_BUFFER.
int base_lexer::handle_number | ( | ) |
int base_lexer::handle_number | ( | ) |
int base_lexer::handle_number | ( | ) |
int base_lexer::handle_number | ( | ) |
int base_lexer::handle_op | ( | int | tok, |
bool | bos = false , |
||
bool | compat = true |
||
) |
Definition at line 6793 of file lex.cc.
References EXPR_AND, EXPR_LT, FQ_IDENT_START, lexical_feedback::m_at_beginning_of_statement, lexical_feedback::m_looking_for_object_index, lexical_feedback::m_parsing_classdef_decl, lexical_feedback::m_parsing_classdef_superclass, lexical_feedback::m_tok_beg, and lexical_feedback::m_tok_end.
int base_lexer::handle_token | ( | int | tok, |
token * | tok_val = nullptr |
||
) |
Definition at line 6845 of file lex.cc.
References lexical_feedback::m_tok_beg, and lexical_feedback::m_tok_end.
void base_lexer::increment_token_count | ( | ) |
Definition at line 6661 of file lex.cc.
References interpreter::get_settings(), settings::increment_token_count(), lexical_feedback::m_interpreter, and lexical_feedback::m_token_count.
void base_lexer::init | ( | ) |
Definition at line 5271 of file lex.cc.
References m_scanner, yylex_init, and yyset_extra.
|
inlinevirtual |
Reimplemented in lexer.
Definition at line 725 of file lex.h.
Referenced by base_parser::make_anon_fcn_handle().
|
inlinevirtual |
|
inlinevirtual |
Reimplemented in lexer.
Definition at line 721 of file lex.h.
Referenced by base_parser::make_anon_fcn_handle().
bool base_lexer::input_from_tmp_history_file | ( | ) |
Definition at line 6684 of file lex.cc.
References interpreter::get_history_system(), history_system::input_from_tmp_file(), and lexical_feedback::m_interpreter.
Referenced by base_parser::start_function().
|
inlinevirtual |
Reimplemented in push_lexer, and lexer.
bool base_lexer::inside_any_object_index | ( | ) |
Definition at line 5447 of file lex.cc.
References lexical_feedback::m_looking_at_object_index.
|
inlinevirtual |
Reimplemented in push_lexer.
bool base_lexer::looks_like_command_arg | ( | ) |
Definition at line 6234 of file lex.cc.
References lexical_feedback::m_allow_command_syntax, lexical_feedback::previous_token_may_be_command(), and lexical_feedback::space_follows_previous_token().
int base_lexer::make_keyword_token | ( | const std::string & | s | ) |
Definition at line 5464 of file lex.cc.
References token::arguments_end, arguments_kw, break_kw, case_kw, catch_kw, token::classdef_end, classdef_kw, continue_kw, do_kw, else_kw, elseif_kw, end_kw, end_try_catch_kw, end_unwind_protect_kw, endarguments_kw, endclassdef_kw, endenumeration_kw, endevents_kw, endfor_kw, endfunction_kw, endif_kw, endmethods_kw, endparfor_kw, endproperties_kw, endspmd_kw, endswitch_kw, endwhile_kw, token::enumeration_end, enumeration_kw, token::events_end, events_kw, token::for_end, for_kw, token::function_end, function_kw, get_kw, global_kw, token::if_end, if_kw, octave_kw_hash::in_word_set(), octave_kw::kw_id, filepos::line(), lexical_feedback::m_arguments_is_keyword, lexical_feedback::m_at_beginning_of_statement, lexical_feedback::m_buffer_function_text, lexical_feedback::m_classdef_element_names_are_keywords, lexical_feedback::m_current_input_line, lexical_feedback::m_defining_fcn, lexical_feedback::m_fcn_file_full_name, lexical_feedback::m_filepos, lexical_feedback::m_force_script, lexical_feedback::m_function_text, lexical_feedback::m_looking_at_decl_list, lexical_feedback::m_looking_at_return_list, lexical_feedback::m_looping, lexical_feedback::m_maybe_classdef_get_set_method, lexical_feedback::m_parsed_function_name, lexical_feedback::m_reading_classdef_file, lexical_feedback::m_reading_fcn_file, lexical_feedback::m_reading_script_file, lexical_feedback::m_tok_beg, lexical_feedback::m_tok_end, lexical_feedback::m_token_count, magic_file_kw, magic_line_kw, token::methods_end, methods_kw, otherwise_kw, panic_impossible, token::parfor_end, parfor_kw, persistent_kw, token::properties_end, properties_kw, return_kw, set_kw, token::simple_end, token::spmd_end, spmd_kw, token::switch_end, switch_kw, octave_kw::tok, token::try_catch_end, try_kw, until_kw, unwind_protect_cleanup_kw, token::unwind_protect_end, unwind_protect_kw, token::while_end, and while_kw.
bool base_lexer::maybe_unput_comma_before_unary_op | ( | int | tok | ) |
Definition at line 6770 of file lex.cc.
References lexical_feedback::previous_token_value(), and lexical_feedback::space_follows_previous_token().
void base_lexer::maybe_warn_language_extension_comment | ( | char | c | ) |
void base_lexer::maybe_warn_separator_insert | ( | char | sep | ) |
Definition at line 6428 of file lex.cc.
References filepos::line(), lexical_feedback::m_fcn_file_full_name, lexical_feedback::m_filepos, and warning_with_id().
std::size_t base_lexer::pending_token_count | ( | ) | const |
Definition at line 6507 of file lex.cc.
References lexical_feedback::m_tokens, and lexical_feedback::token_cache::size().
void base_lexer::pop_start_state | ( | ) |
Definition at line 6702 of file lex.cc.
References BEGIN, and OCTAVE_YYG.
void base_lexer::prep_for_file | ( | ) |
Definition at line 5315 of file lex.cc.
References INPUT_FILE_START, and lexical_feedback::m_reading_script_file.
void base_lexer::push_token | ( | token * | tok | ) |
Definition at line 6492 of file lex.cc.
References m_scanner, lexical_feedback::m_tokens, lexical_feedback::token_cache::push(), yyget_lval, and YYSTYPE.
|
virtual |
Reimplemented in lexer.
Definition at line 5292 of file lex.cc.
References lexical_feedback::symbol_table_context::clear(), interpreter::interactive(), lexical_feedback::m_interpreter, lexical_feedback::m_reading_classdef_file, lexical_feedback::m_reading_fcn_file, lexical_feedback::m_reading_script_file, m_scanner, lexical_feedback::m_symtab_context, lexical_feedback::reset(), and yyrestart.
Referenced by lexer::reset(), and base_parser::reset().
void base_lexer::update_token_positions | ( | int | tok_len | ) |
Definition at line 5427 of file lex.cc.
References filepos::increment_column(), lexical_feedback::m_filepos, lexical_feedback::m_tok_beg, and lexical_feedback::m_tok_end.
void base_lexer::warn_deprecated_syntax | ( | const std::string & | msg | ) |
Definition at line 6481 of file lex.cc.
References filepos::line(), lexical_feedback::m_fcn_file_full_name, lexical_feedback::m_filepos, and warning_with_id().
void base_lexer::warn_language_extension | ( | const std::string & | msg | ) |
Definition at line 6443 of file lex.cc.
References filepos::line(), lexical_feedback::m_fcn_file_full_name, lexical_feedback::m_filepos, and warning_with_id().
void base_lexer::warn_language_extension_operator | ( | const std::string & | op | ) |
bool base_lexer::whitespace_is_significant | ( | ) |
Definition at line 5774 of file lex.cc.
References lexical_feedback::bbp_nesting_level::is_brace(), lexical_feedback::bbp_nesting_level::is_bracket(), lexical_feedback::m_looking_at_object_index, and lexical_feedback::m_nesting_level.
comment_buffer base_lexer::m_comment_buf |
Definition at line 717 of file lex.h.
Referenced by base_parser::finish_if_command(), base_parser::finish_switch_command(), base_parser::make_do_until_command(), base_parser::make_for_command(), base_parser::make_try_command(), base_parser::make_unwind_command(), base_parser::make_while_command(), and base_parser::start_function().
input_buffer base_lexer::m_input_buf |