parser

package
v0.0.0-...-6382efb Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2014 License: MIT Imports: 3 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallNode

type CallNode struct {
	// Pos
	NodeType
	Callee Node
	Args   []Node
}

func (*CallNode) Copy

func (node *CallNode) Copy() Node

func (*CallNode) String

func (node *CallNode) String() string

type IdentNode

type IdentNode struct {
	// Pos
	NodeType
	Ident string
}

func NewIdentNode

func NewIdentNode(name string) *IdentNode

func (*IdentNode) Copy

func (node *IdentNode) Copy() Node

func (*IdentNode) String

func (node *IdentNode) String() string

type Node

type Node interface {
	Type() NodeType
	// Position() Pos
	String() string
	Copy() Node
}

func Parse

func Parse(l *lexer.Lexer) []Node

func ParseFromString

func ParseFromString(name, program string) []Node

type NodeType

type NodeType int
const (
	NodeIdent NodeType = iota
	NodeString
	NodeNumber
	NodeCall
	NodeVector
)

func (NodeType) Type

func (t NodeType) Type() NodeType

type NumberNode

type NumberNode struct {
	// Pos
	NodeType
	Value      string
	NumberType token.Token
}

func (*NumberNode) Copy

func (node *NumberNode) Copy() Node

func (*NumberNode) String

func (node *NumberNode) String() string

type Pos

type Pos int

func (Pos) Position

func (p Pos) Position() Pos

type StringNode

type StringNode struct {
	// Pos
	NodeType
	Value string
}

func (*StringNode) Copy

func (node *StringNode) Copy() Node

func (*StringNode) String

func (node *StringNode) String() string

type VectorNode

type VectorNode struct {
	// Pos
	NodeType
	Nodes []Node
}

func (*VectorNode) Copy

func (node *VectorNode) Copy() Node

func (*VectorNode) String

func (node *VectorNode) String() string

Jump to

Keyboard shortcuts

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