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

Side by Side Diff: src/lexer/lexer_py.re

Issue 172893003: Experimental parser: add dfa path iterator (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 6 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
« no previous file with comments | « no previous file | tools/lexer_generator/backtracking_generator.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 the V8 project authors. All rights reserved. 1 # Copyright 2013 the V8 project authors. All rights reserved.
2 # Redistribution and use in source and binary forms, with or without 2 # Redistribution and use in source and binary forms, with or without
3 # modification, are permitted provided that the following conditions are 3 # modification, are permitted provided that the following conditions are
4 # met: 4 # met:
5 # 5 #
6 # * Redistributions of source code must retain the above copyright 6 # * Redistributions of source code must retain the above copyright
7 # notice, this list of conditions and the following disclaimer. 7 # notice, this list of conditions and the following disclaimer.
8 # * Redistributions in binary form must reproduce the above 8 # * Redistributions in binary form must reproduce the above
9 # copyright notice, this list of conditions and the following 9 # copyright notice, this list of conditions and the following
10 # disclaimer in the documentation and/or other materials provided 10 # disclaimer in the documentation and/or other materials provided
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 "-" <|token(SUB)|> 135 "-" <|token(SUB)|>
136 "*" <|token(MUL)|> 136 "*" <|token(MUL)|>
137 "/" <|token(DIV)|> 137 "/" <|token(DIV)|>
138 "%" <|token(MOD)|> 138 "%" <|token(MOD)|>
139 "~" <|token(BIT_NOT)|> 139 "~" <|token(BIT_NOT)|>
140 "," <|token(COMMA)|> 140 "," <|token(COMMA)|>
141 141
142 line_terminator+ <|line_terminator|> 142 line_terminator+ <|line_terminator|>
143 /[:whitespace:]+/ <|skip|> 143 /[:whitespace:]+/ <|skip|>
144 144
145 "\"" <set_marker(1)||DoubleQuoteString> 145 "\"" <set_marker(1)|token(ILLEGAL)|DoubleQuoteString>
146 "'" <set_marker(1)||SingleQuoteString> 146 "'" <set_marker(1)|token(ILLEGAL)|SingleQuoteString>
147 147
148 # all keywords 148 # all keywords
149 "break" <|token(BREAK)|> 149 "break" <|token(BREAK)|>
150 "case" <|token(CASE)|> 150 "case" <|token(CASE)|>
151 "catch" <|token(CATCH)|> 151 "catch" <|token(CATCH)|>
152 "class" <|token(FUTURE_RESERVED_WORD)|> 152 "class" <|token(FUTURE_RESERVED_WORD)|>
153 "const" <|token(CONST)|> 153 "const" <|token(CONST)|>
154 "continue" <|token(CONTINUE)|> 154 "continue" <|token(CONTINUE)|>
155 "debugger" <|token(DEBUGGER)|> 155 "debugger" <|token(DEBUGGER)|>
156 "default" <|token(DEFAULT)|> 156 "default" <|token(DEFAULT)|>
(...skipping 28 matching lines...) Expand all
185 "throw" <|token(THROW)|> 185 "throw" <|token(THROW)|>
186 "true" <|token(TRUE_LITERAL)|> 186 "true" <|token(TRUE_LITERAL)|>
187 "try" <|token(TRY)|> 187 "try" <|token(TRY)|>
188 "typeof" <|token(TYPEOF)|> 188 "typeof" <|token(TYPEOF)|>
189 "var" <|token(VAR)|> 189 "var" <|token(VAR)|>
190 "void" <|token(VOID)|> 190 "void" <|token(VOID)|>
191 "while" <|token(WHILE)|> 191 "while" <|token(WHILE)|>
192 "with" <|token(WITH)|> 192 "with" <|token(WITH)|>
193 "yield" <|token(YIELD)|> 193 "yield" <|token(YIELD)|>
194 194
195 identifier_start <|token(IDENTIFIER)|Identifier> 195 identifier_start <|token(IDENTIFIER)|Identifier>
196 unicode_escape <check_escaped_identifier_start|token(IDENTIFIER)|Identifier> 196 unicode_escape <check_escaped_identifier_start|token(IDENTIFIER)|Identifier>
197 "\\" <|token(ILLEGAL)|> # ambiguous backtracking otherwise
197 198
198 eos <terminate> 199 eos <terminate>
199 default_action <do_token_and_go_forward(ILLEGAL)> 200 default_action <default>
200 201
201 <<DoubleQuoteString>> 202 <<DoubleQuoteString>>
202 epsilon <StringSubgraph> 203 epsilon <StringSubgraph>
203 "\"" <|token(STRING)|> 204 "\"" <|token(STRING)|>
204 catch_all <||continue> 205 catch_all <||continue>
205 eos <terminate_illegal> 206 eos <terminate_illegal>
206 207
207 <<SingleQuoteString>> 208 <<SingleQuoteString>>
208 epsilon <StringSubgraph> 209 epsilon <StringSubgraph>
209 "'" <|token(STRING)|> 210 "'" <|token(STRING)|>
210 catch_all <||continue> 211 catch_all <||continue>
211 eos <terminate_illegal> 212 eos <terminate_illegal>
212 213
213 <<StringSubgraph>> 214 <<StringSubgraph>>
214 "\\" line_terminator_sequence <set_has_escapes||continue(1)> 215 "\\" line_terminator_sequence <set_has_escapes||continue(1)>
215 /\\[x][:hex_digit:]{2}/ <set_has_escapes||continue(1)> 216 /\\[x][:hex_digit:]{2}/ <set_has_escapes||continue(1)>
216 unicode_escape <set_has_escapes||continue(1)> 217 unicode_escape <set_has_escapes||continue(1)>
217 /\\[1-7]/ <octal_inside_string||continue(1)> 218 /\\[1-7]/ <octal_inside_string||continue(1)>
218 /\\[0-7][0-7]+/ <octal_inside_string||continue(1)> 219 /\\[0-7][0-7]+/ <octal_inside_string||continue(1)>
219 "\\0" <set_has_escapes||continue(1)> 220 "\\0" <set_has_escapes||continue(1)>
220 /\\[^xu0-7:line_terminator:]/ <set_has_escapes||continue(1)> 221 /\\[^xu0-7:line_terminator:]/ <set_has_escapes||continue(1)>
221 "\\" <|token(ILLEGAL)|> 222 "\\" <|token(ILLEGAL)|>
222 line_terminator <|token(ILLEGAL)|> 223 line_terminator <|token(ILLEGAL)|>
223 224
224 <<Identifier>> 225 <<Identifier>>
225 identifier_char <|token(IDENTIFIER)|continue> 226 identifier_char <|token(IDENTIFIER)|continue>
226 /\\u[:hex_digit:]{4}/ <check_escaped_identifier_part|token(IDENTIFIER)|continue> 227 unicode_escape <check_escaped_identifier_part|token(IDENTIFIER)|continue>
228 "\\" <|token(ILLEGAL)|> # ambiguous backtracking otherwise
227 229
228 <<SingleLineComment>> 230 <<SingleLineComment>>
229 line_terminator <|line_terminator|> 231 line_terminator <|line_terminator|>
230 catch_all <||continue> 232 catch_all <||continue>
231 eos <skip_and_terminate> 233 eos <skip_and_terminate>
232 234
233 <<MultiLineComment>> 235 <<MultiLineComment>>
234 /\*+\// <|skip|> 236 /\*+\// <|skip|>
235 # TODO(dcarney): find a way to generate the below rule
236 /\*+[^\/*]/ <||continue> 237 /\*+[^\/*]/ <||continue>
237 line_terminator <line_terminator_in_multiline_comment||continue> 238 line_terminator <line_terminator_in_multiline_comment||continue>
238 catch_all <||continue> 239 catch_all <||continue>
239 eos <terminate_illegal> 240 eos <terminate_illegal>
OLDNEW
« no previous file with comments | « no previous file | tools/lexer_generator/backtracking_generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698