Interface Scanner

  • All Known Implementing Classes:
    ScannerImpl

    public interface Scanner
    This interface represents an input stream of Tokens.

    The parser and the scanner form together the 'Parse' step in the loading process (see chapter 3.1 of the YAML Specification).

    See Also:
    Token
    • Method Detail

      • checkToken

        boolean checkToken​(Token.ID... choices)
        Check if the next token is one of the given types.
        Parameters:
        choices - token IDs to match with
        Returns:
        true if the next token is one of the given types. Returns false if no more tokens are available.
        Throws:
        ScannerException - Thrown in case of malformed input.
      • checkToken

        default boolean checkToken​(Token.ID choice)
        Check if the next token is the given type.
        Parameters:
        choice - token ID to match with
        Returns:
        true if the next token is the given type. Returns false if no more tokens are available.
        Throws:
        ScannerException - Thrown in case of malformed input.
      • resetDocumentIndex

        void resetDocumentIndex()