mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-08 12:37:37 +00:00
38 lines
781 B
Java
38 lines
781 B
Java
class UnaryNode extends ExpressionNode {
|
|
|
|
UnaryNode(String aOp, ExpressionNode aChild)
|
|
{
|
|
child = aChild;
|
|
op = aOp;
|
|
}
|
|
|
|
String print(String indent)
|
|
{
|
|
StringBuffer result = new StringBuffer(indent);
|
|
result.append("UnaryNode ");
|
|
result.append(op);
|
|
result.append("\n");
|
|
indent += " ";
|
|
if (child == null) {
|
|
result.append(indent);
|
|
result.append("null\n");
|
|
}
|
|
else
|
|
result.append(child.print(indent));
|
|
return result.toString();
|
|
}
|
|
|
|
String getOperator()
|
|
{
|
|
return op;
|
|
}
|
|
|
|
ExpressionNode getChild()
|
|
{
|
|
return child;
|
|
}
|
|
|
|
protected ExpressionNode child;
|
|
protected String op;
|
|
|
|
} |