regx

package
v0.0.0-...-d3fc8e5 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OPERATOR = 0x1000000    /* Bit set in all operators */
	START    = OPERATOR + 0 /* Start, used for marker on stack */
	RBRA     = OPERATOR + 1 /* Right bracket,  */
	LBRA     = OPERATOR + 2 /* Left bracket,  */
	OR       = OPERATOR + 3 /* Alternation, | */
	CAT      = OPERATOR + 4 /* Concatentation, implicit operator */
	STAR     = OPERATOR + 5 /* Closure, * */
	PLUS     = OPERATOR + 6 /* a+ == aa* */
	QUEST    = OPERATOR + 7 /* a? == a|nothing, i.e. 0 or 1 a's */
	ANY      = 0x2000000    /* Any character but newline, . */
	NOP      = ANY + 1      /* No operation, internal use only */
	BOL      = ANY + 2      /* Beginning of line, ^ */
	EOL      = ANY + 3      /* End of line, $ */
	CCLASS   = ANY + 4      /* Character class, [] */
	NCCLASS  = ANY + 5      /* Negated character class, [^] */
	END      = ANY + 0x77   /* Terminate: match found */

	ISATOR = OPERATOR
	ISAND  = ANY

	QUOTED = 0x4000000 /* Bit set for \-ed lex characters */
)

* Actions and Tokens * * 0x10000xx are operators, value == precedence * 0x20000xx are tokens, i.e. operands for operators

View Source
const DCLASS = 10 /* allocation increment */
View Source
const NLIST = 127
View Source
const NPROG = 1024
View Source
const NRange = 10
View Source
const NSTACK = 20

Variables

This section is empty.

Functions

func Compile

func Compile(r []rune) bool

func Init

func Init()

func Match

func Match(t runes.Text, r []rune, startp int, eof int, rp *Ranges) bool

either t!=nil or r!=nil, and we match the string in the appropriate place

func MatchBackward

func MatchBackward(t runes.Text, startp int, rp *Ranges) bool

func Null

func Null() bool

Types

type Ilist

type Ilist struct {
	// contains filtered or unexported fields
}

type Inst

type Inst struct {
	// contains filtered or unexported fields
}

type Node

type Node struct {
	// contains filtered or unexported fields
}

type Ranges

type Ranges struct {
	R [NRange]runes.Range
}
var Sel Ranges

Jump to

Keyboard shortcuts

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