John Darrington <[EMAIL PROTECTED]> writes: > On Tue, Sep 23, 2008 at 09:19:26PM -0700, Ben Pfaff wrote: > > I also think this would be nice to have. It is a problem that I > did some work on a few years ago. It is not too hard to write a > parser generator that accepts a context-free grammar for PSPP > syntax and outputs C code to parse it, and in fact I did most of > the work necessary for that. > > Really? As I understand it, the example that I've given means that the > grammar is not context-free.
The grammars for many languages are not strictly context-free, but compiler writers still write context-free grammars for them and work around them in various ways. The C language, for example, famously is not context-free due to the syntax for "typedef", but that does not stop us from using yacc to parse it. (Usually, you add a little bit of intelligence to the lexer, and that's what I planned to do too.) -- Ben Pfaff http://benpfaff.org _______________________________________________ pspp-dev mailing list [email protected] http://lists.gnu.org/mailman/listinfo/pspp-dev
