X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.spreadsheet%2Fsrc%2Forg%2Fsimantics%2Fspreadsheet%2Fsolver%2Fformula%2Fparser%2Fast%2FAstRelation.java;fp=bundles%2Forg.simantics.spreadsheet%2Fsrc%2Forg%2Fsimantics%2Fspreadsheet%2Fsolver%2Fformula%2Fparser%2Fast%2FAstRelation.java;h=2c525fb437e6107944b2504aa2bfc4ee24a26971;hb=c07a3818f0024e932a27eb85cbfd3f2291475a65;hp=0000000000000000000000000000000000000000;hpb=6c99e980d250fb9201aba93be7dcb1f55564dccd;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.spreadsheet/src/org/simantics/spreadsheet/solver/formula/parser/ast/AstRelation.java b/bundles/org.simantics.spreadsheet/src/org/simantics/spreadsheet/solver/formula/parser/ast/AstRelation.java new file mode 100644 index 000000000..2c525fb43 --- /dev/null +++ b/bundles/org.simantics.spreadsheet/src/org/simantics/spreadsheet/solver/formula/parser/ast/AstRelation.java @@ -0,0 +1,39 @@ +/******************************************************************************* + * Copyright (c) 2010 Association for Decentralized Information Management in + * Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.spreadsheet.solver.formula.parser.ast; + +public class AstRelation implements AstValue { + + public AstValue left; + public String op; + public AstValue right; + + public AstRelation(AstValue left) { + this.left = left; + } + + public void setRight(String op, AstValue right) { + this.op = op.trim(); + this.right = right; + } + + @Override + public T accept(AstValueVisitor v) { + return v.visit(this); + } + + public AstValue simplify() { + if(right == null) return left; + else return this; + } + +}