[Solved] Xtext fails to parse my text file [message #1124175] |
Thu, 03 October 2013 09:02 |
Charles Bonneau Messages: 32 Registered: February 2010 Location: Belgium |
Member |
|
|
Hello,
I have to "fix" a grammar developed by someone else.
This grammar contains these rules:
VarAccess:
varName=SingleVar (('[' {VarAccess.ArrayAccess=current} index=SignedInt ']') | ('.'{VarAccess.MemberAccess=current}attributeName=NAME))*;
SingleVar:
'$'name=NAME;
SignedInt:
('+' | '-')? UNSIGNED_INT;
terminal UNSIGNED_INT:
('1'..'9') ('0'..'9')* | '0';
terminal NAME:
('a'..'z' | 'A'..'Z') ('a'..'z' | 'A'..'Z' | '0'..'9')*;
But when I load a file containing this text :
I end up with a model where <VarAccessEObject>.getVarName().getName() is null (it should be "as").
I can't figure out what is wrong with this grammar and why the attribute 'name' of the 'SingleVar' object is null.
Do you see something that is not right in the code snippet ?
Thank you in advance for you help.
Charles
[Updated on: Thu, 03 October 2013 10:05] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.02723 seconds