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
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
>
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 :)
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
>
>