public static RegexpChannel regexp(TokenType type, String... regexpPiece) { return new RegexpChannel(type, merge(regexpPiece)); }
public static RegexpChannel regexp(TokenType type, String... regexpPiece) { return new RegexpChannel(type, merge(regexpPiece)); }
public static RegexpChannel regexp(TokenType type, String... regexpPiece) { return new RegexpChannel(type, merge(regexpPiece)); }
public static Lexer create() { return Lexer.builder().withFailIfNoChannelToConsumeOneCharacter(false) .withChannel(new IdentifierAndKeywordChannel("\\p{L}(\\p{L}|\\p{N}|_)*", true, Keyword.values())) .withChannel(new RegexpChannel(Literals.FLOAT, Literals.FLOAT.regexp)) .withChannel(new RegexpChannel(Literals.INTEGER, Literals.INTEGER.regexp)) .withChannel(new RegexpChannel(Literals.STRING, Literals.STRING.regexp)) .withChannel(new CommentRegexpChannel("^//.*")).withChannel(new PunctuatorChannel(Punctuators.values())) .withChannel(new BlackHoleChannel("[ \t\r\n]+")).build(); }