[antlr-interest] EBNF - XML representations

Yauhen Yakimovich eugeny.yakimovitch at gmail.com
Mon Apr 25 12:37:47 PDT 2011


No, you haven't missed anything at all. One just has to built such a
tree walker and define a respective XML document format.
But again that would be solely an AST translation of ANTLR ("BNF")
grammar to its XML representation. One can also produce a concrete
syntax tree of parsed input in form of XML with respective syntax
markup (AST tags).

What's to relevant applications - pure curiosity and research.

On Mon, Apr 25, 2011 at 1:13 PM, Hiran Chaudhuri <Hiran.Chaudhuri at web.de> wrote:
> A grammar for parsing grammars is what ANTLR has builtin. How else would you define a grammar and make ANTLR generate the code?
> Once such a grammar is parsed an AST should be available.
>
> And since an AST is a tree structure, a simple TreeWalker could serialize it to XML.
>
> I do not see the big difficulty here. But as I have not followed the full discussion I may have missed a bit...
>
> Hiran
>
>
> -----Ursprüngliche Nachricht-----
> Von: "Ben Senior" <ben at autonomic.net>
> Gesendet: 24.04.2011 13:57:14
> An: antlr-interest at antlr.org
> Betreff: Re: [antlr-interest] EBNF - XML representations
>
> [...]
>>I'm not sure it is difficult at all to build a grammar for parsing
>>grammars, I am just less convinced as time goes by whether that's a
>>really useful thing to do.
> [...]
>



-- 
With best regards,
Y.Y.


More information about the antlr-interest mailing list