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 11:37:23 +0000
Message-ID: <459A43F3.1060909@hp.com>
CC: Eric Prud'hommeaux <eric@w3.org>, public-rdf-dawg@w3.org



Seaborne, Andy wrote:
> 
> 
> 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

Or even the correct:

QNAME_LN   ::= QNAME_NS NCNAME

	Andy

> 
> (LN = LocalName)
> 
> 	Andy
> 
> 
> 
> 
> 
> 
> 
Received on Tuesday, 2 January 2007 11:37:35 GMT

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