diff options
author | Eugene Sandulenko | 2016-06-11 22:43:05 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-03 23:40:36 +0200 |
commit | 824c3fb6616b9afa65ac3db5d2c8d97a26004dd8 (patch) | |
tree | 5ead080d129dbbd329accf012b68ae4571279b25 /engines/director/lingo/lingo-gr.y | |
parent | e4428587b763b0f1da48de9decf251f98ddd3f00 (diff) | |
download | scummvm-rg350-824c3fb6616b9afa65ac3db5d2c8d97a26004dd8.tar.gz scummvm-rg350-824c3fb6616b9afa65ac3db5d2c8d97a26004dd8.tar.bz2 scummvm-rg350-824c3fb6616b9afa65ac3db5d2c8d97a26004dd8.zip |
DIRECTOR: Added stub for 'mci' Lingo command
Diffstat (limited to 'engines/director/lingo/lingo-gr.y')
-rw-r--r-- | engines/director/lingo/lingo-gr.y | 53 |
1 files changed, 34 insertions, 19 deletions
diff --git a/engines/director/lingo/lingo-gr.y b/engines/director/lingo/lingo-gr.y index 49149cbfba..25b6736474 100644 --- a/engines/director/lingo/lingo-gr.y +++ b/engines/director/lingo/lingo-gr.y @@ -32,6 +32,8 @@ extern int yylex(); extern int yyparse(); void yyerror(char *s) { error("%s", s); } +int func_mci(Common::String *s); + %} %union { int i; Common::String *s; } @@ -39,7 +41,11 @@ void yyerror(char *s) { error("%s", s); } %token UNARY %token<i> INT %token<s> VAR +%token<s> STRING +%token FUNC_MCI + %type<i> expr +%type<i> func %right '=' %left '+' '-' @@ -49,24 +55,33 @@ void yyerror(char *s) { error("%s", s); } %% list: statement - | list statement - ; - -statement: expr ',' - | expr ':' { warning("%d", $1); } - ; - -expr: INT { $$ = $1; } - | VAR { $$ = vars[*$1]; delete $1; } - | VAR '=' expr { $$ = vars[*$1] = $3; delete $1; } - | expr '+' expr { $$ = $1 + $3; } - | expr '-' expr { $$ = $1 - $3; } - | expr '*' expr { $$ = $1 * $3; } - | expr '/' expr { $$ = $1 / $3; } - | expr '%' expr { $$ = $1 % $3; } - | '+' expr %prec UNARY { $$ = $2; } - | '-' expr %prec UNARY { $$ = -$2; } - | '(' expr ')' { $$ = $2; } - ; + | list statement + ; + +statement: expr { warning("%d", $1); } + | func { warning("%d", $1); } + ; + +expr: INT { $$ = $1; } + | VAR { $$ = vars[*$1]; delete $1; } + | VAR '=' expr { $$ = vars[*$1] = $3; delete $1; } + | expr '+' expr { $$ = $1 + $3; } + | expr '-' expr { $$ = $1 - $3; } + | expr '*' expr { $$ = $1 * $3; } + | expr '/' expr { $$ = $1 / $3; } + | expr '%' expr { $$ = $1 % $3; } + | '+' expr %prec UNARY { $$ = $2; } + | '-' expr %prec UNARY { $$ = -$2; } + | '(' expr ')' { $$ = $2; } + | + ; + +func: FUNC_MCI STRING { func_mci($2); delete $2; } %% + +int func_mci(Common::String *s) { + warning("mci: %s", s->c_str()); + + return 0; +} |