[antlr-interest] Targeting different runtimes with the same grammar

Des des at deshartman.com
Sat May 9 15:45:55 PDT 2009


Chris

The way I did it was to write stubs in the member section that I then  
override. It is not completely target agnostic, but allows you to  
maintain simpler grammar files where you only have to change the stubs  
for the target language

Thanks
Des Hartman
+614 01 277 115
iPhone junky

On 09/05/2009, at 7:59, Chris Lambrou <chris at lambrou.net> wrote:

>
> Is there a recommended way of writing a grammar so that it can be  
> used to target different runtimes?  I'd like to be able to use the  
> same grammar to target both C# (for use in an ASP.NET server  
> application) and in JavaScript (for use by clients). The ANTLR book  
> is filled with examples of how useful it can be to embed Java code  
> within the grammar, but this couples the grammar to a specific  
> runtime, which is something I'm explicitly trying to avoid.
>
> Regards,
>
> Chris
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20090510/bfb0dc34/attachment.html 


More information about the antlr-interest mailing list