Documentation ¶
Index ¶
- Variables
- func CB1(val bool) value.Value
- func CI32(val int32) value.Value
- func CIC32(val int32) constant.Constant
- func Emit(program binder.BoundProgram, useFingerprints bool) *ir.Module
- func FindType(module *ir.Module, name string) types.Type
- func GlobalExists(module *ir.Module, name string) bool
- type Class
- type Comment
- type ConvertedStruct
- type Emitter
- func (emt *Emitter) Adapt()
- func (emt *Emitter) Box(blk **ir.Block, val value.Value, typ symbols.TypeSymbol) value.Value
- func (emt *Emitter) ConvertExternalCall(function symbols.FunctionSymbol) string
- func (emt *Emitter) ConvertType(fld symbols.TypeSymbol, structsAsPointers bool) string
- func (emt *Emitter) CreateObject(blk **ir.Block, src symbols.TypeSymbol, args ...value.Value) value.Value
- func (emt *Emitter) DefaultConstant(blk **ir.Block, typ symbols.TypeSymbol) constant.Constant
- func (emt *Emitter) EmitArrayAccessExpression(blk **ir.Block, expr boundnodes.BoundArrayAccessExpressionNode) value.Value
- func (emt *Emitter) EmitArrayAccessRef(blk **ir.Block, expr boundnodes.BoundArrayAccessExpressionNode) value.Value
- func (emt *Emitter) EmitArrayAssignment(blk **ir.Block, base value.Value, index value.Value, ...)
- func (emt *Emitter) EmitArrayAssignmentExpression(blk **ir.Block, expr boundnodes.BoundArrayAssignmentExpressionNode) value.Value
- func (emt *Emitter) EmitAssignment(blk **ir.Block, variable symbols.LocalVariableSymbol, ...)
- func (emt *Emitter) EmitAssignmentExpression(blk **ir.Block, expr boundnodes.BoundAssignmentExpressionNode) value.Value
- func (emt *Emitter) EmitBinaryExpression(blk **ir.Block, expr boundnodes.BoundBinaryExpressionNode) value.Value
- func (emt *Emitter) EmitBlockStatement(sym symbols.FunctionSymbol, fnc *ir.Func, ...)
- func (emt *Emitter) EmitBoundExpressionStatement(blk **ir.Block, stmt boundnodes.BoundExpressionStatementNode)
- func (emt *Emitter) EmitBuiltInFunctions()
- func (emt *Emitter) EmitCLibReferences()
- func (emt *Emitter) EmitCallExpression(blk **ir.Block, expr boundnodes.BoundCallExpressionNode) value.Value
- func (emt *Emitter) EmitClass(cls binder.BoundClass)
- func (emt *Emitter) EmitClassAndArcReferences(module *ir.Module)
- func (emt *Emitter) EmitClassCallExpression(blk **ir.Block, expr boundnodes.BoundClassCallExpressionNode) value.Value
- func (emt *Emitter) EmitClassConstructor(cls *Class, bcls binder.BoundClass, clsvConstant value.Value, ...) *ir.Func
- func (emt *Emitter) EmitClassFieldAccessExpression(blk **ir.Block, expr boundnodes.BoundClassFieldAccessExpressionNode) value.Value
- func (emt *Emitter) EmitClassFieldAccessExpressionRef(blk **ir.Block, _base boundnodes.BoundExpressionNode, ...) (value.Value, value.Value)
- func (emt *Emitter) EmitClassFieldAssignmentExpression(blk **ir.Block, expr boundnodes.BoundClassFieldAssignmentExpressionNode) value.Value
- func (emt *Emitter) EmitClassFunction(cls symbols.ClassSymbol, sym symbols.FunctionSymbol, ...) *ir.Func
- func (emt *Emitter) EmitConditionalGotoStatement(blk **ir.Block, stmt boundnodes.BoundConditionalGotoStatementNode)
- func (emt *Emitter) EmitConversionExpression(blk **ir.Block, expr boundnodes.BoundConversionExpressionNode) value.Value
- func (emt *Emitter) EmitDereferenceExpression(blk **ir.Block, expr boundnodes.BoundDereferenceExpressionNode) value.Value
- func (emt *Emitter) EmitEnumExpression(blk **ir.Block, expr boundnodes.BoundEnumExpressionNode) value.Value
- func (emt *Emitter) EmitExpression(blk **ir.Block, expr boundnodes.BoundExpressionNode) value.Value
- func (emt *Emitter) EmitExternalFunction(sym symbols.FunctionSymbol) *ir.Func
- func (emt *Emitter) EmitFunction(sym symbols.FunctionSymbol, body boundnodes.BoundBlockStatementNode) *ir.Func
- func (emt *Emitter) EmitFunctionExpression(blk **ir.Block, expr boundnodes.BoundFunctionExpressionNode) value.Value
- func (emt *Emitter) EmitGotoStatement(blk **ir.Block, stmt boundnodes.BoundGotoStatementNode)
- func (emt *Emitter) EmitLambdaExpression(blk **ir.Block, expr boundnodes.BoundLambdaExpressionNode) value.Value
- func (emt *Emitter) EmitLiteralExpression(blk **ir.Block, expr boundnodes.BoundLiteralExpressionNode) value.Value
- func (emt *Emitter) EmitMakeArrayExpression(blk **ir.Block, expr boundnodes.BoundMakeArrayExpressionNode) value.Value
- func (emt *Emitter) EmitMakeExpression(blk **ir.Block, expr boundnodes.BoundMakeExpressionNode) value.Value
- func (emt *Emitter) EmitMakeStructExpression(blk **ir.Block, expr boundnodes.BoundMakeStructExpressionNode) value.Value
- func (emt *Emitter) EmitPackageCallExpression(blk **ir.Block, expr boundnodes.BoundPackageCallExpressionNode) value.Value
- func (emt *Emitter) EmitPointerAccessExpression(blk **ir.Block, expr boundnodes.BoundArrayAccessExpressionNode, ...) value.Value
- func (emt *Emitter) EmitPointerAccessRef(blk **ir.Block, expr boundnodes.BoundArrayAccessExpressionNode) value.Value
- func (emt *Emitter) EmitPointerAssignmentExpression(blk **ir.Block, expr boundnodes.BoundArrayAssignmentExpressionNode, ...) value.Value
- func (emt *Emitter) EmitReferenceExpression(blk **ir.Block, expr boundnodes.BoundReferenceExpressionNode) value.Value
- func (emt *Emitter) EmitReturnStatement(blk **ir.Block, stmt boundnodes.BoundReturnStatementNode)
- func (emt *Emitter) EmitStruct(stc symbols.StructSymbol)
- func (emt *Emitter) EmitStructFieldAccessExpression(blk **ir.Block, expr boundnodes.BoundClassFieldAccessExpressionNode) value.Value
- func (emt *Emitter) EmitStructFieldAccessExpressionRef(blk **ir.Block, base boundnodes.BoundExpressionNode, ...) value.Value
- func (emt *Emitter) EmitStructFieldAssignmentExpression(blk **ir.Block, expr boundnodes.BoundClassFieldAssignmentExpressionNode) value.Value
- func (emt *Emitter) EmitTernaryExpression(blk **ir.Block, expr boundnodes.BoundTernaryExpressionNode) value.Value
- func (emt *Emitter) EmitThisExpression(blk **ir.Block, expr boundnodes.BoundThisExpressionNode) value.Value
- func (emt *Emitter) EmitTypeCallExpression(blk **ir.Block, expr boundnodes.BoundTypeCallExpressionNode) value.Value
- func (emt *Emitter) EmitUnaryExpression(blk **ir.Block, expr boundnodes.BoundUnaryExpressionNode) value.Value
- func (emt *Emitter) EmitUnloadedReference(blk **ir.Block, expr boundnodes.BoundExpressionNode) (value.Value, value.Value)
- func (emt *Emitter) EmitValidConversionCheck(blk **ir.Block, typ symbols.TypeSymbol, val value.Value)
- func (emt *Emitter) EmitVariable(blk **ir.Block, variable symbols.VariableSymbol, inMain bool) value.Value
- func (emt *Emitter) EmitVariableDeclaration(blk **ir.Block, varibale symbols.LocalVariableSymbol, isTmp bool)
- func (emt *Emitter) EmitVariableDeclarationStatement(blk **ir.Block, stmt boundnodes.BoundVariableDeclarationStatementNode)
- func (emt *Emitter) EmitVariableExpression(blk **ir.Block, expr boundnodes.BoundVariableExpressionNode) value.Value
- func (emt *Emitter) EmitVariablePtr(blk **ir.Block, variable symbols.VariableSymbol, inMain bool) value.Value
- func (emt *Emitter) GetConstantStringConstant(literal string) constant.Constant
- func (emt *Emitter) GetStringConstant(blk **ir.Block, literal string) value.Value
- func (emt *Emitter) GetThreadWrapper(source symbols.TypeSymbol) *ir.Func
- func (emt *Emitter) GetVtableConstant(src symbols.TypeSymbol, typ string) value.Value
- func (emt *Emitter) IRTypes(typ symbols.TypeSymbol) types.Type
- func (emt *Emitter) Id(sym symbols.Symbol) string
- func (emt *Emitter) ImportFunction(fnc *ir.Func) *ir.Func
- func (emt *Emitter) ImportPackage(pack symbols.PackageSymbol)
- func (emt *Emitter) ImportType(typ types.Type)
- func (emt *Emitter) InitDbg()
- func (emt *Emitter) LoadAndReferenceClasses(module *ir.Module)
- func (emt *Emitter) LoadAndReferenceClassesFromPackage(module *ir.Module, pack symbols.PackageSymbol)
- func (emt *Emitter) PopulateClass(cls *Class, bcls binder.BoundClass)
- func (emt *Emitter) PopulateStruct(stc *Struct, bstc symbols.StructSymbol)
- func (emt *Emitter) ResolveArray(typ symbols.TypeSymbol, cache *map[string]types.Type, ...) types.Type
- func (emt *Emitter) ResolveFunctionPointer(subTypes []symbols.TypeSymbol) types.Type
- func (emt *Emitter) SizeOf(blk **ir.Block, typ symbols.TypeSymbol) value.Value
- func (emt *Emitter) TypeExists(name string) bool
- type Function
- type Global
- type Local
- type Package
- type Struct
Constants ¶
This section is empty.
Variables ¶
View Source
var AdapterModule string
View Source
var CompileAsPackage bool
View Source
var CurrentVersion string
View Source
var EmitDebugInfo = false
View Source
var PackageName string
View Source
var SourceFile string
View Source
var VerboseARC = false
Functions ¶
Types ¶
type Comment ¶
type Comment struct { Text string // embed a dummy ir.Instruction to have Comment implement the ir.Instruction // interface. ir.Instruction }
func NewComment ¶
type ConvertedStruct ¶
type ConvertedStruct struct {
// contains filtered or unexported fields
}
type Emitter ¶
type Emitter struct { Program binder.BoundProgram Module *ir.Module UseFingerprints bool // referenced functions CFuncs map[string]*ir.Func ExcFuncs map[string]*ir.Func // referenced classes Classes map[string]*Class // referenced structs Structs map[string]*Struct // referenced packages Packages map[string]*Package // global variables Globals map[string]Global Functions map[string]Function FunctionWrappers map[string]*ir.Func Lambdas map[string]*ir.Func FunctionLocals map[string]map[string]Local StrConstants map[string]value.Value StrNameCounter int // local things for this current class Class *Class ClassSym symbols.ClassSymbol // local things for this current function Function *ir.Func FunctionSym symbols.FunctionSymbol Locals map[string]Local Temps []string Labels map[string]*ir.Block // flags IsInClass bool }
func (*Emitter) ConvertExternalCall ¶
func (emt *Emitter) ConvertExternalCall(function symbols.FunctionSymbol) string
func (*Emitter) ConvertType ¶
func (emt *Emitter) ConvertType(fld symbols.TypeSymbol, structsAsPointers bool) string
func (*Emitter) CreateObject ¶
func (*Emitter) DefaultConstant ¶
func (*Emitter) EmitArrayAccessExpression ¶
func (emt *Emitter) EmitArrayAccessExpression(blk **ir.Block, expr boundnodes.BoundArrayAccessExpressionNode) value.Value
func (*Emitter) EmitArrayAccessRef ¶
func (emt *Emitter) EmitArrayAccessRef(blk **ir.Block, expr boundnodes.BoundArrayAccessExpressionNode) value.Value
func (*Emitter) EmitArrayAssignment ¶
func (emt *Emitter) EmitArrayAssignment(blk **ir.Block, base value.Value, index value.Value, literalValue boundnodes.BoundExpressionNode)
func (*Emitter) EmitArrayAssignmentExpression ¶
func (emt *Emitter) EmitArrayAssignmentExpression(blk **ir.Block, expr boundnodes.BoundArrayAssignmentExpressionNode) value.Value
func (*Emitter) EmitAssignment ¶
func (emt *Emitter) EmitAssignment(blk **ir.Block, variable symbols.LocalVariableSymbol, val boundnodes.BoundExpressionNode)
func (*Emitter) EmitAssignmentExpression ¶
func (emt *Emitter) EmitAssignmentExpression(blk **ir.Block, expr boundnodes.BoundAssignmentExpressionNode) value.Value
func (*Emitter) EmitBinaryExpression ¶
func (emt *Emitter) EmitBinaryExpression(blk **ir.Block, expr boundnodes.BoundBinaryExpressionNode) value.Value
func (*Emitter) EmitBlockStatement ¶
func (emt *Emitter) EmitBlockStatement(sym symbols.FunctionSymbol, fnc *ir.Func, body boundnodes.BoundBlockStatementNode)
func (*Emitter) EmitBoundExpressionStatement ¶
func (emt *Emitter) EmitBoundExpressionStatement(blk **ir.Block, stmt boundnodes.BoundExpressionStatementNode)
func (*Emitter) EmitBuiltInFunctions ¶
func (emt *Emitter) EmitBuiltInFunctions()
func (*Emitter) EmitCLibReferences ¶
func (emt *Emitter) EmitCLibReferences()
func (*Emitter) EmitCallExpression ¶
func (emt *Emitter) EmitCallExpression(blk **ir.Block, expr boundnodes.BoundCallExpressionNode) value.Value
func (*Emitter) EmitClass ¶
func (emt *Emitter) EmitClass(cls binder.BoundClass)
</STRUCTS>------------------------------------------------------------------ <CLASSES>-------------------------------------------------------------------
func (*Emitter) EmitClassAndArcReferences ¶
func (*Emitter) EmitClassCallExpression ¶
func (emt *Emitter) EmitClassCallExpression(blk **ir.Block, expr boundnodes.BoundClassCallExpressionNode) value.Value
func (*Emitter) EmitClassConstructor ¶
func (*Emitter) EmitClassFieldAccessExpression ¶
func (emt *Emitter) EmitClassFieldAccessExpression(blk **ir.Block, expr boundnodes.BoundClassFieldAccessExpressionNode) value.Value
func (*Emitter) EmitClassFieldAccessExpressionRef ¶
func (emt *Emitter) EmitClassFieldAccessExpressionRef(blk **ir.Block, _base boundnodes.BoundExpressionNode, field symbols.VariableSymbol) (value.Value, value.Value)
func (*Emitter) EmitClassFieldAssignmentExpression ¶
func (emt *Emitter) EmitClassFieldAssignmentExpression(blk **ir.Block, expr boundnodes.BoundClassFieldAssignmentExpressionNode) value.Value
func (*Emitter) EmitClassFunction ¶
func (emt *Emitter) EmitClassFunction(cls symbols.ClassSymbol, sym symbols.FunctionSymbol, body boundnodes.BoundBlockStatementNode) *ir.Func
func (*Emitter) EmitConditionalGotoStatement ¶
func (emt *Emitter) EmitConditionalGotoStatement(blk **ir.Block, stmt boundnodes.BoundConditionalGotoStatementNode)
func (*Emitter) EmitConversionExpression ¶
func (emt *Emitter) EmitConversionExpression(blk **ir.Block, expr boundnodes.BoundConversionExpressionNode) value.Value
func (*Emitter) EmitDereferenceExpression ¶
func (emt *Emitter) EmitDereferenceExpression(blk **ir.Block, expr boundnodes.BoundDereferenceExpressionNode) value.Value
func (*Emitter) EmitEnumExpression ¶
func (emt *Emitter) EmitEnumExpression(blk **ir.Block, expr boundnodes.BoundEnumExpressionNode) value.Value
func (*Emitter) EmitExpression ¶
func (emt *Emitter) EmitExpression(blk **ir.Block, expr boundnodes.BoundExpressionNode) value.Value
func (*Emitter) EmitExternalFunction ¶
func (emt *Emitter) EmitExternalFunction(sym symbols.FunctionSymbol) *ir.Func
func (*Emitter) EmitFunction ¶
func (emt *Emitter) EmitFunction(sym symbols.FunctionSymbol, body boundnodes.BoundBlockStatementNode) *ir.Func
func (*Emitter) EmitFunctionExpression ¶
func (emt *Emitter) EmitFunctionExpression(blk **ir.Block, expr boundnodes.BoundFunctionExpressionNode) value.Value
func (*Emitter) EmitGotoStatement ¶
func (emt *Emitter) EmitGotoStatement(blk **ir.Block, stmt boundnodes.BoundGotoStatementNode)
func (*Emitter) EmitLambdaExpression ¶
func (emt *Emitter) EmitLambdaExpression(blk **ir.Block, expr boundnodes.BoundLambdaExpressionNode) value.Value
func (*Emitter) EmitLiteralExpression ¶
func (emt *Emitter) EmitLiteralExpression(blk **ir.Block, expr boundnodes.BoundLiteralExpressionNode) value.Value
func (*Emitter) EmitMakeArrayExpression ¶
func (emt *Emitter) EmitMakeArrayExpression(blk **ir.Block, expr boundnodes.BoundMakeArrayExpressionNode) value.Value
func (*Emitter) EmitMakeExpression ¶
func (emt *Emitter) EmitMakeExpression(blk **ir.Block, expr boundnodes.BoundMakeExpressionNode) value.Value
func (*Emitter) EmitMakeStructExpression ¶
func (emt *Emitter) EmitMakeStructExpression(blk **ir.Block, expr boundnodes.BoundMakeStructExpressionNode) value.Value
func (*Emitter) EmitPackageCallExpression ¶
func (emt *Emitter) EmitPackageCallExpression(blk **ir.Block, expr boundnodes.BoundPackageCallExpressionNode) value.Value
func (*Emitter) EmitPointerAccessExpression ¶
func (*Emitter) EmitPointerAccessRef ¶
func (emt *Emitter) EmitPointerAccessRef(blk **ir.Block, expr boundnodes.BoundArrayAccessExpressionNode) value.Value
func (*Emitter) EmitPointerAssignmentExpression ¶
func (*Emitter) EmitReferenceExpression ¶
func (emt *Emitter) EmitReferenceExpression(blk **ir.Block, expr boundnodes.BoundReferenceExpressionNode) value.Value
func (*Emitter) EmitReturnStatement ¶
func (emt *Emitter) EmitReturnStatement(blk **ir.Block, stmt boundnodes.BoundReturnStatementNode)
func (*Emitter) EmitStruct ¶
func (emt *Emitter) EmitStruct(stc symbols.StructSymbol)
<STRUCTS>-------------------------------------------------------------------
func (*Emitter) EmitStructFieldAccessExpression ¶
func (emt *Emitter) EmitStructFieldAccessExpression(blk **ir.Block, expr boundnodes.BoundClassFieldAccessExpressionNode) value.Value
func (*Emitter) EmitStructFieldAccessExpressionRef ¶
func (emt *Emitter) EmitStructFieldAccessExpressionRef(blk **ir.Block, base boundnodes.BoundExpressionNode, field symbols.VariableSymbol) value.Value
func (*Emitter) EmitStructFieldAssignmentExpression ¶
func (emt *Emitter) EmitStructFieldAssignmentExpression(blk **ir.Block, expr boundnodes.BoundClassFieldAssignmentExpressionNode) value.Value
func (*Emitter) EmitTernaryExpression ¶
func (emt *Emitter) EmitTernaryExpression(blk **ir.Block, expr boundnodes.BoundTernaryExpressionNode) value.Value
func (*Emitter) EmitThisExpression ¶
func (emt *Emitter) EmitThisExpression(blk **ir.Block, expr boundnodes.BoundThisExpressionNode) value.Value
func (*Emitter) EmitTypeCallExpression ¶
func (emt *Emitter) EmitTypeCallExpression(blk **ir.Block, expr boundnodes.BoundTypeCallExpressionNode) value.Value
func (*Emitter) EmitUnaryExpression ¶
func (emt *Emitter) EmitUnaryExpression(blk **ir.Block, expr boundnodes.BoundUnaryExpressionNode) value.Value
func (*Emitter) EmitUnloadedReference ¶
func (emt *Emitter) EmitUnloadedReference(blk **ir.Block, expr boundnodes.BoundExpressionNode) (value.Value, value.Value)
func (*Emitter) EmitValidConversionCheck ¶
func (*Emitter) EmitVariable ¶
func (*Emitter) EmitVariableDeclaration ¶
func (*Emitter) EmitVariableDeclarationStatement ¶
func (emt *Emitter) EmitVariableDeclarationStatement(blk **ir.Block, stmt boundnodes.BoundVariableDeclarationStatementNode)
func (*Emitter) EmitVariableExpression ¶
func (emt *Emitter) EmitVariableExpression(blk **ir.Block, expr boundnodes.BoundVariableExpressionNode) value.Value
func (*Emitter) EmitVariablePtr ¶
func (*Emitter) GetConstantStringConstant ¶
func (*Emitter) GetStringConstant ¶
func (*Emitter) GetThreadWrapper ¶
func (emt *Emitter) GetThreadWrapper(source symbols.TypeSymbol) *ir.Func
func (*Emitter) GetVtableConstant ¶
func (*Emitter) ImportPackage ¶
func (emt *Emitter) ImportPackage(pack symbols.PackageSymbol)
func (*Emitter) ImportType ¶
func (*Emitter) LoadAndReferenceClasses ¶
func (*Emitter) LoadAndReferenceClassesFromPackage ¶
func (emt *Emitter) LoadAndReferenceClassesFromPackage(module *ir.Module, pack symbols.PackageSymbol)
func (*Emitter) PopulateClass ¶
func (emt *Emitter) PopulateClass(cls *Class, bcls binder.BoundClass)
func (*Emitter) PopulateStruct ¶
func (emt *Emitter) PopulateStruct(stc *Struct, bstc symbols.StructSymbol)
func (*Emitter) ResolveArray ¶
func (emt *Emitter) ResolveArray(typ symbols.TypeSymbol, cache *map[string]types.Type, generic symbols.TypeSymbol) types.Type
func (*Emitter) ResolveFunctionPointer ¶
func (emt *Emitter) ResolveFunctionPointer(subTypes []symbols.TypeSymbol) types.Type
func (*Emitter) TypeExists ¶
Click to show internal directories.
Click to hide internal directories.