W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > January to March 2007

Re: lexer ambiguity in SPARQL

From: Seaborne, Andy <andy.seaborne@hp.com>
Date: Tue, 02 Jan 2007 10:42:17 +0000
Message-ID: <459A3709.5020807@hp.com>
To: Eric Prud'hommeaux <eric@w3.org>
CC: public-rdf-dawg@w3.org



Eric Prud'hommeaux wrote:
> Matching "abcd:" against QName,
>   [66]    QName    ::=    QNAME | QNAME_NS
>   [69]    QNAME_NS    ::=    NCNAME_PREFIX? ':'
>   [70]    QNAME    ::=    NCNAME_PREFIX? ':' NCNAME?
> I get two possible solutions:
>   QNAME_NS and QNAME
> 
> The only reference to QName is in
>   [65]    IRIref    ::=    Q_IRI_REF | QName
> so I think we can just change QNAME to not have the NCNAME optional.
>   [70]    QNAME    ::=    NCNAME_PREFIX? ':' NCNAME
> 
> In some sense, lexer ambiguities don't exist in lex; the winner is the
> first, longest production to match the input string, but it does make
> life harder for parser writers.

OK - good idea - changed to:

QNAME_NS   ::= NCNAME_PREFIX? ':'
QNAME_LN   ::= QNAME_NS ':' NCNAME

(LN = LocalName)

	Andy
Received on Tuesday, 2 January 2007 10:42:35 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:15:35 GMT