[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.mdt.ocl] custom operators and functions using model information

Hi all,

I am modifying the OCL parser/evaluator in order to (besides other things):

* include a series of time related datatypes (Date, Time, Duration, Timestamp). These datatypes should have standard infix operators (+, -, ..) like integers and so on... I think I have to modify the EvaluationVisitor. Is this the best course of action?

* include predefined methods that, if applied on an attribute, have access to the model information of that attribute (i.e. which class they belong, in addition to the actual instance).
For instance, lets assume book have an attribute called author. And the "LOTR" book instance has "Tolkien" as its author attribute. Then the predefined method LOTR.author.info() should be able to know that it is invoked on the "author" attribute of a "book" class.
Do you have any idea on how to implement these methods?


Thank you all,

Elio