Haroldo Stenger
2018-07-14 23:41:59 UTC
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
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.
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.