Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Side by Side Diff: vm/parser.h

Issue 9462003: Changes to shrink the token stream representation from two words to one word. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 #ifndef VM_PARSER_H_ 5 #ifndef VM_PARSER_H_
6 #define VM_PARSER_H_ 6 #define VM_PARSER_H_
7 7
8 #include "include/dart_api.h" 8 #include "include/dart_api.h"
9 9
10 #include "vm/ast.h" 10 #include "vm/ast.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 119
120 // Parsing a library or a regular source script. 120 // Parsing a library or a regular source script.
121 bool is_library_source() const { 121 bool is_library_source() const {
122 return (script_.kind() == RawScript::kScript) || 122 return (script_.kind() == RawScript::kScript) ||
123 (script_.kind() == RawScript::kLibrary); 123 (script_.kind() == RawScript::kLibrary);
124 } 124 }
125 125
126 inline Token::Kind CurrentToken(); 126 inline Token::Kind CurrentToken();
127 Token::Kind LookaheadToken(int num_tokens); 127 Token::Kind LookaheadToken(int num_tokens);
128 String* CurrentLiteral() const; 128 String* CurrentLiteral() const;
129 RawDouble* CurrentDoubleLiteral() const;
130 RawInteger* CurrentIntegerLiteral() const;
129 131
130 // Sets parser to given token position in the stream. 132 // Sets parser to given token position in the stream.
131 void SetPosition(intptr_t position); 133 void SetPosition(intptr_t position);
132 134
133 void ConsumeToken() { 135 void ConsumeToken() {
134 // Reset cache and advance the token. 136 // Reset cache and advance the token.
135 token_kind_ = Token::kILLEGAL; 137 token_kind_ = Token::kILLEGAL;
136 token_index_++; 138 token_index_++;
137 CompilerStats::num_tokens_consumed++; 139 CompilerStats::num_tokens_consumed++;
138 } 140 }
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 // code at all points in the try block where an exit from the block is 463 // code at all points in the try block where an exit from the block is
462 // done using 'return', 'break' or 'continue' statements. 464 // done using 'return', 'break' or 'continue' statements.
463 TryBlocks* try_blocks_list_; 465 TryBlocks* try_blocks_list_;
464 466
465 DISALLOW_COPY_AND_ASSIGN(Parser); 467 DISALLOW_COPY_AND_ASSIGN(Parser);
466 }; 468 };
467 469
468 } // namespace dart 470 } // namespace dart
469 471
470 #endif // VM_PARSER_H_ 472 #endif // VM_PARSER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698