diff options
Diffstat (limited to 'engines/parallaction/parser_br.cpp')
-rw-r--r-- | engines/parallaction/parser_br.cpp | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/engines/parallaction/parser_br.cpp b/engines/parallaction/parser_br.cpp index 1968b008eb..8b36f54ea7 100644 --- a/engines/parallaction/parser_br.cpp +++ b/engines/parallaction/parser_br.cpp @@ -316,7 +316,7 @@ DECLARE_COMMAND_PARSER(endif) { DECLARE_COMMAND_PARSER(location) { debugC(7, kDebugParser, "COMMAND_PARSER(location) "); - createCommand(_lookup); + createCommand(_locationParser->_lookup); _locParseCtxt.cmd->u._string = strdup(_tokens[1]); _locParseCtxt.nextToken++; @@ -345,7 +345,7 @@ DECLARE_COMMAND_PARSER(location) { DECLARE_COMMAND_PARSER(string) { debugC(7, kDebugParser, "COMMAND_PARSER(string) "); - createCommand(_lookup); + createCommand(_locationParser->_lookup); _locParseCtxt.cmd->u._string = strdup(_tokens[1]); _locParseCtxt.nextToken++; @@ -357,7 +357,7 @@ DECLARE_COMMAND_PARSER(string) { DECLARE_COMMAND_PARSER(math) { debugC(7, kDebugParser, "COMMAND_PARSER(math) "); - createCommand(_lookup); + createCommand(_locationParser->_lookup); _locParseCtxt.cmd->u._lvalue = _countersNames->lookup(_tokens[1]); _locParseCtxt.nextToken++; @@ -372,7 +372,7 @@ DECLARE_COMMAND_PARSER(math) { DECLARE_COMMAND_PARSER(test) { debugC(7, kDebugParser, "COMMAND_PARSER(test) "); - createCommand(_lookup); + createCommand(_locationParser->_lookup); uint counter = _countersNames->lookup(_tokens[1]); _locParseCtxt.nextToken++; @@ -405,7 +405,7 @@ DECLARE_COMMAND_PARSER(test) { DECLARE_COMMAND_PARSER(music) { debugC(7, kDebugParser, "COMMAND_PARSER(music) "); - createCommand(_lookup); + createCommand(_locationParser->_lookup); _locParseCtxt.cmd->u._musicCommand = _audioCommandsNames->lookup(_tokens[1]); _locParseCtxt.nextToken++; @@ -423,7 +423,7 @@ DECLARE_COMMAND_PARSER(music) { DECLARE_COMMAND_PARSER(zeta) { debugC(7, kDebugParser, "COMMAND_PARSER(zeta) "); - createCommand(_lookup); + createCommand(_locationParser->_lookup); _locParseCtxt.cmd->u._zeta0 = atoi(_tokens[1]); _locParseCtxt.nextToken++; @@ -445,7 +445,7 @@ DECLARE_COMMAND_PARSER(zeta) { DECLARE_COMMAND_PARSER(give) { debugC(7, kDebugParser, "COMMAND_PARSER(give) "); - createCommand(_lookup); + createCommand(_locationParser->_lookup); _locParseCtxt.cmd->u._object = 4 + atoi(_tokens[1]); _locParseCtxt.nextToken++; @@ -471,7 +471,7 @@ DECLARE_COMMAND_PARSER(give) { DECLARE_COMMAND_PARSER(text) { debugC(7, kDebugParser, "COMMAND_PARSER(text) "); - createCommand(_lookup); + createCommand(_locationParser->_lookup); if (isdigit(_tokens[1][1])) { _locParseCtxt.cmd->u._zeta0 = atoi(_tokens[1]); @@ -497,7 +497,7 @@ DECLARE_COMMAND_PARSER(text) { DECLARE_COMMAND_PARSER(unary) { debugC(7, kDebugParser, "COMMAND_PARSER(unary) "); - createCommand(_lookup); + createCommand(_locationParser->_lookup); _locParseCtxt.cmd->u._rvalue = atoi(_tokens[1]); _locParseCtxt.nextToken++; @@ -548,7 +548,7 @@ DECLARE_ZONE_PARSER(type) { // } } - popParserTables(); + _locationParser->popTables(); } @@ -592,7 +592,7 @@ DECLARE_ANIM_PARSER(endanimation) { _locParseCtxt.a->_flags |= 0x1000000; - popParserTables(); + _locationParser->popTables(); } @@ -760,6 +760,8 @@ typedef OpcodeImpl<Parallaction_br> OpcodeV2; void Parallaction_br::initParsers() { + _locationParser = new Parser; + static const OpcodeV2 op0[] = { INSTRUCTION_PARSER(defLocal), // invalid opcode -> local definition INSTRUCTION_PARSER(zone), // on @@ -908,10 +910,6 @@ void Parallaction_br::initParsers() { for (i = 0; i < ARRAYSIZE(op6); i++) _locationAnimParsers.push_back(&op6[i]); - - _currentOpcodes = 0; - _currentStatements = 0; - } void Parallaction_br::parseLocation(const char* filename) { |