W3C home > Mailing lists > Public > public-multilingualweb-lt@w3.org > April 2013

RE: [Action-484] Create an ABNF based on http://lists.w3.org/Archives/Public/public-multilingualweb-lt/2013Apr/0047.html

From: Pablo Nieto Caride <pablo.nieto@linguaserve.com>
Date: Tue, 16 Apr 2013 18:29:13 +0200
To: "'Jirka Kosek'" <jirka@kosek.cz>
Cc: <public-multilingualweb-lt@w3.org>
Message-ID: <060c01ce3abf$88103090$983091b0$@linguaserve.com>
Hi Jirka, Felix, all,

This the ABNF I created based on http://www.w3.org/TR/xmlschema-2/#nt-charClass that covers pretty much the subset Yves and Shaun proposed:
Subset:
1. character classes [abc]  [a-zA-Z_\-]
2. ranges [a-c]
3. negations [^abc]
4. "^" and "]" must never appear unless backslash-escaped
5. "-" may be backslash-escaped
6. escape sequences "\n", "\r", "\t", "\d", and "\D"
7. literal "\" is escaped as "\\"

The rules of the ABNF are:

[1] charClass ::= charClassEsc | charClassExpr | WildcardEsc

[2] charClassEsc ::= SingleCharEsc | MultiCharEsc

[3] SingleCharEsc ::= '\' [nrt\|.?*+(){}#x2D#x5B#x5D#x5E]

[4] MultiCharEsc ::= '\' [dD]

[5] charClassExpr ::= '[' charGroup ']'

[6] charGroup ::= posCharGroup | negCharGroup | charClassSub

[7] posCharGroup ::= ( charRange | charClassEsc )+

[8] charRange ::= seRange | XmlCharIncDash

[9] seRange ::= charOrEsc '-' charOrEsc

[10] charOrEsc ::= XmlChar | SingleCharEsc

[11] XmlChar ::= [^\#x2D#x5B#x5D]

[12] XmlCharIncDash ::= [^\#x5B#x5D]

[13] negCharGroup ::= '^' posCharGroup

[14] charClassSub ::= ( posCharGroup | negCharGroup ) '-' charClassExpr

[15] WildcardEsc ::= '.'

It's pretty much the same as the nt-charClass, I just removed some rules and tokens that we didn't really needed as Jirka suggested.

Now if memory serves we need a RELAX NG schema to validate the grammar, don't we? Or are we going to use the regex finally?

Cheers,
Pablo.
------------------------------------------------------------------------------------
-----Mensaje original-----
De: Jirka Kosek [mailto:jirka@kosek.cz] 
Enviado el: martes, 16 de abril de 2013 11:38
Para: Pablo Nieto Caride
CC: public-multilingualweb-lt@w3.org
Asunto: Re: [Action-484] Create an ABNF based on http://lists.w3.org/Archives/Public/public-multilingualweb-lt/2013Apr/0047.html

On 16.4.2013 11:30, Pablo Nieto Caride wrote:

> I assume both are valid, in that case do we have any preference? 

These are just variations. Personally I prefer W3C style, it's more readable to normal reader IMHO.

				Jirka


--
------------------------------------------------------------------
  Jirka Kosek      e-mail: jirka@kosek.cz      http://xmlguru.cz
------------------------------------------------------------------
       Professional XML consulting and training services
  DocBook customization, custom XSLT/XSL-FO document processing
------------------------------------------------------------------
 OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 rep.
------------------------------------------------------------------
    Bringing you XML Prague conference    http://xmlprague.cz
------------------------------------------------------------------
Received on Tuesday, 16 April 2013 16:29:42 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:32:07 UTC