Index: trunk/ab5.0/abdev/ab_common/include/Lexical/Class.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/Class.h	(revision 622)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/Class.h	(revision 632)
@@ -2,5 +2,7 @@
 
 class UserProc;
+class UserProcs;
 class Delegate;
+class Classes;
 
 class ClassPrototype : public Prototype, public DynamicMethodsPrototype
@@ -78,4 +80,7 @@
 	//アラインメント値
 	int fixedAlignment;
+
+public:
+	ActiveBasic::Common::Lexical::ExpandedTemplateClasses expandedTemplateClasses;
 
 	// XMLシリアライズ用
@@ -101,4 +106,5 @@
 		ar & BOOST_SERIALIZATION_NVP( staticMethods );
 		ar & BOOST_SERIALIZATION_NVP( fixedAlignment );
+		ar & BOOST_SERIALIZATION_NVP( expandedTemplateClasses );
 	}
 
@@ -106,60 +112,16 @@
 public:
 
-	CClass( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const std::string &name )
-		: ClassPrototype( namespaceScopes, name )
-		, importedNamespaces( importedNamespaces )
-		, classType( Class )
-		, pSuperClass( NULL )
-		, blittableType( Type() )
-		, isReady( false )
-		, fixedAlignment( 0 )
-		, ConstructorMemberSubIndex( -1 )
-		, DestructorMemberSubIndex( -1 )
-		, vtblNum( 0 )
-		, vtbl_offset( -1 )
-		, comVtblOffset( 0 )
-		, isCompilingConstructor( false )
-		, isCompilingDestructor( false )
-		, cacheSize( 0 )
-	{
-	}
-	CClass()
-		: ClassPrototype()
-		, importedNamespaces()
-		, classType()
-		, pSuperClass( NULL )
-		, blittableType( Type() )
-		, isReady( false )
-		, fixedAlignment( 0 )
-		, ConstructorMemberSubIndex( -1 )
-		, DestructorMemberSubIndex( -1 )
-		, vtblNum( 0 )
-		, vtbl_offset( -1 )
-		, comVtblOffset( 0 )
-		, isCompilingConstructor( false )
-		, isCompilingDestructor( false )
-		, cacheSize( 0 )
-	{
-	}
-	~CClass()
-	{
-		// 動的メンバ
-		BOOST_FOREACH( Member *member, dynamicMembers )
-		{
-			delete member;
-		}
-
-		// 静的メンバ
-		BOOST_FOREACH( Member *member, staticMembers )
-		{
-			delete member;
-		}
-
-		// インターフェイス
-		BOOST_FOREACH( ::Interface *pInterface, interfaces )
-		{
-			delete pInterface;
-		}
-	}
+	CClass( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const std::string &name );
+	CClass( const NamespaceScopes &namespaceScopes,
+		const NamespaceScopesCollection &importedNamespaces,
+		const std::string &name, ClassType classType,
+		const GenericTypes &formalGenericTypes,
+		const Types &superClassActualTypeParameters,
+		int ConstructorMemberSubIndex,
+		int DestructorMemberSubIndex,
+		int vtblNum,
+		int fixedAlignment );
+	CClass();
+	~CClass();
 
 	virtual const std::string &GetKeyName() const
@@ -273,4 +235,8 @@
 		this->classType = classType;
 	}
+	ClassType GetClassType() const
+	{
+		return classType;
+	}
 
 
@@ -314,4 +280,8 @@
 		return interfaces;
 	}
+	Interfaces &GetInterfaces()
+	{
+		return interfaces;
+	}
 	bool IsInheritsInterface( const CClass *pInterfaceClass ) const;
 
@@ -372,4 +342,8 @@
 		this->ConstructorMemberSubIndex = constructorMemberSubIndex;
 	}
+	int GetConstructorMemberSubIndex() const
+	{
+		return ConstructorMemberSubIndex;
+	}
 
 	//デストラクタ メソッドを取得
@@ -382,4 +356,8 @@
 	{
 		this->DestructorMemberSubIndex = destructorMemberSubIndex;
+	}
+	int GetDestructorMemberSubIndex() const
+	{
+		return DestructorMemberSubIndex;
 	}
 
Index: trunk/ab5.0/abdev/ab_common/include/Lexical/Member.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/Member.h	(revision 622)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/Member.h	(revision 632)
@@ -33,4 +33,10 @@
 
 	int source_code_address;
+
+	Member( Prototype::Accessibility accessibility, const std::string &name, const Type &newType, bool isConst, const Subscripts &subscripts, const std::string &initializeExpression, const std::string &constructParameter );
+	Member( const Member &member, const Type &actualType );
+	Member( const Member &member );
+	Member();
+	~Member();
 
 	const std::string &GetName() const
@@ -70,31 +76,4 @@
 		return constructParameter;
 	}
-
-	Member( Prototype::Accessibility accessibility, const std::string &name, const Type &newType, bool isConst, const Subscripts &subscripts, const std::string &initializeExpression, const std::string &constructParameter )
-		: MemberPrototype( accessibility )
-		, name( name )
-		, type( newType )
-		, isConst( isConst )
-		, subscripts( subscripts )
-		, initializeExpression( initializeExpression )
-		, constructParameter( constructParameter )
-	{
-	}
-	Member::Member(Member &member)
-		: MemberPrototype( member.GetAccessibility() )
-		, name( member.GetName() )
-		, type( member.GetType() )
-		, isConst( member.IsConst() )
-		, subscripts( member.GetSubscripts() )
-	{
-		//ソースコードの位置
-		source_code_address=member.source_code_address;
-	}
-	Member()
-	{
-	}
-	~Member()
-	{
-	}
 };
 typedef std::vector<Member *> Members;
Index: trunk/ab5.0/abdev/ab_common/include/Lexical/ObjectModule.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/ObjectModule.h	(revision 622)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/ObjectModule.h	(revision 632)
@@ -4,4 +4,7 @@
 {
 public:
+	// オブジェクトモジュール名
+	std::string name;
+
 	// メタ情報
 	Meta meta;
@@ -29,4 +32,5 @@
 		trace_for_serialize( "serializing - objectModule" );
 
+		ar & BOOST_SERIALIZATION_NVP( name );
 		ar & BOOST_SERIALIZATION_NVP( meta );
 		ar & BOOST_SERIALIZATION_NVP( globalNativeCode );
@@ -39,4 +43,12 @@
 	void StaticLink( ObjectModule &objectModule );
 
+	const std::string &GetName() const
+	{
+		return name;
+	}
+	void SetName( const std::string &name )
+	{
+		this->name = name;
+	}
 	int GetCurrentSourceIndex() const
 	{
Index: trunk/ab5.0/abdev/ab_common/include/Lexical/Parameter.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/Parameter.h	(revision 622)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/Parameter.h	(revision 632)
@@ -26,25 +26,9 @@
 
 public:
-	Parameter( const std::string &varName, const Type &type, bool isRef = false, const std::string initValue = "" ):
-		Type( type ),
-		varName( varName ),
-		isRef( isRef ),
-		isArray( false ),
-		initValue( initValue )
-	{
-	}
-	Parameter( const Parameter &param ):
-		Type( param ),
-		varName( param.varName ),
-		isRef( param.isRef ),
-		isArray( param.isArray ),
-		subscripts( param.subscripts ),
-		initValue( param.initValue )
-	{
-	}
-	Parameter()
-	{
-	}
-	~Parameter(){}
+	Parameter( const std::string &varName, const Type &type, bool isRef = false, const std::string initValue = "" );
+	Parameter( const Parameter &param, const Type &type );
+	Parameter( const Parameter &param );
+	Parameter();
+	~Parameter();
 
 	void SetArray( const Subscripts &subscripts ){
Index: trunk/ab5.0/abdev/ab_common/include/Lexical/Procedure.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/Procedure.h	(revision 622)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/Procedure.h	(revision 632)
@@ -24,6 +24,7 @@
 	Type returnType;
 
+private:
 	// ソースコードの位置
-	int codePos;
+	SourceCodePosition sourceCodePosition;
 
 	// XMLシリアライズ用
@@ -40,5 +41,5 @@
 		ar & BOOST_SERIALIZATION_NVP( params );
 		ar & BOOST_SERIALIZATION_NVP( returnType );
-		ar & BOOST_SERIALIZATION_NVP( codePos );
+		ar & BOOST_SERIALIZATION_NVP( sourceCodePosition );
 	}
 
@@ -49,5 +50,4 @@
 		, isCdecl( isCdecl )
 		, isUsing( false )
-		, codePos( -1 )
 	{
 	}
@@ -83,11 +83,11 @@
 	}
 
-	int GetCodePos() const
-	{
-		return codePos;
-	}
-	void SetCodePos( int codePos )
-	{
-		this->codePos = codePos;
+	const SourceCodePosition &GetSourceCodePosition() const
+	{
+		return sourceCodePosition;
+	}
+	void SetSourceCodePosition( const SourceCodePosition &sourceCodePosition )
+	{
+		this->sourceCodePosition = sourceCodePosition;
 	}
 
@@ -178,32 +178,8 @@
 public:
 
-	UserProc( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const std::string &name, Kind kind, bool isMacro, bool isCdecl, bool isExport )
-		: Procedure( namespaceScopes, name, kind, isCdecl )
-		, importedNamespaces( importedNamespaces )
-		, pParentClass( NULL )
-		, pInterface( NULL )
-		, pMethod( NULL )
-		, isMacro( isMacro )
-		, secondParmNum( 0 )
-		, realSecondParmNum( 1 )
-		, isExport( isExport )
-		, isSystem( false )
-		, isAutoGeneration( false )
-		, isCompiled( false )
-		, beginOpAddress( 0 )
-		, endOpAddress( 0 )
-	{
-		static int id_base=0;
-		id = ( id_base ++ );
-	}
-	UserProc()
-	{
-	}
-	~UserProc()
-	{
-		BOOST_FOREACH( Parameter *pParam, realParams ){
-			delete pParam;
-		}
-	}
+	UserProc( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const std::string &name, Kind kind, bool isMacro, bool isCdecl, bool isExport );
+	UserProc( const UserProc &userProc, const CClass *pParentClass );
+	UserProc();
+	~UserProc();
 
 	void SetReturnType( const Type &newReturnType )
Index: trunk/ab5.0/abdev/ab_common/include/Lexical/Source.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/Source.h	(revision 622)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/Source.h	(revision 632)
@@ -253,2 +253,39 @@
 };
 typedef std::vector<BasicSource> BasicSources;
+
+class SourceCodePosition
+{
+	std::string objectModuleName;
+	int pos;
+
+	// 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( objectModuleName );
+		ar & BOOST_SERIALIZATION_NVP( pos );
+	}
+
+public:
+	SourceCodePosition( const std::string &objectModuleName, int pos )
+		: objectModuleName( objectModuleName )
+		, pos( pos )
+	{
+	}
+	SourceCodePosition()
+		: pos( -1 )
+	{
+	}
+
+	const std::string &GetObjectModuleName() const
+	{
+		return objectModuleName;
+	}
+	int GetPos() const
+	{
+		return pos;
+	}
+};
Index: trunk/ab5.0/abdev/ab_common/include/Lexical/Template.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/Template.h	(revision 632)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/Template.h	(revision 632)
@@ -0,0 +1,53 @@
+#pragma once
+
+class CClass;
+
+namespace ActiveBasic{ namespace Common{ namespace Lexical{
+
+
+class ExpandedTemplateClass
+{
+	CClass *pClass;
+	Types actualTypes;
+
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		ar & BOOST_SERIALIZATION_NVP( pClass );
+		ar & BOOST_SERIALIZATION_NVP( actualTypes );
+	}
+
+
+public:
+	ExpandedTemplateClass( CClass *pClass, const Types &actualTypes )
+		: pClass( pClass )
+		, actualTypes( actualTypes )
+	{
+	}
+	ExpandedTemplateClass()
+		: pClass( NULL )
+	{
+	}
+	~ExpandedTemplateClass();
+
+	const CClass &GetClass() const
+	{
+		return *pClass;
+	}
+	CClass &GetClass()
+	{
+		return *pClass;
+	}
+
+	const Types &GetActualTypes() const
+	{
+		return actualTypes;
+	}
+};
+
+typedef std::vector<ExpandedTemplateClass *> ExpandedTemplateClasses;
+
+
+}}}
Index: trunk/ab5.0/abdev/ab_common/include/Lexical/Type.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/Type.h	(revision 622)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/Type.h	(revision 632)
@@ -136,4 +136,8 @@
 	void PtrLevelDown(){
 		PTR_LEVEL_DOWN( basicType );
+	}
+	void SetPtrLevel( int level )
+	{
+		basicType = MAKE_PTR_TYPE( NATURAL_TYPE( basicType ), level );
 	}
 
@@ -166,4 +170,5 @@
 	bool IsReal() const;
 	bool Is64() const;
+	bool IsValueType() const;
 	bool IsProcPtr() const;
 	bool IsStruct() const;
@@ -233,5 +238,19 @@
 	static int GetBasicTypeFromSimpleName( const char *variable );
 };
-typedef std::vector<Type> Types;
+
+class Types
+	: public std::vector<Type>
+{
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		ar & boost::serialization::make_nvp("vector_Type", boost::serialization::base_object<vector<Type>>(*this));
+	}
+
+public:
+	bool IsEquals( const Types &Types ) const;
+};
 
 /*!
Index: trunk/ab5.0/abdev/ab_common/include/Lexical/TypeDef.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/TypeDef.h	(revision 622)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/TypeDef.h	(revision 632)
@@ -59,4 +59,4 @@
 
 	void Add( const NamespaceScopes &namespaceScopes, const std::string &name, const std::string &baseName, int nowLine );
-	int GetIndex( const Symbol &symbol ) const;
+	const TypeDef *Find( const Symbol &symbol ) const;
 };
Index: trunk/ab5.0/abdev/ab_common/include/ab_common.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/ab_common.h	(revision 622)
+++ trunk/ab5.0/abdev/ab_common/include/ab_common.h	(revision 632)
@@ -19,4 +19,5 @@
 #include "Lexical/Interface.h"
 #include "Lexical/Member.h"
+#include "Lexical/Template.h"
 #include "Lexical/Class.h"
 #include "Lexical/Parameter.h"
