Skip to content
Snippets Groups Projects
Commit bb585047 authored by Oscar Amaya Mohr's avatar Oscar Amaya Mohr
Browse files

Update minako-lexic.l

parent f13cb3ed
No related merge requests found
...@@ -11,7 +11,7 @@ void invalid_token() { ...@@ -11,7 +11,7 @@ void invalid_token() {
} }
%} %}
%s st %s STRING
BLOCK_COMMENT "/*"((("*"[^/])?)|[^*])*"*/" BLOCK_COMMENT "/*"((("*"[^/])?)|[^*])*"*/"
LINE_COMMENT "//".* LINE_COMMENT "//".*
...@@ -37,21 +37,21 @@ printf return KW_PRINTF; ...@@ -37,21 +37,21 @@ printf return KW_PRINTF;
return return KW_RETURN; return return KW_RETURN;
void return KW_VOID; void return KW_VOID;
while return KW_WHILE; while return KW_WHILE;
&& return AND; "&&" return AND;
\|\| return OR; "||" return OR;
== return EQ; "==" return EQ;
!= return NEQ; "!=" return NEQ;
\>= return GEQ; ">=" return GEQ;
\<= return LEQ; "<=" return LEQ;
\> return GRT; ">" return GRT;
\< return LSS; "<" return LSS;
{INT} yylval.intValue = atoi(yytext); return CONST_INT; {INT} yylval.intValue = atoi(yytext); return CONST_INT;
{FLOAT} yylval.floatValue = atof(yytext); return CONST_FLOAT; {FLOAT} yylval.floatValue = atof(yytext); return CONST_FLOAT;
true yylval.intValue = 1; return CONST_BOOLEAN; true yylval.intValue = 1; return CONST_BOOLEAN;
false yylval.intValue = 0; return CONST_BOOLEAN; false yylval.intValue = 0; return CONST_BOOLEAN;
\" BEGIN(st); \" BEGIN(STRING);
<st>[^\n\"]*/\" yylval.string = yytext; BEGIN(INITIAL); return CONST_STRING; <STRING>[^\n\"]*/\" yylval.string = yytext; BEGIN(INITIAL); return CONST_STRING;
{ID} yylval.string = yytext; return ID; {ID} yylval.string = yytext; return ID;
{PUNCTUATION} return (int)(*yytext); {PUNCTUATION} return (int)(*yytext);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment