I have just uploaded Marpa-R2 2.077_011
<https://metacpan.org/release/JKEGL/Marpa-R2-2.077_011> to CPAN. The
high-level ASF interface is now documented
<https://metacpan.org/pod/release/JKEGL/Marpa-R2-2.077_011/pod/ASF.pod>. At
the high-level, there's no talk of symches and factoring and memoization
is done for you. (OK, actually I do mention symches and factorings, but
it's all relegated to section at the end which you can skip.) You write
a "traverser" subroutine which is very like the action for of an AST
node. It has access to the rule ID, the literal input span, the values
of the child symbols, etc. Of course, the traverser has to deal with
ambiguity, and this motivates two differences:
First, it's unified -- there is only one traverser subroutine. Instead
of multiple actions attached to rules, there's only one traverser and
you'll need to write your own if-else or similar logic to perform
whatever per-rule logic there is. This is because, due to ambiguity,
each ASF glade (the ASF equivalent of an AST's tree node) might involve
several rules.
Second, there's an iterator, $glade->next(). This lets you step through
the alternatives at a glade.
It is still tree traversal, so it's not trivial, but I hope it's a less
daunting place to start than the low-level interface.
-- jeffrey
--
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/groups/opt_out.