Documentation
¶
Index ¶
- func Traverse(n Node, f func(Node) bool)
- func Validate(expression string, start Node) error
- type Alternation
- type AlternationCallback
- type Callback
- type Container
- type Input
- type Node
- func NewAtomicGroup(alt Alternation) Node
- func NewClass(table Table) Node
- func NewComment(text string) Node
- func NewCondition(cond *Predicate, yes Node, no Node) Node
- func NewDot() Node
- func NewEndOfLine() Node
- func NewEndOfString() Node
- func NewEndOfStringAndNewLine() Node
- func NewForNameReference(name string) Node
- func NewGroup(alt Alternation) Node
- func NewGuard(cond *Predicate, yes Node) Node
- func NewKeep() Node
- func NewLookAhead(alt Alternation) Node
- func NewLookBehind(alt Alternation) (Node, error)
- func NewNamedGroup(name string, alt Alternation) Node
- func NewNegativeClass(table Table) Node
- func NewNegativeLookAhead(alt Alternation) Node
- func NewNegativeLookBehind(alt Alternation) (Node, error)
- func NewNonWordBoundary() Node
- func NewNotCapturedGroup(alt Alternation) Node
- func NewOptionsSwitcher(enable []ScanOption, disable []ScanOption) Node
- func NewQuantifier(q *quantity.Quantity, value Node) Node
- func NewStartOfLine() Node
- func NewStartOfString() Node
- func NewWordBoundary() Node
- func NodeForReference(index int) Node
- func Unify(start Node) []Node
- type Output
- type Predicate
- type ScanOption
- type Scanner
- type Table
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Alternation ¶
type Alternation interface {
Node
GetVariants() []Node
VisitAlternation(
scanner Scanner,
input Input,
from, to int,
match AlternationCallback,
)
CopyAlternation() Alternation
}
func NewAlternation ¶
func NewAlternation(variants []Node) Alternation
type AlternationCallback ¶
type Node ¶
type Node interface {
GetKey() string
GetExpressions() structs.Set[string]
AddExpression(string)
GetNestedNodes() map[string]Node
IsLeaf() bool
Visit(Scanner, Input, int, int, Callback)
// TODO : trie have few size / heights (leafs)
// TODO : node with different sizes must have chain value instead trie to simpliy this moment
Size() (int, bool)
Copy() Node
}
func NewAtomicGroup ¶
func NewAtomicGroup(alt Alternation) Node
func NewComment ¶
func NewEndOfLine ¶
func NewEndOfLine() Node
func NewEndOfString ¶
func NewEndOfString() Node
func NewEndOfStringAndNewLine ¶
func NewEndOfStringAndNewLine() Node
func NewForNameReference ¶
func NewGroup ¶
func NewGroup(alt Alternation) Node
func NewLookAhead ¶
func NewLookAhead(alt Alternation) Node
func NewLookBehind ¶
func NewLookBehind(alt Alternation) (Node, error)
func NewNamedGroup ¶
func NewNamedGroup(name string, alt Alternation) Node
func NewNegativeClass ¶
func NewNegativeLookAhead ¶
func NewNegativeLookAhead(alt Alternation) Node
func NewNegativeLookBehind ¶
func NewNegativeLookBehind(alt Alternation) (Node, error)
func NewNonWordBoundary ¶
func NewNonWordBoundary() Node
func NewNotCapturedGroup ¶
func NewNotCapturedGroup(alt Alternation) Node
func NewOptionsSwitcher ¶
func NewOptionsSwitcher(enable []ScanOption, disable []ScanOption) Node
func NewStartOfLine ¶
func NewStartOfLine() Node
func NewStartOfString ¶
func NewStartOfString() Node
func NewWordBoundary ¶
func NewWordBoundary() Node
func NodeForReference ¶
type ScanOption ¶
type ScanOption uint
const ( ScanOptionCaseInsensetive ScanOption = 1 ScanOptionMultiline ScanOption = 2 ScanOptionDisableNamedGroups ScanOption = 3 )
type Scanner ¶
type Scanner interface {
Position() int
Rewind(pos int)
MatchGroup(from int, to int)
GroupsPosition() int
GetGroup(idx int) (quantity.Interface, bool)
RewindGroups(pos int)
MatchNamedGroup(name string, from int, to int)
NamedGroupsPosition() int
GetNamedGroup(name string) (quantity.Interface, bool)
RewindNamedGroups(pos int)
MarkAsHole(from int, to int)
HolesPosition() int
RewindHoles(pos int)
OptionsInclude(opt ScanOption) bool
OptionsEnable(opt ScanOption)
OptionsDisable(opt ScanOption)
OptionsPosition() int
RewindOptions(pos int)
}
Source Files
¶
- alternation.go
- atomic_group.go
- base.go
- class.go
- comment.go
- condition.go
- dot.go
- end_of_line.go
- end_of_string.go
- end_of_string_and_new_line.go
- group.go
- keep.go
- look_ahead.go
- look_behind.go
- named_group.go
- named_reference.go
- negative_class.go
- negative_look_ahead.go
- negative_look_behind.go
- node.go
- non_word_boundary.go
- not_captured_group.go
- options_switcher.go
- quantifier.go
- reference_node.go
- start_of_line.go
- start_of_string.go
- unificator.go
- validator.go
- word_boundary.go
Click to show internal directories.
Click to hide internal directories.