// A program that reads an infix expression and outputs reverse Polish. // Barry Cornelius, 19 June 2000 import java.io. BufferedReader; import java.io. InputStreamReader; import java.io. IOException; public class ToReversePolishProg { public static void main(final String[] pArgs) throws IOException { final BufferedReader tKeyboard = new BufferedReader(new InputStreamReader(System.in)); System.out.print("Type in an expression (using infix notation): "); System.out.flush(); String tInfixString = tKeyboard.readLine(); Infix tInfix = new Infix(tInfixString); System.out.println("The equivalent reverse Polish is: " + tInfix.toReversePolish()); } }