Index: /trunk/ab5.0/abdev/BasicCompiler32/BasicCompiler.vcproj
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler32/BasicCompiler.vcproj	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler32/BasicCompiler.vcproj	(revision 465)
@@ -1266,4 +1266,8 @@
 					>
 				</File>
+				<File
+					RelativePath="..\BasicCompiler_Common\src\Messenger.cpp"
+					>
+				</File>
 				<Filter
 					Name="Langauge Classes"
@@ -1471,4 +1475,8 @@
 					>
 				</File>
+				<File
+					RelativePath="..\BasicCompiler_Common\include\Messenger.h"
+					>
+				</File>
 				<Filter
 					Name="Language Classes"
Index: /trunk/ab5.0/abdev/BasicCompiler32/CParameter.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler32/CParameter.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler32/CParameter.cpp	(revision 465)
@@ -239,5 +239,5 @@
 				char temp2[255];
 				sprintf(temp2,"%s関数の第%dパラメータ",procName.c_str(),i2+1);
-				SetError(19,temp2,cp);
+				compiler.errorMessenger.Output(19,temp2,cp);
 				continue;
 			}
@@ -306,5 +306,5 @@
 			}
 			else{
-				SetError(300,NULL,cp);
+				compiler.errorMessenger.Output(300,NULL,cp);
 			}
 		}
@@ -368,10 +368,10 @@
 									if( dummyType.IsObject() ){
 										if( !dummyType.GetClass().IsEqualsOrSubClass( &varType.GetClass() ) ){
-											SetError(11,Parms[i2],cp);
+											compiler.errorMessenger.Output(11,Parms[i2],cp);
 										}
 									}
 									else if( dummyType.IsStruct() ){
 										if( !dummyType.GetClass().IsEquals( &varType.GetClass() ) ){
-											SetError(11,Parms[i2],cp);
+											compiler.errorMessenger.Output(11,Parms[i2],cp);
 										}
 									}
@@ -382,5 +382,5 @@
 								}
 								else{
-									SetError(11,Parms[i2],cp);
+									compiler.errorMessenger.Output(11,Parms[i2],cp);
 								}
 							}
Index: /trunk/ab5.0/abdev/BasicCompiler32/Compile_Calc.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler32/Compile_Calc.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler32/Compile_Calc.cpp	(revision 465)
@@ -130,5 +130,5 @@
 		compiler.codeGenerator.op_fstp_basereg( DEF_DOUBLE, REG_ESP );
 	}
-	else SetError(9,NULL,cp);
+	else compiler.errorMessenger.Output(9,NULL,cp);
 }
 void ChangeTypeToSingle(int OldType){
@@ -198,5 +198,5 @@
 		compiler.codeGenerator.op_fstp_basereg( DEF_SINGLE, REG_ESP );
 	}
-	else SetError(9,NULL,cp);
+	else compiler.errorMessenger.Output(9,NULL,cp);
 }
 
@@ -254,5 +254,5 @@
 		}
 	}
-	else SetError(9,NULL,cp);
+	else compiler.errorMessenger.Output(9,NULL,cp);
 }
 void ChangeTypeToLong(int OldType){
@@ -393,5 +393,5 @@
 	}
 	else{
-		SetError(300,NULL,cp);
+		compiler.errorMessenger.Output(300,NULL,cp);
 	}
 }
@@ -411,5 +411,5 @@
 			//ダブルクォートは不正なのでエラー扱い
 			variable[i]=0;
-			SetError(3,variable,cp);
+			compiler.errorMessenger.Output(3,variable,cp);
 			return;
 		}
@@ -458,5 +458,5 @@
 			if(GetVarType(variable,Type(),0)){
 				//変数リストに該当したとき
-				SetError(1,NULL,cp);
+				compiler.errorMessenger.Output(1,NULL,cp);
 			}
 			else{
@@ -465,9 +465,9 @@
 				{
 					//定数リストに該当したとき
-					SetError(1,NULL,cp);
+					compiler.errorMessenger.Output(1,NULL,cp);
 				}
 				else{
 					//変数リスト、定数リストに該当しないとき
-					SetError(3,variable,cp);
+					compiler.errorMessenger.Output(3,variable,cp);
 				}
 			}
@@ -491,5 +491,5 @@
 
 	if(Command[i+1]=='\0'){
-		SetError(1,NULL,cp);
+		compiler.errorMessenger.Output(1,NULL,cp);
 		return;
 	}
@@ -531,5 +531,5 @@
 
 	if( lstrcmpi( variable, "This" ) == 0 ){
-		SetError(133,NULL,cp);
+		compiler.errorMessenger.Output(133,NULL,cp);
 		return;
 	}
@@ -593,10 +593,10 @@
 	if( !TermOpeOnlyVariable( variable, varType, VarRelativeVar, true ) )
 	{
-		SetError();
+		compiler.errorMessenger.OutputFatalError();
 		return;
 	}
 
 	if(varType.GetBasicType()&FLAG_PTR){
-		SetError(14,variable,cp);
+		compiler.errorMessenger.Output(14,variable,cp);
 		return;
 	}
@@ -614,5 +614,5 @@
 		compiler.GetObjectModule().meta.GetBlittableTypes().GetClass( calcType ).GetStaticMethods().Enum( "_Create", userProcs );
 		if( userProcs.size() != 1 ){
-			SetError();
+			compiler.errorMessenger.OutputFatalError();
 			return;
 		}
Index: /trunk/ab5.0/abdev/BasicCompiler32/Compile_Calc_PushVar.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler32/Compile_Calc_PushVar.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler32/Compile_Calc_PushVar.cpp	(revision 465)
@@ -21,5 +21,5 @@
 	}
 	else if(pRelativeVar->dwKind==VAR_REFGLOBAL){
-		SetError(300,NULL,cp);
+		compiler.errorMessenger.Output(300,NULL,cp);
 	}
 	else if(pRelativeVar->dwKind==VAR_LOCAL){
@@ -68,5 +68,5 @@
 		//64ビットの場合はedx:eaxにロード
 		if(reg!=REG_EAX){
-			SetError(300,NULL,cp);
+			compiler.errorMessenger.Output(300,NULL,cp);
 			return;
 		}
Index: /trunk/ab5.0/abdev/BasicCompiler32/Compile_CallProc.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler32/Compile_CallProc.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler32/Compile_CallProc.cpp	(revision 465)
@@ -135,5 +135,5 @@
 					}
 					else{
-						SetError(300,NULL,cp);
+						compiler.errorMessenger.Output(300,NULL,cp);
 					}
 				}
@@ -163,5 +163,5 @@
 			pMethod = pobj_c->GetStaticMethods().GetMethodPtr( pUserProc );
 			if( !pMethod ){
-				SetError(300,NULL,cp);
+				compiler.errorMessenger.Output(300,NULL,cp);
 				return false;
 			}
@@ -181,5 +181,5 @@
 				//同一クラスオブジェクトの場合はプライベートアクセスを容認する
 				if( pMethod->IsNoneAccess() ){
-					SetError(109,pUserProc->GetName(),cp);
+					compiler.errorMessenger.Output(109,pUserProc->GetName(),cp);
 					return false;
 				}
@@ -188,9 +188,9 @@
 				if( pMethod->IsPrivate()
 					|| pMethod->IsNoneAccess() ){
-					SetError(109,pUserProc->GetName(),cp);
+					compiler.errorMessenger.Output(109,pUserProc->GetName(),cp);
 					return false;
 				}
 				if( !pMethod->GetUserProc().GetParentClass().IsEqualsOrSubClass( pobj_c ) && pMethod->IsProtected() ){
-					SetError(110,pUserProc->GetName(),cp);
+					compiler.errorMessenger.Output(110,pUserProc->GetName(),cp);
 					return false;
 				}
@@ -200,5 +200,5 @@
 			//クラス内部からの呼び出し（継承によるACCESS_NONのみをエラーとする）
 			if( pMethod->IsNoneAccess() ){
-				SetError(109,pUserProc->GetName(),cp);
+				compiler.errorMessenger.Output(109,pUserProc->GetName(),cp);
 				return false;
 			}
@@ -296,5 +296,5 @@
 				if( !resultType.IsObject() )
 				{
-					SetError();
+					compiler.errorMessenger.OutputFatalError();
 				}
 
@@ -344,5 +344,5 @@
 			if( vtblMasterListIndex != 0 )
 			{
-				SetError();
+				compiler.errorMessenger.OutputFatalError();
 			}
 		}
Index: /trunk/ab5.0/abdev/BasicCompiler32/Compile_Func.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler32/Compile_Func.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler32/Compile_Func.cpp	(revision 465)
@@ -263,5 +263,5 @@
 					|| type.IsObjectPtr() && referenceKind == RefPointer ) )
 				{
-					SetError(104,ObjectName,cp);
+					compiler.errorMessenger.Output(104,ObjectName,cp);
 				}
 
@@ -305,5 +305,5 @@
 			if( vtblMasterListIndex != 0 )
 			{
-				SetError();
+				compiler.errorMessenger.OutputFatalError();
 			}
 		}
@@ -400,5 +400,5 @@
 		{
 			extern int cp;
-			SetError(1,NULL,cp);
+			compiler.errorMessenger.Output(1,NULL,cp);
 			return;
 		}
@@ -460,5 +460,5 @@
 		GetOverloadSubHash( name, subs );
 		if( subs.size() == 0 ){
-			SetError(27,name,cp);
+			compiler.errorMessenger.Output(27,name,cp);
 			return;
 		}
@@ -480,5 +480,5 @@
 					) )
 				{
-					SetError(67, name, cp );
+					compiler.errorMessenger.Output(67, name, cp );
 				}
 			}
@@ -491,5 +491,5 @@
 					) )
 				{
-					SetError(66, name, cp );
+					compiler.errorMessenger.Output(66, name, cp );
 				}
 			}
@@ -497,5 +497,5 @@
 
 		if(!pUserProc){
-			SetError(27,name,cp);
+			compiler.errorMessenger.Output(27,name,cp);
 			return;
 		}
@@ -504,5 +504,5 @@
 		pUserProc=GetSubHash(name);
 		if(!pUserProc){
-			SetError(27,name,cp);
+			compiler.errorMessenger.Output(27,name,cp);
 			return;
 		}
@@ -531,5 +531,5 @@
 	Type tempType;
 	if( !compiler.StringToType( typeName, tempType ) ){
-		SetError(3,typeName,cp);
+		compiler.errorMessenger.Output(3,typeName,cp);
 		return;
 	}
@@ -597,5 +597,5 @@
 	}
 	else{
-		SetError(134,NULL,cp );
+		compiler.errorMessenger.Output(134,NULL,cp );
 	}
 }
@@ -680,5 +680,5 @@
 	}
 	if(!tempType.IsWhole()){
-		SetError(11,Parameter,cp);
+		compiler.errorMessenger.Output(11,Parameter,cp);
 		return;
 	}
Index: /trunk/ab5.0/abdev/BasicCompiler32/Compile_Object.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler32/Compile_Object.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler32/Compile_Object.cpp	(revision 465)
@@ -22,5 +22,5 @@
 
 	if(bSomeObjects){
-		SetError();
+		compiler.errorMessenger.OutputFatalError();
 
 		//push ebx
@@ -64,5 +64,5 @@
 		}
 		else{
-			SetError();
+			compiler.errorMessenger.OutputFatalError();
 		}
 
@@ -110,5 +110,5 @@
 	if(pClass->IsAbstract()){
 		//抽象クラスだったとき
-		SetError(125,pClass->GetName(),cp);
+		compiler.errorMessenger.Output(125,pClass->GetName(),cp);
 	}
 
@@ -119,5 +119,5 @@
 		Type tempType;
 		NumOpe(objectSizeStr,Type(),tempType);
-		if( !tempType.IsWhole() ) SetError(49,NULL,cp);
+		if( !tempType.IsWhole() ) compiler.errorMessenger.Output(49,NULL,cp);
 		ChangeTypeToLong(tempType.GetBasicType());
 
@@ -269,5 +269,5 @@
 		return;
 	}
-	if(!( tempType.IsObjectPtr() || tempType.IsVoidPtr() )) SetError(122,NULL,cp);
+	if(!( tempType.IsObjectPtr() || tempType.IsVoidPtr() )) compiler.errorMessenger.Output(122,NULL,cp);
 
 	//pop eax
Index: /trunk/ab5.0/abdev/BasicCompiler32/Compile_ProcOp.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler32/Compile_ProcOp.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler32/Compile_ProcOp.cpp	(revision 465)
@@ -197,5 +197,5 @@
 	}
 	else{
-		SetError();
+		compiler.errorMessenger.OutputFatalError();
 	}
 }
@@ -242,10 +242,10 @@
 		{
 			if(pGotoLabelSchedule->GetName().size()>0){
-				SetError(6,pGotoLabelSchedule->GetName(),pGotoLabelSchedule->GetSourceCodePos());
+				compiler.errorMessenger.Output(6,pGotoLabelSchedule->GetName(),pGotoLabelSchedule->GetSourceCodePos());
 			}
 			else{
 				char temporary[255];
 				sprintf(temporary,"%d",pGotoLabelSchedule->GetLineNum());
-				SetError(6,temporary,pGotoLabelSchedule->GetSourceCodePos());
+				compiler.errorMessenger.Output(6,temporary,pGotoLabelSchedule->GetSourceCodePos());
 			}
 		}
@@ -273,5 +273,5 @@
 	}
 	else{
-		SetError();
+		compiler.errorMessenger.OutputFatalError();
 	}
 }
@@ -285,5 +285,5 @@
 
 	if( pUserProc->GetLocalVars().size() ){
-		SetError();
+		compiler.errorMessenger.OutputFatalError();
 		return;
 	}
@@ -311,5 +311,5 @@
 	{
 		// 既にコード生成が行われている場合はエラー
-		SetError();
+		compiler.errorMessenger.OutputFatalError();
 	}
 
@@ -531,5 +531,5 @@
 					}
 					if(!(temporary[0]=='('&&temporary[lstrlen(temporary)-1]==')')){
-						SetError(1,NULL,cp);
+						compiler.errorMessenger.Output(1,NULL,cp);
 					}
 					RemoveStringPare(temporary);
@@ -618,5 +618,5 @@
 	//With情報のメモリを解放
 	for(i3=0;i3<WithInfo.num;i3++){
-		SetError(22,"With",WithInfo.pWithCp[i3]);
+		compiler.errorMessenger.Output(22,"With",WithInfo.pWithCp[i3]);
 		HeapDefaultFree(WithInfo.ppName[i3]);
 	}
@@ -710,5 +710,5 @@
 		else
 		{
-			SetError();
+			compiler.errorMessenger.OutputFatalError();
 		}
 	}
Index: /trunk/ab5.0/abdev/BasicCompiler32/Compile_Set_Var.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler32/Compile_Set_Var.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler32/Compile_Set_Var.cpp	(revision 465)
@@ -50,5 +50,5 @@
 	}
 
-	SetError(1,NULL,cp);
+	compiler.errorMessenger.Output(1,NULL,cp);
 }
 
@@ -155,9 +155,9 @@
 	if(type==DEF_DOUBLE){
 		// TODO: 実装
-		SetError();
+		compiler.errorMessenger.OutputFatalError();
 	}
 	else if(type==DEF_SINGLE){
 		// TODO: 実装
-		SetError();
+		compiler.errorMessenger.OutputFatalError();
 	}
 	else if(type==DEF_INT64||type==DEF_QWORD){
@@ -180,5 +180,5 @@
 		if(!IsWholeNumberType(type)){
 			//不正な型の場合
-			SetError(9,NULL,cp);
+			compiler.errorMessenger.Output(9,NULL,cp);
 			return;
 		}
@@ -327,5 +327,5 @@
 	else if(pRelative->dwKind==VAR_REFGLOBAL){
 		// 今は使われていない
-		SetError();
+		compiler.errorMessenger.OutputFatalError();
 
 		if(pRelative->bOffsetOffset){
Index: /trunk/ab5.0/abdev/BasicCompiler32/Compile_Statement.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler32/Compile_Statement.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler32/Compile_Statement.cpp	(revision 465)
@@ -16,5 +16,5 @@
 			//ダブルクォートは不正なのでエラー扱い
 			leftTerm[i]=0;
-			SetError(3,leftTerm,cp);
+			compiler.errorMessenger.Output(3,leftTerm,cp);
 			return;
 		}
@@ -48,5 +48,5 @@
 		(leftTerm[0]==1&&leftTerm[1]==ESC_PSMEM)
 		)){
-		SetError(1,NULL,cp);
+		compiler.errorMessenger.Output(1,NULL,cp);
 		return;
 	}
@@ -76,5 +76,5 @@
 		if(pUserProc){
 			if( !pUserProc->IsMacro() ){
-				SetError(10,Command,cp);
+				compiler.errorMessenger.Output(10,Command,cp);
 			}
 
@@ -117,5 +117,5 @@
 
 	// どこにも当てはまらなかったため、失敗
-	SetError(1,NULL,cp);
+	compiler.errorMessenger.Output(1,NULL,cp);
 }
 
@@ -126,5 +126,5 @@
 	for(i=0;;i++){
 		if(Parameter[i]=='\0'){
-			SetError(21,NULL,cp);
+			compiler.errorMessenger.Output(21,NULL,cp);
 			return;
 		}
@@ -355,5 +355,5 @@
 	compiler.codeGenerator.ContinueAreaBegin();
 
-	if(!Parameter[0]) SetError(10,"While",cp);
+	if(!Parameter[0]) compiler.errorMessenger.Output(10,"While",cp);
 
 	const PertialSchedule *pWhilePertialSchedule = NULL;
@@ -483,5 +483,5 @@
 	i=GetOneParameter(Parameter,0,temporary);
 	if(!Parameter[i]){
-		SetError(12,"For",cp);
+		compiler.errorMessenger.Output(12,"For",cp);
 		goto ErrorStep;
 	}
@@ -496,5 +496,5 @@
 		}
 		if(temporary[i2]=='\0'){
-			SetError(12,"For",cp);
+			compiler.errorMessenger.Output(12,"For",cp);
 			goto ErrorStep;
 		}
@@ -514,5 +514,5 @@
 	if(Parameter[i]){
 		i=GetOneParameter(Parameter,i,StepNum);
-		if(Parameter[i]) SetError(12,"For",cp);
+		if(Parameter[i]) compiler.errorMessenger.Output(12,"For",cp);
 	}
 	else lstrcpy(StepNum,"1");
@@ -578,5 +578,5 @@
 	if(szNextVariable[0]){
 		if(lstrcmp(szNextVariable,variable)!=0){
-			SetError(55,szNextVariable,cp);
+			compiler.errorMessenger.Output(55,szNextVariable,cp);
 		}
 	}
@@ -608,5 +608,5 @@
 	GetCustomToken( variable, Parameter, i, ESC_IN, true );
 	if(!Parameter[i]){
-		SetError(12,"Foreach",cp);
+		compiler.errorMessenger.Output(12,"Foreach",cp);
 		isError = true;
 		goto ErrorStep;
@@ -667,5 +667,5 @@
 	if(szNextVariable[0]){
 		if(lstrcmp(szNextVariable,variable)!=0){
-			SetError(55,szNextVariable,cp);
+			compiler.errorMessenger.Output(55,szNextVariable,cp);
 		}
 	}
@@ -691,5 +691,5 @@
 	int i,i2,i3;
 
-	if(Parameter[0]) SetError(10,"Do",cp);
+	if(Parameter[0]) compiler.errorMessenger.Output(10,"Do",cp);
 
 	//Continueアドレスのバックアップとセット
@@ -894,5 +894,5 @@
 void OpcodeExitSub(void){
 	if( UserProc::IsGlobalAreaCompiling() ){
-		SetError(12,"Exit Sub/Function",cp);
+		compiler.errorMessenger.Output(12,"Exit Sub/Function",cp);
 		return;
 	}
@@ -942,5 +942,5 @@
 			if(basbuf[i]=='\0'){
 				selectSchedules.pop_back();
-				SetError(22,"Select",cp);
+				compiler.errorMessenger.Output(22,"Select",cp);
 				return;
 			}
@@ -1163,5 +1163,5 @@
 
 	if(selectSchedules.back().typeSize==-1){
-		SetError(30,"Case",cp);
+		compiler.errorMessenger.Output(30,"Case",cp);
 		return;
 	}
@@ -1282,5 +1282,5 @@
 	i=GetOneParameter(Parameter,0,temporary);
 	if(!Parameter[i]){
-		SetError(1,NULL,cp);
+		compiler.errorMessenger.Output(1,NULL,cp);
 		return;
 	}
@@ -1291,5 +1291,5 @@
 	}
 	if(!resultType.IsWhole()){
-		SetError(11,Parameter,cp);
+		compiler.errorMessenger.Output(11,Parameter,cp);
 		return;
 	}
@@ -1300,5 +1300,5 @@
 	i=GetOneParameter(Parameter,i,temporary);
 	if(Parameter[i]){
-		SetError(1,NULL,cp);
+		compiler.errorMessenger.Output(1,NULL,cp);
 		return;
 	}
Index: /trunk/ab5.0/abdev/BasicCompiler32/Compile_Var.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler32/Compile_Var.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler32/Compile_Var.cpp	(revision 465)
@@ -35,5 +35,5 @@
 	else{
 		//エラー
-		SetError(1,NULL,cp);
+		compiler.errorMessenger.Output(1,NULL,cp);
 		return;
 	}
@@ -185,5 +185,5 @@
 	if( !pMember )
 	{
-		if(isErrorEnabled) SetError(103,VarName,cp);
+		if(isErrorEnabled) compiler.errorMessenger.Output(103,VarName,cp);
 		return false;
 	}
@@ -196,5 +196,5 @@
 		//同一クラスオブジェクトの場合はプライベートアクセスを容認する
 		if(pMember->IsNoneAccess()){
-			if(isErrorEnabled) SetError(107,VarName,cp);
+			if(isErrorEnabled) compiler.errorMessenger.Output(107,VarName,cp);
 			return false;
 		}
@@ -203,9 +203,9 @@
 		if((bPrivateAccess==0&&pMember->IsPrivate())||
 			pMember->IsNoneAccess()){
-			if(isErrorEnabled) SetError(107,VarName,cp);
+			if(isErrorEnabled) compiler.errorMessenger.Output(107,VarName,cp);
 			return false;
 		}
 		else if(bPrivateAccess==0&&pMember->IsProtected()){
-			if(isErrorEnabled) SetError(108,VarName,cp);
+			if(isErrorEnabled) compiler.errorMessenger.Output(108,VarName,cp);
 			return false;
 		}
@@ -219,5 +219,5 @@
 		){
 			//Const定義の変数に書き込みアクセスをしようとした場合
-			SetError(61,VarName,cp);
+			compiler.errorMessenger.Output(61,VarName,cp);
 	}
 
@@ -237,5 +237,5 @@
 	else{
 		if(lpPtrOffset[0]){
-			if(isErrorEnabled) SetError(16,member,cp);
+			if(isErrorEnabled) compiler.errorMessenger.Output(16,member,cp);
 			return false;
 		}
@@ -250,5 +250,5 @@
 		//配列オフセット
 		if(!GetArrayOffset(pMember->GetSubscripts(),array,pMember->GetType())){
-			if(isErrorEnabled) SetError(14,member,cp);
+			if(isErrorEnabled) compiler.errorMessenger.Output(14,member,cp);
 			return false;
 		}
@@ -263,5 +263,5 @@
 		if( resultType.IsObject() || resultType.IsStruct() ){
 			if( refType != RefDot ){
-				if(isErrorEnabled) SetError(104,member,cp);
+				if(isErrorEnabled) compiler.errorMessenger.Output(104,member,cp);
 				return false;
 			}
@@ -279,5 +279,5 @@
 				if( ( resultType.IsObjectPtr() || resultType.IsStructPtr() )
 					&& refType != RefDot ){
-						if(isErrorEnabled) SetError(104,member,cp);
+						if(isErrorEnabled) compiler.errorMessenger.Output(104,member,cp);
 						return false;
 				}
@@ -293,5 +293,5 @@
 				if( ( resultType.IsObjectPtr() || resultType.IsStructPtr() )
 					&& refType != RefPointer ){
-						if(isErrorEnabled) SetError(104,member,cp);
+						if(isErrorEnabled) compiler.errorMessenger.Output(104,member,cp);
 						return false;
 				}
@@ -307,5 +307,5 @@
 				//ppObj[n]->member
 				if( refType != RefPointer ){
-					if(isErrorEnabled) SetError(104,member,cp);
+					if(isErrorEnabled) compiler.errorMessenger.Output(104,member,cp);
 					return false;
 				}
@@ -321,5 +321,5 @@
 			}
 			else{
-				if(isErrorEnabled) SetError(104,member,cp);
+				if(isErrorEnabled) compiler.errorMessenger.Output(104,member,cp);
 				return false;
 			}
@@ -403,5 +403,5 @@
 			else{
 				if(lpPtrOffset[0]){
-					SetError(16,variable,cp);
+					compiler.errorMessenger.Output(16,variable,cp);
 					pRelativeVar->dwKind=NON_VAR;
 					return false;
@@ -485,5 +485,5 @@
 			compiler.pCompilingClass->IsCompilingDestructor() == false
 			){
-				SetError(131, NULL, cp );
+				compiler.errorMessenger.Output(131, NULL, cp );
 		}
 
@@ -577,5 +577,5 @@
 		}
 
-		if(isErrorEnabled) SetError(3,variable,cp);
+		if(isErrorEnabled) compiler.errorMessenger.Output(3,variable,cp);
 		pRelativeVar->dwKind=NON_VAR;
 		return false;
@@ -593,5 +593,5 @@
 		else{
 			if(lpPtrOffset[0]){
-				SetError(16,variable,cp);
+				compiler.errorMessenger.Output(16,variable,cp);
 				pRelativeVar->dwKind=NON_VAR;
 				return false;
@@ -619,9 +619,9 @@
 		if( resultType.IsObject() ){
 			//オブジェクト定数
-			SetError(130, VarName, cp );
+			compiler.errorMessenger.Output(130, VarName, cp );
 		}
 		else{
 			//一般のConst変数
-			SetError(61,VarName,cp);
+			compiler.errorMessenger.Output(61,VarName,cp);
 		}
 	}
@@ -647,5 +647,5 @@
 	if(array[0]){
 		if(!GetArrayOffset(*pSubscripts,array,resultType)){
-			SetError(14,variable,cp);
+			compiler.errorMessenger.Output(14,variable,cp);
 			pRelativeVar->dwKind=NON_VAR;
 			return false;
@@ -656,5 +656,5 @@
 			//実態オブジェクトのメンバを参照（obj.member）
 			if( refType != RefDot ){
-				SetError(104,VarName,cp);
+				compiler.errorMessenger.Output(104,VarName,cp);
 				pRelativeVar->dwKind=NON_VAR;
 				return false;
@@ -671,5 +671,5 @@
 				//pObj[n].member
 				if( refType != RefDot ){
-					SetError(104,VarName,cp);
+					compiler.errorMessenger.Output(104,VarName,cp);
 					pRelativeVar->dwKind=NON_VAR;
 					return false;
@@ -681,5 +681,5 @@
 				//pObj->member
 				if( refType != RefPointer ){
-					SetError(104,VarName,cp);
+					compiler.errorMessenger.Output(104,VarName,cp);
 					pRelativeVar->dwKind=NON_VAR;
 					return false;
@@ -698,5 +698,5 @@
 				//ppObj[n]->member
 				if( refType != RefPointer ){
-					SetError(104,VarName,cp);
+					compiler.errorMessenger.Output(104,VarName,cp);
 					pRelativeVar->dwKind=NON_VAR;
 					return false;
@@ -713,5 +713,5 @@
 			}
 			else{
-				SetError(104,VarName,cp);
+				compiler.errorMessenger.Output(104,VarName,cp);
 				pRelativeVar->dwKind=NON_VAR;
 				return false;
@@ -719,5 +719,5 @@
 		}
 		else{
-			SetError(102,VarName,cp);
+			compiler.errorMessenger.Output(102,VarName,cp);
 			pRelativeVar->dwKind=NON_VAR;
 			return false;
@@ -768,5 +768,5 @@
 				while(1){
 					if( subscripts[0] < i2 ){
-						SetError(41,0,cp);
+						compiler.errorMessenger.Output(41,0,cp);
 						return 0;
 					}
@@ -790,5 +790,5 @@
 			BOOST_FOREACH( CMember *pMember, objClass.GetDynamicMembers() ){
 				if(InitBuf[i]=='\0'){
-					SetError(41,0,cp);
+					compiler.errorMessenger.Output(41,0,cp);
 					return false;
 				}
@@ -806,5 +806,5 @@
 		}
 
-		SetError(41,0,cp);
+		compiler.errorMessenger.Output(41,0,cp);
 		return false;
 	}
@@ -816,5 +816,5 @@
 
 	if( subscripts.size() > 0 ){
-		SetError(41,0,cp);
+		compiler.errorMessenger.Output(41,0,cp);
 		return false;
 	}
@@ -931,5 +931,5 @@
 				while(1){
 					if( subscripts[0] < i2 ){
-						SetError(41,0,cp);
+						compiler.errorMessenger.Output(41,0,cp);
 						return 0;
 					}
@@ -953,5 +953,5 @@
 			BOOST_FOREACH( CMember *pMember, objClass.GetDynamicMembers() ){
 				if(InitBuf[i]=='\0'){
-					SetError(41,0,cp);
+					compiler.errorMessenger.Output(41,0,cp);
 					return false;
 				}
@@ -971,5 +971,5 @@
 		}
 
-		SetError(41,0,cp);
+		compiler.errorMessenger.Output(41,0,cp);
 		return false;
 	}
@@ -981,5 +981,5 @@
 
 	if( subscripts.size() > 0 ){
-		SetError(41,0,cp);
+		compiler.errorMessenger.Output(41,0,cp);
 		return false;
 	}
@@ -1105,5 +1105,5 @@
 		if( UserProc::CompilingUserProc().GetLocalVars().DuplicateCheck( Symbol( VarName ) ) ){
 			//２重定義のエラー
-			SetError(15,VarName,cp);
+			compiler.errorMessenger.Output(15,VarName,cp);
 			return;
 		}
@@ -1218,5 +1218,5 @@
 		else{
 			if( subscripts.size() > 1 ){
-				SetError(300,NULL,cp);
+				compiler.errorMessenger.Output(300,NULL,cp);
 			}
 			sprintf( objectSize, "%d", subscripts[0] );
@@ -1230,5 +1230,5 @@
 		GetVarOffset( true, false, VarName, &RelativeVar, Type() );
 		if( RelativeVar.dwKind == VAR_DIRECTMEM ){
-			SetError();
+			compiler.errorMessenger.OutputFatalError();
 		}
 		SetVariableFromEax( Type( DEF_OBJECT, *compiler.GetObjectModule().meta.GetClasses().GetObjectClassPtr() ), DEF_OBJECT, &RelativeVar );
@@ -1306,5 +1306,5 @@
 void SetVarPtrToReg(int reg,RELATIVE_VAR *pRelativeVar){
 	if( reg != REG_EAX ){
-		SetError();
+		compiler.errorMessenger.OutputFatalError();
 		//TODO: 未完成
 	}
@@ -1315,5 +1315,5 @@
 	const UserProc *pUserProc_AddGlobalRootPtr = GetClassMethod( "_System_CGarbageCollection", "AddGlobalRootPtr" );
 	if( !pUserProc_AddGlobalRootPtr ){
-		SetError(3, "_System_CGarbageCollection.AddGlobalRootPtr", -1 );
+		compiler.errorMessenger.Output(3, "_System_CGarbageCollection.AddGlobalRootPtr", -1 );
 		return false;
 	}
Index: /trunk/ab5.0/abdev/BasicCompiler32/MakePeHdr.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler32/MakePeHdr.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler32/MakePeHdr.cpp	(revision 465)
@@ -365,5 +365,5 @@
 		// 名前空間が初期化されているかをチェック
 		if( compiler.GetNamespaceSupporter().GetLivingNamespaceScopes().size() ){
-			SetError();
+			compiler.errorMessenger.OutputFatalError();
 		}
 
@@ -443,5 +443,5 @@
 		//With情報のメモリを解放
 		for(i=0;i<WithInfo.num;i++){
-			SetError(22,"With",WithInfo.pWithCp[i]);
+			compiler.errorMessenger.Output(22,"With",WithInfo.pWithCp[i]);
 			HeapDefaultFree(WithInfo.ppName[i]);
 		}
@@ -451,5 +451,5 @@
 		// 名前空間が正しく閉じられているかをチェック
 		if( compiler.GetNamespaceSupporter().GetLivingNamespaceScopes().size() ){
-			SetError(63,NULL,-1);
+			compiler.errorMessenger.Output(63,NULL,-1);
 		}
 
@@ -504,8 +504,7 @@
 	}
 
-	extern BOOL bError;
-	if( !bError )
+	if( !compiler.errorMessenger.HasError() )
 	{
-		CompileMessage( "リンク中..." );
+		compiler.messenger.Output( "リンク中..." );
 	}
 
@@ -558,5 +557,5 @@
 
 			if(!hLib){
-				SetError(-106,pDllProc->GetDllFileName().c_str(),pDllProc->GetCodePos());
+				compiler.errorMessenger.Output(-106,pDllProc->GetDllFileName().c_str(),pDllProc->GetCodePos());
 			}
 		}
@@ -565,5 +564,5 @@
 			if(!GetProcAddress(hLib,pDllProc->GetAlias().c_str())){
 				FreeLibrary(hLib);
-				SetError(-107,pDllProc->GetAlias(),pDllProc->GetCodePos());
+				compiler.errorMessenger.Output(-107,pDllProc->GetAlias(),pDllProc->GetCodePos());
 			}
 			FreeLibrary(hLib);
@@ -712,5 +711,5 @@
 
 		if( pDllProc->GetDllFileName().size() > 16 ){
-			SetError(7,NULL,cp);
+			compiler.errorMessenger.Output(7,NULL,cp);
 			break;
 		}
@@ -831,12 +830,11 @@
 	CDebugSection *pobj_DebugSection;
 	pobj_DebugSection=new CDebugSection();
-	extern BOOL bError;
-	if( compiler.IsDebug() && bError == 0 )
+	if( compiler.IsDebug() && !compiler.errorMessenger.HasError() )
 	{
-		CompileMessage( "デバッグ情報を生成しています。" );
+		compiler.messenger.Output( "デバッグ情報を生成しています。" );
 
 		pobj_DebugSection->make();
 
-		CompileMessage( "デバッグ情報の生成が完了しました。" );
+		compiler.messenger.Output( "デバッグ情報の生成が完了しました。" );
 	}
 
@@ -1122,6 +1120,8 @@
 
 
-	extern BOOL bError;
-	if(bError) goto EndWriteOpcode;
+	if( compiler.errorMessenger.HasError() )
+	{
+		goto EndWriteOpcode;
+	}
 
 
@@ -1414,5 +1414,5 @@
 	hFile=CreateFile(OutputFileName,GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
 	if(hFile==INVALID_HANDLE_VALUE){
-		SetError(53,OutputFileName,-1);
+		compiler.errorMessenger.Output(53,OutputFileName,-1);
 		goto EndWriteOpcode;
 	}
Index: /trunk/ab5.0/abdev/BasicCompiler32/NumOpe.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler32/NumOpe.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler32/NumOpe.cpp	(revision 465)
@@ -59,5 +59,5 @@
 	}
 	else{
-		SetError();
+		compiler.errorMessenger.OutputFatalError();
 	}
 }
@@ -79,5 +79,5 @@
 void ExtendRegToBigType( int reg, int bigBasicType, int baseBasicType ){
 	if( reg != REG_EAX ){
-		SetError();
+		compiler.errorMessenger.OutputFatalError();
 	}
 	switch( Type::GetBasicSize( bigBasicType ) ){
@@ -190,5 +190,5 @@
 				// オブジェクトメンバのポインタをeaxにコピー
 				if( !VarToReg( tempRelativeVar, baseType, resultType ) ){
-					SetError(11,termFull,cp);
+					compiler.errorMessenger.Output(11,termFull,cp);
 				}
 
@@ -224,5 +224,5 @@
 			if( !leftType.IsStruct() )
 			{
-				SetError();
+				compiler.errorMessenger.OutputFatalError();
 			}
 
@@ -332,5 +332,5 @@
 	{
 		// 関数ポインタ
-		SetError();
+		compiler.errorMessenger.OutputFatalError();
 
 		///////////////////////////////////////////////////////////////////
@@ -342,5 +342,5 @@
 	}
 
-	SetError();
+	compiler.errorMessenger.OutputFatalError();
 
 	return false;
@@ -400,5 +400,5 @@
 			if( isProcedureCallOnly )
 			{
-				SetError(1,NULL,cp);
+				compiler.errorMessenger.Output(1,NULL,cp);
 			}
 			return false;
@@ -432,5 +432,5 @@
 		if( compiler.pCompilingClass == NULL )
 		{
-			SetError(142,NULL,cp);
+			compiler.errorMessenger.Output(142,NULL,cp);
 			return false;
 		}
@@ -465,5 +465,5 @@
 			{
 				//閉じカッコ")"に続く文字がNULLでないとき
-				SetError(42,NULL,cp);
+				compiler.errorMessenger.Output(42,NULL,cp);
 			}
 
@@ -525,5 +525,5 @@
 
 				//閉じカッコ")"に続く文字がNULLでないときはエラーにする
-				if(termFull[i2+1+i4+1]!='\0') SetError(42,NULL,cp);
+				if(termFull[i2+1+i4+1]!='\0') compiler.errorMessenger.Output(42,NULL,cp);
 
 				//マクロ関数の場合
@@ -629,5 +629,5 @@
 	if( isProcedureCallOnly )
 	{
-		SetError(3, termLeft, cp );
+		compiler.errorMessenger.Output(3, termLeft, cp );
 	}
 
@@ -645,5 +645,5 @@
 		// 変数の場合はeaxに変数ポインタを格納する
 		if( !VarToReg( relativeVar, baseType, resultType ) ){
-			SetError(11,term,cp);
+			compiler.errorMessenger.Output(11,term,cp);
 		}
 	}
@@ -658,5 +658,5 @@
 	if( !isVariable )
 	{
-		SetError();
+		compiler.errorMessenger.OutputFatalError();
 	}
 
@@ -678,5 +678,5 @@
 	if( reg != REG_EAX ){
 		// TODO: 未実装
-		SetError();
+		compiler.errorMessenger.OutputFatalError();
 	}
 
@@ -708,5 +708,5 @@
 
 	if(expression[0]=='\0'){
-		SetError(1,NULL,cp);
+		compiler.errorMessenger.Output(1,NULL,cp);
 		return false;
 	}
@@ -863,5 +863,5 @@
 						else GetCalcName(idCalc,temp2);
 						sprintf(temporary,"Operator %s",temp2);
-						SetError(27,temporary,cp);
+						compiler.errorMessenger.Output(27,temporary,cp);
 						goto error;
 					}
@@ -892,5 +892,5 @@
 					}
 					else{
-						SetError(3, term, cp );
+						compiler.errorMessenger.Output(3, term, cp );
 						goto error;
 					}
@@ -918,5 +918,5 @@
 						// 拡張版リテラル文字列（エスケープシーケンス可能）
 						if(!RemoveStringQuotes(term+2)){
-							SetError(43,NULL,cp);
+							compiler.errorMessenger.Output(43,NULL,cp);
 							goto error;
 						}
@@ -928,5 +928,5 @@
 						// 通常文字列
 						if(!RemoveStringQuotes(term)){
-							SetError(43,NULL,cp);
+							compiler.errorMessenger.Output(43,NULL,cp);
 							goto error;
 						}
@@ -976,5 +976,5 @@
 								}
 							}
-							SetError(38,term,cp);
+							compiler.errorMessenger.Output(38,term,cp);
 
 							goto error;
@@ -990,5 +990,5 @@
 						if( resultType.GetBasicType() & FLAG_CAST ){
 							// 型名のみ
-							SetError();
+							compiler.errorMessenger.OutputFatalError();
 						}
 						else{
@@ -1087,5 +1087,5 @@
 						}
 						else{
-							SetError(300,NULL,cp);
+							compiler.errorMessenger.Output(300,NULL,cp);
 							goto error;
 						}
@@ -1095,5 +1095,5 @@
 					//該当する識別子が見当たらないときはエラー扱いにする
 					bError=1;
-					SetError(3,term,cp);
+					compiler.errorMessenger.Output(3,term,cp);
 					type_stack[sp]=DEF_DOUBLE;
 				}
@@ -1243,5 +1243,5 @@
 				if( PTR_LEVEL( type_stack[sp-1] ) <= 0 ){
 					//ポインタ型ではないとき
-					SetError( 3, NULL, cp );
+					compiler.errorMessenger.Output( 3, NULL, cp );
 					goto error;
 				}
@@ -1252,5 +1252,5 @@
 
 			default:
-				SetError(300,NULL,cp);
+				compiler.errorMessenger.Output(300,NULL,cp);
 				goto error;
 		}
@@ -1260,5 +1260,5 @@
 
 	if(sp!=1){
-		SetError(1,NULL,cp);
+		compiler.errorMessenger.Output(1,NULL,cp);
 		goto error;
 	}
@@ -1266,5 +1266,5 @@
 	if(bLiteralCalculation){
 		//右辺値が数値の定数式の場合
-		SetError();
+		compiler.errorMessenger.OutputFatalError();
 	}
 	else{
Index: /trunk/ab5.0/abdev/BasicCompiler32/NumOpe_Arithmetic.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler32/NumOpe_Arithmetic.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler32/NumOpe_Arithmetic.cpp	(revision 465)
@@ -999,5 +999,5 @@
 	int castBasicType = type[sp-1];
 	if((castBasicType&FLAG_CAST)==0){
-		SetError(47,NULL,cp);
+		compiler.errorMessenger.Output(47,NULL,cp);
 		return 0;
 	}
Index: /trunk/ab5.0/abdev/BasicCompiler32/NumOpe_Logical.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler32/NumOpe_Logical.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler32/NumOpe_Logical.cpp	(revision 465)
@@ -15,5 +15,5 @@
 	if(IsRealNumberType(type[sp-2])||IsRealNumberType(type[sp-1])){
 		//いずれかの項が実数のとき
-		SetError(45,"xor",cp);
+		compiler.errorMessenger.Output(45,"xor",cp);
 		return 0;
 	}
@@ -158,5 +158,5 @@
 	if(IsRealNumberType(type[sp-2])||IsRealNumberType(type[sp-1])){
 		//いずれかの項が実数のとき
-		SetError(45,"or",cp);
+		compiler.errorMessenger.Output(45,"or",cp);
 		return 0;
 	}
@@ -301,5 +301,5 @@
 	if(IsRealNumberType(type[sp-2])||IsRealNumberType(type[sp-1])){
 		//いずれかの項が実数のとき
-		SetError(45,"and",cp);
+		compiler.errorMessenger.Output(45,"and",cp);
 		return 0;
 	}
@@ -441,5 +441,5 @@
 	if(IsRealNumberType(type[sp-1])){
 		//実数のとき
-		SetError(45,"Not",cp);
+		compiler.errorMessenger.Output(45,"Not",cp);
 		return 0;
 	}
Index: /trunk/ab5.0/abdev/BasicCompiler32/NumOpe_Relation.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler32/NumOpe_Relation.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler32/NumOpe_Relation.cpp	(revision 465)
@@ -24,5 +24,5 @@
 		}
 		else{
-			SetError();
+			compiler.errorMessenger.OutputFatalError();
 		}
 	}*/
Index: /trunk/ab5.0/abdev/BasicCompiler32/OperatorProc.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler32/OperatorProc.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler32/OperatorProc.cpp	(revision 465)
@@ -7,5 +7,5 @@
 
 void FreeTempObject(int reg,const CClass *pobj_c){
-	if(!IsSafeReg(reg)) SetError(300,NULL,cp);
+	if(!IsSafeReg(reg)) compiler.errorMessenger.Output(300,NULL,cp);
 
 	const CMethod *method = pobj_c->GetDestructorMethod();
@@ -231,5 +231,5 @@
 	if(bCalcUseHeap){
 		//未解放のインスタンスが存在する旨を示す警告
-		SetError(-105,NULL,cp);
+		compiler.errorMessenger.Output(-105,NULL,cp);
 	}
 
@@ -255,5 +255,5 @@
 
 	//エラーを発行
-	SetError(-1,"キャスト演算子がオーバーロードされていません。",cp);
+	compiler.errorMessenger.Output(-1,"キャスト演算子がオーバーロードされていません。",cp);
 }
 void CallIndexerGetterProc( const Type &classType, const char *ObjectName, char *Parameter,Type &resultType, DWORD dwProcFlags ){
Index: /trunk/ab5.0/abdev/BasicCompiler32/stdafx.h
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler32/stdafx.h	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler32/stdafx.h	(revision 465)
@@ -22,4 +22,5 @@
 #include <jenga/include/common/File.h>
 #include <jenga/include/common/CmdLine.h>
+#include <jenga/include/common/Path.h>
 
 #include "../BasicCompiler_Common/common.h"
Index: /trunk/ab5.0/abdev/BasicCompiler32/x86CodeGenerator.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler32/x86CodeGenerator.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler32/x86CodeGenerator.cpp	(revision 465)
@@ -30,9 +30,9 @@
 		|| mod == MOD_REG ) )
 	{
-		SetError();
+		compiler.errorMessenger.OutputFatalError();
 	}
 	if( isPertialSchedule && !( mod == MOD_DISP32 || mod == MOD_BASE_DISP32 ) )
 	{
-		SetError();
+		compiler.errorMessenger.OutputFatalError();
 	}
 
@@ -972,5 +972,5 @@
 	if(type==DEF_DOUBLE)		pNativeCode->Put( (char)0xDD );
 	else if(type==DEF_SINGLE)	pNativeCode->Put( (char)0xD9 );
-	else SetError(300,NULL,cp);
+	else compiler.errorMessenger.Output(300,NULL,cp);
 
 	if(base_reg==REG_ESP){
@@ -993,5 +993,5 @@
 	if(type==DEF_DOUBLE)		pNativeCode->Put( (char)0xDD );
 	else if(type==DEF_SINGLE)	pNativeCode->Put( (char)0xD9 );
-	else SetError(300,NULL,cp);
+	else compiler.errorMessenger.Output(300,NULL,cp);
 
 	//オペコード、レジスタ
@@ -1027,5 +1027,5 @@
 	if(type==DEF_DOUBLE)		pNativeCode->Put( (char)0xDD );
 	else if(type==DEF_SINGLE)	pNativeCode->Put( (char)0xD9 );
-	else SetError(300,NULL,cp);
+	else compiler.errorMessenger.Output(300,NULL,cp);
 
 	int reg=0;
@@ -1069,5 +1069,5 @@
 	if(type==DEF_DOUBLE)		pNativeCode->Put( (char)0xDD );
 	else if(type==DEF_SINGLE)	pNativeCode->Put( (char)0xD9 );
-	else SetError(300,NULL,cp);
+	else compiler.errorMessenger.Output(300,NULL,cp);
 
 	if(base_reg==REG_ESP){
@@ -1090,5 +1090,5 @@
 	if(type==DEF_DOUBLE)		pNativeCode->Put( (char)0xDD );
 	else if(type==DEF_SINGLE)	pNativeCode->Put( (char)0xD9 );
-	else SetError(300,NULL,cp);
+	else compiler.errorMessenger.Output(300,NULL,cp);
 
 	//オペコード、レジスタ
@@ -1124,5 +1124,5 @@
 	if(type==DEF_DOUBLE)		pNativeCode->Put( (char)0xDD );
 	else if(type==DEF_SINGLE)	pNativeCode->Put( (char)0xD9 );
-	else SetError(300,NULL,cp);
+	else compiler.errorMessenger.Output(300,NULL,cp);
 
 	int reg=0;
@@ -1182,5 +1182,5 @@
 	}
 	else{
-		SetError();
+		compiler.errorMessenger.OutputFatalError();
 	}
 }
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/BasicCompiler.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/BasicCompiler.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/BasicCompiler.cpp	(revision 465)
@@ -299,5 +299,5 @@
 			SendMessage(hwnd,EM_GETSEL,(WPARAM)&pos,0);
 			i=(int)SendMessage(hwnd,EM_LINEFROMCHAR,pos,0);
-			ShowErrorLine(pErrorInfo[i].line,pErrorInfo[i].FileName);
+			compiler.errorMessenger.ShowErrorLine( i );
 
 			StartPos=(int)SendMessage(hwnd,EM_LINEINDEX,i,0);
@@ -808,11 +808,4 @@
 	lstrcat(BasicCurDir,temporary);
 
-	//エラーリスト情報を初期化
-	pErrorInfo=(ERRORINFO *)HeapAlloc(hHeap,0,1);
-	ErrorNum=0;
-	CompileMsgNum=0;
-	WarningNum=0;
-	bError=0;
-
 	if(bClipCompileView){
 		//ProjectEditor埋め込み型インターフェイス
@@ -859,10 +852,4 @@
 	}
 
-	//エラーリスト情報を解放
-	for(i=0;i<ErrorNum;i++){
-		if(pErrorInfo[i].FileName) HeapDefaultFree(pErrorInfo[i].FileName);
-	}
-	HeapDefaultFree(pErrorInfo);
-
 	//不揮発性データを保存
 	pobj_nv->save();
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/BasicCompiler.h
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/BasicCompiler.h	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/BasicCompiler.h	(revision 465)
@@ -22,9 +22,4 @@
 DWORD ImageBase;
 
-ERRORINFO *pErrorInfo;
-int ErrorNum;
-int CompileMsgNum;
-int WarningNum;
-BOOL bError;
 char **SynonymErrorWords;
 int SynonymErrorNum;
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/CommandFormat.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/CommandFormat.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/CommandFormat.cpp	(revision 465)
@@ -28,5 +28,5 @@
 		for(i2=0;;i++,i2++){
 			if(Parameter[i]=='\0'){
-				SetError(1,NULL,nowLine);
+				compiler.errorMessenger.Output(1,NULL,nowLine);
 				return;
 			}
@@ -41,5 +41,5 @@
 		else if(lstrcmpi(temporary,"append")==0) lstrcat(buffer,",3");
 		else{
-			SetError(1,NULL,nowLine);
+			compiler.errorMessenger.Output(1,NULL,nowLine);
 			return;
 		}
@@ -77,5 +77,5 @@
 	else{
 		if(Parameter[0]!='('){
-			SetError(10,"Line",nowLine);
+			compiler.errorMessenger.Output(10,"Line",nowLine);
 			return;
 		}
@@ -95,5 +95,5 @@
 
 		if(Parameter[i+1]!='-'){
-			SetError(10,"Line",nowLine);
+			compiler.errorMessenger.Output(10,"Line",nowLine);
 			return;
 		}
@@ -109,5 +109,5 @@
 
 	if(Parameter[i]!='('){
-		SetError(10,"Line",nowLine);
+		compiler.errorMessenger.Output(10,"Line",nowLine);
 		return;
 	}
@@ -131,5 +131,5 @@
 	}
 	else if(Parameter[i+1]!=','){
-		SetError(10,"Line",nowLine);
+		compiler.errorMessenger.Output(10,"Line",nowLine);
 		return;
 	}
@@ -149,5 +149,5 @@
 	else if(lstrcmpi(temporary,"bf")==0) lstrcat(buffer,",2");
 	else{
-		SetError(10,"Line",nowLine);
+		compiler.errorMessenger.Output(10,"Line",nowLine);
 		return;
 	}
@@ -160,5 +160,5 @@
 	i=GetOneParameter(Parameter,i,temporary);	//第７パラメータ取得
 	if(Parameter[i-1]==','){
-		SetError(10,"Line",nowLine);
+		compiler.errorMessenger.Output(10,"Line",nowLine);
 		return;
 	}
@@ -174,5 +174,5 @@
 
 	if(Parameter[0]!='('){
-		SetError(10,"Circle",nowLine);
+		compiler.errorMessenger.Output(10,"Circle",nowLine);
 		return;
 	}
@@ -191,5 +191,5 @@
 	i++;
 	if(Parameter[i]!=','){
-		SetError(10,"Circle",nowLine);
+		compiler.errorMessenger.Output(10,"Circle",nowLine);
 		return;
 	}
@@ -243,5 +243,5 @@
 	}
 	else{
-		SetError(10,"Circle",nowLine);
+		compiler.errorMessenger.Output(10,"Circle",nowLine);
 		return;
 	}
@@ -253,5 +253,5 @@
 		lstrcat(buffer,temporary);
 		if(Parameter[i-1]==','){
-			SetError(10,"Circle",nowLine);
+			compiler.errorMessenger.Output(10,"Circle",nowLine);
 			return;
 		}
@@ -268,5 +268,5 @@
 
 	if(Parameter[0]!='('){
-		SetError(10,"PSet",nowLine);
+		compiler.errorMessenger.Output(10,"PSet",nowLine);
 		return;
 	}
@@ -286,5 +286,5 @@
 	else if(Parameter[i+1]=='\0') lstrcat(buffer,",7");
 	else{
-		SetError(10,"PSet",nowLine);
+		compiler.errorMessenger.Output(10,"PSet",nowLine);
 		return;
 	}
@@ -296,5 +296,5 @@
 
 	if(Parameter[0]!='('){
-		SetError(10,"Paint",nowLine);
+		compiler.errorMessenger.Output(10,"Paint",nowLine);
 		return;
 	}
@@ -311,5 +311,5 @@
 	}
 	if(Parameter[i+1]!=','){
-		SetError(10,"Paint",nowLine);
+		compiler.errorMessenger.Output(10,"Paint",nowLine);
 		return;
 	}
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/Compile.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/Compile.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/Compile.cpp	(revision 465)
@@ -87,5 +87,5 @@
 		if( !pTypeParameterBaseClassNames )
 		{
-			SetError();
+			compiler.errorMessenger.OutputFatalError();
 		}
 		pTypeParameterBaseClassNames->clear();
@@ -113,5 +113,5 @@
 			{
 				extern int cp;
-				SetError(1,NULL,cp);
+				compiler.errorMessenger.Output(1,NULL,cp);
 			}
 			typeParameters.push_back( temporary );
@@ -129,5 +129,5 @@
 					{
 						extern int cp;
-						SetError(1,NULL,cp);
+						compiler.errorMessenger.Output(1,NULL,cp);
 					}
 				}
@@ -150,5 +150,5 @@
 			{
 				extern int cp;
-				SetError(1,NULL,cp);
+				compiler.errorMessenger.Output(1,NULL,cp);
 			}
 		}
@@ -181,5 +181,5 @@
 			char temporary[64];
 			GetDefaultNameFromES( cStatement, temporary );
-			SetError( 22, temporary, pos );
+			compiler.errorMessenger.Output( 22, temporary, pos );
 			return -1;
 		}
@@ -247,5 +247,5 @@
 				if( UserProc::IsLocalAreaCompiling() ){
 					// ローカル領域をコンパイルしているとき
-					SetError(65,"TypeDef",cp );
+					compiler.errorMessenger.Output(65,"TypeDef",cp );
 				}
 
@@ -256,5 +256,5 @@
 				if( UserProc::IsLocalAreaCompiling() ){
 					// ローカル領域をコンパイルしているとき
-					SetError(65,"Delegate",cp );
+					compiler.errorMessenger.Output(65,"Delegate",cp );
 				}
 
@@ -273,5 +273,5 @@
 					LexicalScope *pScope = compiler.codeGenerator.lexicalScopes.SearchScope( LexicalScope::SCOPE_TYPE_WHILE );
 					if( !pScope ){
-						SetError(12,"Exit While",cp);
+						compiler.errorMessenger.Output(12,"Exit While",cp);
 						return;
 					}
@@ -283,5 +283,5 @@
 					LexicalScope *pScope = compiler.codeGenerator.lexicalScopes.SearchScope( LexicalScope::SCOPE_TYPE_FOR );
 					if( !pScope ){
-						SetError(12,"Exit For",cp);
+						compiler.errorMessenger.Output(12,"Exit For",cp);
 						return;
 					}
@@ -293,5 +293,5 @@
 					LexicalScope *pScope = compiler.codeGenerator.lexicalScopes.SearchScope( LexicalScope::SCOPE_TYPE_DO );
 					if( !pScope ){
-						SetError(12,"Exit Do",cp);
+						compiler.errorMessenger.Output(12,"Exit Do",cp);
 						return;
 					}
@@ -331,5 +331,5 @@
 			case ESC_ENDWITH:
 				if(WithInfo.num<=0){
-					SetError(12,"End With",cp);
+					compiler.errorMessenger.Output(12,"End With",cp);
 					return;
 				}
@@ -340,5 +340,5 @@
 				if( UserProc::IsLocalAreaCompiling() ){
 					// ローカル領域をコンパイルしているとき
-					SetError(65,"Declare",cp );
+					compiler.errorMessenger.Output(65,"Declare",cp );
 				}
 				break;
@@ -349,5 +349,5 @@
 			case ESC_ENDNAMESPACE:
 				if( compiler.GetNamespaceSupporter().GetLivingNamespaceScopes().size() <= 0 ){
-					SetError(12,"End Namespace",cp);
+					compiler.errorMessenger.Output(12,"End Namespace",cp);
 				}
 				compiler.GetNamespaceSupporter().GetLivingNamespaceScopes().pop_back();
@@ -380,5 +380,5 @@
 				char temporary[64];
 				GetDefaultNameFromES(Command[1],temporary);
-				SetError(30,temporary,cp);
+				compiler.errorMessenger.Output(30,temporary,cp);
 				break;
 		}
@@ -502,5 +502,5 @@
 				while(!(basbuf[cp]==1&&basbuf[cp+1]==ESC_ENDSUB)){
 					if(basbuf[cp]=='\0'){
-						SetError(22,"Sub",i2);
+						compiler.errorMessenger.Output(22,"Sub",i2);
 						break;
 					}
@@ -516,5 +516,5 @@
 				while(!(basbuf[cp]==1&&basbuf[cp+1]==ESC_ENDFUNCTION)){
 					if(basbuf[cp]=='\0'){
-						SetError(22,"Function",i2);
+						compiler.errorMessenger.Output(22,"Function",i2);
 						break;
 					}
@@ -530,5 +530,5 @@
 				while(!(basbuf[cp]==1&&basbuf[cp+1]==ESC_ENDMACRO)){
 					if(basbuf[cp]=='\0'){
-						SetError(22,"Macro",i2);
+						compiler.errorMessenger.Output(22,"Macro",i2);
 						break;
 					}
@@ -544,5 +544,5 @@
 				while(!(basbuf[cp]==1&&basbuf[cp+1]==ESC_ENDTYPE)){
 					if(basbuf[cp]=='\0'){
-						SetError(22,"Type",i2);
+						compiler.errorMessenger.Output(22,"Type",i2);
 						break;
 					}
@@ -558,5 +558,5 @@
 				while(!(basbuf[cp]==1&&basbuf[cp+1]==ESC_ENDCLASS)){
 					if(basbuf[cp]=='\0'){
-						SetError(22,"Class",i2);
+						compiler.errorMessenger.Output(22,"Class",i2);
 						break;
 					}
@@ -572,5 +572,5 @@
 				while(!(basbuf[cp]==1&&basbuf[cp+1]==ESC_ENDINTERFACE)){
 					if(basbuf[cp]=='\0'){
-						SetError(22,"Interface",i2);
+						compiler.errorMessenger.Output(22,"Interface",i2);
 						break;
 					}
@@ -686,5 +686,5 @@
 				}
 				if(Return_Sequence){
-					SetError(12,temporary,cp);
+					compiler.errorMessenger.Output(12,temporary,cp);
 					break;
 				}
@@ -703,5 +703,5 @@
 								basbuf[cp+1]==ESC_ENUM){
 								GetDefaultNameFromES(basbuf[cp+1],temp3);
-								SetError(12,temp3,cp);
+								compiler.errorMessenger.Output(12,temp3,cp);
 							}
 						}
@@ -718,5 +718,5 @@
 								basbuf[cp+1]==ESC_ENUM)){
 								GetDefaultNameFromES(basbuf[cp+1],temp3);
-								SetError(12,temp3,cp);
+								compiler.errorMessenger.Output(12,temp3,cp);
 							}
 						}
@@ -774,25 +774,25 @@
 				switch(Return_Command){
 					case COM_WEND:
-						SetError(4,"\"While\" - \"Wend\" ",ScopeStart);
+						compiler.errorMessenger.Output(4,"\"While\" - \"Wend\" ",ScopeStart);
 						break;
 					case COM_NEXT:
-						SetError(4,"\"For\" - \"Next\" ",ScopeStart);
+						compiler.errorMessenger.Output(4,"\"For\" - \"Next\" ",ScopeStart);
 						break;
 					case COM_LOOP:
-						SetError(4,"\"Do\" - \"Loop\" ",ScopeStart);
+						compiler.errorMessenger.Output(4,"\"Do\" - \"Loop\" ",ScopeStart);
 						break;
 				}
 				switch(Return_Sequence){
 					case ESC_ENDSUB:
-						SetError(4,"\"Sub\" - \"End Sub\" ",ScopeStart);
+						compiler.errorMessenger.Output(4,"\"Sub\" - \"End Sub\" ",ScopeStart);
 						break;
 					case ESC_ENDFUNCTION:
-						SetError(4,"\"Function\" - \"End Function\" ",ScopeStart);
+						compiler.errorMessenger.Output(4,"\"Function\" - \"End Function\" ",ScopeStart);
 						break;
 					case ESC_ENDMACRO:
-						SetError(4,"\"Macro\" - \"End Macro\" ",ScopeStart);
+						compiler.errorMessenger.Output(4,"\"Macro\" - \"End Macro\" ",ScopeStart);
 						break;
 					case ESC_ENDIF:
-						SetError(22,"If",ScopeStart);
+						compiler.errorMessenger.Output(22,"If",ScopeStart);
 						break;
 				}
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/Intermediate_Step1.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/Intermediate_Step1.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/Intermediate_Step1.cpp	(revision 465)
@@ -130,5 +130,5 @@
 			if(bracket[PareNum]!=0||PareNum<0){
 				//"カッコ \'( )\'"
-				SetError(4,STRING_PARENTHESIS,i);
+				compiler.errorMessenger.Output(4,STRING_PARENTHESIS,i);
 				return;
 			}
@@ -138,5 +138,5 @@
 			if(bracket[PareNum]!=1||PareNum<0){
 				//"カッコ \'( )\'"
-				SetError(4,STRING_PARENTHESIS,i);
+				compiler.errorMessenger.Output(4,STRING_PARENTHESIS,i);
 				return;
 			}
@@ -146,7 +146,7 @@
 
 			//"カッコ \'( )\'"
-			if(PareNum!=0) SetError(4,STRING_PARENTHESIS,i);
-
-			if(IsStr!=0) SetError(5,NULL,i);
+			if(PareNum!=0) compiler.errorMessenger.Output(4,STRING_PARENTHESIS,i);
+
+			if(IsStr!=0) compiler.errorMessenger.Output(5,NULL,i);
 			if(buffer[i]=='\0') break;
 			PareNum=0;
@@ -161,8 +161,8 @@
 				//全角スペース
 				if(buffer[i]==(char)0x81&&buffer[i+1]==(char)0x40)
-					SetError(20,NULL,i);
+					compiler.errorMessenger.Output(20,NULL,i);
 
 				//その他の全角文字
-				else SetError(8,NULL,i);
+				else compiler.errorMessenger.Output(8,NULL,i);
 				sw=1;
 			}
@@ -259,5 +259,5 @@
 				while(basbuf[i2]==' '||basbuf[i2]=='\t') i2++;
 				if(basbuf[i2]!='\"'){
-					SetError(1,NULL,i2);
+					compiler.errorMessenger.Output(1,NULL,i2);
 					return;
 				}
@@ -317,5 +317,5 @@
 				while(basbuf[i2]==' '||basbuf[i2]=='\t') i2++;
 				if(basbuf[i2]!='\"'){
-					SetError(1,NULL,i2);
+					compiler.errorMessenger.Output(1,NULL,i2);
 					return;
 				}
@@ -1021,5 +1021,5 @@
 			while(buffer[i]==' '||buffer[i]=='\t') i++;
 			if(buffer[i]!='('){
-				SetError(1,NULL,i);
+				compiler.errorMessenger.Output(1,NULL,i);
 				return;
 			}
@@ -1047,5 +1047,5 @@
 			while(buffer[i]==' '||buffer[i]=='\t') i++;
 			if(buffer[i]!='='){
-				SetError(1,NULL,i);
+				compiler.errorMessenger.Output(1,NULL,i);
 				break;
 			}
@@ -1243,9 +1243,9 @@
 						if(FuncNum!=0){
 							if(FuncType==ESC_FUNCTION)
-								SetError(54,"End Function",FuncPtr);
+								compiler.errorMessenger.Output(54,"End Function",FuncPtr);
 							else if(FuncType==ESC_SUB)
-								SetError(54,"End Sub",FuncPtr);
+								compiler.errorMessenger.Output(54,"End Sub",FuncPtr);
 							else if(FuncType==ESC_MACRO)
-								SetError(54,"End Macro",FuncPtr);
+								compiler.errorMessenger.Output(54,"End Macro",FuncPtr);
 							return;
 						}
@@ -1265,9 +1265,9 @@
 						if(FuncNum!=0||i3!=FuncType){
 							if(basbuf[i2+1]==ESC_ENDFUNCTION)
-								SetError(12,"End Function",i2);
+								compiler.errorMessenger.Output(12,"End Function",i2);
 							else if(basbuf[i2+1]==ESC_ENDSUB)
-								SetError(12,"End Sub",i2);
+								compiler.errorMessenger.Output(12,"End Sub",i2);
 							else if(basbuf[i2+1]==ESC_ENDMACRO)
-								SetError(12,"End Macro",i2);
+								compiler.errorMessenger.Output(12,"End Macro",i2);
 							return;
 						}
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/Intermediate_Step2.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/Intermediate_Step2.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/Intermediate_Step2.cpp	(revision 465)
@@ -21,5 +21,5 @@
 		}
 		if(!IsVariableChar(buffer[i])){
-			SetError(1,NULL,i);
+			compiler.errorMessenger.Output(1,NULL,i);
 			break;
 		}
@@ -28,5 +28,5 @@
 
 	if(buffer[i]=='\0'){
-		SetError(22,"Enum",cp);
+		compiler.errorMessenger.Output(22,"Enum",cp);
 		return;
 	}
@@ -51,5 +51,5 @@
 		if(temporary[0]=='\0'){
 			if(buffer[i]=='\0'){
-				SetError(22,"Enum",cp);
+				compiler.errorMessenger.Output(22,"Enum",cp);
 				break;
 			}
@@ -109,5 +109,5 @@
 		else if( basbuf[i] == 1 && basbuf[i+1] == ESC_ENDNAMESPACE ){
 			if( namespaceScopes.size() <= 0 ){
-				SetError(12, "End Namespace", i );
+				compiler.errorMessenger.Output(12, "End Namespace", i );
 			}
 			else{
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/MakeExe.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/MakeExe.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/MakeExe.cpp	(revision 465)
@@ -43,5 +43,4 @@
 	extern HANDLE hHeap;
 	extern char *basbuf;
-	extern int ErrorNum;
 	extern BOOL bStopCompile;
 	extern HWND hMainDlg;
@@ -71,5 +70,5 @@
 	compiler.GetObjectModule().GetSources().push_back( BasicSource() );
 	if( !compiler.GetObjectModule().GetCurrentSource().ReadFile( SourceFileName ) ){
-		SetError(201,SourceFileName,-1);
+		compiler.errorMessenger.Output(201,SourceFileName,-1);
 		goto EndCompile;
 	}
@@ -80,6 +79,5 @@
 	else ImageBase=0x00400000;
 
-	extern BOOL bError;
-	if(bError||bStopCompile) goto EndCompile;
+	if( compiler.errorMessenger.HasError() || bStopCompile ) goto EndCompile;
 
 
@@ -89,10 +87,13 @@
 
 	//"最適化中..."
-	CompileMessage(STRING_COMPILE_OPTIMIZING);
+	compiler.messenger.Output( STRING_COMPILE_OPTIMIZING );
 
 	//カッコを相互チェック（ダブルクォートチェックチェックを含む）
 	CheckParenthesis(basbuf);
 
-	if(bError||bStopCompile) goto EndCompile;
+	if( compiler.errorMessenger.HasError() || bStopCompile )
+	{
+		goto EndCompile;
+	}
 
 	//コンパイルダイアログのプログレスバーを上げる
@@ -117,5 +118,8 @@
 	//CheckPareCommand();
 
-	if(bError||bStopCompile) goto EndCompile;
+	if( compiler.errorMessenger.HasError() || bStopCompile )
+	{
+		goto EndCompile;
+	}
 
 	//コンパイルダイアログのプログレスバーを上げる
@@ -136,5 +140,6 @@
 	SynonymErrorWords=0;
 
-	if(bError||bStopCompile){
+	if( compiler.errorMessenger.HasError() || bStopCompile )
+	{
 		//定数に関する情報を解放
 		goto EndCompile;
@@ -175,9 +180,9 @@
 				if( compiler.staticLibraries.back()->Read( coreFilePath ) )
 				{
-					CompileMessage( ((string)"\"" + path.GetFileName() + path.GetExt() + "\" を読み込みました。").c_str() );
+					compiler.messenger.Output( ((string)"\"" + path.GetFileName() + path.GetExt() + "\" を読み込みました。").c_str() );
 				}
 				else
 				{
-					CompileMessage( ((string)"\"" + path.GetFileName() + path.GetExt() + "\" ファイルが壊れています。").c_str() );
+					compiler.messenger.Output( ((string)"\"" + path.GetFileName() + path.GetExt() + "\" ファイルが壊れています。").c_str() );
 					isSuccessfulLoadStaticLinkLibrary = false;
 				}
@@ -185,5 +190,5 @@
 			else
 			{
-				CompileMessage( ((string)"\"" + path.GetFileName() + path.GetExt() + "\" ファイルが存在しません。").c_str() );
+				compiler.messenger.Output( ((string)"\"" + path.GetFileName() + path.GetExt() + "\" ファイルが存在しません。").c_str() );
 				isSuccessfulLoadStaticLinkLibrary = false;
 			}
@@ -198,9 +203,9 @@
 				if( compiler.staticLibraries.back()->Read( filePath ) )
 				{
-					CompileMessage( ((string)"\"" + path.GetFileName() + path.GetExt() + "\" を読み込みました。").c_str() );
+					compiler.messenger.Output( ((string)"\"" + path.GetFileName() + path.GetExt() + "\" を読み込みました。").c_str() );
 				}
 				else
 				{
-					CompileMessage( ((string)"\"" + path.GetFileName() + path.GetExt() + "\" ファイルが壊れています。").c_str() );
+					compiler.messenger.Output( ((string)"\"" + path.GetFileName() + path.GetExt() + "\" ファイルが壊れています。").c_str() );
 					isSuccessfulLoadStaticLinkLibrary = false;
 				}
@@ -208,5 +213,5 @@
 			else
 			{
-				CompileMessage( ((string)"\"" + path.GetFileName() + path.GetExt() + "\" ファイルが存在しません。").c_str() );
+				compiler.messenger.Output( ((string)"\"" + path.GetFileName() + path.GetExt() + "\" ファイルが存在しません。").c_str() );
 				isSuccessfulLoadStaticLinkLibrary = false;
 			}
@@ -225,5 +230,5 @@
 
 	//"コンパイル中..."
-	CompileMessage(STRING_COMPILE_COMPILING);
+	compiler.messenger.Output(STRING_COMPILE_COMPILING);
 
 	Compile();
@@ -248,26 +253,29 @@
 
 		//"コンパイルはユーザーにより中断されました。"
-		CompileMessage(STRING_COMPILE_STOP);
+		compiler.messenger.Output(STRING_COMPILE_STOP);
 	}
 	else{
-		extern int CompileMsgNum;
 		extern int WarningNum;
-		if(bError==0){
+		if( !compiler.errorMessenger.HasError() )
+		{
 			//"コンパイルは正常に完了しました（エラー:%d、警告:%d）"
 			sprintf(temp2,
 				STRING_COMPILE_SUCCESS,
-				ErrorNum-CompileMsgNum-WarningNum,
-				WarningNum,
+				compiler.errorMessenger.GetErrorCount(),
+				compiler.errorMessenger.GetWarningCount(),
 				((double)(GetTickCount() - beforeTickCount))/1000
 			);
 		}
-		else{
+		else
+		{
 			//"コンパイルは中断されました（エラー:%d、警告:%d）"
-			sprintf(temp2,STRING_COMPILE_ERROR,ErrorNum-CompileMsgNum-WarningNum,WarningNum);
-		}
-
-		CompileMessage("");
-		CompileMessage("-----------------------------------------------------");
-		CompileMessage(temp2);
+			sprintf(temp2,STRING_COMPILE_ERROR,
+				compiler.errorMessenger.GetErrorCount(),
+				compiler.errorMessenger.GetWarningCount() );
+		}
+
+		compiler.messenger.Output( "" );
+		compiler.messenger.Output( "-----------------------------------------------------" );
+		compiler.messenger.Output( temp2 );
 	}
 
@@ -282,5 +290,4 @@
 int MainThread(DWORD dummy){
 	extern BOOL bDebugRun;
-	extern int bError;
 
 	if(bDebugRun){
@@ -296,5 +303,8 @@
 
 		//デバッグ実行
-		if(bError==0) DebugProgram();
+		if( !compiler.errorMessenger.HasError() )
+		{
+			DebugProgram();
+		}
 	}
 	else{
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/NumOpe_GetType.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/NumOpe_GetType.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/NumOpe_GetType.cpp	(revision 465)
@@ -61,5 +61,5 @@
 	if(!type){
 		extern int cp;
-		SetError(300,NULL,cp);
+		compiler.errorMessenger.Output(300,NULL,cp);
 	}
 
@@ -86,5 +86,5 @@
 			if(IsRealNumberType(type[sp-2])||IsRealNumberType(type[sp-1])){
 				//いずれかの項が実数のとき
-				SetError(45,temporary,cp);
+				compiler.errorMessenger.Output(45,temporary,cp);
 				return 0;
 			}
@@ -92,5 +92,5 @@
 			//As以外の演算子に型名が指定されていないかをチェック
 			if((type[sp-2]&FLAG_CAST)||(type[sp-1]&FLAG_CAST)){
-				SetError(48,temporary,cp);
+				compiler.errorMessenger.Output(48,temporary,cp);
 				return 0;
 			}
@@ -100,5 +100,5 @@
 			if(IsRealNumberType(type[sp-1])){
 				//実数のとき
-				SetError(45,temporary,cp);
+				compiler.errorMessenger.Output(45,temporary,cp);
 				return 0;
 			}
@@ -106,5 +106,5 @@
 			//As以外の演算子に型名が指定されていないかをチェック
 			if(type[sp-1]&FLAG_CAST){
-				SetError(48,temporary,cp);
+				compiler.errorMessenger.Output(48,temporary,cp);
 				return 0;
 			}
@@ -125,5 +125,5 @@
 			//As以外の演算子に型名が指定されていないかをチェック
 			if((type[sp-2]&FLAG_CAST)||(type[sp-1]&FLAG_CAST)){
-				SetError(48,temporary,cp);
+				compiler.errorMessenger.Output(48,temporary,cp);
 				return 0;
 			}
@@ -143,5 +143,5 @@
 			//As以外の演算子に型名が指定されていないかをチェック
 			if((type[sp-2]&FLAG_CAST)||(type[sp-1]&FLAG_CAST)){
-				SetError(48,temporary,cp);
+				compiler.errorMessenger.Output(48,temporary,cp);
 				return 0;
 			}
@@ -154,5 +154,5 @@
 			if(IsRealNumberType(type[sp-2])||IsRealNumberType(type[sp-1])){
 				//いずれかの項が実数のとき
-				SetError(45,temporary,cp);
+				compiler.errorMessenger.Output(45,temporary,cp);
 				return 0;
 			}
@@ -160,5 +160,5 @@
 			//As以外の演算子に型名が指定されていないかをチェック
 			if((type[sp-2]&FLAG_CAST)||(type[sp-1]&FLAG_CAST)){
-				SetError(48,temporary,cp);
+				compiler.errorMessenger.Output(48,temporary,cp);
 				return 0;
 			}
@@ -168,5 +168,5 @@
 			if((type[sp-1]&FLAG_CAST)==0){
 				//型名が指定されていないときはエラー
-				SetError(47,NULL,cp);
+				compiler.errorMessenger.Output(47,NULL,cp);
 				return 0;
 			}
@@ -176,5 +176,5 @@
 			if(type[sp-1]&FLAG_CAST){
 				//型名が指定されていないときはエラー
-				SetError(47,NULL,cp);
+				compiler.errorMessenger.Output(47,NULL,cp);
 				return 0;
 			}
@@ -184,5 +184,5 @@
 			//As以外の演算子に型名が指定されていないかをチェック
 			if(type[sp-1]&FLAG_CAST){
-				SetError(48,temporary,cp);
+				compiler.errorMessenger.Output(48,temporary,cp);
 				return 0;
 			}
@@ -279,5 +279,5 @@
 	if( !compiler.StringToType( TypeName, resultType ) )
 	{
-		SetError(3,TypeName,cp);
+		compiler.errorMessenger.Output(3,TypeName,cp);
 		return false;
 	}
@@ -285,5 +285,5 @@
 	if( !resultType.IsObject() )
 	{
-		SetError(121,NULL,cp);
+		compiler.errorMessenger.Output(121,NULL,cp);
 		return false;
 	}
@@ -326,5 +326,5 @@
 		{
 			if( !GetReturnTypeOfIndexerGetterProc( classType, resultType ) ){
-				SetError(1,NULL,cp);
+				compiler.errorMessenger.Output(1,NULL,cp);
 				return false;
 			}
@@ -509,5 +509,5 @@
 			//閉じカッコ")"に続く文字がNULLでないとき
 			if(termFull[i2+1+i4+1]!='\0'){
-				SetError(42,NULL,cp);
+				compiler.errorMessenger.Output(42,NULL,cp);
 			}
 
@@ -541,5 +541,5 @@
 
 					//閉じカッコ")"に続く文字がNULLでないときはエラーにする
-					if(termFull[i2+1+i4+1]!='\0') SetError(42,NULL,cp);
+					if(termFull[i2+1+i4+1]!='\0') compiler.errorMessenger.Output(42,NULL,cp);
 
 					//マクロ関数の場合
@@ -571,5 +571,5 @@
 		if( classType.IsObject() ){
 			if( !GetReturnTypeOfIndexerGetterProc( classType, resultType ) ){
-				SetError(1,NULL,cp);
+				compiler.errorMessenger.Output(1,NULL,cp);
 				return false;
 			}
@@ -649,5 +649,5 @@
 
 	if(expression[0]=='\0'){
-		SetError(1,NULL,cp);
+		compiler.errorMessenger.Output(1,NULL,cp);
 		return false;
 	}
@@ -765,5 +765,5 @@
 					}
 					else{
-						SetError(3, term, cp );
+						compiler.errorMessenger.Output(3, term, cp );
 						goto error;
 					}
@@ -861,5 +861,5 @@
 						}
 						else{
-							SetError(1,NULL,0);
+							compiler.errorMessenger.Output(1,NULL,0);
 							goto error;
 						}
@@ -876,5 +876,5 @@
 
 					if(GetSubHash(VarName,0)){
-						SetError();
+						compiler.errorMessenger.OutputFatalError();
 						Type tempType;
 						GetReturnTypeOfPropertyMethod(term,NULL,tempType);
@@ -894,5 +894,5 @@
 					//該当する識別子が見当たらないときはエラー扱いにする
 					bError=1;
-					SetError(3,term,cp);
+					compiler.errorMessenger.Output(3,term,cp);
 					type_stack[sp]=DEF_DOUBLE;
 				}
@@ -984,5 +984,5 @@
 				if( PTR_LEVEL( type_stack[sp-1] ) <= 0 ){
 					//ポインタ型ではないとき
-					SetError( 3, NULL, cp );
+					compiler.errorMessenger.Output( 3, NULL, cp );
 					goto error;
 				}
@@ -996,5 +996,5 @@
 
 	if(sp!=1){
-		SetError(1,NULL,cp);
+		compiler.errorMessenger.Output(1,NULL,cp);
 		goto error;
 	}
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/Object.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/Object.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/Object.cpp	(revision 465)
@@ -25,5 +25,5 @@
 	const UserProc *pUserProc = GetMethodHash(ObjectName,type.GetClass().GetName().c_str(),Parameter);
 	if(!pUserProc){
-		if(Parameter[0]) SetError(113,type.GetClass().GetName().c_str(),cp);
+		if(Parameter[0]) compiler.errorMessenger.Output(113,type.GetClass().GetName().c_str(),cp);
 		return;
 	}
@@ -102,5 +102,5 @@
 			i+=i2;
 			if(expression[i]!='\0'){
-				SetError(42,NULL,cp);
+				compiler.errorMessenger.Output(42,NULL,cp);
 				return false;
 			}
@@ -115,5 +115,5 @@
 
 	if( !compiler.StringToType( typeName, resultType ) ){
-		SetError(3,typeName,cp);
+		compiler.errorMessenger.Output(3,typeName,cp);
 		return false;
 	}
@@ -124,5 +124,5 @@
 		////////////////////////
 
-		SetError(121,NULL,cp);
+		compiler.errorMessenger.Output(121,NULL,cp);
 		return false;
 	}
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/OldStatement.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/OldStatement.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/OldStatement.cpp	(revision 465)
@@ -41,5 +41,5 @@
 			if(Parameter[i2+1]==';') lstrcpy(buffer+i2,"? \"");
 			else if(Parameter[i2+1]==',') lstrcpy(buffer+i2,"\"");
-			else SetError(10,"Input",cp);
+			else compiler.errorMessenger.Output(10,"Input",cp);
 			i2+=2;
 		}
@@ -57,5 +57,5 @@
 			if(Parameter[i2+1]==';') lstrcpy(buffer+i2,"? \"");
 			else if(Parameter[i2+1]==',') lstrcpy(buffer+i2,"\"");
-			else SetError(10,"Input",cp);
+			else compiler.errorMessenger.Output(10,"Input",cp);
 			i2+=2;
 		}
@@ -89,5 +89,5 @@
 		}
 		if(temporary[0]=='\0'){
-			SetError(10,"Input",cp);
+			compiler.errorMessenger.Output(10,"Input",cp);
 			return;
 		}
@@ -122,5 +122,5 @@
 	else pUserProc=GetSubHash("INPUT_FromPrompt");
 	if(!pUserProc){
-		SetError(3,"Input",cp);
+		compiler.errorMessenger.Output(3,"Input",cp);
 		return;
 	}
@@ -189,5 +189,5 @@
 		}
 		if(temporary[0]=='\0'){
-			SetError(10,"Print",cp);
+			compiler.errorMessenger.Output(10,"Print",cp);
 			return;
 		}
@@ -224,5 +224,5 @@
 	else pUserProc=GetSubHash("PRINTUSING_ToPrompt");
 	if(!pUserProc){
-		SetError(3,"Print",cp);
+		compiler.errorMessenger.Output(3,"Print",cp);
 		return;
 	}
@@ -328,5 +328,5 @@
 	else pUserProc=GetSubHash("PRINT_ToPrompt");
 	if(!pUserProc){
-		SetError(3,"Print",cp);
+		compiler.errorMessenger.Output(3,"Print",cp);
 		return;
 	}
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/ParamImpl.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/ParamImpl.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/ParamImpl.cpp	(revision 465)
@@ -44,5 +44,5 @@
 					if( buffer[i] == '\0' )
 					{
-						SetError();
+						compiler.errorMessenger.OutputFatalError();
 						break;
 					}
@@ -236,5 +236,5 @@
 				if( pUserProc ){
 					if( isEnabledReturnType ){
-						SetError(52,name,cp);
+						compiler.errorMessenger.Output(52,name,cp);
 						return NULL;
 					}
@@ -267,5 +267,5 @@
 				if( pUserProc )
 				{
-					SetError(52,name,cp);
+					compiler.errorMessenger.Output(52,name,cp);
 					return NULL;
 				}
@@ -278,5 +278,5 @@
 	if( !pUserProc )
 	{
-		SetError();
+		compiler.errorMessenger.OutputFatalError();
 	}
 
@@ -318,5 +318,5 @@
 		if( params.size() == 0 || params[params.size()-1]->GetBasicType()!=DEF_ELLIPSE ){
 			//パラメータが多すぎるとき
-			SetError(10,procName,cp);
+			compiler.errorMessenger.Output(10,procName,cp);
 			return false;
 		}
@@ -329,5 +329,5 @@
 
 			//パラメータが少なすぎるとき
-			SetError(10,procName,cp);
+			compiler.errorMessenger.Output(10,procName,cp);
 			return false;
 		}
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/RSrcSection.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/RSrcSection.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/RSrcSection.cpp	(revision 465)
@@ -108,5 +108,5 @@
 		hFile=CreateFile(pCursorResourceInfo[i3].FileName,GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
 		if(hFile==INVALID_HANDLE_VALUE){
-			SetError(23,pCursorResourceInfo[i3].FileName,-1);
+			compiler.errorMessenger.Output(23,pCursorResourceInfo[i3].FileName,-1);
 			sw=1;
 			continue;
@@ -127,5 +127,5 @@
 		hFile=CreateFile(pBitmapResourceInfo[i3].FileName,GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
 		if(hFile==INVALID_HANDLE_VALUE){
-			SetError(23,pBitmapResourceInfo[i3].FileName,-1);
+			compiler.errorMessenger.Output(23,pBitmapResourceInfo[i3].FileName,-1);
 			sw=1;
 			continue;
@@ -138,5 +138,5 @@
 		hFile=CreateFile(pIconResourceInfo[i3].FileName,GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
 		if(hFile==INVALID_HANDLE_VALUE){
-			SetError(23,pIconResourceInfo[i3].FileName,-1);
+			compiler.errorMessenger.Output(23,pIconResourceInfo[i3].FileName,-1);
 			sw=1;
 			continue;
@@ -645,5 +645,5 @@
 		hFile=CreateFile(pCursorResourceInfo[i3].FileName,GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
 		if(hFile==INVALID_HANDLE_VALUE){
-			SetError(23,pCursorResourceInfo[i3].FileName,-1);
+			compiler.errorMessenger.Output(23,pCursorResourceInfo[i3].FileName,-1);
 			return buffer;
 		}
@@ -725,5 +725,5 @@
 		hFile=CreateFile(pBitmapResourceInfo[i3].FileName,GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
 		if(hFile==INVALID_HANDLE_VALUE){
-			SetError(23,pBitmapResourceInfo[i3].FileName,-1);
+			compiler.errorMessenger.Output(23,pBitmapResourceInfo[i3].FileName,-1);
 			return buffer;
 		}
@@ -753,5 +753,5 @@
 		hFile=CreateFile(pIconResourceInfo[i3].FileName,GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
 		if(hFile==INVALID_HANDLE_VALUE){
-			SetError(23,pIconResourceInfo[i3].FileName,-1);
+			compiler.errorMessenger.Output(23,pIconResourceInfo[i3].FileName,-1);
 			return buffer;
 		}
@@ -839,5 +839,5 @@
 		hFile=CreateFile(temp2,GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
 		if(hFile==INVALID_HANDLE_VALUE){
-			SetError(59,temp2,-1);
+			compiler.errorMessenger.Output(59,temp2,-1);
 			return buffer;
 		}
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/Resource.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/Resource.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/Resource.cpp	(revision 465)
@@ -59,5 +59,5 @@
 		}
 		if(resultType.IsReal()){
-			SetError(9,temporary,0);
+			compiler.errorMessenger.Output(9,temporary,0);
 			return;
 		}
@@ -116,5 +116,5 @@
 		else{
 error:
-			SetError(17,NULL,0);
+			compiler.errorMessenger.Output(17,NULL,0);
 			return;
 		}
@@ -124,5 +124,5 @@
 		if(buffer[i2]=='\0') break;
 		else if(buffer[i2]!='\n'){
-			SetError(17,NULL,0);
+			compiler.errorMessenger.Output(17,NULL,0);
 			return;
 		}
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/StrOperation.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/StrOperation.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/StrOperation.cpp	(revision 465)
@@ -883,5 +883,5 @@
 	if( calcNames[idCalc] == NULL )
 	{
-		SetError();
+		compiler.errorMessenger.OutputFatalError();
 	}
 	lstrcpy( name, calcNames[idCalc] );
@@ -901,5 +901,5 @@
 		}
 	}
-	SetError();
+	compiler.errorMessenger.OutputFatalError();
 	return 0;
 }
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/Subroutine.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/Subroutine.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/Subroutine.cpp	(revision 465)
@@ -372,5 +372,5 @@
 		else if( source[i] == 1 && source[i+1] == ESC_ENDNAMESPACE ){
 			if( namespaceScopes.size() <= 0 ){
-				SetError(12, "End Namespace", i );
+				compiler.errorMessenger.Output(12, "End Namespace", i );
 			}
 			else{
@@ -391,5 +391,5 @@
 			if( !compiler.GetNamespaceSupporter().ImportsNamespace( temporary ) )
 			{
-				SetError(64,temporary,cp );
+				compiler.errorMessenger.Output(64,temporary,cp );
 			}
 
@@ -497,5 +497,5 @@
 			CompileBufferInProcedure( *pUserProc );
 		}
-		else SetError(300,NULL,cp);
+		else compiler.errorMessenger.Output(300,NULL,cp);
 	}
 	else
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/VariableOpe.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/VariableOpe.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/VariableOpe.cpp	(revision 465)
@@ -173,5 +173,5 @@
 	else{
 		extern int cp;
-		SetError(1,NULL,cp);
+		compiler.errorMessenger.Output(1,NULL,cp);
 		return 0;
 	}
@@ -273,5 +273,5 @@
 				}
 				if(variable[i]=='\"'){
-					SetError(1,NULL,cp);
+					compiler.errorMessenger.Output(1,NULL,cp);
 					return;
 				}
@@ -360,5 +360,5 @@
 				}
 				if(buffer[i+1]==cPare_Open){
-					SetError(14,buffer,cp);
+					compiler.errorMessenger.Output(14,buffer,cp);
 					return 0;
 				}
@@ -411,5 +411,5 @@
 
 	if(!IsVariableTopChar(name[0])){
-		SetError(1,NULL,nowLine);
+		compiler.errorMessenger.Output(1,NULL,nowLine);
 		return 0;
 	}
@@ -417,5 +417,5 @@
 		if(name[i2]=='\0') break;
 		if(!IsVariableChar(name[i2])){
-			SetError(1,NULL,nowLine);
+			compiler.errorMessenger.Output(1,NULL,nowLine);
 			return 0;
 		}
@@ -451,5 +451,5 @@
 	const CMember *pMember = objClass.FindDynamicMember( VarName );
 	if( !pMember ){
-		if(isErrorEnabled) SetError(103,VarName,cp);
+		if(isErrorEnabled) compiler.errorMessenger.Output(103,VarName,cp);
 		return false;
 	}
@@ -459,5 +459,5 @@
 		//同一クラスオブジェクトの場合はプライベートアクセスを容認する
 		if( pMember->IsNoneAccess() ){
-			if(isErrorEnabled) SetError(107,VarName,cp);
+			if(isErrorEnabled) compiler.errorMessenger.Output(107,VarName,cp);
 			return false;
 		}
@@ -466,9 +466,9 @@
 		if(( bPrivateAccess==0 && pMember->IsPrivate() )||
 			pMember->IsNoneAccess() ){
-			if(isErrorEnabled) SetError(107,VarName,cp);
+			if(isErrorEnabled) compiler.errorMessenger.Output(107,VarName,cp);
 			return false;
 		}
 		else if( bPrivateAccess==0 && pMember->IsProtected() ){
-			if(isErrorEnabled) SetError(108,VarName,cp);
+			if(isErrorEnabled) compiler.errorMessenger.Output(108,VarName,cp);
 			return false;
 		}
@@ -490,5 +490,5 @@
 	else{
 		if(lpPtrOffset[0]){
-			if(isErrorEnabled) SetError(16,lpszMember,cp);
+			if(isErrorEnabled) compiler.errorMessenger.Output(16,lpszMember,cp);
 			return false;
 		}
@@ -523,5 +523,5 @@
 		else{
 			//エラー
-			if(isErrorEnabled) SetError(1,NULL,cp);
+			if(isErrorEnabled) compiler.errorMessenger.Output(1,NULL,cp);
 			return false;
 		}
@@ -674,5 +674,5 @@
 
 	//変数として見つからなかったとき
-	if(isErrorEnabled) SetError(3,variable,cp);
+	if(isErrorEnabled) compiler.errorMessenger.Output(3,variable,cp);
 	return false;
 
@@ -688,5 +688,5 @@
 	else{
 		if(lpPtrOffset[0]){
-			if(isErrorEnabled) SetError(16,variable,cp);
+			if(isErrorEnabled) compiler.errorMessenger.Output(16,variable,cp);
 			return false;
 		}
@@ -714,5 +714,5 @@
 		else{
 			//エラー
-			if(isErrorEnabled) SetError(1,NULL,cp);
+			if(isErrorEnabled) compiler.errorMessenger.Output(1,NULL,cp);
 			return false;
 		}
@@ -828,5 +828,5 @@
 			(temporary[2]==ESC_FUNCTION||temporary[2]==ESC_SUB)){
 			if(buffer[i]!='('){
-				SetError(10,temporary,cp);
+				compiler.errorMessenger.Output(10,temporary,cp);
 				return false;
 			}
@@ -849,5 +849,5 @@
 
 		if( !compiler.StringToType( temporary, type ) ){
-			SetError(3,temporary,cp);
+			compiler.errorMessenger.Output(3,temporary,cp);
 			return false;
 		}
@@ -860,5 +860,5 @@
 
 			if( !type.IsObject() ){
-				SetError(112,variable,cp);
+				compiler.errorMessenger.Output(112,variable,cp);
 				return false;
 			}
@@ -877,5 +877,5 @@
 			if(i2>=0){
 				if(!(variable[i2]=='#'||variable[i2]=='!'||variable[i2]=='%'||variable[i2]=='$'))
-					SetError(-103,variable,cp);
+					compiler.errorMessenger.Output(-103,variable,cp);
 			}
 		}
@@ -896,5 +896,5 @@
 	if( InitBuf[0] != '\0' && ConstractParameter[0] != '\0' ){
 		//初期値とコンストラクタパラメータが同時に呼び出されているとき
-		SetError(132, NULL, cp);
+		compiler.errorMessenger.Output(132, NULL, cp);
 	}
 
@@ -944,5 +944,5 @@
 	if( compiler.GetObjectModule().meta.GetGlobalVars().DuplicateCheck( Symbol( name ) ) ){
 		//２重定義のエラー
-		SetError(15,name,cp);
+		compiler.errorMessenger.Output(15,name,cp);
 		return;
 	}
@@ -1024,5 +1024,5 @@
 	if( Parameter[i2] == 1 && Parameter[i2+1] == ESC_BYREF ){
 		//参照型
-		SetError();
+		compiler.errorMessenger.OutputFatalError();
 		Parameter += 2;
 	}
@@ -1067,5 +1067,5 @@
 	//定数と２重定義されていないかを調べる
 	if(compiler.GetObjectModule().meta.GetGlobalConsts().GetBasicType(VarName)){
-		SetError(15,VarName,cp);
+		compiler.errorMessenger.Output(15,VarName,cp);
 		return;
 	}
@@ -1073,5 +1073,5 @@
 	//定数マクロとして定義されている場合
 	if( compiler.GetObjectModule().meta.GetGlobalConstMacros().IsExist( VarName ) ){
-		SetError(15,VarName,cp);
+		compiler.errorMessenger.Output(15,VarName,cp);
 		return;
 	}
@@ -1095,5 +1095,5 @@
 	if(dwFlags&DIMFLAG_STATIC){
 		if( UserProc::IsGlobalAreaCompiling() ){
-			SetError(60,NULL,cp);
+			compiler.errorMessenger.Output(60,NULL,cp);
 			return;
 		}
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/calculation.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/calculation.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/calculation.cpp	(revision 465)
@@ -98,5 +98,5 @@
 	if(sp==1){
 		if(stack[0]){
-			SetError(9,NULL,cp);
+			compiler.errorMessenger.Output(9,NULL,cp);
 			return;
 		}
@@ -106,5 +106,5 @@
 		//文字列演算が可能な演算子
 		if((stack[sp-2]&&stack[sp-1]==0)||(stack[sp-2]==0&&stack[sp-1])){
-			SetError(9,NULL,cp);
+			compiler.errorMessenger.Output(9,NULL,cp);
 			return;
 		}
@@ -113,5 +113,5 @@
 		//文字列演算ができない演算子
 		if(stack[sp-2]||stack[sp-1]){
-			SetError(9,NULL,cp);
+			compiler.errorMessenger.Output(9,NULL,cp);
 			return;
 		}
@@ -180,5 +180,5 @@
 
 	extern int cp;
-	SetError(300,NULL,cp);
+	compiler.errorMessenger.Output(300,NULL,cp);
 	return 0;
 }
@@ -253,5 +253,5 @@
 			else{
 				//ゼロ割りエラーを検地
-				SetError(56,NULL,cp);
+				compiler.errorMessenger.Output(56,NULL,cp);
 			}
 		}
@@ -261,5 +261,5 @@
 			else{
 				//ゼロ割りエラーを検地
-				SetError(56,NULL,cp);
+				compiler.errorMessenger.Output(56,NULL,cp);
 			}
 		}
@@ -360,5 +360,5 @@
 			else{
 				//ゼロ割りエラーを検地
-				SetError(56,NULL,cp);
+				compiler.errorMessenger.Output(56,NULL,cp);
 			}
 		}
@@ -489,5 +489,5 @@
 						Type tempType;
 						if( !compiler.StringToType( temp2, tempType ) ){
-							if(enableerror) SetError(3,temp2,cp);
+							if(enableerror) compiler.errorMessenger.Output(3,temp2,cp);
 							return false;
 						}
@@ -501,10 +501,10 @@
 						if( !pConstMacro )
 						{
-							if(enableerror) SetError(3,temporary,cp);
+							if(enableerror) compiler.errorMessenger.Output(3,temporary,cp);
 							return false;
 						}
 						if( !pConstMacro->GetCalcBuffer( temp2, Parms ) )
 						{
-							if(enableerror) SetError(3,temporary,cp);
+							if(enableerror) compiler.errorMessenger.Output(3,temporary,cp);
 							return false;
 						}
@@ -685,5 +685,5 @@
 							else{
 								//エラー
-								if(enableerror) SetError(300,NULL,cp);
+								if(enableerror) compiler.errorMessenger.Output(300,NULL,cp);
 								return 0;
 							}
@@ -704,5 +704,5 @@
 								}
 								//エラー
-								if(enableerror) SetError(3,Parms,cp);
+								if(enableerror) compiler.errorMessenger.Output(3,Parms,cp);
 								return false;
 							}
@@ -746,5 +746,5 @@
 			else{
 				if(!(Command[i]=='+'||Command[i]=='-'||(Command[i]==1&&Command[i+1]==ESC_NOT))){
-					if(enableerror) SetError(1,NULL,cp);
+					if(enableerror) compiler.errorMessenger.Output(1,NULL,cp);
 					return false;
 				}
@@ -994,5 +994,5 @@
 					return -1;
 				}
-				SetError(57,NULL,cp);
+				compiler.errorMessenger.Output(57,NULL,cp);
 				return DEF_BYTE;
 			}
@@ -1020,5 +1020,5 @@
 					return -1;
 				}
-				SetError(58,NULL,cp);
+				compiler.errorMessenger.Output(58,NULL,cp);
 				return DEF_BYTE;
 			}
@@ -1036,5 +1036,5 @@
 				return -1;
 			}
-			SetError(12,"&",cp);
+			compiler.errorMessenger.Output(12,"&",cp);
 			return DEF_BYTE;
 		}
@@ -1090,5 +1090,5 @@
 					}
 
-					SetError(3,value,cp);
+					compiler.errorMessenger.Output(3,value,cp);
 					return DEF_DOUBLE;
 				}
@@ -1136,5 +1136,5 @@
 	}
 
-	SetError(33,NULL,cp);
+	compiler.errorMessenger.Output(33,NULL,cp);
 	return DEF_DOUBLE;
 }
@@ -1445,5 +1445,5 @@
 						(Command[i]==1&&Command[i+1]==ESC_BYVAL)
 					)){
-						SetError(1,NULL,cp);
+						compiler.errorMessenger.Output(1,NULL,cp);
 						return 0;
 				}
@@ -1461,5 +1461,5 @@
 				i+=i4;
 				if(!i3){
-					SetError(1,NULL,cp);
+					compiler.errorMessenger.Output(1,NULL,cp);
 					return 0;
 				}
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/common.h
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/common.h	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/common.h	(revision 465)
@@ -370,8 +370,4 @@
 
 //error.cpp
-void SetError(int ErrorNum,const char *KeyWord,int pos);
-void SetError(int ErrorNum,const string &keyWord,int pos);
-void SetError();
-void CompileMessage(const char *buffer);
 bool CheckDifferentType( const Type &varType,const Type &calcType,const char *pszFuncName,const int ParmNum);
 
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/error.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/error.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/error.cpp	(revision 465)
@@ -5,411 +5,4 @@
 
 #include "../BasicCompiler_Common/common.h"
-
-BOOL GetErrorMsg(int num,const char *KeyWord,char *msg,int pos){
-	extern HANDLE hHeap;
-	int i2;
-	char temporary[64];
-
-	char tempKeyWord[1024];
-	if(KeyWord){
-		lstrcpy(tempKeyWord,KeyWord);
-		for(i2=0;;i2++){
-			if(tempKeyWord[i2]=='\0') break;
-			if(tempKeyWord[i2]==1){
-				GetDefaultNameFromES(tempKeyWord[i2+1],temporary);
-				SlideString(tempKeyWord+i2+2,lstrlen(temporary)-2);
-				memcpy(tempKeyWord+i2,temporary,lstrlen(temporary));
-			}
-		}
-	}
-	else{
-		lstrcpy(tempKeyWord,"");
-	}
-
-	if(num==-1||num==-2) lstrcpy(msg,tempKeyWord);	//部分エラー
-
-	if(num==3){
-		temporary[0]=tempKeyWord[0];
-		for(i2=1;;i2++){
-			if((!IsVariableChar(tempKeyWord[i2]))||i2>=255){
-				temporary[i2]=0;
-				break;
-			}
-			temporary[i2]=tempKeyWord[i2];
-		}
-
-		extern char **SynonymErrorWords;
-		extern int SynonymErrorNum;
-		for(i2=0;i2<SynonymErrorNum;i2++){
-			if(lstrcmp(SynonymErrorWords[i2],temporary)==0) return 0;
-		}
-
-#if defined(JPN)
-		//日本語
-		sprintf(msg,"\"%s\" 無効な識別子です",temporary);
-#else
-		//英語
-		sprintf(msg,"\"%s\" Invalid identifier.",temporary);
-#endif
-
-		//重複エラー情報を追加
-		SynonymErrorWords=(char **)HeapReAlloc(hHeap,0,SynonymErrorWords,(SynonymErrorNum+1)*sizeof(char *));
-		SynonymErrorWords[SynonymErrorNum]=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
-		lstrcpy(SynonymErrorWords[SynonymErrorNum],temporary);
-		SynonymErrorNum++;
-	}
-	if(num==30){
-#if defined(JPN)
-		//日本語
-		if(temporary[0]) sprintf(msg,"\"%s\" の使い方が不正です",tempKeyWord);
-		else lstrcpy(msg,"文法が間違っています");
-#else
-		//英語
-		if(temporary[0]) sprintf(msg,"How to use the \"%s\" is wrong.",tempKeyWord);
-		else lstrcpy(msg,"Syntax Error.");
-#endif
-	}
-
-
-	/////////////////////
-	// ワーニングエラー
-	/////////////////////
-#if defined(JPN)
-	////////////////////
-	//日本語
-	////////////////////
-	if(num==-101) sprintf(msg,"[警告] %sに強制変換されています。データが失われる可能性があります。",tempKeyWord);
-	if(num==-102) sprintf(msg,"[警告] %sに強制変換されています。",tempKeyWord);
-	if(num==-103) sprintf(msg,"[警告] \"%s\" 型が指定されていません。Double型として扱います。",tempKeyWord);
-	if(num==-104) sprintf(msg,"[警告] \"%s\" 戻り値の型が指定されていません。Double型として扱います。",tempKeyWord);
-	if(num==-105) sprintf(msg,"[警告] 一時オブジェクトの解放を行えません。キャスト用オブジェクトを用意してください。",tempKeyWord);
-	if(num==-106) sprintf(msg,"[警告] DLLファイル \"%s\" が見つかりません。",tempKeyWord);
-	if(num==-107) sprintf(msg,"[警告] DLL関数 \"%s\" を参照できません。",tempKeyWord);
-	if(num==-108) lstrcpy(msg,"[警告] Catch節、Finally節を持たない意味のないTryスコープです。");
-	if(num==-120) sprintf(msg,"[警告] VarPtr関数の引数にオブジェクト インスタンスが指定されました。オブジェクトの先頭アドレスを取得したいときはObjPtr関数に切り替えをお願いします。m(__)m（この警告はVarPtr→ObjPtrへの切り替えが完了したら消します（切り替えは \"適材箇所に限り\" ですので、ご注意ください！））",tempKeyWord);
-#else
-#endif
-
-
-	///////////////
-	// 一般エラー
-	///////////////
-
-#if defined(JPN)
-	////////////////////
-	//日本語
-	////////////////////
-	if(num==1) lstrcpy(msg,"文法が間違っています。");
-	if(num==2) sprintf(msg,"左のオペランドが、左辺値になっていません。");
-	//num==3は予約されています
-	if(num==4) sprintf(msg,"%sの相互関係が一致しません。",tempKeyWord);
-	if(num==5) sprintf(msg,"ダブルクォートの数が一致しません。");
-	if(num==6) sprintf(msg,"\"%s\" ジャンプ先が不正です。",tempKeyWord);
-	if(num==7) lstrcpy(msg,"DLL名が長すぎます（拡張子を含め、16文字以下にして下さい）。");
-	if(num==8) lstrcpy(msg,"コンパイラが認識できない文字コードが含まれています。");
-	if(num==9) sprintf(msg,"型が違います。");
-	if(num==10) sprintf(msg,"\"%s\" のパラメータ指定が間違っています。",tempKeyWord);
-	if(num==11) sprintf(msg,"\"%s\" 型が違います。",tempKeyWord);
-	if(num==12) sprintf(msg,"%s の使い方が不正です。",tempKeyWord);
-	if(num==13) sprintf(msg,"\"%s\" を参照できません。",tempKeyWord);
-	if(num==14) sprintf(msg,"\"%s\" 配列指定が不正です。",tempKeyWord);
-	if(num==15) sprintf(msg,"\"%s\" はすでに定義されています。",tempKeyWord);
-	if(num==16) sprintf(msg,"\"%s\" 配列、またはポインタ以外の変数に添え字が指定されています。",tempKeyWord);
-	if(num==17) sprintf(msg,"リソース データが不正です。");
-	if(num==18) sprintf(msg,"\"%s\"はポインタ変数型です。文字列演算を指定することはできません。",tempKeyWord);
-	if(num==19) sprintf(msg,"\"%s\"は値参照型です。ByVal指定することはできません。",tempKeyWord);
-	if(num==20) lstrcpy(msg,"全角スペースが含まれています（全角スペースはコンパイラが認識できないので、半角スペースまたはタブ文字にしてください）。");
-	if(num==21) sprintf(msg,"If制御のブロック指定が不正です。");
-	if(num==22) sprintf(msg,"%s に対する End %s が見つかりません。",tempKeyWord,tempKeyWord);
-	if(num==23) sprintf(msg,"リソース ファイル \"%s\" の読み込みに失敗。",tempKeyWord);
-	if(num==24) lstrcpy(msg,"Export指定の関数のパラメータには実体オブジェクトを利用することはできません（BytePtr型などを利用して下さい）。");
-	if(num==25) sprintf(msg,"DLL関数にオブジェクトを引き渡すことはできません(%s)。",tempKeyWord);
-	if(num==26) sprintf(msg,"\"%s\" 戻り値の型が指定されていません。",tempKeyWord);
-	if(num==27) sprintf(msg,"\"%s\" は定義されていません。",tempKeyWord);
-	if(num==28) sprintf(msg,"構造体パラメータは参照渡しにしてください(%s)。",tempKeyWord);
-	if(num==29) sprintf(msg,"配列ポインタを要素と同時に引渡すときは、ポインタ参照（ByRef）にしてください。");
-	//num==30は予約されています
-	if(num==31) sprintf(msg,"\"%s\" は構造体です（メンバの参照はピリオド \".\" で区切ってください）。",tempKeyWord);
-	if(num==32) sprintf(msg,"\"%s\" は構造体ポインタです（メンバの参照は \"->\" で区切ってください）。",tempKeyWord);
-	if(num==33) sprintf(msg,"定数式にリテラル値、または定数以外のものが含まれています。");
-	if(num==34) sprintf(msg,"定数はモジュールレベルで宣言して下さい。");
-	if(num==38) sprintf(msg,"\"%s\" 戻り値が存在しないプロシージャです。",tempKeyWord);
-	if(num==39) sprintf(msg,"\"%s\" はオブジェクトポインタではありません（\"->\" 参照はできません）。",tempKeyWord);
-	if(num==40) lstrcpy(msg,"DLL関数の戻り値としてオブジェクトを受け取ることはできません。");
-	if(num==41) lstrcpy(msg,"初期データが不正です。");
-	if(num==42) lstrcpy(msg,"閉じカッコ \")\" の後に不正な文字が含まれています。");
-	if(num==43) lstrcpy(msg,"ダブルクォートの後に不正な文字が含まれています。");
-	if(num==45) sprintf(msg,"実数に対して \"%s\" 演算子は利用できません。",tempKeyWord);
-	if(num==46) lstrcpy(msg,"配列の添え字に整数以外の値が与えられています。");
-	if(num==47) lstrcpy(msg,"As演算子の右辺値に型名以外の識別子が指定されています。");
-	if(num==48) sprintf(msg,"%s演算子に対して型名が指定されています。",tempKeyWord);
-	if(num==49) lstrcpy(msg,"添え字に整数以外の型が指定されています。");
-	if(num==50) sprintf(msg,"%sに変換できません。",tempKeyWord);
-	if(num==51) lstrcpy(msg,"オブジェクト、構造体のアラインメント値は 1, 2, 4, 8, 16 のいずれかでなければなりません。");
-	if(num==52) sprintf(msg,"\"%s\" オーバーロードを解決できません。",tempKeyWord);
-	if(num==53) sprintf(msg,"\"%s\" 出力ファイルの書き込みに失敗しました。実行されている可能性があります。",tempKeyWord);
-	if(num==54) sprintf(msg,"対応する%sが存在しません。",tempKeyWord);
-	if(num==55) sprintf(msg,"\"%s\" は対応するForステートメントで利用されるカウンタ変数ではありません。",tempKeyWord);
-	if(num==56) lstrcpy(msg,"ゼロ割りが行われました。");
-	if(num==57) lstrcpy(msg,"8進数のリテラル表記が不正です。");
-	if(num==58) lstrcpy(msg,"16進数のリテラル表記が不正です。");
-	if(num==59) sprintf(msg,"マニフェスト ファイル \"%s\" の読み込みに失敗。",tempKeyWord);
-	if(num==60) lstrcpy(msg,"Staticステートメントはグローバル領域では使用できません。");
-	if(num==61) sprintf(msg,"\"%s\" は定数です。書き込みアクセスはできません。",tempKeyWord);
-	if(num==62) sprintf(msg,"グローバル領域でのReturnは禁止されています。",tempKeyWord);
-	if(num==63) lstrcpy(msg,"名前空間が正しく閉じられていません。");
-	if(num==64) sprintf(msg,"\"%s\" 無効な名前空間です。",tempKeyWord);
-	if(num==65) sprintf(msg,"ローカル領域で%sは使用できません。",tempKeyWord);
-	if(num==66) sprintf(msg,"%s 要求されている関数ポインタのパラメータまたは戻り値が一致しません。", tempKeyWord );
-	if(num==67) sprintf(msg,"%s 要求されているデリゲートのパラメータまたは戻り値が一致しません。", tempKeyWord );
-	if(num==68) sprintf(msg,"\"%s\" 不正な関数名です。", tempKeyWord);
-	if(num==69) sprintf(msg,"\"%s\" 不正なメソッド名です。", tempKeyWord);
-	if(num==70) lstrcpy(msg,"一つのTryに対して複数のFinallyを記述できません。");
-	if(num==71) lstrcpy(msg,"Finallyの後ろにCatchを記述することはできません。");
-	if(num==72) lstrcpy(msg,"Catchのパラメータの型が指定されていません。");
-	if(num==73) lstrcpy(msg,"\"%s\" Catchのパラメータの型はクラス型でなければなりません。");
-	if(num==74) sprintf(msg,"\"%s\" 型として認識できません。",tempKeyWord);
-
-
-	//オブジェクト関連
-	if(num==102) sprintf(msg,"\"%s\" オブジェクトは定義されていません。",tempKeyWord);
-	if(num==103) sprintf(msg,"\"%s\" メンバは定義されていません。",tempKeyWord);
-	if(num==104) sprintf(msg,"\"%s\" 参照方法が違います。",tempKeyWord);
-	if(num==105) sprintf(msg,"\"%s\" 自身のクラスを継承することはできません。",tempKeyWord);
-	if(num==106) sprintf(msg,"\"%s\" 存在しないクラスです。",tempKeyWord);
-	if(num==107) sprintf(msg,"Privateメンバ \"%s\" にアクセスすることはできません。",tempKeyWord);
-	if(num==108) sprintf(msg,"Protectedメンバ \"%s\" にアクセスすることはできません。",tempKeyWord);
-	if(num==109) sprintf(msg,"Privateメンバ関数 \"%s\" を呼び出すことはできません。",tempKeyWord);
-	if(num==110) sprintf(msg,"Protectedメンバ関数 \"%s\" を呼び出すことはできません。",tempKeyWord);
-	if(num==111) lstrcpy(msg,"InheritsはClass定義内の先頭に記述する必要があります。");
-	if(num==112) sprintf(msg,"\"%s\" はクラス型ではないため、初期パラメータを指定することはできません。",tempKeyWord);
-	if(num==113) sprintf(msg,"\"%s\" コンストラクタへ渡すパラメータが不正です。",tempKeyWord);
-	if(num==114) lstrcpy(msg,"デストラクタはパラメータを持てません。");
-	if(num==115) lstrcpy(msg,"コンストラクタ及びデストラクタは戻り値を持てません。");
-	//if(num==116) lstrcpy(msg,"コンストラクタ及びデストラクタはパブリックアクセスにしなければなりません。");
-	if(num==117) lstrcpy(msg,"デストラクタの名前が \"~クラス名\" になっていません。");
-	if(num==118) lstrcpy(msg,"参照する基底クラスが存在しません。");
-	if(num==119) sprintf(msg,"\"%s\" メンバは基底クラスで定義されていません。",tempKeyWord);
-	if(num==120) lstrcpy(msg,"デストラクトするオブジェクトの型が不明です。");
-	if(num==121) lstrcpy(msg,"New演算子にはクラス以外の型を指定できません。");
-	if(num==122) lstrcpy(msg,"Delete演算子にポインタ以外の型が指定されています。");
-	if(num==123) lstrcpy(msg,"ループ継承が行われました。");
-	if(num==124) lstrcpy(msg,"循環参照が行われました。");
-	if(num==125) sprintf(msg,"\"%s\" は抽象クラスです。インスタンス化することはできません。",tempKeyWord);
-	if(num==126) lstrcpy(msg,"オペレータのオーバーロードをクラスの外で行うことはできません。");
-	if(num==127) lstrcpy(msg,"Override修飾子の指定が無い状況でオーバーライドを行うことはできません。");
-	if(num==128) lstrcpy(msg,"オーバーライドを行うときはアクセシビリティを同一にしなければなりません。");
-	if(num==129) sprintf(msg,"静的メンバ \"%s\" は定義されていません。",tempKeyWord);
-	if(num==130) sprintf(msg,"\"%s\" はオブジェクト定数です。書き込みアクセスはできません。",tempKeyWord);
-	if(num==131) lstrcpy(msg,"Const定義されたメソッド内でクラスメンバへの書き込みアクセスはできません。");
-	if(num==132) lstrcpy(msg,"明示的なコンストラクタ呼び出しと初期値の指定を同時に行うことはできません。");
-	if(num==133) lstrcpy(msg,"Thisに代入はできません。");
-	if(num==134) lstrcpy( msg,"ObjPtr関数にはオブジェクト インスタンス以外を指定できません。" );
-	if(num==135) lstrcpy( msg, "クラス以外の型を継承元として指定することはできません。" );
-	if(num==136) sprintf( msg, "\"%s\" 非仮想関数に対してオーバーライドしようとしました。", tempKeyWord );
-	if(num==137) lstrcpy(msg,"ImplementsはClass定義内の先頭に記述する必要があります。");
-	if(num==138) sprintf(msg,"%s はインターフェイスではありません。Implementsできるのはインターフェイスに限ります。",tempKeyWord);
-	if(num==139) sprintf(msg,"%s はインターフェイスではありません。",tempKeyWord);
-	if(num==140) lstrcpy(msg,"Align修飾子を構造体以外の型に指定することはできません。");
-	if(num==141) lstrcpy(msg,"Blittable修飾子をクラス以外の型に指定することはできません。");
-	if(num==142) lstrcpy(msg,"不正なThis参照です。");
-
-	//Enum関連
-	if(num==150) sprintf(msg,"\"%s\" 値が定義されていません。",tempKeyWord);
-	if(num==151) sprintf(msg,"\"%s\" 列挙リストに登録されていません。",tempKeyWord);
-
-	//リンカ
-	if(num==200) sprintf(msg,"\"%s\" 未解決です (リンク エラー)。",tempKeyWord);
-	if(num==201) sprintf(msg,"\"%s\" の読み込みに失敗。",tempKeyWord);
-
-	//原因不明
-	if(num==300) lstrcpy(msg,"内部エラー");
-
-	// ベースライブラリ不整合
-	if( num == 400 )	sprintf( msg, "\"%s\" が存在しません。標準ライブラリの内容が古い可能性があります。", tempKeyWord );
-
-#else
-	////////////////////
-	//英語
-	////////////////////
-	if(num==1) lstrcpy(msg,"Syntax Error.");
-	if(num==2) sprintf(msg,"Left operand must be l-value.");
-	//num==3は予約されています
-	if(num==4) sprintf(msg,"Correlation of %s is wrong.",tempKeyWord);
-	if(num==5) sprintf(msg,"Correlation of double quotes is wrong.");
-	if(num==6) sprintf(msg,"\"%s\" Label not found.",tempKeyWord);
-	if(num==7) lstrcpy(msg,"The DLL name is too long. Must be 16 characters or less.");
-	if(num==8) lstrcpy(msg,"The inaccurate characters are contained.");
-	if(num==9) sprintf(msg,"Type is wrong.");
-	if(num==10) sprintf(msg,"\"%s\" Rule of parameter is wrong.",tempKeyWord);
-	if(num==11) sprintf(msg,"\"%s\" Type is wrong.",tempKeyWord);
-	if(num==12) sprintf(msg,"\"%s\" Not a valid use.",tempKeyWord);
-	if(num==13) sprintf(msg,"Cannot refer to \"%s\".",tempKeyWord);
-	if(num==14) sprintf(msg,"\"%s\" Array argument(s) out of bound.",tempKeyWord);
-	if(num==15) sprintf(msg,"\"%s\" is already defined.",tempKeyWord);
-	if(num==16) sprintf(msg,"\"%s\" Argument(s) following variable which is not pointer or array.",tempKeyWord);
-	if(num==17) sprintf(msg,"Invalid resource data.");
-	if(num==18) sprintf(msg,"\"%s\" Invalid operation on a pointer variable.",tempKeyWord);
-	if(num==19) sprintf(msg,"\"%s\" is already to be passed by value. You cannot use \"ByVal\".",tempKeyWord);
-	if(num==21) sprintf(msg,"Wrong structure of \"If\" block.");
-	if(num==22) sprintf(msg,"No matching \"End %s\" found for \"%s\".",tempKeyWord,tempKeyWord);
-	if(num==23) sprintf(msg,"Cannot read the resource file \"%s\".",tempKeyWord);
-	if(num==24) lstrcpy(msg,"Must not use String type as an argument for exported function. (Use BytePtr type instead.)");
-	if(num==27) sprintf(msg,"\"%s\" Undefined procedure.",tempKeyWord);
-	if(num==28) sprintf(msg,"\"%s\" Structure must not be passed by value. (Use \"ByRef\".)",tempKeyWord);
-	if(num==29) sprintf(msg,"Array must not be passed by value. (Use \"ByRef\".)");
-	//num==30は予約されています
-	if(num==31) sprintf(msg,"\"%s\" is a struct. (Use period \".\" to refer to the members.)",tempKeyWord);
-	if(num==32) sprintf(msg,"\"%s\" is a pointer of struct. (Use arrow \"->\" to refer to the members.)",tempKeyWord);
-	if(num==33) sprintf(msg,"Constant formula has a thing that is not literal value or constant value.");
-	if(num==34) sprintf(msg,"Constant formula must be defined in the module level.");
-	if(num==38) sprintf(msg,"\"%s\" is a procedure without a return value.",tempKeyWord);
-	if(num==39) sprintf(msg,"\"%s\" is not object pointer. \"->\" is invalid.",tempKeyWord);
-	if(num==40) lstrcpy(msg,"Cannot set a object to return value.");
-	if(num==41) lstrcpy(msg,"Init data is wrong.");
-	if(num==42) lstrcpy(msg,"The inaccurate characters are contained after the closing parenthesis \")\".");
-	if(num==43) lstrcpy(msg,"The inaccurate characters are contained after the double quote.");
-
-	//オブジェクト関連
-	if(num==102) sprintf(msg,"\"%s\" The object is not defined.",tempKeyWord);
-	if(num==103) sprintf(msg,"\"%s\" The member is not defined.",tempKeyWord);
-	if(num==104) sprintf(msg,"\"%s\" The reference character is different.",tempKeyWord);
-	if(num==105) sprintf(msg,"\"%s\" An own class is not inheritable.",tempKeyWord);
-	if(num==106) sprintf(msg,"\"%s\" It class is not defined.",tempKeyWord);
-	if(num==107) sprintf(msg,"\"%s\" Cannot access the private member.",tempKeyWord);
-	if(num==108) sprintf(msg,"\"%s\" Cannot access the protected member.",tempKeyWord);
-	if(num==109) sprintf(msg,"\"%s\" Cannot call the private member.",tempKeyWord);
-	if(num==110) sprintf(msg,"\"%s\" Cannot call the protected member.",tempKeyWord);
-	if(num==111) lstrcpy(msg,"The Inherits phrase must be described to the 1st line of class module");
-	if(num==112) sprintf(msg,"\"%s\" is not class object. Therefor you cannot set the parameter for constructor.",tempKeyWord);
-	if(num==113) sprintf(msg,"\"%s\" The parameter for constructor is wrong.",tempKeyWord);
-	if(num==114) lstrcpy(msg,"Destructor cannot have a parameter.");
-	if(num==115) lstrcpy(msg,"Constructor and Destructor cannot have a return value.");
-	if(num==116) lstrcpy(msg,"Constructor and Destructor must be public access.");
-	if(num==117) lstrcpy(msg,"Destructors name must be \"~ClassName\".");
-	if(num==118) lstrcpy(msg,"Super class is not found.");
-	if(num==119) sprintf(msg,"\"%s\" The member is not defined in the super class.",tempKeyWord);
-
-	//Enum関連
-	if(num==150) sprintf(msg,"\"%s\" The value is not set",tempKeyWord);
-	if(num==151) sprintf(msg,"\"%s\" is not found from enum lists.",tempKeyWord);
-
-	//リンカ
-	if(num==200) sprintf(msg,"\"%s\" Unknown error.",tempKeyWord);
-#endif
-
-	return 1;
-}
-void SetError(int ErrorNum,const string &keyWord,int pos){
-	SetError( ErrorNum, keyWord.c_str(), pos );
-}
-void SetError(int num,const char *KeyWord,int pos){
-	extern HANDLE hHeap;
-	extern HWND hMainDlg;
-	extern ERRORINFO *pErrorInfo;
-	extern int ErrorNum;
-	char temporary[1024],temp2[1024],temp3[32];
-	BOOL bFirst;
-	int i2;
-
-	extern BOOL bDebugRun;
-	if(bDebugRun) return;
-
-	if(num!=-2){
-		//一般エラーまたは警告
-		i2=0;	//ここにブレークポイントをおく
-
-		if(num>-100){
-			//エラーのみ
-
-			i2=0;
-
-			if( num == 300 )
-			{
-				// 内部エラー
-				i2=0;
-			}
-		}
-
-	}
-
-	if(!GetErrorMsg(num,KeyWord,temporary,pos)) return;
-
-	if(ErrorNum==0){
-		SetDlgItemText(hMainDlg,IDC_ERRORLIST,"");
-		EnableWindow(GetDlgItem(hMainDlg,IDC_ERRORLIST),1);
-		bFirst=1;
-	}
-	else bFirst=0;
-
-
-	////////////////////
-	// エラー情報を追加
-	pErrorInfo=(ERRORINFO *)HeapReAlloc(hHeap,0,pErrorInfo,(ErrorNum+1)*sizeof(ERRORINFO));
-
-	if(pos==-1){
-		pErrorInfo[ErrorNum].FileName=0;
-		lstrcpy(temp2,temporary);
-	}
-	else{
-		std::string dummyStr;
-		compiler.GetObjectModule().GetCurrentSource().GetLineInfo( pos, pErrorInfo[ErrorNum].line, dummyStr );
-
-		pErrorInfo[ErrorNum].FileName=(char *)HeapAlloc(hHeap,0,lstrlen(dummyStr.c_str())+1);
-		lstrcpy(pErrorInfo[ErrorNum].FileName,dummyStr.c_str());
-
-		_splitpath(pErrorInfo[ErrorNum].FileName,0,0,temp2,temp3);
-		lstrcat(temp2,temp3);
-
-		if(pErrorInfo[ErrorNum].line==-1)
-			sprintf(temp2+lstrlen(temp2),"(no area) %s",temporary);
-		else
-			sprintf(temp2+lstrlen(temp2),"(%d) - %s",pErrorInfo[ErrorNum].line+1,temporary);
-	}
-
-	i2=GetWindowTextLength(GetDlgItem(hMainDlg,IDC_ERRORLIST));
-	SendDlgItemMessage(hMainDlg,IDC_ERRORLIST,EM_SETSEL,i2,i2);
-	if(bFirst==0){
-		SendDlgItemMessage(hMainDlg,IDC_ERRORLIST,EM_REPLACESEL,0,(LPARAM)"\r\n");
-		i2+=2;
-		SendDlgItemMessage(hMainDlg,IDC_ERRORLIST,EM_SETSEL,i2,i2);
-	}
-	SendDlgItemMessage(hMainDlg,IDC_ERRORLIST,EM_REPLACESEL,0,(LPARAM)temp2);
-
-	std::string msg = temp2;
-	if(num==-2){
-		//コンパイルメッセージ
-		//※何もしない
-		extern int CompileMsgNum;
-		CompileMsgNum++;
-	}
-	else{
-		msg = (num>-100) ? "error - " : "warning - ";
-		msg += temp2;
-		if(num>-100){
-			//警告ではなく、エラーの場合はエラーチェックフラグを立てる
-			extern BOOL bError;
-			bError=1;
-		}
-		else{
-			extern int WarningNum;
-			WarningNum++;
-		}
-
-		// ログに出力
-		trace( msg );
-	}
-
-	std::cout << msg << endl;
-
-
-	ErrorNum++;
-}
-void SetError(){
-	SetError(300,NULL,cp);
-}
-void CompileMessage(const char *buffer){
-	SetError(-2,buffer,-1);
-}
 
 #define STRING_SYSTEM_DECLAREHANDLE "*_System_DeclareHandle_"
@@ -444,7 +37,7 @@
 
 	extern int cp;
-	if(iWarning==1) SetError(-101,temporary,cp);
- 	else if(iWarning==2) SetError(-102,temporary,cp);
- 	else if(iWarning==3) SetError(50,temporary,cp);
+	if(iWarning==1) compiler.errorMessenger.Output(-101,temporary,cp);
+ 	else if(iWarning==2) compiler.errorMessenger.Output(-102,temporary,cp);
+ 	else if(iWarning==3) compiler.errorMessenger.Output(50,temporary,cp);
 }
 
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/hash.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/hash.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/hash.cpp	(revision 465)
@@ -125,5 +125,5 @@
 	if(subs.size() == 0){
 		if(bError){
-			SetError(3,lpszName,cp);
+			compiler.errorMessenger.Output(3,lpszName,cp);
 		}
 		return 0;
@@ -132,5 +132,5 @@
 	//一つ以上の関数が存在するときは内部エラー（デバッグ用）
 	if(subs.size() > 1){
-		if(bError) SetError(300,NULL,cp);
+		if(bError) compiler.errorMessenger.Output(300,NULL,cp);
 	}
 
@@ -169,5 +169,5 @@
 	char temporary[VN_SIZE];
 	sprintf( temporary, "%s.%s", className, methodName );
-	SetError(3, temporary, -1 );
+	compiler.errorMessenger.Output(3, temporary, -1 );
 
 	return NULL;
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/include/Compiler.h
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/include/Compiler.h	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/include/Compiler.h	(revision 465)
@@ -1,4 +1,5 @@
 #pragma once
 
+#include <Messenger.h>
 #include <CodeGenerator.h>
 #include <NamespaceSupporter.h>
@@ -85,4 +86,8 @@
 		return namespaceSupporter;
 	}
+
+	// メッセンジャー
+	Messenger messenger;
+	ErrorMessenger errorMessenger;
 
 	// コード生成機構
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/include/Messenger.h
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/include/Messenger.h	(revision 465)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/include/Messenger.h	(revision 465)
@@ -0,0 +1,74 @@
+
+class Messenger
+{
+public:
+	void Output( const std::string &message );
+	int GetNextErrorLine();
+};
+
+class ErrorInfo
+{
+	int errorCode;
+	std::string keyword;
+	std::string sourceFilePath;
+	int sourceLineNum;
+	int errorLineNum;
+
+public:
+	ErrorInfo( int errorCode, const std::string &keyword, const std::string &sourceFilePath, int sourceLineNum )
+		: errorCode( errorCode )
+		, keyword( keyword )
+		, sourceFilePath( sourceFilePath )
+		, sourceLineNum( sourceLineNum )
+	{
+	}
+	ErrorInfo( int errorCode, const std::string &keyword, int sourceIndex );
+
+	int GetErrorCode() const
+	{
+		return errorCode;
+	}
+	bool IsWarning() const
+	{
+		return ( errorCode < -100 );
+	}
+	const std::string &GetKeyword() const
+	{
+		return keyword;
+	}
+	const std::string &GetSourceFilePath() const
+	{
+		return sourceFilePath;
+	}
+	int GetSourceLineNum() const
+	{
+		return sourceLineNum;
+	}
+	int GetErrorLineNum() const
+	{
+		return errorLineNum;
+	}
+
+	std::string GetMessageString() const;
+	std::string GetFullMessageString() const;
+};
+typedef std::vector<ErrorInfo> ErrorInfos;
+
+class ErrorMessenger
+	: public Messenger
+{
+	ErrorInfos errorInfos;
+	Jenga::Common::Strings synonymKeyWords;
+
+public:
+	void Output( const ErrorInfo &errorInfo );
+	void Output( int errorCode, const std::string &keyword, int sourceIndex );
+	void Output( int errorCode, const char *keyword, int sourceIndex );
+	void OutputFatalError();
+
+	int GetErrorCount() const;
+	bool HasError() const;
+	int GetWarningCount() const;
+
+	void ShowErrorLine( int errorLineNum );
+};
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/include/Method.h
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/include/Method.h	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/include/Method.h	(revision 465)
@@ -5,5 +5,4 @@
 class UserProc;
 class CClass;
-void SetError();
 
 class CMethod : public MemberPrototype
@@ -175,12 +174,24 @@
 	}
 
-	virtual bool Override( const UserProc *pUserProc, Prototype::Accessibility accessibility, bool isOverrideModifier ){SetError();return false;}
-
-	virtual bool IsAbstract() const{SetError();return false;}
-	virtual void SetAbstractMark( bool isAbstract ){SetError();}
+	virtual bool Override( const UserProc *pUserProc, Prototype::Accessibility accessibility, bool isOverrideModifier )
+	{
+		throw;
+	}
+
+	virtual bool IsAbstract() const
+	{
+		throw;
+	}
+	virtual void SetAbstractMark( bool isAbstract )
+	{
+		throw;
+	}
 	virtual bool IsVirtual() const{
 		return false;
 	}
-	virtual bool IsConst() const{SetError();return false;}
+	virtual bool IsConst() const
+	{
+		throw;
+	}
 	virtual bool IsDynamic() const
 	{
@@ -191,6 +202,12 @@
 		return true;
 	}
-	virtual const CClass *GetInheritsClassPtr() const{SetError();return NULL;}
-	virtual void SetInheritsClassPtr( const CClass *pInheritsClass ){SetError();}
+	virtual const CClass *GetInheritsClassPtr() const
+	{
+		throw;
+	}
+	virtual void SetInheritsClassPtr( const CClass *pInheritsClass )
+	{
+		throw;
+	}
 	virtual bool IsNotUse() const
 	{
@@ -199,5 +216,5 @@
 	virtual void SetNotUseMark( bool isNotUse )
 	{
-		SetError();
+		throw;
 	}
 };
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/include/NativeCode.h
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/include/NativeCode.h	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/include/NativeCode.h	(revision 465)
@@ -119,45 +119,10 @@
 		return lpValue;
 	}
-	const ::DllProc &GetDllProc() const
-	{
-		if( type != Schedule::DllProc )
-		{
-			SetError();
-		}
-		return *pDllProc;
-	}
-	const ::UserProc &GetUserProc() const
-	{
-		if( !( type == Schedule::UserProc || type == Schedule::AddressOf || type == Schedule::CatchAddress ) )
-		{
-			SetError();
-		}
-		return *pUserProc;
-	}
-	const ::CClass &GetClass() const
-	{
-		if( !( type == Schedule::ComVtbl || type == Schedule::Vtbl || type == Schedule::TypeInfo ) )
-		{
-			SetError();
-		}
-		return *pClass;
-	}
-
-	void SpecifyAddressOf()
-	{
-		if( type != Schedule::UserProc )
-		{
-			SetError();
-		}
-		type = Schedule::AddressOf;
-	}
-	void SpecifyCatchAddress()
-	{
-		if( type != Schedule::UserProc )
-		{
-			SetError();
-		}
-		type = Schedule::CatchAddress;
-	}
+	const ::DllProc &GetDllProc() const;
+	const ::UserProc &GetUserProc() const;
+	const ::CClass &GetClass() const;
+
+	void SpecifyAddressOf();
+	void SpecifyCatchAddress();
 };
 typedef std::vector<Schedule> Schedules;
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/src/Class.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/src/Class.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/src/Class.cpp	(revision 465)
@@ -199,5 +199,5 @@
 		const CClass *pInheritsClass = compiler.GetObjectModule().meta.GetClasses().Find(className);
 		if( !pInheritsClass ){
-			SetError(106,className,nowLine);
+			compiler.errorMessenger.Output(106,className,nowLine);
 			return false;
 		}
@@ -212,5 +212,5 @@
 		}
 		else{
-			SetError(135,pInheritsClass->GetFullName().c_str(),nowLine);
+			compiler.errorMessenger.Output(135,pInheritsClass->GetFullName().c_str(),nowLine);
 			return false;
 		}
@@ -236,5 +236,5 @@
 	if( !compiler.GetObjectModule().meta.GetClasses().LoopRefCheck(inheritsClass) )
 	{
-		SetError(123,inheritsClass.GetName(),nowLine);
+		compiler.errorMessenger.Output(123,inheritsClass.GetName(),nowLine);
 		return false;
 	}
@@ -296,5 +296,5 @@
 	{
 		// インターフェイスではないとき
-		SetError(138,interfaceClass.GetName().c_str(),nowLine );
+		compiler.errorMessenger.Output(138,interfaceClass.GetName().c_str(),nowLine );
 		return false;
 	}
@@ -379,5 +379,5 @@
 		const CClass *pInterfaceClass = compiler.GetObjectModule().meta.GetClasses().Find( className );
 		if( !pInterfaceClass ){
-			SetError(106,paramStr.c_str(),nowLine);
+			compiler.errorMessenger.Output(106,paramStr.c_str(),nowLine);
 			continue;
 		}
@@ -404,5 +404,5 @@
 	//重複チェック
 	if(this->DupliCheckAll(VarName)){
-		SetError(15,VarName,cp);
+		compiler.errorMessenger.Output(15,VarName,cp);
 	}
 
@@ -466,5 +466,5 @@
 		//デストラクタの場合はその名前が正しいかチェックを行う
 		if(lstrcmp(temporary+1,pobj_c->GetName().c_str())!=0)
-			SetError(117,NULL,nowLine);
+			compiler.errorMessenger.Output(117,NULL,nowLine);
 		else
 			bDestructor=1;
@@ -489,5 +489,5 @@
 
 	if(pobj_c->DupliCheckMember(temporary)){
-		SetError(15,temporary,nowLine);
+		compiler.errorMessenger.Output(15,temporary,nowLine);
 		return;
 	}
@@ -502,5 +502,5 @@
 		{
 			//関数名、パラメータ、戻り値が合致したとき
-			SetError(15,pUserProc->GetName().c_str(),nowLine);
+			compiler.errorMessenger.Output(15,pUserProc->GetName().c_str(),nowLine);
 			return;
 		}
@@ -549,5 +549,5 @@
 	if( interfaceName[0] )
 	{
-		SetError(139,interfaceName,nowLine);
+		compiler.errorMessenger.Output(139,interfaceName,nowLine);
 	}
 
@@ -557,5 +557,5 @@
 
 	if( isOverride ){
-		SetError(12,"Override",nowLine);
+		compiler.errorMessenger.Output(12,"Override",nowLine);
 	}
 
@@ -757,5 +757,5 @@
 				if( !pMember->GetType().IsStruct() )
 				{
-					SetError();
+					compiler.errorMessenger.OutputFatalError();
 				}
 
@@ -863,5 +863,5 @@
 				if( !pMember->GetType().IsStruct() )
 				{
-					SetError();
+					compiler.errorMessenger.OutputFatalError();
 				}
 
@@ -985,5 +985,5 @@
 	}
 
-	SetError();
+	compiler.errorMessenger.OutputFatalError();
 	return;
 }
@@ -1002,5 +1002,5 @@
 	}
 
-	SetError();
+	compiler.errorMessenger.OutputFatalError();
 	return 0;
 }
@@ -1014,5 +1014,5 @@
 	if( vtblMasterListOffset == -1 )
 	{
-		SetError();
+		compiler.errorMessenger.OutputFatalError();
 	}
 
@@ -1042,5 +1042,5 @@
 	if( vtblMasterList.size() )
 	{
-		SetError();
+		compiler.errorMessenger.OutputFatalError();
 	}
 
@@ -1062,5 +1062,5 @@
 			if( this->comVtblOffset )
 			{
-				SetError();
+				compiler.errorMessenger.OutputFatalError();
 			}
 			this->comVtblOffset = tempVtblOffset;
@@ -1167,5 +1167,5 @@
 	if( !Put( pClass ) )
 	{
-		SetError(15,pClass->GetName(), nowLine);
+		compiler.errorMessenger.Output(15,pClass->GetName(), nowLine);
 		return false;
 	}
@@ -1465,5 +1465,5 @@
 			pCompilingMethod = pParentClass->GetStaticMethods().GetMethodPtr( pUserProc );
 			if( !pCompilingMethod ){
-				SetError();
+				compiler.errorMessenger.OutputFatalError();
 			}
 		}
@@ -1482,5 +1482,5 @@
 		if( !pStringClass )
 		{
-			SetError(400, "System.String", cp);
+			compiler.errorMessenger.Output(400, "System.String", cp);
 			static CClass dummy;
 			return &dummy;
@@ -1498,5 +1498,5 @@
 		if( !pObjectClass )
 		{
-			SetError(400, "System.Object", cp);
+			compiler.errorMessenger.Output(400, "System.Object", cp);
 			static CClass dummy;
 			return &dummy;
@@ -1514,5 +1514,5 @@
 		if( !pInterfaceInfo )
 		{
-			SetError(400, "ActiveBasic.Core.InterfaceInfo", cp);
+			compiler.errorMessenger.Output(400, "ActiveBasic.Core.InterfaceInfo", cp);
 			static CClass dummy;
 			return &dummy;
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/src/Class_Collect.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/src/Class_Collect.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/src/Class_Collect.cpp	(revision 465)
@@ -102,5 +102,5 @@
 		else if( source[i] == 1 && source[i+1] == ESC_ENDNAMESPACE ){
 			if( namespaceScopes.size() <= 0 ){
-				SetError(12, "End Namespace", i );
+				compiler.errorMessenger.Output(12, "End Namespace", i );
 			}
 			else{
@@ -121,5 +121,5 @@
 			if( !compiler.GetNamespaceSupporter().ImportsNamespace( temporary ) )
 			{
-				SetError(64,temporary,i );
+				compiler.errorMessenger.Output(64,temporary,i );
 			}
 
@@ -228,5 +228,5 @@
 			if(pobj_LoopRefCheck->check(pMember->GetType().GetClass())){
 				extern int cp;
-				SetError(124,pMember->GetType().GetClass().GetName(),cp);
+				compiler.errorMessenger.Output(124,pMember->GetType().GetClass().GetName(),cp);
 				return false;
 			}
@@ -283,5 +283,5 @@
 		else if( basbuf[i] == 1 && basbuf[i+1] == ESC_ENDNAMESPACE ){
 			if( namespaceScopes.size() <= 0 ){
-				SetError(12, "End Namespace", i );
+				compiler.errorMessenger.Output(12, "End Namespace", i );
 			}
 			else{
@@ -303,5 +303,5 @@
 			if( !compiler.GetNamespaceSupporter().ImportsNamespace( temporary ) )
 			{
-				SetError(64,temporary,i );
+				compiler.errorMessenger.Output(64,temporary,i );
 			}
 
@@ -358,9 +358,9 @@
 					if( !compiler.StringToType( typeParameterBaseClassNames[i2], baseType ) )
 					{
-						SetError(106,typeParameterBaseClassNames[i2],i);
+						compiler.errorMessenger.Output(106,typeParameterBaseClassNames[i2],i);
 					}
 					else if( !baseType.IsObject() )
 					{
-						SetError(106,typeParameterBaseClassNames[i2],i);
+						compiler.errorMessenger.Output(106,typeParameterBaseClassNames[i2],i);
 					}
 				}
@@ -394,5 +394,5 @@
 
 				if(lstrcmpi(temporary,pobj_c->GetName().c_str())==0){
-					SetError(105,temporary,i);
+					compiler.errorMessenger.Output(105,temporary,i);
 					goto Interface_InheritsError;
 				}
@@ -402,5 +402,5 @@
 				const CClass *pInheritsClass = classes.Find(temporary);
 				if( !pInheritsClass ){
-					SetError(106,temporary,i);
+					compiler.errorMessenger.Output(106,temporary,i);
 					goto Interface_InheritsError;
 				}
@@ -427,5 +427,5 @@
 				//エラー
 				if(basbuf[i]==1&&(basbuf[i+1]==ESC_CLASS||basbuf[i+1]==ESC_TYPE||basbuf[i+1]==ESC_INTERFACE)){
-					SetError(22,"Interface",i);
+					compiler.errorMessenger.Output(22,"Interface",i);
 					i--;
 					break;
@@ -433,10 +433,10 @@
 
 				if(basbuf[i]==1&&basbuf[i+1]==ESC_INHERITS){
-					SetError(111,NULL,i);
+					compiler.errorMessenger.Output(111,NULL,i);
 					break;
 				}
 				else if( basbuf[i] == 1 && basbuf[i+1] == ESC_IMPLEMENTS )
 				{
-					SetError(137, NULL, i );
+					compiler.errorMessenger.Output(137, NULL, i );
 					break;
 				}
@@ -454,5 +454,5 @@
 					if(basbuf[i]=='\0'){
 						i--;
-						SetError(22,"Interface",top_pos);
+						compiler.errorMessenger.Output(22,"Interface",top_pos);
 						break;
 					}
@@ -466,5 +466,5 @@
 					temporary[1]==ESC_SUB||temporary[1]==ESC_FUNCTION
 					))){
-					SetError(1,NULL,i);
+					compiler.errorMessenger.Output(1,NULL,i);
 					break;
 				}
@@ -505,9 +505,9 @@
 				if( dwClassType != ESC_TYPE )
 				{
-					SetError(140,NULL,i);
+					compiler.errorMessenger.Output(140,NULL,i);
 				}
 
 				if(!(iAlign==1||iAlign==2||iAlign==4||iAlign==8||iAlign==16))
-					SetError(51,NULL,i);
+					compiler.errorMessenger.Output(51,NULL,i);
 			}
 			else if( memicmp( basbuf + i, "Blittable(", 10 ) == 0 ){
@@ -518,5 +518,5 @@
 				if( dwClassType != ESC_CLASS )
 				{
-					SetError(141,NULL,i);
+					compiler.errorMessenger.Output(141,NULL,i);
 				}
 			}
@@ -568,9 +568,9 @@
 					if( !compiler.StringToType( typeParameterBaseClassNames[i2], baseType ) )
 					{
-						SetError(106,typeParameterBaseClassNames[i2],i);
+						compiler.errorMessenger.Output(106,typeParameterBaseClassNames[i2],i);
 					}
 					else if( !baseType.IsObject() )
 					{
-						SetError(106,typeParameterBaseClassNames[i2],i);
+						compiler.errorMessenger.Output(106,typeParameterBaseClassNames[i2],i);
 					}
 				}
@@ -616,5 +616,5 @@
 
 					if(lstrcmpi(temporary,pobj_c->GetName().c_str())==0){
-						SetError(105,temporary,i);
+						compiler.errorMessenger.Output(105,temporary,i);
 						goto InheritsError;
 					}
@@ -644,5 +644,5 @@
 				//エラー
 				if(basbuf[i]==1&&(basbuf[i+1]==ESC_CLASS||basbuf[i+1]==ESC_TYPE)){
-					SetError(22,"Class",i);
+					compiler.errorMessenger.Output(22,"Class",i);
 					i--;
 					break;
@@ -650,10 +650,10 @@
 
 				if(basbuf[i]==1&&basbuf[i+1]==ESC_INHERITS){
-					SetError(111,NULL,i);
+					compiler.errorMessenger.Output(111,NULL,i);
 					break;
 				}
 				else if( basbuf[i] == 1 && basbuf[i+1] == ESC_IMPLEMENTS )
 				{
-					SetError(137, NULL, i );
+					compiler.errorMessenger.Output(137, NULL, i );
 					break;
 				}
@@ -718,7 +718,7 @@
 
 						if(dwClassType==ESC_CLASS)
-							SetError(22,"Class",top_pos);
+							compiler.errorMessenger.Output(22,"Class",top_pos);
 						else
-							SetError(22,"Type",top_pos);
+							compiler.errorMessenger.Output(22,"Type",top_pos);
 
 						i--;
@@ -810,5 +810,5 @@
 							basbuf[i+1]==ESC_ENUM)){
 							GetDefaultNameFromES(i3,temporary);
-							SetError(22,temporary,i);
+							compiler.errorMessenger.Output(22,temporary,i);
 						}
 						if(basbuf[i]==1&&basbuf[i+1]==GetEndXXXCommand((char)i3)){
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/src/CommonCodeGenerator.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/src/CommonCodeGenerator.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/src/CommonCodeGenerator.cpp	(revision 465)
@@ -22,5 +22,5 @@
 	if( pertialSchedules.size() > 0 )
 	{
-		SetError();
+		compiler.errorMessenger.OutputFatalError();
 	}
 }
@@ -40,5 +40,5 @@
 				{
 					// 範囲外
-					SetError();
+					compiler.errorMessenger.OutputFatalError();
 				}
 
@@ -55,5 +55,5 @@
 			else
 			{
-				SetError();
+				compiler.errorMessenger.OutputFatalError();
 			}
 
@@ -72,5 +72,5 @@
 	if( isSuccessful == false )
 	{
-		SetError();
+		compiler.errorMessenger.OutputFatalError();
 	}
 }
@@ -94,5 +94,5 @@
 			else
 			{
-				SetError();
+				compiler.errorMessenger.OutputFatalError();
 			}
 
@@ -111,5 +111,5 @@
 	if( isSuccessful == false )
 	{
-		SetError();
+		compiler.errorMessenger.OutputFatalError();
 	}
 }
@@ -133,5 +133,5 @@
 				{
 					// 範囲外
-					SetError();
+					compiler.errorMessenger.OutputFatalError();
 				}
 
@@ -144,5 +144,5 @@
 			else
 			{
-				SetError();
+				compiler.errorMessenger.OutputFatalError();
 			}
 
@@ -160,5 +160,5 @@
 	if( isSuccessful == false )
 	{
-		SetError();
+		compiler.errorMessenger.OutputFatalError();
 	}
 }
@@ -180,5 +180,5 @@
 		else
 		{
-			SetError();
+			compiler.errorMessenger.OutputFatalError();
 		}
 	}
@@ -196,5 +196,5 @@
 		else
 		{
-			SetError();
+			compiler.errorMessenger.OutputFatalError();
 		}
 	}
@@ -223,5 +223,5 @@
 	else
 	{
-		SetError();
+		compiler.errorMessenger.OutputFatalError();
 	}
 
@@ -276,5 +276,5 @@
 	if( GetContinueCodePos() == -1 )
 	{
-		SetError(12,"Continue",cp);
+		compiler.errorMessenger.Output(12,"Continue",cp);
 		return;
 	}
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/src/Compiler.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/src/Compiler.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/src/Compiler.cpp	(revision 465)
@@ -206,5 +206,5 @@
 	}
 
-	SetError(1, NULL, cp);
+	compiler.errorMessenger.Output(1, NULL, cp);
 
 	return (string)"(null)";
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/src/Const.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/src/Const.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/src/Const.cpp	(revision 465)
@@ -17,5 +17,5 @@
 	for(i=0;;i++){
 		if(buffer[i]=='\0'){
-			SetError(10,"Const",cp);
+			compiler.errorMessenger.Output(10,"Const",cp);
 			return;
 		}
@@ -31,5 +31,5 @@
 		|| compiler.GetObjectModule().meta.GetGlobalConsts().IsExist( name ) )
 	{
-		SetError(15,name,cp);
+		compiler.errorMessenger.Output(15,name,cp);
 		return;
 	}
@@ -144,5 +144,5 @@
 		extern int cp;
 		for(i2=0;i2<num;i2++) HeapDefaultFree(pParms[i2]);
-		SetError(10,GetName().c_str(),cp);
+		compiler.errorMessenger.Output(10,GetName().c_str(),cp);
 		lstrcpy(dest,"0");
 		return 1;
@@ -206,5 +206,5 @@
 	if(parameterStr[i]!='(')
 	{
-		SetError();
+		compiler.errorMessenger.OutputFatalError();
 		return;
 	}
@@ -214,5 +214,5 @@
 	for(i++,i2=0;;i++,i2++){
 		if(parameterStr[i]=='\0'){
-			SetError(1,NULL,cp);
+			compiler.errorMessenger.Output(1,NULL,cp);
 			return;
 		}
@@ -226,5 +226,5 @@
 				if(parameterStr[i]!='='){
 					extern int cp;
-					SetError(1,NULL,cp);
+					compiler.errorMessenger.Output(1,NULL,cp);
 					return;
 				}
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/src/DataTable.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/src/DataTable.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/src/DataTable.cpp	(revision 465)
@@ -121,5 +121,5 @@
 			{
 				// エラー
-				SetError();
+				compiler.errorMessenger.OutputFatalError();
 				return false;
 			}
@@ -196,5 +196,5 @@
 			i+=i2;
 			if(expression[i]!='\0'){
-				SetError(42,NULL,cp);
+				compiler.errorMessenger.Output(42,NULL,cp);
 				return false;
 			}
@@ -213,5 +213,5 @@
 
 	if( !compiler.StringToType( typeName, resultType ) ){
-		SetError(3,typeName,cp);
+		compiler.errorMessenger.Output(3,typeName,cp);
 		return false;
 	}
@@ -222,5 +222,5 @@
 		////////////////////////
 
-		SetError(121,NULL,cp);
+		compiler.errorMessenger.Output(121,NULL,cp);
 		return false;
 	}
@@ -268,5 +268,5 @@
 {
 	if( !baseType.IsPointer() ){
-		SetError(1,NULL,cp);
+		compiler.errorMessenger.Output(1,NULL,cp);
 		return false;
 	}
@@ -301,5 +301,5 @@
 			if( !RemoveStringQuotes( tempParamStr ) )
 			{
-				SetError();
+				compiler.errorMessenger.OutputFatalError();
 			}
 
@@ -335,5 +335,5 @@
 			if( !resultType.IsWhole() ){
 				// TODO: 実数に未対応
-				SetError();
+				compiler.errorMessenger.OutputFatalError();
 				isSuccessful = false;
 				break;
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/src/Delegate.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/src/Delegate.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/src/Delegate.cpp	(revision 465)
@@ -20,5 +20,5 @@
 		if( !compiler.StringToType( returnTypeName, returnType ) )
 		{
-			SetError(3,returnTypeName,sourceIndex);
+			compiler.errorMessenger.Output(3,returnTypeName,sourceIndex);
 		}
 	}
@@ -72,5 +72,5 @@
 		else if( source[i] == 1 && source[i+1] == ESC_ENDNAMESPACE ){
 			if( namespaceScopes.size() <= 0 ){
-				SetError(12, "End Namespace", i );
+				compiler.errorMessenger.Output(12, "End Namespace", i );
 			}
 			else{
@@ -91,5 +91,5 @@
 			if( !compiler.GetNamespaceSupporter().ImportsNamespace( temporary ) )
 			{
-				SetError(64,temporary,i );
+				compiler.errorMessenger.Output(64,temporary,i );
 			}
 
@@ -108,5 +108,5 @@
 			if( !( source[i] == 1 && ( source[i+1] == ESC_SUB || source[i+1] == ESC_FUNCTION ) ) )
 			{
-				SetError(1,NULL,i);
+				compiler.errorMessenger.Output(1,NULL,i);
 				continue;
 			}
@@ -125,5 +125,5 @@
 			if( source[i] != '(' )
 			{
-				SetError(1,NULL,nowLine);
+				compiler.errorMessenger.Output(1,NULL,nowLine);
 				continue;
 			}
@@ -142,5 +142,5 @@
 				if( procKind != Procedure::Function )
 				{
-					SetError(38,name,nowLine);
+					compiler.errorMessenger.Output(38,name,nowLine);
 				}
 			}
@@ -149,5 +149,5 @@
 				if( procKind == Procedure::Function )
 				{
-					SetError(-104,name,nowLine);
+					compiler.errorMessenger.Output(-104,name,nowLine);
 					lstrcpy( returnTypeName, "Double" );
 				}
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/src/Enum.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/src/Enum.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/src/Enum.cpp	(revision 465)
@@ -18,5 +18,5 @@
 		}
 		if(!IsVariableChar(buffer[i])){
-			SetError(1,NULL,i);
+			compiler.errorMessenger.Output(1,NULL,i);
 			break;
 		}
@@ -25,5 +25,5 @@
 
 	if(buffer[i]=='\0'){
-		SetError(22,"Enum",nowLine);
+		compiler.errorMessenger.Output(22,"Enum",nowLine);
 		return;
 	}
@@ -52,5 +52,5 @@
 		if(temporary[0]=='\0'){
 			if(buffer[i]=='\0'){
-				SetError(22,"Enum",nowLine);
+				compiler.errorMessenger.Output(22,"Enum",nowLine);
 				break;
 			}
@@ -131,5 +131,5 @@
 		else if( source[i] == 1 && source[i+1] == ESC_ENDNAMESPACE ){
 			if( namespaceScopes.size() <= 0 ){
-				SetError(12, "End Namespace", i );
+				compiler.errorMessenger.Output(12, "End Namespace", i );
 			}
 			else{
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/src/Exception.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/src/Exception.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/src/Exception.cpp	(revision 465)
@@ -120,5 +120,5 @@
 		if( isDefinedFinally )
 		{
-			SetError(71,NULL,cp);
+			compiler.errorMessenger.Output(71,NULL,cp);
 			return;
 		}
@@ -146,5 +146,5 @@
 		if( isDefinedFinally )
 		{
-			SetError(70,NULL,cp);
+			compiler.errorMessenger.Output(70,NULL,cp);
 			return;
 		}
@@ -173,5 +173,5 @@
 		if( !isDefinedFinally )
 		{
-			SetError();
+			compiler.errorMessenger.OutputFatalError();
 		}
 
@@ -259,5 +259,5 @@
 	if( tryScopes.size() == 0 )
 	{
-		SetError(1,NULL,cp);
+		compiler.errorMessenger.Output(1,NULL,cp);
 		return;
 	}
@@ -271,5 +271,5 @@
 		if( !typeName[0] )
 		{
-			SetError(72,NULL,cp);
+			compiler.errorMessenger.Output(72,NULL,cp);
 		}
 		else
@@ -277,5 +277,5 @@
 			if( !compiler.StringToType( typeName, paramType ) )
 			{
-				SetError(74,typeName,cp);
+				compiler.errorMessenger.Output(74,typeName,cp);
 			}
 			else
@@ -283,5 +283,5 @@
 				if( !paramType.IsObject() )
 				{
-					SetError(73,typeName,cp);
+					compiler.errorMessenger.Output(73,typeName,cp);
 				}
 			}
@@ -296,9 +296,9 @@
 	if( paramType.IsObject() )
 	{
-		sprintf( temporary, "Dim %s = Thread.CurrentThread().__GetThrowintParamObject() As %s", varName, paramType.GetClass().GetFullName().c_str() );
+		sprintf( temporary, "Dim %s = System.Threading.Thread.CurrentThread().__GetThrowintParamObject() As %s", varName, paramType.GetClass().GetFullName().c_str() );
 		MakeMiddleCode( temporary );
 		ChangeOpcode( temporary );
 	}
-	lstrcpy( temporary, "Thread.CurrentThread().__Catched()" );
+	lstrcpy( temporary, "System.Threading.Thread.CurrentThread().__Catched()" );
 	MakeMiddleCode( temporary );
 	ChangeOpcode( temporary );
@@ -326,5 +326,5 @@
 	if( tryScopes.size() == 0 )
 	{
-		SetError(12,"End Try",cp);
+		compiler.errorMessenger.Output(12,"End Try",cp);
 		return;
 	}
@@ -333,5 +333,5 @@
 	{
 		// CatchもFinallyも存在しないとき
-		SetError(-108,NULL,tryScopes.back().GetSourceCodePos() );
+		compiler.errorMessenger.Output(-108,NULL,tryScopes.back().GetSourceCodePos() );
 	}
 
@@ -364,5 +364,5 @@
 	while( tryScopes.size() > 0 )
 	{
-		SetError(22, "Try", tryScopes.back().GetSourceCodePos() );
+		compiler.errorMessenger.Output(22, "Try", tryScopes.back().GetSourceCodePos() );
 
 		EndTryCommand( true );
@@ -393,5 +393,5 @@
 	if( tryScopes.size() == 0 )
 	{
-		SetError(1,NULL,cp);
+		compiler.errorMessenger.Output(1,NULL,cp);
 		return;
 	}
@@ -424,5 +424,5 @@
 	if( tryScopes.size() == 0 )
 	{
-		SetError(1,NULL,cp);
+		compiler.errorMessenger.Output(1,NULL,cp);
 		return;
 	}
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/src/LexicalScope.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/src/LexicalScope.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/src/LexicalScope.cpp	(revision 465)
@@ -64,5 +64,5 @@
 void LexicalScopes::End(){
 	if( level <= 0 ){
-		SetError();
+		compiler.errorMessenger.OutputFatalError();
 		return;
 	}
@@ -154,5 +154,5 @@
 			if( UserProc::IsGlobalAreaCompiling() ){
 				//ここには来ないハズ
-				SetError(300,NULL,cp);
+				compiler.errorMessenger.Output(300,NULL,cp);
 			}
 		}
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/src/Linker.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/src/Linker.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/src/Linker.cpp	(revision 465)
@@ -113,5 +113,5 @@
 				&& schedule.GetUserProc().GetEndOpAddress() == 0 )
 			{
-				SetError();
+				compiler.errorMessenger.OutputFatalError();
 			}
 
@@ -252,5 +252,5 @@
 	if( nativeCode.GetSize() > 0 )
 	{
-		SetError();
+		compiler.errorMessenger.OutputFatalError();
 	}
 
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/src/Messenger.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/src/Messenger.cpp	(revision 465)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/src/Messenger.cpp	(revision 465)
@@ -0,0 +1,479 @@
+#include "stdafx.h"
+
+void Messenger::Output( const std::string &message )
+{
+	////////////////////////////////////////////////////////////////////
+	// エディットコントロールに出力
+	////////////////////////////////////////////////////////////////////
+	extern HWND hMainDlg;
+
+	// 出力先のエディットコントロールが無効化されていたときはクリアして有効化する
+	if( !IsWindowEnabled( GetDlgItem(hMainDlg,IDC_ERRORLIST) ) )
+	{
+		SetDlgItemText( hMainDlg, IDC_ERRORLIST, "" );
+		EnableWindow( GetDlgItem( hMainDlg, IDC_ERRORLIST ), TRUE );
+	}
+
+	// エディットコントロールに出力
+	int i2 = GetWindowTextLength(GetDlgItem(hMainDlg,IDC_ERRORLIST));
+	SendDlgItemMessage(hMainDlg,IDC_ERRORLIST,EM_SETSEL,i2,i2);
+	SendDlgItemMessage(hMainDlg,IDC_ERRORLIST,EM_REPLACESEL,0,(LPARAM)(message + "\r\n").c_str());
+
+
+	// ログに出力
+	trace( message );
+
+	// 標準出力
+	std::cout << message << endl;
+}
+int Messenger::GetNextErrorLine()
+{
+	extern HWND hMainDlg;
+	int index = GetWindowTextLength(GetDlgItem(hMainDlg,IDC_ERRORLIST));
+	return SendMessage(GetDlgItem(hMainDlg,IDC_ERRORLIST),EM_LINEFROMCHAR,index,0);
+}
+
+ErrorInfo::ErrorInfo( int errorCode, const std::string &keyword, int sourceIndex )
+	: errorCode( errorCode )
+	, keyword( keyword )
+	, sourceFilePath( "" )
+	, sourceLineNum( -1 )
+{
+	if( sourceIndex != -1 )
+	{
+		compiler.GetObjectModule().GetCurrentSource().GetLineInfo( sourceIndex, sourceLineNum, sourceFilePath );
+	}
+
+	errorLineNum = compiler.messenger.GetNextErrorLine();
+}
+
+std::string ErrorInfo::GetMessageString() const
+{
+	extern HANDLE hHeap;
+	int i2;
+	char temporary[64];
+
+	char tempKeyWord[1024];
+	lstrcpy(tempKeyWord,keyword.c_str());
+	for(i2=0;;i2++){
+		if(tempKeyWord[i2]=='\0') break;
+		if(tempKeyWord[i2]==1){
+			GetDefaultNameFromES(tempKeyWord[i2+1],temporary);
+			SlideString(tempKeyWord+i2+2,lstrlen(temporary)-2);
+			memcpy(tempKeyWord+i2,temporary,lstrlen(temporary));
+		}
+	}
+
+	if( errorCode == -1 || errorCode == -2 )
+	{
+		// 部分エラー
+		return keyword;
+	}
+
+	char msg[1024];
+	if(errorCode==3)
+	{
+		for( int i3=0; ; i3++ )
+		{
+			if( !IsVariableChar( tempKeyWord[i3] ) || tempKeyWord[i3] == '.' )
+			{
+				temporary[i3] = 0;
+				break;
+			}
+			temporary[i3] = tempKeyWord[i3];
+		}
+
+#if defined(JPN)
+		//日本語
+		sprintf(msg,"\"%s\" 無効な識別子です",temporary);
+#else
+		//英語
+		sprintf(msg,"\"%s\" Invalid identifier.",temporary);
+#endif
+
+	}
+	if(errorCode==30){
+#if defined(JPN)
+		//日本語
+		if(temporary[0]) sprintf(msg,"\"%s\" の使い方が不正です",tempKeyWord);
+		else lstrcpy(msg,"文法が間違っています");
+#else
+		//英語
+		if(temporary[0]) sprintf(msg,"How to use the \"%s\" is wrong.",tempKeyWord);
+		else lstrcpy(msg,"Syntax Error.");
+#endif
+	}
+
+
+	/////////////////////
+	// ワーニングエラー
+	/////////////////////
+#if defined(JPN)
+	////////////////////
+	//日本語
+	////////////////////
+	if(errorCode==-101) sprintf(msg,"[警告] %sに強制変換されています。データが失われる可能性があります。",tempKeyWord);
+	if(errorCode==-102) sprintf(msg,"[警告] %sに強制変換されています。",tempKeyWord);
+	if(errorCode==-103) sprintf(msg,"[警告] \"%s\" 型が指定されていません。Double型として扱います。",tempKeyWord);
+	if(errorCode==-104) sprintf(msg,"[警告] \"%s\" 戻り値の型が指定されていません。Double型として扱います。",tempKeyWord);
+	if(errorCode==-105) sprintf(msg,"[警告] 一時オブジェクトの解放を行えません。キャスト用オブジェクトを用意してください。",tempKeyWord);
+	if(errorCode==-106) sprintf(msg,"[警告] DLLファイル \"%s\" が見つかりません。",tempKeyWord);
+	if(errorCode==-107) sprintf(msg,"[警告] DLL関数 \"%s\" を参照できません。",tempKeyWord);
+	if(errorCode==-108) lstrcpy(msg,"[警告] Catch節、Finally節を持たない意味のないTryスコープです。");
+	if(errorCode==-120) sprintf(msg,"[警告] VarPtr関数の引数にオブジェクト インスタンスが指定されました。オブジェクトの先頭アドレスを取得したいときはObjPtr関数に切り替えをお願いします。m(__)m（この警告はVarPtr→ObjPtrへの切り替えが完了したら消します（切り替えは \"適材箇所に限り\" ですので、ご注意ください！））",tempKeyWord);
+#else
+#endif
+
+
+	///////////////
+	// 一般エラー
+	///////////////
+
+#if defined(JPN)
+	////////////////////
+	//日本語
+	////////////////////
+	if(errorCode==1) lstrcpy(msg,"文法が間違っています。");
+	if(errorCode==2) sprintf(msg,"左のオペランドが、左辺値になっていません。");
+	//errorCode==3は予約されています
+	if(errorCode==4) sprintf(msg,"%sの相互関係が一致しません。",tempKeyWord);
+	if(errorCode==5) sprintf(msg,"ダブルクォートの数が一致しません。");
+	if(errorCode==6) sprintf(msg,"\"%s\" ジャンプ先が不正です。",tempKeyWord);
+	if(errorCode==7) lstrcpy(msg,"DLL名が長すぎます（拡張子を含め、16文字以下にして下さい）。");
+	if(errorCode==8) lstrcpy(msg,"コンパイラが認識できない文字コードが含まれています。");
+	if(errorCode==9) sprintf(msg,"型が違います。");
+	if(errorCode==10) sprintf(msg,"\"%s\" のパラメータ指定が間違っています。",tempKeyWord);
+	if(errorCode==11) sprintf(msg,"\"%s\" 型が違います。",tempKeyWord);
+	if(errorCode==12) sprintf(msg,"%s の使い方が不正です。",tempKeyWord);
+	if(errorCode==13) sprintf(msg,"\"%s\" を参照できません。",tempKeyWord);
+	if(errorCode==14) sprintf(msg,"\"%s\" 配列指定が不正です。",tempKeyWord);
+	if(errorCode==15) sprintf(msg,"\"%s\" はすでに定義されています。",tempKeyWord);
+	if(errorCode==16) sprintf(msg,"\"%s\" 配列、またはポインタ以外の変数に添え字が指定されています。",tempKeyWord);
+	if(errorCode==17) sprintf(msg,"リソース データが不正です。");
+	if(errorCode==18) sprintf(msg,"\"%s\"はポインタ変数型です。文字列演算を指定することはできません。",tempKeyWord);
+	if(errorCode==19) sprintf(msg,"\"%s\"は値参照型です。ByVal指定することはできません。",tempKeyWord);
+	if(errorCode==20) lstrcpy(msg,"全角スペースが含まれています（全角スペースはコンパイラが認識できないので、半角スペースまたはタブ文字にしてください）。");
+	if(errorCode==21) sprintf(msg,"If制御のブロック指定が不正です。");
+	if(errorCode==22) sprintf(msg,"%s に対する End %s が見つかりません。",tempKeyWord,tempKeyWord);
+	if(errorCode==23) sprintf(msg,"リソース ファイル \"%s\" の読み込みに失敗。",tempKeyWord);
+	if(errorCode==24) lstrcpy(msg,"Export指定の関数のパラメータには実体オブジェクトを利用することはできません（BytePtr型などを利用して下さい）。");
+	if(errorCode==25) sprintf(msg,"DLL関数にオブジェクトを引き渡すことはできません(%s)。",tempKeyWord);
+	if(errorCode==26) sprintf(msg,"\"%s\" 戻り値の型が指定されていません。",tempKeyWord);
+	if(errorCode==27) sprintf(msg,"\"%s\" は定義されていません。",tempKeyWord);
+	if(errorCode==28) sprintf(msg,"構造体パラメータは参照渡しにしてください(%s)。",tempKeyWord);
+	if(errorCode==29) sprintf(msg,"配列ポインタを要素と同時に引渡すときは、ポインタ参照（ByRef）にしてください。");
+	//errorCode==30は予約されています
+	if(errorCode==31) sprintf(msg,"\"%s\" は構造体です（メンバの参照はピリオド \".\" で区切ってください）。",tempKeyWord);
+	if(errorCode==32) sprintf(msg,"\"%s\" は構造体ポインタです（メンバの参照は \"->\" で区切ってください）。",tempKeyWord);
+	if(errorCode==33) sprintf(msg,"定数式にリテラル値、または定数以外のものが含まれています。");
+	if(errorCode==34) sprintf(msg,"定数はモジュールレベルで宣言して下さい。");
+	if(errorCode==38) sprintf(msg,"\"%s\" 戻り値が存在しないプロシージャです。",tempKeyWord);
+	if(errorCode==39) sprintf(msg,"\"%s\" はオブジェクトポインタではありません（\"->\" 参照はできません）。",tempKeyWord);
+	if(errorCode==40) lstrcpy(msg,"DLL関数の戻り値としてオブジェクトを受け取ることはできません。");
+	if(errorCode==41) lstrcpy(msg,"初期データが不正です。");
+	if(errorCode==42) lstrcpy(msg,"閉じカッコ \")\" の後に不正な文字が含まれています。");
+	if(errorCode==43) lstrcpy(msg,"ダブルクォートの後に不正な文字が含まれています。");
+	if(errorCode==45) sprintf(msg,"実数に対して \"%s\" 演算子は利用できません。",tempKeyWord);
+	if(errorCode==46) lstrcpy(msg,"配列の添え字に整数以外の値が与えられています。");
+	if(errorCode==47) lstrcpy(msg,"As演算子の右辺値に型名以外の識別子が指定されています。");
+	if(errorCode==48) sprintf(msg,"%s演算子に対して型名が指定されています。",tempKeyWord);
+	if(errorCode==49) lstrcpy(msg,"添え字に整数以外の型が指定されています。");
+	if(errorCode==50) sprintf(msg,"%sに変換できません。",tempKeyWord);
+	if(errorCode==51) lstrcpy(msg,"オブジェクト、構造体のアラインメント値は 1, 2, 4, 8, 16 のいずれかでなければなりません。");
+	if(errorCode==52) sprintf(msg,"\"%s\" オーバーロードを解決できません。",tempKeyWord);
+	if(errorCode==53) sprintf(msg,"\"%s\" 出力ファイルの書き込みに失敗しました。実行されている可能性があります。",tempKeyWord);
+	if(errorCode==54) sprintf(msg,"対応する%sが存在しません。",tempKeyWord);
+	if(errorCode==55) sprintf(msg,"\"%s\" は対応するForステートメントで利用されるカウンタ変数ではありません。",tempKeyWord);
+	if(errorCode==56) lstrcpy(msg,"ゼロ割りが行われました。");
+	if(errorCode==57) lstrcpy(msg,"8進数のリテラル表記が不正です。");
+	if(errorCode==58) lstrcpy(msg,"16進数のリテラル表記が不正です。");
+	if(errorCode==59) sprintf(msg,"マニフェスト ファイル \"%s\" の読み込みに失敗。",tempKeyWord);
+	if(errorCode==60) lstrcpy(msg,"Staticステートメントはグローバル領域では使用できません。");
+	if(errorCode==61) sprintf(msg,"\"%s\" は定数です。書き込みアクセスはできません。",tempKeyWord);
+	if(errorCode==62) sprintf(msg,"グローバル領域でのReturnは禁止されています。",tempKeyWord);
+	if(errorCode==63) lstrcpy(msg,"名前空間が正しく閉じられていません。");
+	if(errorCode==64) sprintf(msg,"\"%s\" 無効な名前空間です。",tempKeyWord);
+	if(errorCode==65) sprintf(msg,"ローカル領域で%sは使用できません。",tempKeyWord);
+	if(errorCode==66) sprintf(msg,"%s 要求されている関数ポインタのパラメータまたは戻り値が一致しません。", tempKeyWord );
+	if(errorCode==67) sprintf(msg,"%s 要求されているデリゲートのパラメータまたは戻り値が一致しません。", tempKeyWord );
+	if(errorCode==68) sprintf(msg,"\"%s\" 不正な関数名です。", tempKeyWord);
+	if(errorCode==69) sprintf(msg,"\"%s\" 不正なメソッド名です。", tempKeyWord);
+	if(errorCode==70) lstrcpy(msg,"一つのTryに対して複数のFinallyを記述できません。");
+	if(errorCode==71) lstrcpy(msg,"Finallyの後ろにCatchを記述することはできません。");
+	if(errorCode==72) lstrcpy(msg,"Catchのパラメータの型が指定されていません。");
+	if(errorCode==73) lstrcpy(msg,"\"%s\" Catchのパラメータの型はクラス型でなければなりません。");
+	if(errorCode==74) sprintf(msg,"\"%s\" 型として認識できません。",tempKeyWord);
+
+
+	//オブジェクト関連
+	if(errorCode==102) sprintf(msg,"\"%s\" オブジェクトは定義されていません。",tempKeyWord);
+	if(errorCode==103) sprintf(msg,"\"%s\" メンバは定義されていません。",tempKeyWord);
+	if(errorCode==104) sprintf(msg,"\"%s\" 参照方法が違います。",tempKeyWord);
+	if(errorCode==105) sprintf(msg,"\"%s\" 自身のクラスを継承することはできません。",tempKeyWord);
+	if(errorCode==106) sprintf(msg,"\"%s\" 存在しないクラスです。",tempKeyWord);
+	if(errorCode==107) sprintf(msg,"Privateメンバ \"%s\" にアクセスすることはできません。",tempKeyWord);
+	if(errorCode==108) sprintf(msg,"Protectedメンバ \"%s\" にアクセスすることはできません。",tempKeyWord);
+	if(errorCode==109) sprintf(msg,"Privateメンバ関数 \"%s\" を呼び出すことはできません。",tempKeyWord);
+	if(errorCode==110) sprintf(msg,"Protectedメンバ関数 \"%s\" を呼び出すことはできません。",tempKeyWord);
+	if(errorCode==111) lstrcpy(msg,"InheritsはClass定義内の先頭に記述する必要があります。");
+	if(errorCode==112) sprintf(msg,"\"%s\" はクラス型ではないため、初期パラメータを指定することはできません。",tempKeyWord);
+	if(errorCode==113) sprintf(msg,"\"%s\" コンストラクタへ渡すパラメータが不正です。",tempKeyWord);
+	if(errorCode==114) lstrcpy(msg,"デストラクタはパラメータを持てません。");
+	if(errorCode==115) lstrcpy(msg,"コンストラクタ及びデストラクタは戻り値を持てません。");
+	//if(errorCode==116) lstrcpy(msg,"コンストラクタ及びデストラクタはパブリックアクセスにしなければなりません。");
+	if(errorCode==117) lstrcpy(msg,"デストラクタの名前が \"~クラス名\" になっていません。");
+	if(errorCode==118) lstrcpy(msg,"参照する基底クラスが存在しません。");
+	if(errorCode==119) sprintf(msg,"\"%s\" メンバは基底クラスで定義されていません。",tempKeyWord);
+	if(errorCode==120) lstrcpy(msg,"デストラクトするオブジェクトの型が不明です。");
+	if(errorCode==121) lstrcpy(msg,"New演算子にはクラス以外の型を指定できません。");
+	if(errorCode==122) lstrcpy(msg,"Delete演算子にポインタ以外の型が指定されています。");
+	if(errorCode==123) lstrcpy(msg,"ループ継承が行われました。");
+	if(errorCode==124) lstrcpy(msg,"循環参照が行われました。");
+	if(errorCode==125) sprintf(msg,"\"%s\" は抽象クラスです。インスタンス化することはできません。",tempKeyWord);
+	if(errorCode==126) lstrcpy(msg,"オペレータのオーバーロードをクラスの外で行うことはできません。");
+	if(errorCode==127) lstrcpy(msg,"Override修飾子の指定が無い状況でオーバーライドを行うことはできません。");
+	if(errorCode==128) lstrcpy(msg,"オーバーライドを行うときはアクセシビリティを同一にしなければなりません。");
+	if(errorCode==129) sprintf(msg,"静的メンバ \"%s\" は定義されていません。",tempKeyWord);
+	if(errorCode==130) sprintf(msg,"\"%s\" はオブジェクト定数です。書き込みアクセスはできません。",tempKeyWord);
+	if(errorCode==131) lstrcpy(msg,"Const定義されたメソッド内でクラスメンバへの書き込みアクセスはできません。");
+	if(errorCode==132) lstrcpy(msg,"明示的なコンストラクタ呼び出しと初期値の指定を同時に行うことはできません。");
+	if(errorCode==133) lstrcpy(msg,"Thisに代入はできません。");
+	if(errorCode==134) lstrcpy( msg,"ObjPtr関数にはオブジェクト インスタンス以外を指定できません。" );
+	if(errorCode==135) lstrcpy( msg, "クラス以外の型を継承元として指定することはできません。" );
+	if(errorCode==136) sprintf( msg, "\"%s\" 非仮想関数に対してオーバーライドしようとしました。", tempKeyWord );
+	if(errorCode==137) lstrcpy(msg,"ImplementsはClass定義内の先頭に記述する必要があります。");
+	if(errorCode==138) sprintf(msg,"%s はインターフェイスではありません。Implementsできるのはインターフェイスに限ります。",tempKeyWord);
+	if(errorCode==139) sprintf(msg,"%s はインターフェイスではありません。",tempKeyWord);
+	if(errorCode==140) lstrcpy(msg,"Align修飾子を構造体以外の型に指定することはできません。");
+	if(errorCode==141) lstrcpy(msg,"Blittable修飾子をクラス以外の型に指定することはできません。");
+	if(errorCode==142) lstrcpy(msg,"不正なThis参照です。");
+
+	//Enum関連
+	if(errorCode==150) sprintf(msg,"\"%s\" 値が定義されていません。",tempKeyWord);
+	if(errorCode==151) sprintf(msg,"\"%s\" 列挙リストに登録されていません。",tempKeyWord);
+
+	//リンカ
+	if(errorCode==200) sprintf(msg,"\"%s\" 未解決です (リンク エラー)。",tempKeyWord);
+	if(errorCode==201) sprintf(msg,"\"%s\" の読み込みに失敗。",tempKeyWord);
+
+	//原因不明
+	if(errorCode==300) lstrcpy(msg,"内部エラー");
+
+	// ベースライブラリ不整合
+	if( errorCode == 400 )	sprintf( msg, "\"%s\" が存在しません。標準ライブラリの内容が古い可能性があります。", tempKeyWord );
+
+#else
+	////////////////////
+	//英語
+	////////////////////
+	if(errorCode==1) lstrcpy(msg,"Syntax Error.");
+	if(errorCode==2) sprintf(msg,"Left operand must be l-value.");
+	//errorCode==3は予約されています
+	if(errorCode==4) sprintf(msg,"Correlation of %s is wrong.",tempKeyWord);
+	if(errorCode==5) sprintf(msg,"Correlation of double quotes is wrong.");
+	if(errorCode==6) sprintf(msg,"\"%s\" Label not found.",tempKeyWord);
+	if(errorCode==7) lstrcpy(msg,"The DLL name is too long. Must be 16 characters or less.");
+	if(errorCode==8) lstrcpy(msg,"The inaccurate characters are contained.");
+	if(errorCode==9) sprintf(msg,"Type is wrong.");
+	if(errorCode==10) sprintf(msg,"\"%s\" Rule of parameter is wrong.",tempKeyWord);
+	if(errorCode==11) sprintf(msg,"\"%s\" Type is wrong.",tempKeyWord);
+	if(errorCode==12) sprintf(msg,"\"%s\" Not a valid use.",tempKeyWord);
+	if(errorCode==13) sprintf(msg,"Cannot refer to \"%s\".",tempKeyWord);
+	if(errorCode==14) sprintf(msg,"\"%s\" Array argument(s) out of bound.",tempKeyWord);
+	if(errorCode==15) sprintf(msg,"\"%s\" is already defined.",tempKeyWord);
+	if(errorCode==16) sprintf(msg,"\"%s\" Argument(s) following variable which is not pointer or array.",tempKeyWord);
+	if(errorCode==17) sprintf(msg,"Invalid resource data.");
+	if(errorCode==18) sprintf(msg,"\"%s\" Invalid operation on a pointer variable.",tempKeyWord);
+	if(errorCode==19) sprintf(msg,"\"%s\" is already to be passed by value. You cannot use \"ByVal\".",tempKeyWord);
+	if(errorCode==21) sprintf(msg,"Wrong structure of \"If\" block.");
+	if(errorCode==22) sprintf(msg,"No matching \"End %s\" found for \"%s\".",tempKeyWord,tempKeyWord);
+	if(errorCode==23) sprintf(msg,"Cannot read the resource file \"%s\".",tempKeyWord);
+	if(errorCode==24) lstrcpy(msg,"Must not use String type as an argument for exported function. (Use BytePtr type instead.)");
+	if(errorCode==27) sprintf(msg,"\"%s\" Undefined procedure.",tempKeyWord);
+	if(errorCode==28) sprintf(msg,"\"%s\" Structure must not be passed by value. (Use \"ByRef\".)",tempKeyWord);
+	if(errorCode==29) sprintf(msg,"Array must not be passed by value. (Use \"ByRef\".)");
+	//errorCode==30は予約されています
+	if(errorCode==31) sprintf(msg,"\"%s\" is a struct. (Use period \".\" to refer to the members.)",tempKeyWord);
+	if(errorCode==32) sprintf(msg,"\"%s\" is a pointer of struct. (Use arrow \"->\" to refer to the members.)",tempKeyWord);
+	if(errorCode==33) sprintf(msg,"Constant formula has a thing that is not literal value or constant value.");
+	if(errorCode==34) sprintf(msg,"Constant formula must be defined in the module level.");
+	if(errorCode==38) sprintf(msg,"\"%s\" is a procedure without a return value.",tempKeyWord);
+	if(errorCode==39) sprintf(msg,"\"%s\" is not object pointer. \"->\" is invalid.",tempKeyWord);
+	if(errorCode==40) lstrcpy(msg,"Cannot set a object to return value.");
+	if(errorCode==41) lstrcpy(msg,"Init data is wrong.");
+	if(errorCode==42) lstrcpy(msg,"The inaccurate characters are contained after the closing parenthesis \")\".");
+	if(errorCode==43) lstrcpy(msg,"The inaccurate characters are contained after the double quote.");
+
+	//オブジェクト関連
+	if(errorCode==102) sprintf(msg,"\"%s\" The object is not defined.",tempKeyWord);
+	if(errorCode==103) sprintf(msg,"\"%s\" The member is not defined.",tempKeyWord);
+	if(errorCode==104) sprintf(msg,"\"%s\" The reference character is different.",tempKeyWord);
+	if(errorCode==105) sprintf(msg,"\"%s\" An own class is not inheritable.",tempKeyWord);
+	if(errorCode==106) sprintf(msg,"\"%s\" It class is not defined.",tempKeyWord);
+	if(errorCode==107) sprintf(msg,"\"%s\" Cannot access the private member.",tempKeyWord);
+	if(errorCode==108) sprintf(msg,"\"%s\" Cannot access the protected member.",tempKeyWord);
+	if(errorCode==109) sprintf(msg,"\"%s\" Cannot call the private member.",tempKeyWord);
+	if(errorCode==110) sprintf(msg,"\"%s\" Cannot call the protected member.",tempKeyWord);
+	if(errorCode==111) lstrcpy(msg,"The Inherits phrase must be described to the 1st line of class module");
+	if(errorCode==112) sprintf(msg,"\"%s\" is not class object. Therefor you cannot set the parameter for constructor.",tempKeyWord);
+	if(errorCode==113) sprintf(msg,"\"%s\" The parameter for constructor is wrong.",tempKeyWord);
+	if(errorCode==114) lstrcpy(msg,"Destructor cannot have a parameter.");
+	if(errorCode==115) lstrcpy(msg,"Constructor and Destructor cannot have a return value.");
+	if(errorCode==116) lstrcpy(msg,"Constructor and Destructor must be public access.");
+	if(errorCode==117) lstrcpy(msg,"Destructors name must be \"~ClassName\".");
+	if(errorCode==118) lstrcpy(msg,"Super class is not found.");
+	if(errorCode==119) sprintf(msg,"\"%s\" The member is not defined in the super class.",tempKeyWord);
+
+	//Enum関連
+	if(errorCode==150) sprintf(msg,"\"%s\" The value is not set",tempKeyWord);
+	if(errorCode==151) sprintf(msg,"\"%s\" is not found from enum lists.",tempKeyWord);
+
+	//リンカ
+	if(errorCode==200) sprintf(msg,"\"%s\" Unknown error.",tempKeyWord);
+#endif
+
+	return msg;
+}
+
+std::string ErrorInfo::GetFullMessageString() const
+{
+	if( sourceLineNum != -1 )
+	{
+		char temporary[1024];
+		sprintf( temporary, "%s(%d) - %s",
+			Jenga::Common::Path( sourceFilePath ).GetFileName().c_str(),
+			sourceLineNum,
+			GetMessageString().c_str()
+			);
+
+		return temporary;
+	}
+
+	return GetMessageString();
+}
+
+void ErrorMessenger::Output( const ErrorInfo &errorInfo )
+{
+	if( errorInfo.GetErrorCode() == 3 )
+	{
+		if( errorInfo.GetKeyword().size() <= 0 )
+		{
+			// ありえない
+			throw;
+		}
+
+		if( Jenga::Common::IsExistString( synonymKeyWords, errorInfo.GetKeyword() ) )
+		{
+			// 既にエラーが出力されている場合は無視
+			return;
+		}
+
+		synonymKeyWords.push_back( errorInfo.GetKeyword() );
+	}
+
+	errorInfos.push_back( errorInfo );
+
+	// 文字列を出力
+	Messenger::Output( errorInfo.GetFullMessageString() );
+}
+void ErrorMessenger::Output( int errorCode, const std::string &keyword, int sourceIndex )
+{
+	Output( ErrorInfo( errorCode, keyword, sourceIndex ) );
+}
+void ErrorMessenger::Output( int errorCode, const char *keyword, int sourceIndex )
+{
+	if( !keyword )
+	{
+		keyword = "";
+	}
+	Output( errorCode, std::string( keyword ), sourceIndex );
+}
+void ErrorMessenger::OutputFatalError()
+{
+	Output( 300, "", cp );
+}
+
+int ErrorMessenger::GetErrorCount() const
+{
+	int count = 0;
+	BOOST_FOREACH( const ErrorInfo &errorInfo, errorInfos )
+	{
+		if( !errorInfo.IsWarning() )
+		{
+			count ++;
+		}
+	}
+	return count;
+}
+bool ErrorMessenger::HasError() const
+{
+	return ( GetErrorCount() > 0 );
+}
+int ErrorMessenger::GetWarningCount() const
+{
+	int count = 0;
+	BOOST_FOREACH( const ErrorInfo &errorInfo, errorInfos )
+	{
+		if( errorInfo.IsWarning() )
+		{
+			count ++;
+		}
+	}
+	return count;
+}
+
+void ErrorMessenger::ShowErrorLine( int errorLineNum )
+{
+	const ErrorInfo *pErrorInfo = NULL;
+	BOOST_FOREACH( const ErrorInfo &errorInfo, errorInfos )
+	{
+		if( errorInfo.GetErrorLineNum() == errorLineNum )
+		{
+			pErrorInfo = &errorInfo;
+			break;
+		}
+	}
+
+	if( !pErrorInfo )
+	{
+		// 該当なし
+		return;
+	}
+	if( pErrorInfo->GetSourceLineNum() == -1 )
+	{
+		return;
+	}
+
+	HANDLE hFile;
+	DWORD dw;
+	char FileName[MAX_PATH];
+	char temporary[MAX_PATH];
+
+	lstrcpy( FileName, pErrorInfo->GetSourceFilePath().c_str() );
+
+	if(IsWindow(hOwnerEditor)){
+		if(FileName){
+
+			while( !IsFileExist( FileName ) ){
+				char temp2[MAX_PATH],temp3[MAX_PATH];
+				_splitpath(FileName,NULL,NULL,temp2,temp3);
+				lstrcat(temp2,temp3);
+
+				sprintf(temporary,"\"%s\" が見つかりません。格納されているディレクトリを指定してください。",temp2);
+				if(!GetFolder(hOwnerEditor,temp3,temporary)) return;
+
+				if(temp3[lstrlen(temp3)-1]!='\\') lstrcat(temp3,"\\");
+
+				sprintf(FileName,"%s%s",temp3,temp2);
+			}
+
+			hFile=CreateFile(
+				( Jenga::Common::Environment::GetAppDir() + "\\pgm.tmp" ).c_str(),
+				GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_TEMPORARY,NULL);
+			WriteFile(hFile,FileName,lstrlen(FileName),&dw,NULL);
+			CloseHandle(hFile);
+
+			SendMessage(hOwnerEditor,WM_SHOWERROR,pErrorInfo->GetSourceLineNum(),0);
+		}
+	}
+}
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/src/Method.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/src/Method.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/src/Method.cpp	(revision 465)
@@ -11,5 +11,5 @@
 	{
 		// Override修飾子が無い状況で基底クラスの実体メソッドをオーバーライドしようとした
-		SetError(127,NULL,cp);
+		compiler.errorMessenger.Output(127,NULL,cp);
 	}
 
@@ -21,9 +21,9 @@
 	{
 		// オーバーライドミス
-		SetError(136, pUserProc->GetName(), cp);
+		compiler.errorMessenger.Output(136, pUserProc->GetName(), cp);
 	}
 	if(this->GetAccessibility() != accessibility )
 	{
-		SetError(128,NULL,cp);
+		compiler.errorMessenger.Output(128,NULL,cp);
 	}
 
@@ -35,5 +35,5 @@
 {
 	// 静的メソッドがコピーコンストラトされることは想定しない
-	SetError();
+	compiler.errorMessenger.OutputFatalError();
 }
 
@@ -160,5 +160,5 @@
 
 			if(pMethod->IsAbstract()){
-				SetError();
+				compiler.errorMessenger.OutputFatalError();
 
 				ppsi[i2]=0;
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/src/NamespaceSupporter.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/src/NamespaceSupporter.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/src/NamespaceSupporter.cpp	(revision 465)
@@ -46,5 +46,5 @@
 		else if( source[i] == 1 && source[i+1] == ESC_ENDNAMESPACE ){
 			if( namespaceScopes.size() <= 0 ){
-				SetError( 12, "End Namespace", i );
+				compiler.errorMessenger.Output( 12, "End Namespace", i );
 				isSuccessful = false;
 			}
@@ -59,5 +59,5 @@
 
 	if( namespaceScopes.size() > 0 ){
-		SetError( 63, NULL, cp );
+		compiler.errorMessenger.Output( 63, NULL, cp );
 		isSuccessful = false;
 	}
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/src/NativeCode.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/src/NativeCode.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/src/NativeCode.cpp	(revision 465)
@@ -4,4 +4,46 @@
 
 #define BREAK_EIP(checkEip)  (obp+0x00401000>=checkEip)
+
+const ::DllProc &Schedule::GetDllProc() const
+{
+	if( type != Schedule::DllProc )
+	{
+		compiler.errorMessenger.OutputFatalError();
+	}
+	return *pDllProc;
+}
+const ::UserProc &Schedule::GetUserProc() const
+{
+	if( !( type == Schedule::UserProc || type == Schedule::AddressOf || type == Schedule::CatchAddress ) )
+	{
+		compiler.errorMessenger.OutputFatalError();
+	}
+	return *pUserProc;
+}
+const ::CClass &Schedule::GetClass() const
+{
+	if( !( type == Schedule::ComVtbl || type == Schedule::Vtbl || type == Schedule::TypeInfo ) )
+	{
+		compiler.errorMessenger.OutputFatalError();
+	}
+	return *pClass;
+}
+
+void Schedule::SpecifyAddressOf()
+{
+	if( type != Schedule::UserProc )
+	{
+		compiler.errorMessenger.OutputFatalError();
+	}
+	type = Schedule::AddressOf;
+}
+void Schedule::SpecifyCatchAddress()
+{
+	if( type != Schedule::UserProc )
+	{
+		compiler.errorMessenger.OutputFatalError();
+	}
+	type = Schedule::CatchAddress;
+}
 
 void NativeCode::PutEx( const NativeCode &nativeCode )
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/src/Parameter.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/src/Parameter.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/src/Parameter.cpp	(revision 465)
@@ -145,5 +145,5 @@
 			if( isRef == false )
 			{
-				SetError(29,NULL,nowLine);
+				compiler.errorMessenger.Output(29,NULL,nowLine);
 			}
 			isArray = true;
@@ -206,5 +206,5 @@
 
 			if( type.IsNull() ){
-				SetError(3,temporary,nowLine);
+				compiler.errorMessenger.Output(3,temporary,nowLine);
 				type.SetBasicType( DEF_PTR_VOID );
 			}
@@ -219,5 +219,5 @@
 		else{
 			type.SetBasicType( Type::GetBasicTypeFromSimpleName(temporary) );
-			SetError(-103,temporary,nowLine);
+			compiler.errorMessenger.Output(-103,temporary,nowLine);
 		}
 
@@ -240,5 +240,5 @@
 		}
 		else{
-			SetError(1,NULL,nowLine);
+			compiler.errorMessenger.Output(1,NULL,nowLine);
 			break;
 		}
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/src/Procedure.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/src/Procedure.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/src/Procedure.cpp	(revision 465)
@@ -105,5 +105,5 @@
 	//パラメータ
 	if(sourceOfParams[i]!='('){
-		SetError(1,NULL,nowLine);
+		compiler.errorMessenger.Output(1,NULL,nowLine);
 		return false;
 	}
@@ -111,5 +111,5 @@
 		//クラスのメンバ関数の場合のみ、デストラクタにパラメータがある場合にエラーをだす
 		if(this->GetName()[0]=='~'){
-			SetError(114,NULL,nowLine);
+			compiler.errorMessenger.Output(114,NULL,nowLine);
 			return false;
 		}
@@ -133,5 +133,5 @@
 			if( !this->IsFunction() ){
 				// Sub/Macroの場合
-				SetError(38,this->GetName(),nowLine);
+				compiler.errorMessenger.Output(38,this->GetName(),nowLine);
 			}
 
@@ -140,5 +140,5 @@
 		else
 		{
-			SetError(1,NULL,nowLine);
+			compiler.errorMessenger.Output(1,NULL,nowLine);
 			return false;
 		}
@@ -199,5 +199,5 @@
 			if( isRef == false )
 			{
-				SetError(29,NULL,nowLine);
+				compiler.errorMessenger.Output(29,NULL,nowLine);
 			}
 			isArray = true;
@@ -248,5 +248,5 @@
 
 			if( type.IsNull() ){
-				SetError(3,temporary,nowLine);
+				compiler.errorMessenger.Output(3,temporary,nowLine);
 				type.SetBasicType( DEF_PTR_VOID );
 			}
@@ -261,5 +261,5 @@
 		else{
 			type.SetBasicType( Type::GetBasicTypeFromSimpleName(name) );
-			SetError(-103,name,nowLine);
+			compiler.errorMessenger.Output(-103,name,nowLine);
 		}
 
@@ -325,5 +325,5 @@
 		if(sw){
 			//配列パラメータ
-			if( isRef == false ) SetError(29,NULL,nowLine);
+			if( isRef == false ) compiler.errorMessenger.Output(29,NULL,nowLine);
 			isArray = true;
 
@@ -389,5 +389,5 @@
 
 			if( type.IsNull() ){
-				SetError(3,temporary,nowLine);
+				compiler.errorMessenger.Output(3,temporary,nowLine);
 				type.SetBasicType( DEF_PTR_VOID );
 			}
@@ -402,5 +402,5 @@
 		else{
 			type.SetBasicType( Type::GetBasicTypeFromSimpleName(temporary) );
-			SetError(-103,temporary,nowLine);
+			compiler.errorMessenger.Output(-103,temporary,nowLine);
 		}
 
@@ -421,5 +421,5 @@
 		if( !this->IsFunction() ){
 			// Sub/Macroの場合
-			SetError(38,this->GetName(),nowLine);
+			compiler.errorMessenger.Output(38,this->GetName(),nowLine);
 		}
 
@@ -428,5 +428,5 @@
 				this->GetName()[0]=='~'){
 				//クラスのコンストラクタ、デストラクタがFunction定義の場合はエラーをだす
-				SetError(115,NULL,nowLine);
+				compiler.errorMessenger.Output(115,NULL,nowLine);
 			}
 		}
@@ -435,5 +435,5 @@
 		if( this->returnType.IsNull() )
 		{
-			SetError(3,returnTypeStr,nowLine);
+			compiler.errorMessenger.Output(3,returnTypeStr,nowLine);
 		}
 	}
@@ -442,5 +442,5 @@
 		{
 			// Function定義なのに、戻り値の型がセットされていない
-			SetError(-104,this->GetName().c_str(),nowLine);
+			compiler.errorMessenger.Output(-104,this->GetName().c_str(),nowLine);
 
 			this->returnType.SetBasicType( DEF_DOUBLE );
@@ -495,5 +495,5 @@
 	{
 		// 重複しているため、失敗
-		SetError(15,pUserProc->GetName().c_str(),nowLine);
+		compiler.errorMessenger.Output(15,pUserProc->GetName().c_str(),nowLine);
 		return false;
 	}
@@ -536,5 +536,5 @@
 	if(buffer[i]==1&&buffer[i+1]==ESC_OPERATOR){
 		if(!pobj_c){
-			SetError(126,NULL,nowLine);
+			compiler.errorMessenger.Output(126,NULL,nowLine);
 			return 0;
 		}
@@ -570,5 +570,5 @@
 		}
 		if(!iCalcId){
-			SetError(1,NULL,nowLine);
+			compiler.errorMessenger.Output(1,NULL,nowLine);
 			return 0;
 		}
@@ -608,5 +608,5 @@
 				else
 				{
-					SetError();
+					compiler.errorMessenger.OutputFatalError();
 					return NULL;
 				}
@@ -615,5 +615,5 @@
 				if( SplitMemberName( memberName, parentName, dummyMemberName, refKind ) )
 				{
-					SetError(69,temporary,nowLine);
+					compiler.errorMessenger.Output(69,temporary,nowLine);
 					return NULL;
 				}
@@ -621,5 +621,5 @@
 			else
 			{
-				SetError(68,temporary,nowLine);
+				compiler.errorMessenger.Output(68,temporary,nowLine);
 				return NULL;
 			}
@@ -642,5 +642,5 @@
 
 		if(GetDeclareHash(temporary)){
-			SetError(15,temporary,nowLine);
+			compiler.errorMessenger.Output(15,temporary,nowLine);
 			return 0;
 		}
@@ -715,5 +715,5 @@
 	//パラメータ
 	if(sourceOfParams[i]!='('){
-		SetError(1,NULL,nowLine);
+		compiler.errorMessenger.Output(1,NULL,nowLine);
 		return 0;
 	}
@@ -765,5 +765,5 @@
 		if(sw){
 			//配列パラメータ
-			if( isRef == false ) SetError(29,NULL,nowLine);
+			if( isRef == false ) compiler.errorMessenger.Output(29,NULL,nowLine);
 			isArray = true;
 
@@ -811,5 +811,5 @@
 
 			if( type.IsNull() ){
-				SetError(3,temporary,nowLine);
+				compiler.errorMessenger.Output(3,temporary,nowLine);
 				type.SetBasicType( DEF_PTR_VOID );
 			}
@@ -817,5 +817,5 @@
 		else{
 			type.SetBasicType( Type::GetBasicTypeFromSimpleName(temporary) );
-			SetError(-103,temporary,nowLine);
+			compiler.errorMessenger.Output(-103,temporary,nowLine);
 		}
 
@@ -834,5 +834,5 @@
 		else if(sourceOfParams[i]==')') continue;
 		else{
-			SetError(1,NULL,nowLine);
+			compiler.errorMessenger.Output(1,NULL,nowLine);
 			break;
 		}
@@ -863,5 +863,5 @@
 				}
 				compiler.StringToType( temporary, this->returnType );
-				if( this->returnType.IsNull() ) SetError(3,temporary,nowLine);
+				if( this->returnType.IsNull() ) compiler.errorMessenger.Output(3,temporary,nowLine);
 
 				sw_as=1;
@@ -891,5 +891,5 @@
 	}
 	else{
-		SetError(1,NULL,nowLine);
+		compiler.errorMessenger.Output(1,NULL,nowLine);
 		return;
 	}
@@ -912,5 +912,5 @@
 		}
 		if(buffer[i]=='\0'){
-			SetError(1,NULL,nowLine);
+			compiler.errorMessenger.Output(1,NULL,nowLine);
 			return;
 		}
@@ -921,5 +921,5 @@
 	//ユーザー定義関数との重複チェック
 	if(GetSubHash(procName)){
-		SetError(15,procName,nowLine);
+		compiler.errorMessenger.Output(15,procName,nowLine);
 		return;
 	}
@@ -935,5 +935,5 @@
 	}
 	if( resultType.GetBasicType() != typeOfPtrChar ){
-		SetError(1,NULL,nowLine);
+		compiler.errorMessenger.Output(1,NULL,nowLine);
 		return;
 	}
@@ -943,5 +943,5 @@
 		lstrcat(dllFileName,".DLL");
 		if(lstrlen(dllFileName)>=16){
-			SetError(7,NULL,nowLine);
+			compiler.errorMessenger.Output(7,NULL,nowLine);
 			return;
 		}
@@ -956,5 +956,5 @@
 		}
 		if( resultType.GetBasicType() != typeOfPtrChar ){
-			SetError(1,NULL,nowLine);
+			compiler.errorMessenger.Output(1,NULL,nowLine);
 			return;
 		}
@@ -977,9 +977,9 @@
 	BOOST_FOREACH( const Parameter *pParam, pDllProc->Params() ){
 		if( pParam->IsObject() ){
-			SetError(25,pParam->GetVarName(),nowLine);
+			compiler.errorMessenger.Output(25,pParam->GetVarName(),nowLine);
 		}
 		if( !pParam->IsRef() ){
 			if( pParam->IsStruct() ){
-				SetError(28,pParam->GetVarName(),nowLine);
+				compiler.errorMessenger.Output(28,pParam->GetVarName(),nowLine);
 			}
 		}
@@ -992,5 +992,5 @@
 		if( pDllProc->ReturnType().IsObject() ){
 			// DLL関数ではオブジェクトを戻り値にできない
-			SetError(40,pDllProc->GetName(),nowLine);
+			compiler.errorMessenger.Output(40,pDllProc->GetName(),nowLine);
 		}
 	}
@@ -1010,5 +1010,5 @@
 	//パラメータ
 	if(sourceOfParams[i]!='('){
-		SetError(1,NULL,nowLine);
+		compiler.errorMessenger.Output(1,NULL,nowLine);
 		return 0;
 	}
@@ -1059,5 +1059,5 @@
 		if(sw){
 			//配列パラメータ
-			if( isRef == false ) SetError(29,NULL,nowLine);
+			if( isRef == false ) compiler.errorMessenger.Output(29,NULL,nowLine);
 			isArray = true;
 
@@ -1104,5 +1104,5 @@
 
 			if( type.IsNull() ){
-				SetError(3,temporary,nowLine);
+				compiler.errorMessenger.Output(3,temporary,nowLine);
 				type.SetBasicType( DEF_PTR_VOID );
 			}
@@ -1110,5 +1110,5 @@
 		else{
 			type.SetBasicType( Type::GetBasicTypeFromSimpleName(temporary) );
-			SetError(-103,temporary,nowLine);
+			compiler.errorMessenger.Output(-103,temporary,nowLine);
 		}
 
@@ -1127,5 +1127,5 @@
 		else if(sourceOfParams[i]==')') continue;
 		else{
-			SetError(1,NULL,nowLine);
+			compiler.errorMessenger.Output(1,NULL,nowLine);
 			break;
 		}
@@ -1156,5 +1156,5 @@
 				}
 				compiler.StringToType( temporary, this->returnType );
-				if( this->returnType.IsNull() ) SetError(3,temporary,nowLine);
+				if( this->returnType.IsNull() ) compiler.errorMessenger.Output(3,temporary,nowLine);
 
 				sw_as=1;
@@ -1174,5 +1174,5 @@
 		if( this->ReturnType().IsNull() ){
 			// 戻り値がない
-			SetError(26,this->GetName(),nowLine);
+			compiler.errorMessenger.Output(26,this->GetName(),nowLine);
 		}
 	}
@@ -1180,5 +1180,5 @@
 		if( !this->ReturnType().IsNull() ){
 			// Sub定義なのに、戻り値がある
-			SetError(38,this->GetName(),nowLine);
+			compiler.errorMessenger.Output(38,this->GetName(),nowLine);
 		}
 	}
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/src/Source.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/src/Source.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/src/Source.cpp	(revision 465)
@@ -678,5 +678,5 @@
 				if( !source.ReadFile_InIncludeDirective( temporary ) ){
 					sprintf(temp2,"インクルードファイル \"%s\" をオープンできません",temporary);
-					SetError(-1,temp2,i);
+					compiler.errorMessenger.Output(-1,temp2,i);
 					break;
 				}
@@ -920,5 +920,5 @@
 	for( int i=0; genBuffer[i] ; i++ ){
 		if( genBuffer[i] == '\n' ){
-			SetError();
+			compiler.errorMessenger.OutputFatalError();
 			break;
 		}
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/src/Type.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/src/Type.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/src/Type.cpp	(revision 465)
@@ -116,5 +116,5 @@
 	}
 
-	SetError();
+	compiler.errorMessenger.OutputFatalError();
 
 	return 0;
@@ -219,5 +219,5 @@
 	{
 		if( !pClass ){
-			SetError();
+			compiler.errorMessenger.OutputFatalError();
 			return 0;
 		}
@@ -232,5 +232,5 @@
 	}
 
-	SetError();
+	compiler.errorMessenger.OutputFatalError();
 	return 0;
 }
Index: /trunk/ab5.0/abdev/BasicCompiler_Common/src/TypeDef.cpp
===================================================================
--- /trunk/ab5.0/abdev/BasicCompiler_Common/src/TypeDef.cpp	(revision 464)
+++ /trunk/ab5.0/abdev/BasicCompiler_Common/src/TypeDef.cpp	(revision 465)
@@ -10,5 +10,5 @@
 {
 	if( !compiler.StringToType( baseName, baseType ) ){
-		SetError(3, baseName, nowLine );
+		compiler.errorMessenger.Output(3, baseName, nowLine );
 		return;
 	}
@@ -87,5 +87,5 @@
 
 	if(expression[i]!='='){
-		SetError(10,"TypeDef",nowLine);
+		compiler.errorMessenger.Output(10,"TypeDef",nowLine);
 		return;
 	}
@@ -98,5 +98,5 @@
 		if(temporary[i]=='\0') break;
 		if( !( IsVariableChar( temporary[i], true) ) ){
-			SetError(10,"TypeDef",nowLine);
+			compiler.errorMessenger.Output(10,"TypeDef",nowLine);
 			return;
 		}
@@ -107,5 +107,5 @@
 		//関数ポインタ
 		if(pTemp[3]!='('){
-			SetError(10,"TypeDef",nowLine);
+			compiler.errorMessenger.Output(10,"TypeDef",nowLine);
 			return;
 		}
@@ -118,5 +118,5 @@
 			if( !( IsVariableChar( pTemp[i], true) ) )
 			{
-				SetError(10,"TypeDef",nowLine);
+				compiler.errorMessenger.Output(10,"TypeDef",nowLine);
 				return;
 			}
@@ -126,5 +126,5 @@
 	//識別子が重複している場合はエラーにする
 	if(lstrcmp(temporary,pTemp)==0){
-		SetError(1,NULL,nowLine);
+		compiler.errorMessenger.Output(1,NULL,nowLine);
 		return;
 	}
@@ -170,5 +170,5 @@
 		else if( basbuf[i] == 1 && basbuf[i+1] == ESC_ENDNAMESPACE ){
 			if( namespaceScopes.size() <= 0 ){
-				SetError(12, "End Namespace", i );
+				compiler.errorMessenger.Output(12, "End Namespace", i );
 			}
 			else{
@@ -189,5 +189,5 @@
 			if( !compiler.GetNamespaceSupporter().ImportsNamespace( temporary ) )
 			{
-				SetError(64,temporary,i );
+				compiler.errorMessenger.Output(64,temporary,i );
 			}
 
Index: /trunk/ab5.0/jenga/include/common/String.h
===================================================================
--- /trunk/ab5.0/jenga/include/common/String.h	(revision 464)
+++ /trunk/ab5.0/jenga/include/common/String.h	(revision 465)
@@ -9,4 +9,6 @@
 typedef std::vector<std::string> Strings;
 
+bool IsExistString( const Jenga::Common::Strings &strings, const std::string &findStr );
+
 }
 }
Index: /trunk/ab5.0/jenga/projects/common/common.vcproj
===================================================================
--- /trunk/ab5.0/jenga/projects/common/common.vcproj	(revision 464)
+++ /trunk/ab5.0/jenga/projects/common/common.vcproj	(revision 465)
@@ -297,4 +297,8 @@
 				>
 			</File>
+			<File
+				RelativePath="..\..\src\common\String.cpp"
+				>
+			</File>
 		</Filter>
 		<Filter
Index: /trunk/ab5.0/jenga/src/common/String.cpp
===================================================================
--- /trunk/ab5.0/jenga/src/common/String.cpp	(revision 465)
+++ /trunk/ab5.0/jenga/src/common/String.cpp	(revision 465)
@@ -0,0 +1,15 @@
+#include <boost/foreach.hpp>
+#include <jenga/include/common/String.h>
+
+
+bool Jenga::Common::IsExistString( const Jenga::Common::Strings &strings, const std::string &findStr )
+{
+	BOOST_FOREACH( const std::string &str, strings )
+	{
+		if( str == findStr )
+		{
+			return true;
+		}
+	}
+	return false;
+}
