ast

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2022 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArrLit

type ArrLit struct {
	Token token.Token
	Elms  []Expr
}

Arrays

func (*ArrLit) String

func (ar *ArrLit) String() string

func (*ArrLit) TokenLit

func (ar *ArrLit) TokenLit() string

type BlockStmt

type BlockStmt struct {
	Token token.Token
	Stmts []Stmt
}

func (*BlockStmt) String

func (bs *BlockStmt) String() string

func (*BlockStmt) TokenLit

func (bs *BlockStmt) TokenLit() string

type Boolean

type Boolean struct {
	Token token.Token
	Value bool
}

Boolean Expression

func (*Boolean) String

func (b *Boolean) String() string

func (*Boolean) TokenLit

func (b *Boolean) TokenLit() string

type CallExpr

type CallExpr struct {
	Token token.Token // The '(' token
	Func  Expr
	// Identifier or FunctionLiteral
	Args []Expr
}

func (*CallExpr) String

func (ce *CallExpr) String() string

func (*CallExpr) TokenLit

func (ce *CallExpr) TokenLit() string

type Comment

type Comment struct {
	Token token.Token
	Value string
}

func (*Comment) String

func (s *Comment) String() string

func (*Comment) TokenLit

func (s *Comment) TokenLit() string

type Expr

type Expr interface {
	Node
	// contains filtered or unexported methods
}

type ExprStmt

type ExprStmt struct {
	Token token.Token
	Expr  Expr
}

Expression Statement

func (*ExprStmt) String

func (e *ExprStmt) String() string

func (*ExprStmt) TokenLit

func (e *ExprStmt) TokenLit() string

type FunctionLit

type FunctionLit struct {
	Token  token.Token // The 'fn' token
	Params []*Identifier
	Body   *BlockStmt
}

func (*FunctionLit) String

func (fl *FunctionLit) String() string

func (*FunctionLit) TokenLit

func (fl *FunctionLit) TokenLit() string

type HashLit

type HashLit struct {
	Token token.Token
	Pairs map[Expr]Expr
}

func (*HashLit) String

func (hl *HashLit) String() string

func (*HashLit) TokenLit

func (hl *HashLit) TokenLit() string

type Identifier

type Identifier struct {
	Token token.Token
	Value string
}

func (*Identifier) String

func (id *Identifier) String() string

func (*Identifier) TokenLit

func (id *Identifier) TokenLit() string

type IfExpr

type IfExpr struct {
	Token     token.Token
	Cond      Expr
	TrueBlock *BlockStmt
	ElseBlock *BlockStmt
}

func (*IfExpr) String

func (i *IfExpr) String() string

func (*IfExpr) TokenLit

func (i *IfExpr) TokenLit() string

type IncludeStmt

type IncludeStmt struct {
	Token    token.Token
	Filename Expr
}

func (*IncludeStmt) String

func (is *IncludeStmt) String() string

func (*IncludeStmt) TokenLit

func (is *IncludeStmt) TokenLit() string

type IndexExpr

type IndexExpr struct {
	Token token.Token
	Left  Expr
	Index Expr
}

func (*IndexExpr) String

func (ie *IndexExpr) String() string

func (*IndexExpr) TokenLit

func (ie *IndexExpr) TokenLit() string

type InfixExpr

type InfixExpr struct {
	Token token.Token
	Left  Expr
	Op    string
	Right Expr
}

func (*InfixExpr) String

func (inf *InfixExpr) String() string

func (*InfixExpr) TokenLit

func (inf *InfixExpr) TokenLit() string

type LetStmt

type LetStmt struct {
	Token token.Token
	Name  Identifier
	Value Expr
}

func (*LetStmt) String

func (lst *LetStmt) String() string

func (*LetStmt) TokenLit

func (lst *LetStmt) TokenLit() string

type Node

type Node interface {
	TokenLit() string
	String() string
}

type NumberLit

type NumberLit struct {
	Token token.Token
	Value number.Number
	IsInt bool
}

func (*NumberLit) String

func (nl *NumberLit) String() string

func (*NumberLit) TokenLit

func (nl *NumberLit) TokenLit() string

type PrefixExpr

type PrefixExpr struct {
	Token token.Token
	Op    string
	Right Expr
}

func (*PrefixExpr) String

func (pref *PrefixExpr) String() string

func (*PrefixExpr) TokenLit

func (pref *PrefixExpr) TokenLit() string

type Program

type Program struct {
	Source string
	Stmts  []Stmt
}

func (*Program) String

func (p *Program) String() string

func (*Program) TokenLit

func (p *Program) TokenLit() string

type ReturnStmt

type ReturnStmt struct {
	Token     token.Token
	ReturnVal Expr
}

func (*ReturnStmt) String

func (r *ReturnStmt) String() string

func (*ReturnStmt) TokenLit

func (r *ReturnStmt) TokenLit() string

type ShowStmt

type ShowStmt struct {
	Token token.Token
	Value []Expr
}

func (*ShowStmt) String

func (s *ShowStmt) String() string

func (*ShowStmt) TokenLit

func (s *ShowStmt) TokenLit() string

type Stmt

type Stmt interface {
	Node
	// contains filtered or unexported methods
}

type StringLit

type StringLit struct {
	Token token.Token
	Value string
}

func (*StringLit) String

func (s *StringLit) String() string

func (*StringLit) TokenLit

func (s *StringLit) TokenLit() string

type WhileExpr

type WhileExpr struct {
	Token     token.Token
	Cond      Expr
	StmtBlock *BlockStmt
}

func (*WhileExpr) String

func (w *WhileExpr) String() string

func (*WhileExpr) TokenLit

func (w *WhileExpr) TokenLit() string

Jump to

Keyboard shortcuts

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