Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » "XtextReconcilerJob" internal error(Unrecoverable editor crash with simple grammar)
"XtextReconcilerJob" internal error [message #1352819] Tue, 13 May 2014 16:47 Go to next message
Steve Pearson is currently offline Steve PearsonFriend
Messages: 12
Registered: May 2014
Junior Member
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 18:08 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13468
Registered: July 2009
Senior Member
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);


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: "XtextReconcilerJob" internal error [message #1352970 is a reply to message #1352953] Tue, 13 May 2014 18:16 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13468
Registered: July 2009
Senior Member
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);


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: "XtextReconcilerJob" internal error [message #1354469 is a reply to message #1352953] Wed, 14 May 2014 09:10 Go to previous message
Steve Pearson is currently offline Steve PearsonFriend
Messages: 12
Registered: May 2014
Junior Member
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 Jun 02 15:52:14 GMT 2020

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

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

Back to the top