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 12:32 Go to next message
rohit ahuja is currently offline rohit ahuja
Messages: 25
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 14:06 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6246
Registered: July 2009
Senior Member
Hi,

this is intended behaviour. why dont you simply ask the resource if it has errors?
Re: AST always getting generated despite errors [message #1115428 is a reply to message #1115136] Tue, 24 September 2013 01:24 Go to previous messageGo to next message
rohit ahuja is currently offline rohit ahuja
Messages: 25
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 01:46 Go to previous message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6246
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.
Previous Topic:XPECT testing
Next Topic:Using DSL-Editor in an older Eclipse
Goto Forum:
  


Current Time: Tue Sep 02 05:25:22 EDT 2014

Powered by FUDForum. Page generated in 0.01919 seconds