regex

package
v0.0.0-...-f855b71 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2017 License: GPL-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const (
	CONCATENATION_RE_SIMPLE_RE = iota
	NEW_AXIOM                  = iota
	RE_SIMPLE_RE               = iota
	RE_UNION                   = iota
	SET_ITEMS                  = iota
)

Variables

View Source
var Stats parsingStats

Stats contains some statistics that may be checked after a call to ParseString or ParseFile

Functions

func ParseFile

func ParseFile(filename string, numThreads int) (bool, *symbol)

ParseFile parses a file in parallel using an operator precedence grammar. It takes as input a filename and the number of threads, and returns a boolean representing the success or failure of the parsing and the symbol at the root of the syntactic tree (if successful).

func ParseString

func ParseString(str []byte, numThreads int) (bool, *symbol)

ParseString parses a string in parallel using an operator precedence grammar. It takes as input a string as a slice of bytes and the number of threads, and returns a boolean representing the success or failure of the parsing and the symbol at the root of the syntactic tree (if successful).

func SetCPUProfileFile

func SetCPUProfileFile(file *os.File)

Types

type Dfa

type Dfa struct {
	Initial   *DfaState
	Final     []*DfaState
	NumStates int
}

func (*Dfa) GetStates

func (dfa *Dfa) GetStates() []*DfaState

GetState returns a slice containing all the states of the dfa. The states are sorted by their state number.

type DfaState

type DfaState struct {
	Num             int
	Transitions     [256]*DfaState
	IsFinal         bool
	AssociatedRules []int
}

type Nfa

type Nfa struct {
	Initial   *NfaState
	Final     *NfaState
	NumStates int
}

func NewEmptyStringNfa

func NewEmptyStringNfa() Nfa

func (*Nfa) AddAssociatedRule

func (nfa *Nfa) AddAssociatedRule(ruleNum int)

func (*Nfa) Concatenate

func (nfa1 *Nfa) Concatenate(nfa2 Nfa)

func (*Nfa) KleenePlus

func (nfa *Nfa) KleenePlus()

Operator +

func (*Nfa) KleeneStar

func (nfa *Nfa) KleeneStar()

Operator *

func (*Nfa) ToDfa

func (nfa *Nfa) ToDfa() Dfa

func (*Nfa) Unite

func (nfa1 *Nfa) Unite(nfa2 Nfa)

Operator |

func (*Nfa) ZeroOrOne

func (nfa *Nfa) ZeroOrOne()

Operator ?

type NfaState

type NfaState struct {
	Transitions     [256][]*NfaState
	AssociatedRules []int
}

func (*NfaState) AddTransition

func (state *NfaState) AddTransition(char byte, ptr *NfaState)

func (*NfaState) EpsilonClosure

func (state *NfaState) EpsilonClosure() []*NfaState

Jump to

Keyboard shortcuts

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