parser

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2018 License: MIT Imports: 6 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Comments

type Comments map[node.Node][]*comment.Comment

Comments a collection of comment groups assigned to nodes

func (Comments) AddComments

func (c Comments) AddComments(node node.Node, comments []*comment.Comment)

AddComments add comment group to the collection

func (Comments) AddFromChildNode

func (c Comments) AddFromChildNode(n node.Node, ch node.Node)

func (Comments) AddFromToken

func (c Comments) AddFromToken(node node.Node, token *scanner.Token, tokenName comment.TokenName)

type Parser

type Parser interface {
	Parse() int
	GetPath() string
	GetRootNode() node.Node
	GetErrors() []*errors.Error
	GetComments() Comments
	GetPositions() Positions
}

Parser interface

type PositionBuilder

type PositionBuilder struct {
	Positions    *Positions
	PositionPool *sync.Pool
}

PositionBuilder provide functions to constuct positions

func (*PositionBuilder) NewNodeListNodePosition

func (b *PositionBuilder) NewNodeListNodePosition(list []node.Node, n node.Node) *position.Position

NewNodeListNodePosition returns new Position

func (*PositionBuilder) NewNodeListPosition

func (b *PositionBuilder) NewNodeListPosition(list []node.Node) *position.Position

NewNodeListPosition returns new Position

func (*PositionBuilder) NewNodeListTokenPosition

func (b *PositionBuilder) NewNodeListTokenPosition(list []node.Node, t *scanner.Token) *position.Position

NewNodeListTokenPosition returns new Position

func (*PositionBuilder) NewNodeNodeListPosition

func (b *PositionBuilder) NewNodeNodeListPosition(n node.Node, list []node.Node) *position.Position

NewNodeNodeListPosition returns new Position

func (*PositionBuilder) NewNodePosition

func (b *PositionBuilder) NewNodePosition(n node.Node) *position.Position

NewNodePosition returns new Position

func (*PositionBuilder) NewNodeTokenPosition

func (b *PositionBuilder) NewNodeTokenPosition(n node.Node, t *scanner.Token) *position.Position

NewNodeTokenPosition returns new Position

func (*PositionBuilder) NewNodesPosition

func (b *PositionBuilder) NewNodesPosition(startNode node.Node, endNode node.Node) *position.Position

NewNodesPosition returns new Position

func (*PositionBuilder) NewOptionalListTokensPosition

func (b *PositionBuilder) NewOptionalListTokensPosition(list []node.Node, t *scanner.Token, endToken *scanner.Token) *position.Position

NewOptionalListTokensPosition returns new Position

func (*PositionBuilder) NewTokenNodeListPosition

func (b *PositionBuilder) NewTokenNodeListPosition(t *scanner.Token, list []node.Node) *position.Position

NewTokenNodeListPosition returns new Position

func (*PositionBuilder) NewTokenNodePosition

func (b *PositionBuilder) NewTokenNodePosition(t *scanner.Token, n node.Node) *position.Position

NewTokenNodePosition returns new Position

func (*PositionBuilder) NewTokenPosition

func (b *PositionBuilder) NewTokenPosition(t *scanner.Token) *position.Position

NewTokenPosition returns new Position

func (*PositionBuilder) NewTokensPosition

func (b *PositionBuilder) NewTokensPosition(startToken *scanner.Token, endToken *scanner.Token) *position.Position

NewTokensPosition returns new Position

type Positions

type Positions map[node.Node]*position.Position

Positions a collection of positions attached to nodes

func (Positions) AddPosition

func (p Positions) AddPosition(node node.Node, position *position.Position)

AddPosition attaches a position to a node

Jump to

Keyboard shortcuts

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