forked from ragibson/miniJava-compiler
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIfStmt.java
More file actions
33 lines (28 loc) · 787 Bytes
/
IfStmt.java
File metadata and controls
33 lines (28 loc) · 787 Bytes
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
/**
* miniJava Abstract Syntax Tree classes
* @author prins
* @version COMP 520 (v2.2)
*/
package miniJava.AbstractSyntaxTrees;
import miniJava.SyntacticAnalyzer.SourcePosition;
public class IfStmt extends Statement
{
public IfStmt(Expression b, Statement t, Statement e, SourcePosition posn){
super(posn);
cond = b;
thenStmt = t;
elseStmt = e;
}
public IfStmt(Expression b, Statement t, SourcePosition posn){
super(posn);
cond = b;
thenStmt = t;
elseStmt = null;
}
public <A,R> R visit(Visitor<A,R> v, A o) {
return v.visitIfStmt(this, o);
}
public Expression cond;
public Statement thenStmt;
public Statement elseStmt;
}