get stream position in the past

6 views
Skip to first unread message

Durand Jean-Damien

unread,
May 15, 2013, 10:55:28 AM5/15/13
to marpa-...@googlegroups.com
Jeffrey,

Given a G1 level, a dot position and a rule ID, is it possible to get the corresponding stream position ?

For example, I am at G1 level 13, and I wonder what was the stream position of G1 level 10, because I found something of interest in it at rule id 2 and dot position 1.

Thanks, Jean-Damien.

Jeffrey Kegler

unread,
May 15, 2013, 11:34:36 AM5/15/13
to marpa-...@googlegroups.com
G1 "level"? Is this G1 location (Earley set)? -- 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 marpa-parser...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Durand Jean-Damien

unread,
May 15, 2013, 3:21:42 PM5/15/13
to marpa-...@googlegroups.com
Yes

Jeffrey Kegler

unread,
May 15, 2013, 3:28:18 PM5/15/13
to marpa-...@googlegroups.com
A stream span (that is, start and length) can be found as a function of G1 location.  If you are trying to conceptualize the location of the G1 parse in terms of a specific position in the G0 input, you'll most often think of the Earley set's location as being the end of that span (start + length).  I'll add a method to return the stream span for an arbitrary G1 location after I get the indexed release out today.  -- jeffrey

Durand Jean-Damien wrote:
Reply all
Reply to author
Forward
0 new messages