示例#1
0
void LuaParser::AddString(int key, const string& value)
{
	if ((L == NULL) || (initDepth < 0)) { return; }
	lua_pushnumber(L, key);
	lua_pushstring(L, value.c_str());
	PushParam();
}
示例#2
0
void LuaParser::AddBool(int key, bool value)
{
	if ((L == NULL) || (initDepth < 0)) { return; }
	lua_pushnumber(L, key);
	lua_pushboolean(L, value);
	PushParam();
}
示例#3
0
void LuaParser::AddFloat(int key, float value)
{
	if ((L == NULL) || (initDepth < 0)) { return; }
	lua_pushnumber(L, key);
	lua_pushnumber(L, value);
	PushParam();
}
示例#4
0
void LuaParser::AddFloat(const string& key, float value)
{
	if ((L == NULL) || (initDepth < 0)) { return; }
	lua_pushstring(L, key.c_str());
	lua_pushnumber(L, value);
	PushParam();
}
示例#5
0
void LuaParser::AddBool(const string& key, bool value)
{
	if ((L == NULL) || (initDepth < 0)) { return; }
	lua_pushstring(L, key.c_str());
	lua_pushboolean(L, value);
	PushParam();
}
示例#6
0
void LuaParser::EndTable()
{
	if ((L == NULL) || (initDepth < 0)) { return; }
	assert(initDepth > 0);
	initDepth--;
	PushParam();
}
示例#7
0
void LuaParser::AddFunc(int key, int (*func)(lua_State*))
{
	if ((L == NULL) || (initDepth < 0)) { return; }
	if (func == NULL) { return; }
	lua_pushnumber(L, key);
	lua_pushcfunction(L, func);
	PushParam();
}
示例#8
0
void LuaParser::AddFunc(const string& key, int (*func)(lua_State*))
{
	if ((L == NULL) || (initDepth < 0)) { return; }
	if (func == NULL) { return; }
	lua_pushstring(L, key.c_str());
	lua_pushcfunction(L, func);
	PushParam();
}
示例#9
0
void PushParam(TreeNode* pnode){
	if (pnode->sibling!=NULL){
		PushParam(pnode->sibling);
	}

	HandleNodeExp(pnode);
	EMITCODE("pushl %eax\n");
}
示例#10
0
void HandleProcExc(TreeNode* pnode){
	ProcList varList=procListLookup(pnode->attr.name);
	PushParam(pnode->child[0]);
	EMITCODE("pushl %ecx\n");  
	EMITCODE("movl %esp, %ecx\n");
	sprintf(tmp, "call %s\n", pnode->attr.name);
	EMITCODE(tmp);
	EMITCODE("popl %ecx\n");
	PopParam(pnode->child[0],varList->paraList);
}