| 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 24 matching lines...) Expand all Loading... |
| 35 // TokenDesc defines the kind of a token and its location in | 35 // TokenDesc defines the kind of a token and its location in |
| 36 // the source text. | 36 // the source text. |
| 37 struct TokenDescriptor { | 37 struct TokenDescriptor { |
| 38 Token::Kind kind; | 38 Token::Kind kind; |
| 39 int offset; // Offset in source string. | 39 int offset; // Offset in source string. |
| 40 SourcePosition position; // Text position in source. | 40 SourcePosition position; // Text position in source. |
| 41 const String* literal; // Identifier, number or string literal. | 41 const String* literal; // Identifier, number or string literal. |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 // Dummy token index reflecting an unknown source position. | 44 // Dummy token index reflecting an unknown source position. |
| 45 static const intptr_t kDummyTokenIndex = 0; | 45 static const intptr_t kNoSourcePos = 0; |
| 46 | 46 |
| 47 // Character used to indicate a private identifier. | 47 // Character used to indicate a private identifier. |
| 48 static const char kPrivateIdentifierStart = '_'; | 48 static const char kPrivateIdentifierStart = '_'; |
| 49 | 49 |
| 50 // Character used to separate the private identifier from the key. | 50 // Character used to separate the private identifier from the key. |
| 51 static const char kPrivateKeySeparator = '@'; | 51 static const char kPrivateKeySeparator = '@'; |
| 52 | 52 |
| 53 typedef ZoneGrowableArray<TokenDescriptor> GrowableTokenStream; | 53 typedef ZoneGrowableArray<TokenDescriptor> GrowableTokenStream; |
| 54 | 54 |
| 55 // Initializes scanner to scan string source. | 55 // Initializes scanner to scan string source. |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 | 214 |
| 215 SourcePosition c0_pos_; // Source position of lookahead character c0_. | 215 SourcePosition c0_pos_; // Source position of lookahead character c0_. |
| 216 | 216 |
| 217 static KeywordTable keywords_[Token::numKeywords]; | 217 static KeywordTable keywords_[Token::numKeywords]; |
| 218 }; | 218 }; |
| 219 | 219 |
| 220 | 220 |
| 221 } // namespace dart | 221 } // namespace dart |
| 222 | 222 |
| 223 #endif // VM_SCANNER_H_ | 223 #endif // VM_SCANNER_H_ |
| OLD | NEW |