.withChannel(commentRegexp("//", o2n("[^\\n\\r]"))) .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.REAL_LITERAL, o2n(DIGIT), "\\.", one2n(DIGIT), opt(EXP), opt(REAL_SUFFIX))) .withChannel(regexp(CSharpTokenType.REAL_LITERAL, one2n(DIGIT), EXP, opt(REAL_SUFFIX))) .withChannel(regexp(CSharpTokenType.REAL_LITERAL, one2n(DIGIT), REAL_SUFFIX)) 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(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()))