-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCompilerFlagNode.java
More file actions
63 lines (56 loc) · 1.89 KB
/
CompilerFlagNode.java
File metadata and controls
63 lines (56 loc) · 1.89 KB
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
package org.perlonjava.astnode;
import org.perlonjava.astvisitor.Visitor;
/**
* The CompilerFlagNode class represents a node in the AST for handling
* compiler flags such as warnings, features, and strict options.
*/
public class CompilerFlagNode extends AbstractNode {
private final java.util.BitSet warningFlags;
private final int featureFlags;
private final int strictOptions;
/**
* Constructs a new CompilerFlagNode with the specified flag states.
*
* @param warningFlags the bitmask representing the state of warning flags
* @param featureFlags the bitmask representing the state of feature flags
* @param strictOptions the bitmask representing the state of strict options
* @param tokenIndex the index of the token in the source code
*/
public CompilerFlagNode(java.util.BitSet warningFlags, int featureFlags, int strictOptions, int tokenIndex) {
this.warningFlags = (java.util.BitSet) warningFlags.clone();
this.featureFlags = featureFlags;
this.strictOptions = strictOptions;
this.tokenIndex = tokenIndex;
}
/**
* Returns the bitmask representing the state of warning flags.
*
* @return the warning flags bitmask
*/
public java.util.BitSet getWarningFlags() {
return warningFlags;
}
/**
* Returns the bitmask representing the state of feature flags.
*
* @return the feature flags bitmask
*/
public int getFeatureFlags() {
return featureFlags;
}
/**
* Returns the bitmask representing the state of strict options.
*
* @return the strict options bitmask
*/
public int getStrictOptions() {
return strictOptions;
}
/**
* @param visitor the visitor that will perform the operation on the node
*/
@Override
public void accept(Visitor visitor) {
visitor.visit(this);
}
}