Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » AST always getting generated despite errors
AST always getting generated despite errors [message #1115085] Mon, 23 September 2013 16:32 Go to next message
rohit ahuja is currently offline rohit ahujaFriend
Messages: 27
Registered: February 2013
Junior Member
Hi All,

I have a XText DSL having certain validators specified.
I am using the generated AST in another code and storing it in the EMF model.

This AST is always generated even though there are certain DSL errors/validation errors, and the AST just 'skips' those specific error cases, and adds on the error free details. So the generated AST is a parsed format of the 'error-free' grammar only.

Is there some way wherein we donot generate the AST at all in case there is any grammar error, rather than the partial generation of the error-free grammar.

It would be great if any of you can provide some help.

Thanks,
Rohit
Re: AST always getting generated despite errors [message #1115136 is a reply to message #1115085] Mon, 23 September 2013 18:06 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

this is intended behaviour. why dont you simply ask the resource if it has errors?


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: AST always getting generated despite errors [message #1115428 is a reply to message #1115136] Tue, 24 September 2013 05:24 Go to previous messageGo to next message
rohit ahuja is currently offline rohit ahujaFriend
Messages: 27
Registered: February 2013
Junior Member
Hi Christian,

Thanks for the reply, can you please elaborate on how to do that?

Thanks
Re: AST always getting generated despite errors [message #1115444 is a reply to message #1115428] Tue, 24 September 2013 05:46 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

you did give no context what you do with the model and how you access it.
you would no change the parser or stuff but the code
that works with the AST

(if you have an EObject you can ask it for its eResource and that for errors.


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:XPECT testing
Next Topic:Using DSL-Editor in an older Eclipse
Goto Forum:
  


Current Time: Thu Apr 18 12:59:10 GMT 2024

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

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

Back to the top