Package com.sonar.sslr.impl.channel
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:
RegexpChannelBuilder
-
-
Constructor Summary
Constructors Constructor Description RegexpChannel(TokenType type, String regexp)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
consume(CodeReader code, Lexer lexer)
Tries to consume the character stream at the current reading cursor position (provided by theCodeReader
).
-
-
-
Constructor Detail
-
RegexpChannel
public RegexpChannel(TokenType type, String regexp)
- Throws:
PatternSyntaxException
- if the expression's syntax is invalid
-
-
Method Detail
-
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 theCodeReader
). If the character stream is consumed the method must return true and the OUTPUT object can be fed.
-
-