• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* This file was generated by SableCC (http://www.sablecc.org/). */
2 
3 package com.google.clearsilver.jsilver.syntax.node;
4 
5 import com.google.clearsilver.jsilver.syntax.analysis.*;
6 
7 @SuppressWarnings("nls")
8 public final class AVariableExpression extends PExpression
9 {
10     private PVariable _variable_;
11 
AVariableExpression()12     public AVariableExpression()
13     {
14         // Constructor
15     }
16 
AVariableExpression( @uppressWarnings"hiding") PVariable _variable_)17     public AVariableExpression(
18         @SuppressWarnings("hiding") PVariable _variable_)
19     {
20         // Constructor
21         setVariable(_variable_);
22 
23     }
24 
25     @Override
clone()26     public Object clone()
27     {
28         return new AVariableExpression(
29             cloneNode(this._variable_));
30     }
31 
apply(Switch sw)32     public void apply(Switch sw)
33     {
34         ((Analysis) sw).caseAVariableExpression(this);
35     }
36 
getVariable()37     public PVariable getVariable()
38     {
39         return this._variable_;
40     }
41 
setVariable(PVariable node)42     public void setVariable(PVariable node)
43     {
44         if(this._variable_ != null)
45         {
46             this._variable_.parent(null);
47         }
48 
49         if(node != null)
50         {
51             if(node.parent() != null)
52             {
53                 node.parent().removeChild(node);
54             }
55 
56             node.parent(this);
57         }
58 
59         this._variable_ = node;
60     }
61 
62     @Override
toString()63     public String toString()
64     {
65         return ""
66             + toString(this._variable_);
67     }
68 
69     @Override
removeChild(@uppressWarnings"unused") Node child)70     void removeChild(@SuppressWarnings("unused") Node child)
71     {
72         // Remove child
73         if(this._variable_ == child)
74         {
75             this._variable_ = null;
76             return;
77         }
78 
79         throw new RuntimeException("Not a child.");
80     }
81 
82     @Override
replaceChild(@uppressWarnings"unused") Node oldChild, @SuppressWarnings("unused") Node newChild)83     void replaceChild(@SuppressWarnings("unused") Node oldChild, @SuppressWarnings("unused") Node newChild)
84     {
85         // Replace child
86         if(this._variable_ == oldChild)
87         {
88             setVariable((PVariable) newChild);
89             return;
90         }
91 
92         throw new RuntimeException("Not a child.");
93     }
94 }
95