parser

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2018 License: MPL-2.0 Imports: 3 Imported by: 2

Documentation

Overview

Package parser contains the main structs for parsing

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Func

type Func func(ctx *parsley.Context, leftRecCtx data.IntMap, pos parsley.Pos) (parsley.Node, data.IntSet)

Func defines a helper to implement the Parser interface with functions

func Nil added in v0.6.0

func Nil() Func

Nil always matches and returns with an nil node result

func (Func) Name added in v0.6.0

func (f Func) Name() string

Name returns with an empty name

func (Func) Parse

func (f Func) Parse(ctx *parsley.Context, leftRecCtx data.IntMap, pos parsley.Pos) (parsley.Node, data.IntSet)

Parse parses the input using the function

func (Func) WithName added in v0.6.0

func (f Func) WithName(name interface{}) *NamedFunc

WithName returns with the same parser function but with the given name If a function is passed then it will be called when Name() is called

type NamedFunc added in v0.6.0

type NamedFunc struct {
	// contains filtered or unexported fields
}

NamedFunc is a parser function with a custom name

func End

func End() *NamedFunc

End matches the end of the input

func (*NamedFunc) Name added in v0.6.0

func (nf *NamedFunc) Name() string

Name returns with the parser name

func (*NamedFunc) Parse added in v0.6.0

func (nf *NamedFunc) Parse(ctx *parsley.Context, leftRecCtx data.IntMap, pos parsley.Pos) (parsley.Node, data.IntSet)

Parse parses the input using the function

Jump to

Keyboard shortcuts

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