Index: trunk/ab5.0/abdev/ab_common/include/Lexical/NativeCode.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/NativeCode.h	(revision 640)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/NativeCode.h	(revision 641)
@@ -244,5 +244,5 @@
 		return sourceLines;
 	}
-	void NextSourceLine( const SourceCodePosition &sourceCodePosition );
+	void NextSourceLine( const SourceCodePosition &sourceCodePosition, bool isInSystemProc );
 
 	void ResetDataSectionBaseOffset( long dataSectionBaseOffset );
Index: trunk/ab5.0/abdev/ab_common/include/Lexical/Procedure.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/Procedure.h	(revision 640)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/Procedure.h	(revision 641)
@@ -136,5 +136,5 @@
 	// 各種フラグ
 	bool isExport;
-	mutable bool isSystem;
+	mutable bool isAutoGenerationSystem;
 	mutable bool isAutoGeneration;
 	mutable bool isCompiled;
@@ -180,5 +180,5 @@
 		ar & BOOST_SERIALIZATION_NVP( realSecondParmNum );
 		ar & BOOST_SERIALIZATION_NVP( isExport );
-		ar & BOOST_SERIALIZATION_NVP( isSystem );
+		ar & BOOST_SERIALIZATION_NVP( isAutoGenerationSystem );
 		ar & BOOST_SERIALIZATION_NVP( isAutoGeneration );
 		ar & BOOST_SERIALIZATION_NVP( isCompiled );
@@ -275,11 +275,11 @@
 		return isExport;
 	}
-	void ThisIsSystemProc() const
-	{
-		isSystem = true;
-	}
-	bool IsSystem() const
-	{
-		return isSystem;
+	void ThisIsAutoGenerationSystemProc() const
+	{
+		isAutoGenerationSystem = true;
+	}
+	bool IsAutoGenerationSystem() const
+	{
+		return isAutoGenerationSystem;
 	}
 	void ThisIsAutoGenerationProc() const
@@ -291,4 +291,5 @@
 		return isAutoGeneration;
 	}
+	bool IsSystem() const;
 	void CompleteCompile() const
 	{
Index: trunk/ab5.0/abdev/ab_common/src/Lexical/NativeCode.cpp
===================================================================
--- trunk/ab5.0/abdev/ab_common/src/Lexical/NativeCode.cpp	(revision 640)
+++ trunk/ab5.0/abdev/ab_common/src/Lexical/NativeCode.cpp	(revision 641)
@@ -161,5 +161,5 @@
 }
 
-void NativeCode::NextSourceLine( const SourceCodePosition &sourceCodePosition )
+void NativeCode::NextSourceLine( const SourceCodePosition &sourceCodePosition, bool isInSystemProc )
 {
 	if( sourceLines.size() )
@@ -173,5 +173,4 @@
 
 	extern BOOL bDebugSupportProc;
-	extern BOOL bSystemProc;
 	DWORD sourceLineType = 0;
 	if( bDebugSupportProc )
@@ -179,5 +178,5 @@
 		sourceLineType |= CODETYPE_DEBUGPROC;
 	}
-	if( bSystemProc )
+	if( isInSystemProc )
 	{
 		sourceLineType |= CODETYPE_SYSTEMPROC;
Index: trunk/ab5.0/abdev/ab_common/src/Lexical/Procedure.cpp
===================================================================
--- trunk/ab5.0/abdev/ab_common/src/Lexical/Procedure.cpp	(revision 640)
+++ trunk/ab5.0/abdev/ab_common/src/Lexical/Procedure.cpp	(revision 641)
@@ -44,5 +44,5 @@
 	, realSecondParmNum( 1 )
 	, isExport( isExport )
-	, isSystem( false )
+	, isAutoGenerationSystem( false )
 	, isAutoGeneration( false )
 	, isCompiled( false )
@@ -65,5 +65,5 @@
 	, realSecondParmNum( userProc.realSecondParmNum )
 	, isExport( userProc.isExport )
-	, isSystem( userProc.isSystem )
+	, isAutoGenerationSystem( userProc.isAutoGenerationSystem )
 	, isAutoGeneration( userProc.isAutoGeneration )
 	, isCompiled( false )
@@ -138,4 +138,23 @@
 	return false;
 }
+bool UserProc::IsSystem() const
+{
+	// "_System_" を名前の先頭に含む関数
+	if( memcmp( this->GetName().c_str(), "_System_", 8 ) == 0 )
+	{
+		return true;
+	}
+
+	// "_System_" を名前の先頭に含むクラスのメソッド
+	if( this->HasParentClass() )
+	{
+		if( memcmp( this->GetParentClass().GetName().c_str(), "_System_", 8 ) == 0 )
+		{
+			return true;
+		}
+	}
+
+	return false;
+}
 const NamespaceScopes &UserProc::GetNamespaceScopes() const
 {
Index: trunk/ab5.0/abdev/ab_common/src/Lexical/Source.cpp
===================================================================
--- trunk/ab5.0/abdev/ab_common/src/Lexical/Source.cpp	(revision 640)
+++ trunk/ab5.0/abdev/ab_common/src/Lexical/Source.cpp	(revision 641)
@@ -900,5 +900,5 @@
 	}
 
-	if( includedFilesRelation.GetLineCounts() < i2 )
+	if( includedFilesRelation.GetLineCounts() <= i2 )
 	{
 		//Jenga::Throw( "BasicSource::GetLineInfoメソッドで不正な行の情報を取得しようとした" );
