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

Unified Diff: vm/parser.h

Issue 10697055: Represent tokens as a compressed stream instead of an array. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « vm/object_test.cc ('k') | vm/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/parser.h
===================================================================
--- vm/parser.h (revision 9536)
+++ vm/parser.h (working copy)
@@ -105,34 +105,6 @@
};
-// The class TokenStreamIterator encapsulates iteration over the TokenStream
-// object. The parser uses this to iterate over tokens while parsing a script
-// or a function.
-class TokenStreamIterator : ValueObject {
- public:
- TokenStreamIterator(const TokenStream& tokens, intptr_t token_pos)
- : tokens_(tokens), token_position_(token_pos) { }
-
- intptr_t NumberOfTokens() const { return tokens_.Length(); }
- bool IsValid() const;
-
- inline Token::Kind CurrentTokenKind() const;
- Token::Kind LookaheadTokenKind(intptr_t num_tokens) const;
-
- intptr_t CurrentPosition() const { return token_position_; }
- void SetCurrentPosition(intptr_t value) { token_position_ = value; }
-
- void Advance() { token_position_ += 1; }
-
- RawObject* CurrentToken() const;
- RawString* CurrentLiteral() const;
-
- private:
- const TokenStream& tokens_;
- intptr_t token_position_;
-};
-
-
class Parser : ValueObject {
public:
Parser(const Script& script, const Library& library);
@@ -540,7 +512,7 @@
const Script& script_;
- TokenStreamIterator tokens_iterator_;
+ TokenStream::Iterator tokens_iterator_;
Token::Kind token_kind_; // Cached token kind for current token.
Block* current_block_;
« no previous file with comments | « vm/object_test.cc ('k') | vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698