* Tim Bunce wrote in perl.perl6.internals:
>Here's a related idea: write a tool that reads BNF grammar, such as
>http://java.sun.com/docs/books/jls/third_edition/html/syntax.html
>http://java.sun.com/docs/books/jls/third_edition/html/grammars.html
>and writes a parser in Perl 6 for that grammar.

I would be very interested in (using) a tool that reads many types of
formal grammars and makes it easy to transform them to other formalisms.
I am currently finishing up a free software library that decides any
context-free language and the intersection and complement of languages
it decides, focused on validation against web standards (is this string
a syntactically correct 'mailto' URL, HTTP header value, JSON document,
HTML attribute value, etc.)

For it to be useful, the grammars for the various specifications need
to be in a format my library understands; unfortunately there are very
many BNF variants in use (the IETF generally uses its ABNF, the W3C
tends to use the EBNF format defined in the XML specification, ...) and
my library accepts only its own formalism (an XML format based on RELAX
NG, a schema language for XML document validation).

Tools that can read these BNF variants into a common object model, or
otherwise make it easy to convert one formalism into another would be
the main missing link to put my library into practical use in tools
like <http://validator.w3.org/>. So work on the first half of the
problem above would be very welcome.

My plan is in principle to make my formalism sufficiently powerful so
that all these BNF variants can be mapped 1:1 to it; then get people to
extract and convert the grammars in the various specifications, and put
them in some repository. From there on, using them for other formalisms
like Perl 6 Rules would start with simple tree transformations rather
than writing another parser (or at least comperatively simple, if you
are bad at writing parsers like I am).
-- 
Björn Höhrmann · mailto:[EMAIL PROTECTED] · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 

Reply via email to