![]() |
Gorgon Game Engine
|
Intermediate language complier. More...
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 Intermediate & | Duplicate (Scope *scope) const |
virtual void | Finalize () override |
Finalizes the compilation. More... | |
![]() | |
Base (Scope *scope) | |
virtual | ~Base () |
Scope & | GetScope () 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 | |
![]() | |
std::vector< Instruction > | List |
The instructions that are compiled. More... | |
![]() | |
Scope * | scope |
The current scope the compiler is compiling, can be nullptr. More... | |
Intermediate language complier.
Intermediate | ( | Scope * | scope = nullptr | ) |
|
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.
|
virtual |
Implements Base.
References Intermediate::Intermediate(), and Base::scope.
|
overridevirtual |
Finalizes the compilation.
Compiler may throw an error about missing constructs at this point.
Implements Base.