Index: trunk/ab5.0/abdev/ab_common/include/Lexical/Class.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/Class.h	(revision 603)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/Class.h	(revision 603)
@@ -0,0 +1,510 @@
+#pragma once
+
+class UserProc;
+class Delegate;
+
+class ClassPrototype : public Prototype, public DynamicMethodsPrototype
+{
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Prototype );
+		ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( DynamicMethodsPrototype );
+	}
+
+public:
+	ClassPrototype( const NamespaceScopes &namespaceScopes, const std::string &name )
+		: Prototype( namespaceScopes, name )
+		, DynamicMethodsPrototype()
+	{
+	}
+	ClassPrototype()
+		: Prototype()
+		, DynamicMethodsPrototype()
+	{
+	}
+};
+
+class CClass: public ClassPrototype, public Jenga::Common::ObjectInHashmap<CClass>
+{
+public:
+	// 型の種類
+	enum ClassType{
+		Class,
+		Interface,
+		ComInterface,
+		Enum,
+		Delegate,
+		Structure,
+	};
+
+private:
+	ClassType classType;
+
+	// importされている名前空間
+	NamespaceScopesCollection importedNamespaces;
+
+	// 型パラメータ
+	GenericTypes formalGenericTypes;
+
+	// 基底クラス
+	const CClass *pSuperClass;
+
+	// 基底クラスの型パラメータ（実パラメータ）
+	Types superClassActualTypeParameters;
+
+	// Blittable型情報
+	Type blittableType;
+
+	// 実装するインターフェイス
+	Interfaces interfaces;
+
+	// 動的メンバ
+	Members dynamicMembers;
+
+	// 静的メンバ
+	Members staticMembers;
+
+	// 動的メソッド
+	int ConstructorMemberSubIndex;
+	int DestructorMemberSubIndex;
+	int vtblNum;					// 仮想関数の数
+
+	// 静的メソッド
+	Methods staticMethods;
+
+	//アラインメント値
+	int fixedAlignment;
+
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		trace_for_serialize( "serializing - CClass" );
+
+		ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( ClassPrototype );
+		ar & BOOST_SERIALIZATION_NVP( classType );
+		ar & BOOST_SERIALIZATION_NVP( importedNamespaces );
+		ar & BOOST_SERIALIZATION_NVP( formalGenericTypes );
+		ar & boost::serialization::make_nvp( "pSuperClass", const_cast<CClass *&>(pSuperClass) );
+		ar & BOOST_SERIALIZATION_NVP( superClassActualTypeParameters );
+		ar & BOOST_SERIALIZATION_NVP( blittableType );
+		ar & BOOST_SERIALIZATION_NVP( interfaces );
+		ar & BOOST_SERIALIZATION_NVP( dynamicMembers );
+		ar & BOOST_SERIALIZATION_NVP( staticMembers );
+		ar & BOOST_SERIALIZATION_NVP( ConstructorMemberSubIndex );
+		ar & BOOST_SERIALIZATION_NVP( DestructorMemberSubIndex );
+		ar & BOOST_SERIALIZATION_NVP( vtblNum );
+		ar & BOOST_SERIALIZATION_NVP( staticMethods );
+		ar & BOOST_SERIALIZATION_NVP( fixedAlignment );
+	}
+
+	bool isReady;
+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;
+		}
+	}
+
+	virtual const std::string &GetKeyName() const
+	{
+		return GetName();
+	}
+	virtual bool IsDuplication( const CClass *pClass ) const
+	{
+		if( pClass->IsEqualSymbol( *this ) )
+		{
+			return true;
+		}
+		return false;
+	}
+
+	virtual void Using() const;
+
+	void Readed(){
+		isReady = true;
+	}
+	bool IsReady() const{
+		return isReady;
+	}
+
+	const NamespaceScopesCollection &GetImportedNamespaces() const
+	{
+		return importedNamespaces;
+	}
+
+	// 型パラメータ
+	const GenericTypes &GetFormalGenericTypes() const
+	{
+		return formalGenericTypes;
+	}
+	void AddFormalGenericType( GenericType genericType )
+	{
+		this->formalGenericTypes.push_back( genericType );
+	}
+	int GetFormalGenericTypeParameterIndex( const std::string &name ) const
+	{
+		int i = 0;
+		BOOST_FOREACH( const GenericType &genericType, formalGenericTypes )
+		{
+			if( genericType.GetName() == name )
+			{
+				return i;
+			}
+			i++;
+		}
+		return -1;
+	}
+	bool IsExistFormalGenericTypeParameter( const std::string &name ) const
+	{
+		BOOST_FOREACH( const GenericType &genericType, formalGenericTypes )
+		{
+			if( genericType.GetName() == name )
+			{
+				return true;
+			}
+		}
+		return false;
+	}
+	bool IsGeneric() const
+	{
+		return ( this->formalGenericTypes.size() != 0 );
+	}
+
+	// 継承元クラス
+	bool HasSuperClass() const
+	{
+		return ( pSuperClass != NULL );
+	}
+	const CClass &GetSuperClass() const
+	{
+		return *pSuperClass;
+	}
+	void SetSuperClass( const CClass *pSuperClass )
+	{
+		this->pSuperClass = pSuperClass;
+	}
+	const Types &GetSuperClassActualTypeParameters() const
+	{
+		return superClassActualTypeParameters;
+	}
+	void SetSuperClassActualTypeParameters( const Types &actualTypeParameters )
+	{
+		this->superClassActualTypeParameters = actualTypeParameters;
+	}
+
+	// Blittable型
+	bool IsBlittableType() const
+	{
+		return !blittableType.IsNull();
+	}
+	const Type &GetBlittableType() const
+	{
+		return blittableType;
+	}
+	void SetBlittableType( const Type &type ){
+		blittableType = type;
+	}
+
+	bool IsClass() const;
+	bool IsInterface() const;
+	bool IsComInterface() const;
+	bool IsEnum() const;
+	bool IsDelegate() const;
+	bool IsStructure() const;
+	void SetClassType( ClassType classType )
+	{
+		this->classType = classType;
+	}
+
+
+	//コンストラクタをコンパイルしているかどうかのチェックフラグ
+private:
+	mutable bool isCompilingConstructor;
+public:
+	void NotifyStartConstructorCompile() const;
+	void NotifyFinishConstructorCompile() const;
+	bool IsCompilingConstructor() const;
+
+	//デストラクタをコンパイルしているかどうかのチェックフラグ
+private:
+	mutable bool isCompilingDestructor;
+public:
+	void NotifyStartDestructorCompile() const;
+	void NotifyFinishDestructorCompile() const;
+	bool IsCompilingDestructor() const;
+
+
+	//自身の派生クラスかどうかを確認
+	bool IsSubClass( const CClass *pClass ) const;
+
+	//自身と等しいまたは派生クラスかどうかを確認
+	bool IsEqualsOrSubClass( const CClass *pClass ) const;
+
+	// 自身と等しいまたは派生クラス、基底クラスかどうかを確認
+	bool IsEqualsOrSubClassOrSuperClass( const CClass &objClass ) const;
+
+	// インターフェイス
+	bool HasInterfaces() const
+	{
+		return ( interfaces.size() != 0 );
+	}
+	void AddInterface( ::Interface *pInterface )
+	{
+		interfaces.push_back( pInterface );
+	}
+	const Interfaces &GetInterfaces() const
+	{
+		return interfaces;
+	}
+	bool IsInheritsInterface( const CClass *pInterfaceClass ) const;
+
+	// クラス継承
+	bool InheritsClass( const CClass &inheritsClass, const Types &actualTypeParameters, int nowLine );
+
+	//メンバ、メソッドの追加
+	void AddDynamicMember( Member *pMember );
+	void AddStaticMember( Member *pMember );
+
+	//重複チェック
+	bool DupliCheckAll(const char *name) const;
+	bool DupliCheckMember(const char *name) const;
+
+	const Members &GetDynamicMembers() const
+	{
+		return dynamicMembers;
+	}
+	const Members &GetStaticMembers() const
+	{
+		return staticMembers;
+	}
+	Members &GetDynamicMembers()
+	{
+		return dynamicMembers;
+	}
+	Members &GetStaticMembers()
+	{
+		return staticMembers;
+	}
+	
+	const Member *FindDynamicMember( const char *memberName ) const;
+	bool HasDynamicMember( const char *memberName ) const
+	{
+		return ( FindDynamicMember( memberName ) != NULL );
+	}
+
+	void EnumDynamicMethodsOrInterfaceMethods( const char *methodName, std::vector<const UserProc *> &subs ) const;
+	const CMethod *GetDynamicMethodOrInterfaceMethod( const UserProc *pUserProc ) const;
+
+	const Methods &GetStaticMethods() const
+	{
+		return staticMethods;
+	}
+	Methods &GetStaticMethods()
+	{
+		return staticMethods;
+	}
+
+	//デフォルト コンストラクタ
+	const CMethod *GetConstructorMethod() const
+	{
+		if( ConstructorMemberSubIndex == -1 ) return NULL;
+		return GetDynamicMethods()[ConstructorMemberSubIndex];
+	}
+	void SetConstructorMemberSubIndex( int constructorMemberSubIndex )
+	{
+		this->ConstructorMemberSubIndex = constructorMemberSubIndex;
+	}
+
+	//デストラクタ メソッドを取得
+	const CMethod *GetDestructorMethod() const
+	{
+		if( DestructorMemberSubIndex == -1 ) return NULL;
+		return GetDynamicMethods()[DestructorMemberSubIndex];
+	}
+	void SetDestructorMemberSubIndex( int destructorMemberSubIndex )
+	{
+		this->DestructorMemberSubIndex = destructorMemberSubIndex;
+	}
+
+	// ユーザ指定のアラインメント固定値
+	int GetFixedAlignment() const
+	{
+		return fixedAlignment;
+	}
+	void SetFixedAlignment( int fixedAlignment )
+	{
+		this->fixedAlignment = fixedAlignment;
+	}
+
+	// メンバの総合サイズを取得
+private:
+	int cacheSize;
+public:
+	int GetSize() const;
+
+	// メンバのオフセットを取得
+	int GetMemberOffset( const char *memberName ) const;
+private:
+	// アラインメント値を取得
+	int GetAlignment() const;
+
+
+	/////////////////////////////////////////////////////////////////
+	// vtbl
+	/////////////////////////////////////////////////////////////////
+public:
+	// vtblに存在する仮想関数の数
+	int GetVtblNum() const
+	{
+		return vtblNum;
+	}
+	void SetVtblNum( int vtblNum )
+	{
+		this->vtblNum = vtblNum;
+	}
+	void AddVtblNum( int vtblNum )
+	{
+		this->vtblNum += vtblNum;
+	}
+	bool IsExistVirtualFunctions() const
+	{
+		// 構造体以外は仮想関数を持つ
+		return !IsStructure();
+	}
+	
+private:
+	int vtbl_offset;
+	int comVtblOffset;
+	int vtblMasterListOffset;
+public:
+	std::vector<long> vtblMasterList;
+	int GetVtblOffset() const
+	{
+		return vtbl_offset;
+	}
+	void SetVtblOffset( int vtblOffset )
+	{
+		this->vtbl_offset = vtblOffset;
+	}
+	int GetComVtblOffset() const
+	{
+		return comVtblOffset;
+	}
+	void SetComVtblOffset( int comVtblOffset )
+	{
+		this->comVtblOffset = comVtblOffset;
+	}
+	void GetVtblMasterListIndexAndVtblIndex( const UserProc *pUserProc, int &vtblMasterListIndex, int &vtblIndex ) const;
+	int GetVtblMasterListIndex( const CClass *pClass ) const;
+	long GetVtblMasterListOffset() const;
+	void SetVtblMasterListOffset( int vtblMasterListOffset )
+	{
+		this->vtblMasterListOffset = vtblMasterListOffset;
+	}
+	bool IsAbstract() const;
+
+
+	// TypeInfo用
+	mutable int typeInfoDataTableOffset;
+	void SetTypeInfoDataTableOffset( int typeInfoDataTableOffset ) const
+	{
+		this->typeInfoDataTableOffset = typeInfoDataTableOffset;
+	}
+	int GetTypeInfoDataTableOffset() const
+	{
+		return typeInfoDataTableOffset;
+	}
+
+	// 動的型データ用のメンバデータを取得
+	std::string GetStaticDefiningStringAsMemberNames() const;
+	std::string GetStaticDefiningStringAsMemberOffsets() const;
+	void GetReferenceOffsetsInitializeBuffer( std::string &referenceOffsetsBuffer, int &numOfReference, int baseOffset = 0 ) const;
+};
+
+class Classes : public Jenga::Common::Hashmap<CClass>
+{
+	// XMLシリアライズ用
+public:
+	Classes()
+		: pStringClass( NULL )
+		, pObjectClass( NULL )
+		, pInterfaceInfo( NULL )
+	{
+	}
+	~Classes()
+	{
+	}
+
+	bool Insert( CClass *pClass, int nowLine );
+	CClass *Add( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const char *name,int nowLine);
+
+	const CClass *FindEx( const Symbol &symbol ) const;
+
+
+	/////////////////////////////
+	// 特殊クラス
+	/////////////////////////////
+	mutable const CClass *pStringClass;
+	mutable const CClass *pObjectClass;
+	mutable const CClass *pInterfaceInfo;
+	const CClass *GetStringClassPtr() const;
+	const CClass *GetObjectClassPtr() const;
+	const CClass *GetInterfaceInfoClassPtr() const;
+};
Index: trunk/ab5.0/abdev/ab_common/include/Lexical/Const.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/Const.h	(revision 603)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/Const.h	(revision 603)
@@ -0,0 +1,146 @@
+#pragma once
+
+//定数
+class CConst : public Symbol, public Jenga::Common::ObjectInHashmap<CConst>
+{
+	Type type;
+	_int64 i64data;
+
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		trace_for_serialize( "serializing - CConst" );
+
+		ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Symbol );
+		ar & BOOST_SERIALIZATION_NVP( type );
+		ar & BOOST_SERIALIZATION_NVP( i64data );
+	}
+
+public:
+	CConst( const NamespaceScopes &namespaceScopes, const std::string &name, const Type &newType, _int64 i64data)
+		: Symbol( namespaceScopes, name )
+		, type( newType )
+		, i64data( i64data )
+	{
+	}
+	CConst( const NamespaceScopes &namespaceScopes, const std::string &name, int value)
+		: Symbol( namespaceScopes, name )
+		, type( Type(DEF_LONG) )
+		, i64data( value )
+	{
+	}
+	CConst()
+	{
+	}
+	~CConst()
+	{
+	}
+
+	virtual const std::string &GetKeyName() const
+	{
+		return GetName();
+	}
+
+	Type GetType()
+	{
+		return type;
+	}
+	_int64 GetWholeData()
+	{
+		return i64data;
+	}
+	double GetDoubleData();
+};
+class Consts : public Jenga::Common::Hashmap<CConst>
+{
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		trace_for_serialize( "serializing - Consts" );
+
+		ar & boost::serialization::make_nvp("Hashmap_CConst",
+			boost::serialization::base_object<Jenga::Common::Hashmap<CConst>>(*this));
+	}
+
+public:
+
+	void Add( const NamespaceScopes &namespaceScopes, const std::string &name, _int64 i64data, const Type &type );
+	void Add( const NamespaceScopes &namespaceScopes, const std::string &name, int value);
+
+private:
+	CConst *GetObjectPtr( const Symbol &symbol );
+public:
+
+	int GetBasicType( const Symbol &symbol );
+	_int64 GetWholeData( const Symbol &symbol );
+	double GetDoubleData( const Symbol &symbol );
+	bool IsStringPtr( const Symbol &symbol, bool isUnicode );
+};
+
+//定数マクロ
+class ConstMacro : public Symbol, public Jenga::Common::ObjectInHashmap<ConstMacro>
+{
+	std::vector<std::string> parameters;
+	std::string expression;
+
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		trace_for_serialize( "serializing - ConstMacro" );
+
+		ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Symbol );
+		ar & BOOST_SERIALIZATION_NVP( parameters );
+		ar & BOOST_SERIALIZATION_NVP( expression );
+	}
+
+public:
+	ConstMacro( const NamespaceScopes &namespaceScopes, const std::string &name, const std::vector<std::string> &parameters, const std::string &expression )
+		: Symbol( namespaceScopes, name )
+		, parameters( parameters )
+		, expression( expression )
+	{
+	}
+	ConstMacro()
+	{
+	}
+	~ConstMacro()
+	{
+	}
+
+	virtual const std::string &GetKeyName() const
+	{
+		return GetName();
+	}
+
+	const std::vector<std::string> &GetParameters() const
+	{
+		return parameters;
+	}
+	const std::string &GetExpression() const
+	{
+		return expression;
+	}
+};
+class ConstMacros : public Jenga::Common::Hashmap<ConstMacro>
+{
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		trace_for_serialize( "serializing - ConstMacros" );
+
+		ar & boost::serialization::make_nvp("Hashmap_ConstMacro",
+			boost::serialization::base_object<Jenga::Common::Hashmap<ConstMacro>>(*this));
+	}
+
+public:
+	bool Add( const NamespaceScopes &namespaceScopes, const std::string &name, const char *parameterStr );
+	ConstMacro *Find( const Symbol &name );
+};
Index: trunk/ab5.0/abdev/ab_common/include/Lexical/DataTable.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/DataTable.h	(revision 603)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/DataTable.h	(revision 603)
@@ -0,0 +1,151 @@
+#pragma once
+
+//DataTable.cpp
+class DataTable
+{
+	char *buffer;
+	int size;
+
+public:
+	// リンカで解決しなければならないスケジュール
+	Schedules schedules;
+
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	BOOST_SERIALIZATION_SPLIT_MEMBER();
+	template<class Archive> void load(Archive& ar, const unsigned int version)
+	{
+		std::string _buffer;
+		ar & BOOST_SERIALIZATION_NVP( _buffer );
+		ar & BOOST_SERIALIZATION_NVP( size );
+		ar & BOOST_SERIALIZATION_NVP( schedules );
+
+		// 読み込み後の処理
+		Realloc( size );
+		for( int i=0; i<size; 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);
+		}
+	}
+	template<class Archive> void save(Archive& ar, const unsigned int version) const
+	{
+		// 保存準備
+		char *tempCode = (char *)calloc( (size+1) * 3, 1 );
+		for( int i=0; i<size; 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( size );
+		ar & BOOST_SERIALIZATION_NVP( schedules );
+	}
+
+
+	void Realloc( int size )
+	{
+		this->buffer = (char *)realloc( this->buffer, size + 100 );
+		this->size = size;
+	}
+
+public:
+	DataTable()
+		: buffer( (char *)malloc(100) )
+		, size( 0 )
+	{
+		lstrcpy( buffer, "initialized!!!" );
+	}
+	DataTable( const DataTable &dataTable )
+		: buffer( (char *)malloc(100) )
+		, size( 0 )
+	{
+		lstrcpy( buffer, "initialized!!!" );
+		AddBinary( dataTable.GetPtr(), dataTable.GetSize() );
+	}
+	~DataTable()
+	{
+		free( buffer );
+	}
+	void Clear()
+	{
+		size = 0;
+	}
+
+	void operator = ( const DataTable &dataTable )
+	{
+		Clear();
+		AddBinary( dataTable.GetPtr(), dataTable.GetSize() );
+	}
+
+	int AddBinary( const void *buffer, int size );
+	int Add( _int64 i64data );
+	int Add( int i32data );
+	int Add( double dbl );
+	int Add( float flt );
+	int AddString( const char *str );
+	int AddString( const std::string &str );
+	int AddWString( const std::wstring &wstr );
+	void Add( const DataTable &dataTable )
+	{
+		long baseOffset = GetSize();
+
+		AddBinary( dataTable.GetPtr(), dataTable.GetSize() );
+
+		// スケジュールを追加
+		BOOST_FOREACH( const Schedule &schedule, dataTable.schedules )
+		{
+			this->schedules.push_back(
+				Schedule(
+					schedule.GetType(),
+					baseOffset + schedule.GetOffset(),
+					schedule.GetLongPtrValue()
+				)
+			);
+		}
+	}
+	int AddSpace( int size );
+	void AddAlignment( int size );
+
+	const void *GetPtr() const
+	{
+		return buffer;
+	}
+	int GetSize() const
+	{
+		return size;
+	}
+
+	long GetLong( int pos ) const
+	{
+		return *(long *)( buffer + pos );
+	}
+	_int64 GetInt64( int pos ) const
+	{
+		return *(_int64 *)( buffer + pos );
+	}
+	void Overwrite( int pos, long newLongValue )
+	{
+		*(long *)( buffer + pos ) = newLongValue;
+	}
+	void OverwriteInt64( int pos, _int64 new64Value )
+	{
+		*(_int64 *)( buffer + pos ) = new64Value;
+	}
+	void OverwriteBinary( int pos, const void *ptr, int size )
+	{
+		memcpy( buffer + pos, ptr, size );
+	}
+
+	void ResetDataSectionBaseOffset( long dataSectionBaseOffset );
+};
Index: trunk/ab5.0/abdev/ab_common/include/Lexical/Delegate.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/Delegate.h	(revision 603)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/Delegate.h	(revision 603)
@@ -0,0 +1,84 @@
+#pragma once
+
+class Delegate
+	: public Procedure
+	, public Jenga::Common::ObjectInHashmap<Delegate>
+{
+	// importされている名前空間
+	NamespaceScopesCollection importedNamespaces;
+
+	std::string paramStr;
+	std::string returnTypeName;
+	int sourceIndex;
+
+	Parameters dynamicParams;
+
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		trace_for_serialize( "serializing - Delegate" );
+
+		ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Procedure );
+		ar & BOOST_SERIALIZATION_NVP( importedNamespaces );
+		ar & BOOST_SERIALIZATION_NVP( dynamicParams );
+	}
+
+public:
+	Delegate( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const std::string &name, Procedure::Kind procKind, const char *paramStr, const std::string &returnTypeName, int sourceIndex )
+		: Procedure( namespaceScopes, name, procKind, false )
+		, importedNamespaces( importedNamespaces )
+		, paramStr( paramStr )
+		, returnTypeName( returnTypeName )
+		, sourceIndex( sourceIndex )
+	{
+	}
+	Delegate()
+	{
+	}
+
+	const NamespaceScopesCollection &GetImportedNamespaces() const
+	{
+		return importedNamespaces;
+	}
+
+	const std::string &GetParamStr() const
+	{
+		return paramStr;
+	}
+	const std::string &GetReturnTypeName() const
+	{
+		return returnTypeName;
+	}
+	void SetReturnType( const Type &returnType )
+	{
+		this->returnType = returnType;
+	}
+
+	int GetSourceIndex() const
+	{
+		return sourceIndex;
+	}
+
+	virtual const std::string &GetKeyName() const
+	{
+		return GetName();
+	}
+
+	const Parameters &GetDynamicParams() const
+	{
+		return dynamicParams;
+	}
+	Parameters &GetDynamicParams()
+	{
+		return dynamicParams;
+	}
+
+	/*!
+	@brief	オーバーライド用にデリゲート同士が等しいかどうかをチェックする
+	@param	dgt 照らし合わせるデリゲート
+	*/
+	bool IsSimilar( const Delegate &dgt ) const;
+};
+typedef Jenga::Common::Hashmap<Delegate> Delegates;
Index: trunk/ab5.0/abdev/ab_common/include/Lexical/Interface.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/Interface.h	(revision 603)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/Interface.h	(revision 603)
@@ -0,0 +1,93 @@
+#pragma once
+
+class CClass;
+
+class DynamicMethodsPrototype
+{
+	// 動的メソッド
+	Methods dynamicMethods;
+
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		ar & BOOST_SERIALIZATION_NVP( dynamicMethods );
+	}
+
+public:
+	DynamicMethodsPrototype(){}
+	DynamicMethodsPrototype( const DynamicMethodsPrototype &dynamicMethodsPrototype )
+		: dynamicMethods( dynamicMethodsPrototype.dynamicMethods )
+	{
+	}
+	~DynamicMethodsPrototype(){}
+
+	const Methods &GetDynamicMethods() const
+	{
+		return dynamicMethods;
+	}
+	Methods &GetDynamicMethods()
+	{
+		return dynamicMethods;
+	}
+
+	void AddDynamicMethods( CMethod *pMethod )
+	{
+		dynamicMethods.push_back( pMethod );
+	}
+};
+
+class Interface : public DynamicMethodsPrototype
+{
+	const CClass *pInterfaceClass;
+	mutable int vtblOffset;
+
+	// 型パラメータ（実パラメータ）
+	Types actualTypeParameters;
+
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		trace_for_serialize( "serializing - Interface" );
+
+		ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( DynamicMethodsPrototype );
+		ar & boost::serialization::make_nvp("pInterfaceClass", const_cast<CClass *&>(pInterfaceClass) );
+		ar & BOOST_SERIALIZATION_NVP( vtblOffset );
+		ar & BOOST_SERIALIZATION_NVP( actualTypeParameters );
+	}
+
+public:
+	Interface( const CClass *pInterfaceClass, const Types &actualTypeParameters );
+	Interface( const Interface &objInterface )
+		: DynamicMethodsPrototype( objInterface )
+		, pInterfaceClass( objInterface.pInterfaceClass )
+		, vtblOffset( objInterface.vtblOffset )
+	{
+	}
+	Interface()
+	{
+	}
+
+	const CClass &GetClass() const{
+		return *pInterfaceClass;
+	}
+	int GetVtblOffset() const
+	{
+		return vtblOffset;
+	}
+	void SetVtblOffset( int vtblOffset ) const
+	{
+		this->vtblOffset = vtblOffset;
+	}
+
+	const Types &GetActualTypeParameters() const
+	{
+		return actualTypeParameters;
+	}
+
+	std::string GetFullNameWithActualGenericTypeParameters() const;
+};
+typedef std::vector<Interface *> Interfaces;
Index: trunk/ab5.0/abdev/ab_common/include/Lexical/Member.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/Member.h	(revision 603)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/Member.h	(revision 603)
@@ -0,0 +1,100 @@
+#pragma once
+
+class CClass;
+
+class Member : public MemberPrototype
+{
+	std::string name;
+	Type type;
+	bool isConst;
+	Subscripts subscripts;
+
+	std::string initializeExpression;
+	std::string constructParameter;
+
+	// XMLシリアライズ用
+	// TODO: xml
+private:
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		trace_for_serialize( "serializing - Member" );
+
+		ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( MemberPrototype );
+		ar & BOOST_SERIALIZATION_NVP( name );
+		ar & BOOST_SERIALIZATION_NVP( type );
+		ar & BOOST_SERIALIZATION_NVP( isConst );
+		ar & BOOST_SERIALIZATION_NVP( subscripts );
+		ar & BOOST_SERIALIZATION_NVP( initializeExpression );
+		ar & BOOST_SERIALIZATION_NVP( constructParameter );
+	}
+
+public:
+
+	int source_code_address;
+
+	const std::string &GetName() const
+	{
+		return name;
+	}
+	void SetName( const std::string &name )
+	{
+		this->name = name;
+	}
+
+	const Type &GetType() const
+	{
+		return type;
+	}
+	void ResetType( const Type &type )
+	{
+		this->type = type;
+	}
+
+	bool IsConst() const
+	{
+		return isConst;
+	}
+
+	const Subscripts &GetSubscripts() const
+	{
+		return subscripts;
+	}
+
+	const std::string &GetInitializeExpression() const
+	{
+		return initializeExpression;
+	}
+	const std::string &GetConstructParameter() const
+	{
+		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/Meta.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/Meta.h	(revision 603)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/Meta.h	(revision 603)
@@ -0,0 +1,159 @@
+#pragma once
+
+class Meta
+{
+	// 名前空間
+	NamespaceScopesCollection namespaceScopesCollection;
+
+	// 関数・メソッド
+	UserProcs userProcs;
+
+	// DLL関数
+	DllProcs dllProcs;
+
+	// クラス
+	Classes classesImpl;
+
+	// グローバル変数
+	GlobalVars globalVars;
+
+	// グローバル定数
+	Consts globalConsts;
+
+	// グローバル定数マクロ
+	ConstMacros globalConstMacros;
+
+	// blittable型
+	BlittableTypes blittableTypes;
+
+	// TypeDef
+	TypeDefCollection typeDefs;
+
+	// 関数ポインタ
+	ProcPointers procPointers;
+
+	// デリゲート
+	Delegates delegates;
+
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		trace_for_serialize( "serializing - Meta" );
+
+		ar & BOOST_SERIALIZATION_NVP( namespaceScopesCollection );
+		ar & BOOST_SERIALIZATION_NVP( userProcs );
+		ar & BOOST_SERIALIZATION_NVP( dllProcs );
+		ar & BOOST_SERIALIZATION_NVP( classesImpl );
+		ar & BOOST_SERIALIZATION_NVP( globalVars );
+		ar & BOOST_SERIALIZATION_NVP( globalConsts );
+		ar & BOOST_SERIALIZATION_NVP( globalConstMacros );
+		ar & BOOST_SERIALIZATION_NVP( blittableTypes );
+		ar & BOOST_SERIALIZATION_NVP( typeDefs );
+		ar & BOOST_SERIALIZATION_NVP( procPointers );
+		ar & BOOST_SERIALIZATION_NVP( delegates );
+	}
+
+	Classes *pNowClassesForDebugger;
+
+public:
+	Meta()
+		: classesImpl()
+		, pNowClassesForDebugger( &classesImpl )
+	{
+	}
+
+	// 初期化
+	void Clear();
+
+	// 静的リンク
+	void StaticLink( Meta &meta, long dataSectionBaseOffset, int sourceIndexBase );
+
+	const NamespaceScopesCollection &GetNamespaces() const
+	{
+		return namespaceScopesCollection;
+	}
+	NamespaceScopesCollection &GetNamespaces()
+	{
+		return namespaceScopesCollection;
+	}
+
+	const UserProcs &GetUserProcs() const
+	{
+		return userProcs;
+	}
+	UserProcs &GetUserProcs()
+	{
+		return userProcs;
+	}
+
+	const DllProcs &GetDllProcs() const
+	{
+		return dllProcs;
+	}
+	DllProcs &GetDllProcs()
+	{
+		return dllProcs;
+	}
+
+	Classes &GetClasses()
+	{
+		return *pNowClassesForDebugger;
+	}
+	void SetClasses( Classes *pClasses )
+	{
+		this->pNowClassesForDebugger = pClasses;
+	}
+
+	const GlobalVars &GetGlobalVars() const
+	{
+		return globalVars;
+	}
+	GlobalVars &GetGlobalVars()
+	{
+		return globalVars;
+	}
+
+	const Consts &GetGlobalConsts() const
+	{
+		return globalConsts;
+	}
+	Consts &GetGlobalConsts()
+	{
+		return globalConsts;
+	}
+
+	const ConstMacros &GetGlobalConstMacros() const
+	{
+		return globalConstMacros;
+	}
+	ConstMacros &GetGlobalConstMacros()
+	{
+		return globalConstMacros;
+	}
+
+	BlittableTypes &GetBlittableTypes()
+	{
+		return blittableTypes;
+	}
+
+	TypeDefCollection &GetTypeDefs()
+	{
+		return typeDefs;
+	}
+
+	ProcPointers &GetProcPointers()
+	{
+		return procPointers;
+	}
+
+	Delegates &GetDelegates()
+	{
+		return delegates;
+	}
+
+	const ::Delegate &ToDelegate( const CClass &_class );
+
+	const CClass *FindClassSupportedTypeDef( const Symbol &symbol );
+};
Index: trunk/ab5.0/abdev/ab_common/include/Lexical/Method.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/Method.h	(revision 603)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/Method.h	(revision 603)
@@ -0,0 +1,275 @@
+#pragma once
+
+class UserProc;
+class CClass;
+
+class CMethod : public MemberPrototype
+{
+	const UserProc *pUserProc;
+
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		trace_for_serialize( "serializing - CMethod" );
+
+		ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( MemberPrototype );
+		ar & boost::serialization::make_nvp("pUserProc", const_cast<UserProc *&>(pUserProc));
+	}
+
+public:
+	CMethod( const UserProc *pUserProc, Prototype::Accessibility accessibility )
+		: MemberPrototype( accessibility )
+		, pUserProc( pUserProc )
+	{
+	}
+	CMethod()
+	{
+	}
+
+	const UserProc &GetUserProc() const
+	{
+		return *pUserProc;
+	}
+	void SetUserProcPtr( const UserProc *pUserProc )
+	{
+		this->pUserProc = pUserProc;
+	}
+
+	virtual bool IsAbstract() const = 0;
+	virtual void SetAbstractMark( bool isAbstractMark ) = 0;
+	virtual bool IsVirtual() const = 0;
+	virtual bool IsConst() const = 0;
+	virtual bool IsDynamic() const = 0;
+	virtual bool IsStatic() const = 0;
+	virtual const CClass *GetInheritsClassPtr() const = 0;
+	virtual void SetInheritsClassPtr( const CClass *pInheritsClass ) = 0;
+	virtual bool IsNotUse() const = 0;
+	virtual void SetNotUseMark( bool isNotUse ) = 0;
+};
+
+class DynamicMethod : public CMethod
+{
+public:
+	struct OverrideResult
+	{
+		enum EnumType
+		{
+			Successful = 0,				// オーバーライドに成功
+			NotVirtual,					// 非Virtualメソッドに対してオーバーライドを行おうとした
+			NotUseOverrideModifier,		// Override修飾子が無い状況で基底クラスの実体メソッドをオーバーライドしようとした
+			DifferentAccesibility,		// オーバーライド元、先のアクセシビリティに相違がある
+		};
+
+		EnumType enumType;
+		const CMethod *pMethod;
+	};
+
+private:
+	bool isAbstract;
+	bool isVirtual;
+	bool isConst;
+	const CClass *pInheritsClass;
+
+	// 他のインターフェイスへ実装が移った場合（基底クラスメソッドのインターフェイス実装）はこのフラグをオンにする
+	bool isNotUse;
+
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		trace_for_serialize( "serializing - DynamicMethod" );
+
+		ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( CMethod );
+		ar & BOOST_SERIALIZATION_NVP( isAbstract );
+		ar & BOOST_SERIALIZATION_NVP( isVirtual );
+		ar & BOOST_SERIALIZATION_NVP( isConst );
+		ar & boost::serialization::make_nvp("pInheritsClass", const_cast<CClass *&>(pInheritsClass));
+		ar & BOOST_SERIALIZATION_NVP( isNotUse );
+	}
+
+public:
+	DynamicMethod( UserProc *pUserProc, Prototype::Accessibility accessibility, bool isAbstract, bool isVirtual, bool isConst, const CClass *pInheritsClass = NULL )
+		: CMethod( pUserProc, accessibility )
+		, isAbstract( isAbstract )
+		, isVirtual( isVirtual )
+		, isConst( isConst )
+		, pInheritsClass( pInheritsClass )
+		, isNotUse( false )
+	{
+	}
+	DynamicMethod( const CMethod &method )
+		: CMethod( &method.GetUserProc(), method.GetAccessibility() )
+		, isAbstract( method.IsAbstract() )
+		, isVirtual( method.IsVirtual() )
+		, isConst( method.IsConst() )
+		, pInheritsClass( method.GetInheritsClassPtr() )
+		, isNotUse( false )
+	{
+	}
+	DynamicMethod()
+	{
+	}
+
+	DynamicMethod::OverrideResult::EnumType Override( const UserProc *pUserProc, Prototype::Accessibility accessibility, bool isOverrideModifier );
+
+	virtual bool IsAbstract() const
+	{
+		return isAbstract;
+	}
+	virtual void SetAbstractMark( bool isAbstract )
+	{
+		this->isAbstract = isAbstract;
+	}
+	virtual bool IsVirtual() const
+	{
+		return isVirtual;
+	}
+	virtual bool IsConst() const
+	{
+		return isConst;
+	}
+	virtual bool IsDynamic() const
+	{
+		return true;
+	}
+	virtual bool IsStatic() const
+	{
+		return false;
+	}
+	virtual const CClass *GetInheritsClassPtr() const
+	{
+		return pInheritsClass;
+	}
+	virtual void SetInheritsClassPtr( const CClass *pInheritsClass )
+	{
+		this->pInheritsClass = pInheritsClass;
+	}
+	virtual bool IsNotUse() const
+	{
+		return isNotUse;
+	}
+	virtual void SetNotUseMark( bool isNotUse )
+	{
+		this->isNotUse = isNotUse;
+	}
+};
+BOOST_CLASS_EXPORT( DynamicMethod );
+class StaticMethod : public CMethod
+{
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		trace_for_serialize( "serializing - StaticMethod" );
+
+		ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( CMethod );
+	}
+
+public:
+
+	// コンストラクタ
+	StaticMethod( UserProc *pUserProc, Prototype::Accessibility accessibility )
+		: CMethod( pUserProc, accessibility )
+	{
+	}
+
+	// コピーコンストラクタ
+	StaticMethod( const StaticMethod &staticMethod );
+
+	// デストラクタ
+	StaticMethod()
+	{
+	}
+
+	virtual bool Override( const UserProc *pUserProc, Prototype::Accessibility accessibility, bool isOverrideModifier )
+	{
+		throw;
+	}
+
+	virtual bool IsAbstract() const
+	{
+		throw;
+	}
+	virtual void SetAbstractMark( bool isAbstract )
+	{
+		throw;
+	}
+	virtual bool IsVirtual() const{
+		return false;
+	}
+	virtual bool IsConst() const
+	{
+		throw;
+	}
+	virtual bool IsDynamic() const
+	{
+		return false;
+	}
+	virtual bool IsStatic() const
+	{
+		return true;
+	}
+	virtual const CClass *GetInheritsClassPtr() const
+	{
+		throw;
+	}
+	virtual void SetInheritsClassPtr( const CClass *pInheritsClass )
+	{
+		throw;
+	}
+	virtual bool IsNotUse() const
+	{
+		return false;
+	}
+	virtual void SetNotUseMark( bool isNotUse )
+	{
+		throw;
+	}
+};
+BOOST_CLASS_EXPORT( StaticMethod );
+
+class Methods : public std::vector<CMethod *>
+{
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		trace_for_serialize( "serializing - Methods" );
+
+		ar & boost::serialization::make_nvp("vector_CMethod", boost::serialization::base_object<vector<CMethod *>>(*this));
+	}
+
+public:
+	// コンストラクタ
+	Methods();
+
+	// コピーコンストラクタ
+	Methods( const Methods &methods );
+
+	// デストラクタ
+	~Methods();
+
+	//メンバ、メソッドの追加
+	void Add( UserProc *pUserProc, Prototype::Accessibility accessibility, bool isConst, bool isAbstract, bool isVirtual );
+	void AddStatic(UserProc *pUserProc,Prototype::Accessibility accessibility);
+
+	/*!
+	@brief	オーバーライドのための検索
+	@param	actualTypeParametersForThisMethods thisオブジェクトで保有するメソッド群を対象とした実型パラメータ
+			pUserProc 照らし合わせる関数
+	*/
+	DynamicMethod *FindForOverride( const Types &actualTypeParametersForThisMethods, const UserProc *pUserProc );
+
+	const CMethod *GetMethodPtr( const UserProc *pUserProc ) const;
+	bool IsExist( const char *name ) const;
+	virtual void Enum( const char *methodName, std::vector<const UserProc *> &subs ) const;
+	virtual void Enum( BYTE idOperatorCalc, std::vector<const UserProc *> &subs ) const;
+
+	// 仮想メソッドの個数を取得
+	int GetVtblNum() const;
+};
Index: trunk/ab5.0/abdev/ab_common/include/Lexical/NativeCode.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/NativeCode.h	(revision 603)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/NativeCode.h	(revision 603)
@@ -0,0 +1,262 @@
+#pragma once
+
+class UserProc;
+class DllProc;
+class CClass;
+
+class Schedule
+{
+public:
+	enum Type
+	{
+		None = 10000,
+		GlobalVar,		// グローバル変数スケジュール
+		DataTable,		// データテーブル スケジュール
+		CatchAddress,	// Catchアドレス スケジュール
+		Relocation,		// リロケーション情報スケジュール
+		UserProc,		// ユーザ定義関数呼び出し側スケジュール
+		AddressOf,		// ユーザ定義関数位置スケジュール
+		DllProc,		// DLL関数位置スケジュール
+		ComVtbl,		// com_vtblスケジュール
+		Vtbl,			// vtblスケジュール
+		TypeInfo,		// TypeInfoスケジュール
+	};
+
+private:
+	Type type;
+	long offset;
+
+	union{
+		LONG_PTR lpValue;
+		const ::UserProc *pUserProc;
+		const ::DllProc *pDllProc;
+		const ::CClass *pClass;
+	};
+
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		trace_for_serialize( "serializing - Schedule" );
+
+		ar & BOOST_SERIALIZATION_NVP( type );
+		ar & BOOST_SERIALIZATION_NVP( offset );
+
+		switch( type )
+		{
+		case UserProc:
+		case AddressOf:
+		case CatchAddress:
+			ar & boost::serialization::make_nvp("pUserProc", const_cast<::UserProc *&>(pUserProc));
+			break;
+		case DllProc:
+			ar & boost::serialization::make_nvp("pDllProc", const_cast<::DllProc *&>(pDllProc));
+			break;
+		case ComVtbl:
+		case Vtbl:
+		case TypeInfo:
+			ar & boost::serialization::make_nvp("pClass", const_cast<::CClass *&>(pClass));
+			break;
+		default:
+			ar & BOOST_SERIALIZATION_NVP( lpValue );
+			break;
+		}
+	}
+
+public:
+	Schedule()
+	{
+	}
+	Schedule( Type type, long offset, LONG_PTR lpValue = 0 )
+		: type( type )
+		, offset( offset )
+		, lpValue( lpValue )
+	{
+	}
+	Schedule( Schedule::Type type, const ::UserProc *pUserProc, long offset )
+		: type( type )
+		, offset( offset )
+		, pUserProc( pUserProc )
+	{
+	}
+	Schedule( const ::DllProc *pDllProc, long offset )
+		: type( Schedule::DllProc )
+		, offset( offset )
+		, pDllProc( pDllProc )
+	{
+	}
+	Schedule( Type type, const ::CClass *pClass, long offset )
+		: type( type )
+		, pClass( pClass )
+		, offset( offset )
+	{
+		if( !( type == Schedule::ComVtbl || type == Schedule::Vtbl || type == Schedule::TypeInfo ) )
+		{
+			DebugBreak();
+		}
+	}
+	~Schedule()
+	{
+	}
+
+	Type GetType() const
+	{
+		return type;
+	}
+	long GetOffset() const
+	{
+		return offset;
+	}
+	LONG_PTR GetLongPtrValue() const
+	{
+		return lpValue;
+	}
+	const ::DllProc &GetDllProc() const;
+	const ::UserProc &GetUserProc() const;
+	const ::CClass &GetClass() const;
+};
+typedef std::vector<Schedule> Schedules;
+
+#define CODETYPE_SYSTEMPROC		0x0001
+#define CODETYPE_DEBUGPROC		0x0002
+class SourceLine
+{
+	int lineNum;
+	long nativeCodePos;
+	int sourceIndex;
+	long sourceCodePos;
+	DWORD codeType;
+
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		trace_for_serialize( "serializing - SourceLine" );
+
+		ar & BOOST_SERIALIZATION_NVP( lineNum );
+		ar & BOOST_SERIALIZATION_NVP( nativeCodePos );
+		ar & BOOST_SERIALIZATION_NVP( sourceIndex );
+		ar & BOOST_SERIALIZATION_NVP( sourceCodePos );
+		ar & BOOST_SERIALIZATION_NVP( codeType );
+	}
+
+public:
+	SourceLine( int lineNum, int nativeCodePos, int sourceIndex, int sourceCodePos, DWORD codeType )
+		: lineNum( lineNum )
+		, nativeCodePos( nativeCodePos )
+		, sourceIndex( sourceIndex )
+		, sourceCodePos( sourceCodePos )
+		, codeType( codeType )
+	{
+	}
+	SourceLine()
+	{
+	}
+
+	int GetLineNum() const
+	{
+		return lineNum;
+	}
+	long GetNativeCodePos() const
+	{
+		return nativeCodePos;
+	}
+	int GetSourceIndex() const
+	{
+		return sourceIndex;
+	}
+	void SetSourceIndex( int sourceIndex )
+	{
+		this->sourceIndex = sourceIndex;
+	}
+	long GetSourceCodePos() const
+	{
+		return sourceCodePos;
+	}
+	void SetSourceCodePos( int sourceCodePos )
+	{
+		this->sourceCodePos = sourceCodePos;
+	}
+	DWORD GetCodeType() const
+	{
+		return codeType;
+	}
+	bool IsInSystemProc() const
+	{
+		return ( (codeType&CODETYPE_SYSTEMPROC) != 0 );
+	}
+	bool IsInDebugProc() const
+	{
+		return ( (codeType&CODETYPE_DEBUGPROC) != 0 );
+	}
+};
+typedef std::vector<SourceLine> SourceLines;
+
+class NativeCode : public Jenga::Common::Binary
+{
+	// リンカで解決しなければならないスケジュール
+	Schedules schedules;
+
+	// ソースコード行番号とネイティブコード位置の対応情報
+	SourceLines sourceLines;
+
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		trace_for_serialize( "serializing(load) - NativeCode" );
+
+		ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Jenga::Common::Binary );
+		ar & BOOST_SERIALIZATION_NVP( schedules );
+		ar & BOOST_SERIALIZATION_NVP( sourceLines );
+	}
+
+public:
+	NativeCode()
+		: Jenga::Common::Binary()
+	{
+	}
+	NativeCode( const NativeCode &nativeCode )
+		: Jenga::Common::Binary()
+	{
+		PutEx( nativeCode );
+	}
+	NativeCode( const char *codeBuffer, int size )
+		: Jenga::Common::Binary( codeBuffer, size )
+	{
+	}
+	~NativeCode()
+	{
+	}
+
+	void operator =( const NativeCode &nativeCode )
+	{
+		Clear();
+		PutEx( nativeCode );
+	}
+
+	const Schedules &GetSchedules() const
+	{
+		return schedules;
+	}
+
+	void PutEx( const NativeCode &nativeCode );
+	void PutEx( long l, Schedule::Type scheduleType );
+	void PutUserProcSchedule( const UserProc *pUserProc, bool isCall );
+	void PutCatchAddressSchedule( const UserProc *pUserProc, long codePos );
+	void PutDllProcSchedule( const DllProc *pDllProc );
+	void PutComVtblSchedule( const CClass *pClass );
+	void PutVtblSchedule( const CClass *pClass );
+
+	const SourceLines &GetSourceLines() const
+	{
+		return sourceLines;
+	}
+	void NextSourceLine( int currentSourceIndex, int nowLine );
+
+	void ResetDataSectionBaseOffset( long dataSectionBaseOffset );
+	void ResetSourceIndexes( long sourceIndexBase );
+};
Index: trunk/ab5.0/abdev/ab_common/include/Lexical/ObjectModule.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/ObjectModule.h	(revision 603)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/ObjectModule.h	(revision 603)
@@ -0,0 +1,71 @@
+#pragma once
+
+class ObjectModule
+{
+public:
+	// メタ情報
+	Meta meta;
+
+	// グローバル領域のネイティブコード
+	NativeCode globalNativeCode;
+
+	// データテーブル
+	DataTable dataTable;
+
+private:
+	// ソースコード
+	int currentSourceIndex;
+	BasicSources sources;
+
+	// XMLシリアライズ用
+private:
+	virtual const char *RootTagName() const
+	{
+		return "objectModule";
+	}
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		trace_for_serialize( "serializing - objectModule" );
+
+		ar & BOOST_SERIALIZATION_NVP( meta );
+		ar & BOOST_SERIALIZATION_NVP( globalNativeCode );
+		ar & BOOST_SERIALIZATION_NVP( dataTable );
+		ar & BOOST_SERIALIZATION_NVP( currentSourceIndex );
+		ar & BOOST_SERIALIZATION_NVP( sources );
+	}
+
+public:
+	void StaticLink( ObjectModule &objectModule );
+
+	int GetCurrentSourceIndex() const
+	{
+		return currentSourceIndex;
+	}
+	const BasicSource &GetCurrentSource() const
+	{
+		return sources[currentSourceIndex];
+	}
+	BasicSource &GetCurrentSource()
+	{
+		return sources[currentSourceIndex];
+	}
+	void SetCurrentSourceIndex( int currentSourceIndex )
+	{
+		this->currentSourceIndex = currentSourceIndex;
+	}
+	const BasicSource &GetSource( int sourceIndex ) const
+	{
+		return sources[sourceIndex];
+	}
+	BasicSources &GetSources()
+	{
+		return sources;
+	}
+
+	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/ab5.0/abdev/ab_common/include/Lexical/Parameter.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/Parameter.h	(revision 603)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/Parameter.h	(revision 603)
@@ -0,0 +1,102 @@
+#pragma once
+
+class Parameter : public Type
+{
+	std::string varName;
+	bool isRef;
+	bool isArray;
+	Subscripts subscripts;
+
+	std::string initValue;
+
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		trace_for_serialize( "serializing - Parameter" );
+
+		ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Type );
+		ar & BOOST_SERIALIZATION_NVP( varName );
+		ar & BOOST_SERIALIZATION_NVP( isRef );
+		ar & BOOST_SERIALIZATION_NVP( isArray );
+		ar & BOOST_SERIALIZATION_NVP( subscripts );
+		ar & BOOST_SERIALIZATION_NVP( initValue );
+	}
+
+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(){}
+
+	void SetArray( const Subscripts &subscripts ){
+		isArray = true;
+		this->subscripts = subscripts;
+	}
+
+	const std::string &GetVarName() const
+	{
+		return varName;
+	}
+
+	bool IsRef() const
+	{
+		return isRef;
+	}
+	bool IsArray(){
+		return isArray;
+	}
+	const Subscripts &GetSubscripts() const
+	{
+		return subscripts;
+	}
+
+	const std::string &GetInitValue() const
+	{
+		return initValue;
+	}
+
+	bool Equals( const Parameter &param, bool isContravariant ) const;
+	bool Equals( const Types &actualTypeParametersForThisProc, const Parameter &param, bool isContravariant ) const;
+};
+
+class Parameters : public std::vector<Parameter *>
+{
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		trace_for_serialize( "serializing - Parameters" );
+
+		ar & boost::serialization::make_nvp("vector_Parameter", boost::serialization::base_object<std::vector<Parameter *>>(*this));
+	}
+
+public:
+
+	bool Equals( const Parameters &params, bool isContravariant = false ) const;
+	bool Equals( const Types &actualTypeParametersForThisProc, const Parameters &params, bool isContravariant = false ) const;
+
+	int GetMemorySize() const
+	{
+		return (int)this->size() * PTR_SIZE;
+	}
+};
Index: trunk/ab5.0/abdev/ab_common/include/Lexical/Procedure.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/Procedure.h	(revision 603)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/Procedure.h	(revision 603)
@@ -0,0 +1,549 @@
+#pragma once
+
+class CClass;
+class Interface;
+class CMethod;
+
+class Procedure : public Symbol
+{
+public:
+	// 種類
+	enum Kind{
+		Sub,
+		Function,
+	};
+
+private:
+	Kind kind;
+
+	bool isCdecl;
+	mutable bool isUsing;
+
+	// パラメータ
+	Parameters params;
+
+protected:
+
+	// 戻り値の型
+	Type returnType;
+
+	// ソースコードの位置
+	int codePos;
+
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		trace_for_serialize( "serializing - Procedure" );
+
+		ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Symbol );
+		ar & BOOST_SERIALIZATION_NVP( kind );
+		ar & BOOST_SERIALIZATION_NVP( isCdecl );
+		ar & BOOST_SERIALIZATION_NVP( isUsing );
+		ar & BOOST_SERIALIZATION_NVP( params );
+		ar & BOOST_SERIALIZATION_NVP( returnType );
+		ar & BOOST_SERIALIZATION_NVP( codePos );
+	}
+
+public:
+	Procedure( const NamespaceScopes &namespaceScopes, const std::string &name, Kind kind, bool isCdecl )
+		: Symbol( namespaceScopes, name )
+		, kind( kind )
+		, isCdecl( isCdecl )
+		, isUsing( false )
+		, codePos( -1 )
+	{
+	}
+	Procedure()
+	{
+	}
+	~Procedure(){
+		BOOST_FOREACH( Parameter *pParam, params ){
+			delete pParam;
+		}
+	}
+
+	bool IsSub() const
+	{
+		return ( kind == Sub );
+	}
+	bool IsFunction() const
+	{
+		return ( kind == Function );
+	}
+
+	bool IsCdecl() const
+	{
+		return isCdecl;
+	}
+	void Using() const
+	{
+		isUsing = true;
+	}
+	bool IsUsing() const
+	{
+		return isUsing;
+	}
+
+	int GetCodePos() const
+	{
+		return codePos;
+	}
+	void SetCodePos( int codePos )
+	{
+		this->codePos = codePos;
+	}
+
+	const Parameters &Params() const
+	{
+		return params;
+	}
+	Parameters &GetParameters()
+	{
+		return params;
+	}
+	const Type &ReturnType() const
+	{
+		return returnType;
+	}
+	Type &ReturnType()
+	{
+		return returnType;
+	}
+};
+
+class UserProc : public Procedure, public Jenga::Common::ObjectInHashmap<UserProc>
+{
+public:
+	std::string _paramStr;
+
+private:
+	NamespaceScopesCollection importedNamespaces;
+
+	// 親クラスと対応するメソッド
+	const CClass *pParentClass;
+	const Interface *pInterface;
+	CMethod *pMethod;
+
+	bool isMacro;
+
+	// パラメータの追加情報
+	int secondParmNum;
+	Parameters realParams;
+	int realSecondParmNum;
+
+	// 各種フラグ
+	bool isExport;
+	mutable bool isSystem;
+	mutable bool isAutoGeneration;
+	mutable bool isCompiled;
+
+	mutable DWORD beginOpAddress;
+	mutable DWORD endOpAddress;
+
+	// ローカル変数
+	mutable Variables localVars;
+
+	// 識別ID
+	int id;
+
+	// ネイティブコード
+	NativeCode nativeCode;
+
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		trace_for_serialize( "serializing - UserProc" );
+
+		ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Procedure );
+		ar & BOOST_SERIALIZATION_NVP( _paramStr );
+		ar & BOOST_SERIALIZATION_NVP( importedNamespaces );
+		ar & boost::serialization::make_nvp("pParentClass", const_cast<CClass *&>(pParentClass) );
+		ar & boost::serialization::make_nvp("pInterface", const_cast<Interface *&>(pInterface) );
+		ar & BOOST_SERIALIZATION_NVP( pMethod );
+		ar & BOOST_SERIALIZATION_NVP( isMacro );
+		ar & BOOST_SERIALIZATION_NVP( secondParmNum );
+		ar & BOOST_SERIALIZATION_NVP( realParams );
+		ar & BOOST_SERIALIZATION_NVP( realSecondParmNum );
+		ar & BOOST_SERIALIZATION_NVP( isExport );
+		ar & BOOST_SERIALIZATION_NVP( isSystem );
+		ar & BOOST_SERIALIZATION_NVP( isAutoGeneration );
+		ar & BOOST_SERIALIZATION_NVP( isCompiled );
+		ar & BOOST_SERIALIZATION_NVP( beginOpAddress );
+		ar & BOOST_SERIALIZATION_NVP( endOpAddress );
+		ar & BOOST_SERIALIZATION_NVP( localVars );
+		ar & BOOST_SERIALIZATION_NVP( id );
+		ar & BOOST_SERIALIZATION_NVP( nativeCode );
+	}
+
+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;
+		}
+	}
+
+	void SetReturnType( const Type &newReturnType )
+	{
+		returnType = newReturnType;
+	}
+
+	virtual const std::string &GetKeyName() const
+	{
+		return GetName();
+	}
+
+	virtual bool IsDuplication( const UserProc *pUserProc ) const
+	{
+		if( this->GetParentClassPtr() == pUserProc->GetParentClassPtr()	// 親クラスが等しい
+			&& this->pInterface == pUserProc->pInterface				// インターフェイスが等しい
+			&& pUserProc->IsEqualSymbol( *this )						// 名前空間及び名前が等しい
+			&& this->Params().Equals( pUserProc->Params() )				// パラメータが等しい
+			&& this->returnType.Equals( pUserProc->returnType ) )		// 戻り値が等しい
+		{
+			return true;
+		}
+		return false;
+	}
+
+	/*!
+	@brief	オーバーライド用に関数同士が等しいかどうかをチェックする
+	@param	actualTypeParametersForThisProc thisオブジェクトで保有するメソッドを対象とした実型パラメータ
+			pUserProc 照らし合わせる関数
+	*/
+	bool IsEqualForOverride( const Types &actualTypeParametersForThisProc, const UserProc *pUserProc ) const;
+
+	bool IsMacro() const
+	{
+		return isMacro;
+	}
+
+	int GetSecondParmNum() const
+	{
+		return secondParmNum;
+	}
+	void SetSecondParmNum( int secondParmNum )
+	{
+		this->secondParmNum = secondParmNum;
+	}
+	const Parameters &RealParams() const
+	{
+		return realParams;
+	}
+	Parameters &RealParams()
+	{
+		return realParams;
+	}
+	void SetRealParams( const Parameters &params )
+	{
+		realParams = params;
+	}
+	int GetRealSecondParmNum() const
+	{
+		return realSecondParmNum;
+	}
+
+	void ExportOff(){
+		isExport = false;
+	}
+	bool IsExport() const
+	{
+		return isExport;
+	}
+	void ThisIsSystemProc() const
+	{
+		isSystem = true;
+	}
+	bool IsSystem() const
+	{
+		return isSystem;
+	}
+	void ThisIsAutoGenerationProc() const
+	{
+		isAutoGeneration = true;
+	}
+	bool IsAutoGeneration() const
+	{
+		return isAutoGeneration;
+	}
+	void CompleteCompile() const
+	{
+		isCompiled = true;
+	}
+	void KillCompileStatus() const
+	{
+		isCompiled = false;
+	}
+	bool IsCompiled() const
+	{
+		return isCompiled;
+	}
+	bool IsDestructor() const
+	{
+		return ( GetName()[0] == '~' );
+	}
+
+	// バイナリコード位置とサイズ
+	DWORD GetBeginOpAddress() const
+	{
+		return beginOpAddress;
+	}
+	void SetBeginOpAddress( DWORD beginOpAddress ) const
+	{
+		this->beginOpAddress = beginOpAddress;
+	}
+	DWORD GetEndOpAddress() const
+	{
+		return endOpAddress;
+	}
+	void SetEndOpAddress( DWORD endOpAddress ) const
+	{
+		this->endOpAddress = endOpAddress;
+	}
+	int GetCodeSize() const
+	{
+		return endOpAddress - beginOpAddress;
+	}
+
+	virtual const NamespaceScopes &GetNamespaceScopes() const;
+	const NamespaceScopesCollection &GetImportedNamespaces() const;
+
+	Variables &GetLocalVars() const
+	{
+		return localVars;
+	}
+
+	int GetId() const
+	{
+		return id;
+	}
+
+	const NativeCode &GetNativeCode() const
+	{
+		return nativeCode;
+	}
+	NativeCode &GetNativeCode()
+	{
+		return nativeCode;
+	}
+
+	std::string GetFullName() const;
+	bool IsCastOperator() const;
+
+	bool IsVirtual() const;
+
+	void SetParentClass( const CClass *pParentClass ){
+		this->pParentClass = pParentClass;
+	}
+	const CClass *GetParentClassPtr() const
+	{
+		return pParentClass;
+	}
+	const CClass &GetParentClass() const
+	{
+		return *pParentClass;
+	}
+	bool HasParentClass() const
+	{
+		return ( pParentClass != NULL );
+	}
+	bool IsGlobalProcedure() const
+	{
+		return ( pParentClass == NULL );
+	}
+	void SetInterface( const Interface *pInterface )
+	{
+		this->pInterface = pInterface;
+	}
+	void SetMethod( CMethod *pMethod ){
+		this->pMethod = pMethod;
+	}
+	const CMethod &GetMethod() const;
+
+
+	static const UserProc *pGlobalProc;
+};
+
+class UserProcs : public Jenga::Common::Hashmap<UserProc>
+{
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		trace_for_serialize( "serializing - UserProcs" );
+
+		ar & boost::serialization::make_nvp("Hashmap_UserProcImpl",
+			boost::serialization::base_object<Jenga::Common::Hashmap<UserProc>>(*this));
+	}
+
+
+public:
+	UserProcs()
+	{
+	}
+	~UserProcs()
+	{
+	}
+
+	void EnumGlobalProcs( const char *simpleName, const Symbol &localSymbol, std::vector<const UserProc *> &subs );
+};
+
+class DllProc : public Procedure, public Jenga::Common::ObjectInHashmap<DllProc>
+{
+	std::string dllFileName;
+	std::string alias;
+	int lookupAddress;
+
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		trace_for_serialize( "serializing - DllProc" );
+
+		ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Procedure );
+		ar & BOOST_SERIALIZATION_NVP( dllFileName );
+		ar & BOOST_SERIALIZATION_NVP( alias );
+		ar & BOOST_SERIALIZATION_NVP( lookupAddress );
+	}
+
+public:
+	DllProc( const NamespaceScopes &namespaceScopes, const std::string &name, Kind kind, bool isCdecl, const std::string &dllFileName, const std::string &alias )
+		: Procedure( namespaceScopes, name, kind, isCdecl )
+		, dllFileName( dllFileName )
+		, alias( alias )
+		, lookupAddress( 0 )
+	{
+	}
+	DllProc()
+	{
+	}
+	~DllProc()
+	{
+	}
+
+	virtual const std::string &GetKeyName() const
+	{
+		return GetName();
+	}
+
+	virtual bool IsDuplication( const DllProc *pDllProc ) const
+	{
+		if( pDllProc->IsEqualSymbol( *this )
+			&& this->Params().Equals( pDllProc->Params() ) )
+		{
+			return true;
+		}
+		return false;
+	}
+
+	const std::string &GetDllFileName() const
+	{
+		return dllFileName;
+	}
+	const std::string &GetAlias() const
+	{
+		return alias;
+	}
+
+	void SetLookupAddress( int lookupAddress ){
+		this->lookupAddress = lookupAddress;
+	}
+	int GetLookupAddress() const
+	{
+		return lookupAddress;
+	}
+};
+class DllProcs : public Jenga::Common::Hashmap<DllProc>
+{
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		trace_for_serialize( "serializing - DllProcs" );
+
+		ar & boost::serialization::make_nvp("Hashmap_DllProc",
+			boost::serialization::base_object<Jenga::Common::Hashmap<DllProc>>(*this));
+	}
+};
+
+class ProcPointer : public Procedure
+{
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		trace_for_serialize( "serializing - ProcPointer" );
+
+		ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Procedure );
+	}
+
+public:
+	ProcPointer( Kind kind )
+		: Procedure( NamespaceScopes(), std::string(), kind, false )
+	{
+	}
+	ProcPointer()
+	{
+	}
+	~ProcPointer(){}
+};
+
+class ProcPointers : public std::vector<ProcPointer *>
+{
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		trace_for_serialize( "serializing - ProcPointers" );
+
+		ar & boost::serialization::make_nvp("vector_ProcPointer",
+			boost::serialization::base_object<vector<ProcPointer *>>(*this));
+	}
+
+public:
+	ProcPointers()
+	{
+	}
+	~ProcPointers()
+	{
+		Clear();
+	}
+
+	void Clear();
+	void PullOutAll()
+	{
+		clear();
+	}
+};
Index: trunk/ab5.0/abdev/ab_common/include/Lexical/Source.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/Source.h	(revision 603)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/Source.h	(revision 603)
@@ -0,0 +1,254 @@
+#pragma once
+
+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 (int)filePaths.size();
+	}
+
+	int AddFile( const std::string &filePath )
+	{
+		filePaths.push_back( filePath );
+		return (int)filePaths.size()-1;
+	}
+	void AddLine( int fileNumber )
+	{
+		lineFileNumbers.push_back( fileNumber );
+	}
+
+	int GetLineCounts() const
+	{
+		return (int)lineFileNumbers.size();
+	}
+};
+
+class Text{
+protected:
+	char *buffer;
+	int length;
+
+public:
+
+	Text(){
+		buffer = (char *)calloc( 1, 1 );
+		length = 0;
+	}
+	Text( const Text &text )
+		: length( text.length )
+	{
+		buffer = (char *)malloc( length + 1 );
+		memcpy( buffer, text.buffer, length );
+		buffer[length] = 0;
+	}
+	~Text(){
+		free( buffer );
+	}
+	void Clear()
+	{
+		length = 0;
+	}
+	void Add( const std::string &str )
+	{
+		buffer = (char *)realloc( buffer, length + str.size() + 1 );
+		lstrcpy( buffer + length, str.c_str() );
+		length += (int)str.size();
+	}
+	void Add( const std::vector<char> &str )
+	{
+		buffer = (char *)realloc( buffer, length + str.size() + 1 );
+		lstrcpy( buffer + length, &str[0] );
+		length += (int)str.size();
+	}
+
+	bool ReadFile( const std::string &filePath );
+
+	static void Text::SlideString(char *buffer, int slide){
+		char *temp;
+		temp=(char *)malloc(lstrlen(buffer)+1);
+		lstrcpy(temp,buffer);
+		lstrcpy(buffer+slide,temp);
+		free(temp);
+	}
+};
+
+class BasicSource : public Text
+{
+	static const std::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 )
+	{
+		bool isEqualBasbuf = false;
+		extern char *basbuf;
+		if( basbuf == buffer + 2 )
+		{
+			isEqualBasbuf = true;
+		}
+
+		buffer = (char *)realloc( buffer, newLength + 255 );
+
+		length = newLength;
+
+		if( isEqualBasbuf )
+		{
+			basbuf = buffer + 2;
+		}
+	}
+
+	void IncludeFiles();
+
+	void ChangeReturnLineChar();
+
+	void RemoveComments();
+
+	bool ReadFile_InIncludeDirective( const std::string &filePath );
+	void DirectiveIncludeOrRequire( const std::string &mainSourceFilePath, const std::string &includeDirPath );
+
+	void RemoveReturnLineUnderbar();
+
+	void Initialize( const std::string &source );
+
+public:
+	BasicSource(){}
+	BasicSource( const BasicSource &basicSource )
+		: Text( basicSource )
+		, includedFilesRelation( basicSource.includedFilesRelation )
+	{
+	}
+	BasicSource( const std::string &source )
+	{
+		Initialize( source );
+	}
+	~BasicSource(){}
+
+	char *GetBuffer(){
+		return buffer+2;
+	}
+	const char *GetBuffer() const
+	{
+		return buffer+2;
+	}
+	int GetLength() const
+	{
+		return length-2;
+	}
+	void _ResetLength()
+	{
+		length = lstrlen( buffer );
+	}
+
+	const IncludedFilesRelation &GetIncludedFilesRelation() const
+	{
+		return includedFilesRelation;
+	}
+
+	void SetBuffer( const char *buffer );
+
+	bool ReadFile( const std::string &filePath, bool isDebug, bool isDll, bool isUnicode, int majorVer, const std::string &mainSourceFilePath, const std::string &includeDirPath );
+
+	void Addition( const char *buffer );
+
+	bool GetLineInfo( int sourceCodePos, int &line, std::string &fileName ) const;
+
+	void operator = ( const BasicSource &source ){
+		Realloc( source.length );
+		lstrcpy( buffer, source.buffer );
+	}
+
+	char operator[]( int index ) const
+	{
+		if( index>GetLength() )
+		{
+			Jenga::Throw( "BasicSource bad access" );
+		}
+		return buffer[2+index];
+	}
+
+	std::string cannotIncludePath;
+	int cannotIncludeSourcePos;
+};
+typedef std::vector<BasicSource> BasicSources;
Index: trunk/ab5.0/abdev/ab_common/include/Lexical/Symbol.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/Symbol.h	(revision 601)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/Symbol.h	(revision 603)
@@ -3,4 +3,6 @@
 namespace ActiveBasic{ namespace Common{ namespace Lexical{
 
+std::string Operator_NaturalStringToCalcMarkString( const std::string &name );
+std::string Operator_CalcMarkStringToNaturalString( const std::string &name );
 
 class Symbol
Index: trunk/ab5.0/abdev/ab_common/include/Lexical/Type.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/Type.h	(revision 603)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/Type.h	(revision 603)
@@ -0,0 +1,373 @@
+#pragma once
+
+class CClass;
+
+class GenericType;
+typedef std::vector<GenericType> GenericTypes;
+
+class Type{
+	int basicType;
+	union{
+		LONG_PTR index;
+		const CClass *pClass;
+	};
+
+	// ジェネリクス クラス インスタンス型の場合に使う
+	GenericTypes actualGenericTypes;
+
+	// 型パラメータで使う
+	std::string formalTypeName;	// 型パラメータの名前
+	int formalTypeIndex;		// 型パラメータの引数番号
+
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		trace_for_serialize( "serializing - Type" );
+
+		ar & BOOST_SERIALIZATION_NVP( basicType );
+		if( HasMember() )
+		{
+			ar & boost::serialization::make_nvp("pClass", const_cast<CClass *&>(pClass));
+			ar & BOOST_SERIALIZATION_NVP( actualGenericTypes );
+		}
+		else
+		{
+			ar & BOOST_SERIALIZATION_NVP( index );
+		}
+
+		if( IsTypeParameter() )
+		{
+			ar & BOOST_SERIALIZATION_NVP( formalTypeName );
+			ar & BOOST_SERIALIZATION_NVP( formalTypeIndex );
+		}
+	}
+
+public:
+	static int GetBasicSize( int basicType );
+
+	Type():
+	  basicType( DEF_NON ),
+	  index( -1 ){}
+	Type( int basicType ):
+	  basicType( basicType ),
+	  index( -1 ){}
+
+	Type( int basicType, LONG_PTR index )
+		: basicType( basicType )
+		, index( index )
+	{
+	}
+
+	Type( int basicType, const CClass &objClass ):
+	  basicType( basicType ),
+	  index( (LONG_PTR)&objClass ){}
+
+	Type( const Type &type )
+		: basicType( type.basicType )
+		, index( type.index )
+		, actualGenericTypes( type.actualGenericTypes )
+		, formalTypeName( type.formalTypeName )
+		, formalTypeIndex( type.formalTypeIndex )
+	{
+	}
+
+	~Type();
+
+	void operator= ( const Type &type )
+	{
+		basicType = type.basicType;
+		index = type.index;
+		actualGenericTypes = type.actualGenericTypes;
+		formalTypeName = type.formalTypeName;
+		formalTypeIndex = type.formalTypeIndex;
+	}
+
+	__inline int GetBasicType() const
+	{
+		return basicType;
+	}
+	LONG_PTR GetIndex() const
+	{
+		return index;
+	}
+	const CClass &GetClass() const;
+
+	void SetBasicType( int basicType ){
+		this->basicType = basicType;
+	}
+	void SetIndex( LONG_PTR index ){
+		this->index = index;
+	}
+	void SetClassPtr( const CClass *pClass )
+	{
+		int naturalBasicType = NATURAL_TYPE( basicType );
+		if( !HasMember() )
+		{
+			Jenga::Throw( "クラスまたは構造体でない型に対してSetClassPtrを呼び出した" );
+		}
+		this->pClass = pClass;
+	}
+	void SetNull(){
+		SetBasicType( DEF_NON );
+		SetIndex( -1 );
+	}
+	void SetType( int basicType, LONG_PTR index ){
+		SetBasicType( basicType );
+		SetIndex( index );
+	}
+	void SetType( int basicType, const CClass *pClass ){
+		SetBasicType( basicType );
+		this->pClass = pClass;
+	}
+	void SetActualGenericTypes( const GenericTypes &genericTypes )
+	{
+		this->actualGenericTypes = genericTypes;
+	}
+
+	int PtrLevel() const
+	{
+		return PTR_LEVEL( basicType );
+	}
+	void PtrLevelUp(){
+		PTR_LEVEL_UP( basicType );
+	}
+	void PtrLevelDown(){
+		PTR_LEVEL_DOWN( basicType );
+	}
+
+	bool Equals( const Type &type ) const;
+	bool IsCovariant( const Type &type ) const;
+	bool IsContravariant( const Type &type ) const;
+
+	int GetBasicSize() const;
+	int GetSize() const;
+
+	bool IsNull() const;
+
+	bool IsByte() const;
+	bool IsSByte() const;
+	bool IsWord() const;
+	bool IsInteger() const;
+	bool IsDWord() const;
+	bool IsLong() const;
+	bool IsQWord() const;
+	bool IsInt64() const;
+	bool IsSingle() const;
+	bool IsDouble() const;
+	bool IsBoolean() const;
+
+	static bool IsPointer( int basicType );
+	bool IsPointer() const;
+	bool IsSigned() const;
+	bool IsNaturalWhole() const;
+	bool IsWhole() const;
+	bool IsReal() const;
+	bool Is64() const;
+	bool IsProcPtr() const;
+	bool IsStruct() const;
+	bool IsStructPtr() const;
+	bool IsObject() const;
+	bool IsObjectPtr() const;
+	bool IsTypeParameter() const;
+	bool IsObjectClass() const;
+	bool IsStringClass() const;
+	bool IsVoidPtr() const;
+	bool IsAny() const;
+	bool IsDelegate() const;
+	bool IsInterface() const;
+	bool IsComInterface() const;
+
+	// オブジェクトや構造体など、メンバを持つ型かどうかを判別する
+	bool HasMember() const;
+
+	// 型パラメータの名前を取得
+	const std::string &GetFormalTypeName() const
+	{
+		if( !IsTypeParameter() )
+		{
+			Jenga::Throw( "型パラメータでない型に対してGetFormalTypeNameメソッドが呼ばれた" );
+		}
+		return formalTypeName;
+	}
+	void SetFormalTypeName( const std::string &formalTypeName )
+	{
+		if( !IsTypeParameter() )
+		{
+			Jenga::Throw( "型パラメータでない型に対してSetFormalTypeNameメソッドが呼ばれた" );
+		}
+		this->formalTypeName = formalTypeName;
+	}
+	int GetFormalTypeIndex() const
+	{
+		if( !IsTypeParameter() )
+		{
+			Jenga::Throw( "型パラメータでない型に対してGetFormalTypeIndexメソッドが呼ばれた" );
+		}
+		return formalTypeIndex;
+	}
+	void SetFormalTypeIndex( int formalTypeIndex )
+	{
+		if( !IsTypeParameter() )
+		{
+			Jenga::Throw( "型パラメータでない型に対してSetFormalTypeIndexメソッドが呼ばれた" );
+		}
+		this->formalTypeIndex = formalTypeIndex;
+	}
+
+	// 未完成
+	const Type &GetActualGenericType( int index ) const;
+	bool HasActualGenericType() const;
+
+	//型名を取得
+	std::string ToString() const;
+
+
+private:
+	static const int basicTypeList[];
+	static const std::string basicTypeNameList[];
+public:
+	static bool StringToBasicType( const std::string &typeName, int &basicType );
+	static const char *Type::BasicTypeToCharPtr( const Type &type );
+	static int GetBasicTypeFromSimpleName( const char *variable );
+};
+typedef std::vector<Type> Types;
+
+/*!
+@brief	ジェネリックな型を解決する
+@param	typeParameter ジェネリック型を指定する。ここに解決後の型が入る。
+		classType インスタンス化されているオブジェクトの型
+		pUserProc 現在コンパイル中の関数（ただしクラスメソッドのみ）
+*/
+void ResolveFormalGenericTypeParameter( Type &typeParameter, const Type &classType, const UserProc *pUserProc = NULL );
+
+class GenericType
+{
+	std::string name;
+	Type type;
+
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		trace_for_serialize( "serializing - GenericType" );
+
+		ar & BOOST_SERIALIZATION_NVP( name );
+		ar & BOOST_SERIALIZATION_NVP( type );
+	}
+
+public:
+	GenericType( const std::string &name, const Type &type )
+		: name( name )
+		, type( type )
+	{
+	}
+	GenericType()
+	{
+	}
+	~GenericType()
+	{
+	}
+
+	const std::string &GetName() const
+	{
+		return name;
+	}
+	const Type &GetType() const
+	{
+		return type;
+	}
+};
+
+class BlittableType
+{
+	Type basicType;
+	CClass *pClass;
+
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		trace_for_serialize( "serializing - BlittableType" );
+
+		ar & BOOST_SERIALIZATION_NVP( basicType );
+		ar & BOOST_SERIALIZATION_NVP( pClass );
+	}
+
+public:
+	bool isTargetObjectModule;
+	BlittableType( const Type &basicType, CClass *pClass )
+		: basicType( basicType )
+		, pClass( pClass )
+		, isTargetObjectModule( true )
+	{
+	}
+	BlittableType()
+		: isTargetObjectModule( true )
+	{
+	}
+	const Type &GetBasicType() const
+	{
+		return basicType;
+	}
+	const CClass *GetClassPtr() const
+	{
+		return pClass;
+	}
+	const std::string GetCreateStaticMethodFullName() const;
+};
+class BlittableTypes : public std::vector<BlittableType>
+{
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		trace_for_serialize( "serializing - BlittableTypes" );
+
+		ar & boost::serialization::make_nvp("vector_BlittableType",
+			boost::serialization::base_object<std::vector<BlittableType>>(*this));
+	}
+
+public:
+	bool IsExist( Type type ) const
+	{
+		const BlittableTypes &blittableTypes = *this;
+		BOOST_FOREACH( const BlittableType &blittableType, blittableTypes ){
+			if( blittableType.GetBasicType().Equals( type ) ){
+				return true;
+			}
+		}
+		return false;
+	}
+	const BlittableType &Find( const Type &type ) const
+	{
+		const BlittableTypes &blittableTypes = *this;
+		BOOST_FOREACH( const BlittableType &blittableType, blittableTypes ){
+			if( blittableType.GetBasicType().Equals( type ) ){
+				return blittableType;
+			}
+		}
+		Jenga::Throw( "Blittable型ではない" );
+
+		static BlittableType dummy;
+		return dummy;
+	}
+	const CClass *GetClassPtr( const Type &type ) const
+	{
+		const BlittableTypes &blittableTypes = *this;
+		BOOST_FOREACH( const BlittableType &blittableType, blittableTypes ){
+			if( blittableType.GetBasicType().Equals( type ) ){
+				return blittableType.GetClassPtr();
+			}
+		}
+		return NULL;
+	}
+	const CClass &GetClass( const Type &type ) const
+	{
+		return *GetClassPtr( type );
+	}
+};
Index: trunk/ab5.0/abdev/ab_common/include/Lexical/TypeDef.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/TypeDef.h	(revision 603)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/TypeDef.h	(revision 603)
@@ -0,0 +1,62 @@
+#pragma once
+
+class TypeDefCollection;
+
+class TypeDef : public Symbol
+{
+	friend TypeDefCollection;
+
+	std::string baseName;
+	Type baseType;
+
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		trace_for_serialize( "serializing - TypeDef" );
+
+		ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Symbol );
+		ar & BOOST_SERIALIZATION_NVP( baseName );
+		ar & BOOST_SERIALIZATION_NVP( baseType );
+	}
+
+public:
+	TypeDef( const NamespaceScopes &namespaceScopes, const std::string &name, const std::string &baseName, const Type &baseType );
+	TypeDef()
+	{
+	}
+	~TypeDef()
+	{
+	}
+
+	const std::string &GetBaseName() const
+	{
+		return baseName;
+	}
+	const Type &GetBaseType() const
+	{
+		return baseType;
+	}
+};
+
+class TypeDefCollection : public std::vector<TypeDef>
+{
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		trace_for_serialize( "serializing - TypeDefCollection" );
+
+		ar & boost::serialization::make_nvp("vector_TypeDef",
+			boost::serialization::base_object<std::vector<TypeDef>>(*this));
+	}
+
+public:
+	TypeDefCollection();
+	~TypeDefCollection();
+
+	void Add( const NamespaceScopes &namespaceScopes, const std::string &name, const std::string &baseName, int nowLine );
+	int GetIndex( const Symbol &symbol ) const;
+};
Index: trunk/ab5.0/abdev/ab_common/include/Lexical/Variable.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/Lexical/Variable.h	(revision 603)
+++ trunk/ab5.0/abdev/ab_common/include/Lexical/Variable.h	(revision 603)
@@ -0,0 +1,254 @@
+#pragma once
+
+class Variable : public Symbol
+{
+	Type type;
+	bool isConst;
+	bool isRef;
+	bool isArray;
+	Subscripts subscripts;
+
+	bool isParameter;
+	bool hasInitData;
+
+	//コンストラクタ用パラメータ
+	std::string paramStrForConstructor;
+
+
+	/* --- オフセット ---
+		※グローバル変数で初期バッファがない場合は最上位ビットに1がセットされ、
+		初期バッファの有無が識別される。
+		（その後、スケジュール実行により、実際の配置に並び替えられる）*/
+	int offset;
+
+
+	//レキシカルスコープ用
+	int scopeStartAddress;
+	int scopeEndAddress;
+	int scopeLevel;
+
+
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		trace_for_serialize( "serializing - Variable" );
+
+		ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Symbol );
+		ar & BOOST_SERIALIZATION_NVP( type );
+		ar & BOOST_SERIALIZATION_NVP( isConst );
+		ar & BOOST_SERIALIZATION_NVP( isRef );
+		ar & BOOST_SERIALIZATION_NVP( isArray );
+		ar & BOOST_SERIALIZATION_NVP( subscripts );
+		ar & BOOST_SERIALIZATION_NVP( isParameter );
+		ar & BOOST_SERIALIZATION_NVP( hasInitData );
+		ar & BOOST_SERIALIZATION_NVP( paramStrForConstructor );
+		ar & BOOST_SERIALIZATION_NVP( offset );
+		ar & BOOST_SERIALIZATION_NVP( scopeStartAddress );
+		ar & BOOST_SERIALIZATION_NVP( scopeEndAddress );
+		ar & BOOST_SERIALIZATION_NVP( scopeLevel );
+	}
+
+public:
+	Variable( const Symbol &symbol, const Type &type, bool isConst, bool isRef, const std::string &paramStrForConstructor, bool hasInitData );
+	Variable( const NamespaceScopes &namespaceScopes, const std::string &name, const Type &type, bool isConst, bool isRef, const std::string &paramStrForConstructor, bool hasInitData );
+	Variable( const Variable &var );
+	Variable();
+
+	void SetArray( const Subscripts &subscripts ){
+		isArray = true;
+		this->subscripts = subscripts;
+	}
+
+	const Type &GetType() const
+	{
+		return type;
+	}
+	void ConstOff(){
+		isConst = false;
+	}
+	void ConstOn(){
+		isConst = true;
+	}
+	bool IsConst() const
+	{
+		return isConst;
+	}
+	bool IsRef() const
+	{
+		return isRef;
+	}
+	bool IsArray()const
+	{
+		return isArray;
+	}
+	const Subscripts &GetSubscripts() const
+	{
+		return subscripts;
+	}
+
+	void ThisIsParameter(){
+		isParameter = true;
+	}
+	bool IsParameter() const
+	{
+		return isParameter;
+	}
+	bool HasInitData() const
+	{
+		return hasInitData;
+	}
+
+
+	int GetMemorySize() const
+	{
+		if( isRef || isParameter ){
+			return PTR_SIZE;
+		}
+
+		int size = type.GetSize();
+
+		if( isArray ){
+			int num = 1;
+			for( int i=0; i<(int)subscripts.size(); i++){
+				num *= subscripts[i]+1;
+			}
+			size *= num;
+		}
+
+		if( size % PTR_SIZE ){
+			size += PTR_SIZE-(size%PTR_SIZE);
+		}
+
+		return size;
+	}
+
+	int GetOffsetAddress() const
+	{
+		return offset;
+	}
+	void SetOffsetAddress( int offset )
+	{
+		this->offset = offset;
+	}
+
+	const std::string &GetParamStrForConstructor() const
+	{
+		return paramStrForConstructor;
+	}
+
+	//レキシカルスコープ用
+	int GetScopeStartAddress() const
+	{
+		return scopeStartAddress;
+	}
+	void SetScopeStartAddress( int scopeStartAddress )
+	{
+		this->scopeStartAddress = scopeStartAddress;
+	}
+	int GetScopeEndAddress() const
+	{
+		return scopeEndAddress;
+	}
+	void SetScopeEndAddress( int scopeEndAddress )
+	{
+		this->scopeEndAddress = scopeEndAddress;
+	}
+	int GetScopeLevel() const
+	{
+		return scopeLevel;
+	}
+	void SetScopeLevel( int scopeLevel )
+	{
+		this->scopeLevel = scopeLevel;
+	}
+
+
+	bool isLiving;
+	int source_code_address;
+
+
+	static int GetSubScriptCounts( const Subscripts &subscripts ){
+		// 配列の要素数を取得
+		int i,i2;
+		for(i=0,i2=1;i<(int)subscripts.size();i++){
+			i2 *= subscripts[i]+1;
+		}
+		return i2;
+	}
+};
+
+class Variables : public std::vector<Variable *>
+{
+protected:
+	int allSize;
+
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		trace_for_serialize( "serializing - Variables" );
+
+		ar & boost::serialization::make_nvp("vector_Variable", boost::serialization::base_object<vector<Variable *>>(*this));
+	}
+
+public:
+	Variables()
+		: allSize( 0 )
+	{
+	}
+	~Variables(){
+		Clear();
+	}
+
+	void Clear(){
+		for( int i=0; i<(int)this->size(); i++ ){
+			delete (*this)[i];
+		}
+
+		allSize = 0;
+		clear();
+	}
+	void PullOutAll()
+	{
+		clear();
+	}
+
+	int GetAllSize() const
+	{
+		return allSize;
+	}
+
+	bool DuplicateCheck( const Symbol &symbol, int nowScopeLevel ) const;
+
+	const Variable *BackSearch( const Symbol &symbol, int nowScopeLevel ) const;
+	const Variable *Find( const Symbol &symbol )const;
+};
+
+class GlobalVars : public Variables
+{
+public:
+	Jenga::Common::Binary initAreaBuffer;
+
+	// XMLシリアライズ用
+private:
+	friend class boost::serialization::access;
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
+	{
+		trace_for_serialize( "serializing - GlobalVars" );
+
+		ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Variables );
+		ar & BOOST_SERIALIZATION_NVP( initAreaBuffer );
+	}
+public:
+	GlobalVars()
+	{
+	}
+	~GlobalVars()
+	{
+	}
+
+	void Add( Variable *pVar, bool isResetOffsetAddress = true );
+};
Index: trunk/ab5.0/abdev/ab_common/include/ab_common.h
===================================================================
--- trunk/ab5.0/abdev/ab_common/include/ab_common.h	(revision 601)
+++ trunk/ab5.0/abdev/ab_common/include/ab_common.h	(revision 603)
@@ -1,3 +1,5 @@
 #pragma once
+
+#define trace_for_serialize( msg )
 
 #include "BasicFixed.h"
@@ -8,2 +10,21 @@
 #include "Lexical/Prototype.h"
 #include "Lexical/TypeMisc.h"
+
+using namespace ActiveBasic::Common::Lexical;
+
+#include "Lexical/NativeCode.h"
+#include "Lexical/Source.h"
+#include "Lexical/Type.h"
+#include "Lexical/Method.h"
+#include "Lexical/Interface.h"
+#include "Lexical/Member.h"
+#include "Lexical/Class.h"
+#include "Lexical/Parameter.h"
+#include "Lexical/Variable.h"
+#include "Lexical/Procedure.h"
+#include "Lexical/TypeDef.h"
+#include "Lexical/Const.h"
+#include "Lexical/Delegate.h"
+#include "Lexical/Meta.h"
+#include "Lexical/DataTable.h"
+#include "Lexical/ObjectModule.h"
