@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; if (!super.equals(o)) return false; ScalarLiteral that = (ScalarLiteral) o; return Objects.equals(value, that.value); }
public ListLiteral(List<Expression> args) { super(JiffleType.LIST); this.args = new ArrayList<>(); for (Expression arg : args) { this.args.add(arg.forceDouble()); } }
public PrefixUnaryExpression(String op, Expression arg) { super(arg.getType()); this.op = op; this.arg = arg; }
@Override public int hashCode() { return Objects.hash(super.hashCode(), arg, op); }
public void write(SourceWriter w) { w.append("("); expr.write(w); w.append(")"); }
@Override public int hashCode() { return Objects.hash(super.hashCode(), value); }
/** * Writes out a node to a SourceWriter and returns the resulting script * * @param node * @return */ public String writeToString(Expression node) { SourceWriter sw = new SourceWriter(runtimeModel); node.write(sw); return sw.getSource(); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; if (!super.equals(o)) return false; Variable variable = (Variable) o; return Objects.equals(name, variable.name); }
public PostfixUnaryExpression(Expression arg, String op) { super(arg.getType()); this.arg = arg; this.op = op; }
@Override public int hashCode() { return Objects.hash(super.hashCode(), name); }
/** * Writes out a node to a SourceWriter and returns the resulting script * * @param node * @return */ public String writeToString(Expression node) { SourceWriter sw = new SourceWriter(runtimeModel); node.write(sw); return sw.getSource(); }
public ListLiteral(List<Expression> args) { super(JiffleType.LIST); this.args = new ArrayList<>(); for (Expression arg : args) { this.args.add(arg.forceDouble()); } }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; if (!super.equals(o)) return false; ParenExpression that = (ParenExpression) o; return Objects.equals(expr, that.expr); }
@Override public int hashCode() { return Objects.hash(super.hashCode(), destVar, expr); }
public void write(SourceWriter w) { w.append("("); expr.write(w); w.append(")"); }
public BinaryExpression(int opCode, Expression left, Expression right, boolean declarationNeeded) throws NodeException { super(getReturnType(left, right)); this.op = Operator.get(opCode); if (op == Operator.UNKNOWN) { throw new NodeException(Errors.INVALID_BINARY_EXPRESSION); } this.left = left.forceDouble(); this.right = right.forceDouble(); this.declarationNeeded = declarationNeeded; }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; if (!super.equals(o)) return false; ListLiteral that = (ListLiteral) o; return Objects.equals(args, that.args); }
public PrefixUnaryExpression(String op, Expression arg) { super(arg.getType()); this.op = op; this.arg = arg; }
@Override public int hashCode() { return Objects.hash(super.hashCode(), expr); }