Exemplo n.º 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();
}
Exemplo n.º 2
0
void LuaParser::AddBool(int key, bool value)
{
	if ((L == NULL) || (initDepth < 0)) { return; }
	lua_pushnumber(L, key);
	lua_pushboolean(L, value);
	PushParam();
}
Exemplo n.º 3
0
void LuaParser::AddFloat(int key, float value)
{
	if ((L == NULL) || (initDepth < 0)) { return; }
	lua_pushnumber(L, key);
	lua_pushnumber(L, value);
	PushParam();
}
Exemplo n.º 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();
}
Exemplo n.º 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();
}
Exemplo n.º 6
0
void LuaParser::EndTable()
{
	if ((L == NULL) || (initDepth < 0)) { return; }
	assert(initDepth > 0);
	initDepth--;
	PushParam();
}
Exemplo n.º 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();
}
Exemplo n.º 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();
}
Exemplo n.º 9
0
void PushParam(TreeNode* pnode){
	if (pnode->sibling!=NULL){
		PushParam(pnode->sibling);
	}

	HandleNodeExp(pnode);
	EMITCODE("pushl %eax\n");
}
Exemplo 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);
}