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

📄 实验四2.cpp

📁 这是几个编译原理实验程序,有做实验的朋友可以用用!
💻 CPP
字号:
#include<iostream.h>
#include<stdio.h>
void main()
{int i;
 char array[5]={0};
 cout<<"please input the wen fa: "<<endl;
 for(i=0;i<5;i++)
 {cin>>array[i];
 int INITIALIZE();
 char NEW_NODE();
 void TEST();
 void SUCCESS();
 void FAILURE();
 void TRY_AGAIN();
 }
 cout<<"分析结束时栈的输出:"<<array[i]<<endl;
}
template<class stack_entry>
class stack{
     private:
       int m,n;
	   int maxstack;
	 public:
		stack();
		void pop()
		{if(!empty)
		 return 1;
		}
        push(stack);
} digui;
stack_entry digui::stack()
{
 for(int i=0;i<maxstack;i++)
stack_entrry[i]=stack_entry[i+1];
 return();
};
 stack_entry digui::push(&stack)
{
 if(stack_entry[i]<stack_entry[maxstack])
  return 1;
else
  return 0;
}
INITIALIZE(&stack)
{push(&stack);
 entry[1]=(z,0,0,0,0);
 int c=1;v=1;j=1;
 goto FAILURE;
}
NEW_NODE()
{ if(key_word>'a'&&keyword<'z')
  if(entry[i]==keyword)
  {j=j+1;goto success;
  }
  else
	  goto FAILURE;
      goto TEST;
}
TEST()
{if(G[i]==|)
 if(stack_entry[2]!=0) 
  goto SUCCESS;
else 
  break;
 if(stack_entry[i]=$)
 if(stack_entry[2]!=0)
 goto failure;
else
 break;
 V=V+1;
 s[V]=(stack_entry[i],0,c,0,son);
 goto NEW_NODE;
}
SUCCESS()
{C=stack_entry[2];
 goto TRY_AGAIN;
}
TRY_AGAIN()
{if(stack_entry[4]==0)
{while(stack_entry[i]!=|)
  i=+1;
  goto TEST;
}
i=i-1;
 C=entry[4];
 if(!(keyword>'a')&&(keyword>'z'))
	 goto TRY_AGAIN;
   j=j-1;
   goto FAILURE;}



 


⌨️ 快捷键说明

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