Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [henshin-dev] LoopUnit

Hi Christian,

Quoting Christian Krause <henshin.ck@xxxxxxxxx>:

CountedUnits with positive count can be directly modeled using SequentialUnits (correct me if I'm wrong).

You are correct, but even modeling fairly low counts (> 5) by using SequentialUnits can be quite cumbersome for the user.

The only interesting case is when the count value is negative, which should have a "loop as long as possible" semantics. Since this is the only interesting case, I suggest that we remove CountedUnit from the model and add a LoopUnit, which behaves like a CountedUnit with a negative count value.

I don't yet see the benefit of removing functionality, but we could add a parameter to the LoopUnit which can be used to track the current iteration. That way, a simple Rule containing only a Parameter and an AttributeCondition could be used to implement various types of loops in a relatively straightforward way. So, is it possible to automatically add a Parameter to a Unit? (Some slight editor rewrite might be needed, but as this effects the Unit's semantics, the interpreter engine needs to be adapted)

Felix



Back to the top