{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Quiz06

Quiz06 - <expr>:=<term><expr>...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE324 Quiz #6 Name--------- Key --------------- Select the BEST answer for each of the following questions: (5 pts each) 1) The Backus-Naur Form (BNF) is: a) a meta-language equivalent to a Context Free Grammar b) it describes only the syntax of other HLLs c) faster than Algol, when executing code d) all of the above e) a and b above f) d and able to describe only allowed semantics g) none of the above 2) The following language issue(s) can be described via BNF: a) statement sequence b) matching parenthesis c) undeclared name d) operator associativity e) all of the above f) a, b, and d above g) f and over/underflow of values 3) Given the following BNF full description of expression (assuming <id>, <number> as known)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the 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

{[ snackBarMessage ]}

Page1 / 2

Quiz06 - <expr>:=<term><expr>...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon bookmark
Ask a homework question - tutors are online