Make it so the action, instead of returning just the direct value of the current expression, adds it to a list. At each stage you build the direct value of that stage, concatenate the lists from that stage's children, and then add the direct value, so that the final result of the parse is the full list of values.

If this is not convenient to do in the conventional way, by passing the lists upwards, you can use the per-parse variable to contain the list.

Another possibility, and perhaps easier to conceptualize, is to return an AST and post-process it in order to accumulate the lists.

-- jeffrey

On 06/26/2014 04:27 AM, Ion Toloaca wrote:

    Hello Jeffrey,


Thank you for your answer, and indeed this might be the solution I'm looking for - and I would have stopped here if I wanted just one match per notation - but the problem is that there is only 1 actual value returned by actions at the end of the parse - however I want to get all the possible matches for all of my notations. For example '1=2=3' - I want to get 1=2 with 1,2 as argument then also 2=3, and also 1=2=3 with 1,2,3 as argument, and also with 1=2,3 as argument, and also 1,2=3 as arguments - can something like that really be compressed into 1 return value?


--
You received this message because you are subscribed to the Google Groups "marpa parser" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "marpa 
parser" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to