Index: trunk/abdev/BasicCompiler_Common/include/BoostSerializationSupport.h
===================================================================
--- trunk/abdev/BasicCompiler_Common/include/BoostSerializationSupport.h	(revision 278)
+++ trunk/abdev/BasicCompiler_Common/include/BoostSerializationSupport.h	(revision 279)
@@ -25,4 +25,6 @@
 	bool ReadXml( const std::string &xmlFilePath, bool isShowExceptionMessage = true );
 	bool WriteXml( const std::string &xmlFilePath, bool isShowExceptionMessage = true ) const;
+	bool ReadXmlString( const std::string &xmlString );
+	bool WriteXmlString( std::string &xmlString ) const;
 
 	bool ReadBinary( const std::string &filePath, bool isShowExceptionMessage = true );
Index: trunk/abdev/BasicCompiler_Common/include/Compiler.h
===================================================================
--- trunk/abdev/BasicCompiler_Common/include/Compiler.h	(revision 278)
+++ trunk/abdev/BasicCompiler_Common/include/Compiler.h	(revision 279)
@@ -46,7 +46,4 @@
 		return namespaceSupporter;
 	}
-
-	// ソースコード
-	BasicSource source;
 
 	// コード生成機構
Index: trunk/abdev/BasicCompiler_Common/include/DataTable.h
===================================================================
--- trunk/abdev/BasicCompiler_Common/include/DataTable.h	(revision 278)
+++ trunk/abdev/BasicCompiler_Common/include/DataTable.h	(revision 279)
@@ -28,12 +28,8 @@
 		for( int i=0; i<size; i++ )
 		{
-			if( _buffer[i*3+2] != ',' )
-			{
-				//エラー
-				DebugBreak();
-			}
-			ULONG_PTR l;
-			sscanf( _buffer.c_str() + i*3, "%02x,", &l );
-			buffer[i] = (char)l;
+			ULONG_PTR l1 = ( ( _buffer[i*3] >= 'a' ) ? ( _buffer[i*3] - 'a' + 0x0a ) : ( _buffer[i*3] - '0' ) ) * 0x10;
+			ULONG_PTR l2 = ( _buffer[i*3+1] >= 'a' ) ? ( _buffer[i*3+1] - 'a' + 0x0a ) : ( _buffer[i*3+1] - '0' );
+			ULONG_PTR l = l1 + l2;
+			buffer[i] = static_cast<char>(l);
 		}
 	}
Index: trunk/abdev/BasicCompiler_Common/include/NativeCode.h
===================================================================
--- trunk/abdev/BasicCompiler_Common/include/NativeCode.h	(revision 278)
+++ trunk/abdev/BasicCompiler_Common/include/NativeCode.h	(revision 279)
@@ -219,7 +219,8 @@
 		for( int i=0; i<size; i++ )
 		{
-			ULONG_PTR l;
-			sscanf( code.c_str() + i*3, "%02x,", &l );
-			codeBuffer[i] = (char)l;
+			ULONG_PTR l1 = ( ( code[i*3] >= 'a' ) ? ( code[i*3] - 'a' + 0x0a ) : ( code[i*3] - '0' ) ) * 0x10;
+			ULONG_PTR l2 = ( code[i*3+1] >= 'a' ) ? ( code[i*3+1] - 'a' + 0x0a ) : ( code[i*3+1] - '0' );
+			ULONG_PTR l = l1 + l2;
+			codeBuffer[i] = static_cast<char>(l);
 		}
 	}
Index: trunk/abdev/BasicCompiler_Common/include/ObjectModule.h
===================================================================
--- trunk/abdev/BasicCompiler_Common/include/ObjectModule.h	(revision 278)
+++ trunk/abdev/BasicCompiler_Common/include/ObjectModule.h	(revision 279)
@@ -12,4 +12,7 @@
 	// データテーブル
 	DataTable dataTable;
+
+	// ソースコード
+	BasicSource source;
 
 	// XMLシリアライズ用
@@ -27,8 +30,14 @@
 		ar & BOOST_SERIALIZATION_NVP( globalNativeCode );
 		ar & BOOST_SERIALIZATION_NVP( dataTable );
+		ar & BOOST_SERIALIZATION_NVP( source );
 	}
 
 public:
 	void StaticLink( ObjectModule &objectModule );
+
+	bool Read( const std::string &filePath );
+	bool Write( const std::string &filePath ) const;
+	bool ReadString( const std::string &str );
+	bool WriteString( std::string &str ) const;
 };
 typedef std::vector<ObjectModule *> ObjectModules;
Index: trunk/abdev/BasicCompiler_Common/include/Source.h
===================================================================
--- trunk/abdev/BasicCompiler_Common/include/Source.h	(revision 278)
+++ trunk/abdev/BasicCompiler_Common/include/Source.h	(revision 279)
@@ -18,4 +18,61 @@
 	int FilesNum;
 	int LineOfFile[MAX_LEN];
+};
+
+class IncludedFilesRelation
+{
+	std::vector<std::string> filePaths;
+	std::vector<int> lineFileNumbers;
+
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		trace_for_serialize( "serializing - IncludedFilesRelation" );
+
+		ar & BOOST_SERIALIZATION_NVP( filePaths );
+		ar & BOOST_SERIALIZATION_NVP( lineFileNumbers );
+	}
+
+public:
+	IncludedFilesRelation()
+	{
+	}
+	~IncludedFilesRelation()
+	{
+	}
+
+	const int GetFileNumber( int lineNumber ) const
+	{
+		return lineFileNumbers[lineNumber];
+	}
+	const std::string &GetFilePath( int lineNumber ) const
+	{
+		return filePaths[GetFileNumber( lineNumber )];
+	}
+	const std::string &GetFilePathFromFileNumber( int fileNumber ) const
+	{
+		return filePaths[fileNumber];
+	}
+	int GetFileCounts() const
+	{
+		return filePaths.size();
+	}
+
+	int AddFile( const std::string &filePath )
+	{
+		filePaths.push_back( filePath );
+		return filePaths.size()-1;
+	}
+	void AddLine( int fileNumber )
+	{
+		lineFileNumbers.push_back( fileNumber );
+	}
+
+	int GetLineCounts() const
+	{
+		return lineFileNumbers.size();
+	}
 };
 
@@ -66,4 +123,54 @@
 	static const string generateDirectiveName;
 
+	IncludedFilesRelation includedFilesRelation;
+
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	BOOST_SERIALIZATION_SPLIT_MEMBER();
+	template<class Archive> void load(Archive& ar, const unsigned int version)
+	{
+		trace_for_serialize( "serializing(load) - BasicSource" );
+
+		std::string _buffer;
+		ar & BOOST_SERIALIZATION_NVP( _buffer );
+		ar & BOOST_SERIALIZATION_NVP( length );
+		ar & BOOST_SERIALIZATION_NVP( includedFilesRelation );
+
+		// 読み込み後の処理
+		Realloc( length );
+		for( int i=0; i<length; i++ )
+		{
+			ULONG_PTR l1 = ( ( _buffer[i*3] >= 'a' ) ? ( _buffer[i*3] - 'a' + 0x0a ) : ( _buffer[i*3] - '0' ) ) * 0x10;
+			ULONG_PTR l2 = ( _buffer[i*3+1] >= 'a' ) ? ( _buffer[i*3+1] - 'a' + 0x0a ) : ( _buffer[i*3+1] - '0' );
+			ULONG_PTR l = l1 + l2;
+			buffer[i] = static_cast<char>(l);
+		}
+		buffer[length] = 0;
+	}
+	template<class Archive> void save(Archive& ar, const unsigned int version) const
+	{
+		trace_for_serialize( "serializing(save) - BasicSource" );
+
+		// 保存準備
+		char *tempCode = (char *)calloc( (length+1) * 3, 1 );
+		for( int i=0; i<length; i++ )
+		{
+			char temp[32];
+			sprintf( temp, "%02x,", (unsigned char)buffer[i] );
+			tempCode[i*3] = temp[0];
+			tempCode[i*3+1] = temp[1];
+			tempCode[i*3+2] = temp[2];
+		}
+
+		std::string _buffer = tempCode;
+		free( tempCode );
+
+		ar & BOOST_SERIALIZATION_NVP( _buffer );
+		ar & BOOST_SERIALIZATION_NVP( length );
+		ar & BOOST_SERIALIZATION_NVP( includedFilesRelation );
+	}
+
+private:
 	void Realloc( int newLength ){
 		buffer = (char *)realloc( buffer, newLength + 255 );
@@ -102,4 +209,9 @@
 	}
 
+	const IncludedFilesRelation &GetIncludedFilesRelation() const
+	{
+		return includedFilesRelation;
+	}
+
 	void SetBuffer( const char *buffer );
 
@@ -109,4 +221,6 @@
 
 	void Addition( const char *buffer );
+
+	bool GetLineInfo( int sourceCodePos, int &line, std::string &fileName );
 
 	void operator = ( const BasicSource &source ){
