Index: trunk/jenga/include/smoothie/BasicFixed.h
===================================================================
--- trunk/jenga/include/smoothie/BasicFixed.h	(revision 170)
+++ trunk/jenga/include/smoothie/BasicFixed.h	(revision 170)
@@ -0,0 +1,205 @@
+//BasicFixed.h
+
+
+#define MAX_ARRAYDIM	16
+#define PTR_SIZE		sizeof(LONG_PTR)
+#define VN_SIZE			1024
+#define MAX_LEN			65535
+
+
+////////////////
+// マシンタイプ
+////////////////
+
+#define MACHINE_X86		1
+#define MACHINE_AMD64	2
+
+
+////////////////
+// 型
+////////////////
+
+#define DEF_NON			-1
+
+/* basic\command.sbp内の "_System_Type_***" 定数と同期が必要 */
+#define FLAG_PTR		0x80000000
+#define FLAG_CAST		0x40000000
+
+//整数型
+#define DEF_SBYTE		0x00000001
+#define DEF_BYTE		0x00000002
+#define DEF_INTEGER		0x00000003
+#define DEF_WORD		0x00000004
+#define DEF_LONG		0x00000005
+#define DEF_DWORD		0x00000006
+#define DEF_INT64		0x00000007
+#define DEF_QWORD		0x00000008
+
+//実数型
+#define DEF_SINGLE		0x00000009
+#define DEF_DOUBLE		0x0000000A
+
+//文字型
+#define DEF_CHAR		0x0000000B
+
+//bool型
+#define DEF_BOOLEAN		0x0000000C
+
+//文字列型
+#define DEF_STRING		0x0000000D
+
+//ポインタ型
+#define DEF_PTR_VOID	0x0000000E
+#define DEF_PTR_PROC	0x0000000F
+
+//特殊型
+#define DEF_ANY			0x00000015
+#define DEF_OBJECT		0x00000016
+#define DEF_STRUCT		0x00000017
+#define DEF_ELLIPSE		0x00000018
+
+//ポインタ型
+#define MASK_PTR		0x0000ff00
+#define MASK_NATURAL	0x000000ff
+
+#define PTR_LEVEL(t)	(((t)&MASK_PTR)>>8)
+#define NATURAL_TYPE(t)	((t)&MASK_NATURAL)
+#define MAKE_PTR_TYPE(t,p)	((t)|((p)<<8))
+#define PTR_LEVEL_UP(t)		t = MAKE_PTR_TYPE(NATURAL_TYPE(t),PTR_LEVEL(t)+1)
+#define PTR_LEVEL_DOWN(t)	t = MAKE_PTR_TYPE(NATURAL_TYPE(t),PTR_LEVEL(t)-1)
+
+#define DEF_PTR_OBJECT	MAKE_PTR_TYPE(DEF_OBJECT,1)
+#define DEF_PTR_STRUCT	MAKE_PTR_TYPE(DEF_STRUCT,1)
+
+
+
+//NumOpe関数の結果がリテラル値の場合、その値の補助情報がindexに格納される
+#define LITERAL_NULL		-2
+#define LITERAL_M128_0		-3
+#define LITERAL_0_255		-4
+#define LITERAL_M32768_0	-5
+#define LITERAL_0_65535		-6
+#define LITERAL_OTHER_MINUS	-7
+#define LITERAL_OTHER_PLUS	-8
+
+#define LITERAL_STRING		-9
+
+#define IS_LITERAL(x) (x<=LITERAL_NULL&&x!=LITERAL_STRING)
+#define IS_MINUS_LITERAL(x) (x==LITERAL_M128_0||x==LITERAL_M32768_0||x==LITERAL_OTHER_MINUS)
+#define IS_POSITIVE_LITERAL(x) (x==LITERAL_NULL||x==LITERAL_0_255||x==LITERAL_0_65535||x==LITERAL_OTHER_PLUS)
+
+//////////////////////////////////////
+/* 演算子（優先順位が関係している） */
+//////////////////////////////////////
+
+//論理演算子
+#define CALC_XOR			3	// Xor
+#define CALC_OR				6	// Or
+#define CALC_AND			9	// And
+#define CALC_NOT			12	// Not
+
+//比較演算子
+#define CALC_PE				21	// <=
+#define CALC_QE				22	// >=
+#define CALC_NOTEQUAL		23	// <>
+#define CALC_EQUAL			24	// =
+#define CALC_P				25	// <
+#define CALC_Q				26	// >
+
+//算術演算子
+#define CALC_SHL			31	//<<
+#define CALC_SHR			32	//>>
+#define CALC_ADDITION		41	// +
+#define CALC_SUBTRACTION	42	// -
+#define CALC_STRPLUS		43	// &
+#define CALC_MOD			51	// Mod
+#define CALC_PRODUCT		61	// *
+#define CALC_QUOTIENT		62	// /
+#define CALC_INTQUOTIENT	63	//整数除算
+#define CALC_AS				71	// As
+#define CALC_BYVAL			72	// ByVal
+#define CALC_MINUSMARK		81	// -x
+#define CALC_POWER			91	// ^
+
+//代入演算子
+#define CALC_SUBSITUATION	200
+
+//添え字演算子
+#define CALC_ARRAY_GET		201
+#define CALC_ARRAY_SET		202
+
+
+//////////////////////////////////////////////////////////////////////
+// エスケープシーケンス用のバイトコードは0xA0～0xCFの範囲も利用できる
+//////////////////////////////////////////////////////////////////////
+
+//以下制御用エスケープシーケンス
+#define ESC_MOD				'1'		// MOD 演算子
+#define ESC_AND				'&'		// AND 演算子
+#define ESC_OR				'3'		// OR 演算子
+#define ESC_XOR				'4'		// XOR 演算子
+#define ESC_NOT				'5'		// NOT 演算子
+#define ESC_AS				'6'		// AS（区切り文字）
+#define ESC_THEN			2		// Then
+#define ESC_ELSE			3		// Else
+#define ESC_IF				'A'		// If
+#define ESC_ELSEIF			'B'		// ElseIf
+#define ESC_ENDIF			'C'		// End If
+#define ESC_DEF				'D'		// Def
+#define ESC_DECLARE			'E'		// Declare
+#define ESC_SUB				'F'		// Sub
+#define ESC_ENDSUB			'G'		// End Sub
+#define ESC_EXITSUB			'H'		// Exit Sub
+#define ESC_FUNCTION		'I'		// Function
+#define ESC_ENDFUNCTION		'J'		// End Function
+#define ESC_EXITFUNCTION	'K'		// Exit Function
+#define ESC_BYVAL			'L'		// ByVal
+#define ESC_BYREF			'M'		// ByRef
+#define ESC_TYPE			'N'		// Type
+#define ESC_ENDTYPE			'O'		// End Type
+#define ESC_EXITFOR			'P'		// Exit For
+#define ESC_EXITWHILE		'Q'		// Exit Wend
+#define ESC_EXITDO			'R'		// Exit Do
+#define ESC_SELECTCASE		'S'		// Select Case
+#define ESC_CASE			'T'		// Case
+#define ESC_CASEELSE		'U'		// Case Else
+#define ESC_ENDSELECT		'V'		// End Select
+#define ESC_CONST			'W'		// Const
+#define ESC_WITH			'X'		// With
+#define ESC_ENDWITH			'Y'		// End With
+#define ESC_CDECL			'Z'		// cdecl規約
+#define ESC_MACRO			'a'		// Macro
+#define ESC_ENDMACRO		'b'		// End Macro
+#define ESC_EXITMACRO		'c'		// Exit Macro
+#define ESC_EXPORT			'd'		// Export
+#define ESC_CONTINUE		'e'		// Continue
+#define ESC_PSMEM			'f'		// "->" Member of Pointer Struct（構造体ポインタのメンバ参照）
+#define ESC_STATIC			'g'		// Static
+#define ESC_TYPEDEF			'h'		// TypeDef
+#define ESC_TRY				'i'		// Try
+#define ESC_CATCH			'j'		// Catch
+#define ESC_FINALLY			'k'		// Finally
+#define ESC_THROW			'l'		// Throw
+#define ESC_ENDTRY			'm'		// End Try
+#define ESC_NAMESPACE		'o'		// Namespace
+#define ESC_ENDNAMESPACE	'p'		// End Namespace
+#define ESC_IMPORTS			'q'		// Imports
+#define ESC_CLEARNAMESPACEIMPORTED 'r'	// _ClearNamespaceImported
+//EXEファイル用制御エスケープシーケンス
+#define ESC_USING			's'		// Print命令語のUsing
+#define ESC_FOR				't'		// Open命令語のFor
+#define ESC_LINENUM			'u'		// 行番号を示す
+
+//オブジェクト指向エスケープシーケンス
+#define ESC_CLASS			(char)0xA0
+#define ESC_ENDCLASS		(char)0xA1
+#define ESC_ABSTRACT		(char)0xA2
+#define ESC_VIRTUAL			(char)0xA3
+#define ESC_OVERRIDE		(char)0xA4
+#define ESC_INHERITS		(char)0xA5
+#define ESC_ENUM			(char)0xA6
+#define ESC_ENDENUM			(char)0xA7
+#define ESC_NEW				(char)0xA8
+#define ESC_INTERFACE		(char)0xA9
+#define ESC_ENDINTERFACE	(char)0xAA
+#define ESC_OPERATOR		(char)0xAB
Index: trunk/jenga/include/smoothie/Class.h
===================================================================
--- trunk/jenga/include/smoothie/Class.h	(revision 170)
+++ trunk/jenga/include/smoothie/Class.h	(revision 170)
@@ -0,0 +1,18 @@
+#pragma once
+
+#include "Prototype.h"
+
+class CClass : public Prototype
+{
+public:
+	//メンバの参照方法
+	enum RefType{
+		Non = 0,		// no reference member
+		Dot,			// obj.member
+		Pointer,		// obj->member
+	};
+};
+
+class Classes
+{
+};
Index: trunk/jenga/include/smoothie/LexicalScoping.h
===================================================================
--- trunk/jenga/include/smoothie/LexicalScoping.h	(revision 170)
+++ trunk/jenga/include/smoothie/LexicalScoping.h	(revision 170)
@@ -0,0 +1,72 @@
+
+
+enum SCOPE_TYPE{
+	//ベース
+	SCOPE_TYPE_BASE,
+
+	//分岐
+	SCOPE_TYPE_IF,
+
+	//ループ
+	SCOPE_TYPE_DO,
+	SCOPE_TYPE_FOR,
+	SCOPE_TYPE_WHILE,
+
+	//ケース分け
+	SCOPE_TYPE_SELECT,
+};
+
+class CScope{
+	int level;
+	int StartAddress;
+	SCOPE_TYPE TypeOfStatement;
+
+	DWORD *pBreakSchedule;
+	int nBreakSchedule;
+
+public:
+	CScope( int level, int addr, SCOPE_TYPE TypeOfStatement );
+	~CScope();
+
+	int GetStartAddress();
+	SCOPE_TYPE GetTypeOfStatement();
+
+	void Break();
+	void RunScheduleOfBreak();
+};
+
+class CLexicalScopes{
+	CScope **ppScopes;
+	int level;
+
+	CScope *SearchScope( SCOPE_TYPE TypeOfStatement );
+
+public:
+	CLexicalScopes();
+	~CLexicalScopes();
+
+	//初期化（関数コンパイルの開始時に呼び出される）
+	void Init(int addr);
+
+	// スコープを開始
+	void Start( int addr, SCOPE_TYPE TypeOfStatement );
+
+	//スコープを終了
+	void End();
+
+	//スコープ抜け出しステートメント
+	void Break();
+	void ExitFor();
+	void ExitWhile();
+	void ExitDo();
+
+	int GetNowLevel(void);
+	void SetNowLevel( int level );
+	int GetStartAddress(void);
+
+	//スコープ終了時のデストラクタ呼び出し
+	void CallDestructorsOfScopeEnd();
+
+	//Returnステートメント用のデストラクタ呼び出し
+	void CallDestructorsOfReturn( int BaseLevel = 0 );
+};
Index: trunk/jenga/include/smoothie/Member.h
===================================================================
--- trunk/jenga/include/smoothie/Member.h	(revision 170)
+++ trunk/jenga/include/smoothie/Member.h	(revision 170)
@@ -0,0 +1,108 @@
+#pragma once
+
+#include <string>
+#include <vector>
+
+#include "Type.h"
+#include "Class.h"
+#include "Source.h"
+
+using namespace std;
+
+class CClass;
+
+class CMember : public MemberPrototype
+{
+	string name;
+	Type type;
+	bool isConst;
+
+	string initializeExpression;
+	string constructParameter;
+public:
+	int SubScripts[MAX_ARRAYDIM];
+
+	int source_code_address;
+
+	const string &GetName() const
+	{
+		return name;
+	}
+	void SetName( const string &name )
+	{
+		this->name = name;
+	}
+
+	Type GetType() const
+	{
+		return type;
+	}
+
+	bool IsConst()
+	{
+		return isConst;
+	}
+
+	const string &GetInitializeExpression() const
+	{
+		return initializeExpression;
+	}
+	const string &GetConstructParameter() const
+	{
+		return constructParameter;
+	}
+
+	CMember( Prototype::Accessibility accessibility, const string &name, const Type &type, bool isConst )
+		: MemberPrototype( accessibility )
+		, name( name )
+		, type( type )
+		, isConst( isConst )
+	{
+	}
+	CMember( CClass *pobj_c, Prototype::Accessibility accessibility, bool idConst, bool isRef, char *buffer, int nowLine=-1 );
+	CMember( CMember &member );
+	~CMember();
+	static void InitStaticMember(void);
+
+	static bool SplitName( const char *desc, char *object, char *member, CClass::RefType &refType ){
+		int lastIndex = -1;
+		for( int i=0; desc[i]; i++ ){
+			if( desc[i] == '(' ){
+				i=BasicSource::JumpStringInPare(desc,i+1);
+				continue;
+			}
+			else if( desc[i] == '[' ){
+				i=BasicSource::JumpStringInBracket(desc,i+1);
+				continue;
+			}
+			else if(desc[i]=='.'||(desc[i]==1&&desc[i+1]==ESC_PSMEM)){
+				lastIndex = i;
+			}
+		}
+		if( lastIndex == -1 ){
+			lstrcpy( member, desc );
+			return false;
+		}
+
+		if(desc[lastIndex]=='.'){
+			lstrcpy(member,desc+lastIndex+1);
+			refType = CClass::Dot;
+		}
+		else{
+			lstrcpy(member,desc+lastIndex+2);
+			refType = CClass::Pointer;
+		}
+
+		if( object ){
+			lstrcpy( object, desc );
+			object[lastIndex]=0;
+		}
+
+		return true;
+	}
+	static bool SplitName( const char *desc, char *object, char *member ){
+		CClass::RefType dummyRefType;
+		return SplitName( desc, object, member, dummyRefType );
+	}
+};
+typedef std::vector<CMember *> Members;
Index: trunk/jenga/include/smoothie/Method.h
===================================================================
--- trunk/jenga/include/smoothie/Method.h	(revision 170)
+++ trunk/jenga/include/smoothie/Method.h	(revision 170)
@@ -0,0 +1,127 @@
+#pragma once
+
+#include <string>
+#include <vector>
+
+#include <windows.h>
+
+#include "Class.h"
+#include "Procedure.h"
+
+using namespace std;
+
+class UserProc;
+class CClass;
+void SetError();
+
+class CMethod : public MemberPrototype
+{
+public:
+	UserProc *pUserProc;
+
+	CMethod( UserProc *pUserProc, Prototype::Accessibility accessibility )
+		: MemberPrototype( accessibility )
+		, pUserProc( pUserProc )
+	{
+	}
+
+	virtual bool IsAbstract() const = 0;
+	virtual void Override() = 0;
+	virtual bool IsVirtual() const = 0;
+	virtual bool IsConst() const = 0;
+	virtual bool IsStatic() const = 0;
+	virtual const CClass *GetInheritsClassPtr() const = 0;
+	virtual void SetInheritsClassPtr( const CClass *pInheritsClass ) = 0;
+};
+
+class DynamicMethod : public CMethod
+{
+	bool isAbstract;
+	bool isVirtual;
+	bool isConst;
+	const CClass *pInheritsClass;
+
+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 )
+	{
+	}
+	DynamicMethod( const CMethod &method )
+		: CMethod( method.pUserProc, method.GetAccessibility() )
+		, isAbstract( method.IsAbstract() )
+		, isVirtual( method.IsVirtual() )
+		, isConst( method.IsConst() )
+		, pInheritsClass( method.GetInheritsClassPtr() )
+	{
+	}
+
+	virtual bool IsAbstract() const
+	{
+		return isAbstract;
+	}
+	virtual void Override()
+	{
+		isAbstract = false;
+	}
+	virtual bool IsVirtual() const
+	{
+		return isVirtual;
+	}
+	virtual bool IsConst() const
+	{
+		return isConst;
+	}
+	virtual bool IsStatic() const
+	{
+		return false;
+	}
+	virtual const CClass *GetInheritsClassPtr() const
+	{
+		return pInheritsClass;
+	}
+	virtual void SetInheritsClassPtr( const CClass *pInheritsClass )
+	{
+		this->pInheritsClass = pInheritsClass;
+	}
+};
+class StaticMethod : public CMethod
+{
+public:
+	StaticMethod( UserProc *pUserProc, Prototype::Accessibility accessibility )
+		: CMethod( pUserProc, accessibility )
+	{
+	}
+
+	virtual bool IsAbstract() const{SetError();return false;}
+	virtual void Override(){SetError();}
+	virtual bool IsVirtual() const{
+		return false;
+	}
+	virtual bool IsConst() const{SetError();return false;}
+	virtual bool IsStatic() const
+	{
+		return true;
+	}
+	virtual const CClass *GetInheritsClassPtr() const{SetError();return NULL;}
+	virtual void SetInheritsClassPtr( const CClass *pInheritsClass ){SetError();}
+};
+
+class Methods : public vector<CMethod *>
+{
+public:
+	Methods();
+	~Methods();
+
+	//メンバ、メソッドの追加
+	void Add( UserProc *pUserProc, Prototype::Accessibility accessibility, bool isConst, bool isAbstract, bool isVirtual );
+	void AddStatic(UserProc *pUserProc,Prototype::Accessibility accessibility);
+
+	const CMethod *GetMethodPtr( UserProc *pUserProc ) const;
+	bool IsExist( const char *name ) const;
+	virtual void Enum( const char *methodName, vector<UserProc *> &subs ) const;
+	virtual void Enum( const BYTE idOperatorCalc, vector<UserProc *> &subs ) const;
+};
Index: trunk/jenga/include/smoothie/Namespace.h
===================================================================
--- trunk/jenga/include/smoothie/Namespace.h	(revision 170)
+++ trunk/jenga/include/smoothie/Namespace.h	(revision 170)
@@ -0,0 +1,135 @@
+#pragma once
+
+#include <vector>
+#include <string>
+#include <boost/foreach.hpp>
+
+using namespace std;
+
+class NamespaceScopes : public vector<string>
+{
+public:
+	NamespaceScopes(){}
+	NamespaceScopes( const string &namespaceStr );
+	~NamespaceScopes(){}
+
+	string ToString() const
+	{
+		string namespaceStr;
+		const vector<string> &me = *this;
+
+		bool isFirst = true;
+		BOOST_FOREACH( const string &itemStr, me ){
+			if( isFirst ){
+				isFirst = false;
+			}
+			else{
+				namespaceStr += ".";
+			}
+
+			namespaceStr += itemStr;
+		}
+		return namespaceStr;
+	}
+
+	// 等しいかをチェック
+	bool IsEqual( const string &name ) const
+	{
+		if( ToString() == name ){
+			return true;
+		}
+		return false;
+	}
+
+	// 等しいかをチェック
+	bool IsEqual( const NamespaceScopes &namespaceScopes ) const
+	{
+		if( ToString() == namespaceScopes.ToString() ){
+			return true;
+		}
+		return false;
+	}
+
+	// 所属しているかをチェック
+	// 例:
+	// baseNamespaceScopes =  "Discoversoft"
+	// entryNamespaceScopes = "Discoversoft.ActiveBasic"
+	// この場合、entryNamespaceScopes は baseNamespaceScopes に所属している。
+	static bool IsBelong( const NamespaceScopes &baseNamespaceScopes, const NamespaceScopes &entryNamespaceScopes )
+	{
+		if( baseNamespaceScopes.size() > entryNamespaceScopes.size() ){
+			return false;
+		}
+
+		for( int i=0; i<(int)baseNamespaceScopes.size(); i++ ){
+			if( baseNamespaceScopes[i] != entryNamespaceScopes[i] ){
+				return false;
+			}
+		}
+		return true;
+	}
+
+	bool IsImported() const;
+
+	bool IsLiving() const;
+
+	// 包括しているかをチェック
+	// 例:
+	// this =   "Discoversoft.ActiveBasic"
+	// living = "Discoversoft.ActiveBasic"
+	// name =   "ActiveBasic"
+	// この場合、living は name を包括している。
+	bool IsCoverd( const string &name ) const;
+	bool IsCoverd( const NamespaceScopes &namespaceScopes ) const;
+
+	// 指定された名前空間が同一エリアと見なされるかどうかをチェック
+	static bool IsSameArea( const NamespaceScopes &baseNamespaceScopes, const NamespaceScopes &entryNamespaceScopes ){
+		if( entryNamespaceScopes.size() ){
+			if( baseNamespaceScopes.IsCoverd( entryNamespaceScopes ) ){
+				// 包括しているときは同一と見なす
+				return true;
+			}
+		}
+		else{
+			if( baseNamespaceScopes.size() ){
+				// 名前空間の判断が必要なとき
+				if( baseNamespaceScopes.IsImported()
+					|| baseNamespaceScopes.IsLiving() ){
+					// Using指定があるとき
+					// または
+					// 指定された名前空間が現在の名前空間スコープと同一のとき
+					return true;
+				}
+			}
+			else{
+				return true;
+			}
+		}
+
+		return false;
+	}
+};
+
+class NamespaceScopesCollection : public vector<NamespaceScopes>
+{
+public:
+	bool IsExist( const NamespaceScopes &namespaceScopes ) const
+	{
+		const NamespaceScopesCollection &namespaceScopesCollection = *this;
+		BOOST_FOREACH( const NamespaceScopes &tempNamespaceScopes, namespaceScopesCollection ){
+			if( tempNamespaceScopes.IsEqual( namespaceScopes ) ){
+				return true;
+			}
+		}
+		return false;
+	}
+	bool IsExist( const string &namespaceStr ) const
+	{
+		return IsExist( NamespaceScopes( namespaceStr ) );
+	}
+	void SplitNamespace( const char *fullName, char *namespaceStr, char *simpleName ) const;
+
+	bool Imports( const string &namespaceStr );
+
+	static bool CollectNamespaces( const char *source, NamespaceScopesCollection &namespaceScopesCollection );
+};
Index: trunk/jenga/include/smoothie/ObjectModule.h
===================================================================
--- trunk/jenga/include/smoothie/ObjectModule.h	(revision 170)
+++ trunk/jenga/include/smoothie/ObjectModule.h	(revision 170)
@@ -0,0 +1,23 @@
+#pragma once
+
+#include "TypeDef.h"
+#include "Namespace.h"
+#include "Procedure.h"
+
+// プロジェクト中に存在するメタ情報
+class Meta{
+public:
+	// 名前空間
+	NamespaceScopesCollection namespaceScopesCollection;
+
+	// クラス
+
+	// TypeDef
+	TypeDefCollection typeDefs;
+
+	// 関数ポインタ
+	vector<ProcPointer *> procPointers;
+
+	// blittable型
+	BlittableTypes blittableTypes;
+};
Index: trunk/jenga/include/smoothie/Parameter.h
===================================================================
--- trunk/jenga/include/smoothie/Parameter.h	(revision 170)
+++ trunk/jenga/include/smoothie/Parameter.h	(revision 170)
@@ -0,0 +1,115 @@
+#pragma once
+
+#include "Type.h"
+
+#include "BasicFixed.h"
+
+class Parameter : public Type
+{
+	string varName;
+	bool isRef;
+	bool isArray;
+	int subScripts[MAX_ARRAYDIM];
+
+	const string initValue;
+
+public:
+	Parameter( const string &varName, const Type &type, bool isRef = false, const string initValue = "" ):
+		Type( type ),
+		varName( varName ),
+		isRef( isRef ),
+		isArray( false ),
+		initValue( initValue )
+	{
+		subScripts[0] = -1;
+	}
+	Parameter( const Parameter &param ):
+		Type( param ),
+		varName( param.varName ),
+		isRef( param.isRef ),
+		isArray( false ),
+		initValue( param.initValue )
+	{
+		subScripts[0] = -1;
+		if( param.isArray ){
+			SetArray( param.subScripts );
+		}
+	}
+	~Parameter(){}
+
+	void SetArray( const int *pSubScripts ){
+		isArray = true;
+		memcpy( this->subScripts, pSubScripts, sizeof(int) * MAX_ARRAYDIM );
+	}
+
+	const string &GetVarName() const
+	{
+		return varName;
+	}
+
+	bool IsRef() const
+	{
+		return isRef;
+	}
+	bool IsArray(){
+		return isArray;
+	}
+	int *GetSubScriptsPtr(){
+		return subScripts;
+	}
+
+	const string &GetInitValue() const
+	{
+		return initValue;
+	}
+
+	bool Equals( const Parameter &param ) const
+	{
+		if( Type::Equals( param ) ){
+			return true;
+		}
+		else{
+
+			if( this->isRef && this->GetBasicType() == DEF_ANY &&
+				param.isRef == false && param.IsPointer()
+				||
+				this->isRef == false && this->IsPointer() &&
+				param.isRef && param.GetBasicType() == DEF_ANY ){
+					/* ByRef var As Any
+							と
+						var As VoidPtr
+						は同等
+					*/
+					return true;
+			}
+		}
+
+		return false;
+	}
+};
+
+class Parameters : public vector<Parameter *>
+{
+public:
+
+	bool Equals( const Parameters &params ) const
+	{
+		if( this->size() != params.size() ){
+			return false;
+		}
+
+		int max = (int)this->size();
+		for( int i=0; i<max; i++ ){
+			if( !(*this)[i]->Equals( *params[i] ) ){
+				return false;
+			}
+		}
+
+		return true;
+	}
+
+	int GetMemorySize() const
+	{
+		return (int)this->size() * PTR_SIZE;
+	}
+};
Index: trunk/jenga/include/smoothie/Procedure.h
===================================================================
--- trunk/jenga/include/smoothie/Procedure.h	(revision 170)
+++ trunk/jenga/include/smoothie/Procedure.h	(revision 170)
@@ -0,0 +1,342 @@
+#pragma once
+
+#include "Parameter.h"
+#include "Variable.h"
+
+class CClass;
+class CMethod;
+
+class Procedure{
+public:
+	// 種類
+	enum Kind{
+		Sub,
+		Function,
+	};
+
+private:
+	const string name;						// プロシージャ名
+
+	Kind kind;
+
+	bool isCdecl;
+	bool isUsing;
+
+protected:
+
+	// パラメータ
+	Parameters params;
+
+	// 戻り値の型
+	Type returnType;
+
+	// ソースコードの位置
+	int codePos;
+
+public:
+	Procedure( const string &name, Kind kind, bool isCdecl ):
+	  name( name ),
+	  kind( kind ),
+	  isCdecl( isCdecl ),
+	  isUsing( false ),
+	  codePos( -1 )
+	{}
+	~Procedure(){
+		BOOST_FOREACH( Parameter *pParam, params ){
+			delete pParam;
+		}
+	}
+
+	const string &GetName() const
+	{
+		return name;
+	}
+
+	bool IsSub() const
+	{
+		return ( kind == Sub );
+	}
+	bool IsFunction() const
+	{
+		return ( kind == Function );
+	}
+
+	bool IsCdecl() const
+	{
+		return isCdecl;
+	}
+	void Using(){
+		isUsing = true;
+	}
+	bool IsUsing() const
+	{
+		return isUsing;
+	}
+
+	int GetCodePos() const
+	{
+		return codePos;
+	}
+
+	const Parameters &Params() const
+	{
+		return params;
+	}
+	const Type &ReturnType() const
+	{
+		return returnType;
+	}
+};
+
+class UserProc : public Procedure
+{
+public:
+	string _paramStr;
+
+private:
+	bool isMacro;
+
+	// パラメータの追加情報
+	int secondParmNum;
+	Parameters realParams;
+	int realSecondParmNum;
+
+	// 親クラスと対応するメソッド
+	const CClass *pParentClass;
+	CMethod *pMethod;
+
+	// 各種フラグ
+	bool isExport;
+	bool isSystem;
+	bool isAutoGeneration;
+	bool isCompiled;
+
+public:
+
+	UserProc( const string &name, Kind kind, bool isMacro, bool isCdecl, bool isExport ):
+	  Procedure( name, kind, isCdecl ),
+	  isMacro( isMacro ),
+	  pParentClass( NULL ),
+	  pMethod( NULL ),
+	  isExport( isExport ),
+	  isSystem( false ),
+	  isAutoGeneration( false ),
+	  isCompiled( false ),
+	  beginOpAddress( 0 ),
+	  endOpAddress( 0 )
+	{
+	}
+	~UserProc();
+
+	string GetFullName() const;
+
+	bool IsMacro() const
+	{
+		return isMacro;
+	}
+
+	virtual bool SetParamsAndReturnType( const char *sourceOfParams, int nowLine, bool isStatic );
+
+	int GetSecondParmNum() const
+	{
+		return secondParmNum;
+	}
+	const Parameters &RealParams() const
+	{
+		return realParams;
+	}
+	int GetRealSecondParmNum() const
+	{
+		return realSecondParmNum;
+	}
+
+	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 );
+	}
+	void SetMethod( CMethod *pMethod ){
+		this->pMethod = pMethod;
+	}
+
+	void ExportOff(){
+		isExport = false;
+	}
+	bool IsExport() const
+	{
+		return isExport;
+	}
+	void ThisIsSystemProc(){
+		isSystem = true;
+	}
+	bool IsSystem() const
+	{
+		return isSystem;
+	}
+	void ThisIsAutoGenerationProc(){
+		isAutoGeneration = true;
+	}
+	bool IsAutoGeneration(){
+		return isAutoGeneration;
+	}
+	void CompleteCompile(){
+		isCompiled = true;
+	}
+	void KillCompileStatus(){
+		isCompiled = false;
+	}
+	bool IsCompiled() const
+	{
+		return isCompiled;
+	}
+	bool IsDestructor() const
+	{
+		return ( GetName()[0] == '~' );
+	}
+	bool IsVirtual() const;
+
+	// バイナリコードの位置
+	DWORD beginOpAddress;
+	DWORD endOpAddress;
+	int GetCodeSize() const
+	{
+		return endOpAddress - beginOpAddress;
+	}
+
+	virtual const NamespaceScopes &GetNamespaceScopes() const;
+	virtual const NamespaceScopesCollection &GetImportedNamespaces() const;
+	virtual bool IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const;
+
+	// ローカル変数
+	Variables localVars;
+
+	// TODO: 適切なコードへ直す
+	long id;
+
+
+	/////////////////////////////////////////////////////////////////
+	// コンパイル中の関数を管理
+	/////////////////////////////////////////////////////////////////
+private:
+	static UserProc *pCompilingUserProc;
+public:
+	static void CompileStartForGlobalArea(){
+		pCompilingUserProc = NULL;
+	}
+	static void CompileStartForUserProc( UserProc *pUserProc ){
+		pCompilingUserProc = pUserProc;
+	}
+	static bool IsGlobalAreaCompiling(){
+		return ( pCompilingUserProc == NULL );
+	}
+	static bool IsLocalAreaCompiling(){
+		return ( pCompilingUserProc != NULL );
+	}
+	static UserProc &CompilingUserProc(){
+		return *pCompilingUserProc;
+	}
+};
+
+class GlobalProc : public UserProc
+{
+	const NamespaceScopes namespaceScopes;
+	const NamespaceScopesCollection importedNamespaces;
+public:
+	// ハッシュリスト用
+	GlobalProc *pNextData;
+
+	GlobalProc( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const string &name, Kind kind, bool isMacro, bool isCdecl, bool isExport ):
+	  UserProc( name, kind, isMacro, isCdecl, isExport ),
+	  namespaceScopes( namespaceScopes ),
+	  importedNamespaces( importedNamespaces ),
+	  pNextData( NULL )
+	{}
+	~GlobalProc(){}
+/*
+	GlobalProc *Create( const NamespaceScopes &namespaceScopes, char *buffer,int nowLine );
+	bool AddGlobalProc( const NamespaceScopes &namespaceScopes, char *buffer,int nowLine );
+*/
+	virtual const NamespaceScopes &GetNamespaceScopes() const;
+	virtual const NamespaceScopesCollection &GetImportedNamespaces() const
+	{
+		return importedNamespaces;
+	}
+
+	virtual bool IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const;
+	virtual bool IsEqualSymbol( const GlobalProc &globalProc ) const;
+	virtual bool IsEqualSymbol( const string &name ) const;
+};
+
+class DllProc : public Procedure
+{
+	const NamespaceScopes namespaceScopes;
+
+	const string dllFileName;
+	const string alias;
+	int lookupAddress;
+
+public:
+	// ハッシュリスト用
+	DllProc *pNextData;
+
+	DllProc( const NamespaceScopes &namespaceScopes, const string &name, Kind kind, bool isCdecl, const string &dllFileName, const string &alias ):
+	  Procedure( name, kind, isCdecl ),
+	  namespaceScopes( namespaceScopes ),
+	  dllFileName( dllFileName ),
+	  alias( alias ),
+	  lookupAddress( 0 ),
+	  pNextData( NULL )
+	{
+	}
+	~DllProc(){}
+
+	bool IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const;
+	bool IsEqualSymbol( const string &name ) const;
+
+	const NamespaceScopes &GetNamespaceScopes() const
+	{
+		return namespaceScopes;
+	}
+
+	virtual bool SetParamsAndReturnType( const char *sourceOfParams, int nowLine );
+
+	const string &GetDllFileName() const
+	{
+		return dllFileName;
+	}
+	const string &GetAlias() const
+	{
+		return alias;
+	}
+
+	void SetLookupAddress( int lookupAddress ){
+		this->lookupAddress = lookupAddress;
+	}
+	int GetLookupAddress() const
+	{
+		return lookupAddress;
+	}
+
+};
+
+class ProcPointer : public Procedure
+{
+public:
+	ProcPointer( Kind kind ):
+	  Procedure( "", kind, false )
+	{
+	}
+	~ProcPointer(){}
+
+	virtual bool SetParamsAndReturnType( const char *sourceOfParams, int nowLine );
+};
Index: trunk/jenga/include/smoothie/Prototype.h
===================================================================
--- trunk/jenga/include/smoothie/Prototype.h	(revision 170)
+++ trunk/jenga/include/smoothie/Prototype.h	(revision 170)
@@ -0,0 +1,114 @@
+#pragma once
+
+#include <string>
+#include <vector>
+
+#include "Namespace.h"
+
+using namespace std;
+
+class CMethod;
+class UserProc;
+
+class Prototype
+{
+public:
+	enum Accessibility{
+		None,
+		Private,
+		Protected,
+		Public,
+	};
+
+private:
+	// 名前空間
+	NamespaceScopes namespaceScopes;
+
+	//名前
+	string name;
+
+	mutable bool isUsing;
+
+public:
+
+	Prototype( const NamespaceScopes &namespaceScopes, const string &name )
+		: namespaceScopes( namespaceScopes )
+		, name( name )
+		, isUsing( false )
+	{
+	}
+	~Prototype()
+	{
+	}
+
+	// 名前空間
+	const NamespaceScopes &GetNamespaceScopes() const
+	{
+		return namespaceScopes;
+	}
+
+	const string &GetName() const
+	{
+		return name;
+	}
+
+	//自身と等しいかどうかを確認
+	bool IsEquals( const Prototype *prototype ) const
+	{
+		if( this == prototype ){
+			return true;
+		}
+		return false;
+	}
+
+	// シンボル比較
+	bool IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const;
+	bool IsEqualSymbol( const Prototype &prototype ) const;
+	bool IsEqualSymbol( const string &name ) const;
+
+	// 利用状況
+	bool IsUsing() const
+	{
+		return isUsing;
+	}
+	void Using() const
+	{
+		isUsing = true;
+	}
+
+};
+
+class MemberPrototype
+{
+	Prototype::Accessibility accessibility;
+public:
+	MemberPrototype( Prototype::Accessibility accessibility )
+		: accessibility( accessibility )
+	{
+	}
+
+	Prototype::Accessibility GetAccessibility() const
+	{
+		return accessibility;
+	}
+	void SetAccessibility( Prototype::Accessibility accessibility ){
+		this->accessibility = accessibility;
+	}
+
+	bool IsNoneAccess() const
+	{
+		return ( accessibility == Prototype::None );
+	}
+	bool IsPrivate() const
+	{
+		return ( accessibility == Prototype::Private );
+	}
+	bool IsProtected() const
+	{
+		return ( accessibility == Prototype::Protected );
+	}
+	bool IsPublic() const
+	{
+		return ( accessibility == Prototype::Public );
+	}
+};
Index: trunk/jenga/include/smoothie/Smoothie.h
===================================================================
--- trunk/jenga/include/smoothie/Smoothie.h	(revision 170)
+++ trunk/jenga/include/smoothie/Smoothie.h	(revision 170)
@@ -0,0 +1,29 @@
+#pragma once
+
+#include "Source.h"
+#include "ObjectModule.h"
+#include "LexicalScoping.h"
+
+class Smoothie{
+public:
+
+	class Lexical{
+	public:
+		static string baseProjectDirPath;
+		static BasicSource source;
+		static NamespaceScopes liveingNamespaceScopes;
+		static CLexicalScopes lexicalScopes;
+	};
+
+	// コンパイル中に一時的に利用する
+	class Temp{
+	public:
+		// 現在インポートされている名前空間
+		static NamespaceScopesCollection importedNamespaces;
+	};
+
+	// プロジェクト中に存在するメタ情報
+	static Meta meta;
+
+	static bool isFullCompile;
+};
Index: trunk/jenga/include/smoothie/SmoothieException.h
===================================================================
--- trunk/jenga/include/smoothie/SmoothieException.h	(revision 170)
+++ trunk/jenga/include/smoothie/SmoothieException.h	(revision 170)
@@ -0,0 +1,37 @@
+#pragma once
+
+#include <string>
+#include <vector>
+
+class SmoothieException
+{
+	int errorCode;
+	std::string keyword;
+	int nowLine;
+public:
+	SmoothieException( int errorCode, const std::string &keyword, int nowLine )
+		: errorCode( errorCode )
+		, keyword( keyword )
+		, nowLine( nowLine )
+	{
+	}
+	SmoothieException( int errorCode )
+		: errorCode( errorCode )
+		, keyword( "" )
+		, nowLine( -1 )
+	{
+	}
+
+	int GetErrorCode() const
+	{
+		return errorCode;
+	}
+	const std::string &GetKeyword() const
+	{
+		return keyword;
+	}
+	int GetNowLine() const
+	{
+		return nowLine;
+	}
+};
Index: trunk/jenga/include/smoothie/Source.h
===================================================================
--- trunk/jenga/include/smoothie/Source.h	(revision 170)
+++ trunk/jenga/include/smoothie/Source.h	(revision 170)
@@ -0,0 +1,145 @@
+#pragma once
+
+#include <vector>
+#include <string>
+
+#include <windows.h>
+#include <stdlib.h>
+
+#include "BasicFixed.h"
+
+using namespace std;
+
+struct INCLUDEFILEINFO{
+	char **ppFileNames;
+	int FilesNum;
+	int LineOfFile[MAX_LEN];
+};
+
+class Text{
+protected:
+	char *buffer;
+	int length;
+
+public:
+
+	Text(){
+		buffer = (char *)calloc( 1, 1 );
+		length = 0;
+	}
+	~Text(){
+		free( buffer );
+	}
+
+	bool ReadFile( const string &filePath );
+
+	static bool IsBlank( char c )
+	{
+		if( c == ' ' || c == '\t' )
+		{
+			return true;
+		}
+		return false;
+	}
+	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 string generateDirectiveName;
+
+	void Realloc( int newLength ){
+		buffer = (char *)realloc( buffer, newLength + 255 );
+
+		length = newLength;
+
+		extern char *basbuf;
+		basbuf = buffer + 2;
+	}
+
+	void IncludeFiles();
+
+	void ChangeReturnLineChar();
+
+	void RemoveComments();
+
+	bool ReadFile_InIncludeDirective( const string &filePath );
+	void DirectiveIncludeOrRequire();
+
+	void RemoveReturnLineUnderbar();
+
+public:
+	BasicSource(){}
+	~BasicSource(){}
+
+	char *GetBuffer(){
+		return buffer+2;
+	}
+	int GetLength(){
+		return length-2;
+	}
+
+	void SetBuffer( const char *buffer );
+
+	bool ReadFile( const string &filePath );
+
+	bool Generate( const string &genName, const char *buffer );
+
+	void Addition( const char *buffer );
+
+	void operator = ( const BasicSource &source ){
+		Realloc( source.length );
+		lstrcpy( buffer, source.buffer );
+	}
+
+	static bool IsCommandDelimitation( char c ){
+		if( c == '\n' || c == ':' || c == '\0' ){
+			return true;
+		}
+
+		return false;
+	}
+
+	static int JumpStringInPare(const char *buffer,int pos){
+		int PareNum;
+		for(PareNum=1;;pos++){
+			if(buffer[pos]=='\"'){
+				for(pos++;;pos++){
+					if(buffer[pos]=='\"') break;
+				}
+				continue;
+			}
+			else if(buffer[pos]=='(') PareNum++;
+			else if(buffer[pos]==')'){
+				PareNum--;
+				if(PareNum==0) return pos;
+			}
+			else if(buffer[pos]=='\0') break;
+		}
+		return 0;
+	}
+	static int JumpStringInBracket(const char *buffer,int pos){
+		int PareNum;
+		for(PareNum=1;;pos++){
+			if(buffer[pos]=='\"'){
+				for(pos++;;pos++){
+					if(buffer[pos]=='\"') break;
+				}
+				continue;
+			}
+			else if(buffer[pos]=='[') PareNum++;
+			else if(buffer[pos]==']'){
+				PareNum--;
+				if(PareNum==0) return pos;
+			}
+			else if(buffer[pos]=='\0') break;
+		}
+		return 0;
+	}
+};
Index: trunk/jenga/include/smoothie/Symbol.h
===================================================================
--- trunk/jenga/include/smoothie/Symbol.h	(revision 170)
+++ trunk/jenga/include/smoothie/Symbol.h	(revision 170)
@@ -0,0 +1,31 @@
+#pragma once
+
+#include <vector>
+#include <string>
+
+#include "Namespace.h"
+
+using namespace std;
+
+class Symbol
+{
+	NamespaceScopes namespaceScopes;
+	string name;
+public:
+	Symbol( const NamespaceScopes &namespaceScopes, const string &name )
+		: namespaceScopes( namespaceScopes )
+		, name( name )
+	{
+	}
+	Symbol( const char *fullName );
+	Symbol( const string &fullName );
+
+	const NamespaceScopes &GetNamespaceScopes() const
+	{
+		return namespaceScopes;
+	}
+	const string &GetName() const
+	{
+		return name;
+	}
+};
Index: trunk/jenga/include/smoothie/Type.h
===================================================================
--- trunk/jenga/include/smoothie/Type.h	(revision 170)
+++ trunk/jenga/include/smoothie/Type.h	(revision 170)
@@ -0,0 +1,200 @@
+#pragma once
+
+#include <string>
+#include <vector>
+
+#include <boost/foreach.hpp>
+
+#include <windows.h>
+
+#include "BasicFixed.h"
+
+class CClass;
+
+class Type{
+	int basicType;
+	union{
+		LONG_PTR index;
+		const CClass *pClass;
+	};
+
+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 ){}
+
+	__inline int GetBasicType() const
+	{
+		return basicType;
+	}
+	LONG_PTR GetIndex() const
+	{
+		return index;
+	}
+	const CClass &GetClass() const
+	{
+		return *pClass;
+	}
+
+	void SetBasicType( int basicType ){
+		this->basicType = basicType;
+	}
+	void SetIndex( LONG_PTR index ){
+		this->index = index;
+	}
+	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;
+	}
+
+	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;
+
+	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;
+
+	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 IsObjectClass() const;
+	bool IsStringClass() const;
+	bool IsVoidPtr() const;
+	bool IsAny() const;
+
+	// オブジェクトや構造体など、メンバを持つ型かどうかを判別する
+	bool HasMember() const;
+
+	const std::string ToString() const;
+
+	void operator= ( const Type &type ){
+		basicType = type.basicType;
+		index = type.index;
+	}
+
+	static Type String();
+
+
+private:
+	static const int basicTypeList[];
+	static const std::string basicTypeNameList[];
+public:
+	static bool StringToBasicType( const std::string &typeName, int &basicType );
+	static bool StringToType( const std::string &typeName, Type &type );
+};
+
+class BlittableType
+{
+	Type basicType;
+	CClass *pClass;
+public:
+	BlittableType( const Type &basicType, CClass *pClass )
+		: basicType( basicType )
+		, pClass( pClass )
+	{
+	}
+	BlittableType(){}
+	const Type &GetBasicType() const
+	{
+		return basicType;
+	}
+	const CClass *GetClassPtr() const
+	{
+		return pClass;
+	}
+	const std::string GetCreateStaticMethodFullName() const;
+};
+class BlittableTypes : public std::vector<BlittableType>
+{
+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;
+			}
+		}
+		throw "Blittable型ではない";
+	}
+	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/jenga/include/smoothie/TypeDef.h
===================================================================
--- trunk/jenga/include/smoothie/TypeDef.h	(revision 170)
+++ trunk/jenga/include/smoothie/TypeDef.h	(revision 170)
@@ -0,0 +1,56 @@
+#pragma once
+
+#include <vector>
+#include <string>
+
+#include "Type.h"
+#include "Namespace.h"
+
+using namespace std;
+
+class TypeDefCollection;
+
+class TypeDef{
+	friend TypeDefCollection;
+
+	NamespaceScopes namespaceScopes;
+
+	string name;
+	string baseName;
+	Type baseType;
+public:
+	TypeDef( const NamespaceScopes &namespaceScopes, const string &name, const string &baseName );
+	~TypeDef();
+
+	const string &GetName() const
+	{
+		return name;
+	}
+	const string &GetBaseName() const
+	{
+		return baseName;
+	}
+	const Type &GetBaseType() const
+	{
+		return baseType;
+	}
+
+	bool IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const;
+	bool IsEqualSymbol( const string &name ) const;
+};
+
+class TypeDefCollection : public vector<TypeDef>
+{
+public:
+	TypeDefCollection();
+	~TypeDefCollection();
+
+	void Add( const NamespaceScopes &namespaceScopes, const string &name, const string &baseName );
+	int GetIndex( const NamespaceScopes &namespaceScopes, const string &name ) const;
+	int GetIndex( const string &fullName ) const;
+
+private:
+	void Add( const NamespaceScopes &namespaceScopes, const string &expression, int nowLine );
+public:
+	void Init();
+};
Index: trunk/jenga/include/smoothie/Variable.h
===================================================================
--- trunk/jenga/include/smoothie/Variable.h	(revision 170)
+++ trunk/jenga/include/smoothie/Variable.h	(revision 170)
@@ -0,0 +1,169 @@
+#pragma once
+
+#include "Type.h"
+#include "Symbol.h"
+
+class Variable : public Type
+{
+	const NamespaceScopes namespaceScopes;
+	string name;
+	bool isConst;
+	bool isRef;
+	bool isArray;
+	int subScripts[MAX_ARRAYDIM];
+
+	bool isParameter;
+
+public:
+	Variable( const string &name, const Type &type, bool isConst = false, bool isRef = false )
+		: Type( type )
+		, name( name )
+		, isConst( isConst )
+		, isRef( isRef )
+		, isArray( false )
+		, isParameter( false)
+	{
+		subScripts[0] = -1;
+	}
+	Variable( const NamespaceScopes &namespaceScopes, const string &name, const Type &type, bool isConst = false, bool isRef = false )
+		: namespaceScopes( namespaceScopes )
+		, Type( type )
+		, name( name )
+		, isConst( isConst )
+		, isRef( isRef )
+		, isArray( false )
+		, isParameter( false)
+	{
+		subScripts[0] = -1;
+	}
+	Variable( const Variable &var )
+		: Type( var )
+		, name( var.name )
+		, isConst( var.isConst )
+		, isRef( var.isRef )
+		, isArray( false )
+		, isParameter( false )
+	{
+		subScripts[0] = -1;
+		if( var.isArray ){
+			SetArray( var.subScripts );
+		}
+	}
+	~Variable(){}
+
+	void SetArray( const int *pSubScripts ){
+		isArray = true;
+		memcpy( this->subScripts, pSubScripts, sizeof(int) * MAX_ARRAYDIM );
+	}
+
+	const string &GetName() const
+	{
+		return name;
+	}
+
+	bool IsEqualSymbol( const Symbol &symbol, bool isSupportStaticMember = true ) const;
+
+	void ConstOff(){
+		isConst = false;
+	}
+	void ConstOn(){
+		isConst = true;
+	}
+	bool IsConst() const
+	{
+		return isConst;
+	}
+	bool IsRef() const
+	{
+		return isRef;
+	}
+	bool IsArray()const
+	{
+		return isArray;
+	}
+	const int *GetSubScriptsPtr() const
+	{
+		return subScripts;
+	}
+
+	void ThisIsParameter(){
+		isParameter = true;
+	}
+	bool IsParameter() const
+	{
+		return isParameter;
+	}
+
+
+	int GetMemorySize() const
+	{
+		if( isRef || isParameter ){
+			return PTR_SIZE;
+		}
+
+		int size = Type::GetSize();
+
+		if( isArray ){
+			int num = 1;
+			for( int i=0; i<MAX_ARRAYDIM; i++){
+				if(subScripts[i]==-1) break;
+				num *= subScripts[i]+1;
+			}
+			size *= num;
+		}
+
+		if( size % PTR_SIZE ){
+			size += PTR_SIZE-(size%PTR_SIZE);
+		}
+
+		return size;
+	}
+
+
+	/* --- オフセット ---
+
+		※グローバル変数で初期バッファがない場合は最上位ビットに1がセットされ、
+		初期バッファの有無が識別される。
+		（その後、スケジュール実行により、実際の配置に並び替えられる）*/
+	int offset;
+
+	//コンストラクタ用パラメータ
+	string paramStrForConstructor;
+
+	//レキシカルスコープ用
+	int ScopeStartAddress;
+	int ScopeEndAddress;
+	int ScopeLevel;
+	BOOL bLiving;
+
+
+	int source_code_address;
+};
+
+class Variables : public vector<Variable *>
+{
+public:
+	Variables(){}
+	~Variables(){
+		clear();
+	}
+
+	void clear(){
+		for( int i=0; i<(int)this->size(); i++ ){
+			delete (*this)[i];
+		}
+
+		vector<Variable *>::clear();
+	}
+
+	bool DuplicateCheck( const Symbol &symbol ) const;
+
+	const Variable *BackSearch( const Symbol &symbol ) const;
+
+	const Variable *Find( const Symbol &symbol )const;
+};
+
+extern Variables globalVars;
+
+
+
Index: trunk/jenga/projects/common/common.vcproj
===================================================================
--- trunk/jenga/projects/common/common.vcproj	(revision 166)
+++ trunk/jenga/projects/common/common.vcproj	(revision 170)
@@ -40,5 +40,5 @@
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\"
+				AdditionalIncludeDirectories="..\..\..\;..\..\..\cpplibs\boost"
 				MinimalRebuild="true"
 				BasicRuntimeChecks="3"
@@ -102,5 +102,5 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="..\..\..\"
+				AdditionalIncludeDirectories="..\..\..\;..\..\..\cpplibs\boost"
 				RuntimeLibrary="0"
 				WarningLevel="3"
@@ -163,5 +163,5 @@
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..\"
+				AdditionalIncludeDirectories="..\..\..\;..\..\..\cpplibs\boost"
 				MinimalRebuild="true"
 				BasicRuntimeChecks="3"
@@ -225,5 +225,5 @@
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="..\..\..\"
+				AdditionalIncludeDirectories="..\..\..\;..\..\..\cpplibs\boost"
 				RuntimeLibrary="0"
 				WarningLevel="3"
Index: trunk/jenga/projects/smoothie/smoothie.vcproj
===================================================================
--- trunk/jenga/projects/smoothie/smoothie.vcproj	(revision 166)
+++ trunk/jenga/projects/smoothie/smoothie.vcproj	(revision 170)
@@ -19,5 +19,5 @@
 			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
 			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
+			ConfigurationType="4"
 			CharacterSet="2"
 			>
@@ -40,4 +40,184 @@
 				Name="VCCLCompilerTool"
 				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\;..\..\..\cpplibs\boost"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release(amd64)|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="4"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="..\..\..\;..\..\..\cpplibs\boost"
+				RuntimeLibrary="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release(x86)|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="4"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="..\..\..\;..\..\..\cpplibs\boost"
+				RuntimeLibrary="2"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Debug(x86)|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="4"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\..\;..\..\..\cpplibs\boost"
 				MinimalRebuild="true"
 				BasicRuntimeChecks="3"
@@ -57,7 +237,5 @@
 			/>
 			<Tool
-				Name="VCLinkerTool"
-				GenerateDebugInformation="true"
-				TargetMachine="1"
+				Name="VCLibrarianTool"
 			/>
 			<Tool
@@ -65,7 +243,4 @@
 			/>
 			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
 				Name="VCXDCMakeTool"
 			/>
@@ -75,223 +250,4 @@
 			<Tool
 				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release(amd64)|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				RuntimeLibrary="2"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				GenerateDebugInformation="true"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release(x86)|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			WholeProgramOptimization="1"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				RuntimeLibrary="2"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="3"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				GenerateDebugInformation="true"
-				OptimizeReferences="2"
-				EnableCOMDATFolding="2"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
-			/>
-			<Tool
-				Name="VCPostBuildEventTool"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Debug(x86)|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
-			IntermediateDirectory="$(ConfigurationName)"
-			ConfigurationType="1"
-			CharacterSet="2"
-			>
-			<Tool
-				Name="VCPreBuildEventTool"
-			/>
-			<Tool
-				Name="VCCustomBuildTool"
-			/>
-			<Tool
-				Name="VCXMLDataGeneratorTool"
-			/>
-			<Tool
-				Name="VCWebServiceProxyGeneratorTool"
-			/>
-			<Tool
-				Name="VCMIDLTool"
-			/>
-			<Tool
-				Name="VCCLCompilerTool"
-				Optimization="0"
-				MinimalRebuild="true"
-				BasicRuntimeChecks="3"
-				RuntimeLibrary="3"
-				WarningLevel="3"
-				Detect64BitPortabilityProblems="true"
-				DebugInformationFormat="4"
-			/>
-			<Tool
-				Name="VCManagedResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCResourceCompilerTool"
-			/>
-			<Tool
-				Name="VCPreLinkEventTool"
-			/>
-			<Tool
-				Name="VCLinkerTool"
-				GenerateDebugInformation="true"
-				TargetMachine="1"
-			/>
-			<Tool
-				Name="VCALinkTool"
-			/>
-			<Tool
-				Name="VCManifestTool"
-			/>
-			<Tool
-				Name="VCXDCMakeTool"
-			/>
-			<Tool
-				Name="VCBscMakeTool"
-			/>
-			<Tool
-				Name="VCFxCopTool"
-			/>
-			<Tool
-				Name="VCAppVerifierTool"
-			/>
-			<Tool
-				Name="VCWebDeploymentTool"
 			/>
 			<Tool
@@ -308,4 +264,32 @@
 			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
 			>
+			<File
+				RelativePath="..\..\src\smoothie\Member.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\smoothie\Method.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\smoothie\Namespace.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\smoothie\Prototype.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\smoothie\Smoothie.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\smoothie\Source.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\smoothie\Symbol.cpp"
+				>
+			</File>
 		</Filter>
 		<Filter
@@ -314,4 +298,72 @@
 			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
 			>
+			<File
+				RelativePath="..\..\include\smoothie\BasicFixed.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\smoothie\Class.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\smoothie\LexicalScoping.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\smoothie\Member.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\smoothie\Method.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\smoothie\Namespace.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\smoothie\ObjectModule.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\smoothie\Parameter.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\smoothie\Procedure.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\smoothie\Prototype.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\smoothie\Smoothie.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\smoothie\SmoothieException.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\smoothie\Source.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\smoothie\Symbol.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\smoothie\Type.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\smoothie\TypeDef.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\include\smoothie\Variable.h"
+				>
+			</File>
 		</Filter>
 		<Filter
Index: trunk/jenga/src/smoothie/Member.cpp
===================================================================
--- trunk/jenga/src/smoothie/Member.cpp	(revision 170)
+++ trunk/jenga/src/smoothie/Member.cpp	(revision 170)
@@ -0,0 +1,86 @@
+#include <jenga/include/smoothie/Member.h>
+
+CMember::CMember( CClass *pobj_c, Prototype::Accessibility accessibility, bool isConst, bool isRef, char *buffer, int nowLine )
+	: MemberPrototype( accessibility )
+{
+	extern int cp;
+
+	//構文を解析
+	char VarName[VN_SIZE];
+	char initBuffer[VN_SIZE];
+	char lpszConstructParameter[VN_SIZE];
+	GetDimentionFormat(buffer,VarName,SubScripts,type,initBuffer,lpszConstructParameter);
+
+	//重複チェック
+	if(pobj_c->DupliCheckAll(VarName)){
+		SetError(15,VarName,cp);
+	}
+
+	//メンバ名
+	name = VarName;
+
+	//定数扱いかどうか
+	this->isConst = isConst;
+
+	//初期データ
+	initializeExpression = initBuffer;
+
+	//コンストラクタ用のパラメータ
+	constructParameter = lpszConstructParameter;
+
+	//ソースコードの位置
+	source_code_address=nowLine;
+}
+CMember::CMember(CMember &member)
+	: MemberPrototype( member.GetAccessibility() )
+	, name( member.GetName() )
+	, type( member.GetType() )
+	, isConst( member.IsConst() )
+{
+	//SubScripts
+	memcpy(SubScripts,member.SubScripts,MAX_ARRAYDIM*sizeof(int));
+
+	//ソースコードの位置
+	source_code_address=member.source_code_address;
+}
+CMember::~CMember(){
+}
+
+void CMember::InitStaticMember(void){
+	//静的メンバをグローバル領域に作成
+
+	//イテレータをリセット
+	extern Classes *pobj_DBClass;
+	pobj_DBClass->Iterator_Reset();
+
+	int back_cp=cp;
+
+	while(pobj_DBClass->Iterator_HasNext()){
+		CClass &objClass = *pobj_DBClass->Iterator_GetNext();
+
+		// 名前空間をセット
+		Smoothie::Lexical::liveingNamespaceScopes = objClass.GetNamespaceScopes();
+
+		int i=0;
+		BOOST_FOREACH( CMember *member, objClass.staticMembers ){
+			char temporary[VN_SIZE];
+			sprintf(temporary,"%s.%s",objClass.GetName().c_str(),member->GetName().c_str());
+			dim(
+				temporary,
+				member->SubScripts,
+				member->GetType(),
+				member->GetInitializeExpression().c_str(),
+				member->GetConstructParameter().c_str(),
+				0);
+
+			//ネイティブコードバッファの再確保
+			ReallocNativeCodeBuffer();
+
+			i++;
+		}
+	}
+
+	Smoothie::Lexical::liveingNamespaceScopes.clear();
+
+	cp=back_cp;
+}
Index: trunk/jenga/src/smoothie/Method.cpp
===================================================================
--- trunk/jenga/src/smoothie/Method.cpp	(revision 170)
+++ trunk/jenga/src/smoothie/Method.cpp	(revision 170)
@@ -0,0 +1,69 @@
+#include <jenga/include/smoothie/Method.h>
+
+
+Methods::Methods()
+{
+}
+Methods::~Methods()
+{
+	Methods &methods = *this;
+	BOOST_FOREACH( CMethod *pMethod, methods ){
+		delete pMethod;
+	}
+}
+
+void Methods::Add( UserProc *pUserProc,Prototype::Accessibility accessibility, bool isConst, bool isAbstract, bool isVirtual ){
+	CMethod *pMethod = new DynamicMethod( pUserProc, accessibility, isAbstract, isVirtual, isConst );
+	this->push_back( pMethod );
+	pUserProc->SetMethod( pMethod );
+}
+void Methods::AddStatic(UserProc *pUserProc, Prototype::Accessibility accessibility ){
+	CMethod *pMethod = new StaticMethod( pUserProc, accessibility );
+	this->push_back( pMethod );
+	pUserProc->SetMethod( pMethod );
+}
+
+const CMethod *Methods::GetMethodPtr( UserProc *pUserProc ) const
+{
+	const Methods &methods = *this;
+	for( int i=(int)methods.size()-1; i>=0; i-- ){
+		if( pUserProc == methods[i]->pUserProc ){
+			return methods[i];
+		}
+	}
+	return NULL;
+}
+bool Methods::IsExist( const char *name ) const
+{
+	const Methods &methods = *this;
+	BOOST_FOREACH( const CMethod *pMethod, methods ){
+		if( pMethod->pUserProc->GetName() == name ) return true;
+	}
+	return false;
+}
+void Methods::Enum( const char *methodName, vector<UserProc *> &subs ) const
+{
+	//オブジェクトのメンバ関数の場合
+	//※オーバーライドされた関数を先にサーチする必要があるため、バックサーチを行う
+	const Methods &methods = *this;
+	for( int i=(int)methods.size()-1; i>=0; i-- ){
+		if( methods[i]->pUserProc->GetName() == methodName ){
+			subs.push_back( methods[i]->pUserProc );
+		}
+	}
+}
+void Methods::Enum( const BYTE idOperatorCalc, vector<UserProc *> &subs ) const
+{
+	//オブジェクトのメンバ関数の場合
+	//※オーバーライドされた関数を先にサーチする必要があるため、バックサーチを行う
+	const Methods &methods = *this;
+	for( int i=(int)methods.size()-1; i>=0; i-- ){
+		UserProc *pUserProc = methods[i]->pUserProc;
+		const char *temp = pUserProc->GetName().c_str();
+		if(temp[0]==1&&temp[1]==ESC_OPERATOR){
+			if((BYTE)temp[2]==idOperatorCalc){
+				subs.push_back( pUserProc );
+			}
+		}
+	}
+}
Index: trunk/jenga/src/smoothie/Namespace.cpp
===================================================================
--- trunk/jenga/src/smoothie/Namespace.cpp	(revision 170)
+++ trunk/jenga/src/smoothie/Namespace.cpp	(revision 170)
@@ -0,0 +1,165 @@
+#include <jenga/include/smoothie/BasicFixed.h>
+#include <jenga/include/smoothie/Smoothie.h>
+#include <jenga/include/smoothie/Namespace.h>
+#include <jenga/include/smoothie/SmoothieException.h>
+
+
+NamespaceScopes::NamespaceScopes( const string &namespaceStr ){
+	if( namespaceStr.size() == 0 ){
+		return;
+	}
+
+	string::size_type i = 0;
+	while( true ){
+		string::size_type i2 = namespaceStr.find( '.', i );
+
+		string tempName = namespaceStr.substr( i, i2-i );
+
+		push_back( tempName );
+
+		if( i2 == string::npos ){
+			break;
+		}
+
+		i = i2 + 1;
+	}
+}
+
+bool NamespaceScopes::IsImported() const
+{
+	BOOST_FOREACH( const NamespaceScopes &namespaceScopes, Smoothie::Temp::importedNamespaces ){
+		if( this->IsEqual( namespaceScopes ) ){
+			return true;
+		}
+	}
+	return false;
+}
+bool NamespaceScopes::IsLiving() const
+{
+	if( IsBelong( *this, Smoothie::Lexical::liveingNamespaceScopes ) ){
+		return true;
+	}
+	return false;
+}
+
+// 包括しているかをチェック
+// 例:
+// this =   "Discoversoft.ActiveBasic"
+// living = "Discoversoft.ActiveBasic"
+// name =   "ActiveBasic"
+// この場合、living は name を包括している。
+bool NamespaceScopes::IsCoverd( const string &name ) const
+{
+	if( IsEqual( name ) ){
+		return true;
+	}
+
+	string thisStr = ToString();
+
+	NamespaceScopes tempLivingNamespaceScopes = Smoothie::Lexical::liveingNamespaceScopes;
+
+	while( tempLivingNamespaceScopes.size() ){
+		NamespaceScopes tempNamespaceScopes = tempLivingNamespaceScopes;
+
+		string tempStr = tempNamespaceScopes.ToString() + "." + name;
+		if( thisStr == tempStr ){
+			return true;
+		}
+
+		tempLivingNamespaceScopes.pop_back();
+	}
+	return false;
+}
+bool NamespaceScopes::IsCoverd( const NamespaceScopes &namespaceScopes ) const
+{
+	return IsCoverd( namespaceScopes.ToString() );
+}
+
+
+void NamespaceScopesCollection::SplitNamespace( const char *fullName, char *namespaceStr, char *simpleName ) const
+{
+	NamespaceScopes namespaceScopes( fullName );
+	bool hasSimpleName = false;
+	while( namespaceScopes.size() > 0 ){
+		if( IsExist( namespaceScopes ) ){
+			break;
+		}
+		namespaceScopes.pop_back();
+
+		hasSimpleName = true;
+	}
+
+	lstrcpy( namespaceStr, namespaceScopes.ToString().c_str() );
+
+	bool hasNamespace = false;
+	if( namespaceStr[0] ){
+		hasNamespace = true;
+	}
+
+	int dotLength = 0;
+	if( hasSimpleName && hasNamespace ){
+		dotLength = 1;
+	}
+
+	lstrcpy( simpleName, fullName + lstrlen( namespaceStr ) + dotLength );
+}
+bool NamespaceScopesCollection::Imports( const string &namespaceStr ){
+	NamespaceScopes namespaceScopes( namespaceStr );
+	if( !Smoothie::meta.namespaceScopesCollection.IsExist( namespaceScopes ) ){
+		return false;
+	}
+
+	this->push_back( namespaceScopes );
+
+	return true;
+}
+bool NamespaceScopesCollection::CollectNamespaces( const char *source, NamespaceScopesCollection &namespaceScopesCollection )
+{
+	int i, i2;
+	char temporary[1024];
+
+	bool isSuccessful = true;
+
+	// 名前空間管理
+	NamespaceScopes namespaceScopes;
+
+	for(i=0;;i++){
+		if(source[i]=='\0') break;
+
+		if( source[i] == 1 && source[i+1] == ESC_NAMESPACE ){
+			for(i+=2,i2=0;;i2++,i++){
+				if( BasicSource::IsCommandDelimitation( source[i] ) ){
+					temporary[i2]=0;
+					break;
+				}
+				temporary[i2]=source[i];
+			}
+			namespaceScopes.push_back( temporary );
+
+			if( !namespaceScopesCollection.IsExist( namespaceScopes ) ){
+				namespaceScopesCollection.push_back( namespaceScopes );
+			}
+
+			continue;
+		}
+		else if( source[i] == 1 && source[i+1] == ESC_ENDNAMESPACE ){
+			if( namespaceScopes.size() <= 0 ){
+				throw SmoothieException( 12, "End Namespace", i );
+				isSuccessful = false;
+			}
+			else{
+				namespaceScopes.pop_back();
+			}
+
+			i += 2;
+			continue;
+		}
+	}
+
+	if( namespaceScopes.size() > 0 ){
+		throw SmoothieException( 63 );
+		isSuccessful = false;
+	}
+
+	return isSuccessful;
+}
Index: trunk/jenga/src/smoothie/Prototype.cpp
===================================================================
--- trunk/jenga/src/smoothie/Prototype.cpp	(revision 170)
+++ trunk/jenga/src/smoothie/Prototype.cpp	(revision 170)
@@ -0,0 +1,24 @@
+#include <jenga/include/smoothie/Prototype.h>
+#include <jenga/include/smoothie/Member.h>
+#include <jenga/include/smoothie/BasicFixed.h>
+
+bool Prototype::IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const
+{
+	if( GetName() != name ){
+		return false;
+	}
+
+	return NamespaceScopes::IsSameArea( GetNamespaceScopes(), namespaceScopes );
+}
+bool Prototype::IsEqualSymbol( const Prototype &prototype ) const
+{
+	return IsEqualSymbol( prototype.GetNamespaceScopes(), prototype.GetName() );
+}
+bool Prototype::IsEqualSymbol( const string &fullName ) const
+{
+	char AreaName[VN_SIZE] = "";		//オブジェクト変数
+	char NestName[VN_SIZE] = "";		//入れ子メンバ
+	bool isNest = CMember::SplitName( fullName.c_str(), AreaName, NestName );
+
+	return IsEqualSymbol( NamespaceScopes( AreaName ), NestName );
+}
Index: trunk/jenga/src/smoothie/Smoothie.cpp
===================================================================
--- trunk/jenga/src/smoothie/Smoothie.cpp	(revision 170)
+++ trunk/jenga/src/smoothie/Smoothie.cpp	(revision 170)
@@ -0,0 +1,9 @@
+#include <jenga/include/smoothie/Smoothie.h>
+
+BasicSource Smoothie::Lexical::source;
+NamespaceScopes Smoothie::Lexical::liveingNamespaceScopes;
+
+Meta Smoothie::meta;
+NamespaceScopesCollection Smoothie::Temp::importedNamespaces;
+
+bool Smoothie::isFullCompile = false;
Index: trunk/jenga/src/smoothie/Source.cpp
===================================================================
--- trunk/jenga/src/smoothie/Source.cpp	(revision 170)
+++ trunk/jenga/src/smoothie/Source.cpp	(revision 170)
@@ -0,0 +1,921 @@
+#include <boost/foreach.hpp>
+
+#include <jenga/include/common/Directory.h>
+
+#include <jenga/include/smoothie/BasicFixed.h>
+#include <jenga/include/smoothie/Source.h>
+#include <jenga/include/smoothie/SmoothieException.h>
+
+
+const string BasicSource::generateDirectiveName = "#generate";
+
+
+class CDefine{
+	vector<string> names;
+public:
+	CDefine( int majorVer );
+	~CDefine();
+	void Free();
+	void Init( int majorVer );
+
+	BOOL add(char *name);
+	BOOL undef(char *name);
+	BOOL check(char *name);
+	void preprocessor_ifdef(char *buffer,bool isNot);
+	void DirectiveIfdef(char *buffer);
+};
+// TODO: バージョン番号の識別子defineが未完成
+CDefine objDefine(0);
+
+
+//////////////////////////////////////
+// #requireの管理
+//////////////////////////////////////
+class CRequireFiles{
+	char **ppFilePath;
+	int count;
+public:
+	CRequireFiles(){
+		ppFilePath = (char **)malloc( 1 );
+		count = 0;
+	}
+	~CRequireFiles(){
+		for( int i = 0; i < count; i++ ){
+			free( ppFilePath[i] );
+		}
+		free( ppFilePath );
+	}
+	void clear(){
+		for( int i = 0; i < count; i++ ){
+			free( ppFilePath[i] );
+		}
+		free( ppFilePath );
+
+		ppFilePath = (char **)malloc( 1 );
+		count = 0;
+	}
+	bool IsIncluded( const char *includeFilePath ){
+		// '/' → '\\'
+		char tempPath[MAX_PATH];
+		lstrcpy( tempPath, includeFilePath );
+		for( int i=0; tempPath[i]; i++ ){
+			if( tempPath[i] == '/' ){
+				tempPath[i] = '\\';
+			}
+		}
+
+		for( int i=0; i<count; i++ ){
+			if( lstrcmpi( ppFilePath[i], tempPath ) == 0 ){
+				return true;
+			}
+		}
+		return false;
+	}
+	void Add( const char *includeFilePath ){
+		// '/' → '\\'
+		char tempPath[MAX_PATH];
+		lstrcpy( tempPath, includeFilePath );
+		for( int i=0; tempPath[i]; i++ ){
+			if( tempPath[i] == '/' ){
+				tempPath[i] = '\\';
+			}
+		}
+
+		//既に読み込まれているとき
+		if( IsIncluded( tempPath ) ) return;
+
+		//追加
+		ppFilePath = (char **)realloc(ppFilePath, ( count + 1 ) * sizeof(char *) );
+		ppFilePath[count] = (char *)malloc( lstrlen(tempPath) + 1 );
+		lstrcpy( ppFilePath[count], tempPath );
+		count++;
+	}
+};
+CRequireFiles requireFiles;
+
+
+//////////////////////////////////////
+// #define間するクラス
+//////////////////////////////////////
+
+CDefine::CDefine( int majorVer ){
+	Init( majorVer );
+}
+CDefine::~CDefine(){
+}
+void CDefine::Init( int majorVer ){
+	names.clear();
+
+	extern BOOL bDebugCompile;
+	if(bDebugCompile) add("_DEBUG");
+
+#ifdef _AMD64_
+	add("_WIN64");
+#endif
+
+	extern BOOL bDll;
+	if( bDll ){
+		add("_DLL");
+	}
+
+	extern bool isUnicode;
+	if( isUnicode ){
+		add( "UNICODE" );
+	}
+
+	char temporary[255];
+	sprintf(temporary,"_AB_VER%d",majorVer);
+	add(temporary);
+}
+BOOL CDefine::add(char *name){
+	extern HANDLE hHeap;
+
+	//重複チェック
+	if(check(name)) return 0;
+
+	//追加
+	names.push_back( name );
+
+	return 1;
+}
+BOOL CDefine::undef(char *name){
+	vector<string>::iterator i = names.begin();
+	BOOST_FOREACH( const string &temp, names ){
+		if( temp == name ){
+			names.erase( i );
+			return 1;
+		}
+		i++;
+	}
+
+	return 0;
+}
+BOOL CDefine::check(char *name){
+
+	//重複チェック
+	BOOST_FOREACH( const string &temp, names ){
+		if( temp == name ){
+			return 1;
+		}
+	}
+	return 0;
+}
+
+int Search_endif(char *buffer,int i, int *pLine = 0){
+	for(;;i++){
+		if(buffer[i]=='\0') break;
+
+		if( buffer[i] == '\n' ){
+			if( pLine ){
+				(*pLine)++;
+			}
+		}
+
+		if(buffer[i-1]=='\n'){
+			if(memicmp(buffer+i,"#ifdef",6)==0||memicmp(buffer+i,"#ifndef",7)==0){
+				i=Search_endif(buffer,i+6, pLine);
+				if(buffer[i]=='\0') break;
+				continue;
+			}
+			else if(memicmp(buffer+i,"#endif",6)==0){
+				break;
+			}
+		}
+	}
+	return i;
+}
+
+void CDefine::preprocessor_ifdef(char *buffer,bool isNot){
+	int i,i2,i3;
+	char temporary[VN_SIZE];
+
+	if(isNot) i=lstrlen("#ifndef");
+	else i=lstrlen("#ifdef");
+	while(buffer[i]==' '||buffer[i]=='\t') i++;
+
+	for(i2=0;;i++,i2++){
+		if(buffer[i]=='\n'||buffer[i]=='\0'){
+			temporary[i2]=0;
+			break;
+		}
+		temporary[i2]=buffer[i];
+	}
+
+	int sw=0;
+	if(check(temporary)) sw=1;
+
+	if(isNot){
+		//#ifndefのとき（反対にする）
+		if(sw) sw=0;
+		else sw=1;
+	}
+
+	//#ifdefの行を消去
+	Text::SlideString(buffer+i,-i);
+	i=0;
+
+	BOOL bElse=0;
+	if(sw){
+		//TRUEのとき
+
+		//#else、#endifを探索
+		for(;;i++){
+			if(buffer[i]=='\0') break;
+
+			if(i==0||buffer[i-1]=='\n'){
+				if(memicmp(buffer+i,"#ifdef",6)==0||memicmp(buffer+i,"#ifndef",7)==0){
+					i=Search_endif(buffer,i+6);
+					if(buffer[i]=='\0') break;
+					continue;
+				}
+				else if(memicmp(buffer+i,"#else",5)==0){
+					i2=5;
+					bElse=1;
+					break;
+				}
+				else if(memicmp(buffer+i,"#endif",6)==0){
+					i2=6;
+					bElse=0;
+					break;
+				}
+			}
+		}
+
+		//行を消去
+		Text::SlideString(buffer+i+i2,-i2);
+
+		if(bElse){
+			//#elseがある場合はその区間を消去
+
+			for(i2=i,i3=0;;i2++){
+				if(buffer[i2]=='\0') break;
+
+				if(buffer[i2]=='\n') i3++;
+
+				if(i2==0||buffer[i2-1]=='\n'){
+					if(memicmp(buffer+i2,"#ifdef",6)==0||memicmp(buffer+i2,"#ifndef",7)==0){
+						i2=Search_endif(buffer,i2+6, &i3 );
+						if(buffer[i2]=='\0') break;
+						continue;
+					}
+					if(memicmp(buffer+i2,"#endif",6)==0){
+						i2+=6;
+						break;
+					}
+				}
+			}
+
+			//ソースコード区間を消去し、改行コードを挿入
+			Text::SlideString(buffer+i2,i-i2+i3);
+			memset(buffer+i,'\n',i3);
+		}
+	}
+	else{
+		//FALSEのとき
+
+		//#else、#endifを探索
+		for(i2=i,i3=0;;i2++){
+			if(buffer[i2]=='\0') break;
+
+			if(buffer[i2]=='\n') i3++;
+
+			if(i2==0||buffer[i2-1]=='\n'){
+				if(memicmp(buffer+i2,"#ifdef",6)==0||memicmp(buffer+i2,"#ifndef",7)==0){
+					i2=Search_endif(buffer,i2+6, &i3 );
+					if(buffer[i2]=='\0') break;
+					continue;
+				}
+				else if(memicmp(buffer+i2,"#else",5)==0){
+					i2+=5;
+					bElse=1;
+					break;
+				}
+				else if(memicmp(buffer+i2,"#endif",6)==0){
+					i2+=6;
+					bElse=0;
+					break;
+				}
+			}
+		}
+
+		//ソースコード区間を消去し、改行コードを挿入
+		Text::SlideString(buffer+i2,i-i2+i3);
+		memset(buffer+i,'\n',i3);
+
+		if(bElse){
+			//#endifを探索
+			for(;;i++){
+				if(buffer[i]=='\0') break;
+
+				if(i==0||buffer[i-1]=='\n'){
+					if(memicmp(buffer+i,"#ifdef",6)==0||memicmp(buffer+i,"#ifndef",7)==0){
+						i=Search_endif(buffer,i+6);
+						if(buffer[i]=='\0') break;
+						continue;
+					}
+					else if(memicmp(buffer+i,"#endif",6)==0){
+						i2=6;
+						bElse=0;
+						break;
+					}
+				}
+			}
+
+			//行を消去
+			Text::SlideString(buffer+i+i2,-i2);
+		}
+	}
+}
+
+
+void CDefine::DirectiveIfdef(char *buffer){
+	int i,i2,i3,sw;
+	char temporary[VN_SIZE];
+
+	for(i=0;;i++){
+		if(buffer[i]=='\0') break;
+
+		if(i==0||(i>=1&&buffer[i-1]=='\n')){
+			sw=0;
+			if(memicmp(buffer+i,"#define",7)==0){
+				i2=i+7;
+				while(buffer[i2]==' '||buffer[i2]=='\t') i2++;
+
+				for(i3=0;;i2++,i3++){
+					if(buffer[i2]=='\n'||buffer[i2]=='\0'){
+						temporary[i3]=0;
+						break;
+					}
+					temporary[i3]=buffer[i2];
+				}
+
+				add(temporary);
+
+				i2-=i;
+
+				//ディレクティブを消去
+				Text::SlideString(buffer+i+i2,-i2);
+			}
+			if(memicmp(buffer+i,"#undef",6)==0){
+				i2=i+7;
+				while(buffer[i2]==' '||buffer[i2]=='\t') i2++;
+
+				for(i3=0;;i2++,i3++){
+					if(buffer[i2]=='\n'||buffer[i2]=='\0'){
+						temporary[i3]=0;
+						break;
+					}
+					temporary[i3]=buffer[i2];
+				}
+
+				undef(temporary);
+
+				i2-=i;
+
+				//ディレクティブを消去
+				Text::SlideString(buffer+i+i2,-i2);
+			}
+			else if(memicmp(buffer+i,"#ifdef",6)==0){
+				preprocessor_ifdef(buffer+i,false);
+				continue;
+			}
+			else if(memicmp(buffer+i,"#ifndef",7)==0){
+				preprocessor_ifdef(buffer+i,true);
+				continue;
+			}
+			else continue;
+		}
+	}
+}
+
+
+
+
+bool Text::ReadFile( const string &filePath ){
+	//ファイルオープン
+	HANDLE hFile=CreateFile(filePath.c_str(),GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
+	if(hFile==INVALID_HANDLE_VALUE){
+		return false;
+	}
+
+	length = GetFileSize( hFile, NULL );
+
+	buffer = (char *)realloc( buffer, length + 1 );
+
+	//読み込み
+	DWORD dwAccBytes;
+	::ReadFile(hFile,buffer,length,&dwAccBytes,0);
+	buffer[dwAccBytes]=0;
+
+	//ファイルクローズ
+	CloseHandle(hFile);
+
+	return true;
+}
+
+void BasicSource::ChangeReturnLineChar(){
+	int i,i2;
+
+#ifdef _DEBUG
+	//改行コードの整合性チェック
+	for( i=0; ; i++ ){
+		if( buffer[i] == '\0' ){
+			break;
+		}
+		if( buffer[i]!='\r' && buffer[i+1]=='\n'
+			||  buffer[i]=='\r' && buffer[i+1]!='\n' ){
+				char temporary[255];
+				strncpy( temporary, buffer + i-100, 130 );
+				temporary[130] = 0;
+				for(int i2=0; ;i2++){
+					if(temporary[i2]=='\r') temporary[i2]='A';
+					if(temporary[i2]=='\n') temporary[i2]='B';
+					if(temporary[i2]=='\0') break;
+				}
+
+				extern HWND hOwnerEditor;
+				MessageBox( hOwnerEditor, temporary, "改行コードの整合性チェック", MB_OK | MB_ICONEXCLAMATION );
+		}
+	}
+#endif
+
+	//改行コードのCRLFをLFに変換
+	for(i=0,i2=0;;i++,i2++){
+		if(buffer[i]=='\r'&&buffer[i+1]=='\n') i++;
+		buffer[i2]=buffer[i];
+		if(buffer[i]=='\0') break;
+	}
+
+	length = i;
+}
+
+void BasicSource::RemoveComments(){
+	int i,i2,i3,IsStr;
+	char *temporary;
+	temporary=(char *)GlobalAlloc(GMEM_FIXED,lstrlen(buffer)+1);
+	for(i=0,i2=0,i3=0,IsStr=0;;i++,i2++){
+		if(buffer[i]=='\"') IsStr^=1;
+		if(buffer[i]=='\n'||buffer[i]=='\0'){
+			i2--;
+			while(temporary[i2]==' '||temporary[i2]=='\t') i2--;
+			i2++;
+
+			if(i3){
+				//複数行に渡る注釈文の中に改行が存在するとき
+				memset(temporary+i2,'\n',i3);
+				i2+=i3;
+				i3=0;
+			}
+		}
+		if(buffer[i]=='\''&&IsStr==0){
+			//注釈文
+			i2--;
+			while(temporary[i2]==' '||temporary[i2]=='\t') i2--;
+			i2++;
+			while(buffer[i]!='\n'&&buffer[i]!='\0') i++;
+		}
+		if(buffer[i]=='/'&&buffer[i+1]=='*'&&IsStr==0){
+			//注釈文（複数行）
+			i+=2;
+			i3=0;
+			while(!(buffer[i]=='*'&&buffer[i+1]=='/')){
+				if(buffer[i]=='\n') i3++;
+				if(buffer[i]=='\0') break;
+				i++;
+			}
+			if(buffer[i]){
+				i+=2;
+			}
+			i--;
+			i2--;
+			continue;
+		}
+		temporary[i2]=buffer[i];
+		if(buffer[i]=='\0') break;
+	}
+	lstrcpy(buffer,temporary);
+	GlobalFree(temporary);
+}
+
+bool BasicSource::ReadFile_InIncludeDirective( const string &filePath ){
+	if( !Text::ReadFile( filePath ) ){
+		return false;
+	}
+
+	// 改行コードをCRLFからLFに変換
+	ChangeReturnLineChar();
+
+	// コメントを削除
+	RemoveComments();
+
+	// #ifdefディレクティブを処理
+	objDefine.DirectiveIfdef( buffer );
+
+	// アンダーバーによる改行を正規表現に戻す
+	RemoveReturnLineUnderbar();
+
+	// ダミー改行をセット
+	Realloc( length + 2 );
+	Text::SlideString( buffer, 2 );
+	buffer[0] = '\n';
+	buffer[1] = '\n';
+
+	return true;
+}
+
+void BasicSource::DirectiveIncludeOrRequire(){
+	extern HANDLE hHeap;
+	extern char szIncludeDir[MAX_PATH];
+	extern char BasicCurDir[MAX_PATH];
+	extern INCLUDEFILEINFO IncludeFileInfo;
+	int i,i2,i3,sw1,LineNum,FileLayer[255],layer,LastFileByte[255];
+	char temporary[MAX_PATH],temp2[MAX_PATH+255],*LayerDir[255];
+
+	IncludeFileInfo.ppFileNames=(char **)calloc(sizeof(char *),1);
+	extern char SourceFileName[MAX_PATH];
+	IncludeFileInfo.ppFileNames[0]=(char *)malloc(lstrlen(SourceFileName)+1);
+	lstrcpy(IncludeFileInfo.ppFileNames[0],SourceFileName);
+	IncludeFileInfo.FilesNum=1;
+
+	layer=0;
+	FileLayer[layer]=0;
+	LastFileByte[layer]=GetLength();
+	LineNum=0;
+
+	//参照ディレクトリ
+	LayerDir[0]=(char *)malloc(lstrlen(BasicCurDir)+1);
+	lstrcpy(LayerDir[0],BasicCurDir);
+
+	for(i=0;;i++){
+		if(buffer[i]=='\0'){
+			IncludeFileInfo.LineOfFile[LineNum]=-1;
+			break;
+		}
+		if(buffer[i]=='\n'){
+			IncludeFileInfo.LineOfFile[LineNum]=FileLayer[layer];
+			LineNum++;
+		}
+		if(i>LastFileByte[layer]){
+			free(LayerDir[layer]);
+			LayerDir[layer]=0;
+			layer--;
+		}
+		if((buffer[i-1]=='\n'||i==0)&&buffer[i]=='#'){
+			bool isRequire = false;
+			if(memcmp( buffer + i + 1, "include", 7 ) == 0
+				|| memcmp( buffer + i + 1, "require", 7 ) == 0){
+
+					//#requireの場合
+					if( buffer[i + 1] == 'r' ) isRequire = true;
+
+					i2=i+8;
+					while(buffer[i2]==' '||buffer[i2]=='\t') i2++;
+
+					if(buffer[i2]=='\"') sw1=0;
+					else if(buffer[i2]=='<') sw1=1;
+					i2++;
+
+					for(i3=0;;i2++,i3++){
+						if((buffer[i2]=='\"'&&sw1==0)||(buffer[i2]=='>'&&sw1==1)||buffer[i2]=='\n'||buffer[i2]=='\0'){
+							temporary[i3]=0;
+							break;
+						}
+						temporary[i3]=buffer[i2];
+					}
+					while(buffer[i2]!='\n'&&buffer[i2]!='\0') i2++;
+
+					if(sw1){
+						sprintf(temp2,"%s%s",szIncludeDir,temporary);
+						lstrcpy(temporary,temp2);
+					}
+					else{
+						Jenga::Common::Directory dir( LayerDir[layer] );
+						lstrcpy( temporary, dir.GetFullPath( temporary ).c_str() );
+					}
+			}
+			else if(memcmp(buffer+i+1,"prompt",6)==0){
+				i2=i+7;
+				sprintf(temporary,"%sbasic\\prompt.sbp",szIncludeDir);
+			}
+			else if(memcmp(buffer+i+1,"N88BASIC",8)==0){
+				i2=i+9;
+				sprintf(temporary,"%sbasic\\prompt.sbp",szIncludeDir);
+			}
+			else if(memcmp(buffer+i+1,"console",7)==0){
+				//サブシステム タイプをCUIに変更
+				extern unsigned short TypeOfSubSystem;
+				TypeOfSubSystem=IMAGE_SUBSYSTEM_WINDOWS_CUI;
+
+				i2=i+8;
+				sprintf(temporary,"%sbasic\\dos_console.sbp",szIncludeDir);
+			}
+			else continue;
+
+			if(i){
+				//ディレクティブが消えるため、一行減ってしまうのを防ぐ（basic.sbpを除く）
+				Text::SlideString(buffer+i2,1);
+				buffer[i2]='\n';
+				for(i3=0;i3<=layer;i3++) LastFileByte[i3]++;
+			}
+
+			IncludeFileInfo.ppFileNames=(char **)realloc(IncludeFileInfo.ppFileNames,(IncludeFileInfo.FilesNum+1)*sizeof(char *));
+			IncludeFileInfo.ppFileNames[IncludeFileInfo.FilesNum]=(char *)malloc(lstrlen(temporary)+1);
+			lstrcpy(IncludeFileInfo.ppFileNames[IncludeFileInfo.FilesNum],temporary);
+
+			layer++;
+			FileLayer[layer]=IncludeFileInfo.FilesNum;
+			IncludeFileInfo.FilesNum++;
+
+			//#requireの場合では、既に読み込まれているファイルは読み込まないようにする
+			bool isFake = false;
+			if( isRequire ){
+				if( requireFiles.IsIncluded( temporary ) ){
+					//既に読み込まれているとき
+					isFake = true;
+				}
+			}
+
+			BasicSource source;
+
+			if( isFake ){
+				//既に読み込まれているときは空データ
+				source.SetBuffer( "" );
+			}
+			else{
+				//取り込まれたファイルを収集する
+				requireFiles.Add( temporary );
+
+				//インクルードファイルを読み込む
+				if( !source.ReadFile_InIncludeDirective( temporary ) ){
+					sprintf(temp2,"インクルードファイル \"%s\" をオープンできません",temporary);
+					throw SmoothieException(-1,temp2,i);
+					break;
+				}
+			}
+
+			i3=lstrlen(buffer)+source.GetLength();
+			Realloc( i3 );
+			Text::SlideString(buffer+i2,source.GetLength()+(i-i2));
+			memcpy(buffer+i,source.GetBuffer(),source.GetLength());
+
+			//新しい参照ディレクトリをセット
+			char temp4[MAX_PATH];
+			_splitpath(temporary,temp2,temp4,0,0);
+			lstrcat(temp2,temp4);
+			LayerDir[layer]=(char *)malloc(lstrlen(temp2)+1);
+			lstrcpy(LayerDir[layer],temp2);
+
+			//ファイル範囲をスライド
+			LastFileByte[layer]=i+source.GetLength()-1;
+			for(i3=0;i3<layer;i3++) LastFileByte[i3]+=source.GetLength()+(i-i2);
+
+			i--;
+		}
+	}
+
+	free(LayerDir[0]);
+
+	length = lstrlen(buffer);
+}
+
+int KillReturnCode_InParameter(char *buffer,int *pRnum,char cBeginPare,char cEndPare){
+	int i,i2,i3,IsStr;
+
+	//カッコ'('直下の改行
+	while(buffer[0]=='\n'){
+		Text::SlideString(buffer+1,-1);
+		(*pRnum)++;
+	}
+
+	for(i=0,IsStr=0;;i++){
+		if(IsDBCSLeadByte(buffer[i])&&buffer[i+1]){
+			i++;
+			continue;
+		}
+
+		if(buffer[i]=='\"') IsStr^=1;
+
+		if(buffer[i]=='\0') break;	//エラー
+		if(buffer[i]=='\n'){
+			i2=0;
+			i3=0;
+			while(buffer[i+i2]=='\n'){
+				i2++;
+				i3++;
+				while(buffer[i+i2]==' '||buffer[i+i2]=='\t') i2++;
+			}
+			while(buffer[i+i2]==' '||buffer[i+i2]=='\t') i2++;
+
+			if(buffer[i+i2]==cEndPare){
+				Text::SlideString(buffer+i+i2,-i2);
+				(*pRnum)+=i3;
+				break;
+			}
+
+			//エラー
+			break;
+		}
+
+		if(buffer[i]==cBeginPare&&IsStr==0){
+			i++;
+			i2=KillReturnCode_InParameter(buffer+i,pRnum,cBeginPare,cEndPare);
+			i+=i2;
+			if(buffer[i]!=cEndPare) break;
+			continue;
+		}
+		if(buffer[i]==cEndPare&&IsStr==0) break;
+
+		if(buffer[i]==','&&buffer[i+1]=='\n'&&IsStr==0){
+			i++;
+			while(buffer[i]=='\n'){
+				Text::SlideString(buffer+i+1,-1);
+				(*pRnum)++;
+			}
+			i--;
+		}
+	}
+	return i;
+}
+void BasicSource::RemoveReturnLineUnderbar(){
+	int i,i2;
+
+	//アンダーバーによる改行
+	for(i=0;;i++){
+		i2=0;
+		while(buffer[i]=='_'&&buffer[i+1]=='\n'){
+			i2++;
+			Text::SlideString(buffer+i+2,-2);
+			while(buffer[i]=='\n'){
+				Text::SlideString(buffer+i+1,-1);
+				i2++;
+			}
+			for(;;i++){
+				if(buffer[i]=='_'&&buffer[i+1]=='\n') break;
+				if(buffer[i]=='\n'||buffer[i]=='\0'){
+					Text::SlideString(buffer+i,i2);
+					memset(buffer+i,'\n',i2);
+					break;
+				}
+			}
+		}
+		if(buffer[i]=='\0') break;
+	}
+
+	//カッコ内パラメータの改行
+	int IsStr,rnum;
+	for(i=0,IsStr=0,rnum=0;;i++){
+		if(IsDBCSLeadByte(buffer[i])&&buffer[i+1]){
+			i++;
+			continue;
+		}
+		if(buffer[i]=='\0') break;
+		if(buffer[i]=='\n'){
+			if(rnum){
+				Text::SlideString(buffer+i+1,rnum);
+				memset(buffer+i+1,'\n',rnum);
+				rnum=0;
+			}
+		}
+		if(buffer[i]=='\"') IsStr^=1;
+		if(buffer[i]=='('&&IsStr==0){
+			i++;
+			i2=KillReturnCode_InParameter(buffer+i,&rnum,'(',')');
+			i+=i2;
+			if(buffer[i]!=')') break;
+		}
+		if(buffer[i]=='['&&IsStr==0){
+			i++;
+			i2=KillReturnCode_InParameter(buffer+i,&rnum,'[',']');
+			i+=i2;
+			if(buffer[i]!=']') break;
+		}
+	}
+
+	length = lstrlen(buffer);
+}
+
+void BasicSource::SetBuffer( const char *buffer ){
+	this->buffer = (char *)calloc( lstrlen(buffer) + 1, 1 );
+	lstrcpy( this->buffer, buffer );
+	length = lstrlen(buffer);
+
+	// ダミー改行をセット
+	Realloc( length + 2 );
+	Text::SlideString( this->buffer, 2 );
+	this->buffer[0] = '\n';
+	this->buffer[1] = '\n';
+}
+
+bool BasicSource::ReadFile( const string &filePath ){
+	if( !Text::ReadFile( filePath ) ){
+		return false;
+	}
+
+	// 改行コードをCRLFからLFに変換
+	ChangeReturnLineChar();
+
+	// basic.sbpをインクルード
+	const char *headCode = "#include <basic.sbp>\n";
+	Realloc( length + lstrlen(headCode) );
+	Text::SlideString( buffer, lstrlen(headCode) );
+	memcpy( buffer, headCode, lstrlen(headCode) );
+
+	// #defineと#requireを初期化
+	// TODO: バージョン番号の識別子defineが未完成
+	objDefine.Init(0);
+	requireFiles.clear();
+
+	// コメントを削除
+	RemoveComments();
+
+	// #ifdefディレクティブを処理
+	objDefine.DirectiveIfdef( buffer );
+
+	//最終行には文字を含ませないようにする
+	Realloc( length + 1 );
+	lstrcat( buffer, "\n" );
+
+	// #include / #require ディレクティブを処理
+	DirectiveIncludeOrRequire();
+
+	// アンダーバーによる改行を正規表現に戻す
+	RemoveReturnLineUnderbar();
+
+	// ダミー改行をセット
+	Realloc( length + 2 );
+	Text::SlideString( buffer, 2 );
+	buffer[0] = '\n';
+	buffer[1] = '\n';
+
+	extern char *basbuf;
+	basbuf = GetBuffer();
+
+	return true;
+}
+
+bool BasicSource::Generate( const string &genName, const char *genBuffer ){
+	const int genBufferLength = lstrlen( genBuffer );
+
+#ifdef _DEBUG
+	// 挿入ソースに改行コードが含まれていないかを検査する
+	for( int i=0; genBuffer[i] ; i++ ){
+		if( genBuffer[i] == '\n' ){
+			SetError();
+			break;
+		}
+	}
+#endif
+
+	bool isFound = false;
+
+	for( int i=0; ; i++ ){
+		if( i == 0 || buffer[i] == '\n' ){
+			if( buffer[i] == '\n' ){
+				i++;
+			}
+			while( Text::IsBlank( buffer[i] ) ){
+				i++;
+			}
+
+			int startIndex = i;
+
+			if( memicmp( buffer + i, generateDirectiveName.c_str(), generateDirectiveName.size() ) == 0 ){
+				i += (int)generateDirectiveName.size();
+				while( Text::IsBlank( buffer[i] ) ){
+					i++;
+				}
+
+				char temporary[VN_SIZE];
+				for( int i2=0; ; i++, i2++ ){
+					if( buffer[i] == '\n' ){
+						temporary[i2] = 0;
+						break;
+					}
+					temporary[i2] = buffer[i];
+				}
+				if( genName == temporary ){
+					// 一致
+
+					int endIndex = i;
+
+					int lengthOffset = genBufferLength - ( endIndex - startIndex );
+
+					Realloc( length + lengthOffset );
+					Text::SlideString( buffer + endIndex, lengthOffset );
+					memcpy( buffer + startIndex, genBuffer, genBufferLength );
+
+					isFound = true;
+
+					break;
+				}
+			}
+		}
+	}
+
+	return isFound;
+}
+
+void BasicSource::Addition( const char *buffer ){
+	Realloc( length + lstrlen(buffer) );
+	lstrcat( this->buffer, buffer );
+}
Index: trunk/jenga/src/smoothie/Symbol.cpp
===================================================================
--- trunk/jenga/src/smoothie/Symbol.cpp	(revision 170)
+++ trunk/jenga/src/smoothie/Symbol.cpp	(revision 170)
@@ -0,0 +1,22 @@
+#include <jenga/include/smoothie/BasicFixed.h>
+#include <jenga/include/smoothie/Symbol.h>
+#include <jenga/include/smoothie/Member.h>
+
+Symbol::Symbol( const char *fullName )
+{
+	char areaName[VN_SIZE] = "";		//オブジェクト変数
+	char nestName[VN_SIZE] = "";		//入れ子メンバ
+	bool isNest = CMember::SplitName( fullName, areaName, nestName );
+
+	namespaceScopes = NamespaceScopes( areaName );
+	name = nestName;
+}
+Symbol::Symbol( const string &fullName )
+{
+	char areaName[VN_SIZE] = "";		//オブジェクト変数
+	char nestName[VN_SIZE] = "";		//入れ子メンバ
+	bool isNest = CMember::SplitName( fullName.c_str(), areaName, nestName );
+
+	namespaceScopes = NamespaceScopes( areaName );
+	name = nestName;
+}
