~ubuntu-branches/ubuntu/vivid/sablecc/vivid

« back to all changes in this revision

Viewing changes to src/org/sablecc/sablecc/node/APkgNameTail.java

  • Committer: Bazaar Package Importer
  • Author(s): Etienne M. Gagnon
  • Date: 2004-01-25 13:28:01 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040125132801-0so74ui506b30b1q
Tags: 2.18.2-1
* New upstream release.
* Keep the org.sablecc.ant.taskdef.Sablecc ant task of the upstream
  package, closes: #213020.
* Improve man page.
* Update Standards-Version to 3.6.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* This file was generated by SableCC (http://www.sablecc.org/). */
 
2
 
 
3
package org.sablecc.sablecc.node;
 
4
 
 
5
import java.util.*;
 
6
import org.sablecc.sablecc.analysis.*;
 
7
 
 
8
public final class APkgNameTail extends PPkgNameTail
 
9
{
 
10
  private TDot _dot_;
 
11
  private TPkgId _pkgId_;
 
12
 
 
13
  public APkgNameTail()
 
14
  {}
 
15
 
 
16
  public APkgNameTail(
 
17
    TDot _dot_,
 
18
    TPkgId _pkgId_)
 
19
  {
 
20
    setDot(_dot_);
 
21
 
 
22
    setPkgId(_pkgId_);
 
23
 
 
24
  }
 
25
  public Object clone()
 
26
  {
 
27
    return new APkgNameTail(
 
28
             (TDot) cloneNode(_dot_),
 
29
             (TPkgId) cloneNode(_pkgId_));
 
30
  }
 
31
 
 
32
  public void apply(Switch sw)
 
33
  {
 
34
    ((Analysis) sw).caseAPkgNameTail(this);
 
35
  }
 
36
 
 
37
  public TDot getDot()
 
38
  {
 
39
    return _dot_;
 
40
  }
 
41
 
 
42
  public void setDot(TDot node)
 
43
  {
 
44
    if(_dot_ != null)
 
45
    {
 
46
      _dot_.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
    _dot_ = node;
 
60
  }
 
61
 
 
62
  public TPkgId getPkgId()
 
63
  {
 
64
    return _pkgId_;
 
65
  }
 
66
 
 
67
  public void setPkgId(TPkgId node)
 
68
  {
 
69
    if(_pkgId_ != null)
 
70
    {
 
71
      _pkgId_.parent(null);
 
72
    }
 
73
 
 
74
    if(node != null)
 
75
    {
 
76
      if(node.parent() != null)
 
77
      {
 
78
        node.parent().removeChild(node);
 
79
      }
 
80
 
 
81
      node.parent(this);
 
82
    }
 
83
 
 
84
    _pkgId_ = node;
 
85
  }
 
86
 
 
87
  public String toString()
 
88
  {
 
89
    return ""
 
90
           + toString(_dot_)
 
91
           + toString(_pkgId_);
 
92
  }
 
93
 
 
94
  void removeChild(Node child)
 
95
  {
 
96
    if(_dot_ == child)
 
97
    {
 
98
      _dot_ = null;
 
99
      return;
 
100
    }
 
101
 
 
102
    if(_pkgId_ == child)
 
103
    {
 
104
      _pkgId_ = null;
 
105
      return;
 
106
    }
 
107
 
 
108
  }
 
109
 
 
110
  void replaceChild(Node oldChild, Node newChild)
 
111
  {
 
112
    if(_dot_ == oldChild)
 
113
    {
 
114
      setDot((TDot) newChild);
 
115
      return;
 
116
    }
 
117
 
 
118
    if(_pkgId_ == oldChild)
 
119
    {
 
120
      setPkgId((TPkgId) newChild);
 
121
      return;
 
122
    }
 
123
 
 
124
  }
 
125
}