Gorgon Game Engine
Programming Class Reference

Programming dialect compiler. More...

Inheritance diagram for Programming:
[legend]

Public Member Functions

 Programming (Scope *scope=nullptr)
 
virtual unsigned Compile (const std::string &input, unsigned long pline) override
 Asks the compiler to compile the given input. More...
 
virtual ProgrammingDuplicate (Scope *scope) const override
 
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

Programming dialect compiler.

Constructor & Destructor Documentation

◆ Programming()

Programming ( Scope scope = nullptr)

Member Function Documentation

◆ Compile()

virtual 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.

◆ Duplicate()

virtual Programming& Duplicate ( Scope scope) const
overridevirtual

Implements Base.

References Programming::Programming(), 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 file: