Hi sudha !
I don't think there is uml classes able to create an expression tree from a string. I think you should have to code it. Maybe somebody in the community knows an api able to do it ?

Tristan

Le 12/04/2010 20:59, [email protected] a écrit :

I am using the Topcased plugin to generate a state machine having states and transitions . I have a question regarding the representation of a guard expression, which is a Boolean expression of the general form : label = (A1 rop1 B1) bop1 (A2 rop2 B2)….

Here is a portion of my code (trans is a SysML Transition):

guard = trans.createGuard(name, UMLPackage.Literals./CONSTRAINT/);

ValueSpecification _sp_ = curGuard.createSpecification(label, *null*, UMLPackage.Literals./EXPRESSION/);

The above code uses the label as a string. I would like to store the expression as an expression tree (left operand, operator, right operand). There appears to be an Expression class but I am not how that can be used to generate an expression tree for the guard. Is there a class that can create

an expression tree from a string or allow me to create the tree and associate it with guard? Some code example would be helpful.

thanks
sudha


_______________________________________________
Topcased-users mailing list
[email protected]
http://lists.gforge.enseeiht.fr/mailman/listinfo/topcased-users

<<attachment: tristan_faure.vcf>>

_______________________________________________
Topcased-users mailing list
[email protected]
http://lists.gforge.enseeiht.fr/mailman/listinfo/topcased-users

Reply via email to