edu.mit.csail.sdg.alloy4compiler.ast
Class Browsable

java.lang.Object
  extended by edu.mit.csail.sdg.alloy4compiler.ast.Browsable
Direct Known Subclasses:
Command, CompModule, Expr, Func

public abstract class Browsable
extends java.lang.Object

This abstract class represents a node that can be browsed in the graphical parse tree viewer.


Constructor Summary
Browsable()
           
 
Method Summary
abstract  java.lang.String getHTML()
          Returns the description (as HTML) to show for this node.
abstract  java.util.List<? extends Browsable> getSubnodes()
          Returns a list of subnodes for this node.
static Browsable make(Pos pos, Pos span, java.lang.String html, Browsable subnode)
          Construct a Browsable node with the given HTML description and the given single subnode.
static Browsable make(Pos pos, Pos span, java.lang.String html, java.util.List<? extends Browsable> subnodes)
          Construct a Browsable node with the given HTML description and the given 0 or more subnodes.
static Browsable make(java.lang.String html, Browsable subnode)
          Construct a Browsable node with the given HTML description and the given single subnode.
static Browsable make(java.lang.String html, java.util.List<? extends Browsable> subnodes)
          Construct a Browsable node with the given HTML description and the given 0 or more subnodes.
 Pos pos()
          Returns a Pos object representing the position of this Expr.
 javax.swing.JFrame showAsTree(Listener listener)
          Display this node and its subnodes as a tree; if listener!=null, it will receive OurTree.Event.SELECT events when nodes are selected.
 Pos span()
          Returns a Pos object representing the entire span of this Expr and all its subexpressions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Browsable

public Browsable()
Method Detail

pos

public Pos pos()
Returns a Pos object representing the position of this Expr.


span

public Pos span()
Returns a Pos object representing the entire span of this Expr and all its subexpressions.


getHTML

public abstract java.lang.String getHTML()
Returns the description (as HTML) to show for this node.


getSubnodes

public abstract java.util.List<? extends Browsable> getSubnodes()
Returns a list of subnodes for this node.


make

public static final Browsable make(Pos pos,
                                   Pos span,
                                   java.lang.String html,
                                   Browsable subnode)
Construct a Browsable node with the given HTML description and the given single subnode.


make

public static final Browsable make(java.lang.String html,
                                   Browsable subnode)
Construct a Browsable node with the given HTML description and the given single subnode.


make

public static final Browsable make(java.lang.String html,
                                   java.util.List<? extends Browsable> subnodes)
Construct a Browsable node with the given HTML description and the given 0 or more subnodes.


make

public static final Browsable make(Pos pos,
                                   Pos span,
                                   java.lang.String html,
                                   java.util.List<? extends Browsable> subnodes)
Construct a Browsable node with the given HTML description and the given 0 or more subnodes.


showAsTree

public final javax.swing.JFrame showAsTree(Listener listener)
Display this node and its subnodes as a tree; if listener!=null, it will receive OurTree.Event.SELECT events when nodes are selected.