01: package org.hansel.stack;
02:
03: import org.objectweb.asm.tree.analysis.Value;
04:
05: public class BinaryOperatorEntry extends OperatorEntry {
06: private HanselValue op1;
07: private HanselValue op2;
08:
09: public BinaryOperatorEntry(String operator, int precedence,
10: Value op1, Value op2) {
11: this (operator, precedence, (HanselValue) op1, (HanselValue) op2);
12: }
13:
14: public BinaryOperatorEntry(String operator, int precedence,
15: Value op1, Value op2, int size) {
16: this (operator, precedence, (HanselValue) op1,
17: (HanselValue) op2, size);
18: }
19:
20: public BinaryOperatorEntry(String operator, int precedence,
21: HanselValue op1, HanselValue op2) {
22: this (operator, precedence, op1, op2, ((HanselValue) op1)
23: .getSize());
24: }
25:
26: public BinaryOperatorEntry(String operator, int precedence,
27: HanselValue op1, HanselValue op2, int size) {
28: super (operator, precedence, op1.isBoolType(), size);
29:
30: assert op1 != null && op2 != null : "Operators may not be null.";
31:
32: this .op1 = op1;
33: this .op2 = op2;
34: }
35:
36: public HanselValue getOperator1() {
37: return op1;
38: }
39:
40: public HanselValue getOperator2() {
41: return op2;
42: }
43:
44: public String toString() {
45: return toString(op1) + " " + super .toString() + " "
46: + toString(op2);
47: }
48:
49: public HanselValue compress() {
50: return this;
51: }
52:
53: }
|