Package org.rascalmpl.interpreter.staticErrors

Examples of org.rascalmpl.interpreter.staticErrors.Arity


          return makeResult(type, getValue().asRelation().closure(), ctx);
        } catch (IllegalOperationException e){
          throw new UnsupportedOperation("Illegal argument of transitive closure (+)", ctx.getCurrentAST());
        }
      }
      throw new Arity(2, getValue().asRelation().arity(), ctx.getCurrentAST());
    }
View Full Code Here


          return makeResult(type, getValue().asRelation().closureStar(), ctx);
        } catch (IllegalOperationException e){
          throw new UnsupportedOperation("Illegal argument of reflexive transitive closure (*)", ctx.getCurrentAST());
        }
      }
      throw new Arity(2, getValue().asRelation().arity(), ctx.getCurrentAST());
    }
View Full Code Here

      Type rightrelType = right.getType();
      int leftArity = leftrelType.getArity();
      int rightArity = rightrelType.getArity();
       
      if (leftArity != 0 && leftArity != 2) {
        throw new Arity(2, leftArity, ctx.getCurrentAST());
      }
       
      if (rightArity != 0 && rightArity != 2) {
        throw new Arity(2, rightArity, ctx.getCurrentAST());
      }
      Type resultType = leftrelType.compose(rightrelType);
      return makeResult(resultType, left.getValue().asRelation().compose(right.getValue().asRelation()), ctx);
    }
View Full Code Here

    @Override
    public  <U extends IValue> Result<U> transitiveClosure() {
      if (getValue().asRelation().arity() == 0 || getValue().asRelation().arity() == 2) {
        return makeResult(type, getValue().asRelation().closure(), ctx);
      }
      throw new Arity(2, getValue().asRelation().arity(), ctx.getCurrentAST());
    }
View Full Code Here

    @Override
    public  <U extends IValue> Result<U> transitiveReflexiveClosure() {
      if (getValue().asRelation().arity() == 0 || getValue().asRelation().arity() == 2) {
        return makeResult(type, getValue().asRelation().closureStar(), ctx);
      }
      throw new Arity(2, getValue().asRelation().arity(), ctx.getCurrentAST());
    }
View Full Code Here

      Type rightrelType = right.getType();
      int leftArity = leftrelType.getArity();
      int rightArity = rightrelType.getArity();
       
      if (leftArity != 0 && leftArity != 2) {
        throw new Arity(2, leftArity, ctx.getCurrentAST());
      }
       
      if (rightArity != 0 && rightArity != 2) {
        throw new Arity(2, rightArity, ctx.getCurrentAST());
      }
      Type resultType = leftrelType.compose(rightrelType);
      return makeResult(resultType, left.getValue().asRelation().compose(right.getValue().asRelation()), ctx);
    }
View Full Code Here

TOP

Related Classes of org.rascalmpl.interpreter.staticErrors.Arity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.