Mon 16 Mar 11:09:06 CET 2026
This commit is contained in:
parent
1d76b0bad0
commit
0ce3ca9e74
81
src/tokens.h
Normal file
81
src/tokens.h
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
#ifndef _TOKENS_H
|
||||
#define _TOKENS_H
|
||||
|
||||
typedef enum {
|
||||
// compound keyqwords
|
||||
TNUMBER = -127,
|
||||
TCHAR, // 'X'
|
||||
TSTRING, // "string"
|
||||
TIDENTIFIER, // any identifier not being a keyword (variable, function, ...)
|
||||
TVARDEF, // var x,y,z
|
||||
TERROR, // lexer failed, syntax error
|
||||
TCCALL,
|
||||
|
||||
TAND,
|
||||
TOR,
|
||||
TGEQ,
|
||||
TLEQ,
|
||||
TMODULO,
|
||||
TNOT,
|
||||
TNEG,
|
||||
TNEQ,
|
||||
|
||||
TAWAIT,
|
||||
TBREAK,
|
||||
TCALL,
|
||||
TCONST,
|
||||
TCONTINUE,
|
||||
TDATA,
|
||||
TDELAY,
|
||||
TDO,
|
||||
TELSE,
|
||||
TEND,
|
||||
TEVENT,
|
||||
TFOR,
|
||||
TFORK,
|
||||
TFUNC,
|
||||
TGO,
|
||||
#if HAS_LOCK > 0
|
||||
TLOCK,
|
||||
#endif
|
||||
TIF,
|
||||
TON,
|
||||
TPROC,
|
||||
TREM,
|
||||
TREPEAT,
|
||||
TRETURN,
|
||||
TSTART,
|
||||
TSTOP,
|
||||
TTHEN,
|
||||
#if HAS_LOCK > 0
|
||||
TUNLOCK,
|
||||
#endif
|
||||
TWAKEUP,
|
||||
TWHILE,
|
||||
TYIELD,
|
||||
|
||||
EOL=0,
|
||||
|
||||
// Single character tokens ("keywords")
|
||||
TADD = '+',
|
||||
TBLOCK1 = '{',
|
||||
TBLOCK2 = '}',
|
||||
TDIV = '/',
|
||||
TEQUAL = '=',
|
||||
TGT = '>',
|
||||
THANDLE = '&',
|
||||
TINPUT = '?',
|
||||
TLPAR = '(',
|
||||
TLT = '<',
|
||||
TMUL = '*',
|
||||
TNEXTARG = ',',
|
||||
TOUTPUT = '!',
|
||||
TRPAR = ')',
|
||||
TSEPARATOR = ':',
|
||||
TDOLLAR = '$',
|
||||
TSUB = '-'
|
||||
|
||||
|
||||
} tokens_t;
|
||||
|
||||
#endif
|
||||
Loading…
Reference in New Issue
Block a user