Interface IScanner

All Known Implementing Classes:
PublicScanner

public interface IScanner

Caveat: With the introduction of "restricted keywords" in Java 9 it is impossible to classify a token without the help of a parser. For that reason, this interface is not suitable for scanning a modular compilation unit ("module-info.java"). It is the client's responsibility to pass only source from ordinary compilation units. For lack of a file name the scanner cannot check this.

Definition of a Java scanner, as returned by the ToolFactory. The scanner is responsible for tokenizing a given source, providing information about the nature of the token read, its positions and source equivalent.

When the scanner has finished tokenizing, it answers an EOF token ( ITerminalSymbols#TokenNameEOF.

When encountering lexical errors, an InvalidInputException is thrown.

Since:
2.0
See Also: