Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » JvmModelInferrer and debug: skip steps?
JvmModelInferrer and debug: skip steps? [message #1384699] Fri, 30 May 2014 14:21 Go to next message
Victor Noël is currently offline Victor NoëlFriend
Messages: 60
Registered: April 2010
Member
Hi,

In my language, I am exploiting the association (with JvmModelAssociator) between the generated elements and the elements of my grammar so that in debug the debugger goes through the various elements of my grammar.

Unfortunately, it is possible that to one element of my grammar, I associate multiple java methods called in sequence or calling each others.

I would like to know if it is possible to make the debugger step only once for all these methods and not once for each.

Thanks!
Re: JvmModelInferrer and debug: skip steps? [message #1384948 is a reply to message #1384699] Tue, 03 June 2014 09:15 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1763
Registered: July 2009
Location: Firenze, Italy
Senior Member
On 30/05/2014 16:21, Victor Noël wrote:
> Hi,
>
> In my language, I am exploiting the association (with
> JvmModelAssociator) between the generated elements and the elements of
> my grammar so that in debug the debugger goes through the various
> elements of my grammar.
>
> Unfortunately, it is possible that to one element of my grammar, I
> associate multiple java methods called in sequence or calling each others.
>
> I would like to know if it is possible to make the debugger step only
> once for all these methods and not once for each.

If I remember correctly, you should create a child appendable using the
method trace(true); true should mean "skip the additional steps" in the
child appendable that you'll use to generate Java code...

hope this helps
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book


Re: JvmModelInferrer and debug: skip steps? [message #1384950 is a reply to message #1384948] Tue, 03 June 2014 09:25 Go to previous messageGo to next message
Victor Noël is currently offline Victor NoëlFriend
Messages: 60
Registered: April 2010
Member
Ouh nice, I will investigate that, thanks!
Re: JvmModelInferrer and debug: skip steps? [message #1385081 is a reply to message #1384950] Wed, 04 June 2014 08:58 Go to previous messageGo to next message
Victor Noël is currently offline Victor NoëlFriend
Messages: 60
Registered: April 2010
Member
Well actually it is not as easy as it seems Smile

I did a bit of voodoo programming (trying many different call to trace, true/false parameters, in various place of my code) but I didn't even get a change to the behaviour of the debugger...

The thing is, I generate my methods using the "body = [...]" or "body = '''...'''" call which seems to store the ITreeAppendable and the generator call trace on it, so it is not clear where I can do something to change that... do I need to bypass the generator for this particular thing?

Also, I'm not so clear about the meaning of the boolean parameter of trace, according to the name, it seems that true means to use for debugging, but since quasi-all the calls to trace in xtext code is with false, that it is initialised as false when nothing is specified, I guess it has the behaviour you explained Lorenzo...

If someone can clarify some of these things for me, it would be very helpful Smile
Re: JvmModelInferrer and debug: skip steps? [message #1385128 is a reply to message #1385081] Wed, 04 June 2014 13:25 Go to previous message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1763
Registered: July 2009
Location: Firenze, Italy
Senior Member
On 04/06/2014 10:58, Victor Noël wrote:
> Well actually it is not as easy as it seems :)
>
> I did a bit of voodoo programming (trying many different call to trace,
> true/false parameters, in various place of my code) but I didn't even
> get a change to the behaviour of the debugger...
> The thing is, I generate my methods using the "body = [...]" or "body =
> '''...'''" call which seems to store the ITreeAppendable and the
> generator call trace on it, so it is not clear where I can do something
> to change that... do I need to bypass the generator for this particular
> thing?

If you use

body = [...]

then the lambda has a parameter ITreeAppendable (implicit as 'it' if you
don't specify it); what I was suggesting (but I have no way of checking
that) is doing

instead of

body = [
it.append(''' .... ''')
]

do something like

body = [
it.trace(true).append(''' .... ''')
]

hope this helps
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book


Previous Topic:Adding Property to EMF Objects Dynamically
Next Topic:JUnit tests for content assist needing classpath context
Goto Forum:
  


Current Time: Sat Jul 04 03:50:19 GMT 2020

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

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

Back to the top