回覆列表
  • 1 # 使用者2586955584324

    #include

    #include

    #include

    #include

    #include

    using namespace std;

    struct Node1

    {

    char vn;

    char vt;

    char s[10];

    }MAP[20];//儲存分析預測表每個位置對應的終結符,非終結符,產生式

    int k;

    //用R代表E",W代表T",e代表空

    char G[10][10]={"E->TR","R->+TR","R->e","T->FW","W->*FW","W->e","F->(E)","F->i"};//儲存文法中的產生式

    char VN[6]={"E","R","T","W","F"};//儲存非終結符

    char VT[6]={"i","+","*","(",")","#"};//儲存終結符

    char SELECT[10][10]={"(,i","+","),#","(,i","*","+,),#","(","i"};//儲存文法中每個產生式對應的SELECT集

    char Right[10][8]={"->TR","->+TR","->e","->FW","->*FW","->e","->(E)","->i"};

    stack

    bool compare(char *a,char *b)

    {

    int i,la=strlen(a),j,lb=strlen(b);

    for(i=0;i

  • 中秋節和大豐收的關聯?
  • 不輕諾,故我不負人;不信諾,故人不負我!這句話出自哪裡?