diff options
author | Eric Anholt <eric@anholt.net> | 2006-08-29 09:30:32 -0700 |
---|---|---|
committer | Damien Lespiau <damien.lespiau@intel.com> | 2013-03-04 15:54:23 +0000 |
commit | de1a889fe3554df47a6a751855ebae0cd1517e2f (patch) | |
tree | 50de7d8c40afd00e64c7af5f644acd1cd0009acd /assembler/lex.l | |
parent | 0ed5d93cc2f7aa74a10674c8ea0c9a0125a8521f (diff) |
Avoid shift/reduce conflict in predicate by making flagreg and subreg 1 token.
Thanks to keithp for pointing out where the conflict was.
Diffstat (limited to 'assembler/lex.l')
-rw-r--r-- | assembler/lex.l | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/assembler/lex.l b/assembler/lex.l index 5deb3c95..e971360d 100644 --- a/assembler/lex.l +++ b/assembler/lex.l @@ -136,8 +136,16 @@ int saved_state = INITIAL; yylval.integer = atoi(yytext + 1); return NOTIFYREG; } -"f"[0-9]+ { - yylval.integer = atoi(yytext + 1); + /* Unlike other registers, flagreg returns the subreg number in the lvalue + * rather than the reg number, to avoid a shift/reduce conflict in the + * predicate control. + */ +"f0.[0-9]+" { + yylval.integer = atoi(yytext + 3); + return FLAGREG; +} +"f0" { + yylval.integer = 0; return FLAGREG; } [gr][0-9]+ { |