factor

package
v0.0.0-...-99cb562 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2015 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TolerateCharClassCount = 100
)

Variables

View Source
var (
	RegexpOpCodeTable = []string{
		"", "NoMatch", "EmptyMatch", "Literal", "CC",
		"AnyCharNL", "AnyChar", "^", "$", "\\A", "$",
		"\\b", "\\B", "()", "*", "+", "?", "RT", "・", "|",
	}
)

Functions

func PrintTree

func PrintTree(n *Node, depth int)

for debug

Types

type Edge

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

type Factor

type Factor struct {
	Undef        bool
	MinFactorLen int
	// contains filtered or unexported fields
}

func BestSet

func BestSet(sets ...*Factor) (best *Factor)

func CrossSet

func CrossSet(x, y Factor) (xy Factor)

func NewSet

func NewSet() Factor

func (*Factor) Add

func (f *Factor) Add(str string)

func (*Factor) Clear

func (f *Factor) Clear()

func (Factor) Clone

func (f Factor) Clone() Factor

func (Factor) Items

func (f Factor) Items() []string

func (Factor) Size

func (f Factor) Size() int

func (Factor) String

func (f Factor) String() string

func (*Factor) Union

func (f *Factor) Union(ff Factor)

type FactorTuple

type FactorTuple struct {
	Exact, Pref, Suff, Frag Factor
}

func Alternate

func Alternate(x, y FactorTuple) FactorTuple

func Analyze

func Analyze(re *syntax.Regexp) FactorTuple

func Concatinate

func Concatinate(x, y FactorTuple) (xy FactorTuple)

func NewFactorTuple

func NewFactorTuple() FactorTuple

func NewFactorTupleAnyChar

func NewFactorTupleAnyChar() FactorTuple

func NewFactorTupleEmptyString

func NewFactorTupleEmptyString() FactorTuple

func NewFactorTupleLiteral

func NewFactorTupleLiteral(str string) FactorTuple

func NewFactorTupleUndef

func NewFactorTupleUndef() FactorTuple

func (FactorTuple) String

func (f FactorTuple) String() string

func (FactorTuple) Undef

func (f FactorTuple) Undef() bool

type Node

type Node struct {
	Regexp   *syntax.Regexp
	Child    []*Node
	Factor   FactorTuple
	Internal bool
}

func Parse

func Parse(re *syntax.Regexp) (n *Node)

func (*Node) Dot

func (n *Node) Dot(w io.Writer)

func (Node) String

func (n Node) String() string

for debug

type Op

type Op syntax.Op

func (Op) String

func (o Op) String() string

type StrageType

type StrageType map[string]struct{}

Jump to

Keyboard shortcuts

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