/** * Returns the label that represents {@code this|rhs} */ public Label or(Label rhs) { return new LabelExpression.Or(this,rhs); }
public Binary(Label lhs, Label rhs, LabelOperatorPrecedence op) { super(combine(lhs, rhs, op)); this.lhs = lhs; this.rhs = rhs; }
/** * Parses the expression into a label expression tree. * * TODO: replace this with a real parser later */ public static Label parseExpression(String labelExpression) throws ANTLRException { LabelExpressionLexer lexer = new LabelExpressionLexer(new StringReader(labelExpression)); return new LabelExpressionParser(lexer).expr(); }
/** * If the label contains 'unsafe' chars, escape them. */ @Override public String getExpression() { return escape(name); }
/** * Returns the label that represents {@code this->rhs} */ public Label implies(Label rhs) { return new LabelExpression.Implies(this,rhs); }
/** * Returns the label that represents {@code (this)} * This is a pointless operation for machines, but useful * for humans who find the additional parenthesis often useful */ public Label paren() { return new LabelExpression.Paren(this); }
/** * Returns the label that represents {@code this&rhs} */ public Label and(Label rhs) { return new LabelExpression.And(this,rhs); }
/** * Returns the label that represents {@code !this} */ public Label not() { return new LabelExpression.Not(this); }
/** * Returns all the {@link LabelAtomPropertyDescriptor}s that can be potentially configured * on this label. */ public List<LabelAtomPropertyDescriptor> getApplicablePropertyDescriptors() { return LabelAtomProperty.all(); }
/** * Returns the label that represents {@code this<->rhs} */ public Label iff(Label rhs) { return new LabelExpression.Iff(this,rhs); }
public Not(Label base) { super('!'+paren(LabelOperatorPrecedence.NOT,base)); this.base = base; }
public void setDescription(String description) throws IOException { this.description = description; save(); }
@Override public String getExpression() { return getDisplayName(); }
@Override public <V, P> V accept(LabelVisitor<V, P> visitor, P param) { return visitor.onParen(this, param); }
@Override public <V, P> V accept(LabelVisitor<V, P> visitor, P param) { return visitor.onAnd(this, param); }
@Override public <V, P> V accept(LabelVisitor<V, P> visitor, P param) { return visitor.onOr(this, param); }
@Override public <V, P> V accept(LabelVisitor<V, P> visitor, P param) { return visitor.onIff(this, param); }
@Override public <V, P> V accept(LabelVisitor<V, P> visitor, P param) { return visitor.onImplies(this, param); }
public float weight(LabelAtom item) { return item.getTiedJobCount(); } });