/** Consumes a token without returning the value. */ public void advance() { if (nextToken != null) { try { nextToken = scanner.yylex(); } catch (IOException e) { nextToken = null; } catch (ScannerException e) { nextToken = null; } } }
/** * Creates the scanner and reads the first lookahead token. * * @param istream the input stream to tokenize. */ public Scanner(DataInputStream istream) { super(); scanner = new Lexer(istream); try { nextToken = scanner.yylex(); } catch (IOException e) { nextToken = null; } catch (ScannerException e) { nextToken = null; } }