Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected code generation location behavior #753

Closed
grosenberg opened this issue Nov 1, 2014 · 3 comments
Closed

Unexpected code generation location behavior #753

grosenberg opened this issue Nov 1, 2014 · 3 comments

Comments

@grosenberg
Copy link

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."

@grosenberg grosenberg changed the title Unexpected code generation location behavior -- on Windows / Antlr 4.4 Unexpected code generation location behavior Nov 1, 2014
@WalkerCodeRanger
Copy link

I also ran into this issue

@mike-lischke
Copy link
Member

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.

@parrt
Copy link
Member

parrt commented Nov 4, 2017

Closed by #2065

@parrt parrt closed this as completed Nov 4, 2017
@parrt parrt added this to the 4.7.1 milestone Nov 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants