token

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2021 License: MIT Imports: 1 Imported by: 4

Documentation

Index

Constants

View Source
const (
	PlusChar        = '+'
	MinusChar       = '-'
	StarChar        = '*'
	CommonSlashChar = '/'
	OpenParenChar   = '('
	CloseParenChar  = ')'
	CapChar         = '^'
	ModChar         = '%'
	CommaChar       = ','
	QuoteChar       = '\''
	DoubleQuoteChar = '"'
	EqualChar       = '='
	PunctuationChar = '!'
	PipeChar        = '|'
	AndChar         = '&'
	QuestionChar    = '?'
	ColonChar       = ':'
	GreaterChar     = '>'
	LesserChar      = '<'
)

Token character

View Source
const (
	PlusType = 1 + iota
	MinusType
	StarType
	CommonSlashType
	NumberType
	OpenParenType
	CloseParenType
	VariableType
	CapType
	ModType
	CommaType
	StringType
	EqualType
	NotEqualType
	GreaterType
	GreaterEqualType
	LesserType
	LesserEqualType
	OrType
	AndType
	NotType
	BooleanType
	QuestionType
	ColonType
	EOFType
)

Type of tokens

Variables

This section is empty.

Functions

This section is empty.

Types

type And

type And struct{}

And && symbol

func (And) String

func (And) String() string

func (And) Type

func (And) Type() uint

Type of token

type Boolean

type Boolean struct{}

Boolean || symbol

func (Boolean) String

func (Boolean) String() string

func (Boolean) Type

func (Boolean) Type() uint

Type of token

type Cap

type Cap struct{}

Cap symbol

func (Cap) String

func (Cap) String() string

func (Cap) Type

func (Cap) Type() uint

Type of symbol

type CloseParen

type CloseParen struct{}

CloseParen symbol ")"

func (CloseParen) String

func (CloseParen) String() string

func (CloseParen) Type

func (CloseParen) Type() uint

Type of symbol

type Colon

type Colon struct{}

Colon : symbol

func (Colon) String

func (Colon) String() string

func (Colon) Type

func (Colon) Type() uint

Type of token

type Comma

type Comma struct{}

Comma symbol

func (Comma) String

func (Comma) String() string

func (Comma) Type

func (Comma) Type() uint

Type of symbol

type CommonSlash

type CommonSlash struct{}

CommonSlash symbol "/"

func (CommonSlash) String

func (CommonSlash) String() string

func (CommonSlash) Type

func (CommonSlash) Type() uint

Type of symbol

type EOF

type EOF struct{}

EOF symbol

func (EOF) String

func (e EOF) String() string

func (EOF) Type

func (e EOF) Type() uint

Type of symbol

type Equal

type Equal struct{}

Equal == symbol

func (Equal) String

func (Equal) String() string

func (Equal) Type

func (Equal) Type() uint

Type of token

type Greater

type Greater struct{}

Greater ! symbol

func (Greater) String

func (Greater) String() string

func (Greater) Type

func (Greater) Type() uint

Type of token

type GreaterEqual

type GreaterEqual struct{}

GreaterEqual ! symbol

func (GreaterEqual) String

func (GreaterEqual) String() string

func (GreaterEqual) Type

func (GreaterEqual) Type() uint

Type of token

type Lesser

type Lesser struct{}

Lesser ! symbol

func (Lesser) String

func (Lesser) String() string

func (Lesser) Type

func (Lesser) Type() uint

Type of token

type LesserEqual

type LesserEqual struct{}

LesserEqual ! symbol

func (LesserEqual) String

func (LesserEqual) String() string

func (LesserEqual) Type

func (LesserEqual) Type() uint

Type of token

type LiteralString

type LiteralString struct{}

LiteralString value

func (LiteralString) String

func (LiteralString) String() string

func (LiteralString) Type

func (LiteralString) Type() uint

Type of symbol

type Minus

type Minus struct{}

Minus symbol "-"

func (Minus) String

func (Minus) String() string

func (Minus) Type

func (Minus) Type() uint

Type of symbol

type Mod

type Mod struct{}

Mod symbol

func (Mod) String

func (Mod) String() string

func (Mod) Type

func (Mod) Type() uint

Type of symbol

type Not

type Not struct{}

Not ! symbol

func (Not) String

func (Not) String() string

func (Not) Type

func (Not) Type() uint

Type of token

type NotEqual

type NotEqual struct{}

NotEqual != symbol

func (NotEqual) String

func (NotEqual) String() string

func (NotEqual) Type

func (NotEqual) Type() uint

Type of token

type Number

type Number struct{}

Number symbol

func (Number) String

func (Number) String() string

func (Number) Type

func (Number) Type() uint

Type of symbol

type OpenParen

type OpenParen struct{}

OpenParen symbol "("

func (OpenParen) String

func (OpenParen) String() string

func (OpenParen) Type

func (OpenParen) Type() uint

Type of symbol

type Or

type Or struct{}

Or || symbol

func (Or) String

func (Or) String() string

func (Or) Type

func (Or) Type() uint

Type of token

type Plus

type Plus struct{}

Plus symbol "+"

func (Plus) String

func (Plus) String() string

func (Plus) Type

func (Plus) Type() uint

Type of symbol

type Question

type Question struct{}

Question ? symbol

func (Question) String

func (Question) String() string

func (Question) Type

func (Question) Type() uint

Type of token

type Star

type Star struct{}

Star symbol "*"e

func (Star) String

func (Star) String() string

func (Star) Type

func (Star) Type() uint

Type of symbol

type Token

type Token struct {
	Type    Type
	Literal interface{}
	Lexeme  string
	Column  uint
}

Token character stream of expression is token into token

func (Token) String

func (t Token) String() string

type Type

type Type interface {
	String() string
	Type() uint
}

Type of the token

type Variable

type Variable struct{}

Variable symbol

func (Variable) String

func (Variable) String() string

func (Variable) Type

func (Variable) Type() uint

Type of symbol

Jump to

Keyboard shortcuts

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