1 2 package SOFA.SOFAnode.Made.CDL; 3 import java.rmi.RemoteException ; 4 5 import SOFA.SOFAnode.Made.TIR.CDLRepository; 6 import SOFA.SOFAnode.Made.TIR.ExprOperDef; 7 import SOFA.SOFAnode.Made.TIR.Repository; 8 import SOFA.SOFAnode.Made.TIR.TIRExceptCreate; 9 10 class CompExprBoolean extends CompExprOper { 11 public boolean value; 12 public CompExprBoolean(boolean val) { 13 super(CompExprKind.e_boolean); 14 value = val; 15 } 16 17 public int type() { return CompExprKind.e_boolean; } 18 19 public boolean isProp() { return false; } 20 21 public EnumList nameProp(CompRepository rep) throws CDLExceptRemote, CDLExceptLock { 22 EnumList l = new EnumList(); 23 return l; 24 } 25 26 public int isPositive() { 27 return -2; 28 } 29 30 public ExprOperDef toNormal(CDLRepository rep) throws CDLExceptToNormal, CDLExceptRemote, CDLExceptLock { 31 try { 32 return ((Repository) rep.get_containing_repository()).create_exprboolean(value); 33 } catch (RemoteException e) { 34 throw new CDLExceptRemote("Remote exception occured: "+e.getMessage()); 35 } catch (TIRExceptCreate ecr) { 36 throw new CDLExceptToNormal("Can't create expression"); 37 } 38 } 39 40 public String toString() { 41 return new Boolean (value).toString(); 42 } 43 } 44 | Popular Tags |