comparison libinterp/parse-tree/token.h @ 16257:db7f07b22b9b

1/10 commits reworking the lexer
author John W. Eaton <jwe@octave.org>
date Mon, 11 Mar 2013 14:14:41 -0400
parents 12bf6a3f8c45
children 5c32368509a2 15f55df088e7
comparison
equal deleted inserted replaced
16255:12bf6a3f8c45 16257:db7f07b22b9b
73 symbol_table::symbol_record *cls, 73 symbol_table::symbol_record *cls,
74 symbol_table::symbol_record *pkg, int l = -1, int c = -1); 74 symbol_table::symbol_record *pkg, int l = -1, int c = -1);
75 75
76 ~token (void); 76 ~token (void);
77 77
78 void mark_may_be_command (void) { maybe_cmd = true; }
79 bool may_be_command (void) const { return maybe_cmd; }
80
78 void mark_trailing_space (void) { tspc = true; } 81 void mark_trailing_space (void) { tspc = true; }
79 bool space_follows_token (void) const { return tspc; } 82 bool space_follows_token (void) const { return tspc; }
80 83
81 int token_value (void) const { return tok_val; } 84 int token_value (void) const { return tok_val; }
82 bool token_value_is (int tv) const { return tv == tok_val; } 85 bool token_value_is (int tv) const { return tv == tok_val; }
104 107
105 token (const token& tok); 108 token (const token& tok);
106 109
107 token& operator = (const token& tok); 110 token& operator = (const token& tok);
108 111
112 bool maybe_cmd;
109 bool tspc; 113 bool tspc;
110 int line_num; 114 int line_num;
111 int column_num; 115 int column_num;
112 int tok_val; 116 int tok_val;
113 token_type type_tag; 117 token_type type_tag;