enum TOKENTYPE{ TOKEN_IDENTIFIER, //識別子 TOKEN_NUMBER, //数値 TOKEN_STRING, //文字列 TOKEN_EXSTRING, //文字列 TOKEN_OPERATOR, //演算子 TOKEN_ESCAPESEQUENCE, //特殊記号 TOKEN_COMMAND, //コマンド TOKEN_DELIMITATION, //ステップ区切り }; class CToken{ int pos; int length; TOKENTYPE type; int extended; public: CToken(int pos, int length, TOKENTYPE type, int extended); ~CToken(); }; class CSource{ //トークン CToken **ppTokens; int TokenNum; CSource(); ~CSource(); void Free(); void Init(); public: //ソースコードを格納するバッファ char *SourceCode; bool OpenFile(char *FileName); void SetSourceCode(char *source); void AddSourceCode(char *source); private: void AddToken(int pos, int length, TOKENTYPE type, int extended); public: void LexicalAnalysis(int StartPos); //シングルトンオブジェクト static CSource obj; };