1 // Copyright 2006 all rights reserved; see LICENSE file for BSD-style license
3 package edu.berkeley.sbp;
4 import edu.berkeley.sbp.*;
5 import edu.berkeley.sbp.util.*;
6 import edu.berkeley.sbp.Parser.Table.*;
7 import edu.berkeley.sbp.Sequence.Position;
10 import java.lang.reflect.*;
12 class Result implements GraphViz.ToGraphViz {
16 private GSS.Phase phase;
17 private Position reduction;
19 public Position reduction() { return reduction; }
20 public GSS.Phase phase() { return phase; }
21 public Forest getForest() { return f; }
22 public Node parent() { return parent; }
24 public Result(Forest f, Node parent, Position reduction) {
26 this.reduction = reduction;
28 if (parent != null) phase = parent.phase();
31 // GraphViz //////////////////////////////////////////////////////////////////////////////
33 public GraphViz.Node toGraphViz(GraphViz gv) {
34 if (gv.hasNode(this)) return gv.createNode(this);
35 GraphViz.Node n = gv.createNode(this);
37 n.shape = "rectangle";
38 if (parent()!=null) n.edge(parent, "");
41 ((GraphViz.Group)phase().toGraphViz(gv)).add(n);
44 public boolean isTransparent() { return false; }
45 public boolean isHidden() { return false; }