Ask a questionAsk a question
 

Proposed AnswerPREDICTIVE PARSE TABLE

  • Thursday, August 27, 2009 8:40 AMANITHA.y Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    hi, plz help me to slove this problem E->E+T/T T->T*F/F F->(E)/xy/xz i want to construct predictive parse table for the above grammer. I have doubt on solving this whether to eliminate left factoring and left recursion while constructing parse table...... plz help me Regards ANITHA

All Replies

  • Friday, September 18, 2009 4:22 AMsahanaa Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Proposed Answer
    to solve the problem u mentioned using predictive parser, first the left recursion problem could be solved using the formlua
    A -> Ax/y

    A -> yA'
    A' -> xA'/e


    then the grammar becomes

    E -> TE'
    E' -> +TE'/e
    T -> FT'
    T -> *FT'/e
    F -> (E)/xy/xz
    • Proposed As Answer bysahanaa Friday, September 18, 2009 4:22 AM
    •