Index: trunk/abdev/BasicCompiler_Common/include/Procedure.h
===================================================================
--- trunk/abdev/BasicCompiler_Common/include/Procedure.h	(revision 206)
+++ trunk/abdev/BasicCompiler_Common/include/Procedure.h	(revision 208)
@@ -3,5 +3,4 @@
 #include <jenga/include/common/Hashmap.h>
 #include <jenga/include/smoothie/Source.h>
-#include <jenga/include/smoothie/LexicalAnalysis.h>
 
 #include <option.h>
@@ -16,5 +15,5 @@
 class CMethod;
 
-class Procedure
+class Procedure : public Symbol
 {
 public:
@@ -26,6 +25,4 @@
 
 private:
-	string name;						// プロシージャ名
-
 	Kind kind;
 
@@ -48,13 +45,9 @@
 private:
 	friend class boost::serialization::access;
-	BOOST_SERIALIZATION_SPLIT_MEMBER();
-	template<class Archive> void load(Archive& ar, const unsigned int version)
+	template<class Archive> void serialize(Archive& ar, const unsigned int version)
 	{
 		trace_for_serialize( "serializing - Procedure" );
 
-		std::string _name;
-		ar & BOOST_SERIALIZATION_NVP( _name );
-		this->name = Operator_NaturalStringToCalcMarkString( _name );
-
+		ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Symbol );
 		ar & BOOST_SERIALIZATION_NVP( kind );
 		ar & BOOST_SERIALIZATION_NVP( isCdecl );
@@ -64,22 +57,8 @@
 		ar & BOOST_SERIALIZATION_NVP( codePos );
 	}
-	template<class Archive> void save(Archive& ar, const unsigned int version) const
-	{
-		trace_for_serialize( "serializing - Procedure" );
-
-		std::string _name = Operator_CalcMarkStringToNaturalString( name );
-		ar & BOOST_SERIALIZATION_NVP( _name );
-
-		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 string &name, Kind kind, bool isCdecl )
-		: name( name )
+
+public:
+	Procedure( const NamespaceScopes &namespaceScopes, const string &name, Kind kind, bool isCdecl )
+		: Symbol( namespaceScopes, name )
 		, kind( kind )
 		, isCdecl( isCdecl )
@@ -97,9 +76,4 @@
 	}
 
-	const string &GetName() const
-	{
-		return name;
-	}
-
 	bool IsSub() const
 	{
@@ -145,5 +119,4 @@
 
 private:
-	NamespaceScopes namespaceScopes;
 	NamespaceScopesCollection importedNamespaces;
 
@@ -183,5 +156,4 @@
 		ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Procedure );
 		ar & BOOST_SERIALIZATION_NVP( _paramStr );
-		ar & BOOST_SERIALIZATION_NVP( namespaceScopes );
 		ar & BOOST_SERIALIZATION_NVP( importedNamespaces );
 		ar & boost::serialization::make_nvp("pParentClass", const_cast<CClass *&>(pParentClass) );
@@ -204,6 +176,5 @@
 
 	UserProc( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const string &name, Kind kind, bool isMacro, bool isCdecl, bool isExport, int id )
-		: Procedure( name, kind, isCdecl )
-		, namespaceScopes( namespaceScopes )
+		: Procedure( namespaceScopes, name, kind, isCdecl )
 		, importedNamespaces( importedNamespaces )
 		, pParentClass( NULL )
@@ -314,5 +285,5 @@
 	}
 
-	const NamespaceScopes &GetNamespaceScopes() const;
+	virtual const NamespaceScopes &GetNamespaceScopes() const;
 	const NamespaceScopesCollection &GetImportedNamespaces() const;
 
@@ -340,8 +311,4 @@
 	}
 
-	bool IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const;
-	bool IsEqualSymbol( const UserProc &globalProc ) const;
-	bool IsEqualSymbol( const string &name ) const;
-
 	bool IsVirtual() const;
 
@@ -360,4 +327,8 @@
 	{
 		return ( pParentClass != NULL );
+	}
+	bool IsGlobalProcedure() const
+	{
+		return ( pParentClass == NULL );
 	}
 	void SetMethod( CMethod *pMethod ){
@@ -428,6 +399,4 @@
 class DllProc : public Procedure
 {
-	NamespaceScopes namespaceScopes;
-
 	string dllFileName;
 	string alias;
@@ -442,5 +411,4 @@
 
 		ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( Procedure );
-		ar & BOOST_SERIALIZATION_NVP( namespaceScopes );
 		ar & BOOST_SERIALIZATION_NVP( dllFileName );
 		ar & BOOST_SERIALIZATION_NVP( alias );
@@ -453,6 +421,5 @@
 
 	DllProc( const NamespaceScopes &namespaceScopes, const string &name, Kind kind, bool isCdecl, const string &dllFileName, const string &alias ):
-	  Procedure( name, kind, isCdecl ),
-	  namespaceScopes( namespaceScopes ),
+	  Procedure( namespaceScopes, name, kind, isCdecl ),
 	  dllFileName( dllFileName ),
 	  alias( alias ),
@@ -463,12 +430,4 @@
 	~DllProc(){}
 
-	virtual bool IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const;
-	bool IsEqualSymbol( const string &name ) const;
-
-	const NamespaceScopes &GetNamespaceScopes() const
-	{
-		return namespaceScopes;
-	}
-
 	const string &GetDllFileName() const
 	{
@@ -505,5 +464,5 @@
 public:
 	ProcPointer( Kind kind )
-		: Procedure( "", kind, false )
+		: Procedure( NamespaceScopes(), std::string(), kind, false )
 	{
 	}
