The select statement discussed in Homework 12 established a languagerequirement
ID: 3798045 • Letter: T
Question
The select statement discussed in Homework 12 established a languagerequirement that each select statement have zero or more occurrences of the “||” (or) terminal symbol. What sort of requirement was this (contextfree, contextsensitive, runtime)? Justify your answer briefly but precisely.
Select statement is the following:
<stmt> ::= <assign> | <if> | <loop> | <in> | <out> | <sel>
<sel> ::= select <sel seq> end;
<sel seq> ::= <sel cls> | <sel cls> or <sel seq>
<sel cls> ::= <cond> -> <stmt seq>
Explanation / Answer
The above select statement is ofContext-free type. Because if carefully observe there is no terminal on the left hand of any statement. That clearly indicate it not a context-sensitive.
Only non-terminal on the left hand side of the statements its a Context-Free type.