token

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package token contains keywords needed to map input

Index

Constants

View Source
const (
	// ASTERISK - Operators
	ASTERISK = "*"

	// IDENT - Identifiers + literals
	IDENT   = "IDENT"   // tab, car, apple...
	LITERAL = "LITERAL" // 1343456

	// COMMA - Delimiters
	COMMA     = ","
	SEMICOLON = ";"

	// EOF - Special tokens
	EOF        = ""
	APOSTROPHE = "'"

	// LPAREN - Paren
	LPAREN = "("
	RPAREN = ")"

	// CREATE - Keywords
	CREATE   = "CREATE"
	DROP     = "DROP"
	TABLE    = "TABLE"
	INSERT   = "INSERT"
	INTO     = "INTO"
	VALUES   = "VALUES"
	SELECT   = "SELECT"
	FROM     = "FROM"
	WHERE    = "WHERE"
	DELETE   = "DELETE"
	ORDER    = "ORDER"
	BY       = "BY"
	ASC      = "ASC"
	DESC     = "DESC"
	LIMIT    = "LIMIT"
	OFFSET   = "OFFSET"
	UPDATE   = "UPDATE"
	SET      = "SET"
	DISTINCT = "DISTINCT"
	JOIN     = "JOIN"
	INNER    = "INNER"
	FULL     = "FULL"
	LEFT     = "LEFT"
	RIGHT    = "RIGHT"
	ON       = "ON"
	MIN      = "MIN"
	MAX      = "MAX"
	COUNT    = "COUNT"
	SUM      = "SUM"
	AVG      = "AVG"
	IN       = "IN"
	NOTIN    = "NOTIN"
	NULL     = "NULL"

	TO = "TO"

	// EQUAL - Logical operations
	EQUAL = "EQUAL"
	NOT   = "NOT"
	AND   = "AND"
	OR    = "OR"
	TRUE  = "TRUE"
	FALSE = "FALSE"

	// TEXT - Data types
	TEXT = "TEXT"
	INT  = "INT"

	// ILLEGAL - System
	ILLEGAL = "ILLEGAL"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Token

type Token struct {
	Type    Type
	Literal string
}

Token - contains

type Type

type Type string

func LookupIdent

func LookupIdent(ident string) Type

LookupIdent - Return keyword type from defined list if exists, otherwise it returns IDENT type

Jump to

Keyboard shortcuts

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