/** Provides a command line interface to the lexer */ public static void main(String[] args) throws IOException { // check for legal argument list Lexer in; if (args.length == 0) { in = new Lexer(); } else in = new Lexer(args[0]); do { Token t = in.readToken(); if (t == null) break; System.out.println("Token " + t + " in " + t.getClass()); } while (true); }