ast

package
v0.0.0-...-02c006d Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2021 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// contenedores
	PROGRAM = iota
	BLOCK
	EXPRESSION

	// tipos nativos
	INT
	IDENT
	STRING
	BOOLEAN
	NULL

	// computadores
	BINARY
	UNARY

	// control de flujo
	IF
	FUNCTION
	LET
	RETURN
	WHILE
	ARRAY
	HASH
	INDEX
	CALL
)

El tipo de ast

Variables

This section is empty.

Functions

This section is empty.

Types

type ArrayLiteralNode

type ArrayLiteralNode struct {
	Elements []Expression
}

func (*ArrayLiteralNode) String

func (an *ArrayLiteralNode) String() string

func (*ArrayLiteralNode) Type

func (an *ArrayLiteralNode) Type() Type

type Binary

type Binary struct {
	Left  Expression
	Op    token.Token
	Right Expression
}

Computadores

func (*Binary) String

func (b *Binary) String() string

func (*Binary) Type

func (b *Binary) Type() Type

type BlockStmtNode

type BlockStmtNode struct {
	Statements []Statement
}

func (*BlockStmtNode) String

func (b *BlockStmtNode) String() string

func (*BlockStmtNode) Type

func (b *BlockStmtNode) Type() Type

type BooleanNode

type BooleanNode struct {
	Value bool
}

func (*BooleanNode) String

func (bn *BooleanNode) String() string

func (*BooleanNode) Type

func (bn *BooleanNode) Type() Type

type CallExprNode

type CallExprNode struct {
	Callee    Expression
	Arguments []Expression
}

func (*CallExprNode) String

func (cn *CallExprNode) String() string

func (*CallExprNode) Type

func (cn *CallExprNode) Type() Type

type Expression

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

type ExpressionStmtNode

type ExpressionStmtNode struct {
	Expression Expression
}

func (*ExpressionStmtNode) String

func (e *ExpressionStmtNode) String() string

func (*ExpressionStmtNode) Type

func (e *ExpressionStmtNode) Type() Type

type FunLiteralNode

type FunLiteralNode struct {
	Parameters []IdentifierNode
	Body       *BlockStmtNode
}

func (*FunLiteralNode) String

func (fl *FunLiteralNode) String() string

func (*FunLiteralNode) Type

func (fl *FunLiteralNode) Type() Type

type HashLiteralNode

type HashLiteralNode struct {
	Pairs map[Expression]Expression
}

func (*HashLiteralNode) String

func (hn *HashLiteralNode) String() string

func (*HashLiteralNode) Type

func (hn *HashLiteralNode) Type() Type

type IdentifierNode

type IdentifierNode struct {
	Value string
}

tipos nativos

func (*IdentifierNode) String

func (id *IdentifierNode) String() string

func (*IdentifierNode) Type

func (id *IdentifierNode) Type() Type

type IfExprNode

type IfExprNode struct {
	Condition   Expression
	Consequence *BlockStmtNode
	Alternative *BlockStmtNode
}

controladores de flujo

func (*IfExprNode) String

func (i *IfExprNode) String() string

func (*IfExprNode) Type

func (i *IfExprNode) Type() Type

type IndexExprNode

type IndexExprNode struct {
	Callee Expression
	Index  Expression
}

func (*IndexExprNode) String

func (cn *IndexExprNode) String() string

func (*IndexExprNode) Type

func (cn *IndexExprNode) Type() Type

type IntegerNode

type IntegerNode struct {
	Value int64
}

func (*IntegerNode) String

func (in *IntegerNode) String() string

func (*IntegerNode) Type

func (in *IntegerNode) Type() Type

type LetStmtNode

type LetStmtNode struct {
	Name  IdentifierNode
	Value Expression
}

Sentencias

func (*LetStmtNode) String

func (ls *LetStmtNode) String() string

func (*LetStmtNode) Type

func (ls *LetStmtNode) Type() Type

type Node

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

type NullNode

type NullNode struct {
}

func (*NullNode) String

func (nn *NullNode) String() string

func (*NullNode) Type

func (nn *NullNode) Type() Type

type ProgramNode

type ProgramNode struct {
	Statements []Statement
}

contenedores de sentencias

func (*ProgramNode) String

func (p *ProgramNode) String() string

func (*ProgramNode) Type

func (p *ProgramNode) Type() Type

type ReturnStmtNode

type ReturnStmtNode struct {
	Value Expression
}

func (*ReturnStmtNode) String

func (rs *ReturnStmtNode) String() string

func (*ReturnStmtNode) Type

func (rs *ReturnStmtNode) Type() Type

type Statement

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

type StringNode

type StringNode struct {
	Value string
}

func (*StringNode) String

func (sn *StringNode) String() string

func (*StringNode) Type

func (sn *StringNode) Type() Type

type Type

type Type int

type Unary

type Unary struct {
	Op    token.Token
	Right Expression
}

func (*Unary) String

func (u *Unary) String() string

func (*Unary) Type

func (u *Unary) Type() Type

type WhileStmtNode

type WhileStmtNode struct {
	Condition Expression
	Body      *BlockStmtNode
}

func (*WhileStmtNode) String

func (ws *WhileStmtNode) String() string

func (*WhileStmtNode) Type

func (ws *WhileStmtNode) Type() Type

Jump to

Keyboard shortcuts

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