scan

package
v0.0.0-...-59377f0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2022 License: BSD-2-Clause Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CharSet

type CharSet struct {
	Pattern
}

func Char

func Char(p string) CharSet

func Merge

func Merge(es ...Expr) CharSet

func (CharSet) Exclude

func (p CharSet) Exclude(cs ...CharSet) CharSet

func (CharSet) Negate

func (p CharSet) Negate() CharSet

type Expr

type Expr interface {
	String() string
}

type IDMatcher

type IDMatcher struct {
	*regexp.Regexp
	ID int
}

type MM

type MM []struct {
	Expr Expr
	ID   int
}

type Matcher

type Matcher struct {
	Defs    []*IDMatcher
	EOF     int
	Illegal int
}

func NewMapMatcher

func NewMapMatcher(mm MM) *Matcher

func NewMatcher

func NewMatcher(es ...Expr) *Matcher

type Pattern

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

func Con

func Con(es ...Expr) Pattern

func Or

func Or(es ...Expr) Pattern

func Pat

func Pat(pat string) Pattern

func Str

func Str(str string) Pattern

func (Pattern) OneOrMore

func (p Pattern) OneOrMore() Pattern

func (Pattern) Repeat

func (p Pattern) Repeat(n int) Pattern

func (Pattern) Ungreedy

func (p Pattern) Ungreedy() Pattern

func (Pattern) ZeroOrMore

func (p Pattern) ZeroOrMore() Pattern

func (Pattern) ZeroOrOne

func (p Pattern) ZeroOrOne() Pattern

type Scanner

type Scanner struct {
	*Matcher
	// contains filtered or unexported fields
}

func (*Scanner) Error

func (s *Scanner) Error() error

func (*Scanner) Pos

func (s *Scanner) Pos() int

func (*Scanner) Scan

func (s *Scanner) Scan() bool

func (*Scanner) SetReader

func (s *Scanner) SetReader(r io.Reader) error

func (*Scanner) SetSource

func (s *Scanner) SetSource(src []byte)

func (*Scanner) Token

func (s *Scanner) Token() *Token

type Token

type Token struct {
	ID    int
	Value []byte
	Pos   int
}

Directories

Path Synopsis
example

Jump to

Keyboard shortcuts

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