automaton

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2020 License: BSD-3-Clause Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	Final bool // final state
	Paths []Path
	Token Token
}

Node is a state of the Tokenizer automaton

type Path

type Path struct {
	Exp    re.Regexp // regular expression used as transition condition
	Target *Node     // target node
}

Path connects two nodes over a regular expression

type PreNode

type PreNode struct {
	Final bool              `json:"final"`
	Paths map[string]string `json:"paths"`
	Token Token             `json:"token,omitempty"`
}

PreNode is used by the Tokenizer constructor to store unprocessed values that will form a complete Node

type Token

type Token string

Token takes values defined in the rules

Jump to

Keyboard shortcuts

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