public class Typecast extends Expression
| Modifier and Type | Class and Description |
|---|---|
static class |
Typecast.Cast
Represents a cast type
|
| Modifier and Type | Field and Description |
|---|---|
static Typecast.Cast |
CONST |
static Typecast.Cast |
DYNAMIC |
static Typecast.Cast |
NORMAL |
static Typecast.Cast |
REINTERPRET |
static Typecast.Cast |
STATIC |
| Constructor and Description |
|---|
Typecast(java.util.List specs,
Expression expr)
Create a normal typecast.
|
Typecast(Typecast.Cast kind,
java.util.List specs,
Expression expr)
Create a special typecast.
|
Typecast(Typecast.Cast kind,
Specifier spec,
java.util.List expr_list)
Constructs a typecast with the specified kind, specifier, and list of
expressions.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
defaultPrint(Typecast c,
java.io.PrintWriter o)
Prints a typecast expression to a stream.
|
boolean |
equals(java.lang.Object o)
Compares the typecast with the specified object for equality.
|
Expression |
getExpression()
Returns the child expression of the typecast.
|
java.util.List |
getSpecifiers()
Returns the list of specifiers of the typecast.
|
static void |
setClassPrintMethod(java.lang.reflect.Method m)
Overrides the class print method, so that all subsequently
created objects will use the supplied method.
|
java.lang.String |
toString()
Returns a string representation of the expression
|
clone, compareTo, findExpression, getChildren, getParent, getStatement, hashCode, needsParens, print, printSelf, removeChild, setChild, setParens, setParent, setPrintMethod, swapWith, verifypublic static final Typecast.Cast NORMAL
public static final Typecast.Cast DYNAMIC
public static final Typecast.Cast STATIC
public static final Typecast.Cast REINTERPRET
public static final Typecast.Cast CONST
public Typecast(java.util.List specs,
Expression expr)
specs - A list of type specifiers.expr - The expression to cast.NotAnOrphanException - if expr has a parent.public Typecast(Typecast.Cast kind, java.util.List specs, Expression expr)
kind - One of NORMAL, DYNAMIC, STATIC, REINTERPRET, or
CONST.specs - A list of type specifiers.expr - The expression to cast.public Typecast(Typecast.Cast kind, Specifier spec, java.util.List expr_list)
public static void defaultPrint(Typecast c, java.io.PrintWriter o)
c - The cast to print.o - The writer on which to print the cast.public java.lang.String toString()
ExpressiontoString in class Expressionpublic static void setClassPrintMethod(java.lang.reflect.Method m)
m - The new print method.public java.util.List getSpecifiers()
public Expression getExpression()
public boolean equals(java.lang.Object o)
equals in class Expressiono - the object to be compared with.o!=null, this.getClass()==o.getClass(),
and this.children.equals(o.children) ||
this.children==o.children==null