token

package
v0.9.16 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package token is generated by GoGLL. Do not edit

Index

Constants

This section is empty.

Variables

View Source
var IDToType = map[string]Type{
	"Error":                  0,
	"$":                      1,
	"!=":                     2,
	"(":                      3,
	")":                      4,
	"*":                      5,
	"+":                      6,
	",":                      7,
	"-":                      8,
	".":                      9,
	"..":                     10,
	"/":                      11,
	"//":                     12,
	":":                      13,
	"::":                     14,
	"<":                      15,
	"<=":                     16,
	"=":                      17,
	">":                      18,
	">=":                     19,
	"@":                      20,
	"[":                      21,
	"]":                      22,
	"ancestor":               23,
	"ancestor-or-self":       24,
	"and":                    25,
	"attribute":              26,
	"child":                  27,
	"comment":                28,
	"descendant":             29,
	"descendant-or-self":     30,
	"digits":                 31,
	"div":                    32,
	"doublequote":            33,
	"following":              34,
	"following-sibling":      35,
	"mod":                    36,
	"namespace":              37,
	"ncname":                 38,
	"node":                   39,
	"or":                     40,
	"parent":                 41,
	"preceding":              42,
	"preceding-sibling":      43,
	"processing-instruction": 44,
	"self":                   45,
	"singlequote":            46,
	"text":                   47,
	"variableReference":      48,
	"|":                      49,
}
View Source
var StringToType = map[string]Type{
	"Error": Error,
	"EOF":   EOF,
	"T_0":   T_0,
	"T_1":   T_1,
	"T_2":   T_2,
	"T_3":   T_3,
	"T_4":   T_4,
	"T_5":   T_5,
	"T_6":   T_6,
	"T_7":   T_7,
	"T_8":   T_8,
	"T_9":   T_9,
	"T_10":  T_10,
	"T_11":  T_11,
	"T_12":  T_12,
	"T_13":  T_13,
	"T_14":  T_14,
	"T_15":  T_15,
	"T_16":  T_16,
	"T_17":  T_17,
	"T_18":  T_18,
	"T_19":  T_19,
	"T_20":  T_20,
	"T_21":  T_21,
	"T_22":  T_22,
	"T_23":  T_23,
	"T_24":  T_24,
	"T_25":  T_25,
	"T_26":  T_26,
	"T_27":  T_27,
	"T_28":  T_28,
	"T_29":  T_29,
	"T_30":  T_30,
	"T_31":  T_31,
	"T_32":  T_32,
	"T_33":  T_33,
	"T_34":  T_34,
	"T_35":  T_35,
	"T_36":  T_36,
	"T_37":  T_37,
	"T_38":  T_38,
	"T_39":  T_39,
	"T_40":  T_40,
	"T_41":  T_41,
	"T_42":  T_42,
	"T_43":  T_43,
	"T_44":  T_44,
	"T_45":  T_45,
	"T_46":  T_46,
	"T_47":  T_47,
}
View Source
var TypeToID = []string{
	"Error",
	"$",
	"!=",
	"(",
	")",
	"*",
	"+",
	",",
	"-",
	".",
	"..",
	"/",
	"//",
	":",
	"::",
	"<",
	"<=",
	"=",
	">",
	">=",
	"@",
	"[",
	"]",
	"ancestor",
	"ancestor-or-self",
	"and",
	"attribute",
	"child",
	"comment",
	"descendant",
	"descendant-or-self",
	"digits",
	"div",
	"doublequote",
	"following",
	"following-sibling",
	"mod",
	"namespace",
	"ncname",
	"node",
	"or",
	"parent",
	"preceding",
	"preceding-sibling",
	"processing-instruction",
	"self",
	"singlequote",
	"text",
	"variableReference",
	"|",
}
View Source
var TypeToString = []string{
	"Error",
	"EOF",
	"T_0",
	"T_1",
	"T_2",
	"T_3",
	"T_4",
	"T_5",
	"T_6",
	"T_7",
	"T_8",
	"T_9",
	"T_10",
	"T_11",
	"T_12",
	"T_13",
	"T_14",
	"T_15",
	"T_16",
	"T_17",
	"T_18",
	"T_19",
	"T_20",
	"T_21",
	"T_22",
	"T_23",
	"T_24",
	"T_25",
	"T_26",
	"T_27",
	"T_28",
	"T_29",
	"T_30",
	"T_31",
	"T_32",
	"T_33",
	"T_34",
	"T_35",
	"T_36",
	"T_37",
	"T_38",
	"T_39",
	"T_40",
	"T_41",
	"T_42",
	"T_43",
	"T_44",
	"T_45",
	"T_46",
	"T_47",
}

Functions

This section is empty.

Types

type Token

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

Token is returned by the lexer for every scanned lexical token

func New

func New(t Type, lext, rext int, input []rune) *Token

New returns a new token. lext is the left extent and rext the right extent of the token in the input. input is the input slice scanned by the lexer.

func (*Token) GetInput

func (t *Token) GetInput() []rune

GetInput returns the input from which t was parsed.

func (*Token) GetLineColumn

func (t *Token) GetLineColumn() (line, col int)

GetLineColumn returns the line and column of the left extent of t

func (*Token) Lext

func (t *Token) Lext() int

Lext returns the left extent of t in the input stream of runes

func (*Token) Literal

func (t *Token) Literal() []rune

Literal returns the literal runes of t scanned by the lexer

func (*Token) LiteralString

func (t *Token) LiteralString() string

LiteralString returns string(t.Literal())

func (*Token) LiteralStringStripEscape

func (t *Token) LiteralStringStripEscape() string

LiteralStringStripEscape returns string(t.LiteralStripEscape())

func (*Token) LiteralStripEscape

func (t *Token) LiteralStripEscape() []rune

LiteralStripEscape returns the literal runes of t scanned by the lexer

func (*Token) Rext

func (t *Token) Rext() int

Rext returns the right extent of t in the input stream of runes

func (*Token) String

func (t *Token) String() string

func (*Token) Suppress

func (t *Token) Suppress() bool

Suppress returns true iff t is suppressed by the lexer

func (*Token) Type

func (t *Token) Type() Type

Type returns the token Type of t

func (*Token) TypeID

func (t *Token) TypeID() string

TypeID returns the token Type ID of t. This may be different from the literal of token t.

type Type

type Type int

Type is the token type

const (
	Error Type = iota // Error
	EOF               // $
	T_0               // !=
	T_1               // (
	T_2               // )
	T_3               // *
	T_4               // +
	T_5               // ,
	T_6               // -
	T_7               // .
	T_8               // ..
	T_9               // /
	T_10              // //
	T_11              // :
	T_12              // ::
	T_13              // <
	T_14              // <=
	T_15              // =
	T_16              // >
	T_17              // >=
	T_18              // @
	T_19              // [
	T_20              // ]
	T_21              // ancestor
	T_22              // ancestor-or-self
	T_23              // and
	T_24              // attribute
	T_25              // child
	T_26              // comment
	T_27              // descendant
	T_28              // descendant-or-self
	T_29              // digits
	T_30              // div
	T_31              // doublequote
	T_32              // following
	T_33              // following-sibling
	T_34              // mod
	T_35              // namespace
	T_36              // ncname
	T_37              // node
	T_38              // or
	T_39              // parent
	T_40              // preceding
	T_41              // preceding-sibling
	T_42              // processing-instruction
	T_43              // self
	T_44              // singlequote
	T_45              // text
	T_46              // variableReference
	T_47              // |
)

func (Type) ID

func (t Type) ID() string

ID returns the token type ID of token Type t

func (Type) String

func (t Type) String() string

Jump to

Keyboard shortcuts

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