On a grammar that worked in a recent version of PGE, I'm now getting
an error when I try to construct the grammar. The error disappears
when I eliminate all non-greedy quantifiers from the grammar (though,
of course, the constructed grammar parses the text incorrectly with
greedy quantifiers).
This is the error:
p6rule parse error: Error in closure quantifier
current instr.: 'PGE::P6Rule :: parse_error' pc 7074 (compilers/pge/
PGE/Exp.pir:663)
called from Sub 'PGE::P6Rule :: parse_quant' pc 6516 (compilers/pge/
PGE/Exp.pir:663)
called from Sub 'PGE::OPTable :: parse' pc 1412 (compilers/pge/PGE/
Exp.pir:113)
called from Sub 'PGE::Rule :: p6rule' pc 7093 (compilers/pge/PGE/
Exp.pir:663)
called from Sub 'PGE :: p6rule' pc 7151 (compilers/pge/PGE/Exp.pir:663)
called from Sub 'LAG::Parser :: _load' pc 50 (PGE.pir:30)
called from Sub '_main' pc 3 (PGE.pir:22)
The error is thrown from the "parse_quant" subroutine on line 226 of
PGE/P6Rule.pir (under the label "err_closure"), but I'm not sure
whether it's jumping to the "err_closure" label from line 196, 199,
211, or 217 of that file.
The grammar I'm working with is:
http://svn.lohutok.net/nam/trunk/parrot/modules/Language/
AttributeGrammar/lib/LAG/Parser.pir
And the test script I'm loading it from is:
http://svn.lohutok.net/nam/trunk/parrot/modules/Language/
AttributeGrammar/testparse.pir
One example rule with the problem:
p6rule('\( \s* (.*?) \s* \)\s*', classname, 'parenlist')
This rule parses fine if I delete the "?".
Also, the README file in compilers/pge needs to be updated to reflect
the fact that the "dump" method is gone (replaced by dumper.imc).
Allison