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

Unified Diff: tools/lexer_generator/rule_lexer.py

Issue 62103017: Experimental parser: rule grammar refactor (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/lexer_generator/lexer_test.py ('k') | tools/lexer_generator/rule_parser.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/lexer_generator/rule_lexer.py
diff --git a/tools/lexer_generator/rule_lexer.py b/tools/lexer_generator/rule_lexer.py
index 0f5865afcb6f52410fa57f77916ac99b4d5ba8dc..81ce826fa84dfab8633eed1ac56f7b011b6cd925 100644
--- a/tools/lexer_generator/rule_lexer.py
+++ b/tools/lexer_generator/rule_lexer.py
@@ -30,10 +30,8 @@ import ply.lex as lex
class RuleLexer:
tokens = (
- 'DEFAULT',
'DEFAULT_ACTION',
'CATCH_ALL',
- 'PUSH_TOKEN',
'IDENTIFIER',
'STRING',
@@ -47,8 +45,8 @@ class RuleLexer:
'STAR',
'LEFT_PARENTHESIS',
'RIGHT_PARENTHESIS',
- 'LESS_THAN',
- 'GREATER_THAN',
+ 'GRAPH_OPEN',
+ 'GRAPH_CLOSE',
'SEMICOLON',
'ACTION_OPEN',
'ACTION_CLOSE',
@@ -71,7 +69,7 @@ class RuleLexer:
pass
__special_identifiers = set(map(lambda s: s.lower(),
- ['DEFAULT', 'DEFAULT_ACTION', 'CATCH_ALL', 'PUSH_TOKEN']))
+ ['DEFAULT_ACTION', 'CATCH_ALL']))
def t_IDENTIFIER(self, t):
r'[a-zA-Z][a-zA-Z0-9_]*'
@@ -90,11 +88,11 @@ class RuleLexer:
t_EQUALS = '='
t_LEFT_PARENTHESIS = r'\('
t_RIGHT_PARENTHESIS = r'\)'
- t_LESS_THAN = '<'
- t_GREATER_THAN = '>'
+ t_GRAPH_OPEN = '<<'
+ t_GRAPH_CLOSE = '>>'
t_SEMICOLON = ';'
- t_ACTION_OPEN = '<<'
- t_ACTION_CLOSE = '>>'
+ t_ACTION_OPEN = '<'
+ t_ACTION_CLOSE = '>'
def t_LEFT_BRACKET(self, t):
r'{'
« no previous file with comments | « tools/lexer_generator/lexer_test.py ('k') | tools/lexer_generator/rule_parser.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698