Documentation ¶
Index ¶
- func Ast2string(ast BaseNode) ([]byte, error)
- func IsKeyword(s string) bool
- type AcessoMembro
- type Anotacao
- type AsseguraNode
- type BaseNode
- type Bloco
- type BlocoPara
- type ChamadaFuncao
- type ConstanteLiteral
- type ContinueNode
- type DecimalLiteral
- type DeclFuncao
- type DeclFuncaoParametro
- type DeclVar
- type Enquanto
- type ExpressaoSe
- type Identificador
- type ImporteDe
- type Indexacao
- type InteiroLiteral
- type ListaLiteral
- type MapaLiteral
- type NovaNode
- type OpBinaria
- type OpUnaria
- type PareNode
- type Parser
- type Programa
- type Reatribuicao
- type RetorneNode
- type TextoLiteral
- type TuplaLiteral
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Ast2string ¶
Types ¶
type AcessoMembro ¶ added in v0.2.0
type AsseguraNode ¶ added in v0.6.0
type ChamadaFuncao ¶
type ConstanteLiteral ¶
type ConstanteLiteral struct {
Valor string
}
type ContinueNode ¶ added in v0.2.0
type ContinueNode struct{}
type DecimalLiteral ¶
type DecimalLiteral struct {
Valor string
}
type DeclFuncao ¶
type DeclFuncao struct { Nome string // Nome da função Parametros []*DeclFuncaoParametro // Parâmetros da função Corpo *Bloco // Corpo da função }
type DeclFuncaoParametro ¶
type ExpressaoSe ¶
type Identificador ¶
type Identificador struct {
Nome string
}
type ImporteDe ¶ added in v0.4.0
type ImporteDe struct { Caminho *TextoLiteral Nomes []string }
FIXME: adicionar suporte a importação com *
type InteiroLiteral ¶
type InteiroLiteral struct {
Valor string
}
type ListaLiteral ¶ added in v0.3.0
type ListaLiteral struct {
Elementos []BaseNode
}
type MapaLiteral ¶ added in v0.6.0
type MapaLiteral struct {
Entradas [][]BaseNode
}
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
func NewParserFromString ¶
type Programa ¶
type Programa struct {
Declaracoes []BaseNode // Lista de declarações no programa
}
Programa representa o nó raiz do programa na AST.
type Reatribuicao ¶
type Reatribuicao struct { Objeto BaseNode Operador string // =, -=, +=, /=, //=, *= ou outros Expressao BaseNode // A expressao após o sinal de igualdade }
Casos como `variavel += 1`, `variavel -= 1` e outros
type RetorneNode ¶
type RetorneNode struct {
Expressao BaseNode
}
type TextoLiteral ¶
type TextoLiteral struct {
Valor string
}
type TuplaLiteral ¶ added in v0.3.0
type TuplaLiteral struct {
Elementos []BaseNode
}
Click to show internal directories.
Click to hide internal directories.