Discussion:
identifying "offending" L0 lexeme
Haroldo Stenger
2018-07-14 23:41:59 UTC
Permalink
hi, I'm making some progress with the grammar I've been fiddling with. I've
been handling the \s whitspace manually, and now I'm trying to let Marpa
handle it, tweaking the grammar in the complicated spots. In the
iterations, there appear different sorts of errors, this being particularly
difficult to handle and fix:

An L0 lexeme cannot appear on the RHS of an L0 rule
Marpa::R2 exception at ./gistfile2.pl line 34.
BEGIN failed--compilation aborted at ./gistfile2.pl line 85.


I'm given no hint of the lines or rules that are generating the conflict,
and I'm wondering if there is something I'm missing as of parameters to
Marpa to give different sorts of explicative errors.

The grammar in this stage looks like this:

:default ::= action => [name,values]
lexeme default = action => [ start, length, value ] bless => ::name
latm => 1

:start ::= body
body ::= elementbody+
elementbody ::= nclinelns | assigns | blocks
blocks ::= block+
block ::= begin body end | begin end body
begin ::= colon blockname nl | colon blockname colon
blockname nl
end ::= colonend blockname nl
nclinelns ::= nclineln+
nclineln ::= assign | noncolon linenl | nl
linenl ::= line nl

assigns ::= assign+
assign ::= manoizq | modelassign | manoizq eq manoder nl
modelassign ::= modelstr eq modelvalue
modelstr ~ 'Model'
modeltype ~ [a-zA-Z]+
modelvalue ~ [\ \:0-9a-zA-Z\(\)]+
eq ~ '='
manoizq ::= nombre
manoder ~
[\^\<\>\|\_\-\,\;\!\?\/\.\'\"\(\)\[\]\{\}\@\$\*\\\&\#\%\+\.0-9a-zA-Z\:\x{00e1}\x{00e9}\x{00ed}\x{00f3}\x{00fa}\
]+

nl ~ [\n]
line ~
[\=\^\<\>\|\_\-\,\;\!\?\/\.\'\"\(\)\[\]\{\}\@\$\*\\\&\#\%\+\.0-9a-zA-Z\
\:\x{00e1}\x{00e9}\x{00ed}\x{00f3}\x{00fa}]+
noncolon ~ [^:]
blockname ~ [A-Za-z]+
nombre ~ [A-Za-z]+

colon ~ ':'
colonend ~ ':e'
ws1 ~ [\s]+
:discard ~ ws1

any hint is really welcome

and thanks for Marpa, saying its great is no enough.

Haroldo
--
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/d/optout.
Haroldo Stenger
2018-07-15 00:37:54 UTC
Permalink
hi

I've just found the "offending" rule:

modeltype ~ [a-zA-Z]+

which got 'unreferenced' in one of the editings.
By trimming it , the error goes away.
I wonder how that rule can be the culprit of 'An L0 lexeme cannot appear on
the RHS of an L0 rule'. Any idea?

thanks!
Haroldo
Post by Haroldo Stenger
hi, I'm making some progress with the grammar I've been fiddling with.
I've been handling the \s whitspace manually, and now I'm trying to let
Marpa handle it, tweaking the grammar in the complicated spots. In the
iterations, there appear different sorts of errors, this being particularly
An L0 lexeme cannot appear on the RHS of an L0 rule
Marpa::R2 exception at ./gistfile2.pl line 34.
BEGIN failed--compilation aborted at ./gistfile2.pl line 85.
I'm given no hint of the lines or rules that are generating the conflict,
and I'm wondering if there is something I'm missing as of parameters to
Marpa to give different sorts of explicative errors.
:default ::= action => [name,values]
lexeme default = action => [ start, length, value ] bless =>
::name latm => 1
:start ::= body
body ::= elementbody+
elementbody ::= nclinelns | assigns | blocks
blocks ::= block+
block ::= begin body end | begin end body
begin ::= colon blockname nl | colon blockname colon
blockname nl
end ::= colonend blockname nl
nclinelns ::= nclineln+
nclineln ::= assign | noncolon linenl | nl
linenl ::= line nl
assigns ::= assign+
assign ::= manoizq | modelassign | manoizq eq manoder nl
modelassign ::= modelstr eq modelvalue
modelstr ~ 'Model'
modeltype ~ [a-zA-Z]+
modelvalue ~ [\ \:0-9a-zA-Z\(\)]+
eq ~ '='
manoizq ::= nombre
manoder ~
]+
nl ~ [\n]
line ~
\:\x{00e1}\x{00e9}\x{00ed}\x{00f3}\x{00fa}]+
noncolon ~ [^:]
blockname ~ [A-Za-z]+
nombre ~ [A-Za-z]+
colon ~ ':'
colonend ~ ':e'
ws1 ~ [\s]+
:discard ~ ws1
any hint is really welcome
and thanks for Marpa, saying its great is no enough.
Haroldo
--
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/d/optout.
Jeffrey Kegler
2018-07-15 16:02:16 UTC
Permalink
Sorry to not get back in time.

To figure out what a lexeme is, Marpa does the following:

An L0 lexeme is a symbol which appears on an L0 LHS but not on an L0 RHS.

An G1 lexeme is a symbol which appears on a G1 RHS but not on a G1 LHS.

The list of G1 lexemes and the list of L0 lexemes must match exactly or you
get some sort of error message.
Post by Haroldo Stenger
hi
modeltype ~ [a-zA-Z]+
which got 'unreferenced' in one of the editings.
By trimming it , the error goes away.
I wonder how that rule can be the culprit of 'An L0 lexeme cannot appear
on the RHS of an L0 rule'. Any idea?
thanks!
Haroldo
Post by Haroldo Stenger
hi, I'm making some progress with the grammar I've been fiddling with.
I've been handling the \s whitspace manually, and now I'm trying to let
Marpa handle it, tweaking the grammar in the complicated spots. In the
iterations, there appear different sorts of errors, this being particularly
An L0 lexeme cannot appear on the RHS of an L0 rule
Marpa::R2 exception at ./gistfile2.pl line 34.
BEGIN failed--compilation aborted at ./gistfile2.pl line 85.
I'm given no hint of the lines or rules that are generating the conflict,
and I'm wondering if there is something I'm missing as of parameters to
Marpa to give different sorts of explicative errors.
:default ::= action => [name,values]
lexeme default = action => [ start, length, value ] bless =>
::name latm => 1
:start ::= body
body ::= elementbody+
elementbody ::= nclinelns | assigns | blocks
blocks ::= block+
block ::= begin body end | begin end body
begin ::= colon blockname nl | colon blockname colon
blockname nl
end ::= colonend blockname nl
nclinelns ::= nclineln+
nclineln ::= assign | noncolon linenl | nl
linenl ::= line nl
assigns ::= assign+
assign ::= manoizq | modelassign | manoizq eq manoder nl
modelassign ::= modelstr eq modelvalue
modelstr ~ 'Model'
modeltype ~ [a-zA-Z]+
modelvalue ~ [\ \:0-9a-zA-Z\(\)]+
eq ~ '='
manoizq ::= nombre
manoder ~
]+
nl ~ [\n]
line ~
\:\x{00e1}\x{00e9}\x{00ed}\x{00f3}\x{00fa}]+
noncolon ~ [^:]
blockname ~ [A-Za-z]+
nombre ~ [A-Za-z]+
colon ~ ':'
colonend ~ ':e'
ws1 ~ [\s]+
:discard ~ ws1
any hint is really welcome
and thanks for Marpa, saying its great is no enough.
Haroldo
--
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
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jeffrey Kegler
2018-07-15 18:31:28 UTC
Permalink
In the latest development version of Marpa::R2, it now gives the name of
the offending lexeme. Unfortunately, Marpa::R2 is "stable -- serious bug
fix only" so unless there is a serious bug (an unlikely and unwelcome
event) this fix will not appear in an indexed release.
Post by Haroldo Stenger
hi, I'm making some progress with the grammar I've been fiddling with.
I've been handling the \s whitspace manually, and now I'm trying to let
Marpa handle it, tweaking the grammar in the complicated spots. In the
iterations, there appear different sorts of errors, this being particularly
An L0 lexeme cannot appear on the RHS of an L0 rule
Marpa::R2 exception at ./gistfile2.pl line 34.
BEGIN failed--compilation aborted at ./gistfile2.pl line 85.
I'm given no hint of the lines or rules that are generating the conflict,
and I'm wondering if there is something I'm missing as of parameters to
Marpa to give different sorts of explicative errors.
:default ::= action => [name,values]
lexeme default = action => [ start, length, value ] bless =>
::name latm => 1
:start ::= body
body ::= elementbody+
elementbody ::= nclinelns | assigns | blocks
blocks ::= block+
block ::= begin body end | begin end body
begin ::= colon blockname nl | colon blockname colon
blockname nl
end ::= colonend blockname nl
nclinelns ::= nclineln+
nclineln ::= assign | noncolon linenl | nl
linenl ::= line nl
assigns ::= assign+
assign ::= manoizq | modelassign | manoizq eq manoder nl
modelassign ::= modelstr eq modelvalue
modelstr ~ 'Model'
modeltype ~ [a-zA-Z]+
modelvalue ~ [\ \:0-9a-zA-Z\(\)]+
eq ~ '='
manoizq ::= nombre
manoder ~ [\^\<\>\|\_\-\,\;\!\?\/\.\'\"\
]+
nl ~ [\n]
line ~ [\=\^\<\>\|\_\-\,\;\!\?\/\.\'\
00f3}\x{00fa}]+
noncolon ~ [^:]
blockname ~ [A-Za-z]+
nombre ~ [A-Za-z]+
colon ~ ':'
colonend ~ ':e'
ws1 ~ [\s]+
:discard ~ ws1
any hint is really welcome
and thanks for Marpa, saying its great is no enough.
Haroldo
--
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
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Haroldo Stenger
2018-07-15 23:53:28 UTC
Permalink
Post by Jeffrey Kegler
In the latest development version of Marpa::R2, it now gives the name of
the offending lexeme. Unfortunately, Marpa::R2 is "stable -- serious bug
fix only" so unless there is a serious bug (an unlikely and unwelcome
event) this fix will not appear in an indexed release.
thankyou! tat'll help, I'll check it out.

Is it possible to have both versions installed and somehow choose one of
them?
--
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/d/optout.
Jeffrey Kegler
2018-07-16 17:14:22 UTC
Permalink
This can be done with standard Perl facilities.

I have to mix versions all the time. I make R2 my default and override for
my development versions with "-I" options and the "@INC" path of perl.

Another approach is to use multiple perl installations, perhaps via
perlbrew.

Which is best will depend on your usage pattern.
Post by Haroldo Stenger
Post by Jeffrey Kegler
In the latest development version of Marpa::R2, it now gives the name of
the offending lexeme. Unfortunately, Marpa::R2 is "stable -- serious bug
fix only" so unless there is a serious bug (an unlikely and unwelcome
event) this fix will not appear in an indexed release.
thankyou! tat'll help, I'll check it out.
Is it possible to have both versions installed and somehow choose one of
them?
--
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
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Ron Savage
2018-07-16 03:18:10 UTC
Permalink
Hi Haroldo

Did you see
this http://savage.net.au/Perl-modules/html/marpa.faq/faq.html#q2 in the
FAQ?
--
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/d/optout.
Haroldo Stenger
2018-07-16 06:16:24 UTC
Permalink
hi Ron!,
Post by Ron Savage
Hi Haroldo
Did you see this
http://savage.net.au/Perl-modules/html/marpa.faq/faq.html#q2 in the FAQ?
I think I did, rereading it sounds familiar. But this question in particular
is about another error (I believe)
An L0 lexeme cannot appear on the RHS of an L0 rule
not
A lexeme in G1 is not a lexeme in any of the lexers
am I right in interpreting thos two as different?

thanks !

Haroldo
--
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/d/optout.
Ron Savage
2018-07-16 23:51:22 UTC
Permalink
You are right - they are different. However they are intimately related. So
the FAQ has a new Q6
<http://savage.net.au/Perl-modules/html/marpa.faq/faq.html#q6>. If you got
this error from some other circumstance, as your 2nd post suggests, that
would in turn suggest Marpa has misidentified the real problem. But then,
you did say it warned your about the issue indirectly.
--
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/d/optout.
Loading...