Package com.ibm.wala.cast.tree.impl
Class CAstImpl
- java.lang.Object
-
- com.ibm.wala.cast.tree.impl.CAstImpl
-
- All Implemented Interfaces:
CAst
- Direct Known Subclasses:
CAstValueImpl
public class CAstImpl extends 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
Nested Classes Modifier and Type Class Description protected static classCAstImpl.CAstNodeImplprotected static classCAstImpl.CAstValueImpl
-
Constructor Summary
Constructors Constructor Description CAstImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CAstNodemakeConstant(boolean value)Make a boolean constant node.CAstNodemakeConstant(char value)Make a char constant node.CAstNodemakeConstant(double value)Make a double-precision floating point constant node.CAstNodemakeConstant(float value)Make a single-precision floating point constant node.CAstNodemakeConstant(int value)Make an integer constant node.CAstNodemakeConstant(long value)Make a long integer constant node.CAstNodemakeConstant(short value)Make a short integer constant node.CAstNodemakeConstant(Object value)Make an arbitrary object constant node.CAstNodemakeNode(int kind)Make a node of type kind with no children.CAstNodemakeNode(int kind, CAstNode c1)Make a node of type kind with one child.CAstNodemakeNode(int kind, CAstNode[] cs)Make a node of type kind specifying an array of children.CAstNodemakeNode(int kind, CAstNode c1, CAstNode c2)Make a node of type kind with two children.CAstNodemakeNode(int kind, CAstNode c1, CAstNode[] cs)Make a node of type kind giving a first child and array of the rest.CAstNodemakeNode(int kind, CAstNode c1, CAstNode c2, CAstNode c3)Make a node of type kind with three children.CAstNodemakeNode(int kind, CAstNode c1, CAstNode c2, CAstNode c3, CAstNode c4)Make a node of type kind with four children.CAstNodemakeNode(int kind, CAstNode c1, CAstNode c2, CAstNode c3, CAstNode c4, CAstNode c5)Make a node of type kind with five children.CAstNodemakeNode(int kind, CAstNode c1, CAstNode c2, CAstNode c3, CAstNode c4, CAstNode c5, CAstNode c6)Make a node of type kind with six children.StringmakeUnique()Make a new identifier, unqiue to this CAst instance.
-
-
-
Method Detail
-
makeUnique
public String makeUnique()
Description copied from interface:CAstMake a new identifier, unqiue to this CAst instance.- Specified by:
makeUniquein interfaceCAst
-
makeNode
public CAstNode makeNode(int kind, CAstNode[] cs)
Description copied from interface:CAstMake a node of type kind specifying an array of children.
-
makeNode
public CAstNode makeNode(int kind, CAstNode c1, CAstNode[] cs)
Description copied from interface:CAstMake a node of type kind giving a first child and array of the rest.
-
makeNode
public CAstNode makeNode(int kind)
Description copied from interface:CAstMake a node of type kind with no children.
-
makeNode
public CAstNode makeNode(int kind, CAstNode c1)
Description copied from interface:CAstMake a node of type kind with one child.
-
makeNode
public CAstNode makeNode(int kind, CAstNode c1, CAstNode c2)
Description copied from interface:CAstMake a node of type kind with two children.
-
makeNode
public CAstNode makeNode(int kind, CAstNode c1, CAstNode c2, CAstNode c3)
Description copied from interface:CAstMake a node of type kind with three children.
-
makeNode
public CAstNode makeNode(int kind, CAstNode c1, CAstNode c2, CAstNode c3, CAstNode c4)
Description copied from interface:CAstMake a node of type kind with four children.
-
makeNode
public CAstNode makeNode(int kind, CAstNode c1, CAstNode c2, CAstNode c3, CAstNode c4, CAstNode c5)
Description copied from interface:CAstMake a node of type kind with five children.
-
makeNode
public CAstNode makeNode(int kind, CAstNode c1, CAstNode c2, CAstNode c3, CAstNode c4, CAstNode c5, CAstNode c6)
Description copied from interface:CAstMake a node of type kind with six children.
-
makeConstant
public CAstNode makeConstant(Object value)
Description copied from interface:CAstMake an arbitrary object constant node.- Specified by:
makeConstantin interfaceCAst
-
makeConstant
public CAstNode makeConstant(boolean value)
Description copied from interface:CAstMake a boolean constant node.- Specified by:
makeConstantin interfaceCAst
-
makeConstant
public CAstNode makeConstant(char value)
Description copied from interface:CAstMake a char constant node.- Specified by:
makeConstantin interfaceCAst
-
makeConstant
public CAstNode makeConstant(short value)
Description copied from interface:CAstMake a short integer constant node.- Specified by:
makeConstantin interfaceCAst
-
makeConstant
public CAstNode makeConstant(int value)
Description copied from interface:CAstMake an integer constant node.- Specified by:
makeConstantin interfaceCAst
-
makeConstant
public CAstNode makeConstant(long value)
Description copied from interface:CAstMake a long integer constant node.- Specified by:
makeConstantin interfaceCAst
-
makeConstant
public CAstNode makeConstant(float value)
Description copied from interface:CAstMake a single-precision floating point constant node.- Specified by:
makeConstantin interfaceCAst
-
makeConstant
public CAstNode makeConstant(double value)
Description copied from interface:CAstMake a double-precision floating point constant node.- Specified by:
makeConstantin interfaceCAst
-
-