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

« back to all changes in this revision

Viewing changes to src/org/sablecc/sablecc/node/PkgName1.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
 
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2
 
 * This file is part of SableCC.                             *
3
 
 * See the file "LICENSE" for copyright information and the  *
4
 
 * terms and conditions for copying, distribution and        *
5
 
 * modification of SableCC.                                  *
6
 
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
7
 
 
8
 
package org.sablecc.sablecc.node;
9
 
 
10
 
import org.sablecc.sablecc.Switch;
11
 
import org.sablecc.sablecc.analysis.Analysis;
12
 
 
13
 
public final class PkgName1 extends PkgName
14
 
{
15
 
    public void apply(Switch sw)
16
 
    {
17
 
        ((Analysis) sw).casePkgName1(this);
18
 
    }
19
 
 
20
 
    public String toString()
21
 
    {
22
 
        return ""
23
 
            + node1
24
 
            + node2
25
 
            + node3;
26
 
    }
27
 
 
28
 
    private PkgId node1;
29
 
 
30
 
    public PkgId getNode1()
31
 
    {
32
 
        return node1;
33
 
    }
34
 
 
35
 
    public void setNode1(PkgId node)
36
 
    {
37
 
        if(node1 != null)
38
 
        {
39
 
            node1.setParent(null);
40
 
        }
41
 
 
42
 
        if(node.getParent() != null)
43
 
        {
44
 
            node.getParent().removeChild(node);
45
 
        }
46
 
 
47
 
        node.setParent(this);
48
 
 
49
 
        node1 = node;
50
 
    }
51
 
 
52
 
    private PkgNameTails node2;
53
 
 
54
 
    public PkgNameTails getNode2()
55
 
    {
56
 
        return node2;
57
 
    }
58
 
 
59
 
    public void setNode2(PkgNameTails node)
60
 
    {
61
 
        if(node2 != null)
62
 
        {
63
 
            node2.setParent(null);
64
 
        }
65
 
 
66
 
        if(node.getParent() != null)
67
 
        {
68
 
            node.getParent().removeChild(node);
69
 
        }
70
 
 
71
 
        node.setParent(this);
72
 
 
73
 
        node2 = node;
74
 
    }
75
 
 
76
 
    private TSemicolon node3;
77
 
 
78
 
    public TSemicolon getNode3()
79
 
    {
80
 
        return node3;
81
 
    }
82
 
 
83
 
    public void setNode3(TSemicolon node)
84
 
    {
85
 
        if(node3 != null)
86
 
        {
87
 
            node3.setParent(null);
88
 
        }
89
 
 
90
 
        if(node.getParent() != null)
91
 
        {
92
 
            node.getParent().removeChild(node);
93
 
        }
94
 
 
95
 
        node.setParent(this);
96
 
 
97
 
        node3 = node;
98
 
    }
99
 
 
100
 
    void removeChild(Node child)
101
 
    {
102
 
        if(node1 == child)
103
 
        {
104
 
            node1 = null;
105
 
        }
106
 
 
107
 
        if(node2 == child)
108
 
        {
109
 
            node2 = null;
110
 
        }
111
 
 
112
 
        if(node3 == child)
113
 
        {
114
 
            node3 = null;
115
 
        }
116
 
 
117
 
    }
118
 
}
119