parser

package
v0.0.0-...-2384b12 Latest Latest
Warning

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

Go to latest
Published: May 24, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArgList

type ArgList []string

type BinaryExprAST

type BinaryExprAST struct {
	LHS ExprAST
	RHS ExprAST
	Op  rune
}

func (*BinaryExprAST) Accept

func (b *BinaryExprAST) Accept(visitor Visitor) interface{}

type CallExprAST

type CallExprAST struct {
	FunctionName string
	Args         []ExprAST
}

func (*CallExprAST) Accept

func (c *CallExprAST) Accept(visitor Visitor) interface{}

type ExprAST

type ExprAST interface {
	Visitable
}

type ExprList

type ExprList []ExprAST

type FunctionAST

type FunctionAST struct {
	Prototype PrototypeAST
	Body      ExprAST
}

func (*FunctionAST) Accept

func (f *FunctionAST) Accept(visitor Visitor) interface{}

type NumberExprAST

type NumberExprAST string

func (NumberExprAST) Accept

func (n NumberExprAST) Accept(visitor Visitor) interface{}

type ProgramAST

type ProgramAST struct {
	Funcs  []FunctionAST
	Protos []PrototypeAST
}

func (*ProgramAST) Accept

func (p *ProgramAST) Accept(visitor Visitor) interface{}

type PrototypeAST

type PrototypeAST struct {
	FunctionName string
	Args         []string
}

func (*PrototypeAST) Accept

func (p *PrototypeAST) Accept(visitor Visitor) interface{}

type VariableExprAST

type VariableExprAST string

func (VariableExprAST) Accept

func (v VariableExprAST) Accept(visitor Visitor) interface{}

type Visitable

type Visitable interface {
	Accept(Visitor) interface{}
}

type Visitor

type Visitor interface {
	VisitNumberExprAST(*NumberExprAST) interface{}
	VisitBinaryExprAST(*BinaryExprAST) interface{}
	VisitVariableExprAST(*VariableExprAST) interface{}
	VisitCallExprAST(*CallExprAST) interface{}
	VisitPrototypeAST(*PrototypeAST) interface{}
	VisitFunctionAST(*FunctionAST) interface{}
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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