ast

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AST

type AST interface {
	RunPass(ctx *Context, pass Pass)
}

type ASTs

type ASTs []AST

func (ASTs) RunPass

func (asts ASTs) RunPass(ctx *Context, pass Pass)

type ConstDecl

type ConstDecl struct {
	Doc     *Doc
	ID      token.Token
	TypeRef *TypeRef
	Value   *ConstValue
}

func (*ConstDecl) RunPass

func (d *ConstDecl) RunPass(ctx *Context, pass Pass)

type ConstValue

type ConstValue struct {
	Expr string
}

func (*ConstValue) RunPass

func (v *ConstValue) RunPass(ctx *Context, pass Pass)

type Context

type Context struct {
	*errlogger.ErrLoggerWrapper

	Analysis *analysis.Analysis
}

func NewContext

func NewContext(l *errlogger.ErrLoggerWrapper) *Context

func (*Context) RunPassChild

func (c *Context) RunPassChild(parent AST, child AST, pass Pass)

type Doc

type Doc struct {
}

func (*Doc) RunPass

func (d *Doc) RunPass(ctx *Context, pass Pass)

type FuncDecl

type FuncDecl struct {
	Doc    *Doc
	ID     token.Token
	Params ASTs
	Rets   ASTs
}

func (*FuncDecl) RunPass

func (d *FuncDecl) RunPass(ctx *Context, pass Pass)

type FuncParam

type FuncParam struct {
	ID           token.Token
	Type         *TypeRef
	DefaultValue *ConstValue
	VarArg       bool
}

func (*FuncParam) RunPass

func (p *FuncParam) RunPass(ctx *Context, pass Pass)

type GoType

type GoType struct {
	Ref     bool
	Package token.Token
	ID      token.Token
}

func (*GoType) RunPass

func (t *GoType) RunPass(ctx *Context, pass Pass)

type ImportDecl

type ImportDecl struct {
	Alias  string
	Import string
}

func (*ImportDecl) RunPass

func (d *ImportDecl) RunPass(ctx *Context, pass Pass)

type Pass

type Pass int
const (
	Check Pass = iota
	Emit
)

type StructDecl

type StructDecl struct {
	Name   string
	Fields ASTs
}

func (*StructDecl) RunPass

func (d *StructDecl) RunPass(ctx *Context, pass Pass)

type StructField

type StructField struct {
	Name string
	Type *TypeRef
}

func (*StructField) RunPass

func (f *StructField) RunPass(ctx *Context, pass Pass)

type TypeDecl

type TypeDecl struct {
	Doc    *Doc
	ID     token.Token
	GoType *GoType
}

func (*TypeDecl) RunPass

func (d *TypeDecl) RunPass(ctx *Context, pass Pass)

type TypeRef

type TypeRef struct {
	Iter    bool
	Nilable bool
	ID      token.Token

	Type analysis.Type
}

func (*TypeRef) RunPass

func (r *TypeRef) RunPass(ctx *Context, pass Pass)

type Unit

type Unit struct {
	Package token.Token
	Decls   ASTs
}

func (*Unit) RunPass

func (u *Unit) RunPass(ctx *Context, pass Pass)

Jump to

Keyboard shortcuts

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