Skip to main content



      Home
Home » Modeling » TMF (Xtext) » "XtextReconcilerJob" internal error(Unrecoverable editor crash with simple grammar)
"XtextReconcilerJob" internal error [message #1352819] Tue, 13 May 2014 12:47 Go to next message
Eclipse UserFriend
Hello,
I have reduced my grammar to the following:
grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals
generate myDsl "...MyDsl"

MyDslModel: model=IfStatement;
NegationBooleanOperator: 'NOT';
Sign:    '+' | '-';

IfStatement: 'if' exp=Expression ';';
Expression: Factor (Sign exp=Expression)?;  
Factor: constant=ID | (NegationBooleanOperator fac=Factor);


Then in the generated Xtext editor if I type:
if if x +

the following message pops up, an error is thrown and the editor stops working:

An internal error occurred during: "XtextReconcilerJob".
java.lang.IllegalArgumentException: Expression.exp does not exist


The problem occurs only when the if is repeated in the editor. However, this is a common pattern in the full grammar.

Many thanks for your help.
Re: "XtextReconcilerJob" internal error [message #1352953 is a reply to message #1352819] Tue, 13 May 2014 14:08 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

did you have a look at http://blog.efftinge.de/2010/08/parsing-expressions-with-xtext.html

MyDslModel: model=IfStatement;
NegationBooleanOperator: 'NOT';
Sign:    '+' | '-';

IfStatement: 'if' exp=Expression ';';
Expression: Factor ({Expression.left=current }Sign exp=Factor)*;  
Factor returns Expression: constant=ID | (NegationBooleanOperator fac=Factor);
Re: "XtextReconcilerJob" internal error [message #1352970 is a reply to message #1352953] Tue, 13 May 2014 14:16 Go to previous messageGo to next message
Eclipse UserFriend
ps: you may assign Sign and NegationBooleanOperator so that it wont get lost

MyDslModel: model=IfStatement;
NegationBooleanOperator: 'NOT';
Sign:    '+' | '-';

IfStatement: 'if' exp=Expression ';';
Expression: Factor ({Expression.left=current } op=Sign exp=Factor)*;  
Factor returns Expression: {Factor}constant=ID | NotExpression;
NotExpression returns Expression:{NotExpression} (NegationBooleanOperator fac=Factor);
Re: "XtextReconcilerJob" internal error [message #1354469 is a reply to message #1352953] Wed, 14 May 2014 05:10 Go to previous message
Eclipse UserFriend
Many thanks for your really quick response. I managed to apply this pattern throughout my full grammar and it finally fixed the editor crashes. Fantastic!

I suppose the main problem, aside from my inexperience, is that these mistakes get past the Xtext editor - which does sometimes report left recursion - and past the artefact generation stage, manifesting themselves as occasional catastrophic unhandled exceptions coming from ANTLR while editing the DSL. Is there any way these forbidden constructs could be reported earlier - ideally in the Xtext grammar editor? [I am using the latest XText 2.6.0]
Previous Topic:[SOLVED]Validation- Grammar mixin semantic validation
Next Topic:How to setup IApplication to read DSL files
Goto Forum:
  


Current Time: Tue Jul 01 05:31:24 EDT 2025

Powered by FUDForum. Page generated in 0.07332 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top