Commit 95f1d639 authored by Michal Marek's avatar Michal Marek

genksyms: Simplify lexer

The V2_TOKENS state is active all the time.
Signed-off-by: default avatarMichal Marek <mmarek@suse.cz>
Acked-by: default avatarSam Ravnborg <sam@ravnborg.org>
parent 9c281f13
This diff is collapsed.
...@@ -55,10 +55,6 @@ CHAR L?\'([^\\\']*\\.)*[^\\\']*\' ...@@ -55,10 +55,6 @@ CHAR L?\'([^\\\']*\\.)*[^\\\']*\'
MC_TOKEN ([~%^&*+=|<>/-]=)|(&&)|("||")|(->)|(<<)|(>>) MC_TOKEN ([~%^&*+=|<>/-]=)|(&&)|("||")|(->)|(<<)|(>>)
/* Version 2 checksumming does proper tokenization; version 1 wasn't
quite so pedantic. */
%s V2_TOKENS
/* We don't do multiple input files. */ /* We don't do multiple input files. */
%option noyywrap %option noyywrap
...@@ -84,9 +80,9 @@ MC_TOKEN ([~%^&*+=|<>/-]=)|(&&)|("||")|(->)|(<<)|(>>) ...@@ -84,9 +80,9 @@ MC_TOKEN ([~%^&*+=|<>/-]=)|(&&)|("||")|(->)|(<<)|(>>)
recognized as tokens. We don't actually use them since we don't recognized as tokens. We don't actually use them since we don't
parse expressions, but we do want whitespace to be arranged parse expressions, but we do want whitespace to be arranged
around them properly. */ around them properly. */
<V2_TOKENS>{MC_TOKEN} return OTHER; {MC_TOKEN} return OTHER;
<V2_TOKENS>{INT} return INT; {INT} return INT;
<V2_TOKENS>{REAL} return REAL; {REAL} return REAL;
"..." return DOTS; "..." return DOTS;
...@@ -134,7 +130,6 @@ yylex(void) ...@@ -134,7 +130,6 @@ yylex(void)
if (lexstate == ST_NOTSTARTED) if (lexstate == ST_NOTSTARTED)
{ {
BEGIN(V2_TOKENS);
next_node = xmalloc(sizeof(*next_node)); next_node = xmalloc(sizeof(*next_node));
next_node->next = NULL; next_node->next = NULL;
lexstate = ST_NORMAL; lexstate = ST_NORMAL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment