Handle shift operator at syntactic level.

This commit is contained in:
Stefano Sanfilippo 2014-11-23 22:06:37 +01:00
parent 0a6c350ba1
commit 1147af9eda

View File

@ -13,6 +13,8 @@ DIGIT [0-9]
HEXDIGIT [0-9a-zA-Z] HEXDIGIT [0-9a-zA-Z]
CHAR [a-zA-Z_] CHAR [a-zA-Z_]
%x shift
%% %%
("\r\n"|"\n") { ("\r\n"|"\n") {
lineNumber += 1; lineNumber += 1;
@ -70,10 +72,16 @@ CHAR [a-zA-Z_]
"diviso" { "diviso" {
return OP_DIV; return OP_DIV;
} }
"sinistra" { "con scappellamento a" {
BEGIN(shift);
}
<shift>"per" {
BEGIN(INITIAL);
}
<shift>"sinistra" {
return OP_SHL; return OP_SHL;
} }
"destra" { <shift>"destra" {
return OP_SHR; return OP_SHR;
} }
"minore di" { "minore di" {