Example #1
0
 public RtVal queryVal(ValType type, int var, int[] params) throws SemanticException {
   final int[] ONE = new int[] {1};
   RtVal val;
   switch (type) {
     case SINGLE:
       return transfer(type, gen.query(var, ONE), var);
     case SEQUENCE:
     case ARGUMENT:
       return transfer(type, gen.query(var, params), var);
     case TMPID:
       if (tmpAll.available()) {
         val = tmpAll.query(var, ONE);
         if (val.getType() != SetType.NONE) {
           return val;
         }
       }
       if (tmpExist.available()) {
         val = tmpExist.query(var, ONE);
         if (val.getType() != SetType.NONE) {
           return val;
         }
       }
       break;
   }
   throw new SemanticException(var, "查询失败", SemanticException.SemanticErrorType.EPARAM);
 }
Example #2
0
 @Override
 public RtEnv clone() throws CloneNotSupportedException {
   RtEnv o = (RtEnv) super.clone();
   o.gen = gen.clone();
   return o;
 }