diff options
author | Michal Marek <mmarek@suse.cz> | 2011-01-20 10:19:58 -0500 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2011-03-17 10:13:55 -0400 |
commit | 95f1d639ade8fdf9572ac8a926f62b29dd66eaba (patch) | |
tree | 9b8864def448176b950e1f747d33b5e7439ef429 /scripts/genksyms/lex.l | |
parent | 9c281f13b68da49764cbc8d7d610c2f229a0f9a0 (diff) |
genksyms: Simplify lexer
The V2_TOKENS state is active all the time.
Signed-off-by: Michal Marek <mmarek@suse.cz>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts/genksyms/lex.l')
-rw-r--r-- | scripts/genksyms/lex.l | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/scripts/genksyms/lex.l b/scripts/genksyms/lex.l index fe50ff9dacd0..4687b1d147de 100644 --- a/scripts/genksyms/lex.l +++ b/scripts/genksyms/lex.l | |||
@@ -55,10 +55,6 @@ CHAR L?\'([^\\\']*\\.)*[^\\\']*\' | |||
55 | 55 | ||
56 | MC_TOKEN ([~%^&*+=|<>/-]=)|(&&)|("||")|(->)|(<<)|(>>) | 56 | MC_TOKEN ([~%^&*+=|<>/-]=)|(&&)|("||")|(->)|(<<)|(>>) |
57 | 57 | ||
58 | /* Version 2 checksumming does proper tokenization; version 1 wasn't | ||
59 | quite so pedantic. */ | ||
60 | %s V2_TOKENS | ||
61 | |||
62 | /* We don't do multiple input files. */ | 58 | /* We don't do multiple input files. */ |
63 | %option noyywrap | 59 | %option noyywrap |
64 | 60 | ||
@@ -84,9 +80,9 @@ MC_TOKEN ([~%^&*+=|<>/-]=)|(&&)|("||")|(->)|(<<)|(>>) | |||
84 | recognized as tokens. We don't actually use them since we don't | 80 | recognized as tokens. We don't actually use them since we don't |
85 | parse expressions, but we do want whitespace to be arranged | 81 | parse expressions, but we do want whitespace to be arranged |
86 | around them properly. */ | 82 | around them properly. */ |
87 | <V2_TOKENS>{MC_TOKEN} return OTHER; | 83 | {MC_TOKEN} return OTHER; |
88 | <V2_TOKENS>{INT} return INT; | 84 | {INT} return INT; |
89 | <V2_TOKENS>{REAL} return REAL; | 85 | {REAL} return REAL; |
90 | 86 | ||
91 | "..." return DOTS; | 87 | "..." return DOTS; |
92 | 88 | ||
@@ -134,7 +130,6 @@ yylex(void) | |||
134 | 130 | ||
135 | if (lexstate == ST_NOTSTARTED) | 131 | if (lexstate == ST_NOTSTARTED) |
136 | { | 132 | { |
137 | BEGIN(V2_TOKENS); | ||
138 | next_node = xmalloc(sizeof(*next_node)); | 133 | next_node = xmalloc(sizeof(*next_node)); |
139 | next_node->next = NULL; | 134 | next_node->next = NULL; |
140 | lexstate = ST_NORMAL; | 135 | lexstate = ST_NORMAL; |