Changeset 280 in dev for trunk/abdev/BasicCompiler_Common/include
- Timestamp:
- Aug 14, 2007, 8:37:08 AM (17 years ago)
- Location:
- trunk/abdev/BasicCompiler_Common/include
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler_Common/include/Meta.h
r273 r280 75 75 76 76 // 静的リンク 77 void StaticLink( Meta &meta, long dataSectionBaseOffset );77 void StaticLink( Meta &meta, long dataSectionBaseOffset, int sourceIndexBase ); 78 78 79 79 const NamespaceScopesCollection &GetNamespaces() const -
trunk/abdev/BasicCompiler_Common/include/NativeCode.h
r279 r280 130 130 int lineNum; 131 131 long nativeCodePos; 132 int sourceIndex; 132 133 long sourceCodePos; 133 134 DWORD codeType; … … 142 143 ar & BOOST_SERIALIZATION_NVP( lineNum ); 143 144 ar & BOOST_SERIALIZATION_NVP( nativeCodePos ); 145 ar & BOOST_SERIALIZATION_NVP( sourceIndex ); 144 146 ar & BOOST_SERIALIZATION_NVP( sourceCodePos ); 145 147 ar & BOOST_SERIALIZATION_NVP( codeType ); … … 147 149 148 150 public: 149 SourceLine( int lineNum, int nativeCodePos, int source CodePos, DWORD codeType )151 SourceLine( int lineNum, int nativeCodePos, int sourceIndex, int sourceCodePos, DWORD codeType ) 150 152 : lineNum( lineNum ) 151 153 , nativeCodePos( nativeCodePos ) 154 , sourceIndex( sourceIndex ) 152 155 , sourceCodePos( sourceCodePos ) 153 156 , codeType( codeType ) … … 165 168 { 166 169 return nativeCodePos; 170 } 171 int GetSourceIndex() const 172 { 173 return sourceIndex; 174 } 175 void SetSourceIndex( int sourceIndex ) 176 { 177 this->sourceIndex = sourceIndex; 167 178 } 168 179 long GetSourceCodePos() const … … 366 377 367 378 void ResetDataSectionBaseOffset( long dataSectionBaseOffset ); 379 void ResetSourceIndexes( long sourceIndexBase ); 368 380 }; -
trunk/abdev/BasicCompiler_Common/include/ObjectModule.h
r279 r280 13 13 DataTable dataTable; 14 14 15 private: 15 16 // ソースコード 16 BasicSource source; 17 int currentSourceIndex; 18 BasicSources sources; 17 19 18 20 // XMLシリアライズ用 … … 30 32 ar & BOOST_SERIALIZATION_NVP( globalNativeCode ); 31 33 ar & BOOST_SERIALIZATION_NVP( dataTable ); 32 ar & BOOST_SERIALIZATION_NVP( source ); 34 ar & BOOST_SERIALIZATION_NVP( currentSourceIndex ); 35 ar & BOOST_SERIALIZATION_NVP( sources ); 33 36 } 34 37 35 38 public: 36 39 void StaticLink( ObjectModule &objectModule ); 40 41 int GetCurrentSourceIndex() const 42 { 43 return currentSourceIndex; 44 } 45 const BasicSource &GetCurrentSource() const 46 { 47 return sources[currentSourceIndex]; 48 } 49 BasicSource &GetCurrentSource() 50 { 51 return sources[currentSourceIndex]; 52 } 53 void SetCurrentSourceIndex( int currentSourceIndex ) 54 { 55 this->currentSourceIndex = currentSourceIndex; 56 } 57 const BasicSource &GetSource( int sourceIndex ) const 58 { 59 return sources[sourceIndex]; 60 } 61 BasicSources &GetSources() 62 { 63 return sources; 64 } 37 65 38 66 bool Read( const std::string &filePath ); -
trunk/abdev/BasicCompiler_Common/include/Source.h
r279 r280 11 11 12 12 #include <BoostSerializationSupport.h> 13 14 using namespace std;15 16 struct INCLUDEFILEINFO{17 char **ppFileNames;18 int FilesNum;19 int LineOfFile[MAX_LEN];20 };21 13 22 14 class IncludedFilesRelation … … 87 79 buffer = (char *)calloc( 1, 1 ); 88 80 length = 0; 81 } 82 Text( const Text &text ) 83 : length( text.length ) 84 { 85 buffer = (char *)malloc( length + 1 ); 86 memcpy( buffer, text.buffer, length ); 87 buffer[length] = 0; 89 88 } 90 89 ~Text(){ … … 195 194 public: 196 195 BasicSource(){} 196 BasicSource( const BasicSource &basicSource ) 197 : Text( basicSource ) 198 , includedFilesRelation( basicSource.includedFilesRelation ) 199 { 200 } 197 201 ~BasicSource(){} 198 202 … … 222 226 void Addition( const char *buffer ); 223 227 224 bool GetLineInfo( int sourceCodePos, int &line, std::string &fileName ) ;228 bool GetLineInfo( int sourceCodePos, int &line, std::string &fileName ) const; 225 229 226 230 void operator = ( const BasicSource &source ){ … … 238 242 } 239 243 }; 244 typedef std::vector<BasicSource> BasicSources;
Note:
See TracChangeset
for help on using the changeset viewer.