Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Xtext error recovery
Xtext error recovery [message #1746233] Tue, 25 October 2016 19:21 Go to next message
Tamas Gorzsas is currently offline Tamas GorzsasFriend
Messages: 13
Registered: March 2016
Junior Member
I am trying to understand how error recovery works.
I found the explanation

http://zarnekow.blogspot.hu/2012/11/xtext-corner-7-parser-error-recovery.html

but after read it I can't understand why the error recovery doesn't work in this simple grammar.

Grammar:

Model:
greetings+=Greeting*;

Greeting:
'Hello' name=ID;

Text:

Hello Joe
aaaa <-------- extraneous input 'aaaa' expecting EOF

How should I change the grammar in order to error recovery work?


Re: Xtext error recovery [message #1746234 is a reply to message #1746233] Tue, 25 October 2016 19:35 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
hi,

please explain what you would expect?


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Xtext error recovery [message #1746235 is a reply to message #1746234] Tue, 25 October 2016 19:41 Go to previous messageGo to next message
Tamas Gorzsas is currently offline Tamas GorzsasFriend
Messages: 13
Registered: March 2016
Junior Member
sorry.
My problem if I continue the text.

Hello Joe
aaaa
Hello Bill

then "Hello Bill" won't be parsed.

Re: Xtext error recovery [message #1746238 is a reply to message #1746235] Tue, 25 October 2016 20:09 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
yes thats correct. the error recovery is not that good as you might expect.
i have no idea why this is the case with this grammar
you would actually have to debug the antlr code to find out why.

did you comment on sebastians blog post?


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Xtext error recovery [message #1746244 is a reply to message #1746238] Tue, 25 October 2016 20:25 Go to previous message
Tamas Gorzsas is currently offline Tamas GorzsasFriend
Messages: 13
Registered: March 2016
Junior Member
Not yet.
I thought that it is the most basic case I can imagine and I am suprised that it does not work.
Previous Topic:Xtext, Xcore and Maven: how to configure everything?
Next Topic:Content Assist - disable options
Goto Forum:
  


Current Time: Thu Apr 25 16:36:23 GMT 2024

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

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

Back to the top