ooo TMobile 1138 AM T o 31 D hw2 2pdf Done 2 State whether o
..ooo T-Mobile 11:38 AM T o 31% D hw2 (2).pdf Done 2. State whether or not each of the following language oonstructs is syntactically valid. For each invalid construct, give the number of the syntax rule that is violated. (a) Declaration: CONST mask. BITSET (9 11); divisor 512; (b) Dedaration: PROCEDURE Less Than (addrl, addr21 ADDRESS) BOOLEAN: VAR r 1, r2 POINTER TO REAL 2: BEGIN rl :a addr1 r2 1- addr2: RETURN rl r2 END (c) Statement: LOOP Position pattern source, index, found): IF NOT found THEN EXIT END Delete (source index Length (pattern) success): Insert (replacement, source, index success); IF NOT success THEN Error Buffer overflow in Replace\") END (d)Statement: IF queue NIL THEN temp next temp temp .previous 1 tempo: queue temp ELSE temp next :a queue temp .previous 1- queue previous: queue previous next temp queue previous temp END
Solution
a) This Language Construct Statement itself is syntactically invalid.
B) This Language Construct is Syntactically Invalid. In Declaration Part Syntax Rule has been Violated
C) This Language construct is also Syntactically Invalid.Declaration Part Syntax rule violated
D) Language Construct is Syntactically Valid..No Syntax Rules Violated Here..
