Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » log info from FeatureCallCompiler
log info from FeatureCallCompiler [message #764617] Mon, 12 December 2011 14:38 Go to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1762
Registered: July 2009
Location: Firenze, Italy
Senior Member
Hi

In my DSL I'm using XbaseCompiler for generating Java code related to
XExpressions; when FeatureCallCompiler is (implicitly) invoked for
translating feature accesses and the receiver is a parameter (which is
correctly scoped) I get a log info

0 [main] INFO .xbase.compiler.FeatureCallCompiler - The variable
'newExp' has not been declared.

where 'newExp' is a (reference to a) parameter

this comes from

protected void _toJavaExpression(XAbstractFeatureCall call, IAppendable b) {
....
if (b.getName(call.getFeature()) == null) {
String variableName = getFavoriteVariableName(call.getFeature());
if (log.isInfoEnabled())
log.info("The variable '"+variableName+"' has not been declared.");
b.declareSyntheticVariable(call.getFeature(), variableName);
}
....

I suppose it is only an info but not an actual error/warning, right?

I just wanted to be sure that everything is working correctly

thanks in advance
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net


Re: log info from FeatureCallCompiler [message #764630 is a reply to message #764617] Mon, 12 December 2011 14:56 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3107
Registered: July 2009
Senior Member
Hi Lorenzo,

please make sure that your appendable was properly initialized before
you try to compile the method body.

You should invoke #declareVariable for all parameters and other
implicitly available identifiables. Please refer the the
JvmModelGenerator for details.

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 12.12.11 15:38, schrieb Lorenzo Bettini:
> Hi
>
> In my DSL I'm using XbaseCompiler for generating Java code related to
> XExpressions; when FeatureCallCompiler is (implicitly) invoked for
> translating feature accesses and the receiver is a parameter (which is
> correctly scoped) I get a log info
>
> 0 [main] INFO .xbase.compiler.FeatureCallCompiler - The variable
> 'newExp' has not been declared.
>
> where 'newExp' is a (reference to a) parameter
>
> this comes from
>
> protected void _toJavaExpression(XAbstractFeatureCall call, IAppendable
> b) {
> ....
> if (b.getName(call.getFeature()) == null) {
> String variableName = getFavoriteVariableName(call.getFeature());
> if (log.isInfoEnabled())
> log.info("The variable '"+variableName+"' has not been declared.");
> b.declareSyntheticVariable(call.getFeature(), variableName);
> }
> ....
>
> I suppose it is only an info but not an actual error/warning, right?
>
> I just wanted to be sure that everything is working correctly
>
> thanks in advance
> Lorenzo
>
Re: log info from FeatureCallCompiler [message #765012 is a reply to message #764630] Tue, 13 December 2011 08:58 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1762
Registered: July 2009
Location: Firenze, Italy
Senior Member
On 12/12/2011 03:56 PM, Sebastian Zarnekow wrote:
> Hi Lorenzo,
>
> please make sure that your appendable was properly initialized before
> you try to compile the method body.
>
> You should invoke #declareVariable for all parameters and other
> implicitly available identifiables. Please refer the the
> JvmModelGenerator for details.

Hi Sebastian

actually the generation works (as I said the parameters are correctly
scoped); however, I should declareVariable for each parameter? What
could go wrong otherwise? Just to understand better :)

thanks
Lorenzo


--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net


Re: log info from FeatureCallCompiler [message #765072 is a reply to message #765012] Tue, 13 December 2011 11:09 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3107
Registered: July 2009
Senior Member
Hi Lorenzo,

you could end up with name clashes in the generated code.

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 13.12.11 09:58, schrieb Lorenzo Bettini:
> On 12/12/2011 03:56 PM, Sebastian Zarnekow wrote:
>> Hi Lorenzo,
>>
>> please make sure that your appendable was properly initialized before
>> you try to compile the method body.
>>
>> You should invoke #declareVariable for all parameters and other
>> implicitly available identifiables. Please refer the the
>> JvmModelGenerator for details.
>
> Hi Sebastian
>
> actually the generation works (as I said the parameters are correctly
> scoped); however, I should declareVariable for each parameter? What
> could go wrong otherwise? Just to understand better :)
>
> thanks
> Lorenzo
>
>
Re: log info from FeatureCallCompiler [message #765127 is a reply to message #765072] Tue, 13 December 2011 13:19 Go to previous message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1762
Registered: July 2009
Location: Firenze, Italy
Senior Member
On 12/13/2011 12:09 PM, Sebastian Zarnekow wrote:
> Hi Lorenzo,
>
> you could end up with name clashes in the generated code.
>
> Regards,
> Sebastian

OK, got it! :)

thanks again
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net


Previous Topic:Strange scoping behaviour
Next Topic:[Xtext 2.2] Editor does not work out of the box
Goto Forum:
  


Current Time: Fri Apr 03 11:59:51 GMT 2020

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

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

Back to the top