Package ket

Examples of ket.Edit.substitute()


    for (Branch branch : branchVector) {
      Argument first = branch.firstChild();
      if (first==null) return;
      for (int i=1; i<branch.size(); i++) {
        e.setCurrent(first);
        e.substitute(branch.getChild(i));
      }
      e.replace(branch, first);
    }
  }
View Full Code Here


   */
  public static Argument parseAs(String argumentString, Argument x) { // "sin(x)", token(q) -> sin(q)
    Argument a = ArgumentParser.parseArgument(argumentString, Ket.KNOWN_ARGUMENTS, null, null);
    if (a==null) return null;
    Edit e = new Edit(a);
    e.substitute(new Token(new Word("x")), x);
    return e.getCurrent();
  }

  /**
   * This method tokenizes and parses a given string into a mathematical expression.
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.