enum CatspeakToken
GameMaker Language (.gml)Copyenum CatspeakToken {
PAREN_LEFT,
PAREN_RIGHT,
BOX_LEFT,
BOX_RIGHT,
BRACE_LEFT,
BRACE_RIGHT,
COLON,
SEMICOLON,
COMMA,
DOT,
ARROW,
ASSIGN,
ASSIGN_MULTIPLY,
ASSIGN_DIVIDE,
ASSIGN_SUBTRACT,
ASSIGN_PLUS,
REMAINDER,
MULTIPLY,
DIVIDE,
DIVIDE_INT,
SUBTRACT,
PLUS,
EQUAL,
NOT_EQUAL,
GREATER,
GREATER_EQUAL,
LESS,
LESS_EQUAL,
NOT,
BITWISE_NOT,
SHIFT_RIGHT,
SHIFT_LEFT,
BITWISE_AND,
BITWISE_XOR,
BITWISE_OR,
AND,
OR,
XOR,
PIPE_RIGHT,
PIPE_LEFT,
DO,
IF,
ELSE,
CATCH,
WHILE,
FOR,
LOOP,
WITH,
MATCH,
LET,
FUN,
BREAK,
CONTINUE,
RETURN,
THROW,
NEW,
IMPL,
SELF,
PARAMS,
PARAMS_COUNT,
IDENT,
VALUE,
WHITESPACE,
COMMENT,
EOF,
OTHER,
// 3 fields omitted
}
A token in Catspeak is a series of characters with meaning, usually
separated by whitespace. These meanings are represented by unique
elements of the CatspeakToken
enum.
Example
Some examples of tokens in Catspeak, and their meanings:
if
(is aCatspeakToken.IF
)else
(is aCatspeakToken.ELSE
)12.3
(is aCatspeakToken.VALUE
)+
(is aCatspeakToken.PLUS
)
§ PAREN_LEFTtop ^
GameMaker Language (.gml)CopyPAREN_LEFT
The (
character.
§ PAREN_RIGHTtop ^
GameMaker Language (.gml)CopyPAREN_RIGHT
The )
character.
§ BOX_LEFTtop ^
GameMaker Language (.gml)CopyBOX_LEFT
The [
character.
§ BOX_RIGHTtop ^
GameMaker Language (.gml)CopyBOX_RIGHT
The ]
character.
§ BRACE_LEFTtop ^
GameMaker Language (.gml)CopyBRACE_LEFT
The {
character.
§ BRACE_RIGHTtop ^
GameMaker Language (.gml)CopyBRACE_RIGHT
The }
character.
§ COLONtop ^
GameMaker Language (.gml)CopyCOLON
The :
character.
§ SEMICOLONtop ^
GameMaker Language (.gml)CopySEMICOLON
The ;
character.
§ COMMAtop ^
GameMaker Language (.gml)CopyCOMMA
The ,
character.
§ DOTtop ^
GameMaker Language (.gml)CopyDOT
The .
operator.
§ ARROWtop ^
GameMaker Language (.gml)CopyARROW
The =>
operator.
§ ASSIGNtop ^
GameMaker Language (.gml)CopyASSIGN
The =
operator.
§ ASSIGN_MULTIPLYtop ^
GameMaker Language (.gml)CopyASSIGN_MULTIPLY
The *=
operator.
§ ASSIGN_DIVIDEtop ^
GameMaker Language (.gml)CopyASSIGN_DIVIDE
The /=
operator.
§ ASSIGN_SUBTRACTtop ^
GameMaker Language (.gml)CopyASSIGN_SUBTRACT
The -=
operator.
§ ASSIGN_PLUStop ^
GameMaker Language (.gml)CopyASSIGN_PLUS
The +=
operator.
§ REMAINDERtop ^
GameMaker Language (.gml)CopyREMAINDER
The remainder %
operator.
§ MULTIPLYtop ^
GameMaker Language (.gml)CopyMULTIPLY
The *
operator.
§ DIVIDEtop ^
GameMaker Language (.gml)CopyDIVIDE
The /
operator.
§ DIVIDE_INTtop ^
GameMaker Language (.gml)CopyDIVIDE_INT
The integer division //
operator.
§ SUBTRACTtop ^
GameMaker Language (.gml)CopySUBTRACT
The -
operator.
§ PLUStop ^
GameMaker Language (.gml)CopyPLUS
The +
operator.
§ EQUALtop ^
GameMaker Language (.gml)CopyEQUAL
The relational ==
operator.
§ NOT_EQUALtop ^
GameMaker Language (.gml)CopyNOT_EQUAL
The relational !=
operator.
§ GREATERtop ^
GameMaker Language (.gml)CopyGREATER
The relational >
operator.
§ GREATER_EQUALtop ^
GameMaker Language (.gml)CopyGREATER_EQUAL
The relational >=
operator.
§ LESStop ^
GameMaker Language (.gml)CopyLESS
The relational <
operator.
§ LESS_EQUALtop ^
GameMaker Language (.gml)CopyLESS_EQUAL
The relational <=
operator.
§ NOTtop ^
GameMaker Language (.gml)CopyNOT
The logical negation !
operator.
§ BITWISE_NOTtop ^
GameMaker Language (.gml)CopyBITWISE_NOT
The bitwise negation ~
operator.
§ SHIFT_RIGHTtop ^
GameMaker Language (.gml)CopySHIFT_RIGHT
The bitwise right shift >>
operator.
§ SHIFT_LEFTtop ^
GameMaker Language (.gml)CopySHIFT_LEFT
The bitwise left shift <<
operator.
§ BITWISE_ANDtop ^
GameMaker Language (.gml)CopyBITWISE_AND
The bitwise and &
operator.
§ BITWISE_XORtop ^
GameMaker Language (.gml)CopyBITWISE_XOR
The bitwise xor ^
operator.
§ BITWISE_ORtop ^
GameMaker Language (.gml)CopyBITWISE_OR
The bitwise or |
operator.
§ ANDtop ^
GameMaker Language (.gml)CopyAND
The logical and
operator.
§ ORtop ^
GameMaker Language (.gml)CopyOR
The logical or
operator.
§ XORtop ^
GameMaker Language (.gml)CopyXOR
The logical xor
operator.
§ PIPE_RIGHTtop ^
GameMaker Language (.gml)CopyPIPE_RIGHT
The functional pipe right |>
operator.
§ PIPE_LEFTtop ^
GameMaker Language (.gml)CopyPIPE_LEFT
The functional pipe left <|
operator.
§ DOtop ^
GameMaker Language (.gml)CopyDO
The do
keyword.
§ IFtop ^
GameMaker Language (.gml)CopyIF
The if
keyword.
§ ELSEtop ^
GameMaker Language (.gml)CopyELSE
The else
keyword.
§ CATCHtop ^
GameMaker Language (.gml)CopyCATCH
The catch
keyword.
§ WHILEtop ^
GameMaker Language (.gml)CopyWHILE
The while
keyword.
§ FORtop ^
GameMaker Language (.gml)CopyFOR
🔬 This is an experimental feature. It may change at any moment.
The for
keyword.
§ LOOPtop ^
GameMaker Language (.gml)CopyLOOP
🔬 This is an experimental feature. It may change at any moment.
The loop
keyword.
§ WITHtop ^
GameMaker Language (.gml)CopyWITH
🔬 This is an experimental feature. It may change at any moment.
The with
keyword.
§ MATCHtop ^
GameMaker Language (.gml)CopyMATCH
🔬 This is an experimental feature. It may change at any moment.
The match
keyword.
§ LETtop ^
GameMaker Language (.gml)CopyLET
The let
keyword.
§ FUNtop ^
GameMaker Language (.gml)CopyFUN
The fun
keyword.
§ BREAKtop ^
GameMaker Language (.gml)CopyBREAK
The break
keyword.
§ CONTINUEtop ^
GameMaker Language (.gml)CopyCONTINUE
The continue
keyword.
§ RETURNtop ^
GameMaker Language (.gml)CopyRETURN
The return
keyword.
§ THROWtop ^
GameMaker Language (.gml)CopyTHROW
The throw
keyword.
§ NEWtop ^
GameMaker Language (.gml)CopyNEW
The new
keyword.
§ IMPLtop ^
GameMaker Language (.gml)CopyIMPL
🔬 This is an experimental feature. It may change at any moment.
The impl
keyword.
§ SELFtop ^
GameMaker Language (.gml)CopySELF
🔬 This is an experimental feature. It may change at any moment.
The self
keyword.
§ PARAMStop ^
GameMaker Language (.gml)CopyPARAMS
🔬 This is an experimental feature. It may change at any moment.
The params
keyword.
§ PARAMS_COUNTtop ^
GameMaker Language (.gml)CopyPARAMS_COUNT
🔬 This is an experimental feature. It may change at any moment.
The params_count
keyword.
§ IDENTtop ^
GameMaker Language (.gml)CopyIDENT
Represents a variable name.
§ VALUEtop ^
GameMaker Language (.gml)CopyVALUE
Represents a GML value. This could be one of:
string literal:
"hello world"
verbatim literal:
@"\(0_0)/ no escapes!"
integer:
1
,2
,5
float:
1.25
,0.5
character:
'A'
,'0'
,'\n'
boolean:
true
orfalse
undefined
§ WHITESPACEtop ^
GameMaker Language (.gml)CopyWHITESPACE
Represents a sequence of non-breaking whitespace characters.
§ COMMENTtop ^
GameMaker Language (.gml)CopyCOMMENT
Represents a comment.
§ EOFtop ^
GameMaker Language (.gml)CopyEOF
Represents the end of the file.
§ OTHERtop ^
GameMaker Language (.gml)CopyOTHER
Represents any other unrecognised character.
📝 NoteIf the compiler encounters a token of this type, it will typically raise an exception. This likely indicates that a Catspeak script has a syntax error somewhere.