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 class
CAstImpl.CAstNodeImpl
protected static class
CAstImpl.CAstValueImpl
-
Constructor Summary
Constructors Constructor Description CAstImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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(short value)
Make a short integer constant node.CAstNode
makeConstant(Object value)
Make an arbitrary object 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.String
makeUnique()
Make a new identifier, unqiue to this CAst instance.
-
-
-
Method Detail
-
makeUnique
public String makeUnique()
Description copied from interface:CAst
Make a new identifier, unqiue to this CAst instance.- Specified by:
makeUnique
in interfaceCAst
-
makeNode
public CAstNode makeNode(int kind, CAstNode[] cs)
Description copied from interface:CAst
Make a node of type kind specifying an array of children.
-
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.
-
makeNode
public CAstNode makeNode(int kind)
Description copied from interface:CAst
Make a node of type kind with no children.
-
makeNode
public CAstNode makeNode(int kind, CAstNode c1)
Description copied from interface:CAst
Make a node of type kind with one child.
-
makeNode
public CAstNode makeNode(int kind, CAstNode c1, CAstNode c2)
Description copied from interface:CAst
Make a node of type kind with two children.
-
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.
-
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.
-
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.
-
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.
-
makeConstant
public CAstNode makeConstant(Object value)
Description copied from interface:CAst
Make an arbitrary object constant node.- Specified by:
makeConstant
in interfaceCAst
-
makeConstant
public CAstNode makeConstant(boolean value)
Description copied from interface:CAst
Make a boolean constant node.- Specified by:
makeConstant
in interfaceCAst
-
makeConstant
public CAstNode makeConstant(char value)
Description copied from interface:CAst
Make a char constant node.- Specified by:
makeConstant
in interfaceCAst
-
makeConstant
public CAstNode makeConstant(short value)
Description copied from interface:CAst
Make a short integer constant node.- Specified by:
makeConstant
in interfaceCAst
-
makeConstant
public CAstNode makeConstant(int value)
Description copied from interface:CAst
Make an integer constant node.- Specified by:
makeConstant
in interfaceCAst
-
makeConstant
public CAstNode makeConstant(long value)
Description copied from interface:CAst
Make a long integer constant node.- Specified by:
makeConstant
in interfaceCAst
-
makeConstant
public CAstNode makeConstant(float value)
Description copied from interface:CAst
Make a single-precision floating point constant node.- Specified by:
makeConstant
in interfaceCAst
-
makeConstant
public CAstNode makeConstant(double value)
Description copied from interface:CAst
Make a double-precision floating point constant node.- Specified by:
makeConstant
in interfaceCAst
-
-