diff options
Diffstat (limited to 'engines/director/lingo/lingo-lex.l')
-rw-r--r-- | engines/director/lingo/lingo-lex.l | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/engines/director/lingo/lingo-lex.l b/engines/director/lingo/lingo-lex.l index 081a50542a..575d09ec9a 100644 --- a/engines/director/lingo/lingo-lex.l +++ b/engines/director/lingo/lingo-lex.l @@ -34,12 +34,18 @@ void yyparse(); %} +variable [_[:alpha:]][_[:alnum:]]* +constinteger [[:digit:]]+ +conststring \"[^\"\n]*\" +operator [-+*/%=^:,] + %% -[_[:alpha:]][_[:alnum:]]* yylval.s = new Common::String(yytext); return VAR; -[[:digit:]]+ yylval.i = strtol(yytext, NULL, 10); return INT; -[-+*/%=^:,] return *yytext; -.|\n ; /* ignore all the rest */ +mci { return FUNC_MCI; } +{variable} { yylval.s = new Common::String(yytext); return VAR; } +{constinteger} { yylval.i = strtol(yytext, NULL, 10); return INT; } +{operator} { return *yytext; } +{conststring} { yylval.s = new Common::String(yytext); return STRING; } %% |