ScummVM API documentation
MutationOfJB::CommandParser Class Referenceabstract

#include <command.h>

Inheritance diagram for MutationOfJB::CommandParser:
MutationOfJB::CallMacroCommandParser MutationOfJB::ConditionalCommandParser MutationOfJB::EndBlockCommandParser MutationOfJB::GotoCommandParser MutationOfJB::RandomBlockStartParser MutationOfJB::RandomCommandParser MutationOfJB::SeqCommandParser MutationOfJB::CameFromCommandParser MutationOfJB::IfCommandParser MutationOfJB::IfItemCommandParser MutationOfJB::IfPiggyCommandParser MutationOfJB::AddItemCommandParser MutationOfJB::BitmapVisibilityCommandParser MutationOfJB::ChangeCommandParser MutationOfJB::DefineStructCommandParser MutationOfJB::LabelCommandParser MutationOfJB::LoadPlayerCommandParser MutationOfJB::NewRoomCommandParser MutationOfJB::PlayAnimationCommandParser MutationOfJB::RemoveAllItemsCommandParser MutationOfJB::RemoveItemCommandParser MutationOfJB::RenameCommandParser MutationOfJB::SayCommandParser MutationOfJB::SetColorCommandParser MutationOfJB::SetObjectFrameCommandParser MutationOfJB::SpecialShowCommandParser MutationOfJB::SwitchPartCommandParser MutationOfJB::TalkCommandParser

Public Member Functions

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)
 

Detailed Description

Base class for command parsers.

The parser's main job is to create a Command instance from input line.

Member Function Documentation

◆ parse()

virtual bool MutationOfJB::CommandParser::parse ( const Common::String line,
ScriptParseContext parseCtx,
Command *&  command 
)
pure virtual

◆ transition()

virtual void MutationOfJB::CommandParser::transition ( ScriptParseContext parseCtx,
Command oldCommand,
Command newCommand,
CommandParser newCommandParser 
)
virtual

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 in MutationOfJB::RandomBlockStartParser, MutationOfJB::EndBlockCommandParser, MutationOfJB::CallMacroCommandParser, MutationOfJB::ConditionalCommandParser, and MutationOfJB::SeqCommandParser.

◆ finish()

virtual void MutationOfJB::CommandParser::finish ( ScriptParseContext parseCtx)
virtual

Called after the whole script is parsed.

Can be used for cleanup.

Parameters
parseCtxParse context.

Reimplemented in MutationOfJB::EndBlockCommandParser, and MutationOfJB::ConditionalCommandParser.


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