Gorgon Game Engine
ScopeInstance Class Reference

This is an instantiation of a scope. More...

Public Member Functions

 ~ScopeInstance ()
 
void AddSymbol (const StaticMember &symbol)
 Adds a symbol to the symbol table of this scope. More...
 
void Compile ()
 Forces the compilation of entire scope. More...
 
Data FindSymbol (const std::string &name, bool reference)
 Tries to find the given symbol (including variables) More...
 
const InstructionGet ()
 Returns the code at the current line and increments the current line. More...
 
unsigned long GetLineNumber () const
 Returns the current executing logical line number. More...
 
VariableGetLocalVariable (const std::string &name)
 
const std::map< std::string, Variable, String::CaseInsensitiveLess > & GetLocalVariables ()
 
SourceMarker GetMarkerForCurrent () const
 Returns a unique identifier for the next line in source code. More...
 
SourceMarker GetMarkerForNext () const
 Returns a unique identifier for the next line in source code. More...
 
std::string GetName () const
 
long GetPhysicalLine ()
 
ScopeGetScope () const
 Returns the scope of this scope instance. More...
 
VariableGetVariable (const std::string &name)
 
void Jumpto (unsigned long line)
 Jumps to the given line, line numbers start at zero. More...
 
void MoveToEnd ()
 
const InstructionPeek ()
 Returns the code at the current line without incrementing it. More...
 
const InstructionPeek (unsigned long line)
 Returns the code at the given line without changing current line. More...
 
void SetReturn (Return returns)
 Sets the return type of this scope instance. More...
 
void SetVariable (const std::string &name, const Data &data)
 
bool UnsetVariable (const std::string &name)
 

Public Attributes

Data ReturnValue
 Current return value of the scope. This value can be modified before actually returning from the scope. More...
 

Detailed Description

This is an instantiation of a scope.

Constructor & Destructor Documentation

◆ ~ScopeInstance()

Member Function Documentation

◆ AddSymbol()

void AddSymbol ( const StaticMember symbol)

Adds a symbol to the symbol table of this scope.

References Member::GetName(), and Member::GetQualifiedName().

◆ Compile()

void Compile ( )

Forces the compilation of entire scope.

References Scope::ReadInstruction().

◆ FindSymbol()

Data FindSymbol ( const std::string &  name,
bool  reference 
)

◆ Get()

const Instruction* Get ( )

Returns the code at the current line and increments the current line.

References Scope::ReadInstruction().

◆ GetLineNumber()

unsigned long GetLineNumber ( ) const

Returns the current executing logical line number.

◆ GetLocalVariable()

Variable* GetLocalVariable ( const std::string &  name)

◆ GetLocalVariables()

const std::map<std::string, Variable, String::CaseInsensitiveLess>& GetLocalVariables ( )

◆ GetMarkerForCurrent()

SourceMarker GetMarkerForCurrent ( ) const

Returns a unique identifier for the next line in source code.

This information can be used to go back across execution scopes. Useful for Try Catch like structures.

◆ GetMarkerForNext()

SourceMarker GetMarkerForNext ( ) const

Returns a unique identifier for the next line in source code.

This information can be used to go back across execution scopes. Useful for Try Catch like structures.

◆ GetName()

std::string GetName ( ) const

◆ GetPhysicalLine()

long GetPhysicalLine ( )

◆ GetScope()

Scope& GetScope ( ) const

Returns the scope of this scope instance.

◆ GetVariable()

◆ Jumpto()

void Jumpto ( unsigned long  line)

Jumps to the given line, line numbers start at zero.

◆ MoveToEnd()

void MoveToEnd ( )

◆ Peek() [1/2]

const Instruction* Peek ( )

Returns the code at the current line without incrementing it.

References Scope::ReadInstruction().

◆ Peek() [2/2]

const Instruction* Peek ( unsigned long  line)

Returns the code at the given line without changing current line.

References Scope::ReadInstruction().

◆ SetReturn()

void SetReturn ( Return  returns)

Sets the return type of this scope instance.

◆ SetVariable()

void SetVariable ( const std::string &  name,
const Data data 
)

◆ UnsetVariable()

Member Data Documentation

◆ ReturnValue

Data ReturnValue

Current return value of the scope. This value can be modified before actually returning from the scope.


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