Documentation
¶
Index ¶
- Constants
- func EvalMain(bf *OptFunction, en envir.Environment) (interface{}, error)
- func FunctionLookup(sym *envir.Symbols, params *ParameterList, body *BlockStmt) int
- type ASTLeaf
- func (leaf *ASTLeaf) Child(i int) (ASTree, error)
- func (leaf *ASTLeaf) Children() *base.List[ASTree]
- func (leaf *ASTLeaf) Eval(env envir.Environment) (interface{}, error)
- func (leaf *ASTLeaf) GetString() (string, error)
- func (leaf *ASTLeaf) GetToken() token.Token
- func (leaf *ASTLeaf) Location() string
- func (leaf *ASTLeaf) Lookup(sym *envir.Symbols)
- func (leaf *ASTLeaf) NumChildren() int
- type ASTList
- func (l *ASTList) Child(i int) (ASTree, error)
- func (l *ASTList) Children() *base.List[ASTree]
- func (l *ASTList) Eval(env envir.Environment) (interface{}, error)
- func (l *ASTList) GetString() (string, error)
- func (l *ASTList) Location() string
- func (l *ASTList) Lookup(sym *envir.Symbols)
- func (l *ASTList) NumChildren() int
- type ASTree
- type Arguments
- func (a *Arguments) Child(i int) (ASTree, error)
- func (a *Arguments) Children() *base.List[ASTree]
- func (a *Arguments) Eval(env envir.Environment) (interface{}, error)
- func (a *Arguments) Eval0(en envir.Environment, value interface{}) (interface{}, error)
- func (a *Arguments) GetString() (string, error)
- func (a *Arguments) Location() string
- func (a *Arguments) Lookup(sym *envir.Symbols)
- func (a *Arguments) NumChildren() int
- func (a *Arguments) Size() int
- type ArrayLiteral
- func (a *ArrayLiteral) Child(i int) (ASTree, error)
- func (a *ArrayLiteral) Children() *base.List[ASTree]
- func (a *ArrayLiteral) Eval(env envir.Environment) (interface{}, error)
- func (a *ArrayLiteral) GetString() (string, error)
- func (a *ArrayLiteral) Location() string
- func (a *ArrayLiteral) Lookup(sym *envir.Symbols)
- func (a *ArrayLiteral) NumChildren() int
- func (a *ArrayLiteral) Size() int
- type ArrayRef
- func (a *ArrayRef) Child(i int) (ASTree, error)
- func (a *ArrayRef) Children() *base.List[ASTree]
- func (a *ArrayRef) Eval(env envir.Environment) (interface{}, error)
- func (a *ArrayRef) Eval0(env envir.Environment, value interface{}) (interface{}, error)
- func (a *ArrayRef) GetString() (string, error)
- func (a *ArrayRef) Index() (ASTree, error)
- func (a *ArrayRef) Location() string
- func (a *ArrayRef) Lookup(sym *envir.Symbols)
- func (a *ArrayRef) NumChildren() int
- type BinaryExpr
- func (b *BinaryExpr) Child(i int) (ASTree, error)
- func (b *BinaryExpr) Children() *base.List[ASTree]
- func (b *BinaryExpr) Eval(env envir.Environment) (interface{}, error)
- func (b *BinaryExpr) GetString() (string, error)
- func (b *BinaryExpr) Location() string
- func (b *BinaryExpr) Lookup(sym *envir.Symbols)
- func (b *BinaryExpr) NumChildren() int
- type BlockStmt
- func (b *BlockStmt) Child(i int) (ASTree, error)
- func (b *BlockStmt) Children() *base.List[ASTree]
- func (b *BlockStmt) Eval(env envir.Environment) (interface{}, error)
- func (b *BlockStmt) GetString() (string, error)
- func (b *BlockStmt) Location() string
- func (b *BlockStmt) Lookup(sym *envir.Symbols)
- func (b *BlockStmt) NumChildren() int
- type BreakSignal
- type BreakStmt
- func (b *BreakStmt) Child(i int) (ASTree, error)
- func (b *BreakStmt) Children() *base.List[ASTree]
- func (b *BreakStmt) Eval(env envir.Environment) (interface{}, error)
- func (b *BreakStmt) GetString() (string, error)
- func (b *BreakStmt) Location() string
- func (b *BreakStmt) Lookup(sym *envir.Symbols)
- func (b *BreakStmt) NumChildren() int
- type ContinueSignal
- type ContinueStmt
- func (c *ContinueStmt) Child(i int) (ASTree, error)
- func (c *ContinueStmt) Children() *base.List[ASTree]
- func (c *ContinueStmt) Eval(env envir.Environment) (interface{}, error)
- func (c *ContinueStmt) GetString() (string, error)
- func (c *ContinueStmt) Location() string
- func (c *ContinueStmt) Lookup(sym *envir.Symbols)
- func (c *ContinueStmt) NumChildren() int
- type DefStmt
- func (d *DefStmt) Body() (*BlockStmt, error)
- func (d *DefStmt) Child(i int) (ASTree, error)
- func (d *DefStmt) Children() *base.List[ASTree]
- func (d *DefStmt) Eval(en envir.Environment) (interface{}, error)
- func (d *DefStmt) GetString() (string, error)
- func (d *DefStmt) Location() string
- func (d *DefStmt) Lookup(sym *envir.Symbols)
- func (d *DefStmt) Name() (string, error)
- func (d *DefStmt) NumChildren() int
- func (d *DefStmt) Parameters() (*ParameterList, error)
- type ForStmt
- func (w *ForStmt) Child(i int) (ASTree, error)
- func (w *ForStmt) Children() *base.List[ASTree]
- func (w *ForStmt) Eval(en envir.Environment) (interface{}, error)
- func (w *ForStmt) GetString() (string, error)
- func (w *ForStmt) Location() string
- func (w *ForStmt) Lookup(sym *envir.Symbols)
- func (w *ForStmt) NumChildren() int
- type Function
- type GoStmt
- func (g *GoStmt) Child(i int) (ASTree, error)
- func (g *GoStmt) Children() *base.List[ASTree]
- func (g *GoStmt) Eval(env envir.Environment) (interface{}, error)
- func (g *GoStmt) GetString() (string, error)
- func (g *GoStmt) Location() string
- func (g *GoStmt) Lookup(sym *envir.Symbols)
- func (g *GoStmt) NumChildren() int
- type IfStmt
- func (is *IfStmt) Child(i int) (ASTree, error)
- func (is *IfStmt) Children() *base.List[ASTree]
- func (is *IfStmt) Condition() (ASTree, error)
- func (is *IfStmt) ElseBlock() (ASTree, error)
- func (is *IfStmt) Eval(en envir.Environment) (interface{}, error)
- func (is *IfStmt) GetString() (string, error)
- func (is *IfStmt) Location() string
- func (is *IfStmt) Lookup(sym *envir.Symbols)
- func (is *IfStmt) NumChildren() int
- func (is *IfStmt) ThenBlock() (ASTree, error)
- type IncludeStmt
- func (ic *IncludeStmt) Child(i int) (ASTree, error)
- func (ic *IncludeStmt) Children() *base.List[ASTree]
- func (ic *IncludeStmt) Eval(en envir.Environment) (interface{}, error)
- func (ic *IncludeStmt) GetString() (string, error)
- func (ic *IncludeStmt) Location() string
- func (ic *IncludeStmt) Lookup(sym *envir.Symbols)
- func (ic *IncludeStmt) NumChildren() int
- type Name
- func (n *Name) Child(i int) (ASTree, error)
- func (n *Name) Children() *base.List[ASTree]
- func (n *Name) Eval(env envir.Environment) (interface{}, error)
- func (n *Name) EvalForAssign(env envir.Environment, value interface{})
- func (n *Name) GetString() (string, error)
- func (n *Name) Location() string
- func (n *Name) Lookup(sym *envir.Symbols)
- func (n *Name) LookupForAssign(sym *envir.Symbols)
- func (n *Name) Name() (string, error)
- func (n *Name) NumChildren() int
- func (n *Name) Token() token.Token
- type NegativeExpr
- func (n *NegativeExpr) Child(i int) (ASTree, error)
- func (n *NegativeExpr) Children() *base.List[ASTree]
- func (n *NegativeExpr) Eval(env envir.Environment) (interface{}, error)
- func (n *NegativeExpr) GetString() (string, error)
- func (n *NegativeExpr) Location() string
- func (n *NegativeExpr) Lookup(sym *envir.Symbols)
- func (n *NegativeExpr) NumChildren() int
- type NotExpr
- func (n *NotExpr) Child(i int) (ASTree, error)
- func (n *NotExpr) Children() *base.List[ASTree]
- func (n *NotExpr) Eval(env envir.Environment) (interface{}, error)
- func (n *NotExpr) GetString() (string, error)
- func (n *NotExpr) Location() string
- func (n *NotExpr) Lookup(sym *envir.Symbols)
- func (n *NotExpr) NumChildren() int
- type NullStmt
- func (n *NullStmt) Child(i int) (ASTree, error)
- func (n *NullStmt) Children() *base.List[ASTree]
- func (n *NullStmt) Eval(env envir.Environment) (interface{}, error)
- func (n *NullStmt) GetString() (string, error)
- func (n *NullStmt) Location() string
- func (n *NullStmt) Lookup(sym *envir.Symbols)
- func (n *NullStmt) NumChildren() int
- type NumberLiteral
- func (n *NumberLiteral) Child(i int) (ASTree, error)
- func (n *NumberLiteral) Children() *base.List[ASTree]
- func (n *NumberLiteral) Eval(env envir.Environment) (interface{}, error)
- func (n *NumberLiteral) GetString() (string, error)
- func (n *NumberLiteral) Location() string
- func (n *NumberLiteral) Lookup(sym *envir.Symbols)
- func (n *NumberLiteral) NumChildren() int
- func (n *NumberLiteral) String() string
- func (n *NumberLiteral) Value() (interface{}, error)
- type OptFunction
- type ParameterList
- func (p *ParameterList) Child(i int) (ASTree, error)
- func (p *ParameterList) Children() *base.List[ASTree]
- func (p *ParameterList) Eval(env envir.Environment) (interface{}, error)
- func (p *ParameterList) Eval0(env envir.Environment, index int, val interface{})
- func (p *ParameterList) GetString() (string, error)
- func (p *ParameterList) Location() string
- func (p *ParameterList) Lookup(sym *envir.Symbols)
- func (p *ParameterList) Name(i int) (string, error)
- func (p *ParameterList) NumChildren() int
- func (p *ParameterList) Size() int
- type Postfix
- type PrimaryExpr
- func (p *PrimaryExpr) Child(i int) (ASTree, error)
- func (p *PrimaryExpr) Children() *base.List[ASTree]
- func (p *PrimaryExpr) Eval(env envir.Environment) (interface{}, error)
- func (p *PrimaryExpr) GetString() (string, error)
- func (p *PrimaryExpr) HasPostfix(nest int) bool
- func (p *PrimaryExpr) Location() string
- func (p *PrimaryExpr) Lookup(sym *envir.Symbols)
- func (p *PrimaryExpr) NumChildren() int
- func (p *PrimaryExpr) Operand() (ASTree, error)
- func (p *PrimaryExpr) Postfix(nest int) Postfix
- type ReturnSignal
- type ReturnStmt
- func (r *ReturnStmt) Child(i int) (ASTree, error)
- func (r *ReturnStmt) Children() *base.List[ASTree]
- func (r *ReturnStmt) Eval(env envir.Environment) (interface{}, error)
- func (r *ReturnStmt) GetString() (string, error)
- func (r *ReturnStmt) Location() string
- func (r *ReturnStmt) Lookup(sym *envir.Symbols)
- func (r *ReturnStmt) NumChildren() int
- type StringLiteral
- func (s *StringLiteral) Child(i int) (ASTree, error)
- func (s *StringLiteral) Children() *base.List[ASTree]
- func (s *StringLiteral) Eval(env envir.Environment) (interface{}, error)
- func (s *StringLiteral) GetString() (string, error)
- func (s *StringLiteral) Location() string
- func (s *StringLiteral) Lookup(sym *envir.Symbols)
- func (s *StringLiteral) NumChildren() int
- func (s *StringLiteral) Value() (string, error)
- type WhileStmt
- func (w *WhileStmt) Body() (ASTree, error)
- func (w *WhileStmt) Child(i int) (ASTree, error)
- func (w *WhileStmt) Children() *base.List[ASTree]
- func (w *WhileStmt) Condition() (ASTree, error)
- func (w *WhileStmt) Eval(en envir.Environment) (interface{}, error)
- func (w *WhileStmt) GetString() (string, error)
- func (w *WhileStmt) Location() string
- func (w *WhileStmt) Lookup(sym *envir.Symbols)
- func (w *WhileStmt) NumChildren() int
Constants ¶
View Source
const (
UNKNOWN = -1
)
Variables ¶
This section is empty.
Functions ¶
func EvalMain ¶
func EvalMain(bf *OptFunction, en envir.Environment) (interface{}, error)
func FunctionLookup ¶
func FunctionLookup(sym *envir.Symbols, params *ParameterList, body *BlockStmt) int
Types ¶
type ASTList ¶
type ASTList struct {
// contains filtered or unexported fields
}
func (*ASTList) NumChildren ¶
type ASTree ¶
type Arguments ¶
type Arguments struct {
// contains filtered or unexported fields
}
func (*Arguments) Eval0 ¶
func (a *Arguments) Eval0(en envir.Environment, value interface{}) (interface{}, error)
func (*Arguments) NumChildren ¶
type ArrayLiteral ¶
type ArrayLiteral struct {
// contains filtered or unexported fields
}
func NewArrayLiteral ¶
func NewArrayLiteral(l *base.List[ASTree]) *ArrayLiteral
func (*ArrayLiteral) Eval ¶
func (a *ArrayLiteral) Eval(env envir.Environment) (interface{}, error)
func (*ArrayLiteral) GetString ¶
func (a *ArrayLiteral) GetString() (string, error)
func (*ArrayLiteral) Location ¶
func (a *ArrayLiteral) Location() string
func (*ArrayLiteral) Lookup ¶
func (a *ArrayLiteral) Lookup(sym *envir.Symbols)
func (*ArrayLiteral) NumChildren ¶
func (a *ArrayLiteral) NumChildren() int
func (*ArrayLiteral) Size ¶
func (a *ArrayLiteral) Size() int
type ArrayRef ¶
type ArrayRef struct {
// contains filtered or unexported fields
}
func (*ArrayRef) Eval0 ¶
func (a *ArrayRef) Eval0(env envir.Environment, value interface{}) (interface{}, error)
func (*ArrayRef) NumChildren ¶
type BinaryExpr ¶
type BinaryExpr struct {
// contains filtered or unexported fields
}
func NewBinaryExpr ¶
func NewBinaryExpr(l *base.List[ASTree]) *BinaryExpr
func (*BinaryExpr) Eval ¶
func (b *BinaryExpr) Eval(env envir.Environment) (interface{}, error)
func (*BinaryExpr) GetString ¶
func (b *BinaryExpr) GetString() (string, error)
func (*BinaryExpr) Location ¶
func (b *BinaryExpr) Location() string
func (*BinaryExpr) Lookup ¶
func (b *BinaryExpr) Lookup(sym *envir.Symbols)
func (*BinaryExpr) NumChildren ¶
func (b *BinaryExpr) NumChildren() int
type BlockStmt ¶
type BlockStmt struct {
// contains filtered or unexported fields
}
func (*BlockStmt) NumChildren ¶
type BreakStmt ¶
type BreakStmt struct {
// contains filtered or unexported fields
}
func (*BreakStmt) NumChildren ¶
type ContinueStmt ¶
type ContinueStmt struct {
// contains filtered or unexported fields
}
func NewContinueStmt ¶
func NewContinueStmt(l *base.List[ASTree]) *ContinueStmt
func (*ContinueStmt) Eval ¶
func (c *ContinueStmt) Eval(env envir.Environment) (interface{}, error)
func (*ContinueStmt) GetString ¶
func (c *ContinueStmt) GetString() (string, error)
func (*ContinueStmt) Location ¶
func (c *ContinueStmt) Location() string
func (*ContinueStmt) Lookup ¶
func (c *ContinueStmt) Lookup(sym *envir.Symbols)
func (*ContinueStmt) NumChildren ¶
func (c *ContinueStmt) NumChildren() int
type DefStmt ¶
type DefStmt struct {
// contains filtered or unexported fields
}
func (*DefStmt) NumChildren ¶
func (*DefStmt) Parameters ¶
func (d *DefStmt) Parameters() (*ParameterList, error)
type ForStmt ¶
type ForStmt struct {
// contains filtered or unexported fields
}
func (*ForStmt) NumChildren ¶
type Function ¶
type Function struct {
// contains filtered or unexported fields
}
func NewFunction ¶
func NewFunction(parameters *ParameterList, body *BlockStmt, en envir.Environment) *Function
func (*Function) Parameters ¶
func (f *Function) Parameters() *ParameterList
type GoStmt ¶
type GoStmt struct {
// contains filtered or unexported fields
}
func (*GoStmt) NumChildren ¶
type IfStmt ¶
type IfStmt struct {
// contains filtered or unexported fields
}
func (*IfStmt) NumChildren ¶
type IncludeStmt ¶
type IncludeStmt struct {
// contains filtered or unexported fields
}
func NewIncludeStmt ¶
func NewIncludeStmt(l *base.List[ASTree]) *IncludeStmt
func (*IncludeStmt) Eval ¶
func (ic *IncludeStmt) Eval(en envir.Environment) (interface{}, error)
func (*IncludeStmt) GetString ¶
func (ic *IncludeStmt) GetString() (string, error)
func (*IncludeStmt) Location ¶
func (ic *IncludeStmt) Location() string
func (*IncludeStmt) Lookup ¶
func (ic *IncludeStmt) Lookup(sym *envir.Symbols)
func (*IncludeStmt) NumChildren ¶
func (ic *IncludeStmt) NumChildren() int
type Name ¶
type Name struct {
// contains filtered or unexported fields
}
func (*Name) EvalForAssign ¶
func (n *Name) EvalForAssign(env envir.Environment, value interface{})
func (*Name) LookupForAssign ¶
func (*Name) NumChildren ¶
type NegativeExpr ¶
type NegativeExpr struct {
// contains filtered or unexported fields
}
func NewNegativeExpr ¶
func NewNegativeExpr(l *base.List[ASTree]) *NegativeExpr
func (*NegativeExpr) Eval ¶
func (n *NegativeExpr) Eval(env envir.Environment) (interface{}, error)
func (*NegativeExpr) GetString ¶
func (n *NegativeExpr) GetString() (string, error)
func (*NegativeExpr) Location ¶
func (n *NegativeExpr) Location() string
func (*NegativeExpr) Lookup ¶
func (n *NegativeExpr) Lookup(sym *envir.Symbols)
func (*NegativeExpr) NumChildren ¶
func (n *NegativeExpr) NumChildren() int
type NotExpr ¶
type NotExpr struct {
// contains filtered or unexported fields
}
func (*NotExpr) NumChildren ¶
type NullStmt ¶
type NullStmt struct {
// contains filtered or unexported fields
}
func (*NullStmt) NumChildren ¶
type NumberLiteral ¶
type NumberLiteral struct {
// contains filtered or unexported fields
}
func NewNumberLiteral ¶
func NewNumberLiteral(t token.Token) *NumberLiteral
func (*NumberLiteral) Eval ¶
func (n *NumberLiteral) Eval(env envir.Environment) (interface{}, error)
func (*NumberLiteral) GetString ¶
func (n *NumberLiteral) GetString() (string, error)
func (*NumberLiteral) Location ¶
func (n *NumberLiteral) Location() string
func (*NumberLiteral) Lookup ¶
func (n *NumberLiteral) Lookup(sym *envir.Symbols)
func (*NumberLiteral) NumChildren ¶
func (n *NumberLiteral) NumChildren() int
func (*NumberLiteral) String ¶
func (n *NumberLiteral) String() string
func (*NumberLiteral) Value ¶
func (n *NumberLiteral) Value() (interface{}, error)
type OptFunction ¶
type OptFunction struct {
// contains filtered or unexported fields
}
func NewOptFunction ¶
func NewOptFunction(parameters *ParameterList, body *BlockStmt, en envir.Environment, memorySize int) *OptFunction
func (*OptFunction) Body ¶
func (o *OptFunction) Body() *BlockStmt
func (*OptFunction) MakeEnv ¶
func (o *OptFunction) MakeEnv() envir.Environment
func (*OptFunction) Parameters ¶
func (o *OptFunction) Parameters() *ParameterList
type ParameterList ¶
type ParameterList struct {
// contains filtered or unexported fields
}
func NewParameterList ¶
func NewParameterList(l *base.List[ASTree]) *ParameterList
func (*ParameterList) Eval ¶
func (p *ParameterList) Eval(env envir.Environment) (interface{}, error)
func (*ParameterList) Eval0 ¶
func (p *ParameterList) Eval0(env envir.Environment, index int, val interface{})
func (*ParameterList) GetString ¶
func (p *ParameterList) GetString() (string, error)
func (*ParameterList) Location ¶
func (p *ParameterList) Location() string
func (*ParameterList) Lookup ¶
func (p *ParameterList) Lookup(sym *envir.Symbols)
func (*ParameterList) NumChildren ¶
func (p *ParameterList) NumChildren() int
func (*ParameterList) Size ¶
func (p *ParameterList) Size() int
type Postfix ¶
type Postfix interface {
Eval0(env envir.Environment, value interface{}) (interface{}, error)
}
type PrimaryExpr ¶
type PrimaryExpr struct {
// contains filtered or unexported fields
}
func (*PrimaryExpr) Eval ¶
func (p *PrimaryExpr) Eval(env envir.Environment) (interface{}, error)
func (*PrimaryExpr) GetString ¶
func (p *PrimaryExpr) GetString() (string, error)
func (*PrimaryExpr) HasPostfix ¶
func (p *PrimaryExpr) HasPostfix(nest int) bool
func (*PrimaryExpr) Location ¶
func (p *PrimaryExpr) Location() string
func (*PrimaryExpr) Lookup ¶
func (p *PrimaryExpr) Lookup(sym *envir.Symbols)
func (*PrimaryExpr) NumChildren ¶
func (p *PrimaryExpr) NumChildren() int
func (*PrimaryExpr) Operand ¶
func (p *PrimaryExpr) Operand() (ASTree, error)
func (*PrimaryExpr) Postfix ¶
func (p *PrimaryExpr) Postfix(nest int) Postfix
type ReturnSignal ¶
type ReturnSignal struct {
Val interface{}
}
type ReturnStmt ¶
type ReturnStmt struct {
// contains filtered or unexported fields
}
func NewReturnStmt ¶
func NewReturnStmt(l *base.List[ASTree]) *ReturnStmt
func (*ReturnStmt) Eval ¶
func (r *ReturnStmt) Eval(env envir.Environment) (interface{}, error)
func (*ReturnStmt) GetString ¶
func (r *ReturnStmt) GetString() (string, error)
func (*ReturnStmt) Location ¶
func (r *ReturnStmt) Location() string
func (*ReturnStmt) Lookup ¶
func (r *ReturnStmt) Lookup(sym *envir.Symbols)
func (*ReturnStmt) NumChildren ¶
func (r *ReturnStmt) NumChildren() int
type StringLiteral ¶
type StringLiteral struct {
// contains filtered or unexported fields
}
func NewStringLiteral ¶
func NewStringLiteral(t token.Token) *StringLiteral
func (*StringLiteral) Eval ¶
func (s *StringLiteral) Eval(env envir.Environment) (interface{}, error)
func (*StringLiteral) GetString ¶
func (s *StringLiteral) GetString() (string, error)
func (*StringLiteral) Location ¶
func (s *StringLiteral) Location() string
func (*StringLiteral) Lookup ¶
func (s *StringLiteral) Lookup(sym *envir.Symbols)
func (*StringLiteral) NumChildren ¶
func (s *StringLiteral) NumChildren() int
func (*StringLiteral) Value ¶
func (s *StringLiteral) Value() (string, error)
type WhileStmt ¶
type WhileStmt struct {
// contains filtered or unexported fields
}
func (*WhileStmt) NumChildren ¶
Source Files
¶
- arguments.go
- array_literal.go
- array_ref.go
- ast_leaf.go
- ast_list.go
- ast_tree.go
- base_fun.go
- binary_expr.go
- block_stmt.go
- break.go
- break_stmt.go
- continue.go
- continue_stmt.go
- def_stmt.go
- for_stmt.go
- go_stmt.go
- if_stmt.go
- include_stmt.go
- name.go
- negative_expr.go
- not_expr.go
- null_stmt.go
- number_literal.go
- opt_fun.go
- parameter_list.go
- postfix.go
- primary_expr.go
- return_signal.go
- return_stmt.go
- string_literal.go
- while_stmt.go
Click to show internal directories.
Click to hide internal directories.