Hi Alan, I had meant to send my original reply to the list as well, so no worries...
On 09/12/2010 12:45 PM, Alan Post wrote: > On Thu, Dec 09, 2010 at 12:36:09PM -0800, Gordon Tisher wrote: >> On 09/12/2010 12:01 PM, Alan Post wrote: >>> I'm working on my PEG parser, in particular the interface between >>> the parse tree and the code one can attach to productions that >>> are executed on a successful parse. >>> >> If you want to select only certain results from a sequence, use >> variables to capture their results and an action to return the result of >> any desired function of their values: >> >> Rule <- &a:x "c":y -> f(x,y) > > Does your example imply: > > Rule <- &a "c" -> f() My apologies; I was thinking in terms of OMeta (the OMeta and PEG lists go into one folder in my mail client), where variable bindings and semantic actions are explicit, so my response might not be that useful to you. > That is, if no rules are tagged, there are no arguments to f? > > Des it also imply: > > Rule <- &a:y "c":x -> f(x,y) > > Namely, that order of tagged rules doesn't matter, and that the > signature for |f| accepts keyword arguments rather than positional > arguments? Again, I was thinking of OMeta, where all this is explicit, so Peter's response is probably more helpful... -- Gordon Tisher http://balafon.net _______________________________________________ PEG mailing list PEG@lists.csail.mit.edu https://lists.csail.mit.edu/mailman/listinfo/peg