Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetKeywordsMapping ¶
func GetOperatorsMapping ¶
func HasOperatorPrefix ¶
Types ¶
type Token ¶
A Token represents a mainingful word in a program.
func IllegalToken ¶
IllegalToken is a factory for generating a default illegal token
func MatchKeyword ¶
MatchKeyword returns a token containing info about that keyword, or nil if input is not a keyword
func MatchOperator ¶
func (*Token) GetLocation ¶
type Type ¶
type Type int
Type is the type of a token
const ( // ILLEGAL is a type of token that is not specified in language spec (should not exist) ILLEGAL Type = iota EOF COMMENT LITERAL IDENTIFIER // consts INT_LITERAL FLOAT_LITERAL CHAR_LITERAL BOOLEAN_LITERAL STRING_LITERAL // operators ADD SUB MUL DIV MOD POW INCREMENT DECREMENT LAND LOR LNOT ASSIGN ASSIGN_ADD ASSIGN_SUB ASSIGN_MUL ASSIGN_DIV ASSIGN_MOD ASSIGN_POW EQUAL NOT_EQUAL // not equal LESS LEQ // less or equal GREATER GEQ // greater or equal TRIPLE_EQUAL // deep equal TRIPLE_NOT_EQUAL // deep not equal LEFT_PAREN RIGHT_PAREN LEFT_CURLY_BRACE RIGHT_CURLY_BRACE QUESTION_MARK SEMI // SEMI: semi-colon (;) COLON COMMA // keywords LET CONST IF ELSE WHILE FOR IN BREAK SWITCH CASE DEFAULT INT_KEYWORD FLOAT_KEYWORD CHAR_KEYWORD BOOL_KEYWORD STRING_KEYWORD TRUE FALSE PRINT )
Click to show internal directories.
Click to hide internal directories.