diff Bison-Flex/Compiler-StackBase/UTF8/compiler.cpp @ 6:86c0a38332fe

update
author nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
date Tue, 17 May 2011 18:26:00 +0900
parents caede627f691
children
line wrap: on
line diff
--- a/Bison-Flex/Compiler-StackBase/UTF8/compiler.cpp	Tue May 17 12:45:07 2011 +0900
+++ b/Bison-Flex/Compiler-StackBase/UTF8/compiler.cpp	Tue May 17 18:26:00 2011 +0900
@@ -260,7 +260,6 @@
 		if (tag == 0)
 			error(l, "内部エラー:関数テーブルに登録できません");
 	}
-
 	current_function_name = *name;		// 処理中の関数名を登録しておく
 	current_function_type = type;		// 処理中の関数型を登録しておく
 										// 関数内関数(入れ子構造)は無いので、
@@ -270,8 +269,6 @@
 
 	SetLabel(tag->GetIndex());
 
-	//	BlockIn();		// 変数スタックを増やす
-
 	// 引数があれば、引数リストを登録
 	if (args) {
 		args->for_each_rev(add_value(this, variables.back()));
@@ -284,10 +281,20 @@
 
 	const CVMCode &code = statement.back();
 
+	current_function_name.clear();		// 処理中の関数名を消去
 
-	current_function_name.clear();		// 処理中の関数名を消去
+	OpHalt();
+
 }
 
+void compiler::AddExit(const yy::location& l, int type)
+{
+  //  OpExit();
+  OpHalt();
+}
+
+
+
 // 変数の登録
 
 void compiler::AddValue(const yy::location& l, int type, const std::string &name, const CNode *node)
@@ -309,6 +316,9 @@
 	}
 }
 
+
+
+
 // ラベル生成
 
 int compiler::MakeLabel()