/* ========================================================================== * ÀÛ ¼º ÀÚ : À̼ø±Ô * ÀÛ ¼º ÀÏ : 2007.02.21 * ³» ¿ë : ÅäÅ« * ÁÖÀÇ»çÇ× : *===========================================================================*/ #pragma once /// ÅäÅ« ŸÀÔ enum { eTOKEN_ERROR = -1, /// ¿¡·¯ eTOKEN_NULL = 0, /// ³Î eTOKEN_INT, /// Á¤¼ö eTOKEN_FLOAT, /// ½Ç¼ö eTOKEN_VAR, /// º¯¼ö eTOKEN_STR, /// ¹®ÀÚ¿­ eTOKEN_NOT, /// ! eTOKEN_SHARP, /// # eTOKEN_DOLLAR, /// $ eTOKEN_PERCENT, /// % eTOKEN_AND, /// & eTOKEN_LPAREN, /// ( eTOKEN_RPAREN, /// ) eTOKEN_MUL, /// * eTOKEN_PLUS, /// + eTOKEN_COMMA, /// , eTOKEN_DOT, /// . eTOKEN_DIV, /// / eTOKEN_COLON, /// : eTOKEN_SEMICOLON, /// ; eTOKEN_LANGLE, /// < eTOKEN_ASSIGN, /// = eTOKEN_RANGLE, /// > eTOKEN_QUESTION, /// ? eTOKEN_AT, /// @ eTOKEN_LSQUARE, /// [ eTOKEN_RSQUARE, /// ] eTOKEN_XOR, /// ^ eTOKEN_LCURLY, /// { eTOKEN_OR, /// | eTOKEN_RCURLY, /// } eTOKEN_TILD, /// ~ }; /// ÅäÅ« class cToken : public cString { public: cToken(); explicit cToken( int type ); cToken( int type, const char* str ); /// ´ëÀÔ ¿¬»êÀÚ void operator = ( const cString& str ); void operator = ( const char* str ); public: /// ŸÀÔ int mType; /// ÁÙ¹øÈ£ int mLine; }; inline cToken::cToken() : mType( eTOKEN_NULL ) , mLine( 0 ) { } inline cToken::cToken( int type ) : mType( type ) , mLine( 0 ) { } inline cToken::cToken( int type, const char* str ) : cString( str ) , mType( type ) , mLine( 0 ) { } inline void cToken::operator = ( const cString& str ) { *static_cast( this ) = str; } inline void cToken::operator = ( const char* str ) { *static_cast( this ) = str; } //-------------------------------------------------------- /// ÅäÅ« class cTokenW : public cStringW { public: cTokenW(); explicit cTokenW( int type ); cTokenW( int type, const wchar_t* str ); /// ´ëÀÔ ¿¬»êÀÚ void operator = ( const cStringW& str ); void operator = ( const wchar_t* str ); public: /// ŸÀÔ int mType; /// ÁÙ¹øÈ£ int mLine; }; inline cTokenW::cTokenW() : mType( eTOKEN_NULL ) , mLine( 0 ) { } inline cTokenW::cTokenW( int type ) : mType( type ) , mLine( 0 ) { } inline cTokenW::cTokenW( int type, const wchar_t* str ) : cStringW( str ) , mType( type ) , mLine( 0 ) { } inline void cTokenW::operator = ( const cStringW& str ) { *static_cast( this ) = str; } inline void cTokenW::operator = ( const wchar_t* str ) { *static_cast( this ) = str; }