public Scan(String args[]) { // the constructor
        // open an input file if one specified on command line.
        // o.w., use standard input.
        try {
            if (args.length == 0) {
                InputStreamReader isr = new InputStreamReader(System.in);
                br = new BufferedReader(isr);
            }
            else if (args.length > 1) {
                System.err.println("too many command line arguments("+
                                   args.length+"); want 0 or 1" );
                System.exit(1);
            }
            else {
                FileReader fr = new FileReader(args[0]);
                br = new BufferedReader(fr);
            }
        }
        catch (Exception oops) {
            System.err.println("Exception opening file "+args[0]+"\n");
            oops.printStackTrace();
        }

        // initially, we pretend that we just read a newline.
        // hence linenumber is initialized to 0.
        c = '\n';
        linenumber = 0;
        putback = true;
        got_eof = false;
    }