01: // This file is part of KeY - Integrated Deductive Software Design
02: // Copyright (C) 2001-2007 Universitaet Karlsruhe, Germany
03: // Universitaet Koblenz-Landau, Germany
04: // Chalmers University of Technology, Sweden
05: //
06: // The KeY system is protected by the GNU General Public License.
07: // See LICENSE.TXT for details.
08: //
09: //
10:
11: package de.uka.ilkd.key.java.expression.operator;
12:
13: import de.uka.ilkd.key.java.Expression;
14: import de.uka.ilkd.key.java.PrettyPrinter;
15: import de.uka.ilkd.key.java.visitor.Visitor;
16: import de.uka.ilkd.key.util.ExtList;
17:
18: /**
19: * Addition or string concatenation operator "+".
20: */
21:
22: public class Plus extends BinaryOperator {
23:
24: /**
25: * Constructor for the transformation of COMPOST ASTs to KeY.
26: * The first occurrence of an Expression in the given list is taken as
27: * the left hand side
28: * of the expression, the second occurrence is taken as the right hand
29: * side of the expression.
30: * @param children the children of this AST element as KeY classes.
31: */
32: public Plus(ExtList children) {
33: super (children);
34: }
35:
36: public Plus(Expression lhs, Expression rhs) {
37: super (lhs, rhs);
38: }
39:
40: /**
41: * Get precedence.
42: * @return the int value.
43: */
44:
45: public int getPrecedence() {
46: return 3;
47: }
48:
49: /**
50: * Get notation.
51: * @return the int value.
52: */
53: public int getNotation() {
54: return INFIX;
55: }
56:
57: /** calls the corresponding method of a visitor in order to
58: * perform some action/transformation on this element
59: * @param v the Visitor
60: */
61: public void visit(Visitor v) {
62: v.performActionOnPlus(this );
63: }
64:
65: public void prettyPrint(PrettyPrinter p) throws java.io.IOException {
66: p.printPlus(this);
67: }
68: }
|