CIT 594 Previous Announcements
Spring 2013, David Matuszek

Date Announcements
March 18, 2013 Here are some sample Funl programs.
March 15, 2013 I've now posted details of the Funl Evaluator.
March 14, 2013

Updates to Funl parser assignment:

  • The definition of the val expression has changed.
  • I have provided some unit tests, as ParserTest.java.
  • I have provided a tree parser, as tree-parser.java.
  • The tokenizer.zip that I provided for your use does not tokenize quoted strings. As the upgrade requires only four lines (one to say you want quoted strings, three to handle that case), I'll leave that fix up to you. (Additional hint: Read the StreamTokenizer documentation!)
February 26, 2013 Just for fun, I've updated the parser for the Little Logic Language (lll.zip). It now allows an implication operator, handles precedence properly ("implies" < "or" < "and" < "not"), and has no remaining (known) bugs.
  program ::= sentence { sentence }
  sentence ::= fact | query
  fact ::= "!" implication | "Fact:" implication
  query ::= "?" implication | "Query:" implication
  implication ::= disjunction [ "implies" disjunction ]
  disjunction ::= conjunction { "or" conjunction }
  conjunction ::= basis { "and" basis }
  basis ::= [ "not" ] variable | [ "not" ] "(" implication ")" 
If you are having trouble with recursive descent parsing, I recommend that you look over this code (particularly the LittleLogicLanguageParser class).
February 22, 2013

A number of people have tried to do Part 2 of the BNF Tokenizer and Parser assignment without using the method of recursive descent. I've written an example recursive descent parser for a "little logical language", with syntax as follows:

program ::= sentence { sentence }
sentence ::= fact | query
fact ::= "!" expression
query ::= "?" expression
expression ::= [ "not" ] disjunct [ "or" expression ]
disjunct ::= conjunct { "and" conjunct }
conjunct ::= variable | "(" expression ")"

The parser itself is about 225 lines, but there are supporting classes (basic tree and token classes, and a tokenizer). There are still some bugs, but the parser is working well enough to post it as an example of how recursive descent should be done. Here it is: logic_language.zip. I expect to post a final version sometime later.

February 19, 2013

I have tried to clarify the BNF assignment by means of stepping through a small example.

The bottom line is that the assignment is correct as written, so I don't see any need to extend the deadline. Sorry!
February 16, 2013 To help with the current assignment (mostly part 2, but also relevant to part 1), I wrote a BNF definition of BNF, which I expanded into a web page, with explanations. Then I accidentally posted the bare definition instead of this web page.
February 12, 2013 Added a necessary method to the Tokenizer in 05 BNF Tokenizer and Parser.
February 12, 2013 Added a page on All About Recursion.
February 5, 2013 Added a link to StudentChooser.java.
January 16, 2013 I have added a page on Using Piazza and Canvas (and email and my web site). Please read it.
January 9, 2013 If a CIS or CIT class is closed, you can be put on a waiting list for the class. Fill out the form at https://www.cis.upenn.edu/grad/waitlist.shtml.
January 8, 2013 clickerIn addition to textbooks, you should purchase a TurningPoint ResponseCard (or "clicker"). These are approximately $50 and are available at the purchase desk in the Penn Bookstore.