"Bless" versus actions is just a TIMTOWTDI feature.  I found bless less
useful, to the extent I considered removing it in the forthcoming R3
Marpa.  But it has its fans.

If how bless works doesn't leap out at you, stick with actions -- they're
all I use.  You can learn how to use bless later -- or never.

The actions can generate an AST, or do all of the semantics immediately.
In fact you can generate an AST just using a default action:

:default ::= action => [name, values]

This separates the parsing from the semantics, so it's easier to visualize
what's going on.  Particularly for your first Marpa project, it's often
best to start with an AST.

The AST method is also quite powerful and, in terms of speed, reasonable,
so that you may wind up sticking with it as your final way of doing things.

On Tue, Mar 14, 2017 at 8:08 AM, Daniel Blanch <
daniel.blanch.batal...@gmail.com> wrote:

> Hi, I keep trying to understand the semantics of marpa. Forgive me if my
> questions are too basic.
>
> I've read the documentation, in particular this http://search.cpan.org/~
> jkegl/Marpa-R2-3.000000/pod/Semantics.pod.
>
> I've noticed that instead of using actions, it uses bless. I'm not sure if
> I have understand the reason well enough. What I understand is the
> following.
>
> 1) Marpa's bless, creates objects initializing it with the parse result of
> the rule instance
> 2) If the result of other subrules is blessed too, the parent rule will
> get a reference to the subrules blessed objects.
> 3) Doing so provides a somehow 'Semantic tree'
> 4) After parsing I'll get a reference of the root node i can use to
> traverse the whole tree and get the result this way.
>
> I'm I right?
>
> So, what's the difference with actions? Is it that with actions the result
> is computed on the fly? do actions use an AST then or do the parse and the
> result in just one step.
>
> What's the recomended way of using marpa to translate a language, bless
> adverb or action adverb?
>
> Than you very much in advance.
>
>
>
>
>
> On Monday, March 13, 2017 at 2:59:35 PM UTC+1, Daniel Blanch wrote:
>>
>> Hi Marpers,
>>
>> I've been using Marpa for a while, it seems promising, but I find it
>> difficult to understand how default actions and custom actions work
>> together when trying to get a result. Where can I find a tutorial or
>> documentation to understand it? How did you learn Marpa? Documentation is a
>> bit confusing.
>>
>> Thank you very much in advance.
>>
>> Regards.
>>
>> Daniel.
>>
> --
> 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