On 01/04/2009, at 3:00 AM, Emmanuel Onzon wrote: [] I have a view that Dypgen's technology is worth trying to see what obstacles come up in practice.
It is already clear that GLR is not as powerful as a novice like myself might believe from the mathematical capabilities: conflict resolution happens at unexpected places. It seems Felix is about to undergo some serious feature chopping and downsizing, and a move away from trying to appeal to C/C++ programmers. This may allow some redesign of the grammar to be a bit more consistent and less likely to lead to conflicts. There are a couple of really bad cases (where a C style declaration looks like an expression ..) I'm particularly interested in second order dynamics, that is: at the moment a *fixed* grammar is used to load the Felix grammar. Let's call that fixed grammar the meta-grammar. At present, the meta-grammar can't extend itself. That would be interesting to implement! In principle this only requires the Ocaml function calls that extend the grammar to be wrapped in Scheme. Of course doing that makes a stable Dypgen interface more important (because the Scheme is hard to debug). Why would you want this? Well I have already got a bit bored changing a basic BNF grammar into a EBNF meta-grammar, that is, a grammar with "regular expressions" added on top. The problem is that you can add * + ? [] etc symbols but soon it is unworkable to use regular expressions and you want to use regular definitions instead. Also the Dypgen priority information has to be parsed and sent to Dypgen, probably using several "short cuts", since for basic use it is too flexible. Just as an example, to add a new statement Felix would need an "add_statement" feature. It is only a special case that grafts a new statement production onto the end of a long list of statements, but it is easy to characterise .. but it is not general enough a feature to add a new infix operator. Adding new (infix/prefix/postfix) operators is again a special case that should have special meta-grammar support. It doesn't handle weird things like ternary operators, stuff like "match" expression (with list of branches etc), but it eliminates the need to know the intimate details of the grammar to get the recursion right and ensure there's no ambiguity except where it is desired. Why is this important? Well, I tried to implement SQL as a loadable grammar .. SQL is an important language to support .. it is also quite complex and rather bigger than I had hoped, and I found that writing out the productions long hand was extremely painful .. in fact I have a machine readable formal definition already, it just doesn't happen to be the one Felix accepts. If the meta-grammar were itself programmable I might be able to load the SQL definition directly (or at least with minimal editing). -- john skaller skal...@users.sourceforge.net ------------------------------------------------------------------------------ _______________________________________________ Felix-language mailing list Felix-language@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/felix-language