-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathFactorTerm.java
58 lines (44 loc) · 1.34 KB
/
FactorTerm.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
// generated with ast extension for cup
// version 0.8
// 1/1/2023 19:22:28
package askov.schoolprojects.compilerconstruction.mjcompiler.ast;
public class FactorTerm extends Term {
private Factor Factor;
public FactorTerm (Factor Factor) {
this.Factor=Factor;
if(Factor!=null) Factor.setParent(this);
}
public Factor getFactor() {
return Factor;
}
public void setFactor(Factor Factor) {
this.Factor=Factor;
}
public void accept(Visitor visitor) {
visitor.visit(this);
}
public void childrenAccept(Visitor visitor) {
if(Factor!=null) Factor.accept(visitor);
}
public void traverseTopDown(Visitor visitor) {
accept(visitor);
if(Factor!=null) Factor.traverseTopDown(visitor);
}
public void traverseBottomUp(Visitor visitor) {
if(Factor!=null) Factor.traverseBottomUp(visitor);
accept(visitor);
}
public String toString(String tab) {
StringBuffer buffer=new StringBuffer();
buffer.append(tab);
buffer.append("FactorTerm(\n");
if(Factor!=null)
buffer.append(Factor.toString(" "+tab));
else
buffer.append(tab+" null");
buffer.append("\n");
buffer.append(tab);
buffer.append(") [FactorTerm]");
return buffer.toString();
}
}