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.Services;
16: import de.uka.ilkd.key.java.abstraction.KeYJavaType;
17: import de.uka.ilkd.key.java.expression.Operator;
18: import de.uka.ilkd.key.java.reference.ExecutionContext;
19: import de.uka.ilkd.key.java.visitor.Visitor;
20: import de.uka.ilkd.key.util.ExtList;
21:
22: /**
23: * Logical and.
24: */
25:
26: public class LogicalAnd extends Operator {
27:
28: /**
29: * Logical and.
30: * @param children an ExtList with all children of this node
31: * the first children in list will be the one on the left
32: * side, the second the one on the right side.
33: */
34:
35: public LogicalAnd(ExtList children) {
36: super (children);
37: }
38:
39: public LogicalAnd(Expression lhs, Expression rhs) {
40: super (lhs, rhs);
41: }
42:
43: /**
44: * Get arity.
45: * @return the int value.
46: */
47: public int getArity() {
48: return 2;
49: }
50:
51: /**
52: * Get precedence.
53: * @return the int value.
54: */
55:
56: public int getPrecedence() {
57: return 10;
58: }
59:
60: /**
61: * Get notation.
62: * @return the int value.
63: */
64:
65: public int getNotation() {
66: return INFIX;
67: }
68:
69: /** calls the corresponding method of a visitor in order to
70: * perform some action/transformation on this element
71: * @param v the Visitor
72: */
73: public void visit(Visitor v) {
74: v.performActionOnLogicalAnd(this );
75: }
76:
77: public void prettyPrint(PrettyPrinter p) throws java.io.IOException {
78: p.printLogicalAnd(this );
79: }
80:
81: public KeYJavaType getKeYJavaType(Services services,
82: ExecutionContext ec) {
83: return services.getTypeConverter().getBooleanType();
84: }
85:
86: }
|