Hello Daniel,

I did have similar problems multiple times.

> I am having some trouble with the @Operator instruction that EmfText 
> provides. I would like to ask two different questions:
>
> - I want to implement a comparison operation (like 1<2) with the 
> @Operator instruction. As you know, this returns a boolean value (true 
> or false), but it has numeric operands. I have two different primitve 
> Operators for bool and numeric. The problem is the following: When I 
> try to define de "Less" operator (which superclass is "BoolOperand"), 
> EmfText does not allow me to use numeric operands within it. I think I 
> am doing it wrong, because an operation like 1<2 is very common and it 
> should be doable.
One solution to this problem is that your primitive types extend a 
commen super type (e.g., PrimitiveType). Now you are able to define 
operators on the PrimitiveType class. However, with this solution you 
have to check the types of your operands manually, e.g., by adding a 
post processor checking your static semantics. This solution works quite 
well for some operators that you usally can used on all primitive types 
(e.g., !=, ==, ...), however for other operators such as +, - that are 
only allowed for numeric types this solution can lead to many incorrect 
expressions that are accepted by your parser without additional static 
semantics.
>
> - I have a primitive operator for defining Features. I also have 
> operations that cannot be defined with the @Operator instruction, 
> because they don't have a common syntax. The problem is the following: 
> I want to use an instance of the metaobject Feature in a rule that is 
> not under the @Operator instruction. EmfText does not allow me to do 
> that. If I want to use an instance of Feature, it has to be with an 
> @Operator instruction. How can I avoid that?
>
Unfortunately, I can't help you with your second problem.
> Best regards,
>
> Daniel.
Regards,
Claas

-- 
Dipl.-Medieninf. Claas Wilke
Research Assistant

Technische Universität Dresden
Department of Computer Science

Phone +49 351 463 38544
Fax   +49 351 463 38459
Email [email protected]
WWW   http://st.inf.tu-dresden.de/

_______________________________________________
emftext-users mailing list
[email protected]
http://mail-st.inf.tu-dresden.de/cgi-bin/mailman/listinfo/emftext-users

Reply via email to