com.ibm.wala.cast.tree.impl
Class CAstImpl

java.lang.Object
  extended by com.ibm.wala.cast.tree.impl.CAstImpl
All Implemented Interfaces:
CAst
Direct Known Subclasses:
CAstValueImpl

public class CAstImpl
extends java.lang.Object
implements CAst

An implementation of CAst, i.e. a simple factory for creating capa ast nodes. This class simply creates generic nodes with a kind field, and either an array of children or a constant values. Note that there is no easy way to mutate these trees; do not change this (see CAstNode for the rationale for this rule).


Nested Class Summary
protected static class CAstImpl.CAstNodeImpl
           
protected static class CAstImpl.CAstValueImpl
           
 
Constructor Summary
CAstImpl()
           
 
Method Summary
 CAstNode makeConstant(boolean value)
          Make a boolean constant node.
 CAstNode makeConstant(char value)
          Make a char constant node.
 CAstNode makeConstant(double value)
          Make a double-precision floating point constant node.
 CAstNode makeConstant(float value)
          Make a single-precision floating point constant node.
 CAstNode makeConstant(int value)
          Make an integer constant node.
 CAstNode makeConstant(long value)
          Make a long integer constant node.
 CAstNode makeConstant(java.lang.Object value)
          Make an arbitrary object constant node.
 CAstNode makeConstant(short value)
          Make a short integer constant node.
 CAstNode makeNode(int kind)
          Make a node of type kind with no children.
 CAstNode makeNode(int kind, CAstNode c1)
          Make a node of type kind with one child.
 CAstNode makeNode(int kind, CAstNode[] cs)
          Make a node of type kind specifying an array of children.
 CAstNode makeNode(int kind, CAstNode c1, CAstNode c2)
          Make a node of type kind with two children.
 CAstNode makeNode(int kind, CAstNode c1, CAstNode[] cs)
          Make a node of type kind giving a first child and array of the rest.
 CAstNode makeNode(int kind, CAstNode c1, CAstNode c2, CAstNode c3)
          Make a node of type kind with three children.
 CAstNode makeNode(int kind, CAstNode c1, CAstNode c2, CAstNode c3, CAstNode c4)
          Make a node of type kind with four children.
 CAstNode makeNode(int kind, CAstNode c1, CAstNode c2, CAstNode c3, CAstNode c4, CAstNode c5)
          Make a node of type kind with five children.
 CAstNode makeNode(int kind, CAstNode c1, CAstNode c2, CAstNode c3, CAstNode c4, CAstNode c5, CAstNode c6)
          Make a node of type kind with six children.
 java.lang.String makeUnique()
          Make a new identifier, unqiue to this CAst instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CAstImpl

public CAstImpl()
Method Detail

makeUnique

public java.lang.String makeUnique()
Description copied from interface: CAst
Make a new identifier, unqiue to this CAst instance.

Specified by:
makeUnique in interface CAst

makeNode

public CAstNode makeNode(int kind,
                         CAstNode[] cs)
Description copied from interface: CAst
Make a node of type kind specifying an array of children.

Specified by:
makeNode in interface CAst

makeNode

public CAstNode makeNode(int kind,
                         CAstNode c1,
                         CAstNode[] cs)
Description copied from interface: CAst
Make a node of type kind giving a first child and array of the rest.

Specified by:
makeNode in interface CAst

makeNode

public CAstNode makeNode(int kind)
Description copied from interface: CAst
Make a node of type kind with no children.

Specified by:
makeNode in interface CAst

makeNode

public CAstNode makeNode(int kind,
                         CAstNode c1)
Description copied from interface: CAst
Make a node of type kind with one child.

Specified by:
makeNode in interface CAst

makeNode

public CAstNode makeNode(int kind,
                         CAstNode c1,
                         CAstNode c2)
Description copied from interface: CAst
Make a node of type kind with two children.

Specified by:
makeNode in interface CAst

makeNode

public CAstNode makeNode(int kind,
                         CAstNode c1,
                         CAstNode c2,
                         CAstNode c3)
Description copied from interface: CAst
Make a node of type kind with three children.

Specified by:
makeNode in interface CAst

makeNode

public CAstNode makeNode(int kind,
                         CAstNode c1,
                         CAstNode c2,
                         CAstNode c3,
                         CAstNode c4)
Description copied from interface: CAst
Make a node of type kind with four children.

Specified by:
makeNode in interface CAst

makeNode

public CAstNode makeNode(int kind,
                         CAstNode c1,
                         CAstNode c2,
                         CAstNode c3,
                         CAstNode c4,
                         CAstNode c5)
Description copied from interface: CAst
Make a node of type kind with five children.

Specified by:
makeNode in interface CAst

makeNode

public CAstNode makeNode(int kind,
                         CAstNode c1,
                         CAstNode c2,
                         CAstNode c3,
                         CAstNode c4,
                         CAstNode c5,
                         CAstNode c6)
Description copied from interface: CAst
Make a node of type kind with six children.

Specified by:
makeNode in interface CAst

makeConstant

public CAstNode makeConstant(java.lang.Object value)
Description copied from interface: CAst
Make an arbitrary object constant node.

Specified by:
makeConstant in interface CAst

makeConstant

public CAstNode makeConstant(boolean value)
Description copied from interface: CAst
Make a boolean constant node.

Specified by:
makeConstant in interface CAst

makeConstant

public CAstNode makeConstant(char value)
Description copied from interface: CAst
Make a char constant node.

Specified by:
makeConstant in interface CAst

makeConstant

public CAstNode makeConstant(short value)
Description copied from interface: CAst
Make a short integer constant node.

Specified by:
makeConstant in interface CAst

makeConstant

public CAstNode makeConstant(int value)
Description copied from interface: CAst
Make an integer constant node.

Specified by:
makeConstant in interface CAst

makeConstant

public CAstNode makeConstant(long value)
Description copied from interface: CAst
Make a long integer constant node.

Specified by:
makeConstant in interface CAst

makeConstant

public CAstNode makeConstant(float value)
Description copied from interface: CAst
Make a single-precision floating point constant node.

Specified by:
makeConstant in interface CAst

makeConstant

public CAstNode makeConstant(double value)
Description copied from interface: CAst
Make a double-precision floating point constant node.

Specified by:
makeConstant in interface CAst