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

org.snapscript.tree.closure.ClosureParameterList Maven / Gradle / Ivy

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

import org.snapscript.core.Scope;
import org.snapscript.core.function.Signature;
import org.snapscript.tree.function.ParameterDeclaration;
import org.snapscript.tree.function.ParameterList;

public class ClosureParameterList {
   
   private final ParameterList multiple;
   private final ParameterList single;
   
   public ClosureParameterList() {
      this(null, null);
   }
  
   public ClosureParameterList(ParameterList multiple) {
      this(multiple, null);
   }
   
   public ClosureParameterList(ParameterDeclaration single) {
      this(null, single);
   }
   
   public ClosureParameterList(ParameterList multiple, ParameterDeclaration single) {
      this.single = new ParameterList(single);
      this.multiple = multiple;
   }
   
   public Signature create(Scope scope) throws Exception{
      if(multiple != null) {
         return multiple.create(scope);
      }
      return single.create(scope);
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy