nfa

package
v0.0.0-...-a350d6c Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2018 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package nfa provides a way to construct non-deterministic finite automata from regular expressions using the Thompson's construction algorithm.

Index

Constants

View Source
const (
	// Last unicode rune
	RuneLast = 0x10ffff

	// Pseudo-runes
	RuneBeginText = -100 * iota
	RuneEndText
	RuneBeginLine
	RuneEndLine
	RuneWordBoundary
	RuneNoWordBoundary
	RuneLazy
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	S int  // state
	F bool // final?
	T []T  // transitions
}

func New

func New(pattern string) (*Node, error)

func NewFromRegexp

func NewFromRegexp(r *syntax.Regexp) *Node

type T

type T struct {
	R []rune // rune ranges
	N *Node  // node
}

Jump to

Keyboard shortcuts

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