W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > October to December 2006

lexer ambiguity in SPARQL

From: Eric Prud'hommeaux <eric@w3.org>
Date: Wed, 27 Dec 2006 22:41:39 +0100
To: public-rdf-dawg@w3.org
Message-ID: <20061227214139.GB4870@w3.org>
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.
-- 
-eric

office: +1.617.258.5741 NE43-344, MIT, Cambridge, MA 02144 USA
cell:   +1.857.222.5741

(eric@w3.org)
Feel free to forward this message to any list for any purpose other than
email address distribution.

Received on Wednesday, 27 December 2006 20:42:18 GMT

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