| 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 | 124 |
| 125 void ErrorMsg(const char* msg); | 125 void ErrorMsg(const char* msg); |
| 126 | 126 |
| 127 // Scans entire source into a given stream of tokens. | 127 // Scans entire source into a given stream of tokens. |
| 128 void ScanAll(GrowableTokenStream* token_stream); | 128 void ScanAll(GrowableTokenStream* token_stream); |
| 129 | 129 |
| 130 // These functions return true if the given character is a letter, | 130 // These functions return true if the given character is a letter, |
| 131 // a decimal digit, a hexadecimal digit, etc. | 131 // a decimal digit, a hexadecimal digit, etc. |
| 132 static bool IsLetter(int32_t c); | 132 static bool IsLetter(int32_t c); |
| 133 static bool IsDecimalDigit(int32_t c); | 133 static bool IsDecimalDigit(int32_t c); |
| 134 static bool IsNumberStart(int32_t); |
| 134 static bool IsHexDigit(int32_t c); | 135 static bool IsHexDigit(int32_t c); |
| 135 static bool IsIdentStartChar(int32_t c); | 136 static bool IsIdentStartChar(int32_t c); |
| 136 static bool IsIdentChar(int32_t c); | 137 static bool IsIdentChar(int32_t c); |
| 137 | 138 |
| 138 // Skips up to next non-whitespace character. | 139 // Skips up to next non-whitespace character. |
| 139 void ConsumeWhiteSpace(); | 140 void ConsumeWhiteSpace(); |
| 140 | 141 |
| 141 // Skips characters up to end of line. | 142 // Skips characters up to end of line. |
| 142 void ConsumeLineComment(); | 143 void ConsumeLineComment(); |
| 143 | 144 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 const String& private_key_; | 206 const String& private_key_; |
| 206 | 207 |
| 207 SourcePosition c0_pos_; // Source position of lookahead character c0_. | 208 SourcePosition c0_pos_; // Source position of lookahead character c0_. |
| 208 KeywordTable keywords_[Token::numKeywords]; | 209 KeywordTable keywords_[Token::numKeywords]; |
| 209 }; | 210 }; |
| 210 | 211 |
| 211 | 212 |
| 212 } // namespace dart | 213 } // namespace dart |
| 213 | 214 |
| 214 #endif // VM_SCANNER_H_ | 215 #endif // VM_SCANNER_H_ |
| OLD | NEW |