Consider the following grammar:
module Tst
lexical Id = [a-z][a-z0-9]* !>> [a-z0-9];
layout Layout = WhitespaceAndComment* !>> [\ \t\n\r];
lexical WhitespaceAndComment
= [\ \t\n\r]
| @category="Comment" ^ "*" ![\n]* $
;
start syntax TstStart = Id*;
then
start[TstStart] t = parse(#start[TstStart], "*bla\nABC");
gives an ambiguity, probably because the comment can be placed before or after the empty list of strings. So, I have 2 questions:
- How can I use
diagnose()to get a diagnosis? I have trieddiagnose(t)anddiagnose(parse(#start[TstStart], "*bla\nABC")), without success. - What is the ambiguity and how can I resolve it?
Sorry, it has been a while ago. The comment definition contains a flaw, it has to be corrected as follows:
This resolves the ambiguity, but I still would like to know how to use
diagnosis().