[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Savannah-hackers] savannah.gnu.org: submission of BNF Parser Generator
From: |
bsod |
Subject: |
[Savannah-hackers] savannah.gnu.org: submission of BNF Parser Generator |
Date: |
Wed, 05 Dec 2001 19:14:29 -0500 |
A package was submitted to savannah.gnu.org.
This mail was sent to address@hidden, address@hidden
Bert van der Weerd <address@hidden> described the package as follows:
License: gpl
Other License:
Package: BNF Parser Generator
System name: bnf
This package does NOT want to apply for inclusion in the GNU project
The BNF project was concieved some 10 years ago by Han Leusheus and
implemented by me, Bert van der Weerd (address@hidden). BNF is a
parser-generator that takes a BNF-style syntax and generates a \\\"C\\\" parser
for
that syntax. Ofcourse we know of the existence of flex and bison, and
i\\\'ve used these two, but BNF is more
lightweight and more direct to use. It can generate both file i/o based
parsers and string i/o based parsers.
The BNF program is a simple commandline tool, and uses gnu coding
standards for both the commandline parsing and the ./configure;make install
paradigm.
What is missing at the moment is documentation. For that i\\\'ll probably
use \\\'screen\\\' as an example as it has good documentation.
Han Leushuis is already looking at some theoretical improvements to the
program, for example the use of variables in the grammar. I would like
to implement multi-language output, more specific: Perl and C.
an example expression in BNF would be:
expr = \\\'(\\\' expr \\\')\\\' | num \\\'*\\\' num | num \\\'/\\\' num | num
\\\'+\\\' num |
num \\\'-\\\' num | \\\'-\\\' num;
or; to produce output:
expr = { \\\'foo\\\' `bar` | . } ;
where all \\\'foo\\\' is replaced by bar, and the dot matches (and echos)
any character.
Ideas that we want to implement:
$var = \\\'(\\\' expr \\\')\\\' ;
expr = $var | num (\\\'*\\\' | \\\'/\\\' | \\\'+\\\' | \\\'-\\\') num |
\\\'-\\\' num;
which demonstrates the proposed use of variables.
This program is *not* a replacement of bison/flex, but is can and has
been succesfully used in some lightweight applications. We would like to
take it all a step further and become a nice cool GNU project.
It already exists and you can see it at:
http://www.xs4all.nl/~bsod/bnf-1.6.4.tar.gz
This program is partly written in BNF itself, ofcourse;)