Quoting skaller <[EMAIL PROTECTED]>: > On Sat, 2007-07-14 at 20:08 +0200, Emmanuel Onzon wrote: >> Quoting skaller <[EMAIL PROTECTED]>: > >> > Dypgen will then call a merge function which by default >> > choses the latest definition, our new one. >> >> Note that it is not possible to know which AST is chosen by the >> default merge function. That's why the default merge function >> should be only used when the two AST are the same. > > Ouch. Is there a way to fix that, eg priorities?
I don't think there is a simple way to solve this with priorities. Here is something that should work: Each action that is added by the user is numbered increasingly, and instead of just returning an s-expression it also returns its number. Then you can write a merge function that selects the AST that is coupled with the highest number, this ensures that you keep the tree that was built by the most recent action. You would have an "action counter" stored in local_data. Note that instead of returning the number of the action you could alternatively return the max of the numbers returned by the arguments of the action and of the number of the action. Thus the number associated to an AST would be the number of the most recent action among all the actions used to build this tree and not just the number of the last action called to build it. Emmanuel ------------------------------------------------------------------------- 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 [email protected] https://lists.sourceforge.net/lists/listinfo/felix-language
