Class ParseNode

java.lang.Object
org.jboss.byteman.rule.grammar.ParseNode
Direct Known Subclasses:
ParseNode.BinaryNode, ParseNode.NullaryNode, ParseNode.QuaternaryNode, ParseNode.TernaryNode, ParseNode.UnaryNode

public abstract class ParseNode extends Object
Class used by the JavaCUP parser to construct a parse tree.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    private static class 
    a parse node with two children
    private static class 
    a parse node with no children
    private static class 
    a parse node with four children
    private static class 
    a parse node with three children
    private static class 
    a parse node with one child
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    private int
    the column position for this node
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    private String
    the script file containing the text form which this node was parsed
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    private int
    the line position fo rthis node
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    private int
    the type tag for this node
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    ParseNode(int tag, String file, int line, int column)
    generic constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract Object
    getChild(int idx)
    get the nth child for this node or null if the index exceeds the child count
    abstract int
    get the child count for this node
    int
    get the column position for this node
    int
    get the line position for this node
    get a string representing the position for this node
    int
    get the tag for this node
    abstract String
    get the display representation of this node
    static ParseNode
    node(int tag, String file, int line, int column)
    create a simple node for a builtin token
    static ParseNode
    node(int tag, String file, int line, int column, Object child0)
    create a simple node for a builtin token
    static ParseNode
    node(int tag, String file, int line, int column, Object child0, Object child1)
    create a simple node for a builtin token
    static ParseNode
    node(int tag, String file, int line, int column, Object child0, Object child1, Object child2)
    create a simple node for a builtin token
    static ParseNode
    node(int tag, String file, int line, int column, Object child0, Object child1, Object child2, Object child3)
    create a simple node for a builtin token

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • ParseNode

      protected ParseNode(int tag, String file, int line, int column)
      generic constructor
      Parameters:
      tag - identifies the type of this node
      file - identifies the file containing the node's text
      line - identifies the start line for this node's text
      column - identifies the start columen for this node's text
  • Method Details

    • getTag

      public int getTag()
      get the tag for this node
      Returns:
      the tag for this node
    • getLine

      public int getLine()
      get the line position for this node
      Returns:
      the line position for this node
    • getColumn

      public int getColumn()
      get the column position for this node
      Returns:
      the column position for this node
    • getChildCount

      public abstract int getChildCount()
      get the child count for this node
      Returns:
      the child count for this node
    • getChild

      public abstract Object getChild(int idx)
      get the nth child for this node or null if the index exceeds the child count
      Parameters:
      idx - the child index
      Returns:
      the nth child for this node
    • getText

      public abstract String getText()
      get the display representation of this node
      Returns:
      the display representation of this node
    • getPos

      public String getPos()
      get a string representing the position for this node
      Returns:
      a string representing the position for this node
    • node

      public static ParseNode node(int tag, String file, int line, int column)
      create a simple node for a builtin token
      Parameters:
      tag - identifies the type of this node
      file - identifies the file containing the node's text
      line - identifies the start line for this node's text
      column - identifies the start columen for this node's text
      Returns:
      a simple node for a builtin token
    • node

      public static ParseNode node(int tag, String file, int line, int column, Object child0)
      create a simple node for a builtin token
      Parameters:
      tag - identifies the type of this node
      file - identifies the file containing the node's text
      line - identifies the start line for this node's text
      column - identifies the start columen for this node's text
      child0 - the first child for this node
      Returns:
      a simple node for a builtin token
    • node

      public static ParseNode node(int tag, String file, int line, int column, Object child0, Object child1)
      create a simple node for a builtin token
      Parameters:
      tag - identifies the type of this node
      file - identifies the file containing the node's text
      line - identifies the start line for this node's text
      column - identifies the start columen for this node's text
      child0 - the first child for this node
      child1 - the second child for this node
      Returns:
      a simple node for a builtin token
    • node

      public static ParseNode node(int tag, String file, int line, int column, Object child0, Object child1, Object child2)
      create a simple node for a builtin token
      Parameters:
      tag - identifies the type of this node
      file - identifies the file containing the node's text
      line - identifies the start line for this node's text
      column - identifies the start columen for this node's text
      child0 - the first child for this node
      child1 - the second child for this node
      child2 - the third child for this node
      Returns:
      a simple node for a builtin token
    • node

      public static ParseNode node(int tag, String file, int line, int column, Object child0, Object child1, Object child2, Object child3)
      create a simple node for a builtin token
      Parameters:
      tag - identifies the type of this node
      file - identifies the file containing the node's text
      line - identifies the start line for this node's text
      column - identifies the start columen for this node's text
      child0 - the first child for this node
      child1 - the second child for this node
      child2 - the third child for this node
      child3 - the fourth child for this node
      Returns:
      a simple node for a builtin token