lex

package
v0.0.0-...-4a27929 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TOKEN_AND                    = "TOKEN_AND"
	TOKEN_ARROW                  = "TOKEN_ARROW"
	TOKEN_AS                     = "TOKEN_AS"
	TOKEN_ASSIGN                 = "TOKEN_ASSIGN"
	TOKEN_ASSIGN_ADD             = "TOKEN_ASSIGN_ADD"
	TOKEN_ASSIGN_DIV             = "TOKEN_ASSIGN_DIV"
	TOKEN_ASSIGN_MUL             = "TOKEN_ASSIGN_MUL"
	TOKEN_ASSIGN_SUB             = "TOKEN_ASSIGN_SUB"
	TOKEN_ASTERISK               = "TOKEN_ASTERISK"
	TOKEN_BREAK                  = "TOKEN_BREAK"
	TOKEN_CASE                   = "TOKEN_CASE"
	TOKEN_CLASS                  = "TOKEN_CLASS"
	TOKEN_COLON                  = "TOKEN_COLON"
	TOKEN_COMMA                  = "TOKEN_COMMA"
	TOKEN_CONSTRUCTOR            = "TOKEN_CONSTRUCTOR"
	TOKEN_CONTINUE               = "TOKEN_CONTINUE"
	TOKEN_DEFAULT                = "TOKEN_DEFAULT"
	TOKEN_DOT                    = "TOKEN_DOT"
	TOKEN_DOUBLE_COLON           = "TOKEN_DOUBLE_COLON"
	TOKEN_DOUBLE_PLUS            = "TOKEN_DOUBLE_PLUS"
	TOKEN_ELLIPSIS               = "TOKEN_ELLIPSIS"
	TOKEN_ELSE                   = "TOKEN_ELSE"
	TOKEN_ENUM                   = "TOKEN_ENUM"
	TOKEN_EQUALS                 = "TOKEN_EQUALS"
	TOKEN_ERROR                  = "TOKEN_ERROR"
	TOKEN_FALSE                  = "TOKEN_FALSE"
	TOKEN_FOR                    = "TOKEN_FOR"
	TOKEN_FUNC                   = "TOKEN_FUNC"
	TOKEN_GREATER_THAN           = "TOKEN_GREATER_THAN"
	TOKEN_GREATER_THAN_OR_EQUALS = "TOKEN_GREATER_THAN_OR_EQUALS"
	TOKEN_IF                     = "TOKEN_IF"
	TOKEN_IMPORT                 = "TOKEN_IMPORT"
	TOKEN_IN                     = "TOKEN_IN"
	TOKEN_INT                    = "TOKEN_INT"
	TOKEN_EOF                    = "TOKEN_EOF"
	TOKEN_LEFT_CURLY             = "TOKEN_LEFT_CURLY"
	TOKEN_LEFT_PAREN             = "TOKEN_LEFT_PAREN"
	TOKEN_LEFT_SQUARE            = "TOKEN_LEFT_SQUARE"
	TOKEN_LESS_THAN              = "TOKEN_LESS_THAN"
	TOKEN_LESS_THAN_OR_EQUALS    = "TOKEN_LESS_THAN_OR_EQUALS"
	TOKEN_LET                    = "TOKEN_LET"
	TOKEN_MATCH                  = "TOKEN_MATCH"
	TOKEN_MINUS                  = "TOKEN_MINUS"
	TOKEN_MODULO                 = "TOKEN_MODULO"
	TOKEN_NEW                    = "TOKEN_NEW"
	TOKEN_NEWLINE                = "TOKEN_NEWLINE"
	TOKEN_NO                     = "TOKEN_NO"
	TOKEN_NOT                    = "TOKEN_NOT"
	TOKEN_NOT_EQUALS             = "TOKEN_NOT_EQUALS"
	TOKEN_OR                     = "TOKEN_OR"
	TOKEN_PRIVATE                = "TOKEN_PRIVATE"
	TOKEN_PLUS                   = "TOKEN_PLUS"
	TOKEN_PUBLIC                 = "TOKEN_PUBLIC"
	TOKEN_REAL_NUMBER            = "TOKEN_REAL_NUMBER"
	TOKEN_RETURN                 = "TOKEN_RETURN"
	TOKEN_RIGHT_CURLY            = "TOKEN_RIGHT_CURLY"
	TOKEN_RIGHT_PAREN            = "TOKEN_RIGHT_PAREN"
	TOKEN_RIGHT_SQUARE           = "TOKEN_RIGHT_SQUARE"
	TOKEN_SELF                   = "TOKEN_SELF"
	TOKEN_SEMICOLON              = "TOKEN_SEMICOLON"
	TOKEN_SLASH                  = "TOKEN_SLASH"
	TOKEN_STRING                 = "TOKEN_STRING"
	TOKEN_SYMBOL                 = "TOKEN_SYMBOL"
	TOKEN_TRUE                   = "TOKEN_TRUE"
	TOKEN_UNKNOWN                = "TOKEN_UNKNOWN"
	TOKEN_VAR                    = "TOKEN_VAR"
	TOKEN_VOID                   = "TOKEN_VOID"
	TOKEN_WHILE                  = "TOKEN_WHILE"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Lexer

type Lexer struct {
	// contains filtered or unexported fields
}

func NewLexer

func NewLexer(filePath string, program string) *Lexer

func (*Lexer) NextToken

func (l *Lexer) NextToken() *Token

func (*Lexer) NextTokenSkipNewlines

func (l *Lexer) NextTokenSkipNewlines() *Token

type LexerError

type LexerError struct {
	Message string
}

func (*LexerError) Error

func (e *LexerError) Error() string

type Location

type Location struct {
	Line     int
	Column   int
	FilePath string
}

func (*Location) String

func (l *Location) String() string

type Token

type Token struct {
	Type     string
	Value    string
	Location *Location
}

func (*Token) String

func (token *Token) String() string

Jump to

Keyboard shortcuts

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