public override string CodeOutput(int level) { string Code = ""; string levelString = new string('\t', level); Dictionary <string, string> CheckDic = Util.GetVariableType(this); if (comboBox1.SelectedIndex != -1) { List <string> vList = Util.GetVariableList(this, 0); if (comboBox2.SelectedIndex != -1) { if (vList.Contains(comboBox1.Text) && vList.Contains(comboBox2.Text)) { if (CheckDic[comboBox1.Text] == CheckDic[comboBox2.Text]) { if (Util.VariableConfirmation(this).Contains(comboBox2.Text) == false) { Form1.MessageBoxValue("条件で使われている変数は未割当です", true); } Code = levelString + comboBox1.Text + " = " + comboBox2.Text + ";\r\n"; } else { Form1.MessageBoxValue("型が異なります", true); } } else { Form1.MessageBoxValue("未宣言の変数が使われています", true); } } else { if (checkBox1.Checked) { if (vList.Contains(comboBox1.Text)) { if (CheckDic[comboBox1.Text] == "string") { Code = levelString + comboBox1.Text + " = \"" + comboBox2.Text + "\";\r\n"; } else if (CheckDic[comboBox1.Text] == "char") { Code = levelString + comboBox1.Text + " = \'" + comboBox2.Text + "\';\r\n"; } else { Code = levelString + comboBox1.Text + " = " + comboBox2.Text + ";\r\n"; } } else { Form1.MessageBoxValue("未宣言の変数が使われています", true); } } else { Form1.MessageBoxValue("型が異なります", true); } } } else { Form1.MessageBoxValue("代入される変数が入力されていません", true); } return(Code); }