-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIfStatNode.java
37 lines (29 loc) · 895 Bytes
/
IfStatNode.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
package nodes;
import Visitor.*;
import org.w3c.dom.Element;
public class IfStatNode implements StatNode, ISyntaxVisitable, ISemanticVisitable, ICVisitable {
public String name = null;
public ExprNode expr = null;
public BodyNode bn = null;
public BodyNode elsebody = null;
public IfStatNode(String name, ExprNode expr, BodyNode bn, BodyNode elsebody){
this.name=name;
this.expr=expr;
this.bn=bn;
this.elsebody=elsebody;
}
public IfStatNode(String name, ExprNode expr, BodyNode bn){
this.name=name;
this.expr=expr;
this.bn=bn;
this.elsebody=null;
}
@Override
public Element accept(ISyntaxVisitor v) {
return v.visit(this);
}
@Override
public void accept(ISemanticVisitor v) { v.visit(this);}
@Override
public void accept(ICVisitor v) { v.visit(this); }
}