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

Reply via email to