跳转到内容

用户:Antigng/AF/AFTokenizer.h

维基百科,自由的百科全书
enum _AFTokenType
{
	T_NONE,
	T_ID,
	T_KEYWORD,
	T_STRING,
	T_INT,
	T_FLOAT,
	T_OP,
	T_BRA,
	T_KET,
	T_SQUARE_BRA,
	T_SQUARE_KET,
	T_COMMA,
	T_STATEMENT_SEPARATOR
};
enum _AFOpType
{
	O_NOT,
	O_INEQ,
	O_SINEQ,
	O_MUL,
	O_EXP,
	O_PLUS,
	O_MINUS,
	O_DIV,
	O_REM,
	O_AND,
	O_OR,
	O_XOR,
	O_SET,
	O_TER_Q,
	O_TER_S,
	O_L,
	O_LE,
	O_G,
	O_GE,
	O_EQ,
	O_SEQ
};
enum _AFKeywordType
{
	K_like,
	K_in,
	K_contains,
	K_rlike,
	K_irlike,
	K_if,
	K_then,
	K_else,
	K_end,
	K_true,
	K_false,
	K_null
};
struct _AFToken
{
	enum _AFTokenType type;
	union _valueComb
	{
		enum _AFKeywordType key;
		enum _AFOpType op;
		int i;
		double f;
		struct _str
		{
			char *begin;
			int offset;
			unsigned int hash;
		} s;
	} value;
};
int AFGetNextToken(struct _AFToken *tok_p);
void AFTokenizerIni();
void AFTokenizerReset(const char *source,unsigned int source_len);