W3C home > Mailing lists > Public > public-rdf-dawg-comments@w3.org > February 2007

Re: SPARQL Antlr grammary

From: Seaborne, Andy <andy.seaborne@hp.com>
Date: Fri, 02 Feb 2007 18:42:25 +0000
Message-ID: <45C38611.6060702@hp.com>
To: Stephane Fellah <stephanef@imagemattersllc.com>
Cc: public-rdf-dawg-comments@w3.org



Stephane Fellah wrote:
> Hi,
> 
>  
> 
> I am looking for a SPARQL grammary for ANTLR that reflects the latest 
> change in the SPARQL  language specification. Currently the 
> specification document refers to JavaCC grammary. It would be a good 
> idea if the WG provides also an ANTLR grammary for the language. Is 
> anyone working on this ? Thanks in advance.

There's no ANTLR grammar that I'm aware of.  If you find one, or make one, 
please add it to the parsers & grammar section of:

http://esw.w3.org/topic/SparqlImplementations

The working group does not provide grammars other that that in the SPARQL 
document.

The JavaCC one is the one I use to produce the HTML in the SPARQL QL document 
- it is also one of the parsers in ARQ so it gets tested as well.  I happened 
to make it available but it has no endorsement from the working group (e.g. 
the AST it generates is my design).

I've used both JavaCC and ANTLR.  The fact that ANTLR requires a runtime 
library has caused me problems when integrating with other systems which also 
have an ANTLR-generated parser but a different version of ANTLR (at variuous 
times, Forte, Groovy).  JavaCC does not require a special runtime library.

JavaCC can generate HTML which is part of what goes into to making the QL grammar.

Eric provides other grammars via yacker [1].  He uses the HTML from the 
document as input to generate the required files for parser generators for C, 
C++, Perl and Python.  Maybe you can add an ANTLR generator to that.  We get 
to check it easy to use with other parser generator (JavaCC is modified LL - 
others are LALR(1)).  But the one true grammar is the HTML one in the document.

	Andy

[1] http://www.w3.org/1999/02/26-modules/User/Yacker
Received on Friday, 2 February 2007 18:42:54 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:14:51 GMT