This preview shows pages 1–2. Sign up to view the full content.
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 [ (( 6-8 ) +2 ) * ( 4/2 ) ] = (0)...
View Full Document
This note was uploaded on 08/23/2011 for the course CSE 324 taught by Professor Soliman during the Spring '11 term at NMT.
- Spring '11