The Scanner class does some low-level parsing. It can give you many different things, including tokens, lines, integers, reals, etc.
Create a new project in eclipse, e.g. titled "R3".
Import Parse.java into the src directory of
your eclipse project. This class parses simple prefix expressions
where "+" , "-" , "*", and "/" are the only legal binary operators and "a" , "b" , and "c" are
the only legal operands. For example, "* a b" is legal while
"* a b c" is not legal.
Modify this code so that the only legal
operands are any integer. Thus, "* a b" is no longer legal.
"* 10 3" will now be legal and "* 10 3 2" will be illegal.
Bonus:
Part one: first 50 minute recitation.
These are conditions that apply to running a method or a code
segment.
The precondition tells users what must be true before
they call a method. The post-condition tells users what will be true
after they call the method.
These conditions may be "true"
meaning that there is no meaningful condition that applies (true is
always true).
For example, System.out.println(String s) might
have as its precondition that there must be a console to print to, and
its post-condition might be that s has been printed.
In Parse.java leave a comment at the top of the "ID(String indent)" method that describes the pre- and post- conditions of this method.