Mercurial > octave
diff libinterp/parse-tree/token.h @ 29723:6858992dfadf
enter symbols into current scope in parser instead of lexer
* lex.h, lex.ll (base_lexer::is_variable): Eliminate unused SCOPE
argument. Change all uses.
* oct-parse.yy (identifer): Enter NAME in current scope here instead
of in lexer.
* token.h, token.cc (token::m_sr): Delete member variable and all uses.
(token::symbol_name): Delete method. Use token::text where this
method was used prevoiusly.
(token::sym_rec, token::is_symbol): Delete methods and all uses.
(token::sym_rec_token): Delete enum value and all uses. Use
string_token instead.
(token::isstring): New method.
(token::tok_info): Delete overload for symbol_record objects.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 01 Jun 2021 16:57:40 -0400 |
parents | 7854d5752dd2 |
children | c19f8cbe0fd5 |
line wrap: on
line diff
--- a/libinterp/parse-tree/token.h Wed Jun 02 20:05:45 2021 +0200 +++ b/libinterp/parse-tree/token.h Tue Jun 01 16:57:40 2021 -0400 @@ -32,7 +32,6 @@ #include "filepos.h" #include "ov.h" -#include "symrec.h" namespace octave { @@ -47,7 +46,6 @@ string_token, numeric_token, ettype_token, - sym_rec_token, scls_name_token, }; @@ -87,9 +85,6 @@ token (int tv, end_tok_type t, const filepos& beg_pos, const filepos& end_pos); - token (int tv, const symbol_record& s, const filepos& beg_pos, - const filepos& end_pos); - token (int tv, const std::string& mth, const std::string& cls, const filepos& beg_pos, const filepos& end_pos); @@ -125,17 +120,12 @@ return m_type_tag == keyword_token || m_type_tag == ettype_token; } - bool is_symbol (void) const - { - return m_type_tag == sym_rec_token; - } + bool isstring (void) const { return m_type_tag == string_token; } std::string text (void) const; - std::string symbol_name (void) const; octave_value number (void) const; token_type ttype (void) const; end_tok_type ettype (void) const; - symbol_record sym_rec (void) const; std::string superclass_method_name (void) const; std::string superclass_class_name (void) const; @@ -167,10 +157,6 @@ tok_info (end_tok_type et) : m_et (et) { } - tok_info (const symbol_record& sr) - : m_sr (new symbol_record (sr)) - { } - tok_info (const std::string& meth, const std::string& cls) : m_superclass_info (new superclass_info (meth, cls)) { } @@ -187,8 +173,6 @@ end_tok_type m_et; - symbol_record *m_sr; - struct superclass_info { superclass_info (void) = delete;