Class ScannerBuffer

java.lang.Object
java_cup.runtime.ScannerBuffer
All Implemented Interfaces:
Scanner

public class ScannerBuffer extends Object implements Scanner
  • Constructor Details

    • ScannerBuffer

      public ScannerBuffer(Scanner inner)
      Wraps around a custom scanner and stores all so far produced tokens in a buffer
      Parameters:
      inner - the scanner to buffer
  • Method Details

    • getBuffered

      public List<Symbol> getBuffered()
      Read-Only access to the buffered Symbols
      Returns:
      an unmodifiable Version of the buffer
    • next_token

      public Symbol next_token() throws Exception
      Description copied from interface: Scanner
      Return the next token, or null on end-of-file.
      Specified by:
      next_token in interface Scanner
      Throws:
      Exception