Theory Flashcards
(a) The following assignment statements are invalid. Give the reason in each case. (i) xy = xy ^ c4 Reason ……………………………………………………………………………………………………………… ………………………………………………………………………………………………………………………[1] (ii) zy = zy \ 10 Reason ……………………………………………………………………………………………………………… ………………………………………………………………………………………………………………………[1] (iii) yy := xz ^ − 6 Reason ……………………………………………………………………………………………………………… ………………………………………………………………………………………………………………………[1] (b) Complete the Backus-Naur Form (BNF) for the syntax diagrams on the opposite page. ::= ………………………………………………………………………………………………………………………………… ::= ………………………………………………………………………………………………………………………………… ::= ………………………………………………………………………………………………………………………………… ::= ………………………………………………………………………………………………………………………………… [4] (c) Rewrite the BNF rule for a variable so that it can be any number of letters. ::= ……………………………………………………………………………………………………………………………..[2]