public

Inheritance Graph

graph BT
	Compiler
	click Compiler "classEScript_1_1Compiler"

Description

Compiler Input: Syntax tree made of Expressions Output: Byte Code made of EAssembler-Instructions

Logging

   
   
Logger * getLogger() const

Internal helpers

   
   
void addExpression( FnCompileContext & ctxt, EPtr < AST::ASTNode > expression) const
   
void addStatement( FnCompileContext & ctxt, EPtr < AST::ASTNode > statement) const
   
void throwError( FnCompileContext & ctxt, const std::string & message) const
   
void finalizeInstructions( InstructionBlock & instructions)

Public Functions

   
   
  Compiler( Logger * _logger)
   
std::pair< ERef < UserFunction >, _CountedRef < StaticData > > compile(const CodeFragment & code, const std::vector< StringId > & injectedStaticVarNames)

Documentation

function
EScript::Compiler::getLogger

public const inline
   
   
Logger * getLogger( ) const

Defined in EScript/EScript/Compiler/Compiler.h:45


function
EScript::Compiler::addExpression

public const
     
     
void addExpression( FnCompileContext & ctxt,
  EPtr < AST::ASTNode > expression
) const    

Defined in EScript/EScript/Compiler/Compiler.h:57


function
EScript::Compiler::addStatement

public const
     
     
void addStatement( FnCompileContext & ctxt,
  EPtr < AST::ASTNode > statement
) const    

Defined in EScript/EScript/Compiler/Compiler.h:58


function
EScript::Compiler::throwError

public const
     
     
void throwError( FnCompileContext & ctxt,
  const std::string & message
) const    

Defined in EScript/EScript/Compiler/Compiler.h:60


function
EScript::Compiler::finalizeInstructions

public static
     
     
void finalizeInstructions( InstructionBlock & instructions )

(static,internal)

  • Replaces the markers inside the assembly by jump addresses.

Defined in EScript/EScript/Compiler/Compiler.h:56


function
EScript::Compiler::Compiler

public
     
     
Compiler( Logger * _logger )

Defined in EScript/EScript/Compiler/Compiler.h:36


function
EScript::Compiler::compile

public
     
     
std::pair< ERef < UserFunction >, _CountedRef < StaticData > > compile( const CodeFragment & code,
  const std::vector< StringId > & injectedStaticVarNames
)    

Defined in EScript/EScript/Compiler/Compiler.h:38