Sat 03 Sep 2005

An EBNF parser for CL-Yacc

As I alluded to in a previous post, I've written a simple EBNF extension for CL-Yacc, the Common Lisp LALR(1) parser generator.

Today, when I have absolutely no free time, I decided to package it up, do some tidying, and test it on Allegro Common Lisp. Here it is. It'll take EBNF (at least, in the format used for W3C docs!) and spit out CL-Yacc productions, expanding EBNF operators (such as the Kleene Star) into intermediates, identifying terminals, and (if you like) defining the parser for you. It seems to work on ACL and SBCL 0.9.4. Of course, it doesn't do actions, and I haven't got it recognising comments, but it should be usable.

Read the comments at the start and the examples at the end of ebnf.lisp if you want more. Bug reports welcome. BSD licensed. Enjoy!

Now I ought to go and get dressed….

Posted at 2005-09-03 12:59:42 by RichardLink to An EBNF parser for…
Comments, trackbacks.

Google
Web holygoat.co.uk
  • richard is: