-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Expand file tree
/
Copy pathProgram.java
More file actions
39 lines (31 loc) · 902 Bytes
/
Program.java
File metadata and controls
39 lines (31 loc) · 902 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
34
35
36
37
38
39
package com.semmle.js.ast;
import com.semmle.ts.ast.INodeWithSymbol;
import java.util.List;
/** A top-level program entity forming the root of an AST. */
public class Program extends Node implements IStatementContainer, INodeWithSymbol {
private final List<Statement> body;
private final String sourceType;
private int symbolId = -1;
public Program(SourceLocation loc, List<Statement> body, String sourceType) {
super("Program", loc);
this.body = body;
this.sourceType = sourceType;
}
@Override
public <Q, A> A accept(Visitor<Q, A> v, Q q) {
return v.visit(this, q);
}
/** The statements in this program. */
public List<Statement> getBody() {
return body;
}
public String getSourceType() {
return sourceType;
}
public int getSymbol() {
return this.symbolId;
}
public void setSymbol(int symbolId) {
this.symbolId = symbolId;
}
}