Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Forth > ANN: Backus-Nau...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 4015 of 4050
Post > Topic >>

ANN: Backus-Naur automation

by "David N. Williams" <williams@[EMAIL PROTECTED] > Apr 24, 2008 at 02:26 PM

This package has been available for more than a year on the web.
Only the documentation and comments have been revised since
then.  I've hesitated about announcing it -- partly because I'm
awed by Brad Rodriguez' bnf parser:

http://www.zetetics.com/bj/papers/bnfparse.htm

But it is a different approach, which generates Forth source
text definitions for parsing ANS Forth strings, from bnf
productions.

The bnf syntax for productions is no way as elegant as Brad's,
but the correspondence to bnf forms does aim to be fairly
straightforward.

Repetition forms are treated explicitly, with some unrolling
optimization.

The text output is formatted with indentations, and there are
words for outputting comments.  The generated output code uses a
control construct called ELSES, inspired by Wil Baden's THENS,
which assumes knowledge of the control stack.  It works with pfe
and gforth.

The generator itself is ANS Forth compatible with a few
environmental dependencies described in the comments.  It uses
the dynamic strings package with its string stack.  That could
no doubt be avoided, but why would you want to? :-)

A description of the bnf template sheme can be found in Sections
2 and 5 here:

http://www-personal.umich.edu/~williams/archive/forth/strings/expr.html

The generator includes an uncommentable example at the end.
Links for the generator, its example output, and another
example, in fact the whole shebang, are here:

http://www-personal.umich.edu/~williams/archive/forth/strings/index.html#parsegen

-- David




 2 Posts in Topic:
ANN: Backus-Naur automation
"David N. Williams&q  2008-04-24 14:26:09 
Re: ANN: Backus-Naur automation
Jonah Thomas <jethomas  2008-04-25 06:52:14 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon May 12 0:43:19 CDT 2008.