DOC PREVIEW
UConn CSE 4100 - Study guide

This preview shows page 1 out of 2 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Semester Project – Part 2 – CSE4100 – Fall 2011Due: Monday, November 7, 2011, at 2:00pmThe second part of the semester project focuses on gaining experience with flex and bison,coupled with continued design (and redesign) skills for context free grammars (CFGs). The secondpart of the project is divided into two major tasks, and is worth a total of 50 points:• Task 1: 35 points Revising the common grammar to remove the shift/reduce and rule-not-reduced conflicts. These corrections are made to the bison file, and the result must be testedextensively for different input latex documents. You can use the prior test documents fromproject 1 task 1.• Task 1: 15 p oints Using your result grammar of the first task, redesign the common grammarto support the recognition of verbatim blocks and also nested blocks. That is, recall that thedifferent blocks (itemize, enumerate, single, etc.) can also be nested within one another to yielddifferent combinations of formatted text. Again, test your result using bison to demonstratethat the grammar revisions for these two changes work correctly.This is again an individual project, to give each student the opportunity to work with and learnthe compiling writing tools flex and bison. While it is permissible to ask one another questions, allof the work should be your own.To serve as a common basis for the project, the web page contains the following files for projectpart 2:Fileslatex.in : A sample input file.latex.l : A sample latex flex file.latexp2.y : Contains a bison specification with fprintfs for debugging.Grammar most closely resembles the original case.latexp2clean.y: Equivalent specification without the fprintfs.projp2.tex : This file - serves as additional sample latex input.projp2.pdf : PDF version of Project, part 2.output : Generated file that shows parsing rules that are firingb2conflicts.txt: S/R and R/R Conflicts from Bisonbison.debug.txt: Short Overview of Bison -v Outputlatexp2.output : Complete Bison -v Outputlatexp2.tab.c : Parser Generated by Bisonlex.yy.c : Lexical Analyzer Generated by FlexNotes: There are comments in each file explaining what that file contains.1Disclaimer: No guarantees are given regarding the "correctness" of eachof these files. I did some basic testing to make sure that things,in general, would execute. However, note that the latex.in fails sincethere are S/R and rule-not-reduced errors.Note that when I last gave this project, I put ‘intentional ‘errors’ in both latex.in and latex.l. Ithink I took them all out of latex.l, but am not sure about latex.in. Note also that the grammarfiles contain numerous shift/reduce errors and other problems, as will be discussed in class.In terms of compilation, notice that both the #defines and the main program have been removedfrom the latex.l file. The generated latexp2.tab.c from bison will create the #defines, have themain program, and include the lex.yy.c file. Compilation instructions are:flex latex.l (creates lex.yy.c)bison -v latexp2.y (creates latexp2.tab.c and generates latexp2.output)gcc latexp2.tab.c -lfl (creates a.out)a.out < latex.in {creates output}Note that the a.out generates output to the screen of the tokens recognized, and the file outputcontains the rules that are fired. All of the files above and compilation are documented in detail inthe lexandyacc.ppt posted on the web page and to be reviewed in class.The second part of the project is due on November 7, 2011, at 2:00pm. Please hand in thefollowing:1. The revised bison specification for Task 1.2. A log file (word document) that documents the changes made to the grammar to eliminatethe shift/reduce errors and other problems for Task 1. Make sure that you provide both theoriginal and revised grammar segments for each change that you make! Also include anyremaining shift/reduce or reduce/reduce errors, but NOT the entire ‘.output’ file.3. The revised bison specification for Task 2 to handle nested blocks and verbatim.4. A log file (word document) that documents the changes made to your grammar of Task 1 insupport of verbatim and nested blocks for Task 2. These changes may occur in both the flexand bison files! Again, provide original/revised segments for each change, and remaining S/Ror R/R errors.5. Test cases and test results for both Tasks, clearly marked and organized.6. Detailed compilation instructions for your software if it differs from the default as given above.Hand in your projects using an electronic media (via email - zip file using lastname.zip) emailedto TA Eugene Sanzi([email protected]). Note that if Eugene has trouble compilingand/or executing your software, he will contact you for an in person


View Full Document

UConn CSE 4100 - Study guide

Download Study guide
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Study guide and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Study guide 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?