Hi Jeffrey,

I see what the problem is now and I have fixed it. For each token that is 
passed to the recogniser I give marpa an integer value that I use later to 
look up the actual value from a hash map. I come up with these integer 
values using a counter - the problem was that the counter started at zero, 
which presumably triggered the deprecated "valued/unvalued" feature, 
causing the first token (which would be given the value 0) to be treated as 
unvalued by the recogniser. Now that the counter starts at one, the problem 
has disappeared. Although this was an error entirely on my part, you may 
want to add a note to the documentation for value accessors about this 
behaviour in case someone else has a similar problem.

On Monday, 15 September 2014 13:55:43 UTC+1, Jeffrey Kegler wrote:
>
>  marpa_v_arg_0 is a very simple macro, designed for speed.  It is 
> initialized to -1 (an impossible value), so my guess is that you're using 
> it uninitialized -- that things are not yet set up properly.
>
> If this suggestion does not help, and if you could work up an example, I 
> can look into this.
>
> -- jeffrey
>
> On 09/15/2014 04:30 AM, 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 [email protected] <javascript:>.
> 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