-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathConstDecl.java
78 lines (61 loc) · 1.94 KB
/
ConstDecl.java
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
// generated with ast extension for cup
// version 0.8
// 1/1/2023 19:22:27
package askov.schoolprojects.compilerconstruction.mjcompiler.ast;
public class ConstDecl extends Decl {
private Type Type;
private ConstList ConstList;
public ConstDecl (Type Type, ConstList ConstList) {
this.Type=Type;
if(Type!=null) Type.setParent(this);
this.ConstList=ConstList;
if(ConstList!=null) ConstList.setParent(this);
}
public Type getType() {
return Type;
}
public void setType(Type Type) {
this.Type=Type;
}
public ConstList getConstList() {
return ConstList;
}
public void setConstList(ConstList ConstList) {
this.ConstList=ConstList;
}
public void accept(Visitor visitor) {
visitor.visit(this);
}
public void childrenAccept(Visitor visitor) {
if(Type!=null) Type.accept(visitor);
if(ConstList!=null) ConstList.accept(visitor);
}
public void traverseTopDown(Visitor visitor) {
accept(visitor);
if(Type!=null) Type.traverseTopDown(visitor);
if(ConstList!=null) ConstList.traverseTopDown(visitor);
}
public void traverseBottomUp(Visitor visitor) {
if(Type!=null) Type.traverseBottomUp(visitor);
if(ConstList!=null) ConstList.traverseBottomUp(visitor);
accept(visitor);
}
public String toString(String tab) {
StringBuffer buffer=new StringBuffer();
buffer.append(tab);
buffer.append("ConstDecl(\n");
if(Type!=null)
buffer.append(Type.toString(" "+tab));
else
buffer.append(tab+" null");
buffer.append("\n");
if(ConstList!=null)
buffer.append(ConstList.toString(" "+tab));
else
buffer.append(tab+" null");
buffer.append("\n");
buffer.append(tab);
buffer.append(") [ConstDecl]");
return buffer.toString();
}
}