[antlr-interest] antlr suitable for xml languages? (likebpelandare there existing grammaires)

Scott Stanchfield scott at javadude.com
Thu Dec 15 05:49:19 PST 2005


lol... (with you, not at you ;)

The way I've written ANTXR generally assumes that you'd be using an XSD or
DTD to do the actual "validity checking", and that you're just using ANTXR
to give structure to your understanding of the XML. That's optional of
course, and you could really use the grammar to do that validation.

I don't think I'd recommend that though. My intent was to keep the ANTXR
grammar very simple, clean, and readable.

Later,
-- Scott



> -----Original Message-----
> From: antlr-interest-bounces at antlr.org 
> [mailto:antlr-interest-bounces at antlr.org] On Behalf Of Ian Kaplan
> Sent: Wednesday, December 14, 2005 11:42 PM
> To: antlr-interest at antlr.org
> Subject: Re: [antlr-interest] antlr suitable for xml 
> languages? (likebpelandare there existing grammaires)
> 
> 
> > Scott, what would one gain from using ANTXR rather than a 
> standard XML 
> > parser validating with an XSD/DTD.
> 
>   This directed at Scott, but I hope you'll forgive me if I throw in
>   by two cents...
> 
>   There are reasons to use XSD - mainly that they're standard.
> 
>   However, the validation of a document against an XSD is, as far as I
>   can tell, undefined.  The XSD does not actually define a grammer in
>   any form that is formally defined.  For example, LL(1), LR(1),
>   LALR(1) etc...  The validators seem to do recursive tree matching.
>   Just because something validates does not mean it is correct.
> 
>   In contract, if you uses an real grammar with real validation (as
>   ANTLR does), you would have a defined validation and reliability.
> 
>   Seeing what has been done with XSDs, I have had to wonder if anyone
>   who worked on this stuff ever took an undergrad compiler course.
> 
>   Ian (who is not a huge fan of W3C)
> 




More information about the antlr-interest mailing list