Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [4diac-dev] Handling of user defined variable names during export

Hi,

I just looked at the lua exporter. There this has already been
implemented for variables, event connections, data connections,
adapters,...
Also adding all of the prefixes is handled in one single place so the
naming conventions can be changed if needed.
I would suggest that we adapt the export for c++ to how it is handled
for lua, although this change is even bigger than what i propsed
earlier.

As Alois already replied this will not affect monitoring, but only
access inside the exported code.

I would also like to add some tests for the export; yet I am not sure
how to do this without adding dependencies between 4diac and the forte
runtime.

Best regards,
Ernst Blecha


>
-- 

Ernst Blecha
LIT | Cyber-Physical Systems Lab

JOHANNES KEPLER
UNIVERSITY LINZ
Altenberger Straße 69
LIT Open Innovation Center
4040 Linz, Austria
ernst.blecha@xxxxxx
www.jku.at
 
>>> Martin Melik-Merkumians <Melik-Merkumians@xxxxxxxxxxxxxxxxx>
01/28/20 2:36 PM >>>
> Hi,
> 
> I am voting +1 for the proposal. With Joses remarks in mind, we should
probably put the prefix into a String constant in case we have to change
it in the future.
> From today's view I would say var_ should work, and I don't see issues
with it right now.
> 
> Best regards,
> Martin
>>
>> -----Ursprüngliche Nachricht-----
>> Von: 4diac-dev-bounces@xxxxxxxxxxx <4diac-dev-bounces@xxxxxxxxxxx> Im
Auftrag von Jose Cabral
>> Gesendet: Dienstag, 28. Januar 2020 12:04
>> An: 4diac developer discussions <4diac-dev@xxxxxxxxxxx>
>> Betreff: Re: [4diac-dev] Handling of user defined variable names
during export
>>
>> Hi all,
>>
>> I just got acquainted with the ng exporter. I really like the new
proposal. I also had issues in the past with a data input called
"operator" which clashed with c++ reserved word.
>>
>> From what I see, the change will have the following consequences:
>> - The Lua exporter should also be changed according to the new rule
>> - The monitoring pluggin should be updated
>> - All the exported FBs already present in FORTE should be
re-generated (Caution: there are some generated ones that aren't fully
generated)
>> - We should start thinking in adding tests for the exporter
>>
>> Since this change will be big, we should be pretty sure that "var_"
is the right choice.
>>
>> Regards
>>
>> Jose Cabral
>>
>>
>>> -----Ursprüngliche Nachricht-----
>>> Von: 4diac-dev-bounces@xxxxxxxxxxx <4diac-dev-bounces@xxxxxxxxxxx>
Im
>>> Auftrag von Alois Zoitl
>>> Gesendet: Dienstag, 28. Januar 2020 10:25
>>> An: 4diac-dev@xxxxxxxxxxx
>>> Betreff: Re: [4diac-dev] Handling of user defined variable names
>>> during export
>>>
>>> Hi,
>>>
>>> this is an interesting point. Especially as it would finally also
>>> solve our IN/OUT compilation problem for windows. Jose what do you
think?
>>>
>>> The only thing I'm not perfectly sure if there are any backwards
>>> compatibility issues.
>>>
>>> Cheers,
>>> Alois
>>>
>>> On Tue, 2020-01-28 at 08:55 +0100, Ernst Blecha wrote:
>>>> Hi all,
>>>>
>>>> during working on the forte_ng export I came across the fact that
>>>> all variable names are passed through without change. This might
>>>> lead to name clashes or keyword conflicts in the future (e.g. if
for
>>>> implementing the for loop a temporary variable is needed, any name
>>>> given to this variable might overlap with a variable defined by the
user).
>>>>
>>>> I would propose adding a prefix (e.g. "var_") to all variables and
>>>> interfaces, as this would remove the risk of unexpected name
clashes.
>>>>
>>>>
>>>> Best regards,
>>>> Ernst Blecha



Back to the top