01: package org.hansel.stack;
02:
03: public class PrefixOpEntry extends OperatorEntry {
04: private HanselValue entry;
05:
06: public PrefixOpEntry(String operator, int precedence,
07: HanselValue entry) {
08: super (operator, precedence, entry.isBoolType(), entry.getSize());
09:
10: this .entry = entry;
11: }
12:
13: public PrefixOpEntry(String operator, int precedence,
14: HanselValue entry, int size) {
15: super (operator, precedence, entry.isBoolType(), size);
16:
17: this .entry = entry;
18: }
19:
20: protected HanselValue getEntry() {
21: return entry;
22: }
23:
24: public String toString() {
25: return super .toString() + toString(entry);
26: }
27:
28: public HanselValue compress() {
29: try {
30: PrefixOpEntry result = (PrefixOpEntry) this .clone();
31: result.entry = entry.compress();
32: return result;
33: } catch (CloneNotSupportedException e) {
34: e.printStackTrace();
35: // Try to make the best of it...
36: return this;
37: }
38: }
39:
40: }
|