]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.spreadsheet/src/org/simantics/spreadsheet/solver/formula/parser/ast/AstArithmeticExpression.java
Adopt spreadsheet changes made in Balas development
[simantics/platform.git] / bundles / org.simantics.spreadsheet / src / org / simantics / spreadsheet / solver / formula / parser / ast / AstArithmeticExpression.java
1 /*******************************************************************************
2  *  Copyright (c) 2010 Association for Decentralized Information Management in
3  *  Industry THTH ry.
4  *  All rights reserved. This program and the accompanying materials
5  *  are made available under the terms of the Eclipse Public License v1.0
6  *  which accompanies this distribution, and is available at
7  *  http://www.eclipse.org/legal/epl-v10.html
8  *
9  *  Contributors:
10  *      VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.spreadsheet.solver.formula.parser.ast;
13
14 import org.simantics.spreadsheet.solver.formula.PrintVisitor;
15
16 public class AstArithmeticExpression extends AstList {
17         
18         private static final long serialVersionUID = -2166778921791305719L;
19         
20         public final String prefix;
21         
22         public AstArithmeticExpression(String prefix, AstValue left) {
23                 super(left);
24                 this.prefix = prefix;
25         }
26         
27         @Override
28         public <T> T accept(AstValueVisitor<T> v) {
29                 return v.visit(this);
30         }
31         
32         @Override
33         public AstValue simplify() {
34                 if(prefix == null) return super.simplify();
35                 return this;
36         }
37         
38         @Override
39         public String toString() {
40                 return accept(new PrintVisitor());
41         }
42         
43 }