utils

package
v0.0.0-...-d9f2893 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package utils contains utility types and functions for dfa-regex-engine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	N int
}

Context has a number which is basically used to create incremental stuff. Example incremental stuff: state number(q0, q1, q2)

func NewContext

func NewContext() *Context

NewContext returns a new Context. The default value of N is -1.

func (*Context) Increment

func (ctx *Context) Increment() int

Increment add 1 to N which held in Context struct, and returns the number.

type State

type State struct {
	N int
}

State represents a state including in DFA or NFA. It has its number. The number can NOT be duplicate in same DFA or NFA. Basically, the number is set incrementally.

func NewState

func NewState(n int) State

NewState returns a new state with its number set.

func (State) String

func (s State) String() string

Jump to

Keyboard shortcuts

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