You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following works as expected: grammars exist in the parent directory (parser) & all generated files wind up in the current directory (gen)
cd /d D:\DevFiles\Java\JsonEditor\src\net\certiv\json\parser\gen
java org.antlr.v4.Tool ../JsonLexer.g4 ../JsonParser.g4
The following fails:
cd /d D:\DevFiles\Java\JsonEditor\src\net\certiv\json\parser\gen
java org.antlr.v4.Tool ..\JsonLexer.g4 ..\JsonParser.g4
JsonLexer.java and JsonLexer.tokens are generated in the parent directory (parser) and the compile of the JsonParser.g4 fails saying that it cannot find the JsonLexer.tokens in the current directory (gen).
Note the difference in the slashes in the grammar paths - "../" works completely as expected, but ".." works sufficiently for the Tool to find the grammars, but generates in the wrong directory. Adding -o and -lib options in various combinations don't affect the result.
This problem was encountered while rebuilding an early Antlr4 project. So using ".." apparently worked as expected "way back then."
The text was updated successfully, but these errors were encountered:
grosenberg
changed the title
Unexpected code generation location behavior -- on Windows / Antlr 4.4
Unexpected code generation location behavior
Nov 1, 2014
I believe this is actually the same problem as #638. The different target folder creation wouldn't even be a problem if ANTLR would stop doing that and just use what it was given it as output path.
On Windows / Antlr 4.4 (might be related to #638)
The following works as expected: grammars exist in the parent directory (parser) & all generated files wind up in the current directory (gen)
cd /d D:\DevFiles\Java\JsonEditor\src\net\certiv\json\parser\gen
java org.antlr.v4.Tool ../JsonLexer.g4 ../JsonParser.g4
The following fails:
cd /d D:\DevFiles\Java\JsonEditor\src\net\certiv\json\parser\gen
java org.antlr.v4.Tool ..\JsonLexer.g4 ..\JsonParser.g4
JsonLexer.java and JsonLexer.tokens are generated in the parent directory (parser) and the compile of the JsonParser.g4 fails saying that it cannot find the JsonLexer.tokens in the current directory (gen).
Note the difference in the slashes in the grammar paths - "../" works completely as expected, but ".." works sufficiently for the Tool to find the grammars, but generates in the wrong directory. Adding -o and -lib options in various combinations don't affect the result.
This problem was encountered while rebuilding an early Antlr4 project. So using ".." apparently worked as expected "way back then."
The text was updated successfully, but these errors were encountered: