OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 // | 4 // |
5 // Scanner class for the Dart language. The scanner reads source text | 5 // Scanner class for the Dart language. The scanner reads source text |
6 // and produces a stream of tokens which is used by the parser. | 6 // and produces a stream of tokens which is used by the parser. |
7 // | 7 // |
8 | 8 |
9 #ifndef VM_SCANNER_H_ | 9 #ifndef VM_SCANNER_H_ |
10 #define VM_SCANNER_H_ | 10 #define VM_SCANNER_H_ |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 void ScanIdent() { | 192 void ScanIdent() { |
193 ScanIdentChars(true); | 193 ScanIdentChars(true); |
194 } | 194 } |
195 void ScanIdentNoDollar() { | 195 void ScanIdentNoDollar() { |
196 ScanIdentChars(false); | 196 ScanIdentChars(false); |
197 } | 197 } |
198 | 198 |
199 // Reads a number literal. | 199 // Reads a number literal. |
200 void ScanNumber(bool dec_point_seen); | 200 void ScanNumber(bool dec_point_seen); |
201 | 201 |
202 void ScanLibraryTag(); | 202 void ScanScriptTag(); |
203 | 203 |
204 static void PrintTokens(const GrowableTokenStream& ts); | 204 static void PrintTokens(const GrowableTokenStream& ts); |
205 | 205 |
206 TokenDescriptor current_token_; // Current token. | 206 TokenDescriptor current_token_; // Current token. |
207 const String& source_; // The source text being tokenized. | 207 const String& source_; // The source text being tokenized. |
208 intptr_t source_length_; // The length of the source text. | 208 intptr_t source_length_; // The length of the source text. |
209 intptr_t lookahead_pos_; // Position of lookahead character | 209 intptr_t lookahead_pos_; // Position of lookahead character |
210 // within source_. | 210 // within source_. |
211 intptr_t token_start_; // Begin of current token in src_. | 211 intptr_t token_start_; // Begin of current token in src_. |
212 int32_t c0_; // Lookahead character. | 212 int32_t c0_; // Lookahead character. |
(...skipping 10 matching lines...) Expand all Loading... |
223 | 223 |
224 SourcePosition c0_pos_; // Source position of lookahead character c0_. | 224 SourcePosition c0_pos_; // Source position of lookahead character c0_. |
225 KeywordTable keywords_[Token::numKeywords]; | 225 KeywordTable keywords_[Token::numKeywords]; |
226 Array& keyword_symbol_table_; // Access to keyword symbols in object store. | 226 Array& keyword_symbol_table_; // Access to keyword symbols in object store. |
227 }; | 227 }; |
228 | 228 |
229 | 229 |
230 } // namespace dart | 230 } // namespace dart |
231 | 231 |
232 #endif // VM_SCANNER_H_ | 232 #endif // VM_SCANNER_H_ |
OLD | NEW |