Index: trunk/ab5.0/abdev/BasicCompiler_Common/include/Class.h
===================================================================
--- trunk/ab5.0/abdev/BasicCompiler_Common/include/Class.h	(revision 510)
+++ trunk/ab5.0/abdev/BasicCompiler_Common/include/Class.h	(revision 511)
@@ -411,11 +411,8 @@
 
 	// クラス継承
-	bool Inherits( const char *inheritNames, int nowLine );
 	bool InheritsClass( const CClass &inheritsClass, const Types &actualTypeParameters, int nowLine );
-	bool InheritsInterface( const CClass &inheritsClass, int nowLine );
 
 	// インターフェイス実装
 	bool Implements( const CClass &interfaceClass, const Types &actualTypeParameters, int nowLine );
-	bool Implements( const char *interfaceNames, int nowLine );
 
 	//メンバ、メソッドの追加
@@ -423,7 +420,4 @@
 	void AddMember( Prototype::Accessibility accessibility, bool idConst, bool isRef, char *buffer, int nowLine );
 	void AddStaticMember( Prototype::Accessibility accessibility, bool isConst, bool isRef, char *buffer, int nowLine );
-
-	void AddMethod(CClass *pobj_c, Prototype::Accessibility accessibility, BOOL bStatic, bool isConst, bool isAbstract,
-		bool isVirtual, bool isOverride, bool isAutoGeneration, char *buffer, int nowLine);
 
 	//重複チェック
@@ -593,5 +587,4 @@
 	bool Insert( CClass *pClass, int nowLine );
 	CClass *Add( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const char *name,int nowLine);
-	virtual void CollectClassesForNameOnly( const BasicSource &source );
 
 	// vtblを一時的に生成
@@ -603,11 +596,4 @@
 	virtual void InitStaticMember();
 
-private:
-	bool MemberVar_LoopRefCheck(const CClass &objClass);
-public:
-	virtual void GetClass_recur(const char *lpszInheritsClass);
-	void LookaheadClass( const char *className );
-	bool LoopRefCheck( const CClass &objClass );
-	virtual void GetAllClassInfo();
 	virtual void Compile_System_InitializeUserTypes();
 	virtual void Compile_System_InitializeUserTypesForBaseType();
Index: trunk/ab5.0/abdev/BasicCompiler_Common/include/LexicalAnalyzer.h
===================================================================
--- trunk/ab5.0/abdev/BasicCompiler_Common/include/LexicalAnalyzer.h	(revision 510)
+++ trunk/ab5.0/abdev/BasicCompiler_Common/include/LexicalAnalyzer.h	(revision 511)
@@ -7,7 +7,27 @@
 {
 public:
+
+	// 名前空間を収集
 	static bool CollectNamespaces( const char *source, NamespaceScopesCollection &namespaceScopesCollection );
+
+	// フルネーム識別子をシンボルに変換する
 	static Symbol FullNameToSymbol( const char *fullName );
 	static Symbol FullNameToSymbol( const std::string &fullName );
+
+	// クラスの名前情報を収集する
+	static void CollectClassesForNameOnly( const char *source, Classes &classes );
+
+	// クラスを収集する
+	static void AddMethod(CClass *pobj_c, UserProc *pUserProc, Prototype::Accessibility accessibility, BOOL bStatic, bool isConst, bool isAbstract,
+		bool isVirtual, bool isOverride, const char *interfaceName, bool isAutoGeneration, int nowLine);
+	static bool Inherits( CClass &currentClass, const char *inheritNames, int nowLine );
+	static bool Implements( CClass &currentClass, const char *interfaceNames, int nowLine );
+	static void LookaheadClass( const char *className, Classes &classes );
+	static bool LoopRefCheck( const CClass &objClass );
+	static void CollectClasses( const char *source, Classes &classes );
+
+	// グローバルプロシージャを収集する
+	static UserProc* ParseUserProc( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, char *buffer,int nowLine,bool isVirtual,CClass *pobj_c, bool isStatic, char *interfaceName = NULL );
+	static void CollectProcedures( const BasicSource &source, UserProcs &userProcs, DllProcs &dllProcs );
 };
 
Index: trunk/ab5.0/abdev/BasicCompiler_Common/include/Procedure.h
===================================================================
--- trunk/ab5.0/abdev/BasicCompiler_Common/include/Procedure.h	(revision 510)
+++ trunk/ab5.0/abdev/BasicCompiler_Common/include/Procedure.h	(revision 511)
@@ -180,5 +180,5 @@
 public:
 
-	UserProc( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const string &name, Kind kind, bool isMacro, bool isCdecl, bool isExport, int id )
+	UserProc( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const string &name, Kind kind, bool isMacro, bool isCdecl, bool isExport )
 		: Procedure( namespaceScopes, name, kind, isCdecl )
 		, importedNamespaces( importedNamespaces )
@@ -187,4 +187,6 @@
 		, pMethod( NULL )
 		, isMacro( isMacro )
+		, secondParmNum( 0 )
+		, realSecondParmNum( 1 )
 		, isExport( isExport )
 		, isSystem( false )
@@ -193,6 +195,7 @@
 		, beginOpAddress( 0 )
 		, endOpAddress( 0 )
-		, id( id )
-	{
+	{
+		static int id_base=0;
+		id = ( id_base ++ );
 	}
 	UserProc()
@@ -204,4 +207,9 @@
 			delete pParam;
 		}
+	}
+
+	void SetReturnType( const Type &newReturnType )
+	{
+		returnType = newReturnType;
 	}
 
@@ -244,4 +252,8 @@
 		return realParams;
 	}
+	void SetRealParams( const Parameters &params )
+	{
+		realParams = params;
+	}
 	int GetRealSecondParmNum() const
 	{
@@ -396,6 +408,4 @@
 class UserProcs : public Jenga::Common::Hashmap<UserProc>
 {
-	std::vector<std::string> macroNames;
-
 	// XMLシリアライズ用
 private:
@@ -407,5 +417,4 @@
 		ar & boost::serialization::make_nvp("Hashmap_UserProcImpl",
 			boost::serialization::base_object<Jenga::Common::Hashmap<UserProc>>(*this));
-		ar & BOOST_SERIALIZATION_NVP( macroNames );
 	}
 
@@ -420,6 +429,4 @@
 
 	bool Insert( UserProc *pUserProc, int nowLine );
-
-	UserProc *AddUserProc( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, char *buffer,int nowLine,bool isVirtual,CClass *pobj_c, bool isStatic, char *interfaceName = NULL );
 
 	void EnumGlobalProcs( const char *simpleName, const char *localName, std::vector<const UserProc *> &subs );
@@ -511,6 +518,4 @@
 };
 
-void CollectProcedures( const BasicSource &source, UserProcs &userProcs, DllProcs &dllProcs );
-
 class ProcPointer : public Procedure
 {
Index: trunk/ab5.0/abdev/BasicCompiler_Common/include/Variable.h
===================================================================
--- trunk/ab5.0/abdev/BasicCompiler_Common/include/Variable.h	(revision 510)
+++ trunk/ab5.0/abdev/BasicCompiler_Common/include/Variable.h	(revision 511)
@@ -57,44 +57,8 @@
 
 public:
-	Variable( const string &name, const Type &type, bool isConst, bool isRef, const std::string &paramStrForConstructor, bool hasInitData )
-		: Symbol( ActiveBasic::Compiler::LexicalAnalyzer::FullNameToSymbol( name ) )
-		, type( type )
-		, isConst( isConst )
-		, isRef( isRef )
-		, isArray( false )
-		, isParameter( false)
-		, paramStrForConstructor( paramStrForConstructor )
-		, hasInitData( hasInitData )
-	{
-	}
-	Variable( const NamespaceScopes &namespaceScopes, const string &name, const Type &type, bool isConst, bool isRef, const std::string &paramStrForConstructor, bool hasInitData )
-		: Symbol( namespaceScopes, name )
-		, type( type )
-		, isConst( isConst )
-		, isRef( isRef )
-		, isArray( false )
-		, isParameter( false)
-		, paramStrForConstructor( paramStrForConstructor )
-		, hasInitData( hasInitData )
-	{
-	}
-	Variable( const Variable &var )
-		: Symbol( var )
-		, type( var.type )
-		, isConst( var.isConst )
-		, isRef( var.isRef )
-		, isArray( var.isArray )
-		, subscripts( var.subscripts )
-		, isParameter( false )
-		, paramStrForConstructor( var.paramStrForConstructor )
-		, hasInitData( var.hasInitData )
-	{
-	}
-	Variable()
-	{
-	}
-	~Variable()
-	{
-	}
+	Variable( const string &name, const Type &type, bool isConst, bool isRef, const std::string &paramStrForConstructor, bool hasInitData );
+	Variable( const NamespaceScopes &namespaceScopes, const 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 ){
