|
trassare.com | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.trassare.calculator.engine.InfixCalculator
public class InfixCalculator
InfixCalculator parses, calculates, and prints the results of a series of
floating-point arithmetic expressions, one to a line, as given by the
following grammar:
command -> { expression { ! | >> Identifier }
} \n
expression -> term { + term | - term }
term -> { * power | / power }
power -> factor [ ^ power ] | { - } {
ln | sin | cos |
tan | asin | acos |
atan}? power
factor -> ( expression ) | -factor | Number
| @
Historical stuff (the origins of this application): CS 152, Fall, 2005
Programming Assignment #1
Due: October 11, 2005
Class: Section 1, TTh 0900-1015
| Constructor Summary | |
|---|---|
InfixCalculator(ExpressionScanner inS)
Construct a new InfixCalculator class using the ExpressionScanner provided by Doctor Kenneth Louden. |
|
| Method Summary | |
|---|---|
BigDecimal |
go()
Begin execution of the InfixCalculator. |
void |
resetScanner(PushbackReader instream)
Supply the calculator with a new input stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public InfixCalculator(ExpressionScanner inS)
inS - the new ExpressionScanner.| Method Detail |
|---|
public final BigDecimal go()
throws ParseException
ParseException - in any error condition a ParseException is thrownpublic final void resetScanner(PushbackReader instream)
instream - the new PushbackReader to read from.
|
trassare.com | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||