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 or.
24: */
25:
26: public class LogicalOr extends Operator {
27:
28: /**
29: * Logical or.
30: */
31:
32: public LogicalOr(ExtList children) {
33: super (children);
34: }
35:
36: public LogicalOr(Expression lhs, Expression rhs) {
37: super (lhs, rhs);
38: }
39:
40: /**
41: * Get arity.
42: * @return the int value.
43: */
44:
45: public int getArity() {
46: return 2;
47: }
48:
49: /**
50: * Get precedence.
51: * @return the int value.
52: */
53:
54: public int getPrecedence() {
55: return 11;
56: }
57:
58: /**
59: * Get notation.
60: * @return the int value.
61: */
62:
63: public int getNotation() {
64: return INFIX;
65: }
66:
67: /** calls the corresponding method of a visitor in order to
68: * perform some action/transformation on this element
69: * @param v the Visitor
70: */
71: public void visit(Visitor v) {
72: v.performActionOnLogicalOr(this );
73: }
74:
75: public void prettyPrint(PrettyPrinter p) throws java.io.IOException {
76: p.printLogicalOr(this );
77: }
78:
79: public KeYJavaType getKeYJavaType(Services services,
80: ExecutionContext ec) {
81: return services.getTypeConverter().getBooleanType();
82: }
83: }
|