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

« back to all changes in this revision

Viewing changes to src/org/sablecc/sablecc/node/SpecifierOpt1.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 SpecifierOpt1 extends SpecifierOpt
14
 
{
15
 
    public void apply(Switch sw)
16
 
    {
17
 
        ((Analysis) sw).caseSpecifierOpt1(this);
18
 
    }
19
 
 
20
 
    public String toString()
21
 
    {
22
 
        return ""
23
 
            + node1;
24
 
    }
25
 
 
26
 
    private Specifier node1;
27
 
 
28
 
    public Specifier getNode1()
29
 
    {
30
 
        return node1;
31
 
    }
32
 
 
33
 
    public void setNode1(Specifier node)
34
 
    {
35
 
        if(node1 != null)
36
 
        {
37
 
            node1.setParent(null);
38
 
        }
39
 
 
40
 
        if(node.getParent() != null)
41
 
        {
42
 
            node.getParent().removeChild(node);
43
 
        }
44
 
 
45
 
        node.setParent(this);
46
 
 
47
 
        node1 = node;
48
 
    }
49
 
 
50
 
    void removeChild(Node child)
51
 
    {
52
 
        if(node1 == child)
53
 
        {
54
 
            node1 = null;
55
 
        }
56
 
 
57
 
    }
58
 
}
59