Re: ebnf

* Dave Pawson <dave.pawson@gmail.com> [2012-11-29 05:55 -0500]:
> http://dev.w3.org/cvsweb/2000/10/swap/grammar/ebnf2turtle.py
> 
[snips]
> 
> Syntax is checked according to XML 1.1 syntax definition
> http://www.w3.org/TR/2004/REC-xml11-20040204/#sec-notation

Group: I've also found an EBNF parser which can generate a syntax
checker for any EBNF grammar (useful!).  It can generate in C, C++,
Perl, and Python (but Python is not done according to the website)  The
links to the online version, and help page, are below.

Online version: http://www.w3.org/2005/01/yacker
Help and install instructions: http://www.w3.org/1999/02/26-modules/User/Yacker

Dave P. was able to get our grammar to parse correctly, but the darn
thing eats CR/LF/CRLF combinations as part of its parsing, so that would
need to be worked on to get the syntax checking correct.

The grammar he got to parse is below.

	Document ::= Para
	Term      ::= (#xD #xA | #xA #xD | #xD | #xA)
	Bl ::= WS* Term
	Para ::= SP? SP? SP? Text+  Term Bl
	WS        ::= (SP | HT)+
	@terminals
	SP        ::= #x20
	HT        ::= #x9
	CR        ::= #xD
	LF        ::= #xA
	Text ::= [^#xA#xD]

This will at least tell us the EBNF is correct, just like the
ebnf2turtle.py script above.

Regards,
-- 
dave [ please don't CC me ]

Received on Friday, 30 November 2012 14:04:17 UTC