> (a)     X ::= C    C ~ 'cc' B    B ~ 'bb' A   A ~ 'a'    :discard ~ A
> 
> Forbidden.  <A> is required to be a lexeme since it is a discard symbol,

Oh! You are looking at discard symbols as a kind of the same thing as
lexemes, with lexemes the visible part, and discards hidden (*).

But from the perspective of the L0 both are at the top.
(And the same rules about RHS apply).

> and cannot appear on the RHS of an L0 rule.
> 
> (b)     X ::= C   C ~ 'cc'   B ~ 'bb' A   A ~ 'a'  :discard ~ A
> 
> <B> is *not* unreachable.  It is an L0 lexeme, since it is on an L0 LHS but
> not on any L0 RHS.  It might be helpful to imagine that, in L0, the lexemes
> are what the start symbol is in G1.  And, of course, start symbols are
> reachable by definition.

Right. And a d'oh moment for me.

> Re (6).  When the lexer finds discard and non-discard symbols at the same
> location, the discard symbols are ignored.  Discarded symbols are not
> passed up to G1 -- they're discarded!

And that nicely fits in with (*) above.

Ok. I believe I understand this quite a bit better now.

Thank you.

-- 
See you,
        Andreas Kupries <[email protected]>
                        <http://core.tcl.tk/akupries/>
        Developer @     SUSE

Tcl'2017, Oct 16-20, Houston, TX, USA. http://www.tcl.tk/community/tcl2017/
EuroTcl 2017, Jul 8-9, Berlin/DE, http://www.eurotcl.tcl3d.org/
-------------------------------------------------------------------------------




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