Mercurial > hg > octave-nkf
diff libinterp/parse-tree/lex.h @ 16275:dd7de0345124
10/10 commits reworking the lexer
This and the previous nine changesets completely revise the way
significant whitespace is handled inside matrix and cell lists. Now
instead of indefinite look ahead, we keep track of all tokens read and
look back to previous tokens and ahead at most one character. If the
surrounding context changes the parse, we unput the text for the
current token and alter the start state, unput an additional character
(typically a comma or semicolon) or both.
Comments are now handled by a separate set of exlusive start states
and there is no explicit handling of comments within any other
patterns.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 11 Mar 2013 14:40:29 -0400 |
parents | 15f55df088e7 |
children | 26fd237a3427 8cb65fd72164 |
line wrap: on
line diff
--- a/libinterp/parse-tree/lex.h +++ b/libinterp/parse-tree/lex.h @@ -490,6 +490,8 @@ void xunput (char c); + bool looking_at_space (void); + bool inside_any_object_index (void); int is_keyword_token (const std::string& s); @@ -591,28 +593,21 @@ void display_start_state (void) const; - int handle_op (const char *pattern, int tok, bool convert = false, - bool bos = false, bool qit = false); + int handle_op (const char *pattern, int tok, bool bos = false); - int handle_incompatible_op (const char *pattern, int tok, - bool convert = false, bool bos = false, - bool qit = false); + int handle_incompatible_op (const char *pattern, int tok, bool bos = false); bool maybe_unput_comma_before_unary_op (int tok); - int handle_unary_op (const char *pattern, int tok, bool convert = false, - bool bos = false, bool qit = false); + int handle_unary_op (int tok, bool bos = false); - int handle_incompatible_unary_op (const char *pattern, int tok, - bool convert = false, bool bos = false, - bool qit = false); + int handle_incompatible_unary_op (int tok, bool bos = false); int handle_assign_op (const char *pattern, int tok); int handle_incompatible_assign_op (const char *pattern, int tok); - int handle_op_internal (const char *pattern, int tok, bool convert, - bool bos, bool qit, bool compat); + int handle_op_internal (int tok, bool bos, bool compat); int handle_token (const std::string& name, int tok);