
































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

































a b c + * ( ) $ S S → AR S → AR S → AR S → AR R R → +AR R → R → A A → XB A → XB A → XB A → XB B B → B → *XB B → B → X X → a X → b X → c X → ( S )
void parse_S() { c = the current symbol in input (or $ at the end) if (c=='a') { // production S → aSa match('a'); parse_S(); match('a'); } else if (c=='b') { // production S → bSb match('b'); parse_S(); match('b'); } else if (c=='c') { // production S → c match('c'); } else the parse fails; }