diff options
author | Eugene Sandulenko | 2016-06-25 10:11:55 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-03 23:40:36 +0200 |
commit | 2b6f00fc1a03cb8a6d5f1574851302c1380e3408 (patch) | |
tree | f798009bd91fb184054919e8b9164a6f9658537e /engines/director/lingo/lingo-gr.y | |
parent | 2451bed12822cd1996d616dc5c296cff5aecbcde (diff) | |
download | scummvm-rg350-2b6f00fc1a03cb8a6d5f1574851302c1380e3408.tar.gz scummvm-rg350-2b6f00fc1a03cb8a6d5f1574851302c1380e3408.tar.bz2 scummvm-rg350-2b6f00fc1a03cb8a6d5f1574851302c1380e3408.zip |
DIRECTOR: Lingo: Removed redundant endianness specification in READ/WRITE
Diffstat (limited to 'engines/director/lingo/lingo-gr.y')
-rw-r--r-- | engines/director/lingo/lingo-gr.y | 76 |
1 files changed, 52 insertions, 24 deletions
diff --git a/engines/director/lingo/lingo-gr.y b/engines/director/lingo/lingo-gr.y index 5f775c40b0..5b02796be3 100644 --- a/engines/director/lingo/lingo-gr.y +++ b/engines/director/lingo/lingo-gr.y @@ -104,24 +104,39 @@ programline: | /* empty */ ; -asgn: tPUT expr tINTO ID { g_lingo->code1(g_lingo->c_varpush); g_lingo->codeString($4->c_str()); g_lingo->code1(g_lingo->c_assign); $$ = $2; delete $4; } - | tSET ID '=' expr { g_lingo->code1(g_lingo->c_varpush); g_lingo->codeString($2->c_str()); g_lingo->code1(g_lingo->c_assign); $$ = $4; delete $2; } - | tSET ID tTO expr { g_lingo->code1(g_lingo->c_varpush); g_lingo->codeString($2->c_str()); g_lingo->code1(g_lingo->c_assign); $$ = $4; delete $2; } +asgn: tPUT expr tINTO ID { + g_lingo->code1(g_lingo->c_varpush); + g_lingo->codeString($4->c_str()); + g_lingo->code1(g_lingo->c_assign); + $$ = $2; + delete $4; } + | tSET ID '=' expr { + g_lingo->code1(g_lingo->c_varpush); + g_lingo->codeString($2->c_str()); + g_lingo->code1(g_lingo->c_assign); + $$ = $4; + delete $2; } + | tSET ID tTO expr { + g_lingo->code1(g_lingo->c_varpush); + g_lingo->codeString($2->c_str()); + g_lingo->code1(g_lingo->c_assign); + $$ = $4; + delete $2; } ; stmt: expr { g_lingo->code1(g_lingo->c_xpop); } | func | if cond tTHEN stmtlist end tEND tIF { inst then = 0, end = 0; - WRITE_LE_UINT32(&then, $4); - WRITE_LE_UINT32(&end, $5); + WRITE_UINT32(&then, $4); + WRITE_UINT32(&end, $5); (*g_lingo->_currentScript)[$1 + 1] = then; /* thenpart */ (*g_lingo->_currentScript)[$1 + 3] = end; } /* end, if cond fails */ | if cond tTHEN stmtlist end tELSE stmtlist end tEND tIF { inst then = 0, else1 = 0, end = 0; - WRITE_LE_UINT32(&then, $4); - WRITE_LE_UINT32(&else1, $7); - WRITE_LE_UINT32(&end, $8); + WRITE_UINT32(&then, $4); + WRITE_UINT32(&else1, $7); + WRITE_UINT32(&end, $8); (*g_lingo->_currentScript)[$1 + 1] = then; /* thenpart */ (*g_lingo->_currentScript)[$1 + 2] = else1; /* elsepart */ (*g_lingo->_currentScript)[$1 + 3] = end; } /* end, if cond fails */ @@ -131,8 +146,8 @@ stmt: expr { g_lingo->code1(g_lingo->c_xpop); } // | repeatwhile '(' cond ')' stmtlist end tEND tREPEAT { inst body = 0, end = 0; - WRITE_LE_UINT32(&body, $5); - WRITE_LE_UINT32(&end, $6); + WRITE_UINT32(&body, $5); + WRITE_UINT32(&end, $6); (*g_lingo->_currentScript)[$1 + 1] = body; /* body of loop */ (*g_lingo->_currentScript)[$1 + 2] = end; } /* end, if cond fails */ ; @@ -142,11 +157,11 @@ stmt: expr { g_lingo->code1(g_lingo->c_xpop); } // | repeatwith '=' expr end tTO expr end stmtlist end tEND tREPEAT { inst init = 0, finish = 0, body = 0, end = 0, inc = 0; - WRITE_LE_UINT32(&init, $3); - WRITE_LE_UINT32(&finish, $6); - WRITE_LE_UINT32(&body, $8); - WRITE_LE_UINT32(&end, $9); - WRITE_LE_UINT32(&inc, 1); + WRITE_UINT32(&init, $3); + WRITE_UINT32(&finish, $6); + WRITE_UINT32(&body, $8); + WRITE_UINT32(&end, $9); + WRITE_UINT32(&inc, 1); (*g_lingo->_currentScript)[$1 + 1] = init; /* initial count value */ (*g_lingo->_currentScript)[$1 + 2] = finish;/* final count value */ (*g_lingo->_currentScript)[$1 + 3] = body; /* body of loop */ @@ -158,11 +173,11 @@ stmt: expr { g_lingo->code1(g_lingo->c_xpop); } // | repeatwith '=' expr end tDOWN tTO expr end stmtlist end tEND tREPEAT { inst init = 0, finish = 0, body = 0, end = 0, inc = 0; - WRITE_LE_UINT32(&init, $3); - WRITE_LE_UINT32(&finish, $7); - WRITE_LE_UINT32(&body, $9); - WRITE_LE_UINT32(&end, $10); - WRITE_LE_UINT32(&inc, -1); + WRITE_UINT32(&init, $3); + WRITE_UINT32(&finish, $7); + WRITE_UINT32(&body, $9); + WRITE_UINT32(&end, $10); + WRITE_UINT32(&inc, -1); (*g_lingo->_currentScript)[$1 + 1] = init; /* initial count value */ (*g_lingo->_currentScript)[$1 + 2] = finish;/* final count value */ (*g_lingo->_currentScript)[$1 + 3] = body; /* body of loop */ @@ -196,7 +211,7 @@ stmtlist: /* nothing */ { $$ = g_lingo->_currentScript->size(); } expr: INT { $$ = g_lingo->code1(g_lingo->c_constpush); inst i = 0; - WRITE_LE_UINT32(&i, $1); + WRITE_UINT32(&i, $1); g_lingo->code1(i); }; | ID { $$ = g_lingo->code1(g_lingo->c_varpush); @@ -236,9 +251,22 @@ func: tMCI STRING { g_lingo->code1(g_lingo->c_mci); g_lingo->codeString($2->c_ gotofunc: tGO tLOOP { g_lingo->code1(g_lingo->c_gotoloop); } | tGO tNEXT { g_lingo->code1(g_lingo->c_gotonext); } | tGO tPREVIOUS { g_lingo->code1(g_lingo->c_gotoprevious); } - | tGO gotoframe { g_lingo->code1(g_lingo->c_goto); g_lingo->codeString($2->c_str()); g_lingo->codeString(""); delete $2; } - | tGO gotoframe gotomovie { g_lingo->code1(g_lingo->c_goto); g_lingo->codeString($2->c_str()); g_lingo->codeString($3->c_str()); delete $2; delete $3; } - | tGO gotomovie { g_lingo->code1(g_lingo->c_goto); g_lingo->codeString(""); g_lingo->codeString($2->c_str()); delete $2; } + | tGO gotoframe { + g_lingo->code1(g_lingo->c_goto); + g_lingo->codeString($2->c_str()); + g_lingo->codeString(""); + delete $2; } + | tGO gotoframe gotomovie { + g_lingo->code1(g_lingo->c_goto); + g_lingo->codeString($2->c_str()); + g_lingo->codeString($3->c_str()); + delete $2; + delete $3; } + | tGO gotomovie { + g_lingo->code1(g_lingo->c_goto); + g_lingo->codeString(""); + g_lingo->codeString($2->c_str()); + delete $2; } ; gotoframe: tTO tFRAME STRING { $$ = $3; } |