GNU Octave
4.0.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
|
#include "token.h"
Public Types | |
enum | end_tok_type { simple_end, classdef_end, enumeration_end, events_end, for_end, function_end, if_end, methods_end, parfor_end, properties_end, switch_end, try_catch_end, unwind_protect_end, while_end } |
enum | token_type { generic_token, keyword_token, string_token, double_token, ettype_token, sym_rec_token, scls_name_token } |
Public Member Functions | |
token (int tv, int l=-1, int c=-1) | |
token (int tv, bool is_keyword, int l=-1, int c=-1) | |
token (int tv, const char *s, int l=-1, int c=-1) | |
token (int tv, const std::string &s, int l=-1, int c=-1) | |
token (int tv, double d, const std::string &s=std::string(), int l=-1, int c=-1) | |
token (int tv, end_tok_type t, int l=-1, int c=-1) | |
token (int tv, symbol_table::symbol_record *s, int l=-1, int c=-1) | |
token (int tv, const std::string &mth, const std::string &cls, int l=-1, int c=-1) | |
~token (void) | |
int | column (void) const |
end_tok_type | ettype (void) const |
bool | is_keyword (void) const |
bool | is_symbol (void) const |
int | line (void) const |
void | mark_may_be_command (void) |
void | mark_trailing_space (void) |
bool | may_be_command (void) const |
double | number (void) const |
bool | space_follows_token (void) const |
std::string | superclass_class_name (void) |
std::string | superclass_method_name (void) |
symbol_table::symbol_record * | sym_rec (void) |
std::string | symbol_name (void) const |
std::string | text (void) const |
std::string | text_rep (void) |
int | token_value (void) const |
bool | token_value_is (int tv) const |
token_type | ttype (void) const |
Private Member Functions | |
token (const token &tok) | |
token & | operator= (const token &tok) |
Private Attributes | |
union { | |
end_tok_type et | |
double num | |
struct { | |
std::string * class_nm | |
std::string * method_nm | |
} sc | |
symbol_table::symbol_record * sr | |
std::string * str | |
}; | |
int | column_num |
int | line_num |
bool | maybe_cmd |
std::string | orig_text |
int | tok_val |
bool | tspc |
token_type | type_tag |
enum token::end_tok_type |
enum token::token_type |
Definition at line 35 of file token.cc.
References column_num, generic_token, line_num, maybe_cmd, tok_val, tspc, and type_tag.
Definition at line 45 of file token.cc.
References column_num, generic_token, keyword_token, line_num, maybe_cmd, tok_val, tspc, and type_tag.
Definition at line 55 of file token.cc.
References column_num, line_num, maybe_cmd, str, string_token, tok_val, tspc, and type_tag.
Definition at line 66 of file token.cc.
References column_num, line_num, maybe_cmd, str, string_token, tok_val, tspc, and type_tag.
token::token | ( | int | tv, |
end_tok_type | t, | ||
int | l = -1 , |
||
int | c = -1 |
||
) |
Definition at line 89 of file token.cc.
References column_num, et, ettype_token, line_num, maybe_cmd, tok_val, tspc, and type_tag.
token::token | ( | int | tv, |
symbol_table::symbol_record * | s, | ||
int | l = -1 , |
||
int | c = -1 |
||
) |
Definition at line 100 of file token.cc.
References column_num, line_num, maybe_cmd, sr, sym_rec_token, tok_val, tspc, and type_tag.
Definition at line 111 of file token.cc.
References column_num, line_num, maybe_cmd, sc, scls_name_token, tok_val, tspc, and type_tag.
token::~token | ( | void | ) |
Definition at line 124 of file token.cc.
References sc, scls_name_token, str, string_token, and type_tag.
|
private |
|
inline |
Definition at line 87 of file token.h.
Referenced by octave_base_parser::end_token_ok(), octave_base_parser::finish_if_command(), octave_base_parser::finish_switch_command(), octave_base_parser::make_assign_op(), octave_base_parser::make_binary_op(), octave_base_parser::make_boolean_op(), octave_base_parser::make_break_command(), octave_base_parser::make_classdef(), octave_base_parser::make_classdef_enum_block(), octave_base_parser::make_classdef_events_block(), octave_base_parser::make_classdef_methods_block(), octave_base_parser::make_classdef_properties_block(), octave_base_parser::make_constant(), octave_base_parser::make_continue_command(), octave_base_parser::make_decl_command(), octave_base_parser::make_do_until_command(), octave_base_parser::make_elseif_clause(), octave_base_parser::make_fcn_handle(), octave_base_parser::make_for_command(), octave_base_parser::make_postfix_op(), octave_base_parser::make_prefix_op(), octave_base_parser::make_return_command(), octave_base_parser::make_switch_case(), octave_base_parser::make_try_command(), octave_base_parser::make_unwind_command(), and octave_base_parser::make_while_command().
token::end_tok_type token::ettype | ( | void | ) | const |
Definition at line 164 of file token.cc.
References et, ettype_token, and type_tag.
Referenced by octave_base_parser::end_token_ok().
|
inline |
Definition at line 89 of file token.h.
Referenced by lexical_feedback::previous_token_is_keyword().
|
inline |
Definition at line 94 of file token.h.
Referenced by lexical_feedback::maybe_mark_previous_token_as_variable().
|
inline |
Definition at line 86 of file token.h.
Referenced by octave_base_parser::end_token_ok(), octave_base_parser::finish_if_command(), octave_base_parser::finish_switch_command(), octave_base_parser::make_assign_op(), octave_base_parser::make_binary_op(), octave_base_parser::make_boolean_op(), octave_base_parser::make_break_command(), octave_base_parser::make_classdef(), octave_base_parser::make_classdef_enum_block(), octave_base_parser::make_classdef_events_block(), octave_base_parser::make_classdef_methods_block(), octave_base_parser::make_classdef_properties_block(), octave_base_parser::make_constant(), octave_base_parser::make_continue_command(), octave_base_parser::make_decl_command(), octave_base_parser::make_do_until_command(), octave_base_parser::make_elseif_clause(), octave_base_parser::make_fcn_handle(), octave_base_parser::make_for_command(), octave_base_parser::make_postfix_op(), octave_base_parser::make_prefix_op(), octave_base_parser::make_return_command(), octave_base_parser::make_switch_case(), octave_base_parser::make_try_command(), octave_base_parser::make_unwind_command(), and octave_base_parser::make_while_command().
|
inline |
Definition at line 77 of file token.h.
Referenced by octave_base_lexer::handle_identifier().
|
inline |
Definition at line 80 of file token.h.
Referenced by lexical_feedback::mark_previous_token_trailing_space().
|
inline |
Definition at line 78 of file token.h.
Referenced by lexical_feedback::previous_token_may_be_command().
double token::number | ( | void | ) | const |
Definition at line 151 of file token.cc.
References double_token, num, and type_tag.
Referenced by octave_base_lexer::display_token(), and octave_base_parser::make_constant().
|
inline |
Definition at line 81 of file token.h.
Referenced by lexical_feedback::space_follows_previous_token().
std::string token::superclass_class_name | ( | void | ) |
Definition at line 185 of file token.cc.
References sc, scls_name_token, and type_tag.
std::string token::superclass_method_name | ( | void | ) |
Definition at line 178 of file token.cc.
References sc, scls_name_token, and type_tag.
symbol_table::symbol_record * token::sym_rec | ( | void | ) |
Definition at line 171 of file token.cc.
References sr, sym_rec_token, and type_tag.
Referenced by octave_base_lexer::display_token().
std::string token::symbol_name | ( | void | ) | const |
Definition at line 144 of file token.cc.
References symbol_table::symbol_record::name(), sr, sym_rec_token, and type_tag.
Referenced by lexical_feedback::maybe_mark_previous_token_as_variable().
std::string token::text | ( | void | ) | const |
Definition at line 137 of file token.cc.
References str, string_token, and type_tag.
Referenced by octave_base_lexer::display_token(), octave_base_parser::make_constant(), and octave_base_parser::make_fcn_handle().
std::string token::text_rep | ( | void | ) |
Definition at line 192 of file token.cc.
References orig_text.
Referenced by octave_base_parser::make_constant().
|
inline |
Definition at line 83 of file token.h.
Referenced by lexical_feedback::previous_token_value().
Definition at line 84 of file token.h.
Referenced by lexical_feedback::previous_token_value_is().
token::token_type token::ttype | ( | void | ) | const |
union { ... } |
end_tok_type token::et |
|
private |
Definition at line 137 of file token.h.
Referenced by text_rep(), and token().
struct { ... } token::sc |
Referenced by superclass_class_name(), superclass_method_name(), token(), and ~token().
symbol_table::symbol_record* token::sr |
Definition at line 130 of file token.h.
Referenced by sym_rec(), symbol_name(), and token().
std::string* token::str |
|
private |
Definition at line 124 of file token.h.
Referenced by ettype(), number(), superclass_class_name(), superclass_method_name(), sym_rec(), symbol_name(), text(), token(), ttype(), and ~token().