2
votes

I'm developing an ANTLR grammar to fill in some gaps in text. It's like that:

<% SOME_STATEMENT_TO_BE_REPLACED >

My problem is, that I have to target multiple languages with ANTLR3's (4 is possible) codegen. The statement I have to replace is actually a Query for some business logic (there's existing code, I just replace a parser).

I wonder whether I can make use of some features of ANTLR that switch to language templates like:

options {
    language=CSharp3;
    output=AST;
    ASTLabelType=CommonTree;
}

Is there some meta-syntax which I can use across C#, Java and C++?

1

1 Answers

1
votes

Is there some meta-syntax which I can use across C#, Java and C++?

No, there is no such thing in ANTLR. You'll have to do such a replacement yourself.