Changeset 75 in dev for BasicCompiler_Common/Type.h
- Timestamp:
- Mar 20, 2007, 4:36:16 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler_Common/Type.h
r73 r75 1 #pragma once 1 2 2 #ifndef _ACTIVEBASIC_COMPILER_TYPE_H 3 #define _ACTIVEBASIC_COMPILER_TYPE_H 3 class CClass; 4 4 5 5 class Type{ … … 18 18 static bool StringToBasicType( const string &typeName, int &basicType ); 19 19 static bool StringToType( const string &typeName, Type &type ); 20 static int GetBasicSize( int basicType ); 20 21 21 22 Type(): … … 30 31 index( index ){} 31 32 32 Type( int basicType, CClass &objClass ):33 Type( int basicType, const CClass &objClass ): 33 34 basicType( basicType ), 34 35 index( (LONG_PTR)&objClass ){} … … 38 39 index( type.index ){} 39 40 40 int GetBasicType() const41 __inline int GetBasicType() const 41 42 { 42 #ifdef _DEBUG43 if( basicType<-10000 ){44 DebugBreak();45 }46 #endif47 43 return basicType; 48 44 } … … 64 60 void SetNull(){ 65 61 SetBasicType( DEF_NON ); 62 SetIndex( -1 ); 66 63 } 67 64 void SetType( int basicType, LONG_PTR index ){ … … 74 71 } 75 72 73 int PtrLevel() const 74 { 75 return PTR_LEVEL( basicType ); 76 } 76 77 void PtrLevelUp(){ 77 78 PTR_LEVEL_UP( basicType ); 79 } 80 void PtrLevelDown(){ 81 PTR_LEVEL_DOWN( basicType ); 78 82 } 79 83 80 84 bool Equals( const Type &type ) const; 81 85 86 int GetBasicSize() const; 87 int GetSize() const; 88 82 89 bool IsNull() const; 90 91 bool IsByte() const; 92 bool IsSByte() const; 93 bool IsWord() const; 94 bool IsInteger() const; 95 bool IsDWord() const; 96 bool IsLong() const; 97 bool IsQWord() const; 98 bool IsInt64() const; 99 bool IsSingle() const; 100 bool IsDouble() const; 101 bool IsBoolean() const; 102 83 103 bool IsPointer() const; 84 104 bool IsSigned() const; … … 89 109 bool IsProcPtr() const; 90 110 bool IsStruct() const; 111 bool IsStructPtr() const; 112 bool IsObject() const; 113 bool IsObjectPtr() const; 114 bool IsStringObject() const; 115 bool IsVoidPtr() const; 116 bool IsAny() const; 91 117 118 const string ToString() const; 119 120 void operator= ( const Type &type ){ 121 basicType = type.basicType; 122 index = type.index; 123 } 92 124 }; 93 94 #endif //_ACTIVEBASIC_COMPILER_TYPE_H
Note:
See TracChangeset
for help on using the changeset viewer.