P5 README - P5 README 11/28/11 12:51 PM Programming...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
11/28/11 12:51 PM P5 README Page 1 of 7 http://ieng6.ucsd.edu/~cs12f/Assignments/P5/README.html Programming assignment #5: CSE 12 Fall 2011 Here's a description of the fifth programming assignment for CSE 12, Fall 2011. In this assignment, you will create linked trees with dynamically created nodes, and write recursive methods that will parse and evaluate expressions defined in terms of a BNF grammar. The result will be useful as a key component in a command- line calculator application. >>> Due Fri Dec 02 12:00 noon >>> Required solution files: Expr.java, Assignment.java, Operation.java, Term.java, Factor.java, Constant.java, Identifier.java This means that the files that contain your solution to the assignment must be turned in by the due deadline by using the bundleP5 script while logged into your cs12 account on ieng6. If your file is turned in 24 hours or more before the deadline, you will get 1 additional point added to your programming assignment score. The turnin procedure is described below in the section "Turning in your assignment" . It's a good idea to plan to do the assignment well before the deadlines; terminals and tutors can get very busy at the last minute. As always, keep in mind that in doing this assignment, it's your responsibility to understand and follow the course rules for integrity of scholarship. Getting started Review Chapter 8 and Chapter 10 in the text book, and corresponding lecture notes. This assignment uses material introduced and discussed there. Create a directory named "P5" under your cs12 home directory. Your solution to this assignment should be turned in from that directory by the due date and time. Use the bundleP5 script to do that. This assignment involves defining classes with methods that parse and evaluate expressions written in a simple expression language. Parsing means checking that the expression conforms to the syntax rules for the language, and, if it does, constructing an abstract syntax tree (AST) representing the syntactic structure of the expression. (For a little more information about these concepts, see the Free Online Dictionary of Computing entries on parsing and abstract syntax .) After the AST is constructed, it will be recursively evaluated according to the semantics of the expression language, in order to compute the value of the expression, and to perform any required 'side effects'. The syntax rules for the expression language are given below as a Backus-Naur Form (BNF) grammar. These are basically a subset of the rules for Java and C expression syntax. The semantic rules for the language are not given in a formal notation, but they follow closely the form of the BNF grammar. The BNF definitions are recursive, and the definitions of your parsing and evaluation methods will reflect this by being recursive themselves. Copy the file
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 7

P5 README - P5 README 11/28/11 12:51 PM Programming...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online