The starter kit for HW5 has been updated to comply with the changes to the remote parser. Please replace your version of rparse.py with this new version and remove the cache.tmp cache file to be able to work with the new version of the parser.
No teamwork: On this homework, you are asked to work alone.
Submission Instructions: Submit your grammar in the file highlighter.grm using your instructional account.
The lecture described how to parse a regex (here is the simple grammar of regular expressions)
and how to translate the regex with syntax-directed translation to its
AST and how to compile it to 164 code that invokes a backtracking
Here are a few additional translations of regexes. We suggest that
you study them for the exam and before solving this problem. These
translations compile the regex to
In this assignment you will write another such translation. It will print the regex in HTML format. The HTML file will include jQuery scripts that explain the precedence of regex operators to the programmer. Specifically, the jQuery scripts must induce the following effects:
You can see an example of the output in this file. You may want to increase the font size to have an easier time hovering over the operators.
This file, generated by our parser using a grammar with an SDT that outputs HTML and jQuery, is not intended to be human-readable. However, if you want to reverse-engineer our solution (this is allowed and you are welcome!), you may want to understand this file. The easiest way may be to view the file in Chrome developing tool or Firebug on Firefox.
In this assignment you will use the parser that we demoed in the lecture. This is the parser that you will develop in the next two projects (it will build on HW4). We are not giving you the source code of the parser because that would reveal the solution for that project. Instead, you will invoke the parser as described below. This page will invoke the parser on our server with your grammar.
To run the remote parser with the grammar that is the staff solution for HW5, do this (uses grammar file regex.grm on the server):
To run the remote parser with your grammar:
Extra credit: up to you. Get inspired by Regex Buddy. Impress us. :-) If you create something for extra credit, package all source code along with a brief description into a tarball and submit it to the instructional account as extra.tar.gz.