Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Parsing in reconciler failed. / [Model.feature] does not exist
Parsing in reconciler failed. / [Model.feature] does not exist [message #1791123] Sun, 24 June 2018 10:39 Go to next message
Alexandros Karypidis is currently offline Alexandros KarypidisFriend
Messages: 104
Registered: March 2010
Senior Member
Hello,

I started out with this grammar:

grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals

generate myDsl "http://www.xtext.org/example/mydsl/MyDsl"

Model: {Model}
    'greetings' '{'
    greetings+=Greeting*
    '}';

Greeting:
    SimpleGreeting | GoodMorning | GoodEvening | CompoundGreeting;

CompoundGreeting:
    'greet' name=ID '{' 
        lines+=CompoundGreetingMember*
    '}'
;

CompoundGreetingMember:
    RefGreeting | InlineGreeting
;

InlineGreeting:
    GoodMorning | GoodEvening
;

RefGreeting:
    'and' name=ID greet=[Greeting]
;

SimpleGreeting:
    'Hello' name=ID '!';

GoodMorning:
    'Good' 'morning' name=ID '!';

GoodEvening:
    'Good' 'evening' name=ID '!';


It was OK for parsing the following:

// day HappyDay

greetings {
	Hello X !
	Good morning Y !
	Good evening Z !
	
	greet script {
		Good morning A !
		Good evening B !
		and Thinking X
	}
}


I then did the following change, adding the 'Day' rule used at the top of the model:

Model:
    Day
    'greetings' '{'
    greetings+=Greeting*
    '}';

Day:
    'day' name=ID;


When launching Eclipse to test, I now:



  1. For the line 'and Thinking X' I have X underlined with red as a syntax error and the problems view reads "Couldn't resolve reference to greeting X"
  2. When commenting out the top line, I get the exception "Parsing in reconciler failed." (stack trace below)
  3. If I relaunch the Eclipse to test I get the exception "Model.greetings does not exist" (stack trace below) and the editor tab just has this message (no text area to actually edit the text


Now, (2) and (3) seem like there may be a problem in xtext itself. The stack trace does not involve any code I wrote. Does this seem like a bug I should report?

4719 [Worker-6] ERROR org.eclipse.xtext.ui.editor.reconciler.XtextDocumentReconcileStrategy  - Parsing in reconciler failed.
java.lang.NullPointerException
	at org.eclipse.xtext.resource.XtextResource.update(XtextResource.java:263)
	at org.eclipse.xtext.ui.editor.reconciler.XtextDocumentReconcileStrategy.doReconcile(XtextDocumentReconcileStrategy.java:182)
	at org.eclipse.xtext.ui.editor.reconciler.XtextDocumentReconcileStrategy.reconcile(XtextDocumentReconcileStrategy.java:90)
	at org.eclipse.xtext.ui.editor.reconciler.XtextReconciler.doRun(XtextReconciler.java:450)
	at org.eclipse.xtext.ui.editor.reconciler.XtextReconciler.access$3(XtextReconciler.java:430)
	at org.eclipse.xtext.ui.editor.reconciler.XtextReconciler$1.process(XtextReconciler.java:364)
	at org.eclipse.xtext.ui.editor.reconciler.XtextReconciler$1.process(XtextReconciler.java:1)
	at org.eclipse.xtext.util.concurrent.IUnitOfWork$Void.exec(IUnitOfWork.java:37)
	at org.eclipse.xtext.resource.OutdatedStateManager.exec(OutdatedStateManager.java:91)
	at org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumentLocker.modify(XtextDocument.java:433)
	at org.eclipse.xtext.ui.editor.model.XtextDocument.internalModify(XtextDocument.java:166)
	at org.eclipse.xtext.ui.editor.reconciler.XtextReconciler.run(XtextReconciler.java:361)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)


Caused by: java.lang.IllegalArgumentException: Model.greetings does not exist
	at org.eclipse.xtext.parser.DefaultEcoreElementFactory.add(DefaultEcoreElementFactory.java:108)
	at org.eclipse.xtext.parser.antlr.AbstractInternalAntlrParser.add(AbstractInternalAntlrParser.java:355)
	at org.eclipse.xtext.parser.antlr.AbstractInternalAntlrParser.add(AbstractInternalAntlrParser.java:362)
	at org.xtext.example.mydsl.parser.antlr.internal.InternalMyDslParser.ruleModel(InternalMyDslParser.java:194)
	at org.xtext.example.mydsl.parser.antlr.internal.InternalMyDslParser.entryRuleModel(InternalMyDslParser.java:99)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.xtext.parser.antlr.AbstractInternalAntlrParser.parse(AbstractInternalAntlrParser.java:561)
	... 20 more

Re: Parsing in reconciler failed. / [Model.feature] does not exist [message #1791124 is a reply to message #1791123] Sun, 24 June 2018 10:49 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12388
Registered: July 2009
Senior Member
can you please open a bug at github.com/eclipse/xtext-core for that.
the problem is that you are lazy with assigning things
=>
Model:
day=Day
'greetings' '{'
greetings+=Greeting*
'}';

and problem solved.


Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Parsing in reconciler failed. / [Model.feature] does not exist [message #1791125 is a reply to message #1791124] Sun, 24 June 2018 10:57 Go to previous message
Alexandros Karypidis is currently offline Alexandros KarypidisFriend
Messages: 104
Registered: March 2010
Senior Member
Thank you!

Opened https://github.com/eclipse/xtext-core/issues/773
Previous Topic:Formatting multiple parser rules within curly brackets
Next Topic:Create files only once
Goto Forum:
  


Current Time: Sat Nov 17 21:42:28 GMT 2018

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

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

Back to the top