public static IAST Continue() { return headAST0(Continue); }
public static IAST Break() { return headAST0(Break); }
public static IAST BlankSequence() { return headAST0(BlankSequence); }
public static IAST GumbelDistribution() { return headAST0(GumbelDistribution); }
public static IAST NormalDistribution() { return headAST0(NormalDistribution); }
public static IAST FixIntRules() { return F.headAST0(F.$rubi("FixIntRules")); }
/** {@inheritDoc} */ @Override public IAST rest() { int last = size(); switch (last) { case 1: return this; case 2: return F.headAST0(head()); } return new ASTProxy(fDelegate, fFirstIndex + 1); }
/** * Get a function f[...][...] * */ IASTMutable getFunctionArguments(final IExpr head) throws SyntaxError { fRecursionDepth++; getNextToken(); if (fToken == TT_ARGUMENTS_CLOSE) { fRecursionDepth--; getNextToken(); if (fToken == TT_ARGUMENTS_OPEN) { return getFunctionArguments(F.headAST0(head)); } return F.headAST0(head); } final IASTAppendable function = F.ast(head); getArguments(function); fRecursionDepth--; if (fToken == TT_ARGUMENTS_CLOSE) { getNextToken(); if (fToken == TT_ARGUMENTS_OPEN) { return getFunctionArguments(reduceAST(function)); } return reduceAST(function); } throwSyntaxError("']' expected."); return null; }
public IAST removeFromStart(int firstPosition) { if (firstPosition == 1) { return this; } if (0 < firstPosition && firstPosition <= size()) { int last = size(); int size = last - firstPosition + 1; switch (size) { case 1: return F.headAST0(head()); case 2: return F.unaryAST1(head(), get(last - 1)); // case 3: // return F.binaryAST2(head(), get(last - 2), get(last - 1)); // case 4: // return F.ternaryAST3(head(), get(last - 3), get(last - 2), get(last - 1)); default: if (isOrderlessAST()) { return copyFrom(firstPosition); } return new ASTProxy(this, firstPosition); } } else { throw new IndexOutOfBoundsException("Index: " + Integer.valueOf(firstPosition) + ", Size: " + size()); } }
/** {@inheritDoc} */ @Override public IAST removeFromStart(int firstPosition) { if (firstPosition == 1) { return this; } if (0 < firstPosition && firstPosition <= size()) { int last = size(); int size = last - firstPosition + 1; switch (size) { case 1: return F.headAST0(head()); case 2: return F.unaryAST1(head(), get(last - 1)); } } return new ASTProxy(fDelegate, fFirstIndex + firstPosition - 1); }
/** {@inheritDoc} */ @Override public IAST rest() { switch (size()) { case 1: return this; case 2: return F.headAST0(head()); case 3: return F.unaryAST1(head(), arg2()); // case 4: // return F.binaryAST2(head(), arg2(), arg3()); // case 5: // return F.ternaryAST3(head(), arg2(), arg3(), arg4()); default: if (isOrderlessAST()) { return super.rest(); } return new ASTProxy(this, 2); } }
/** * Copy to a new <code>IAST</code> and remove all arguments from position <code>1</code> inclusive to the * <code>firstPosition</code> exclusive of this AST. * * @param firstPosition * @return */ default public IAST removeFromStart(int firstPosition) { if (0 < firstPosition && firstPosition <= size()) { if (firstPosition == 1) { return this; } int last = size(); int size = last - firstPosition + 1; switch (size) { case 1: return F.headAST0(head()); case 2: return F.unaryAST1(head(), get(last - 1)); case 3: return F.binaryAST2(head(), get(last - 2), get(last - 1)); case 4: return F.ternaryAST3(head(), get(last - 3), get(last - 2), get(last - 1)); } return copyFrom(firstPosition); } else { throw new IndexOutOfBoundsException("Index: " + Integer.valueOf(firstPosition) + ", Size: " + size()); } }
private static IASTMutable reduceAST(IASTMutable function) { int size = function.size(); switch (size) { case 1: return F.headAST0(function.head()); case 2: return F.unaryAST1(function.head(), function.arg1()); case 3: return F.binaryAST2(function.head(), function.arg1(), function.arg2()); case 4: return F.ternaryAST3(function.head(), function.arg1(), function.arg2(), function.arg3()); } return function; }
/** {@inheritDoc} */ @Override default IAST rest() { switch (size()) { case 1: return this; case 2: return F.headAST0(head()); case 3: return F.unaryAST1(head(), arg2()); case 4: return F.binaryAST2(head(), arg2(), arg3()); case 5: return F.ternaryAST3(head(), arg2(), arg3(), arg4()); default: return removeAtClone(1); } }
writeAST2(F.Pattern, pat.getSymbol(), F.unaryAST1(F.BlankNullSequence, condition)); } else { writeAST2(F.Pattern, pat.getSymbol(), F.headAST0(F.BlankNullSequence)); writeAST2(F.Pattern, pat.getSymbol(), F.unaryAST1(F.BlankSequence, condition)); } else { writeAST2(F.Pattern, pat.getSymbol(), F.headAST0(F.BlankSequence)); writeAST2(F.Pattern, pat.getSymbol(), F.unaryAST1(F.Blank, condition)); } else { writeAST2(F.Pattern, pat.getSymbol(), F.headAST0(F.Blank));
switch (size) { case 1: ast = (IASTMutable) F.headAST0(convertNode(functionNode.get(0))); break; case 2: