Quiz06

Quiz06 - : <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 DocumentRight 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: : &lt;expr&gt; ::= &lt;term&gt; * &lt;expr&gt; | &lt;term&gt; / &lt;expr&gt; | &lt;term&gt; &lt;term&gt; ::= &lt;term&gt; + &lt;factor&gt; -- Left associative, to make it right just swap &lt;term&gt; and &lt;factor&gt; | &lt;term&gt; &lt;factor&gt; -- Left associative, to make it right just swap &lt;term&gt; and &lt;factor&gt; | &lt;factor&gt; &lt;factor&gt; ::= &lt;id&gt; | &lt;number&gt; | ( &lt;expr&gt; ) | [ &lt;expr&gt; ] 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.

Page1 / 2

Quiz06 - : &amp;amp;lt;expr&amp;amp;gt; ::=...

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

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