tokenize-ebnf.scm
is a tokenizer for EBNF in Scheme. Although it is [almost] useless without a parser --- and that is what I have issue arriving at!
I want this to be an educational experience, so I don't wish to resort to define-sytax
macros. Otherwise it would have been much simpler. Scheme's macros are a cheatcode tbqh. In fact, CLisp's macros are cheatcode too. Read 'Let Over Lambda' by Doug Hoyte. If I use macros here, I have doomed myself to be a Scheme Simp (Scsimp?) forever. I just don't want that.
So what I want is your help in creating a parser for EBNF that keeps in mind the recursive, context-free nature of it. EBNF was not meant to be parser, it was never created as an applicable language. I have loooked around and there are not that many parsers for EBNF around. It's a meta-grammar meant to be leared at and hooted at. Not parsed.
And I don't really need to parse it. I wanna write an ebnf2ps program. So this is enough really.
The problem is the 'nested' or 'recursive' nature of EBNF. For example:
my-rule ::= '>' int [ my-other-rule { ',' my-other-rule } ]
This kinda throws a wrench at the whole process.
Your help is much appreciated. (chubakbidpaa [at] riseup [dot] net)