Class RegexpChannel

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

public class RegexpChannel extends Channel<Lexer>
Creates token of specified type from characters, which match given regular expression.
See Also:
  • Constructor Details

  • 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.