| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 int keyword_len; | 93 int keyword_len; |
| 94 String* keyword_symbol; | 94 String* keyword_symbol; |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 // Initialize Scanner tables. | 97 // Initialize Scanner tables. |
| 98 void InitKeywordTable(); | 98 void InitKeywordTable(); |
| 99 | 99 |
| 100 // Reads next lookahead character. | 100 // Reads next lookahead character. |
| 101 void ReadChar(); | 101 void ReadChar(); |
| 102 | 102 |
| 103 // Read and discard characters up to end of line. |
| 104 void SkipLine(); |
| 105 |
| 103 // Recognizes token 'kind' and reads next character in input. | 106 // Recognizes token 'kind' and reads next character in input. |
| 104 void Recognize(Token::Kind kind) { | 107 void Recognize(Token::Kind kind) { |
| 105 ReadChar(); | 108 ReadChar(); |
| 106 current_token_.kind = kind; | 109 current_token_.kind = kind; |
| 107 } | 110 } |
| 108 | 111 |
| 109 int32_t LookaheadChar(int how_many); | 112 int32_t LookaheadChar(int how_many); |
| 110 | 113 |
| 111 void ErrorMsg(const char* msg); | 114 void ErrorMsg(const char* msg); |
| 112 | 115 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 const String& private_key_; | 194 const String& private_key_; |
| 192 | 195 |
| 193 SourcePosition c0_pos_; // Source position of lookahead character c0_. | 196 SourcePosition c0_pos_; // Source position of lookahead character c0_. |
| 194 KeywordTable keywords_[Token::numKeywords]; | 197 KeywordTable keywords_[Token::numKeywords]; |
| 195 }; | 198 }; |
| 196 | 199 |
| 197 | 200 |
| 198 } // namespace dart | 201 } // namespace dart |
| 199 | 202 |
| 200 #endif // VM_SCANNER_H_ | 203 #endif // VM_SCANNER_H_ |
| OLD | NEW |