Documentation ¶
Index ¶
Constants ¶
View Source
const ( /* Special Types */ EOF = "EOF" ILLEGAL = "ILLEGAL" NEWLINE = "NEWLINE" /* Identifiers & Literals */ IDENT = "IDENT" STRING = "STRING" INTEGER = "INTEGER" DOUBLE = "DOUBLE" BOOLEAN = "BOOLEAN" /* Symbols */ COMMA = "COMMA" LCB = "LCB" RCB = "RCB" LP = "LP" RP = "RP" ASSIGN = "ASSIGN" SIGN = "SIGN" COLON = "COLON" HASH = "HASH" QM = "QM" DOT = "DOT" LSB = "LSB" RSB = "RSB" EXCL = "EXCL" PLUS = "PLUS" MINUS = "MINUS" TIMES = "TIMES" DIVIDE = "DIVIDE" MOD = "MOD" POW = "POW" GT = "GT" LT = "LT" /* Keywords */ ENTITY = "ENTITY" RELATION = "RELATION" PERMISSION = "PERMISSION" ATTRIBUTE = "ATTRIBUTE" RULE = "RULE" AND = "AND" OR = "OR" NOT = "NOT" IN = "IN" /* Comments */ SINGLE_LINE_COMMENT = "SINGLE_LINE_COMMENT" MULTI_LINE_COMMENT = "MULTI_LINE_COMMENT" /* Whitespace */ SPACE = "SPACE" TAB = "TAB" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type PositionInfo ¶ added in v0.3.8
type PositionInfo struct { // The current line position in the input source code. LinePosition int // The current column position in the input source code. ColumnPosition int }
PositionInfo - represents the current position in the input source code.
type Token ¶
type Token struct { // The current position in the input source code. PositionInfo PositionInfo // The type of the token. Type Type // The literal value of the token. Literal string }
Token - represents a lexical token in the input source code.
type Type ¶
type Type string
Type - defines a custom type for tokens.
func LookupKeywords ¶
LookupKeywords - looks up a keyword in the keywords map and returns its corresponding Type.
type WithIgnores ¶ added in v0.3.1
WithIgnores - is a helper struct that includes a token and a list of ignored tokens.
Click to show internal directories.
Click to hide internal directories.