org.snapscript.tree.closure.ClosureParameterList Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of snap Show documentation
Show all versions of snap Show documentation
Dynamic scripting for the JVM
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);
}
}