ast

package
v0.0.0-...-5d0a214 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2020 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ASTNode

type ASTNode interface {
	ToData() (interface{}, error)
	FromData(interface{}) (ASTNode, error)

	String(indent string) (string, error)
	Print(indent string)
	Pretty(indent string)

	Visit(func(ASTNode, interface{}) (interface{}, error)) error
}

func ValueFromData

func ValueFromData(input interface{}) (ASTNode, error)

type Array

type Array struct {
	Elems []ASTNode
}

func (Array) FromData

func (N Array) FromData(input interface{}) (ASTNode, error)

func (Array) Pretty

func (N Array) Pretty(indent string)

func (Array) Print

func (N Array) Print(indent string)

func (Array) String

func (N Array) String(indent string) (string, error)

func (Array) ToData

func (N Array) ToData() (interface{}, error)

func (Array) Visit

func (N Array) Visit(V func(ASTNode, interface{}) (interface{}, error)) error

type Bool

type Bool struct {
	Value bool
}

func (Bool) FromData

func (N Bool) FromData(input interface{}) (ASTNode, error)

func (Bool) Pretty

func (N Bool) Pretty(indent string)

func (Bool) Print

func (N Bool) Print(indent string)

func (Bool) String

func (N Bool) String(indent string) (string, error)

func (Bool) ToData

func (N Bool) ToData() (interface{}, error)

func (Bool) Visit

func (N Bool) Visit(V func(ASTNode, interface{}) (interface{}, error)) error

type BracePath

type BracePath struct {
	// Exprs []Expr
	Exprs []ASTNode
}

func (BracePath) FromData

func (N BracePath) FromData(input interface{}) (ASTNode, error)

func (BracePath) Pretty

func (N BracePath) Pretty(indent string)

func (BracePath) Print

func (N BracePath) Print(indent string)

func (BracePath) String

func (N BracePath) String(indent string) (string, error)

func (BracePath) ToData

func (N BracePath) ToData() (interface{}, error)

func (BracePath) Visit

func (N BracePath) Visit(V func(ASTNode, interface{}) (interface{}, error)) error

type Decimal

type Decimal struct {
	Value float64
}

func (Decimal) FromData

func (N Decimal) FromData(input interface{}) (ASTNode, error)

func (Decimal) Pretty

func (N Decimal) Pretty(indent string)

func (Decimal) Print

func (N Decimal) Print(indent string)

func (Decimal) String

func (N Decimal) String(indent string) (string, error)

func (Decimal) ToData

func (N Decimal) ToData() (interface{}, error)

func (Decimal) Visit

func (N Decimal) Visit(V func(ASTNode, interface{}) (interface{}, error)) error

type Definition

type Definition struct {
	ParseInfo ParseInfo

	Name Token
	DSL  Token

	Body []ASTNode
}

func (Definition) FromData

func (N Definition) FromData(input interface{}) (ASTNode, error)

func (Definition) Pretty

func (N Definition) Pretty(indent string)

func (Definition) Print

func (N Definition) Print(indent string)

func (Definition) String

func (N Definition) String(indent string) (string, error)

func (Definition) ToData

func (N Definition) ToData() (interface{}, error)

func (Definition) Visit

func (N Definition) Visit(V func(ASTNode, interface{}) (interface{}, error)) error

type Field

type Field struct {
	Key   Token
	Value ASTNode
}

func (Field) FromData

func (N Field) FromData(input interface{}) (ASTNode, error)

func (Field) Pretty

func (N Field) Pretty(indent string)

func (Field) Print

func (N Field) Print(indent string)

func (Field) String

func (N Field) String(indent string) (string, error)

func (Field) ToData

func (N Field) ToData() (interface{}, error)

func (Field) Visit

func (N Field) Visit(V func(ASTNode, interface{}) (interface{}, error)) error

type HofFile

type HofFile struct {
	Name string
	Path string

	Definitions []Definition
}

func (HofFile) FromData

func (N HofFile) FromData(input interface{}) (ASTNode, error)

func (HofFile) Pretty

func (N HofFile) Pretty(indent string)

func (HofFile) Print

func (N HofFile) Print(indent string)

func (HofFile) String

func (N HofFile) String(indent string) (string, error)

func (HofFile) ToData

func (N HofFile) ToData() (interface{}, error)

func (HofFile) Visit

func (N HofFile) Visit(V func(ASTNode, interface{}) (interface{}, error)) error

type Integer

type Integer struct {
	Value int
}

func (Integer) FromData

func (N Integer) FromData(input interface{}) (ASTNode, error)

func (Integer) Pretty

func (N Integer) Pretty(indent string)

func (Integer) Print

func (N Integer) Print(indent string)

func (Integer) String

func (N Integer) String(indent string) (string, error)

func (Integer) ToData

func (N Integer) ToData() (interface{}, error)

func (Integer) Visit

func (N Integer) Visit(V func(ASTNode, interface{}) (interface{}, error)) error

type Object

type Object struct {
	Fields []Field
}

func (Object) FromData

func (N Object) FromData(input interface{}) (ASTNode, error)

func (Object) Pretty

func (N Object) Pretty(indent string)

func (Object) Print

func (N Object) Print(indent string)

func (Object) String

func (N Object) String(indent string) (string, error)

func (Object) ToData

func (N Object) ToData() (interface{}, error)

func (Object) Visit

func (N Object) Visit(V func(ASTNode, interface{}) (interface{}, error)) error

type ParseInfo

type ParseInfo struct {
	Line int
	Col  int
	Text string
}

type PathExpr

type PathExpr struct {
	PathList []ASTNode
}

func (PathExpr) FromData

func (N PathExpr) FromData(input interface{}) (ASTNode, error)

func (PathExpr) Pretty

func (N PathExpr) Pretty(indent string)

func (PathExpr) Print

func (N PathExpr) Print(indent string)

func (PathExpr) String

func (N PathExpr) String(indent string) (string, error)

func (PathExpr) ToData

func (N PathExpr) ToData() (interface{}, error)

func (PathExpr) Visit

func (N PathExpr) Visit(V func(ASTNode, interface{}) (interface{}, error)) error

type RangeExpr

type RangeExpr struct {
	Low   int
	High  int
	Range bool
}

func (RangeExpr) FromData

func (N RangeExpr) FromData(input interface{}) (ASTNode, error)

func (RangeExpr) Pretty

func (N RangeExpr) Pretty(indent string)

func (RangeExpr) Print

func (N RangeExpr) Print(indent string)

func (RangeExpr) String

func (N RangeExpr) String(indent string) (string, error)

func (RangeExpr) ToData

func (N RangeExpr) ToData() (interface{}, error)

func (RangeExpr) Visit

func (N RangeExpr) Visit(V func(ASTNode, interface{}) (interface{}, error)) error

type Token

type Token struct {
	Value string
}

func (Token) FromData

func (N Token) FromData(input interface{}) (ASTNode, error)

func (Token) Pretty

func (N Token) Pretty(indent string)

func (Token) Print

func (N Token) Print(indent string)

func (Token) String

func (N Token) String(indent string) (string, error)

func (Token) ToData

func (N Token) ToData() (interface{}, error)

func (Token) Visit

func (N Token) Visit(V func(ASTNode, interface{}) (interface{}, error)) error

type TokenPath

type TokenPath struct {
	Value string
}

func (TokenPath) FromData

func (N TokenPath) FromData(input interface{}) (ASTNode, error)

func (TokenPath) Pretty

func (N TokenPath) Pretty(indent string)

func (TokenPath) Print

func (N TokenPath) Print(indent string)

func (TokenPath) String

func (N TokenPath) String(indent string) (string, error)

func (TokenPath) ToData

func (N TokenPath) ToData() (interface{}, error)

func (TokenPath) Visit

func (N TokenPath) Visit(V func(ASTNode, interface{}) (interface{}, error)) error

type TypeDecl

type TypeDecl struct {
	Name  Token
	Type  Token
	Extra *Object
}

func (TypeDecl) FromData

func (N TypeDecl) FromData(input interface{}) (ASTNode, error)

func (TypeDecl) Pretty

func (N TypeDecl) Pretty(indent string)

func (TypeDecl) Print

func (N TypeDecl) Print(indent string)

func (TypeDecl) String

func (N TypeDecl) String(indent string) (string, error)

func (TypeDecl) ToData

func (N TypeDecl) ToData() (interface{}, error)

func (TypeDecl) Visit

func (N TypeDecl) Visit(V func(ASTNode, interface{}) (interface{}, error)) error

Jump to

Keyboard shortcuts

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