ln018 - Where are We Java read and 17 This should be mostly...

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

View Full Document Right Arrow Icon
Where are We? Java: read chapters 13, 15, and 17 This should be mostly a review…with the exception perhaps of exceptions. Assignment #8: 17.3, due Monday 11/1 (extra credit: 10% implement error handling via exceptions, 10% implement parse trees)
Background image of page 1

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

View Full DocumentRight Arrow Icon
Translator Problem: Build a simple translator from arithmetic expressions to a simple stack machine. The translator accepts the following language: G: <expression> ::= <mulexp> ‘+’ <mulexp> | <mulexp> ‘-’ <mulexp> <mulexp> ::= <rootexp> ‘*’ <rootexp> | <rootexp> ‘/’ <rootexp> <rootexp> ::= ‘(‘ <rootexp> ‘)’ | number The translator generates the following stack machine language: G’: <comlist> ::= <comlist> <command> | <empty> <command> ::= <arithmetic> | <stack> <arithmetic> ::= add | subtract | multiply | divide <stack> ::= push number | pop Base your implementation on the calculator code given in the book.
Background image of page 2
Translator Recursive descent parser…one function for each non- terminal Given the expression (1+2)*3 your translator should
Background image of page 3

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

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

This note was uploaded on 10/03/2011 for the course CSC 301 taught by Professor Hamel during the Spring '08 term at Rhode Island.

Page1 / 10

ln018 - Where are We Java read and 17 This should be mostly...

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

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