Package org.rascalmpl.interpreter.env

Examples of org.rascalmpl.interpreter.env.Environment


    public Result<IValue> interpret(IEvaluator<Result<IValue>> __eval) {

      __eval.setCurrentAST(this);
      __eval.notifyAboutSuspension(this);
     
      Environment old = __eval.getCurrentEnvt();

      try {
        __eval.pushEnv();
        return this.getExpression().interpret(__eval);
      } finally {
View Full Code Here


      org.rascalmpl.ast.Statement body = this.getBody();
      List<org.rascalmpl.ast.Expression> generators = this
          .getGenerators();
      int size = generators.size();
      IBooleanResult[] gens = new IBooleanResult[size];
      Environment old = __eval.getCurrentEnvt();
      Environment[] olds = new Environment[size];

      Result<IValue> result = org.rascalmpl.interpreter.result.ResultFactory
          .makeResult(org.rascalmpl.interpreter.Evaluator.__getTf()
              .voidType(), __eval.__getVf().list(), __eval);
View Full Code Here

      List<org.rascalmpl.ast.Expression> generators = this
          .getConditions();
      int size = generators.size();
      IBooleanResult[] gens = new IBooleanResult[size];
      Environment[] olds = new Environment[size];
      Environment old = __eval.getCurrentEnvt();
     
      int i = 0;
      try {
        olds[0] = __eval.getCurrentEnvt();
        __eval.pushEnv();
View Full Code Here

      List<org.rascalmpl.ast.Expression> generators = this
          .getConditions();
      int size = generators.size();
      IBooleanResult[] gens = new IBooleanResult[size];
      Environment[] olds = new Environment[size];
      Environment old = __eval.getCurrentEnvt();

      int i = 0;
      try {
        olds[0] = __eval.getCurrentEnvt();
        __eval.pushEnv();
View Full Code Here

      __eval.setCurrentAST(this);
      __eval.notifyAboutSuspension(this);
     
      Result<IValue> r = org.rascalmpl.interpreter.result.ResultFactory
          .nothing();
      Environment old = __eval.getCurrentEnvt();

      __eval.pushEnv(this);
      try {
        for (org.rascalmpl.ast.Statement stat : this.getStatements()) {
          __eval.setCurrentAST(stat);
View Full Code Here

     
      int size = this.getVariables().size();
      QualifiedName vars[] = new QualifiedName[size];
      IValue currentValue[] = new IValue[size];

      Environment old = __eval.getCurrentEnvt();

      try {
        List<QualifiedName> varList = this.getVariables();

        for (int i = 0; i < size; i++) {
View Full Code Here

    this.vf = valueFactory;
    this.tf = TypeFactory.getInstance();
  }
 
  public Result<IValue> typeToValue(Type t, IEvaluatorContext ctx) {
    Environment env = ctx.getCurrentEnvt();
    env.getStore().declareAbstractDataType(Factory.Type);
    env.getStore().declareConstructor(Factory.Type_Reified);
    TypeStore store = constructCompleteTypeStore(env);
   
    Map<IConstructor, IConstructor> definitions = new HashMap<IConstructor, IConstructor>();
    IConstructor symbol = reify(t, definitions, ctx, store);
   
View Full Code Here

    public Result<IValue> interpret(IEvaluator<Result<IValue>> __eval) {

      __eval.setCurrentAST(this);
      __eval.notifyAboutSuspension(this);     
     
      Environment old = __eval.getCurrentEnvt();
      __eval.pushEnv();

      try {
        Result<IValue> cval = this.getCondition().interpret(__eval);
View Full Code Here

 
  @Override
  public boolean next() {
    if (firstMatch) {
      firstMatch = false;
      Environment old = ctx.getCurrentEnvt();
      boolean rightResult;
      try {
        ctx.pushEnv();
        leftResult = left.next();
      }
      finally {
        ctx.unwind(old);
      }
      try {
        ctx.pushEnv();
        rightResult = right.next();
      }
      finally {
        ctx.unwind(old);
      }
     
      return leftResult == rightResult;
    }
   
    if (right.hasNext()) {
      Environment old = ctx.getCurrentEnvt();
      try {
        ctx.pushEnv();
        return leftResult == right.next();
      }
      finally {
        ctx.unwind(old);
      }
    }
   
    Environment old = ctx.getCurrentEnvt();
    try {
      ctx.pushEnv();
      leftResult = left.next();
    }
    finally {
View Full Code Here

    return result;
  }

  private IValue applyCases(IValue subject, CaseBlockList casesOrRules, TraverseResult tr) {
    for (CaseBlock cs : casesOrRules.getCases()) {
      Environment old = eval.getCurrentEnvt();
      AbstractAST prevAst = eval.getCurrentAST();
     
      try {
        eval.pushEnv();
       
View Full Code Here

TOP

Related Classes of org.rascalmpl.interpreter.env.Environment

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.