Changeset 7 in dev for BasicCompiler_Common/Const.h


Ignore:
Timestamp:
Dec 7, 2006, 3:09:44 AM (17 years ago)
Author:
dai_9181
Message:

Constステートメントで定数変数を宣言できるように改良。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BasicCompiler_Common/Const.h

    r5 r7  
    99    CConstBase(char *Name);
    1010    ~CConstBase();
     11
     12    char *GetName();
    1113};
    1214
     
    1517    int Type;
    1618    _int64 i64data;
     19
    1720public:
     21    CConst *pNext;
    1822
    19     CConst(char *Name, char *Expression);
     23    CConst(char *Name, int Type, _int64 i64data);
     24    CConst(char *Name, int value);
    2025    ~CConst();
     26
     27    int GetType();
     28    _int64 GetWholeData();
     29    double GetDoubleData();
    2130};
    2231
     
    3342//定数管理クラス
    3443class CDBConst{
    35     CConst **ppobj_Const;
    36     int NumOfConst;
     44    CConst **ppHash;
    3745
    3846    CConstMacro **ppobj_Macro;
    3947    int NumOfMacro;
     48
     49    //シングルトンクラスなので、プライベートに置く
     50    CDBConst();
     51    ~CDBConst();
     52    void _free();
     53    void Free();
     54
    4055public:
    4156
    42     CDBConst();
    43     ~CDBConst();
     57    void Init();
    4458
    4559    void Add(char *buffer);
     60private:
     61    void AddConst(char *Name, CConst *newconst);
     62public:
     63    void AddConst(char *Name, char *Expression);
     64    void AddConst(char *Name, int value);
    4665
    47     void AddConst(char *Name, char *Expression);
     66private:
     67    CConst *GetObjectPtr(char *Name);
     68public:
     69
     70    int GetType(char *Name);
     71    _int64 GetWholeData(char *Name);
     72    double GetDoubleData(char *Name);
     73
     74
     75    //シングルトンオブジェクト
     76    static CDBConst obj;
    4877};
Note: See TracChangeset for help on using the changeset viewer.