Hello all,

I've written a quick few hundred lines of Chicken Scheme that converts
BNF-esque grammars such as:

(s-expression
 . (choice
    (seq "(" (one-or-more s-expression) "." s-expression ")")
    (seq "(" (zero-or-more s-expression) ")")
    (seq "\"" string "\"")
    (seq "#(" (zero-or-more s-expression) ")")
    (seq "#" symbol)
    (seq ":" symbol)
    (seq symbol ":")
    symbol
    number
    (seq "'" s-expression)
    (seq "`" s-expression)
    (seq "," s-expression)
    (seq ",@" s-expression)))

(symbol
 . (choice
    (seq "|" (one-or-more character) "|")
    (seq symbol-first-character (zero-or-more
symbol-subsequent-character))))

Into SVG syntax diagrams such as:

http://love.warhead.org.uk/~alaric/junk/sexpr.svg

It uses matchable and sxpath-lolevel (from the sxpath egg) - the latter
for turning the sxml representation of SVG into yucky XML.

If it's of use to anybody else (I wrote it so I could draw syntax
diagrams for the constructed language Lojban - see
http://love.warhead.org.uk/~alaric/junk/lojban.svg for a more stressful
workout of the layout engine), I'd like to put it in an egg, please!

ABS

--
Alaric Snell-Pym
http://www.snell-pym.org.uk/alaric/

_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to