On Sun, 2007-06-24 at 17:40 +0200, Emmanuel Onzon wrote: > Note that mutable store is problematic with GLR parsing. Because > it can result in undesirable interactions between distinct GLR > threads that should be independent. > For instance global_data and local_data should be immutable.
You might look at how Elkhound handles this. It allows a mutable store with an 'undo' method (since C++ isn't so hot at functional data structures). If a parse is abandoned (Giveup) the undo method is applied. Dypgen also introduces a propagation problem. Since the data goes out of scope when the containing production of an action is reduced, it cannot implement L-attributed grammars automatically. I note that mutable store isn't really a problem UNLESS several productions match the input. Now if you consider the problem of parsing C, then you know it requires keeping a list of typedef names: this is usually done by pushing a list when the typedef is reduced, and popping it when the typedef goes out of scope. For C++, with namespaces and classes, this is very much more complex. BTW: whilst the global/local_data thing works .. it isn't very nice interface .. it doesn't "feel" very functional. FYI: Felix uses Ocaml classes for lexing .. they're mutable, because they have to store a list of user defined keywords. Really this should be handled by the parser.. not sure how to do this (yet :) -- John Skaller <skaller at users dot sf dot net> Felix, successor to C++: http://felix.sf.net ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Felix-language mailing list Felix-language@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/felix-language