⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 flwparser.cpp

📁 flwscript解析器
💻 CPP
📖 第 1 页 / 共 5 页
字号:
			MakeFunction(nIndex,LP_FLW_FUNCTION_SQLCOMMAND);
			MakeSqlCommand(nIndex,l,szgo2);
			//Ivr[nChan].m_nConnID=l;
			//strcpy(Ivr[nChan].m_szSql,szgo2);
			//SqlCommand_Send(nChan);
		}
		break;
	}
}


void InternalOperateKeyWords(int nChnID,int op)
{
	int nIndex = ChnMapTable[nChnID].m_nIndex;
	char sztemp[1024]="",szgo1[1000]="",szgo2[1000]="",szop[100]="";
	char* p1=NULL,*p2=NULL;
	char szlog[1024]="";
	
	//char *pStmt = GetLine(g_pstChnInfo[nIndex].m_nFlwID,g_pstChnInfo[nIndex].m_iCurrentLine,nIndex);
	if(g_pstChnInfo[nIndex].m_pStmt==NULL)
	{		
		MAKEHANGUPRESULT()
		return ;
	}
	
	switch (op)
	{
	case 20001: //NSTATE state define
		//sprintf(szlog,"开始状态 -->%s Level = %d ",pStmt,Ivr[nChan].m_iStringVarLevel);
		//LogMesg(nChan,szlog,INFOOUTPUT,THIS_FILE, __LINE__);
		g_pstChnInfo[nIndex].m_iNextStateLine = -1;
		g_pstChnInfo[nIndex].m_iTimeoutProcLine = g_pstChnInfo[nIndex].m_iCurrentLine; //第一个state
		break;
	case 20002: //NSINIT init
		g_pstChnInfo[nIndex].m_iNextStateLine = -1;
		g_pstChnInfo[nIndex].m_nInitOK =1;
		break;
	case 20003:	//NSPROC proc
		break;
	case 20004: //ICHEAP {
		IncreaseVarHeap(nChnID);
		break;
	case 20005: //DEHEAP }
		DecreaseVarHeap(nChnID);
		break;
	case 20006: //RESULT 	go00001	go00002 
		sprintf(sztemp,"%s",g_pstChnInfo[nIndex].m_pStmt);
		sscanf(sztemp,"%s %s %s",szop,szgo1,szgo2);
		if(g_pstChnInfo[nIndex].m_iIfResult==1)
		{	
			g_pstChnInfo[nIndex].m_iCurrentLine=atoi(szgo1);
			g_pstChnInfo[nIndex].m_iCurrentLine--;
		}
		else
		{
			g_pstChnInfo[nIndex].m_iCurrentLine=atoi(szgo2);
			g_pstChnInfo[nIndex].m_iCurrentLine--;
		}
		break;
	case 20007:	//TESTIF
		sprintf(sztemp,"%s",g_pstChnInfo[nIndex].m_pStmt);
		sscanf(sztemp,"%s %s %s",szop,szgo1,szgo2);
		if(g_pstChnInfo[nIndex].m_iIfResult==1)
		{
			g_pstChnInfo[nIndex].m_iCurrentLine=atoi(szgo2);
			g_pstChnInfo[nIndex].m_iCurrentLine--;
		}
		else
		{
			g_pstChnInfo[nIndex].m_iCurrentLine=atoi(szgo1);
			g_pstChnInfo[nIndex].m_iCurrentLine--;
		}
		break;
	case 20008: //NELSE     NELSE	go00007
		sprintf(sztemp,"%s",g_pstChnInfo[nIndex].m_pStmt);
		sscanf(sztemp,"%s %s",szop,szgo1);
		if(g_pstChnInfo[nIndex].m_iIfResult==1)
		{
			g_pstChnInfo[nIndex].m_iCurrentLine=atoi(szgo1);
			g_pstChnInfo[nIndex].m_iCurrentLine--;
		}
		break;
	case 20009: //TESTSF 判断以前的测试结果,
		sprintf(sztemp,"%s",g_pstChnInfo[nIndex].m_pStmt);
		sscanf(sztemp,"%s %s %s",szop,szgo1,szgo2);
		if(g_pstChnInfo[nIndex].m_iIfResult==1)
		{
			g_pstChnInfo[nIndex].m_iCurrentLine=atoi(szgo2);
			g_pstChnInfo[nIndex].m_iCurrentLine--;
		}
		else
		{
			g_pstChnInfo[nIndex].m_iCurrentLine=atoi(szgo1);
			g_pstChnInfo[nIndex].m_iCurrentLine--;
		}
		break;
	case 20010: //CASERESULT  CASERESULT	go00011	go00012
		sprintf(sztemp,"%s",g_pstChnInfo[nIndex].m_pStmt);
		sscanf(sztemp,"%s %s %s",szop,szgo1,szgo2);
		if(g_pstChnInfo[nIndex].m_iIfResult==1)
		{
			g_pstChnInfo[nIndex].m_iCurrentLine=atoi(szgo1);
			g_pstChnInfo[nIndex].m_iCurrentLine--;
		}
		else
		{
			g_pstChnInfo[nIndex].m_iCurrentLine=atoi(szgo2);
			g_pstChnInfo[nIndex].m_iCurrentLine--;
		}
		break;
	case 20011:	//CASESF 字符串比较
		sprintf(sztemp,"%s",g_pstChnInfo[nIndex].m_pStmt);
		sscanf(sztemp,"%s %s",szop,szgo1);
		p1 = LookStringTable(nChnID,szgo1);
		if(p1==NULL)
		{
			MAKEHANGUPRESULT()
			return ;
		}
		g_pstChnInfo[nIndex].m_iCurrentLine++;
		p2=GetLine(g_pstChnInfo[nIndex].m_nFlwID,g_pstChnInfo[nIndex].m_iCurrentLine,nIndex);
		if(p2==NULL)
		{
			MAKEHANGUPRESULT()
			return ;
		}
		if(strcmp(p1,p2)==0)
		{
			g_pstChnInfo[nIndex].m_iIfResult=1;
		}
		else
		{
			g_pstChnInfo[nIndex].m_iIfResult=0;
		}
		break;
	case 20012://CASEGOTO  CASEGOTO	go00008
		sprintf(sztemp,"%s",g_pstChnInfo[nIndex].m_pStmt);
		sscanf(sztemp,"%s %s",szop,szgo1);
		g_pstChnInfo[nIndex].m_iCurrentLine=atoi(szgo1);
		g_pstChnInfo[nIndex].m_iCurrentLine--;

		break;
	case 20013://CASEDEFAULT
		break;
	case 20014://STATEGOTO	   83: STATEGOTO	m_3_beijing
		sprintf(sztemp,"%s",g_pstChnInfo[nIndex].m_pStmt);
		sscanf(sztemp,"%s %s",szop,szgo1);
		g_pstChnInfo[nIndex].m_iNextStateLine=atoi(szgo1);
		g_pstChnInfo[nIndex].m_nGotoFlag = 1;
		//sprintf(szlog,"STATEGOTO 跳转到 : %d, level = %d ",Ivr[nChan].m_iNextStateLine,Ivr[nChan].m_iIntVarLevel);
		//LogMesg(nChan,szlog,INFOOUTPUT,THIS_FILE, __LINE__);

		break;
	case 20015:
		g_pstChnInfo[nIndex].m_nBoolResult[g_pstChnInfo[nIndex].m_nBoolResultTop++] = g_pstChnInfo[nIndex].m_iIfResult;
		break;
	case 20016:
		g_pstChnInfo[nIndex].m_iIfResult = g_pstChnInfo[nIndex].m_nBoolResult[g_pstChnInfo[nIndex].m_nBoolResultTop-1];
		g_pstChnInfo[nIndex].m_nBoolResultTop--;
		break;
	case 20017:
		if(!g_pstChnInfo[nIndex].m_iIfResult)
		{
			sprintf(sztemp,"%s",g_pstChnInfo[nIndex].m_pStmt);
			sscanf(sztemp,"%s %s",szop,szgo1);
			g_pstChnInfo[nIndex].m_iCurrentLine=atoi(szgo1);
			g_pstChnInfo[nIndex].m_iCurrentLine--;
		}
		break;
	case 20018:
		sprintf(sztemp,"%s",g_pstChnInfo[nIndex].m_pStmt);
		sscanf(sztemp,"%s %s",szop,szgo1);
		g_pstChnInfo[nIndex].m_iCurrentLine=atoi(szgo1);
		g_pstChnInfo[nIndex].m_iCurrentLine--;
		break;
	case 20019://ENTERSECTION
		/*
		sprintf(sztemp,"%s",pStmt);
		sscanf(sztemp,"%s %s",szop,szgo1);
		{
			int nSectionNO = atoi(szgo1);
			int nState = Cont[Ivr[nChan].m_nContNo].GetSectionState(nSectionNO,nChan);
			if(nState==0)
			{
				if(Ivr[nChan].m_nBlockSection==1)
					LogMesg(Ivr[nChan].m_nChan,"解开进入SECTION",DEBUGOUTPUT,THIS_FILE, __LINE__);
				else
					LogMesg(Ivr[nChan].m_nChan,"允许进入SECTION",DEBUGOUTPUT,THIS_FILE, __LINE__);
				g_pstChnInfo[nIndex].m_nBlockSection = 0;
				g_pstChnInfo[nIndex].m_nInSection  = nSectionNO;
				Cont[Ivr[nChan].m_nContNo].EnterSection(nSectionNO,nChan);
			}
			else
			{
				LogMesg(Ivr[nChan].m_nChan,"进入SECTION被阻止",DEBUGOUTPUT,THIS_FILE, __LINE__);
				Ivr[nChan].m_nBlockSection = 1;
			}
		}
		*/
		break;
	case 20020:
		/*
		sprintf(sztemp,"%s",pStmt);
		LogMesg(Ivr[nChan].m_nChan,"离开SECTION",DEBUGOUTPUT,THIS_FILE, __LINE__);
		Ivr[nChan].m_nInSection  = 0;
		sscanf(sztemp,"%s %s",szop,szgo1);
		{
			int nSectionNO = atoi(szgo1);
			Cont[Ivr[nChan].m_nContNo].LeaveSection(nSectionNO,nChan);
		}
		*/
		break;
	case DDSTR://DDSTR   DDSTR	songname
		InternalOperatorStringAssignExp(nChnID);
	
		break;
	case DDINT://DDINT
		
		InternalOperatorIntAssignExp(nChnID);
		break;

	case AGN_STR://AGN_STR
		InternalOperatorStringAssignExp(nChnID);
		break;

	case AGN_INT://AGN_INT
		InternalOperatorIntAssignExp(nChnID);
		break;
	case DEF_END:
		InternalOperatorDefineEnd(nChnID);
		break;
	case AGN_END:
		InternalOperatorDefineEnd(nChnID);
		break;
	}

}

void InternalOperatePlayFile(int nChnID,int op)
{
	int nIndex = ChnMapTable[nChnID].m_nIndex;
	char sztemp[1024]="",szgo1[1000]="",szgo2[1000]="",szop[100]="";
	char* p1=NULL,*p2=NULL;
	char szlog[1024]="";

	//char *pStmt = GetLine(g_pstChnInfo[nIndex].m_nFlwID,g_pstChnInfo[nIndex].m_iCurrentLine,nIndex);
	if(g_pstChnInfo[nIndex].m_pStmt==NULL)
	{		
		MAKEHANGUPRESULT()
		return ;
	}
	switch (op)
	{
		case PLAYFILE1://PLAYFILE1 id id 
			sprintf(sztemp,"%s",g_pstChnInfo[nIndex].m_pStmt);
			sscanf(sztemp,"%s %s %s",szop,szgo1,szgo2);
			{
				char *l=LookStringTable(nChnID,szgo1);
				int r=LookIntTable(nChnID,szgo2);
				if(l==NULL||r==-1)
				{
					MAKEHANGUPRESULT()
					return ;
				}
				MakeFunction(nIndex,LP_FLW_FUNCTION_PLAYFILE);
				MakePlayFile(nIndex,l,r);
			}
		break;
		case 80002://PLAYFILE2 id number
			sprintf(sztemp,"%s",g_pstChnInfo[nIndex].m_pStmt);
			sscanf(sztemp,"%s %s %s",szop,szgo1,szgo2);
			{
				char *l=LookStringTable(nChnID,szgo1);
				int r=atoi(szgo2);
				if(l==NULL||r==-1)
				{
					MAKEHANGUPRESULT()
					return ;
				}
				MakeFunction(nIndex,LP_FLW_FUNCTION_PLAYFILE);
				MakePlayFile(nIndex,l,r);
			}
		break;
		case 80003://PLAYFILE3 str i
			sprintf(sztemp,"%s",g_pstChnInfo[nIndex].m_pStmt);
			sscanf(sztemp,"%s %s",szop,szgo1);
			g_pstChnInfo[nIndex].m_iCurrentLine++;
			p1=GetLine(g_pstChnInfo[nIndex].m_nFlwID,g_pstChnInfo[nIndex].m_iCurrentLine,nIndex);
			if(p1==NULL)
			{
				MAKEHANGUPRESULT()
				return ;
			}
			sprintf(szgo2,"%s",p1);
			{
				int r=LookIntTable(nChnID,szgo1);
				if(r==-1)
				{
					MAKEHANGUPRESULT()
					return ;
				}
				MakeFunction(nIndex,LP_FLW_FUNCTION_PLAYFILE);
				MakePlayFile(nIndex,szgo2,r);
			}
		break;
		case 80004://PLAYFILE4
			sprintf(sztemp,"%s",g_pstChnInfo[nIndex].m_pStmt);
			sscanf(sztemp,"%s %s",szop,szgo1);
			g_pstChnInfo[nIndex].m_iCurrentLine++;
			p1=GetLine(g_pstChnInfo[nIndex].m_nFlwID,g_pstChnInfo[nIndex].m_iCurrentLine,nIndex);
			if(p1==NULL)
			{
				MAKEHANGUPRESULT()
				return ;
			}
			sprintf(szgo2,"%s",p1);
			{
				int r = atoi(szgo1);
				MakeFunction(nIndex,LP_FLW_FUNCTION_PLAYFILE);
				MakePlayFile(nIndex,szgo2,r);
			}
		break;
	}

}

void InternalOperateIFLFV(int nChnID,int op)
{
	int nIndex = ChnMapTable[nChnID].m_nIndex;
	char sztemp[1024]="",szgo1[1000]="",szgo2[1000]="",szop[100]="";
	char* p1=NULL,*p2=NULL;
	

	//char *pStmt = GetLine(g_pstChnInfo[nIndex].m_nFlwID,g_pstChnInfo[nIndex].m_iCurrentLine,nIndex);
	if(g_pstChnInfo[nIndex].m_pStmt==NULL)
	{		
		MAKEHANGUPRESULT()
		return ;
	}
	switch(op)
	{
		case IFLFV1://IFLFV1 if (id>id)
			sprintf(sztemp,"%s",g_pstChnInfo[nIndex].m_pStmt);
			sscanf(sztemp,"%s %s %s",szop,szgo1,szgo2);
			{
				int l=LookIntTable(nChnID,szgo1);
				int r=LookIntTable(nChnID,szgo2);
				if(l>r)
				{
					g_pstChnInfo[nIndex].m_iIfResult=1;
				}
				else
				{
					g_pstChnInfo[nIndex].m_iIfResult=0;
				}
			}
		break;
		case IFLFV2://IFLFV2 if(id>number)
			sprintf(sztemp,"%s",g_pstChnInfo[nIndex].m_pStmt);
			sscanf(sztemp,"%s %s %s",szop,szgo1,szgo2);
			{
				int l=LookIntTable(nChnID,szgo1);
				int r=atoi(szgo2);
				if(l>r)
				{
					g_pstChnInfo[nIndex].m_iIfResult=1;
				}
				else
				{
					g_pstChnInfo[nIndex].m_iIfResult=0;
				}
			}
		break;	
		case IFLFV3://IFLFV3 if(number>id)
			sprintf(sztemp,"%s",g_pstChnInfo[nIndex].m_pStmt);
			sscanf(sztemp,"%s %s %s",szop,szgo1,szgo2);
			{
				int r=LookIntTable(nChnID,szgo2);
				int l=atoi(szgo1);
				if(l>r)
				{
						g_pstChnInfo[nIndex].m_iIfResult=1;
				}
				else
				{
						g_pstChnInfo[nIndex].m_iIfResult=0;
				}
			}
		break;	
		case IFLFV4://IFLFV4 if(number>number)
			sprintf(sztemp,"%s",g_pstChnInfo[nIndex].m_pStmt);
			sscanf(sztemp,"%s %s %s",szop,szgo1,szgo2);
			{
				int l=atoi(szgo1);
				int r=atoi(szgo2);
				if(l>r)
				{
					g_pstChnInfo[nIndex].m_iIfResult=1;
				}
				else
				{
					g_pstChnInfo[nIndex].m_iIfResult=0;
				}
			}
		break;
	}
	

}


void InternalOperateIFRFV(int nChnID,int op)
{
	int nIndex = ChnMapTable[nChnID].m_nIndex;
	char sztemp[1024]="",szgo1[1000]="",szgo2[1000]="",szop[100]="";
	char* p1=NULL,*p2=NULL;
	//char* pStmt =GetLine(g_pstChnInfo[nIndex].m_nFlwID,g_pstChnInfo[nIndex].m_iCurrentLine,nIndex);
	if(g_pstChnInfo[nIndex].m_pStmt==NULL)
	{		
			MAKEHANGUPRESULT()
			return ;
	}
	
	switch(op)
	{
		case IFRFV1://IFRFV1 if(id<id)
		sprintf(sztemp,"%s",g_pstChnInfo[nIndex].m_pStmt);
		sscanf(sztemp,"%s %s %s",szop,szgo1,szgo2);
		{
			int l=LookIntTable(nChnID,szgo1);
			int r=LookIntTable(nChnID,szgo2);
			if(l<r)
			{
				g_pstChnInfo[nIndex].m_iIfResult=1;
			}
			else
			{
				g_pstChnInfo[nIndex].m_iIfResult=0;
			}
		}
		break;
	case IFRFV2://IFRFV2  if(id<number)
		sprintf(sztemp,"%s",g_pstChnInfo[nIndex].m_pStmt);
		sscanf(sztemp,"%s %s %s",szop,szgo1,szgo2);
		{
			int l=LookIntTable(nChnID,szgo1);
			int r=atoi(szgo2);
			if(l<r)
			{
				g_pstChnInfo[nIndex].m_iIfResult=1;
			}
			else
			{
				g_pstChnInfo[nIndex].m_iIfResult=0;
			}
		}
		break;	
	case IFRFV3://IFRFV3 if(number<if)
		sprintf(sztemp,"%s",g_pstChnInfo[nIndex].m_pStmt);
		sscanf(sztemp,"%s %s %s",

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -