ScummVM API documentation
MutationOfJB::EndBlockCommandParser Class Reference
Inheritance diagram for MutationOfJB::EndBlockCommandParser:
MutationOfJB::CommandParser

Public Member Functions

bool parse (const Common::String &line, ScriptParseContext &parseCtx, Command *&command) override
 
void transition (ScriptParseContext &parseCtx, Command *oldCommand, Command *newCommand, CommandParser *newCommandParser) override
 
void finish (ScriptParseContext &parseCtx) override
 
virtual bool parse (const Common::String &line, ScriptParseContext &parseCtx, Command *&command)=0
 
virtual void transition (ScriptParseContext &parseCtx, Command *oldCommand, Command *newCommand, CommandParser *newCommandParser)
 
virtual void finish (ScriptParseContext &parseCtx)
 

Member Function Documentation

◆ parse()

bool MutationOfJB::EndBlockCommandParser::parse ( const Common::String &  line,
ScriptParseContext &  parseCtx,
Command *&  command 
)
overridevirtual

Parses the specified line and possibly returns a Command instance.

Parameters
lineLine to parse.
parseCtxParse context.
commandOutput parameter for newly created command.
Returns
True if the line has been successfully parsed by this parser, false otherwise.
Note
You may return true and set command to nullptr. That means the line has been successfully parsed, but no command is needed.

Implements MutationOfJB::CommandParser.

◆ transition()

void MutationOfJB::EndBlockCommandParser::transition ( ScriptParseContext &  parseCtx,
Command *  oldCommand,
Command *  newCommand,
CommandParser *  newCommandParser 
)
overridevirtual

Called when transitioning parsing between two commands.

For example, cmdParserA->transition(parseCtx, cmdA, cmdB, cmdParserB) is called after command B is done parsing to notify command A parser about the transition from command A to command B. This is useful for sequential commands, because at the time command A is being parsed, we don't have any information about command B, so we cannot set the next pointer. Transition method can be used to set the next pointer after command B is available.

Parameters
parseCtxParse context.
oldCommandOld command (created by this parser).
newCommandNew command (created by newCommandParser).
newCommandParserCommand parser which created the new command.

Reimplemented from MutationOfJB::CommandParser.

◆ finish()

void MutationOfJB::EndBlockCommandParser::finish ( ScriptParseContext &  parseCtx)
overridevirtual

Called after the whole script is parsed.

Can be used for cleanup.

Parameters
parseCtxParse context.

Reimplemented from MutationOfJB::CommandParser.


The documentation for this class was generated from the following file: