token

package
v3.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: Apache-2.0 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{}/* 112 elements not displayed */
View Source
var StringToType = map[string]Type{}/* 112 elements not displayed */
View Source
var Suppress = []bool{}/* 112 elements not displayed */
View Source
var TypeToID = []string{}/* 112 elements not displayed */
View Source
var TypeToString = []string{}/* 112 elements not displayed */

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

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

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              // \\p{ASCII_Hex_Digit}
	T_12              // \\p{Bidi_Control}
	T_13              // \\p{Cc}
	T_14              // \\p{Cf}
	T_15              // \\p{Co}
	T_16              // \\p{Cs}
	T_17              // \\p{C}
	T_18              // \\p{Dash}
	T_19              // \\p{Deprecated}
	T_20              // \\p{Diacritic}
	T_21              // \\p{Digit}
	T_22              // \\p{Extender}
	T_23              // \\p{Hex_Digit}
	T_24              // \\p{Hyphen}
	T_25              // \\p{IDS_Binary_Operator}
	T_26              // \\p{IDS_Trinary_Operator}
	T_27              // \\p{Ideographic}
	T_28              // \\p{Join_Control}
	T_29              // \\p{Letter}
	T_30              // \\p{Ll}
	T_31              // \\p{Lm}
	T_32              // \\p{Logical_Order_Exception}
	T_33              // \\p{Lower}
	T_34              // \\p{Lo}
	T_35              // \\p{Lt}
	T_36              // \\p{Lu}
	T_37              // \\p{L}
	T_38              // \\p{Mark}
	T_39              // \\p{Mc}
	T_40              // \\p{Me}
	T_41              // \\p{Mn}
	T_42              // \\p{M}
	T_43              // \\p{Nd}
	T_44              // \\p{Nl}
	T_45              // \\p{Noncharacter_Code_Point}
	T_46              // \\p{No}
	T_47              // \\p{Number}
	T_48              // \\p{N}
	T_49              // \\p{Other_Alphabetic}
	T_50              // \\p{Other_Default_Ignorable_Code_Point}
	T_51              // \\p{Other_Grapheme_Extend}
	T_52              // \\p{Other_ID_Continue}
	T_53              // \\p{Other_ID_Start}
	T_54              // \\p{Other_Lowercase}
	T_55              // \\p{Other_Math}
	T_56              // \\p{Other_Uppercase}
	T_57              // \\p{Other}
	T_58              // \\p{Pattern_Syntax}
	T_59              // \\p{Pattern_White_Space}
	T_60              // \\p{Pc}
	T_61              // \\p{Pd}
	T_62              // \\p{Pe}
	T_63              // \\p{Pf}
	T_64              // \\p{Pi}
	T_65              // \\p{Po}
	T_66              // \\p{Prepended_Concatenation_Mark}
	T_67              // \\p{Ps}
	T_68              // \\p{Punct}
	T_69              // \\p{P}
	T_70              // \\p{Quotation_Mark}
	T_71              // \\p{Radical}
	T_72              // \\p{Regional_Indicator}
	T_73              // \\p{STerm}
	T_74              // \\p{Sc}
	T_75              // \\p{Sentence_Terminal}
	T_76              // \\p{Sk}
	T_77              // \\p{Sm}
	T_78              // \\p{Soft_Dotted}
	T_79              // \\p{So}
	T_80              // \\p{Space}
	T_81              // \\p{Symbol}
	T_82              // \\p{S}
	T_83              // \\p{Terminal_Punctuation}
	T_84              // \\p{Title}
	T_85              // \\p{Unified_Ideograph}
	T_86              // \\p{Upper}
	T_87              // \\p{Variation_Selector}
	T_88              // \\p{White_Space}
	T_89              // \\p{Zl}
	T_90              // \\p{Zp}
	T_91              // \\p{Zs}
	T_92              // \\p{Z}
	T_93              // ]
	T_94              // ]'
	T_95              // any
	T_96              // char_lit
	T_97              // empty
	T_98              // letter
	T_99              // lowcase
	T_100             // not
	T_101             // nt
	T_102             // number
	T_103             // package
	T_104             // string_lit
	T_105             // tokid
	T_106             // upcase
	T_107             // {
	T_108             // |
	T_109             // }
)

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