#if !defined(_BASE_H)
#define _BASE_H

#include "PubHeader.h"
#include "otstr.h"


///////////////////////////////////////////////////////////////
#ifdef _DLL_PROJECT
class CLASS_EXPORT TObject
#else
class TObject
#endif
{
public:
    TObject();
    virtual ~TObject();
    
public:
    virtual void OnCreate ();
    virtual void OnDestroy();
    
    static  int  ObjectId()     { return 0; }
    virtual int  ObjectTypeId() { return 0; }
};

/////////////////////////////////////
#ifdef _DLL_PROJECT
class CLASS_EXPORT TName
#else
class TName
#endif
{
protected:
    OTSTR  m_strName;
    OTSTR  m_strDescription;
    
public:
    TName();
    virtual ~TName();
    
    void   setName(char* szName);
    OTSTR& getName();

    void   setDescription(char* szDescription);
    OTSTR& getDescription();
};

////////////////////////////////////////
#ifdef _DLL_PROJECT
class CLASS_EXPORT Location
#else
class Location
#endif
{
public:
    OTSTR   m_strFilename;
    long    m_nLocat;		        // locat
    long    m_nLine,m_nColumn;	    // col,row;
    
public:
    Location(char* szFilename=NULL,long nLocat=-1,long nLine=-1,long nColumn=-1);
    virtual ~Location();
    
    void setLocat(char* szFilename=NULL,long nLocat=-1,long nLine=-1,long nColumn=-1);
    void operator=(const Location& right);
    
    OTSTR DumpDetail(Location* pLocatOffset=NULL);  // Filename : Line_Column
    OTSTR Dump(Location* pLocatOffset=NULL);        // Filename : Line

    Location& MoveForward(Location& Offset);  
    Location  Offset(Location& Offset);  
    Location  Offset(long nOffset);  
};

////////////////////////////////////////
class TOKEN
{
public:

    enum 
    {
		INVALID       = -1,
        UNKNOW_CHAR   =  0,
        IDENT         =  1, 
		NUMBER_DEX    =  2,
        NUMBER_HEX    =  3,
        NUMBER_DOUBLE =  4,
        STRING        =  5,     // '...' »ò "..."
		KEYWORD       =  6, 
		OPERATOR      =  7, 
        NUMBER        =  9,     // DEX,HEX,DOUBLE
        VALUESET      =  8,     // { {...}, ...}  
        REMARKLINE    =  10,    // ÐÐ×¢ÊÍ
        REMARKS       =  11     // /* */ ×¢ÊÍ
    } ;
};

///////////////////////////////////////////////
class Waiter
{
public:
    Waiter() {}
    virtual ~Waiter() {}
    
    virtual int  wait_event(UINT EventID,long timeout_sec) { return 0; }  
    virtual bool proc_event(UINT EventID) { return false; }
    virtual void stop(int retn=-1) {}
    virtual bool Process_SysMessages() { return false; }
};


#endif
