// Main program for CSE 401 / CSE M 501 homework 3, part 2. // Two additional classes must be defined: Parser, which must be a // recursive-descent parser for the calculator language, and Scanner, // which should contain a method that the parser can call each time it // want to get the next token from the calculator input. (Note this // is different from the standard input library Scanner class, which // is Java's version of the C library scanf function.) // We strongly suggest that you put these classes in separate files // named Scanner.java and Parser.java in the same folder as this file. // None of these files should contain package declarations - just // leave everything in the default (unnamed) package by omitting // package from your code. // The run() method in class Parser should cause the calculator to // begin execution, reading and processing input until a quit command // is entered. // KW, HP 20au, 21sp public class Calc { public static void main(String[] args) { Scanner s = new Scanner(System.in); Parser p = new Parser(s); p.run(); } }