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

Side by Side Diff: src/lexer/lexer.h

Issue 78463002: Experimental scanner: Remove the re2c version for real. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/lexer/experimental-scanner.cc ('k') | src/lexer/lexer.re » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Portions of this code based on re2c:
2 // (re2c/examples/push.re)
3 // Copyright 2013 the V8 project authors. All rights reserved.
4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are
6 // met:
7 //
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above
11 // copyright notice, this list of conditions and the following
12 // disclaimer in the documentation and/or other materials provided
13 // with the distribution.
14 // * Neither the name of Google Inc. nor the names of its
15 // contributors may be used to endorse or promote products derived
16 // from this software without specific prior written permission.
17 //
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
30 #ifndef V8_LEXER_LEXER_H
31 #define V8_LEXER_LEXER_H
32
33 #include "token.h"
34 #include "flags.h"
35 #include "v8stdint.h"
36
37 #define YYCTYPE uint8_t
38
39 namespace v8 {
40 namespace internal {
41
42 class ExperimentalScanner;
43 class UnicodeCache;
44
45 class PushScanner {
46 public:
47 explicit PushScanner(ExperimentalScanner* sink, UnicodeCache* unicode_cache);
48
49 ~PushScanner();
50
51 void send(v8::internal::Token::Value token);
52 uint32_t push(const void *input, int input_size);
53
54 private:
55 bool ValidIdentifierStart();
56 bool ValidIdentifierPart();
57 uc32 ScanHexNumber(int length);
58
59 UnicodeCache* unicode_cache_;
60
61 bool eof_;
62 int32_t state_;
63 int32_t condition_;
64
65 YYCTYPE* limit_;
66 YYCTYPE* start_;
67 YYCTYPE* cursor_;
68 YYCTYPE* marker_;
69 int real_start_;
70
71 YYCTYPE* buffer_;
72 YYCTYPE* buffer_end_;
73
74 YYCTYPE yych;
75 uint32_t yyaccept;
76
77 bool just_seen_line_terminator_;
78
79 ExperimentalScanner* sink_;
80 };
81
82 } }
83
84 #endif // V8_LEXER_LEXER_H
OLDNEW
« no previous file with comments | « src/lexer/experimental-scanner.cc ('k') | src/lexer/lexer.re » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698