227 views
0 votes
0 votes
Use the braces described in Question $4.2.4$ to simplify the following grammar for statement blocks and conditional statements:

$stmt\rightarrow if\: expr\:then\:stmt\:else\:stmt$
         $\mid if \: stmt \: then \: stmt$
         $\mid begin\: stmtList\: end$
$stmtList\rightarrow stmt;stmtList\mid stmt$

Please log in or register to answer this question.

Related questions

0 votes
0 votes
0 answers
1
admin asked Aug 17, 2019
407 views
The grammar in Fig. $4.7$ generates declarations for a single numerical identifier; these declarations involve four different, independent properties of numbers.Generaliz...
0 votes
0 votes
0 answers
3
admin asked Aug 17, 2019
192 views
Extend the idea of Question $4.2.4$ to allow any regular expression of grammar symbols in the body of a production. Show that this extension does not allow grammars to de...