Xtext generated parser reports errors - why? [message #701723] |
Mon, 25 July 2011 09:42  |
Eclipse User |
|
|
|
Dear colleagures,
As an Xtext beginner I'm stuck with a parsing problem.
My (simplified) grammar (no 'with org.eclipse.xtext.common.Terminals', and 'import ".../emf/2002/Ecore" as ecore' instead) is:
MyDsl:
FourLettersFullStop = FourLettersFullStop
OneToManyLettersElement = OneToManyLettersElement;
FourLettersFullStop:
FourLetters = FourLetters '.' '\r\n';
FourLetters:
A A A A;
OneToManyLettersElement:
'XY ' OneToManyLetters += OneToManyLetters;
OneToManyLetters:
A+;
terminal A: // Uppercase alphabetic letter
('A'..'Z');
Now parsing 'ABYY.\r\nXY ARBITRARYTEXT' is no problem. When parsing 'ABXY.\r\nXY ARBITRARYTEXT' (note the 'XY' in 'ABXY') my generated parser reports errors however.
How can I tell the parser not to try matching the 'XY' in 'ABXY' with the 'OneToManyLettersElement' - and why should I need to?
Any hints are welcome - thanks for your cooperation.
Kind regards Franz-Josef
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02804 seconds