Thursday, May 24, 2007

Practice Problem 1 and Mon 5/21-Wed 5/23

I downloaded Tortise Svn. I finally gained access to the repository and I was able to browse the directories. I also installed flash. And I browsed the VBL website.

Practice Problem 1
boolean RecursiveDescentProc(symbol, nextChar)
{
if(symbol==nextChar)
{
move ahead input pointer;
nextChar=next char from input;
symbolMatch=true;
}
else
symbolMatch=false;
return (symbolMatch);
}


Two possible strings for the grammar:
1.) Rightarrow(mid i)
2.) mid[mid[mid i]]

Resources: Concepts of Programming Languages by R.W. Sebesta and http://www.cs.uky.edu/~lewis/essays/compilers/rec-des.html

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.