%{
#include "y.tab.h"
%}
digit [0-9]
id [a-zA-Z_][a-zA-Z0-9_]*
%%
"if" { return IF; }
"else" { return ELSE; }
"while" { return WHILE; }
"print" { return PRINT; }
{id} { yylval.strval = strdup(yytext); return IDENTIFIER; }
{digit
}+ { yylval
.numval
= atoi
(yytext
); return
NUMBER; } "/" { return DIVIDE; }
"=" { return ASSIGN; }
"==" { return EQUAL; }
"!=" { return NOTEQUAL; }
"<" { return LESS; }
">" { return GREATER; }
"<=" { return LESSEQ; }
">=" { return GREATEREQ; }
"{" { return LBRACE; }
"}" { return RBRACE; }
"(" { return LPAREN; }
")" { return RPAREN; }
";" { return SEMICOLON; }
[ \t\n]+ ; // Skip whitespace
. { return yytext[0]; }
%%
int yywrap() {
return 1;
}
JXsKI2luY2x1ZGUgInkudGFiLmgiCiV9CgpkaWdpdCAgIFswLTldCmlkICAgICAgW2EtekEtWl9dW2EtekEtWjAtOV9dKgoKJSUKCiJpZiIgICAgICAgICAgICAgICAgeyByZXR1cm4gSUY7IH0KImVsc2UiICAgICAgICAgICAgICB7IHJldHVybiBFTFNFOyB9CiJ3aGlsZSIgICAgICAgICAgICAgeyByZXR1cm4gV0hJTEU7IH0KInJlYWQiICAgICAgICAgICAgICB7IHJldHVybiBSRUFEOyB9CiJwcmludCIgICAgICAgICAgICAgeyByZXR1cm4gUFJJTlQ7IH0Ke2lkfSAgICAgICAgICAgICAgICB7IHl5bHZhbC5zdHJ2YWwgPSBzdHJkdXAoeXl0ZXh0KTsgcmV0dXJuIElERU5USUZJRVI7IH0Ke2RpZ2l0fSsgICAgICAgICAgICB7IHl5bHZhbC5udW12YWwgPSBhdG9pKHl5dGV4dCk7IHJldHVybiBOVU1CRVI7IH0KIi8iICAgICAgICAgICAgICAgICB7IHJldHVybiBESVZJREU7IH0KIj0iICAgICAgICAgICAgICAgICB7IHJldHVybiBBU1NJR047IH0KIj09IiAgICAgICAgICAgICAgICB7IHJldHVybiBFUVVBTDsgfQoiIT0iICAgICAgICAgICAgICAgIHsgcmV0dXJuIE5PVEVRVUFMOyB9CiI8IiAgICAgICAgICAgICAgICAgeyByZXR1cm4gTEVTUzsgfQoiPiIgICAgICAgICAgICAgICAgIHsgcmV0dXJuIEdSRUFURVI7IH0KIjw9IiAgICAgICAgICAgICAgICB7IHJldHVybiBMRVNTRVE7IH0KIj49IiAgICAgICAgICAgICAgICB7IHJldHVybiBHUkVBVEVSRVE7IH0KInsiICAgICAgICAgICAgICAgICB7IHJldHVybiBMQlJBQ0U7IH0KIn0iICAgICAgICAgICAgICAgICB7IHJldHVybiBSQlJBQ0U7IH0KIigiICAgICAgICAgICAgICAgICB7IHJldHVybiBMUEFSRU47IH0KIikiICAgICAgICAgICAgICAgICB7IHJldHVybiBSUEFSRU47IH0KIjsiICAgICAgICAgICAgICAgICB7IHJldHVybiBTRU1JQ09MT047IH0KWyBcdFxuXSsgICAgICAgICAgICA7ICAgLy8gU2tpcCB3aGl0ZXNwYWNlCi4gICAgICAgICAgICAgICAgICAgeyByZXR1cm4geXl0ZXh0WzBdOyB9CgolJQoKaW50IHl5d3JhcCgpIHsKICAgIHJldHVybiAxOwp9Cg==