Avoid shift/reduce conflict in predicate by making flagreg and subreg 1 token.

Thanks to keithp for pointing out where the conflict was.
This commit is contained in:
Eric Anholt
2006-08-29 09:30:32 -07:00
committed by Damien Lespiau
parent 0ed5d93cc2
commit de1a889fe3
2 changed files with 13 additions and 10 deletions
+10 -2
View File
@@ -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]+ {