//--------------------------------------------------------------------------------------
//
// X-BASIC'
// 	エラー定義(英語)
//
//--------------------------------------------------------------------------------------

#ifndef	__XB_ERRORE__
#define __XB_ERRORE__	1

#include "XBdefines.h"

//--------------------------------------------------------------------------------------

#ifdef FROM_ERR_C	// Cソース生成時
#define	EXTERNe	// EXTERNe宣言を消し、実体確保する
#else			// ヘッダー生成時
#define	EXTERNe	extern
#endif

//-------------------------------------------------------------------

EXTERNe	const char *errorMesE[]
#ifdef FROM_ERR_C
={	// XB_ERRORNOと合わせること
// 正常終了
	"OK.",
	
	// 発生位置が特定できないエラー/ソース外で発生するエラー
	"endenum is none.",
	"'endfunc' is none.",
	"nest is not closed.",
	
	//----------------------------------------
	"区分け用コード",
	//----------------------------------------

// 内部エラー系
	"System error.",
	"External function's parameter table is illegal.",
	"Workarea can't allocate.",
	"Internal code area can't expand.",
	"Workarea can't expand.",
	"Nestwork overflow.",

// 実行時エラー
	"Zero devide.",
	"This operator can't use for float.",
	"String can use only '+'(add) operator.",
	"Formula types are unmatch.",
	"'dim' illegal.",
	"Array element count is too much (1dimension).",
	"Array dimension is too much.",
	"Array element count is minus.",
	"Over max string length.",
	"Illegal position in the string.",
	"Illega parameter in function.",
	"External function's parameter list is illegal.",
	"Error in external function.",
	"Too much variables or arrays.",
	"Too much recursive call.",

// 以下コンパイル時エラー
	// 文法エラー
	"Non support statement.",
	"Syntax error.",
	"'exit' error.",
	"'for' error.",
	"'func' error.",
	"'if' error.",
	"'input'/'linput' error.",
	"'return' error.",
	"'label' error.",
	"No ';' after 'using'.",
	"Array is not close with ')'.",
	"Too mush source lines.",
	
	// パラメーターエラー
	"Not enough statement's parameter.",
	"Illegal using format.",
	
	// 制御構文系
	"'next' is none corresponding with 'for'.",
	"'then'/'else' without 'if'.",
	"'endwhile' is none corresponding with 'while'.",
	"'until' is none corresponding with 'repeat'.",
	"'case'/'default'/'endswitch' without 'switch'.",
	"'case' is not placed after 'default'.",
//	 01234567890123456789012345|これの倍の長さをerrorView.frame.size.widthに取る
	"'default' is not placed after 'default'.",
//	 0123456789012345678901234501234567890123456789012345
	"'switch' need at least one 'case'.",
	"There is 'continue' within 'switch'.",
	"Too mush 'break' in one 'switch'.",
	"nest is not closed.",
	"'break'/'continue' without nest structure.",
	"There is 'func' without 'end'.",
	
	// 関数系
	"function name double definition.",
	"function's parameter is too much.",
	"function's parameter is not enough.",
	"Array can't use at function's parameter.",
	"Array's dimension is unmatch.",
	"Array's dimension in function is unmatch.",
	"'endfunc' is none.",
	"'endfunc'/'return' without 'func'.",
	"void function has no return value.",
	"No return value to the type other than 'int'.",
//	 0123456789012345678901234501234567890123456789012345
	"goto out of function.",
	"'goto' illegal.",
	"'func' is too much.",
	
	// 式系
	"variable type is unmatch.",
	"formula illegal.",
	"number illegal.",
	"Too many string variables.",
	"Over the max string length.",
	"Can't store to system variable.",
	"Too much names.",
	
	// 宣言系
	"Undefined variable.",
	"Variable is defines with no 'int'.",
	"Variable name is redefinition.",
	"Illegal variable definition.",
	"Variable name is same as statement.",
	"Variable name is same as functions.",
	"Variable name is same as enum constant.",	// v3.00
	"label double definition.",
	"Type is not specified.",
	
	// 配列系
	"Undefined function/array.",
	"Array is defined with no 'dim'.",
	"Too much array's element count.",
	"Array's element count is not enough.",
	"Array's element count specifies only constant.",
	"Array's element count is none.",
	"Too much array's total element count.",
	"Over the max dimension.",
	"Can't use variable length array in grobal area.",
//	 0123456789012345678901234501234567890123456789012345
	
	// 定数処理
	"Enum format error.",
	"Enum name is same as statement.",
	"Enum name is same as functions.",
	"Enum name is redefinition.",
	"endenum is none.",
	"'endenum' without 'enum'.",
}
#endif
;

//-------------------------------------------------------------------

EXTERNe	const char *warnMesE[]
#ifdef FROM_ERR_C
={	// XB_WARNNOと合わせること
	// 正常終了
	"OK.",
	//
	"Input types are unmatch.",
	"Number syntax is illegal.",
}
#endif
;

//-------------------------------------------------------------------

#endif
