blob: bfb69966a0078893e9cb09aa2cd998a40cc9605c [file] [log] [blame]
/* This file was generated by SableCC (http://www.sablecc.org/). */
package com.google.clearsilver.jsilver.syntax.node;
import com.google.clearsilver.jsilver.syntax.analysis.*;
@SuppressWarnings("nls")
public final class AExpandVariable extends PVariable
{
private PVariable _parent_;
private PExpression _child_;
public AExpandVariable()
{
// Constructor
}
public AExpandVariable(
@SuppressWarnings("hiding") PVariable _parent_,
@SuppressWarnings("hiding") PExpression _child_)
{
// Constructor
setParent(_parent_);
setChild(_child_);
}
@Override
public Object clone()
{
return new AExpandVariable(
cloneNode(this._parent_),
cloneNode(this._child_));
}
public void apply(Switch sw)
{
((Analysis) sw).caseAExpandVariable(this);
}
public PVariable getParent()
{
return this._parent_;
}
public void setParent(PVariable node)
{
if(this._parent_ != null)
{
this._parent_.parent(null);
}
if(node != null)
{
if(node.parent() != null)
{
node.parent().removeChild(node);
}
node.parent(this);
}
this._parent_ = node;
}
public PExpression getChild()
{
return this._child_;
}
public void setChild(PExpression node)
{
if(this._child_ != null)
{
this._child_.parent(null);
}
if(node != null)
{
if(node.parent() != null)
{
node.parent().removeChild(node);
}
node.parent(this);
}
this._child_ = node;
}
@Override
public String toString()
{
return ""
+ toString(this._parent_)
+ toString(this._child_);
}
@Override
void removeChild(@SuppressWarnings("unused") Node child)
{
// Remove child
if(this._parent_ == child)
{
this._parent_ = null;
return;
}
if(this._child_ == child)
{
this._child_ = null;
return;
}
throw new RuntimeException("Not a child.");
}
@Override
void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild)
{
// Replace child
if(this._parent_ == oldChild)
{
setParent((PVariable) newChild);
return;
}
if(this._child_ == oldChild)
{
setChild((PExpression) newChild);
return;
}
throw new RuntimeException("Not a child.");
}
}