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(); } }
public static Lexer create(PerlConfiguration config) { return Lexer.builder() .withCharset(config.getCharset()) .withFailIfNoChannelToConsumeOneCharacter(true) .withChannel(new NewLineChannel()) .withChannel(new BlackHoleChannel("\\s")) .withChannel(commentRegexp("#[^\\n\\r]*+")) .withChannel(new PODChannel()) .withChannel(commentRegexp("__END__[\\n\\r].*+")) .withChannel(commentRegexp("__DATA__[\\n\\r].*+")) .withChannel(new StringLiteralsChannel()) .withChannel(new QuoteLikeChannel()) .withChannel(new HeredocChannel()) .withChannel(regexp(PerlTokenType.NUMBER, "[1-9][0-9]*+[.][0-9]++" + EXP)) .withChannel(regexp(PerlTokenType.NUMBER, "[1-9][0-9]*+[.][0-9]++")) .withChannel(regexp(PerlTokenType.NUMBER, "[1-9][0-9]*+" + EXP)) .withChannel(regexp(PerlTokenType.NUMBER, "[1-9][0-9]*+")) .withChannel(regexp(PerlTokenType.NUMBER, "0++")) .withChannel(new IdentifierAndKeywordChannel(and("[$%&@]?[a-zA-Z_]", o2n("\\w")), true, PerlKeyword.values())) .withChannel(new PunctuatorChannel(PerlPunctuator.values())) .withChannel(new UnknownCharacterChannel()) .build(); } }
.withChannel(new IdentifierAndKeywordChannel(and("[a-zA-Z_]", o2n("\\w")), true, PythonKeyword.values()))
.withChannel(new IdentifierAndKeywordChannel(and("[a-zA-Z_]", o2n("\\w")), true, PythonKeyword.values()))
.withChannel(new IdentifierAndKeywordChannel(and("[a-zA-Z_]", o2n("\\w")), true, PythonKeyword.values()))