Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [xtext-dev] generated CA methods name collision

to keep the 'code noise-ratio' in the generated code as low as
possible low i would only generate separator chars for this special
cases (think 80/20 or 'When common things are easy and rare things are
possible' )

@Sven,Jan: which separator should i use? '_','$' or another one?

thx


On Fri, Jan 23, 2009 at 10:33 AM, Sven Efftinge <sven@xxxxxxxxxxx> wrote:
> But there would only be a collision in cases where we have
>
> MyType_ with myField
>
> MyType with _myField
>
> so I'ld say although there is potential for clashes it's no problem in
> practice.
> I prefer _ over $ because the character is not that noisy:
>
> completeMyType_myField
>
> completeMyType$myField
>
> That said, I'ld also be ok with '$' as a delimiter.
>
> @Michael: You said "we could detect such cases..." I'm not sure if that
> means that you want to use a delimiter only if there would be a conflict
> otherwise.
> I think we should always use a delimiter.
>
> Cheers,
> Sven
>
> On Jan 23, 2009, at 10:18 AM, Jan Köhnlein wrote:
>
>> Using underscore won't fix the problem, as _ is allowed in IDs, too :-)
>>
>>> Model :
>>>      (elements+=Element+);
>>>
>>> Element :
>>>      Foo | FooName;
>>>
>>> Foo :
>>>      "foo" Name_X=ID;
>>>
>>> Foo_Name :
>>>      "bar" X=ID;
>>
>> Jan
>>
>> Am 22.01.2009 um 22:34 schrieb michael clay:
>>
>>> copied from https://bugs.eclipse.org/bugs/show_bug.cgi?id=261364
>>> -------------------------------------------------------------------------
>>> Model :
>>>      (elements+=Element+);
>>>
>>> Element :
>>>      Foo | FooName;
>>>
>>> Foo :
>>>      "foo" nameX=ID;
>>>
>>> FooName :
>>>      "bar" x=ID;
>>>
>>> Which leads in (only!) one  completeFooNameX Method in Both cases which
>>> might
>>> be inappropriate because there may be two complete diffenent things to
>>> assign.
>>> ------------------------------------------------------------------
>>>
>>> we could detect such name collisions and use a separator character
>>> ('_' or '$' for generated names??) between the rule and the assignment
>>> ('completeFooName_X')..what do you think?
>>>
>>> note: RULE_ID is not allowed to start with '$'
>>>
>>> m
>>> _______________________________________________
>>> xtext-dev mailing list
>>> xtext-dev@xxxxxxxxxxx
>>> https://dev.eclipse.org/mailman/listinfo/xtext-dev
>>
>> --
>> Dr. Jan Köhnlein
>> Senior Software Architekt
>>
>> Telefon: +49 (0) 431 / 5606-337
>> Mobile: +49 (0) 163 / 3979 776
>> Telefax: +49 (0) 431 / 5606-339
>>
>> http://www.itemis.de
>> jan.koehnlein@xxxxxxxxx
>>
>> itemis AG
>> Niederlassung Kiel
>> Schauenburgerstr. 116
>> 24118 Kiel
>> http://www.itemis.de/
>>
>> Rechtlicher Hinweis:
>> Registergericht: Amtsgericht Dortmund HRB 20621
>> Sitz der Gesellschaft: Lünen
>> Vorstand: Wolfgang Neuhaus, Jens Wagener, Dr. Georg Pietrek
>> Aufsichtsrat: Prof. Dr. Burkhard Igel (Vorsitzender), Stephan Grollmann,
>> Michael Neuhaus
>>
>> _______________________________________________
>> xtext-dev mailing list
>> xtext-dev@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/xtext-dev
>
> _______________________________________________
> xtext-dev mailing list
> xtext-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/xtext-dev
>


Back to the top