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 CompExprProperty extends CompExprOper { 11 public String name; 12 13 public CompExprProperty(String name) { 14 super(CompExprKind.e_property); 15 this.name = name; 16 } 17 18 public int type() { return CompExprKind.e_all; } 19 public boolean isProp() { return true; } 20 21 public EnumList nameProp(CompRepository rep) throws CDLExceptRemote, CDLExceptLock { 22 EnumList l = new EnumList(); 23 l.addName(name); 24 return l; 25 } 26 27 public int isPositive() { 28 return -1; 29 } 30 31 public ExprOperDef toNormal(CDLRepository rep) throws CDLExceptToNormal, CDLExceptRemote, CDLExceptLock { 32 try { 33 return ((Repository) rep.get_containing_repository()).create_exprproperty(name); 34 } catch (RemoteException e) { 35 throw new CDLExceptRemote("Remote exception occured: "+e.getMessage()); 36 } catch (TIRExceptCreate ecr) { 37 throw new CDLExceptToNormal("Can't create expression"); 38 } 39 } 40 41 public String toString() { 42 return "$"+name; 43 } 44 } 45 | Popular Tags |