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]
CHAR [a-zA-Z_]
%x shift
%%
("\r\n"|"\n") {
lineNumber += 1;
@ -70,10 +72,16 @@ CHAR [a-zA-Z_]
"diviso" {
return OP_DIV;
}
"sinistra" {
"con scappellamento a" {
BEGIN(shift);
}
<shift>"per" {
BEGIN(INITIAL);
}
<shift>"sinistra" {
return OP_SHL;
}
"destra" {
<shift>"destra" {
return OP_SHR;
}
"minore di" {