Package org.eclipse.imp.pdb.facts

Examples of org.eclipse.imp.pdb.facts.IValueFactory.bool()


  public static IMap toRascalModifiers(int stateMask,IMap prevMap,IEvaluatorContext ctx){
    IValueFactory vf = ValueFactoryFactory.getValueFactory();
    for(int i = 0 ; i < modifiers.length ;i++){
      Type controlType = modifiers[i];
      IValue cons = vf.constructor(controlType);
      prevMap = prevMap.put(cons, vf.bool((stateMask & modifiersSWT[i]) != 0));
    }
    return prevMap;
  }
 
  public static IValue toRascalKey(KeyEvent e,IEvaluatorContext ctx){
View Full Code Here


        if (!dt.isTime()) {
          return makeResult(getTypeFactory().integerType(), vf.integer(getValue().getCentury()), ctx);
        }
        throw new UnsupportedOperation("Can not retrieve the century on a time value",ctx.getCurrentAST());
      } else if (name.equals("isDate")) {
        return makeResult(getTypeFactory().boolType(), vf.bool(getValue().isDate()), ctx);
      } else if (name.equals("isTime")) {
        return makeResult(getTypeFactory().boolType(), vf.bool(getValue().isTime()), ctx);
      } else if (name.equals("isDateTime")) {
        return makeResult(getTypeFactory().boolType(), vf.bool(getValue().isDateTime()), ctx);
      } else if (name.equals("justDate")) {
View Full Code Here

        }
        throw new UnsupportedOperation("Can not retrieve the century on a time value",ctx.getCurrentAST());
      } else if (name.equals("isDate")) {
        return makeResult(getTypeFactory().boolType(), vf.bool(getValue().isDate()), ctx);
      } else if (name.equals("isTime")) {
        return makeResult(getTypeFactory().boolType(), vf.bool(getValue().isTime()), ctx);
      } else if (name.equals("isDateTime")) {
        return makeResult(getTypeFactory().boolType(), vf.bool(getValue().isDateTime()), ctx);
      } else if (name.equals("justDate")) {
        if (!dt.isTime()) {
          return makeResult(getTypeFactory().dateTimeType(),
View Full Code Here

      } else if (name.equals("isDate")) {
        return makeResult(getTypeFactory().boolType(), vf.bool(getValue().isDate()), ctx);
      } else if (name.equals("isTime")) {
        return makeResult(getTypeFactory().boolType(), vf.bool(getValue().isTime()), ctx);
      } else if (name.equals("isDateTime")) {
        return makeResult(getTypeFactory().boolType(), vf.bool(getValue().isDateTime()), ctx);
      } else if (name.equals("justDate")) {
        if (!dt.isTime()) {
          return makeResult(getTypeFactory().dateTimeType(),
              vf.date(dt.getYear(), dt.getMonthOfYear(), dt.getDayOfMonth()), ctx);
        }
View Full Code Here

  }
 

  public static Result<IBool> bool(boolean b, IEvaluatorContext ctx) {
    IValueFactory vf = ctx.getValueFactory();
    IBool result = vf.bool(b);
    return new BoolResult(result.getType(), result, ctx);
  }
 
  private static class Visitor implements ITypeVisitor<Result<? extends IValue>, RuntimeException> {
    private IValue value;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.