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

Unified Diff: src/scanner-base.h

Issue 5063003: Add separate scanner only intended for preparsing. (Closed)
Patch Set: Address review comments. Created 10 years, 1 month 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 | « src/scanner.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scanner-base.h
diff --git a/src/scanner-base.h b/src/scanner-base.h
index 72797a8945d644f4581057c3c0ca2c181756b1e9..50f30305c4aa3e150bedb3965668c56678d8af1b 100644
--- a/src/scanner-base.h
+++ b/src/scanner-base.h
@@ -41,6 +41,25 @@
namespace v8 {
namespace internal {
+// Interface through which the scanner reads characters from the input source.
+class UTF16Buffer {
+ public:
+ UTF16Buffer();
+ virtual ~UTF16Buffer() {}
+
+ virtual void PushBack(uc32 ch) = 0;
+ // Returns a value < 0 when the buffer end is reached.
+ virtual uc32 Advance() = 0;
+ virtual void SeekForward(int pos) = 0;
+
+ int pos() const { return pos_; }
+
+ protected:
+ int pos_; // Current position in the buffer.
+ int end_; // Position where scanning should stop (EOF).
+};
+
+
class ScannerConstants : AllStatic {
public:
typedef unibrow::Utf8InputBuffer<1024> Utf8Decoder;
« no previous file with comments | « src/scanner.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698