[antlr-interest] Extract all rules/lexems/keywords of a Language.g into XML format?

Ruslan Zasukhin ruslan_zasukhin at valentina-db.com
Thu Jun 9 11:52:37 PDT 2011


Hi All,
Hi Terrence,

We have meet task, where we may want be able extract from
    ANY ANTLR grammar

Description of all Rules, Keywords, Lexems, Imaginary Tokens ...
and put that info into e.g. XML format.


Actually this can be considered as transformation of ANTLR grammar into XML
form.

I believe will be possible and reverse task ... That XML back into ANTLR .g
grammar.


-------
We think next way is possible:

* you already have PARSER of any ANTLR grammar.

* it parses .g grammar and produce AST...

* it looks not to be difficult walk by that AST and output XML in this or
that form ...

* Or may be string templates can be used ...

* actually you already produce C, Java, C# outputs for a grammar.g
Why not add XML - as a general format?

What you think?



----------
Also we have see cTag tools, which can parse many languages,
And produce text output even without XML.
As you may know this tool targeted as Editor App helper library.
    
But I think, why ANTLR cannot be improved to produce similar output,
and kill cTag as a project :-)


--------
Another example of special but not wide tool is GCC-XML
    http://www.gccxml.org/HTML/Index.html


IMO, will be great to extend ANTLR in this way.
This will open new roads for its usage probably.

And this can be for us - users of ANTLR as easy as

    Option output = XML


What you think ?





-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]





More information about the antlr-interest mailing list