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