JSGLR ignores rejection
JSGLR seems to fails to apply the rejection of line 14 of the following grammar applied to the input “a”; the C sglr does it right. The problem does not occur for the reverse rejection.
Sebastian
definition
module Helper
exportssyntax %% Lexeme
-> N {cons(“AorB”)}
-> N {cons(“Any”)}lexical syntax
“a” -> AorB
“b” -> AorB
[A-Za-z] -> AnyReservedId -> VarId {reject}%% VarId -> ReservedId {reject}
module Main
imports Helperexports
start-symbols
Ssyntax %% LexedDocument
Submitted on 8 February 2011 at 09:00
N “\n” -> S {cons(“S”)}
Attachments
Issue Log
But
ReservedIdis not defined in this example grammar? Also, did you test if it was theQVarIdinjection in your original grammar that triggered the problem? You have a similar injection (toN) here.
right. The fixed grammar follows, the problem remains the same. Removing any indirection from the above grammar seems to remedy the ambiguity.
definition
module Helper
exportssyntax %% Lexeme <AorB-LEX> -> N {cons("AorB")} <Any-LEX> -> N {cons("Any")} lexical syntax "a" -> AorB "b" -> AorB [A-Za-z] -> Any AorB -> Any {reject}%% Any -> AorB {reject}
module Main
imports Helperexports
start-symbols
Ssyntax %% LexedDocument N "\n" -> S {cons("S")}
Log in to post comments