91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 2KB
    文件類型: .cpp
    金幣: 1
    下載: 0 次
    發布日期: 2021-05-13
  • 語言: C/C++
  • 標簽: ege??

資源簡介

ege小游戲,用于借鑒和參考游戲開發,游戲內容是黑塔,一個以前很火的游戲

資源截圖

代碼片段和文件信息

#include?
#define?TK_NUM?500
#define?TK_ID?600
using?namespace?std;

class?Parser{
public:
????Parser(){
????????cin>>s;
????????lookahead=getToken();
????????expr();
????}

????int?tokenval=0;
????string?id_buffer=““;

????int?lookahead=0;
????int?current=0;
????string?s;

????void?match(int?t){
????????if(t==lookahead)lookahead=getToken();
????????else?cout<<“error“;
????}
????void?expr(){
????????factor();rest();
????}

????void?rest(){
????????if(lookahead==‘+‘){
????????????match(‘+‘);term();cout<<‘+‘;rest();
????????}else?if(lookahead==‘-‘){
????????????match(‘-‘);term();cout<<‘-‘;rest();
????????}else?if(lookahead==‘*‘||lookahead==‘/‘){
????????????last();rest();
????????}else?if(lookahead==‘?‘)cout<<‘\n‘;
????}
????void?term(){
????????factor();last();
????}
????void?last(){
????????if(lookahead==‘*‘){
????????????match(‘*‘);factor();cout<<‘*‘;last();
????????}else?if(lookahead==‘/‘){
????????????match(‘/‘);factor();cout<<‘/‘;last();
????????}else?if(lookahead==‘?‘)cout<<‘\n‘;
????}
????void?factor(){
????????if(lookahead==TK_ID){
????????????cout<<‘?‘<????????????match(lookahead);
????????}else?if(lookahead==TK_NUM){
????????????cout<<‘?‘<

評論

共有 條評論