Class UnknownCharacterChannel

java.lang.Object
org.sonar.sslr.channel.Channel<Lexer>
com.sonar.sslr.impl.channel.UnknownCharacterChannel

public class UnknownCharacterChannel extends Channel<Lexer>
Creates token with type GenericTokenType.UNKNOWN_CHAR for any character. This channel, if present, should be the last one.
Since:
1.2
  • Constructor Details

    • UnknownCharacterChannel

      public UnknownCharacterChannel()
    • UnknownCharacterChannel

      @Deprecated public UnknownCharacterChannel(boolean shouldLogWarning)
      Deprecated.
      logging removed in 1.20, use UnknownCharacterChannel() or implement your own Channel with logging
  • Method Details

    • consume

      public boolean consume(CodeReader code, Lexer lexer)
      Description copied from class: Channel
      Tries to consume the character stream at the current reading cursor position (provided by the CodeReader). If the character stream is consumed the method must return true and the OUTPUT object can be fed.
      Specified by:
      consume in class Channel<Lexer>
      Parameters:
      code - the handle on the input character stream
      lexer - the OUTPUT that can be optionally fed by the Channel
      Returns:
      false if the Channel doesn't want to consume the character stream, true otherwise.