enum Drizzle::TokenType

Overview

Enum of the various types of Tokens in the Drizzle language. This enum is used for the creation of Token instances, and will use its helper methods to help in the parsing stages also.

Defined in:

drizzle/token.cr

Enum Members

ILLEGAL = 0

Token is generated from a string that Drizzle does not recognise

EOL = 1

End of line token (usually ignored except for certain cases)

EOF = 2

End of file token

IDENTIFIER = 3

Name of variable, function, type, etc

INTEGER = 4

Integer literal

ASSIGN = 5

Assignment operator for assigning value to a variable

RETURN_TYPE = 6

Return type operator for specifying a functions return type

PLUS = 7

Addition operator for adding two values together

MINUS = 8

Subtraction operator for subtracting numbers. Also the unary negation operator.

ASTERISK = 9

Star operator used for multiplication, among other potential stuff later on too

SLASH = 10

Slash operator used for division

LT = 11

Less than logical operator

GT = 12

Greater than logical operator

EQ = 13

Equality logical operator

NOT_EQ = 14

Inequality logical operator

LT_EQ = 15

Less than or equal to

GT_EQ = 16

Greater than or equal to

COMMA = 17

Separating of items in a data structure / parameter list / etc.

COLON = 18

Separating of identifier from type in the case of variables and parameters

LEFT_PAREN = 19

Opening of parameter lists and tuples, and of general brackets

RIGHT_PAREN = 20

Closing of parameter lists and tuples, and of general brackets

LEFT_BRACE = 21

Opening of code blocks i.e. functions, as well as opening of set and dict literals

RIGHT_BRACE = 22

CLosing of code blocks i.e. functions, as well as closing of set and dict literals

LET = 23

Declaration of a variable

FUNCTION = 24

Definition of a function

RETURN = 25

Return value from a function

IF = 26

Conditional statement

ELSIF = 27

Elsif

ELSE = 28

Else

NOT = 29

Logical negation

TRUE = 30

True

FALSE = 31

False

Instance Method Summary

Instance Method Detail

def assign? #

[View source]
def asterisk? #

[View source]
def colon? #

[View source]
def comma? #

[View source]
def else? #

[View source]
def elsif? #

[View source]
def eof? #

[View source]
def eol? #

[View source]
def eq? #

[View source]
def false? #

[View source]
def function? #

[View source]
def gt? #

[View source]
def gt_eq? #

[View source]
def identifier? #

[View source]
def if? #

[View source]
def illegal? #

[View source]
def integer? #

[View source]
def left_brace? #

[View source]
def left_paren? #

[View source]
def let? #

[View source]
def lt? #

[View source]
def lt_eq? #

[View source]
def minus? #

[View source]
def not? #

[View source]
def not_eq? #

[View source]
def plus? #

[View source]
def return? #

[View source]
def return_type? #

[View source]
def right_brace? #

[View source]
def right_paren? #

[View source]
def slash? #

[View source]
def true? #

[View source]