diff --git a/src/ram.l b/src/ram.l index c5c3892..345fa84 100644 --- a/src/ram.l +++ b/src/ram.l @@ -9,11 +9,11 @@ %% -[rio][0-9]* { yylval = yytext; return REGISTER;} -[rio]@[rio][0-9]* { yylval = yytext; return REGISTER_REF;} -[0-9]* { yylval = yytext; return VALUE;} -ADD|SUB|MULT|DIV { yylval = yytext; return OP;} -JUMP|JE|JL { yylval = yytext; return OP_CTRL;} +[rio][0-9]* { yylval = strdup(yytext); return REGISTER;} +[rio]@[rio][0-9]* { yylval = strdup(yytext); return REGISTER_REF;} +[0-9]* { yylval = strdup(yytext); return VALUE;} +ADD|SUB|MULT|DIV { yylval = strdup(yytext); return OP;} +JUMP|JE|JL { yylval = strdup(yytext); return OP_CTRL;} [ ]*,[ ]* {return COMMA;} \( {return PAR_O;} \) {return PAR_C;}