Package org.rascalmpl.interpreter.result

Examples of org.rascalmpl.interpreter.result.OverloadedFunction.call()


      if (func.getFunctions().size() > 1) {
        throw new CommandlineError("should only have one main function", main);
      }
     
      if (main.getArity() == 1) {
        return func.call(getMonitor(), new Type[] { tf.listType(tf.stringType()) },new IValue[] { parsePlainCommandLineArgs(commandline)}, null).getValue();
      }
      else if (main.hasKeywordArgs() && main.getArity() == 0) {
        Map<String, IValue> args = parseKeywordCommandLineArgs(monitor, commandline, main);
        return func.call(getMonitor(), new Type[] { },new IValue[] {}, args).getValue();
      }
View Full Code Here


      if (main.getArity() == 1) {
        return func.call(getMonitor(), new Type[] { tf.listType(tf.stringType()) },new IValue[] { parsePlainCommandLineArgs(commandline)}, null).getValue();
      }
      else if (main.hasKeywordArgs() && main.getArity() == 0) {
        Map<String, IValue> args = parseKeywordCommandLineArgs(monitor, commandline, main);
        return func.call(getMonitor(), new Type[] { },new IValue[] {}, args).getValue();
      }
      else {
        throw new CommandlineError("main function should either have one argument of type list[str], or keyword parameters", main);
      }
    }
View Full Code Here

   
    if (func == null) {
      throw new UndeclaredFunction(Names.fullName(qualifiedName), types, this, getCurrentAST());
    }

    return func.call(getMonitor(), types, args, kwArgs).getValue();
  }
 
 
 
  @Override 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.