Tuesday, May 22, 2007

Practice Problem 1

Write a top down recursive descent procedure to recognize strings accepted by
the following grammar:

$Parens \Rightarrow ( Parens ) \mid < Parens > \mid [ Parens ] \mid i $


The only nonterminal is Parens (which is also the start nonterminal).
$~ (~ )~ <~ >~ [~ ]~ i~ $ are terminal symbols.

Give two strings generated by the above grammar.

No comments: