Re: conflict with inmemantlr-api

Enrico Scantamburlo <[email protected]> Mon, 31 Jul 2017 16:59:33 +0200
Newsgroups gmane.comp.java.netbeans.modules.openide.devel
Message-ID <CAJdy_m9C7D_7Jsn5v7V+nLoADQkRx-FGyDcHPySo16HksAYV2w@mail.gmail.com>
Try to add antlr 4.7 as a library inside the module:
Properties/Libraries/Add New Library...

Il 31/lug/2017 05:22, "Peter Cheung" <[email protected]> ha scritto:

> Dear All
>    I want to use inmemantlr-api (https://github.com/julianthome/inmemantlr).
> It needs antlr 4.7 runtime so org-netbeans-libs-antlr4-runtime can’t
> help, because it is antlr 4.5.3. If i just add antlr4-runtime:3.7 without
> adding org-netbeans-libs-antlr4-runtime, i got these error:
>
> ANTLR Tool version 4.5.3 used for code generation does not match the
> current runtime version 4.7org.snt.inmemantlr.exceptions.CompilationErrorException:
> ----------
> 1. ERROR in /CalculatorLexer.java (at line 2)
> import org.antlr.v4.runtime.Lexer;
>       ^^^^^^^^^
> The import org.antlr cannot be resolved
> ----------
> 2. ERROR in /CalculatorLexer.java (at line 3)
> import org.antlr.v4.runtime.CharStream;
>       ^^^^^^^^^
> The import org.antlr cannot be resolved
> ----------
> 3. ERROR in /CalculatorLexer.java (at line 4)
> import org.antlr.v4.runtime.Token;
>       ^^^^^^^^^
> The import org.antlr cannot be resolved
> —————
>
> If I don’t add *BOTH* org-netbeans-libs-antlr4-runtime but not
> antlr4-runtime:3.7, i got:
>
> org.snt.inmemantlr.exceptions.CompilationErrorException: ----------
> 1. ERROR in /CalculatorLexer.java (at line 2)
> import org.antlr.v4.runtime.Lexer;
>       ^^^^^^^^^
> The import org.antlr cannot be resolved
> ----------
> 2. ERROR in /CalculatorLexer.java (at line 3)
> import org.antlr.v4.runtime.CharStream;
>       ^^^^^^^^^
> The import org.antlr cannot be resolved
> ----------
> 3. ERROR in /CalculatorLexer.java (at line 4)
> import org.antlr.v4.runtime.Token;
>       ^^^^^^^^^
> The import org.antlr cannot be resolved
>
> Please help
>
> thanks
> Peter
>