token

package
v0.0.0-...-2c802aa Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package token provides tokens for parsing the regular expressions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Token

type Token struct {
	V  rune // token value
	Ty Type // token type
}

Token represents a token.

func NewToken

func NewToken(value rune, k Type) *Token

NewToken returns a new Token.

func (*Token) String

func (t *Token) String() string

type Type

type Type int

Type is integer to identify the type of token.

const (
	CHARACTER Type = iota
	UNION
	STAR
	PLUS
	QUESTION
	ANY
	LPAREN
	RPAREN
	EOF
)

Each token is identified by a unique integer.

func (Type) String

func (k Type) String() string

Jump to

Keyboard shortcuts

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