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

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

Issue 68843002: Experimental lexer generator: More code generation. (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 | « no previous file | tools/lexer_generator/dfa.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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 "&" { PUSH_TOKEN(BIT_AND); } 93 "&" { PUSH_TOKEN(BIT_AND); }
94 "+" { PUSH_TOKEN(ADD); } 94 "+" { PUSH_TOKEN(ADD); }
95 "-" { PUSH_TOKEN(SUB); } 95 "-" { PUSH_TOKEN(SUB); }
96 "*" { PUSH_TOKEN(MUL); } 96 "*" { PUSH_TOKEN(MUL); }
97 "/" { PUSH_TOKEN(DIV); } 97 "/" { PUSH_TOKEN(DIV); }
98 "%" { PUSH_TOKEN(MOD); } 98 "%" { PUSH_TOKEN(MOD); }
99 "~" { PUSH_TOKEN(BIT_NOT); } 99 "~" { PUSH_TOKEN(BIT_NOT); }
100 "," { PUSH_TOKEN(COMMA); } 100 "," { PUSH_TOKEN(COMMA); }
101 101
102 line_terminator+ { PUSH_LINE_TERMINATOR(); } 102 line_terminator+ { PUSH_LINE_TERMINATOR(); }
103 whitespace { SKIP } # TODO implement skip 103 whitespace { SKIP(); } # TODO implement skip
104 104
105 "\"" <<DoubleQuoteString>> 105 "\"" <<DoubleQuoteString>>
106 "'" <<SingleQuoteString>> 106 "'" <<SingleQuoteString>>
107 107
108 # all keywords 108 # all keywords
109 "break" { PUSH_TOKEN(BREAK); } 109 "break" { PUSH_TOKEN(BREAK); }
110 "case" { PUSH_TOKEN(CASE); } 110 "case" { PUSH_TOKEN(CASE); }
111 "catch" { PUSH_TOKEN(CATCH); } 111 "catch" { PUSH_TOKEN(CATCH); }
112 "class" { PUSH_TOKEN(FUTURE_RESERVED_WORD); } 112 "class" { PUSH_TOKEN(FUTURE_RESERVED_WORD); }
113 "const" { PUSH_TOKEN(CONST); } 113 "const" { PUSH_TOKEN(CONST); }
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 } 190 }
191 } <<continue>> 191 } <<continue>>
192 default_action { PUSH_TOKEN(IDENTIFIER); } 192 default_action { PUSH_TOKEN(IDENTIFIER); }
193 193
194 <SingleLineComment> 194 <SingleLineComment>
195 line_terminator { PUSH_LINE_TERMINATOR(); } 195 line_terminator { PUSH_LINE_TERMINATOR(); }
196 eof <<terminate>> 196 eof <<terminate>>
197 /./ <<continue>> 197 /./ <<continue>>
198 198
199 <MultiLineComment> 199 <MultiLineComment>
200 "*/" { SKIP } 200 "*/" { SKIP(); }
201 # need to force action 201 # need to force action
202 line_terminator+ { PUSH_LINE_TERMINATOR(); } <<continue>> 202 line_terminator+ { PUSH_LINE_TERMINATOR(); } <<continue>>
203 eof <<terminate>> 203 eof <<terminate>>
204 /./ <<continue>> 204 /./ <<continue>>
205 205
206 <HtmlComment> 206 <HtmlComment>
207 "-->" { SKIP } 207 "-->" { SKIP(); }
208 # need to force action 208 # need to force action
209 line_terminator+ { PUSH_LINE_TERMINATOR(); } <<continue>> 209 line_terminator+ { PUSH_LINE_TERMINATOR(); } <<continue>>
210 eof <<terminate>> 210 eof <<terminate>>
211 /./ <<continue>> 211 /./ <<continue>>
OLDNEW
« no previous file with comments | « no previous file | tools/lexer_generator/dfa.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698