01: package org.hansel.stack;
02:
03: public class OperatorEntry extends HanselValue {
04: private int precedence;
05:
06: public OperatorEntry(String operator, int precedence,
07: boolean isBool, int size) {
08: super (operator, isBool, size);
09: this .precedence = precedence;
10: }
11:
12: protected String toString(HanselValue entry) {
13: if ((entry instanceof OperatorEntry)
14: && (((OperatorEntry) entry).precedence > precedence)) {
15: return "(" + entry.toString() + ")";
16: } else {
17: return entry.toString();
18: }
19: }
20: }
|