What causes a libmarpa rule step to have its argument list start at stack position -1?

2014-09-15 Thread Dylan Ede
I have just bumped into a situation where the valuator always produces a 
rule step that has arguments beginning from -1 for a particular rule. The 
rule is a sequence of 5 symbols, and is also the start rule. The first two 
are the same terminal symbol. marpa_v_arg_0 gives -1. marpa_v_arg_n gives 
3. When this rule step is reached, there are only 4 items on the stack, 
corresponding to the last 4 symbols in the rule. According to the libmarpa 
documentation, marpa_v_arg_0 never fails, and returns a valid stack 
position. -1 is not a valid stack position, so what's gone wrong? This 
problem only occurs when the first two symbols are a particular symbol. Is 
there something I must have done wrong with this symbol?

Other than this problem, I must say that libmarpa is a quite brilliant 
library for parsing.

-- 
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.


Re: What causes a libmarpa rule step to have its argument list start at stack position -1?

2014-09-15 Thread Ruslan Shvedov
Reading the libmarpa doc: the application must maintain the stack ensuring
that it has the correct size for the valuation steps —
http://jeffreykegler.github.io/Marpa-web-site/libmarpa_api/latest/Maintaining-the-stack.html#Maintaining-the-stack
— hope this helps.

On Mon, Sep 15, 2014 at 2:30 PM, Dylan Ede dylan...@googlemail.com wrote:

 I have just bumped into a situation where the valuator always produces a
 rule step that has arguments beginning from -1 for a particular rule. The
 rule is a sequence of 5 symbols, and is also the start rule. The first two
 are the same terminal symbol. marpa_v_arg_0 gives -1. marpa_v_arg_n gives
 3. When this rule step is reached, there are only 4 items on the stack,
 corresponding to the last 4 symbols in the rule. According to the libmarpa
 documentation, marpa_v_arg_0 never fails, and returns a valid stack
 position. -1 is not a valid stack position, so what's gone wrong? This
 problem only occurs when the first two symbols are a particular symbol. Is
 there something I must have done wrong with this symbol?

 Other than this problem, I must say that libmarpa is a quite brilliant
 library for parsing.

 --
 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.


Re: What causes a libmarpa rule step to have its argument list start at stack position -1?

2014-09-15 Thread Dylan Ede
Just to clarify, the problem is that marpa_v_arg_0 returns -1, when the 
documentation explicitly specifies that it should never do so.

On Monday, 15 September 2014 12:30:28 UTC+1, Dylan Ede wrote:

 I have just bumped into a situation where the valuator always produces a 
 rule step that has arguments beginning from -1 for a particular rule. The 
 rule is a sequence of 5 symbols, and is also the start rule. The first two 
 are the same terminal symbol. marpa_v_arg_0 gives -1. marpa_v_arg_n gives 
 3. When this rule step is reached, there are only 4 items on the stack, 
 corresponding to the last 4 symbols in the rule. According to the libmarpa 
 documentation, marpa_v_arg_0 never fails, and returns a valid stack 
 position. -1 is not a valid stack position, so what's gone wrong? This 
 problem only occurs when the first two symbols are a particular symbol. Is 
 there something I must have done wrong with this symbol?

 Other than this problem, I must say that libmarpa is a quite brilliant 
 library for parsing.


-- 
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.