compiler

package
v0.12.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 5, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateWasm

func GenerateWasm(funcs []*ir.Func) *wasm.Module

Types

type Compiler

type Compiler struct {
	Checker *sema.Checker
	// contains filtered or unexported fields
}

func NewCompiler

func NewCompiler(checker *sema.Checker) *Compiler

func (*Compiler) VisitArrayExpression

func (compiler *Compiler) VisitArrayExpression(_ *ast.ArrayExpression) ast.Repr

func (*Compiler) VisitAssignmentStatement

func (compiler *Compiler) VisitAssignmentStatement(_ *ast.AssignmentStatement) ast.Repr

func (*Compiler) VisitBinaryExpression

func (compiler *Compiler) VisitBinaryExpression(expression *ast.BinaryExpression) ast.Repr

func (*Compiler) VisitBlock

func (compiler *Compiler) VisitBlock(block *ast.Block) ast.Repr

func (*Compiler) VisitBoolExpression

func (compiler *Compiler) VisitBoolExpression(_ *ast.BoolExpression) ast.Repr

func (*Compiler) VisitBreakStatement

func (compiler *Compiler) VisitBreakStatement(_ *ast.BreakStatement) ast.Repr

func (*Compiler) VisitCastingExpression

func (compiler *Compiler) VisitCastingExpression(_ *ast.CastingExpression) ast.Repr

func (*Compiler) VisitCompositeDeclaration

func (compiler *Compiler) VisitCompositeDeclaration(_ *ast.CompositeDeclaration) ast.Repr

func (*Compiler) VisitCondition

func (compiler *Compiler) VisitCondition(_ *ast.Condition) ast.Repr

func (*Compiler) VisitConditionalExpression

func (compiler *Compiler) VisitConditionalExpression(_ *ast.ConditionalExpression) ast.Repr

func (*Compiler) VisitContinueStatement

func (compiler *Compiler) VisitContinueStatement(_ *ast.ContinueStatement) ast.Repr

func (*Compiler) VisitCreateExpression

func (compiler *Compiler) VisitCreateExpression(_ *ast.CreateExpression) ast.Repr

func (*Compiler) VisitDestroyExpression

func (compiler *Compiler) VisitDestroyExpression(_ *ast.DestroyExpression) ast.Repr

func (*Compiler) VisitDictionaryExpression

func (compiler *Compiler) VisitDictionaryExpression(_ *ast.DictionaryExpression) ast.Repr

func (*Compiler) VisitEmitStatement

func (compiler *Compiler) VisitEmitStatement(_ *ast.EmitStatement) ast.Repr

func (*Compiler) VisitEnumCaseDeclaration

func (compiler *Compiler) VisitEnumCaseDeclaration(_ *ast.EnumCaseDeclaration) ast.Repr

func (*Compiler) VisitExpressionStatement

func (compiler *Compiler) VisitExpressionStatement(_ *ast.ExpressionStatement) ast.Repr

func (*Compiler) VisitFieldDeclaration

func (compiler *Compiler) VisitFieldDeclaration(_ *ast.FieldDeclaration) ast.Repr

func (*Compiler) VisitFixedPointExpression

func (compiler *Compiler) VisitFixedPointExpression(_ *ast.FixedPointExpression) ast.Repr

func (*Compiler) VisitForStatement

func (compiler *Compiler) VisitForStatement(_ *ast.ForStatement) ast.Repr

func (*Compiler) VisitForceExpression

func (compiler *Compiler) VisitForceExpression(_ *ast.ForceExpression) ast.Repr

func (*Compiler) VisitFunctionBlock

func (compiler *Compiler) VisitFunctionBlock(_ *ast.FunctionBlock) ast.Repr

func (*Compiler) VisitFunctionDeclaration

func (compiler *Compiler) VisitFunctionDeclaration(declaration *ast.FunctionDeclaration) ast.Repr

func (*Compiler) VisitFunctionExpression

func (compiler *Compiler) VisitFunctionExpression(_ *ast.FunctionExpression) ast.Repr

func (*Compiler) VisitIdentifierExpression

func (compiler *Compiler) VisitIdentifierExpression(expression *ast.IdentifierExpression) ast.Repr

func (*Compiler) VisitIfStatement

func (compiler *Compiler) VisitIfStatement(_ *ast.IfStatement) ast.Repr

func (*Compiler) VisitImportDeclaration

func (compiler *Compiler) VisitImportDeclaration(_ *ast.ImportDeclaration) ast.Repr

func (*Compiler) VisitIndexExpression

func (compiler *Compiler) VisitIndexExpression(_ *ast.IndexExpression) ast.Repr

func (*Compiler) VisitIntegerExpression

func (compiler *Compiler) VisitIntegerExpression(expression *ast.IntegerExpression) ast.Repr

func (*Compiler) VisitInterfaceDeclaration

func (compiler *Compiler) VisitInterfaceDeclaration(_ *ast.InterfaceDeclaration) ast.Repr

func (*Compiler) VisitInvocationExpression

func (compiler *Compiler) VisitInvocationExpression(_ *ast.InvocationExpression) ast.Repr

func (*Compiler) VisitMemberExpression

func (compiler *Compiler) VisitMemberExpression(_ *ast.MemberExpression) ast.Repr

func (*Compiler) VisitNilExpression

func (compiler *Compiler) VisitNilExpression(_ *ast.NilExpression) ast.Repr

func (*Compiler) VisitPathExpression

func (compiler *Compiler) VisitPathExpression(_ *ast.PathExpression) ast.Repr

func (*Compiler) VisitPragmaDeclaration

func (compiler *Compiler) VisitPragmaDeclaration(_ *ast.PragmaDeclaration) ast.Repr

func (*Compiler) VisitProgram

func (compiler *Compiler) VisitProgram(_ *ast.Program) ast.Repr

func (*Compiler) VisitReferenceExpression

func (compiler *Compiler) VisitReferenceExpression(_ *ast.ReferenceExpression) ast.Repr

func (*Compiler) VisitReturnStatement

func (compiler *Compiler) VisitReturnStatement(statement *ast.ReturnStatement) ast.Repr

func (*Compiler) VisitStringExpression

func (compiler *Compiler) VisitStringExpression(_ *ast.StringExpression) ast.Repr

func (*Compiler) VisitSwapStatement

func (compiler *Compiler) VisitSwapStatement(_ *ast.SwapStatement) ast.Repr

func (*Compiler) VisitSwitchStatement

func (compiler *Compiler) VisitSwitchStatement(_ *ast.SwitchStatement) ast.Repr

func (*Compiler) VisitTransactionDeclaration

func (compiler *Compiler) VisitTransactionDeclaration(_ *ast.TransactionDeclaration) ast.Repr

func (*Compiler) VisitUnaryExpression

func (compiler *Compiler) VisitUnaryExpression(_ *ast.UnaryExpression) ast.Repr

func (*Compiler) VisitVariableDeclaration

func (compiler *Compiler) VisitVariableDeclaration(declaration *ast.VariableDeclaration) ast.Repr

func (*Compiler) VisitWhileStatement

func (compiler *Compiler) VisitWhileStatement(_ *ast.WhileStatement) ast.Repr

type Local

type Local struct {
	Index uint32
	Type  ir.ValType
}

func NewLocal

func NewLocal(index uint32, valType ir.ValType) *Local

type WasmCodeGen

type WasmCodeGen struct {
	// contains filtered or unexported fields
}

func (*WasmCodeGen) VisitBinOpExpr

func (codeGen *WasmCodeGen) VisitBinOpExpr(expr *ir.BinOpExpr) ir.Repr

func (*WasmCodeGen) VisitBlock

func (codeGen *WasmCodeGen) VisitBlock(_ *ir.Block) ir.Repr

func (*WasmCodeGen) VisitBranch

func (codeGen *WasmCodeGen) VisitBranch(_ *ir.Branch) ir.Repr

func (*WasmCodeGen) VisitBranchIf

func (codeGen *WasmCodeGen) VisitBranchIf(_ *ir.BranchIf) ir.Repr

func (*WasmCodeGen) VisitCall

func (codeGen *WasmCodeGen) VisitCall(_ *ir.Call) ir.Repr

func (*WasmCodeGen) VisitConst

func (codeGen *WasmCodeGen) VisitConst(c *ir.Const) ir.Repr

func (*WasmCodeGen) VisitCopyLocal

func (codeGen *WasmCodeGen) VisitCopyLocal(c *ir.CopyLocal) ir.Repr

func (*WasmCodeGen) VisitDrop

func (codeGen *WasmCodeGen) VisitDrop(_ *ir.Drop) ir.Repr

func (*WasmCodeGen) VisitFunc

func (codeGen *WasmCodeGen) VisitFunc(f *ir.Func) ir.Repr

func (*WasmCodeGen) VisitIf

func (codeGen *WasmCodeGen) VisitIf(_ *ir.If) ir.Repr

func (*WasmCodeGen) VisitInt

func (codeGen *WasmCodeGen) VisitInt(i ir.Int) ir.Repr

func (*WasmCodeGen) VisitLoop

func (codeGen *WasmCodeGen) VisitLoop(_ *ir.Loop) ir.Repr

func (*WasmCodeGen) VisitMoveLocal

func (codeGen *WasmCodeGen) VisitMoveLocal(_ *ir.MoveLocal) ir.Repr

func (*WasmCodeGen) VisitReturn

func (codeGen *WasmCodeGen) VisitReturn(r *ir.Return) ir.Repr

func (*WasmCodeGen) VisitSequence

func (codeGen *WasmCodeGen) VisitSequence(sequence *ir.Sequence) ir.Repr

func (*WasmCodeGen) VisitStoreLocal

func (codeGen *WasmCodeGen) VisitStoreLocal(storeLocal *ir.StoreLocal) ir.Repr

func (*WasmCodeGen) VisitUnOpExpr

func (codeGen *WasmCodeGen) VisitUnOpExpr(_ *ir.UnOpExpr) ir.Repr

Directories

Path Synopsis
WebAssembly (https://webassembly.org/) is an open standard for portable executable programs.
WebAssembly (https://webassembly.org/) is an open standard for portable executable programs.
gen

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL