Documentation ¶
Index ¶
- Variables
- type AssignmentStep
- type CallStep
- type ConditionStep
- type DeclarationStep
- type ExecutionContext
- type LLVMBackendImplementation
- func (impl *LLVMBackendImplementation) AdditionToLLIRValue(a *tokens.Addition, scope *ast.Ast, expressionType *tokens.TypeRef) value.Value
- func (impl *LLVMBackendImplementation) ComparisonToLLIRValue(c *tokens.Comparison, scope *ast.Ast, expressionType *tokens.TypeRef) value.Value
- func (*LLVMBackendImplementation) Declaration(scope *ast.Ast, decl *tokens.Declaration)
- func (impl *LLVMBackendImplementation) EqualityToLLIRValue(eq *tokens.Equality, scope *ast.Ast, expressionType *tokens.TypeRef) value.Value
- func (impl *LLVMBackendImplementation) ExpressionToLLIRValue(e *tokens.Expression, scope *ast.Ast, expressionType *tokens.TypeRef) value.Value
- func (impls *LLVMBackendImplementation) FuncCall(scope *ast.Ast, f *tokens.FuncCall)
- func (impl *LLVMBackendImplementation) LLVMAssignArgumentsToMethodArguments(args []*tokens.Value, mth *ast.Method)
- func (impl *LLVMBackendImplementation) LLVMGetAstMethod(scope *ast.Ast, m *tokens.Method) *ast.Method
- func (impl *LLVMBackendImplementation) LLVMImplementationForArch(scope *ast.Ast, i *tokens.Implementation)
- func (impl *LLVMBackendImplementation) LLVMImplementationForClass(scope *ast.Ast, i *tokens.Implementation)
- func (impl *LLVMBackendImplementation) LLVMImplementationToMethodTokens(scope *ast.Ast, i *tokens.Implementation) []*tokens.Method
- func (impl *LLVMBackendImplementation) LLVMResolveFuncContext(a *ast.Ast, funcName string) *option.Optional[*LocalContext]
- func (impl *LLVMBackendImplementation) LLVMResolveLLIRType(a *ast.Ast, typ string) *option.Optional[*types.Type]
- func (impl *LLVMBackendImplementation) LLVMTraitGetMethods(t *tokens.Trait) []*tokens.Method
- func (impl *LLVMBackendImplementation) MultiplicationToLLIRValue(m *tokens.Multiplication, scope *ast.Ast, expressionType *tokens.TypeRef) value.Value
- func (impls *LLVMBackendImplementation) NewClass(scope *ast.Ast, c *tokens.Class)
- func (impls *LLVMBackendImplementation) NewDeclaration(scope *ast.Ast, decl *tokens.Declaration)
- func (impl *LLVMBackendImplementation) NewImplementation(scope *ast.Ast, i *tokens.Implementation)
- func (impl *LLVMBackendImplementation) NewMethod(scope *ast.Ast, m *tokens.Method)
- func (impl *LLVMBackendImplementation) NewReturn(scope *ast.Ast)
- func (impl *LLVMBackendImplementation) NewReturnLiteral(scope *ast.Ast, literal *tokens.Expression)
- func (impl *LLVMBackendImplementation) NewTrait(scope *ast.Ast, t *tokens.Trait)
- func (impl *LLVMBackendImplementation) NewVariable(scope *ast.Ast, f *tokens.Field)
- func (*LLVMBackendImplementation) ParseExpression(scope *ast.Ast, exp *tokens.Expression)
- func (impl *LLVMBackendImplementation) PrimaryToLLIRValue(p *tokens.Primary, scope *ast.Ast, expressionType *tokens.TypeRef) value.Value
- func (impls *LLVMBackendImplementation) ProcessEntries(scope *ast.Ast, entries []*tokens.Entry)
- func (impl *LLVMBackendImplementation) TraitAssignToScope(scope *ast.Ast, t *tokens.Trait)
- func (impl *LLVMBackendImplementation) TypeRefGetLLIRType(t *tokens.TypeRef, scope *ast.Ast) types.Type
- func (impl *LLVMBackendImplementation) UnaryToLLIRValue(u *tokens.Unary, scope *ast.Ast, expressionType *tokens.TypeRef) value.Value
- type LLVMScopeData
- type LLVMScopeInformation
- type LLVMValueInformation
- type LLVMValuesMap
- type LocalContext
- type ModuleContext
- type PrimitiveType
- type Step
- type ValueAsContant
Constants ¶
This section is empty.
Variables ¶
View Source
var BoolType = &PrimitiveType{ Class: &ast.Ast{ Scope: "bool", }, Type: types.I1, }
View Source
var CallingConventions map[string]map[string]enum.CallingConv = map[string]map[string]enum.CallingConv{ "arm64": { "darwin": enum.CallingConvC, "linux": enum.CallingConvC, "windows": enum.CallingConvC, }, "amd64": { "darwin": enum.CallingConvC, "linux": enum.CallingConvC, "windows": enum.CallingConvWin64, }, }
View Source
var CurrentBackend interfaces.BackendInteface = nil
View Source
var FuncCalls map[string]*ir.InstCall
View Source
var Int16Type = &PrimitiveType{ Class: &ast.Ast{ Scope: "int16", }, Type: types.I16, }
View Source
var Int32Type = &PrimitiveType{ Class: &ast.Ast{ Scope: "int32", }, Type: types.I32, }
View Source
var Int64Type = &PrimitiveType{ Class: &ast.Ast{ Scope: "int64", }, Type: types.I64, }
View Source
var Int8Type = &PrimitiveType{ Class: &ast.Ast{ Scope: "int8", }, Type: types.I8, }
View Source
var IntType = &PrimitiveType{ Class: &ast.Ast{ Scope: "int", }, Type: types.I64, }
View Source
var LLVMProgramValues = &LLVMValuesMap{}
View Source
var LLVMScopeDataMap = &LLVMScopeData{}
View Source
var Methods map[string]*ast.Method
View Source
var Primitives = []*PrimitiveType{ VoidType, IntType, RawStringType, BoolType, }
View Source
var RawStringType = &PrimitiveType{ Class: &ast.Ast{ Scope: "string", }, Type: types.NewPointer(types.I8), }
View Source
var Uint16Type = &PrimitiveType{ Class: &ast.Ast{ Scope: "uint16", }, Type: types.I16, }
View Source
var Uint32Type = &PrimitiveType{ Class: &ast.Ast{ Scope: "uint32", }, Type: types.I32, }
View Source
var Uint64Type = &PrimitiveType{ Class: &ast.Ast{ Scope: "uint64", }, Type: types.I64, }
View Source
var Uint8Type = &PrimitiveType{ Class: &ast.Ast{ Scope: "uint8", }, Type: types.I8, }
View Source
var UintType = &PrimitiveType{ Class: &ast.Ast{ Scope: "uint", }, Type: types.I64, }
View Source
var UnknownType = &PrimitiveType{ Class: &ast.Ast{ Scope: "unknown", }, Type: types.Void, }
View Source
var VoidType = &PrimitiveType{ Class: &ast.Ast{ Scope: "void", }, Type: types.Void, }
Functions ¶
This section is empty.
Types ¶
type ConditionStep ¶
type DeclarationStep ¶
type ExecutionContext ¶
type ExecutionContext struct { Context *ModuleContext Steps []*Step }
var LLVMExecutionContext *ExecutionContext = nil
func NewExecutionContext ¶
func NewExecutionContext() *ExecutionContext
func (*ExecutionContext) FindLLIRMethod ¶
func (e *ExecutionContext) FindLLIRMethod(name string) *option.Optional[*ir.Func]
func (*ExecutionContext) Init ¶
func (e *ExecutionContext) Init()
type LLVMBackendImplementation ¶
type LLVMBackendImplementation struct {
Backend interfaces.BackendInteface
}
func (*LLVMBackendImplementation) AdditionToLLIRValue ¶
func (*LLVMBackendImplementation) ComparisonToLLIRValue ¶
func (impl *LLVMBackendImplementation) ComparisonToLLIRValue(c *tokens.Comparison, scope *ast.Ast, expressionType *tokens.TypeRef) value.Value
func (*LLVMBackendImplementation) Declaration ¶
func (*LLVMBackendImplementation) Declaration(scope *ast.Ast, decl *tokens.Declaration)
func (*LLVMBackendImplementation) EqualityToLLIRValue ¶
func (*LLVMBackendImplementation) ExpressionToLLIRValue ¶
func (impl *LLVMBackendImplementation) ExpressionToLLIRValue(e *tokens.Expression, scope *ast.Ast, expressionType *tokens.TypeRef) value.Value
func (*LLVMBackendImplementation) FuncCall ¶
func (impls *LLVMBackendImplementation) FuncCall(scope *ast.Ast, f *tokens.FuncCall)
func (*LLVMBackendImplementation) LLVMAssignArgumentsToMethodArguments ¶
func (impl *LLVMBackendImplementation) LLVMAssignArgumentsToMethodArguments(args []*tokens.Value, mth *ast.Method)
func (*LLVMBackendImplementation) LLVMGetAstMethod ¶
func (*LLVMBackendImplementation) LLVMImplementationForArch ¶
func (impl *LLVMBackendImplementation) LLVMImplementationForArch(scope *ast.Ast, i *tokens.Implementation)
func (*LLVMBackendImplementation) LLVMImplementationForClass ¶
func (impl *LLVMBackendImplementation) LLVMImplementationForClass(scope *ast.Ast, i *tokens.Implementation)
func (*LLVMBackendImplementation) LLVMImplementationToMethodTokens ¶
func (impl *LLVMBackendImplementation) LLVMImplementationToMethodTokens(scope *ast.Ast, i *tokens.Implementation) []*tokens.Method
func (*LLVMBackendImplementation) LLVMResolveFuncContext ¶
func (impl *LLVMBackendImplementation) LLVMResolveFuncContext(a *ast.Ast, funcName string) *option.Optional[*LocalContext]
func (*LLVMBackendImplementation) LLVMResolveLLIRType ¶
func (*LLVMBackendImplementation) LLVMTraitGetMethods ¶
func (impl *LLVMBackendImplementation) LLVMTraitGetMethods(t *tokens.Trait) []*tokens.Method
func (*LLVMBackendImplementation) MultiplicationToLLIRValue ¶
func (impl *LLVMBackendImplementation) MultiplicationToLLIRValue(m *tokens.Multiplication, scope *ast.Ast, expressionType *tokens.TypeRef) value.Value
func (*LLVMBackendImplementation) NewClass ¶
func (impls *LLVMBackendImplementation) NewClass(scope *ast.Ast, c *tokens.Class)
func (*LLVMBackendImplementation) NewDeclaration ¶
func (impls *LLVMBackendImplementation) NewDeclaration(scope *ast.Ast, decl *tokens.Declaration)
func (*LLVMBackendImplementation) NewImplementation ¶
func (impl *LLVMBackendImplementation) NewImplementation(scope *ast.Ast, i *tokens.Implementation)
func (*LLVMBackendImplementation) NewMethod ¶
func (impl *LLVMBackendImplementation) NewMethod(scope *ast.Ast, m *tokens.Method)
func (*LLVMBackendImplementation) NewReturn ¶
func (impl *LLVMBackendImplementation) NewReturn(scope *ast.Ast)
func (*LLVMBackendImplementation) NewReturnLiteral ¶
func (impl *LLVMBackendImplementation) NewReturnLiteral(scope *ast.Ast, literal *tokens.Expression)
func (*LLVMBackendImplementation) NewTrait ¶
func (impl *LLVMBackendImplementation) NewTrait(scope *ast.Ast, t *tokens.Trait)
func (*LLVMBackendImplementation) NewVariable ¶
func (impl *LLVMBackendImplementation) NewVariable(scope *ast.Ast, f *tokens.Field)
func (*LLVMBackendImplementation) ParseExpression ¶
func (*LLVMBackendImplementation) ParseExpression(scope *ast.Ast, exp *tokens.Expression)
func (*LLVMBackendImplementation) PrimaryToLLIRValue ¶
func (*LLVMBackendImplementation) ProcessEntries ¶
func (impls *LLVMBackendImplementation) ProcessEntries(scope *ast.Ast, entries []*tokens.Entry)
func (*LLVMBackendImplementation) TraitAssignToScope ¶
func (impl *LLVMBackendImplementation) TraitAssignToScope(scope *ast.Ast, t *tokens.Trait)
func (*LLVMBackendImplementation) TypeRefGetLLIRType ¶
type LLVMScopeData ¶
type LLVMScopeData map[string]*LLVMScopeInformation
type LLVMScopeInformation ¶
type LLVMScopeInformation struct { ExecutionContext *ExecutionContext ProgramContext *ModuleContext LocalContext *LocalContext ChildContexts map[string]*LocalContext }
func LLVMGetScopeInformation ¶
func LLVMGetScopeInformation(scope *ast.Ast) *LLVMScopeInformation
func (*LLVMScopeInformation) Init ¶
func (info *LLVMScopeInformation) Init(a *ast.Ast)
type LLVMValueInformation ¶
func LLVMGetValueInformation ¶
func LLVMGetValueInformation(variable *ast.Variable) *LLVMValueInformation
type LLVMValuesMap ¶
type LLVMValuesMap map[string]*LLVMValueInformation
type LocalContext ¶
type LocalContext struct { ModuleContext *ModuleContext Func *ir.Func MainBlock *ir.Block Branches map[string]*ir.Block Types map[string]*types.Type }
func NewLocalContext ¶
func NewLocalContext(fn *ir.Func) *LocalContext
func (*LocalContext) Init ¶
func (l *LocalContext) Init(fn *ir.Func)
type ModuleContext ¶
type ModuleContext struct { Module *ir.Module GlobalDefinitions map[string]*ir.Global Methods map[string]*ir.Func }
func (*ModuleContext) Init ¶
func (m *ModuleContext) Init()
type Step ¶
type Step struct { Call *CallStep Condition *ConditionStep Assignment *AssignmentStep Declaration *DeclarationStep }
type ValueAsContant ¶
func (ValueAsContant) IsConstant ¶
func (v ValueAsContant) IsConstant()
Click to show internal directories.
Click to hide internal directories.