import java_cup.runtime.*; // This program assumes that the lexer and 'sym' programs reside in the // same directory. public class lextest { static Yylex lexer = new Yylex(System.in); // creates lexer object public static void main(String[] sfdf) { try{ Symbol token; do { token = lexer.next_token(); // may need to use "nextToken" instead System.out.println("I found a token: " + token.value); } while (token.sym != sym.EOF); } catch (Exception e) {} } }