rendered paste body#ifndef SW_TOKEN_TYPES#define SW_TOKEN_TYPEStypedef enum { SW_TOKEN_UNKNOWN=0, /* These are the core types, advanced types such as lists/dicts contain these core types (among other things). */ SW_TOKEN_STRING_LITERAL,/* using ', ", """, or ''' */ SW_TOKEN_INTEGER, /* 0-9+ */ SW_TOKEN_FLOAT, /* 0-9.(0-9)* */ SW_TOKEN_BOOL_TRUE, /* true */ SW_TOKEN_BOOL_FALSE, /* false */ SW_TOKEN_CONST, /* const */ SW_TOKEN_MY, /* my */ /* Symbols/Identifiers */ SW_TOKEN_PROCEDURE, /* => */ SW_TOKEN_IDENTIFIER, /* variables, functions, etc. */ SW_TOKEN_RELATE, /* -> */ SW_TOKEN_DO, /* do: ... , */ SW_TOKEN_WHILE, /* while ...: ... ; */ SW_TOKEN_FOR, /* for ...: ... ; */ SW_TOKEN_RETURN, /* return ... */ SW_TOKEN_CONT, /* continue */ SW_TOKEN_BREAK, /* break */ /* General symbols that can be ambiguous */ SW_TOKEN_COLON, /* : */ SW_TOKEN_SEMICOLON, /* ; */ SW_TOKEN_PERIOD, /* . */ SW_TOKEN_COMMA, /* , */ SW_TOKEN_SET, /* = */ SW_TOKEN_JOIN, /* _ */ SW_TOKEN_MORE_ARGS, /* ... */ SW_TOKEN_RANGE, /* .. */ /* Operators */ SW_TOKEN_NOT, /* ! */ SW_TOKEN_IS, /* is */ SW_TOKEN_EQUALS, /* == */ SW_TOKEN_IN, /* in */ SW_TOKEN_NOT_EQUALS, /* != */ SW_TOKEN_LOGICAL_AND, /* && */ SW_TOKEN_LOGICAL_OR, /* || */ SW_TOKEN_LOGICAL_XOR, /* ^^ */ SW_TOKEN_LT, /* < */ SW_TOKEN_GT, /* > */ SW_TOKEN_LT_EQUAL, /* <= */ SW_TOKEN_GT_EQUAL, /* >= */ SW_TOKEN_ADD, /* + */ SW_TOKEN_SUBTRACT, /* - */ SW_TOKEN_DIVIDE, /* / */ SW_TOKEN_MULTIPLY, /* * */ SW_TOKEN_EXPONENT, /* ** */ SW_TOKEN_MODULO, /* % */ /* Parens/brackets/braces */ SW_TOKEN_PAREN_OPEN, /* ( */ SW_TOKEN_PAREN_CLOSE, /* ) */ SW_TOKEN_BRACKET_OPEN, /* [ */ SW_TOKEN_BRACKET_CLOSE, /* ] */ SW_TOKEN_BRACE_OPEN, /* { */ SW_TOKEN_BRACE_CLOSE, /* } */ /* Bitwise operators */ SW_TOKEN_BIT_OR, /* | */ SW_TOKEN_BIT_XOR, /* ^ */ SW_TOKEN_BIT_AND, /* & */ SW_TOKEN_BIT_LSHIFT, /* << */ SW_TOKEN_BIT_RSHIFT, /* >> */ SW_TOKEN_BIT_COMPLEMENT, /* ~ */ /* Type casts */ SW_TOKEN_TYPE_DICT, /* dict */ SW_TOKEN_TYPE_LIST, /* list */ SW_TOKEN_TYPE_INT, /* int */ SW_TOKEN_TYPE_FLOAT /* float */} SwSymbol;typedef struct { SwSymbol symbol; char *value;} SwToken;typedef struct { SwToken *token; char *stream; int pos; /* current position in the stream */ int len; /* length of character stream */} SwTokenBuffer;#endif