Reputation: 10236
Where is the process of creating a new language target for ANTLR discussed? Though it seems like it was some common knowledge with ANTLR3 due to the number of targets that were available, I'm not seeing any documentation bundled in the source-code, nor have I found any obvious places with Google.
I'd expect to not find any such documentation for ANTLR4, but I'm not seeing any, at all.
Upvotes: 2
Views: 401
Reputation: 99869
The process for ANTLR 3 and ANTLR 4 are completely different.
One approach, but probably not the only approach, can be inferred from the source control history for the C# target. Beyond that, you should have an excellent understanding of the data structures available and used both in Java and your target language. The runtime algorithms are extremely sensitive to things like the way hash codes are calculated and used for storing objects in maps, so the behavioral semantics of the Java target would need to be preserved in exact detail, even if that means the resulting code does not look like the Java target.
Upvotes: 2
Reputation: 170158
At the time of this writing, there is no guide how to create a new ANTLR target. Sam Harwell, co-autor of ANTLR4, and author of the C# target, has started making notes on how to create a new target, but it's not complete (yet).
One interested in writing a new target could look how the C# is implemented (and the original Java target of course). But realize it is by no means a trivial task!
Upvotes: 1