/* 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 AVariableExpression extends PExpression
{
private PVariable _variable_;
public AVariableExpression()
{
// Constructor
}
public AVariableExpression(
@SuppressWarnings("hiding") PVariable _variable_)
{
// Constructor
setVariable(_variable_);
}
@Override
public Object clone()
{
return new AVariableExpression(
cloneNode(this._variable_));
}
public void apply(Switch sw)
{
((Analysis) sw).caseAVariableExpression(this);
}
public PVariable getVariable()
{
return this._variable_;
}
public void setVariable(PVariable node)
{
if(this._variable_ != null)
{
this._variable_.parent(null);
}
if(node != null)
{
if(node.parent() != null)
{
node.parent().removeChild(node);
}
node.parent(this);
}
this._variable_ = node;
}
@Override
public String toString()
{
return ""
+ toString(this._variable_);
}
@Override
void removeChild(@SuppressWarnings("unused") Node child)
{
// Remove child
if(this._variable_ == child)
{
this._variable_ = null;
return;
}
throw new RuntimeException("Not a child.");
}
@Override
void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild)
{
// Replace child
if(this._variable_ == oldChild)
{
setVariable((PVariable) newChild);
return;
}
throw new RuntimeException("Not a child.");
}
}