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

org.snapscript.tree.compile.FunctionScopeCompiler Maven / Gradle / Ivy

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

import org.snapscript.core.function.Function;
import org.snapscript.core.scope.Scope;
import org.snapscript.core.scope.index.LocalScopeExtractor;
import org.snapscript.core.type.Type;

public class FunctionScopeCompiler extends ScopeCompiler {
   
   private final LocalScopeExtractor extractor;
   
   public FunctionScopeCompiler() {
      this.extractor = new LocalScopeExtractor(false, true);          
   }

   public Scope compile(Scope local, Type type, Function function) throws Exception {    
      Scope scope = extractor.extract(local);
      Scope stack = scope.getStack();
      
      compileParameters(stack, function);

      return stack;
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy