.withChannel(commentRegexp("/\\*", ANY_CHAR + "*?", "\\*/")) .withChannel(regexp(CSharpTokenType.STRING_LITERAL, "\"", o2n(or("\\\\.", anyButNot("\"", "\\n", "\\r"))), "\"")) .withChannel(regexp(CSharpTokenType.STRING_LITERAL, "@\"", o2n(or("\"\"", anyButNot("\""))), "\"")) .withChannel(regexp(CSharpTokenType.CHARACTER_LITERAL, "'", one2n(or("\\\\.", anyButNot("'", "\\n", "\\r"))), "'")) .withChannel(regexp(CSharpTokenType.INTEGER_DEC_LITERAL, one2n(DIGIT), opt(INT_SUFFIX))) .withChannel(new IdentifierAndKeywordChannel(g(opt("@"), or(LETTER_CHAR, "_"), o2n(or(LETTER_CHAR, DECIMAL_DIGIT_CHAR, CONNECTING_CHAR, COMBINING_CHAR, FORMATTING_CHAR))), true, CSharpKeyword.values())) .withChannel(new PunctuatorChannel(CSharpPunctuator.values()))
public static Lexer create(PlSqlConfiguration conf) { return Lexer .builder() .withCharset(conf.getCharset()) .withFailIfNoChannelToConsumeOneCharacter(true) .withChannel(new BlackHoleChannel("\\s(?!&)")) .withChannel(commentRegexp(COMMENT)) .withChannel(regexp(PlSqlTokenType.SCIENTIFIC_LITERAL, SCIENTIFIC_LITERAL)) .withChannel(regexp(PlSqlTokenType.REAL_LITERAL, REAL_LITERAL)) .withChannel(regexp(PlSqlTokenType.INTEGER_LITERAL, INTEGER_LITERAL)) .withChannel(regexp(PlSqlTokenType.STRING_LITERAL, STRING_LITERAL)) .withChannel(regexp(PlSqlTokenType.DATE_LITERAL, DATE_LITERAL)) .withChannel(new IdentifierAndKeywordChannel(or(SIMPLE_IDENTIFIER, QUOTED_IDENTIFIER), false, PlSqlKeyword.values())) .withChannel(new RegexPunctuatorChannel(PlSqlPunctuator.values())) .withChannel(new BlackHoleChannel(and("\\s&&?", SIMPLE_IDENTIFIER))) .withChannel(new UnknownCharacterChannel()) .build(); } }