ScummVM API documentation
Stark::Tools::ASTNode Struct Referenceabstract

#include <abstractsyntaxtree.h>

Inheritance diagram for Stark::Tools::ASTNode:
Stark::Tools::ASTBlock Stark::Tools::ASTCommand Stark::Tools::ASTCondition Stark::Tools::ASTLoop

Public Member Functions

 ASTNode (ASTNode *parent)
 
virtual void print (uint depth, DefinitionRegistry *definitions)=0
 
virtual Common::Array< const ASTCommand * > listCommands (uint16 index) const =0
 
void findSuccessors (ASTNode **follower, ASTNode **trueBranch, ASTNode **falseBranch) const
 
virtual void findSuccessorsIntern (const ASTNode *node, ASTNode **follower, ASTNode **trueBranch, ASTNode **falseBranch) const =0
 
virtual const ASTCommandgetFirstCommand () const =0
 

Protected Member Functions

void printWithDepth (uint depth, const Common::String &string) const
 

Protected Attributes

ASTNode_parent
 

Detailed Description

Base Abstract Syntax Tree node

The abstract syntax tree directly maps the script source code.

Member Function Documentation

◆ print()

virtual void Stark::Tools::ASTNode::print ( uint  depth,
DefinitionRegistry definitions 
)
pure virtual

Print the script source code for this node and its children

Implemented in Stark::Tools::ASTLoop, Stark::Tools::ASTCondition, Stark::Tools::ASTBlock, and Stark::Tools::ASTCommand.

◆ listCommands()

virtual Common::Array<const ASTCommand *> Stark::Tools::ASTNode::listCommands ( uint16  index) const
pure virtual

Recursively list all the commands in the tree with the requested index

Implemented in Stark::Tools::ASTLoop, Stark::Tools::ASTCondition, Stark::Tools::ASTBlock, and Stark::Tools::ASTCommand.

◆ findSuccessors()

void Stark::Tools::ASTNode::findSuccessors ( ASTNode **  follower,
ASTNode **  trueBranch,
ASTNode **  falseBranch 
) const

Find the successors of a node, either the direct follower or the condition branches

◆ getFirstCommand()

virtual const ASTCommand* Stark::Tools::ASTNode::getFirstCommand ( ) const
pure virtual

Find the first command to be executed when running this job

Implemented in Stark::Tools::ASTLoop, Stark::Tools::ASTCondition, Stark::Tools::ASTBlock, and Stark::Tools::ASTCommand.


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