minChars = 128;
class Compile
{
	clearNewLines = 0;
//	indenting = -1;	//no indenting
	rewriteFile = 1; //append result to the proper place in the file, do not rewrite it

	class Pass_States
	{
		iffinal_no = -1;

		print_pass1 = "private [""_fsmMode"",""_fsmId"",""_params"",""_fsmModes"",""_task"",""_taskState""];\n";
		print_passParam0 = "_fsmMode = [_this,0,"""",[""""]] call bis_fnc_param;\n";
		print_passParam1 = "_fsmId = [_this,1,0,[0]] call bis_fnc_param;\n";
		print_passParam2 = "_params = [_this,2,[],[[]]] call bis_fnc_param;\n";
		print_pass4 = "_fsmModes = [_fsmMode];";
		print_pass5 = "\nwhile {count _fsmModes > 0} do {\n";
		indent_pass1 = 4;


		print_pass6 = "switch (_fsmModes select 0) do\n{\n";
		indent_pass2 = 8;

		class State_Start
		{
			ifstart_yes = 1;
			print_state1 = "case %qt(statetext):\n{\n";
			indent_state1 = 12;
			print_state2 = "_task = %qt(statetext) + ""_"" + str _fsmId;\n";
			print_state3 = "_taskState = if (_task call bis_fnc_taskExists) then {_task call bis_fnc_taskstate} else {""""};\n";
			print_state4 = "_fsmModes = _fsmModes - [%qt(statetext)];\n";

			ifstart_no = -1;
			print_state5 = "case ""STATE_%(statename)"":\n{\n";
			indent_state2 = 12;
			print_state6 = "_fsmModes = _fsmModes - [""STATE_%(statename)""];\n";

			ifstart_both = 0;
			print_state7 = "%(stateinit)\n";
			print_state8 = "switch true do {\n";
			indent_state3 = 16;

			class Links_1
			{
				indent_state1 = 0;
				print_link1 = "case (call {%(condition)}): {\n";
				indent_state2 = 20;
				print_link2 = "_fsmModes = _fsmModes + [""STATE_%(to)""];\n";
				indent_state3 = 16;
				print_link3 = "};\n";
			};

			indent_state4 = 12;
			print_state9 = "};\n";
			indent_state5 = 8;
			print_state10 = "};\n";
		};
		print_state7 = "default {_fsmModes = []; [""Could not find task '%%1'"",_fsmMode] call bis_fnc_error;};\n";

		indent_pass3 = 4;
		print_pass8 = "};\n";
		indent_pass4 = 0;
		print_pass9 = "};";
	};
};

class Decompile
{
	process = 1;	 //0 for not processing Decompile info
	FSMLeft	= "/*";
	FSMRight = "*/";
	class FSMPrefix
	{
		default = "";
	};
	class FSMPrefix2
	{
		default = "";
		head = "*/";
		condition = "\n";
		stateinit = "\n";
		action = "\n";
		privateVariables = "\n";
	};
	class FSMSufix
	{
		default = "";
		compile = "\n";
		condition = "\n";
		stateinit = "\n";
		action = "\n";
		state = "\n";
		head = "\n/*\n";
		link = "\n";
		privateVariables = "\n";
	};
	class FSMSufix2
	{
		default = "";
		compile = "";
		state = "\n";
		head = "\n";
		link = "\n";
	};
};