blob: f6788d1ecd254435e006a6d4bef8b9c14ea1f25b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
/*
* Parameter.java 1.0
*
* This interface is made to type ptree-node into
* the parameter in the body of class.
*
* Jun 20, 1997 mich
* Sep 29, 1997 bv
* Oct 11, 1997 mich
*
* @see io.devnulllabs.openjava.ptree.ParseTree
* @version 1.0 last updated: Oct 11, 1997
* @author Michiaki Tatsubori
*/
package io.devnulllabs.openjava.ptree;
import io.devnulllabs.openjava.ptree.util.ParseTreeVisitor;
/**
* The LabeledStatement class presents labeled statement node
* of parse tree
*
* @see io.devnulllabs.openjava.ptree.NonLeaf
* @see io.devnulllabs.openjava.ptree.Statement
*/
public class LabeledStatement extends NonLeaf implements Statement {
/**
* Allocates a new object.
*
*/
public LabeledStatement(String name, Statement statement) {
super();
set(name, (ParseTree) statement);
}
LabeledStatement() {
super();
}
/**
* Gets the label.
*
* @return the label.
*/
public String getLabel() {
return (String) elementAt(0);
}
/**
* Sets the label.
*
* @param label the label to set.
*/
public void setLabel(String label) {
setElementAt(label, 0);
}
/**
* Gets the statement of this labeled statement
*
* @return the statement.
*/
public Statement getStatement() {
return (Statement) elementAt(1);
}
/**
* Sets the statement of this labeled statement
*
* @return stmt the statement to set.
*/
public void setStatement(Statement stmt) {
setElementAt(stmt, 1);
}
public void accept(ParseTreeVisitor v) throws ParseTreeException {
v.visit(this);
}
}
|