All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.snapscript.tree.define.SuperInstanceBuilder Maven / Gradle / Ivy

There is a newer version: 1.4.6
Show newest version
package org.snapscript.tree.define;

import org.snapscript.core.Model;
import org.snapscript.core.Module;
import org.snapscript.core.Scope;
import org.snapscript.core.Type;
import org.snapscript.core.define.Instance;
import org.snapscript.core.define.SuperInstance;

public class SuperInstanceBuilder {
   
   private final Type type;
   
   public SuperInstanceBuilder(Type type) {
      this.type = type;
   }

   public Scope create(Scope scope, Object left) throws Exception {
      Type real = (Type)left;
      Instance instance = (Instance)scope;
      Instance outer = instance.getOuter();
      Module module = type.getModule();
      Model model = scope.getModel();

      return new SuperInstance(module, model, outer, real, type);
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy