Dear Gerald Rosenberg,
OS: Fedora release 35
Java of OS: openjdk version "11.0.14.1" 2022-02-08
Eclipse: eclipse-modeling-2022-03-R-linux-gtk-x86_64.tar.gz
On a fresh workspace I installed AntrlDT via its update site.
I created a plain Java Project with defaults (src,bin).
I split Hello.g4 from Parr's book into PogoLexer.g4 and PogoParser.g4 and put them into a package under src and added the matching @header lines.
The project got the AntlrDT nature automatically added and all parser files got generated.
Compilation failed as the antlr runtime was not found.
So I downloaded antlr-runtime-4.9.2.jar, put it into /lib and updated the Java Build path of the project accordingly.
Then compilation succeeded and Parser/Lexer worked on a simple Main.java.
I opened the Tokens View and filled the Grammar attributes Snippets dir and ext, and filled Source.
Pressing "Build Model" results in the following text in the Console named "AntrlDT Console":
Parser Loading class for 'de.uwe_ritzmann.antlr.test_dt.PogoParser'.
Lexer Loading class for 'de.uwe_ritzmann.antlr.test_dt.PogoLexer'.
Parser: Parser: failed to load class 'de.uwe_ritzmann.antlr.test_dt.PogoParser' (de.uwe_ritzmann.antlr.test_dt.PogoParser) (at java.net.URLClassLoader#findClass @445)
Lexer: Lexer: failed to load class 'de.uwe_ritzmann.antlr.test_dt.PogoLexer' (de.uwe_ritzmann.antlr.test_dt.PogoLexer) (at java.net.URLClassLoader#findClass @445)?
General ---------------------------------------
Unfortunately I do not have enought insight into the way eclipse handles class loaders and how to fix this problem.
Best Regards
Uwe Ritzmann
Dear Gerald Rosenberg,
OS: Fedora release 35
Java of OS: openjdk version "11.0.14.1" 2022-02-08
Eclipse: eclipse-modeling-2022-03-R-linux-gtk-x86_64.tar.gz
On a fresh workspace I installed AntrlDT via its update site.
I created a plain Java Project with defaults (src,bin).
I split Hello.g4 from Parr's book into PogoLexer.g4 and PogoParser.g4 and put them into a package under src and added the matching
@headerlines.The project got the AntlrDT nature automatically added and all parser files got generated.
Compilation failed as the antlr runtime was not found.
So I downloaded antlr-runtime-4.9.2.jar, put it into /lib and updated the Java Build path of the project accordingly.
Then compilation succeeded and Parser/Lexer worked on a simple Main.java.
I opened the Tokens View and filled the Grammar attributes Snippets dir and ext, and filled Source.
Pressing "Build Model" results in the following text in the Console named "AntrlDT Console":
Parser Loading class for 'de.uwe_ritzmann.antlr.test_dt.PogoParser'.Lexer Loading class for 'de.uwe_ritzmann.antlr.test_dt.PogoLexer'.Parser: Parser: failed to load class 'de.uwe_ritzmann.antlr.test_dt.PogoParser' (de.uwe_ritzmann.antlr.test_dt.PogoParser) (at java.net.URLClassLoader#findClass @445)Lexer: Lexer: failed to load class 'de.uwe_ritzmann.antlr.test_dt.PogoLexer' (de.uwe_ritzmann.antlr.test_dt.PogoLexer) (at java.net.URLClassLoader#findClass @445)?General ---------------------------------------Unfortunately I do not have enought insight into the way eclipse handles class loaders and how to fix this problem.
Best Regards
Uwe Ritzmann