@@ -0,0 +1,2592 @@
+package es.litesolutions.sonar.grappa;%0A%0Aimport com.sonar.sslr.api.Grammar;%0Aimport com.sonar.sslr.impl.Parser;%0Aimport org.sonar.colorizer.Tokenizer;%0Aimport org.sonar.sslr.toolkit.AbstractConfigurationModel;%0Aimport org.sonar.sslr.toolkit.ConfigurationProperty;%0A%0Aimport java.util.Collections;%0Aimport java.util.List;%0A%0Apublic final class SampleToolkit%0A%7B%0A    private SampleToolkit()%0A    %7B%0A        throw new Error(%22nice try!%22);%0A    %7D%0A%0A    public static void main(final String... args)%0A    %7B%0A        /*%0A         * Initialize your language parser and your rule%0A         */%0A%0A        /*%0A        final MyParser parser%0A            = Parboiled.createParser(MyParser.class);%0A        final Rule rule = parser.someRule();%0A        final Channel%3CLexer%3E channel = new GrappaChannel(rule);%0A        */%0A%0A        /*%0A         * Initialize the lexer; only one channel!%0A         */%0A%0A        /*%0A        final Lexer lexer = Lexer.builder()%0A            .withFailIfNoChannelToConsumeOneCharacter(true)%0A            .withChannel(channel)%0A            .build();%0A        */%0A%0A        /*%0A         * Initialize your rules; here we take the example of a grammar which%0A         * has no root rule, but which we inject into a builder.%0A         *%0A         * Match the GrammarRuleKey with the grappa parser rule.%0A         */%0A%0A        /*%0A        final LexerfulGrammarBuilder builder = LexerfulGrammarBuilder.create();%0A        MyGrammar.injectInto(builder);%0A        builder.setRootRule(MyGrammar.MY_RULE_KEY);%0A        */%0A%0A        /*%0A         * Finally, create the Grammar object, the Parser object, initialize%0A         * the toolkit and run it%0A         */%0A%0A        /*%0A        final Grammar grammar = builder.build();%0A%0A        final Parser%3CGrammar%3E grammarParser = Parser.builder(grammar)%0A            .withLexer(lexer).build();%0A%0A        final Toolkit toolkit = new Toolkit(%22test%22,%0A            new DummyConfigurationModel(grammarParser));%0A%0A        toolkit.run();%0A        */%0A    %7D%0A%0A    private static final class DummyConfigurationModel%0A        extends AbstractConfigurationModel%0A    %7B%0A        private final Parser%3CGrammar%3E parser;%0A%0A        private DummyConfigurationModel(final Parser%3CGrammar%3E parser)%0A        %7B%0A            this.parser = parser;%0A        %7D%0A%0A        @Override%0A        public Parser doGetParser()%0A        %7B%0A            return parser;%0A        %7D%0A%0A        @Override%0A        public List%3CTokenizer%3E doGetTokenizers()%0A        %7B%0A            return Collections.emptyList();%0A        %7D%0A%0A        @Override%0A        public List%3CConfigurationProperty%3E getProperties()%0A        %7B%0A            return Collections.emptyList();%0A        %7D%0A    %7D%0A%7D%0A

Add a sample ToolKit file