Mercurial > hg > octave-lyh
diff libinterp/parse-tree/lex.h @ 16126:5c885c13bfa3
localize use of yylval.tok_val in lexical_feedback member functions
* lex.h, lex.ll (lexical_feedback::push_token): New function.
(lexical_feedback::current_token): New function.
(lexical_feedback::token_stack): Now private.
* lex.ll (TOK_PUSH_AND_RETURN, BIN_OP_RETURN_INTERNAL,
lexical_feedback::is_keyword_token, lexical_feedback::handle_number,
lexical_feedback::handle_string,
lexical_feedback::handle_superclass_identifier,
lexical_feedback::handle_meta_identifier,
lexical_feedback::handle_identifier, lexical_feedback::display_token):
Use push_token and current_token instead of accessing yylval.tok_val
directly.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 26 Feb 2013 15:13:43 -0500 |
parents | 96a58f197f93 |
children | 210039e91ad6 |
line wrap: on
line diff
--- a/libinterp/parse-tree/lex.h +++ b/libinterp/parse-tree/lex.h @@ -283,6 +283,10 @@ void gripe_matlab_incompatible_operator (const std::string& op); + void push_token (token *); + + token *current_token (void); + void display_token (int tok); void lexer_debug (const char *pattern, const char *text); @@ -383,16 +387,16 @@ // a paren? bbp_nesting_level nesting_level; + // For unwind protect. + static void cleanup (lexical_feedback *lexer) { delete lexer; } + +private: + // Stack to hold tokens so that we can delete them when the parser is // reset and avoid growing forever just because we are stashing some // information. std::stack <token*> token_stack; - // For unwind protect. - static void cleanup (lexical_feedback *lexer) { delete lexer; } - -private: - // No copying! lexical_feedback (const lexical_feedback&);