Package com.sonar.sslr.impl.channel

Examples of com.sonar.sslr.impl.channel.BlackHoleChannel


        .withFailIfNoChannelToConsumeOneCharacter(true)

        // Channels, which consumes more frequently should come first.
        // Whitespace character occurs more frequently than any other, and thus come first:
        .withChannel(new BlackHoleChannel("[" + LINE_TERMINATOR + WHITESPACE + "]++"))

        // Comments
        .withChannel(commentRegexp(COMMENT))

        // String Literals
View Full Code Here


  public static Lexer create(CxxConfiguration conf, Preprocessor... preprocessors) {
    Lexer.Builder builder = Lexer.builder()
        .withCharset(conf.getCharset())
        .withFailIfNoChannelToConsumeOneCharacter(true)
        .withChannel(new BlackHoleChannel("\\s"))
        .withChannel(new PreprocessorChannel())
        .withChannel(commentRegexp("/\\*", ANY_CHAR + "*?", "\\*/"))
        .withChannel(new BlackHoleChannel(".*"));

    for (Preprocessor preprocessor : preprocessors) {
      builder.withPreprocessor(preprocessor);
    }

View Full Code Here

  public static Lexer create(CxxConfiguration conf, Preprocessor... preprocessors) {
    Lexer.Builder builder = Lexer.builder()
        .withCharset(conf.getCharset())
        .withFailIfNoChannelToConsumeOneCharacter(true)

        .withChannel(new BlackHoleChannel("\\s"))

        // C++ Standard, Section 2.8 "Comments"
        .withChannel(commentRegexp("//[^\\n\\r]*+"))
        .withChannel(commentRegexp("/\\*", ANY_CHAR + "*?", "\\*/"))

 
View Full Code Here

                .withChannel(commentRegexp("/\\*[\\s\\S]*?\\*/"))

                // All other tokens
                .withChannel(regexp(LITERAL, "[^\r\n\\s/]+"))

                .withChannel(new BlackHoleChannel("[\\s]"))

                .build();
    }
View Full Code Here

TOP

Related Classes of com.sonar.sslr.impl.channel.BlackHoleChannel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.