Gorgon Game Engine
Intermediate Class Reference

Intermediate language complier. More...

Inheritance diagram for Intermediate:
[legend]

Public Member Functions

 Intermediate (Scope *scope=nullptr)
 
virtual unsigned Compile (const std::string &input, unsigned long pline) override
 Asks the compiler to compile the given input. More...
 
virtual IntermediateDuplicate (Scope *scope) const
 
virtual void Finalize () override
 Finalizes the compilation. More...
 
- Public Member Functions inherited from Base
 Base (Scope *scope)
 
virtual ~Base ()
 
ScopeGetScope () const
 Returns the scope that compiler will compile. More...
 
bool HasScope () const
 Returns if this compiler is bound to a scope. More...
 

Additional Inherited Members

- Public Attributes inherited from Base
std::vector< InstructionList
 The instructions that are compiled. More...
 
- Protected Attributes inherited from Base
Scopescope
 The current scope the compiler is compiling, can be nullptr. More...
 

Detailed Description

Intermediate language complier.

Constructor & Destructor Documentation

◆ Intermediate()

Intermediate ( Scope scope = nullptr)

Member Function Documentation

◆ Compile()

unsigned Compile ( const std::string &  input,
unsigned long  pline 
)
overridevirtual

Asks the compiler to compile the given input.

Returns the number of instructions generated from the code. Compiler is free to request additional input by returning zero. This does not necessarily mean there is no compilable source in the given input it may simply be an incomplete line. When there is no more input, caller should finish compilation by calling Finalize

Implements Base.

References Gorgon::Scripting::Compilers::CheckInputFor(), Base::List, Instruction::Store, and Instruction::Type.

◆ Duplicate()

virtual Intermediate& Duplicate ( Scope scope) const
virtual

Implements Base.

References Intermediate::Intermediate(), and Base::scope.

◆ Finalize()

virtual void Finalize ( )
overridevirtual

Finalizes the compilation.

Compiler may throw an error about missing constructs at this point.

Implements Base.


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