Yes, e.g. in Marpa::R2 test suite —
https://github.com/jeffreykegler/Marpa--R2/blob/master/cpan/t/sl_json_ast.t

parse()
<https://github.com/jeffreykegler/Marpa--R2/blob/master/cpan/t/sl_json_ast.t#L289>
--
produces an abstract syntax tree (ast) of JSON test, decode()
<https://github.com/jeffreykegler/Marpa--R2/blob/master/cpan/t/sl_json_ast.t#L301>
traverses
it to produce a data structure.

Another example
<https://github.com/jeffreykegler/Marpa--R2/blob/master/cpan/t/sl_timeflies.t>:
ast is produced by calling value()
<https://github.com/jeffreykegler/Marpa--R2/blob/master/cpan/t/sl_timeflies.t#L137>
on recognizer, bracket()
<https://github.com/jeffreykegler/Marpa--R2/blob/master/cpan/t/sl_timeflies.t#L143>
walks
the tree.

There is also a gist from the author —
https://gist.github.com/jeffreykegler/4747725

Hope this helps, rns.



On Mon, Sep 1, 2014 at 8:26 PM, Ed Avis <e...@waniasset.com> wrote:

> I would like to use Marpa::R2 to parse a document and produce a data
> structure showing the syntax tree of the document.  Then I'll walk down
> that
> tree with my own code.  Is there a straightforward recipe to do this?
>
> --
> Ed Avis <e...@waniasset.com>
>
> --
> 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 marpa-parser+unsubscr...@googlegroups.com.
> 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 marpa-parser+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to