public class RPNParser
extends java.lang.Object
| Constructor and Description |
|---|
RPNParser() |
| Modifier and Type | Method and Description |
|---|---|
static void |
doOperation(RPNCalc the_calc,
java.lang.String token)
Given a token, determines what operation the token represents
and calls the appropriate method of the RPNCalc object.
|
static boolean |
isOper(java.lang.String tok)
pre: none
post: returns true if and only if tok is a legal operation.
|
static void |
main(java.lang.String[] argv)
Continuously reads a well formed post fix expression.
|
public static void doOperation(RPNCalc the_calc, java.lang.String token)
the_calc - An initialized RPNCalc object which will
perform the given operation.token - A token representing an operation
to be performed.
Legal tokens are "=", "+", "-", "/", "*", "^".
post: appropriate calls are made to the calculator's operations.public static boolean isOper(java.lang.String tok)
public static void main(java.lang.String[] argv)
throws java.io.IOException
java.io.IOException