public static void main(String args[]) {

                SimpleLAnalyzer tokeniser;
                if (args.length == 0) {
                        System.out.println("Reading from standard input . . .");
                        tokeniser = new SimpleLAnalyzer(System.in);
                } else if (args.length == 1) {
                        try {
                                tokeniser = new SimpleLAnalyzer(new java.io.FileInputStream(args[0]));
                        } catch (java.io.FileNotFoundException e) {
                                System.err.println("File " + args[0] + " not found.");
                                return;
                        }
                }
                else {
                        System.out.println("SimpL Tokeniser: Usage is one of:");
                        System.out.println(" java SimpleLAnalyzer < inputfile");
                        System.out.println("OR");
                        System.out.println(" java SimpleLAnalyzer inputfile");
                        return;
                }
                /*
		* We’ve now initialised the tokeniser to read from the appropriate place,
		* so just keep reading tokens and printing them until we hit EOF
		*/
                for (Token t = getNextToken(); t.kind!=EOF; t = getNextToken()) {
                        // Print out the actual text for the constants, identifiers etc.
                        if (t.kind==NUM) {
                                System.out.print("Number");
                                System.out.print("("+t.image+") ");
                        }
                        else if (t.kind==ID) {
                                System.out.print("Identifier");
                                System.out.print("("+t.image+") ");
                        }
                        else System.out.print(t.image+" ");
                }
        }