go/src/go/token/token.go

type Token

const ILLEGAL

const EOF

const COMMENT

const literal_beg

const IDENT

const INT

const FLOAT

const IMAG

const CHAR

const STRING

const literal_end

const operator_beg

const ADD

const SUB

const MUL

const QUO

const REM

const AND

const OR

const XOR

const SHL

const SHR

const AND_NOT

const ADD_ASSIGN

const SUB_ASSIGN

const MUL_ASSIGN

const QUO_ASSIGN

const REM_ASSIGN

const AND_ASSIGN

const OR_ASSIGN

const XOR_ASSIGN

const SHL_ASSIGN

const SHR_ASSIGN

const AND_NOT_ASSIGN

const LAND

const LOR

const ARROW

const INC

const DEC

const EQL

const LSS

const GTR

const ASSIGN

const NOT

const NEQ

const LEQ

const GEQ

const DEFINE

const ELLIPSIS

const LPAREN

const LBRACK

const LBRACE

const COMMA

const PERIOD

const RPAREN

const RBRACK

const RBRACE

const SEMICOLON

const COLON

const operator_end

const keyword_beg

const BREAK

const CASE

const CHAN

const CONST

const CONTINUE

const DEFAULT

const DEFER

const ELSE

const FALLTHROUGH

const FOR

const FUNC

const GO

const GOTO

const IF

const IMPORT

const INTERFACE

const MAP

const PACKAGE

const RANGE

const RETURN

const SELECT

const STRUCT

const SWITCH

const TYPE

const VAR

const keyword_end

const additional_beg

const TILDE

const additional_end

var tokens

// String returns the string corresponding to the token tok.
// For operators, delimiters, and keywords the string is the actual
// token character sequence (e.g., for the token [ADD], the string is
// "+"). For all other tokens the string corresponds to the token
// constant name (e.g. for the token [IDENT], the string is "IDENT").
func (tok Token) String() string {}

const LowestPrec

const UnaryPrec

const HighestPrec

// Precedence returns the operator precedence of the binary
// operator op. If op is not a binary operator, the result
// is LowestPrecedence.
func (op Token) Precedence() int {}

var keywords

func init() {}

// Lookup maps an identifier to its keyword token or [IDENT] (if not a keyword).
func Lookup(ident string) Token {}

// IsLiteral returns true for tokens corresponding to identifiers
// and basic type literals; it returns false otherwise.
func (tok Token) IsLiteral() bool {}

// IsOperator returns true for tokens corresponding to operators and
// delimiters; it returns false otherwise.
func (tok Token) IsOperator() bool {}

// IsKeyword returns true for tokens corresponding to keywords;
// it returns false otherwise.
func (tok Token) IsKeyword() bool {}

// IsExported reports whether name starts with an upper-case letter.
func IsExported(name string) bool {}

// IsKeyword reports whether name is a Go keyword, such as "func" or "return".
func IsKeyword(name string) bool {}

// IsIdentifier reports whether name is a Go identifier, that is, a non-empty
// string made up of letters, digits, and underscores, where the first character
// is not a digit. Keywords are not identifiers.
func IsIdentifier(name string) bool {}