00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef TA_LEX_H
00013 #define TA_LEX_H
00014
00015 #ifndef TA_TYPES_H
00016 #include "Types.h"
00017 #endif // TA_TYPES_H
00018
00019 #ifndef TA_COMMON_H
00020 #include "Common.h"
00021 #endif // TA_COMMON_H
00022
00023 namespace TA
00024 {
00025
00026 class TACOMMON_CLASS Lex
00027 {
00028 public:
00029 enum TokenType
00030 {
00031 TOKEN_TYPE_END_OF_FILE = 0,
00032 TOKEN_TYPE_NUMBER,
00033 TOKEN_TYPE_ALPHA,
00034 TOKEN_TYPE_SYMBOL,
00035 };
00036
00037 Lex();
00038 ~Lex();
00039
00040 void Initialise(const Char* szString);
00041 void Finalise();
00042
00043 TokenType GetTokenType();
00044 float GetTokenAsFloat();
00045 const Char* GetTokenAsString();
00046 int GetTokenLength();
00047 void Advance();
00048 int GetTotalLength();
00049
00050 private:
00051 Char* m_szString;
00052 TokenType m_eTokenType;
00053 const Char* m_szToken;
00054 static Char* m_szEmptyString;
00055 Char* m_szCurrentPos;
00056 int m_nTokenLength;
00057 int m_nTotalLength;
00058 };
00059
00060 };
00061
00062 #endif // TA_LEX_H
© Copyright 2004-2006 TRUE AXIS PTY LTD Australia. All rights reserved.