本文整理汇总了C++中ABLModulePtr::getPrevState方法的典型用法代码示例。如果您正苦于以下问题:C++ ABLModulePtr::getPrevState方法的具体用法?C++ ABLModulePtr::getPrevState怎么用?C++ ABLModulePtr::getPrevState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ABLModulePtr
的用法示例。
在下文中一共展示了ABLModulePtr::getPrevState方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: execTransBackStatement
void execTransBackStatement(void)
{
SymTableNodePtr prevState = CurModule->getPrevState();
if(!prevState)
runtimeError(ABL_ERR_RUNTIME_NULL_PREVSTATE);
transState(prevState);
getCodeToken();
}
示例2: execute
void execute(SymTableNodePtr routineIdPtr)
{
SymTableNodePtr thisRoutineIdPtr = CurRoutineIdPtr;
CurRoutineIdPtr = routineIdPtr;
routineEntry(routineIdPtr);
//----------------------------------------------------
// Now, search this module for the function we want...
if(CallModuleInit)
{
CallModuleInit = false;
SymTableNodePtr initFunctionIdPtr = searchSymTable("init", ModuleRegistry[CurModule->getHandle()].moduleIdPtr->defn.info.routine.localSymTable);
if(initFunctionIdPtr)
{
execRoutineCall(initFunctionIdPtr, false);
//-------------------------------------------------------------------------
// Since we're calling the function directly, we need to compensate for the
// codeSegmentPtr being incremented by 1 in the normal execRoutineCall...
codeSegmentPtr--;
}
}
if(routineIdPtr->defn.info.routine.flags & ROUTINE_FLAG_FSM)
{
NewStateSet = true;
static char stateList[60][256];
strcpy(SetStateDebugStr, "--");
while(NewStateSet)
{
NumStateTransitions++;
sprintf(stateList[NumStateTransitions], "%s (%s)", CurModule->getState()->name, SetStateDebugStr);
if(NumStateTransitions == 50)
{
UserFile* userFile = UserFile::getNewFile();
char errStr[512];
if(userFile)
{
int32_t err = userFile->open("endless.log");
if(!err)
{
//char s[1024];
//sprintf(s, "Current Date: %s\n", GetTime());
//userFile->write(s);
userFile->write(ModuleRegistry[CurModule->getHandle()].fileName);
for(size_t i = 1; i < 51; i++)
userFile->write(stateList[i]);
userFile->write(" ");
if(ABLEndlessStateCallback)
(*ABLEndlessStateCallback)(userFile);
userFile->close();
}
}
sprintf(errStr, " ABL endless state loop in %s [%s:%s] ", ModuleRegistry[CurModule->getHandle()].fileName, CurModule->getState()->name, CurModule->getPrevState()->name);
#if 0
ABL_Fatal(NumStateTransitions, errStr);
#else
NewStateSet = false;
#endif
}
else
{
NewStateSet = false;
SymTableNodePtr curState = CurModule->getState();
if(!curState)
ABL_Fatal(0, " ABL.execute: nullptr state in FSM ");
execRoutineCall(curState, false);
codeSegmentPtr--;
}
//---------------------------------------------
// In case we exited with a return statement...
ExitWithReturn = false;
ExitFromTacOrder = false;
}
}
else
{
getCodeToken();
execStatement();
//---------------------------------------------
// In case we exited with a return statement...
ExitWithReturn = false;
ExitFromTacOrder = false;
}
routineExit(routineIdPtr);
CurRoutineIdPtr = thisRoutineIdPtr;
}