This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: : <expr> ::= <term> * <expr>  <term> / <expr>  <term> <term> ::= <term> + <factor>  Left associative, to make it right just swap <term> and <factor>  <term> − <factor>  Left associative, to make it right just swap <term> and <factor>  <factor> <factor> ::= <id>  <number>  ( <expr> )  [ <expr> ] The following is a correct expression, based on the above BNF ( not what we are used to at all !): a) [[ X/Y * 8]/6] b) 7 mod (8 + 5) c) 7 (X + Y)/2 d) (7 (X+Y) ) e) none of the above 4) Based on the BNF of problem 16 above, the value of computing “ [ 6 – 8 + 2 * 4 / 2] ” is: a) − 10 b) 2 c) 3 d) − 13 e) 10 f) 35 g) none of the above [ (( 68 ) +2 ) * ( 4/2 ) ] = (0)...
View
Full Document
 Spring '11
 Soliman
 Order Of Operations, Contextfree grammar, Backus–Naur Form

Click to edit the document details