> OK! Quiz time! The following are off the top of my head, and untested:
>
> 1.) :start ::= A A ~ 'a'
>
> A is a lexeme and, yes, a lexeme should be OK as the start symbol.
Good.
> 2.) A ::= B C B ~ 'b' C ~ 'aa' B
>
> A lexeme is *NOT* OK on the RHS of an L0 rule,
Good. That is easy to check for.
> so B is *NOT* a lexeme.
After the ruling above this is 'Six of one ...'.
The two facts of
(a) Being LHS of ~, and RHS of ::= ==> lexeme
(b) Being RHS of ~ ==> not lexeme
are simply in conflict. Depending on the order we encounter the rules
we can error as either
(i) Illegal use of lexeme X on the RHS of match rule ....
or (ii) Illegal use of plain lex symbol X as a lexeme.
In the given example it would be (IMHO) error (i). But that is a bit
of a detail.
The simple rule of "Lexeme forbidden on RHS of ~" is what I had hoped
for. Simple checking, and the lexemes form a neat layer on top of the
L0, at the bottom of G1.
> Since the grammar is ill-formed, I'll pass on the question about <C>.
No problem. With the ruling on B it became moot.
> I'll deal with the last 3 separately.
> I hope this helps!
Yes, it did, 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.