public final class RuleSet extends RuleContainer
Input mode determines whether this ruleset is applied against an entire AST via a depth first iteration of its nodes, or against a filtered view of an AST which contains only those nodes which have been added to the view, based upon some previous test.
setInputMode(int)
,
Rule
Modifier and Type | Field and Description |
---|---|
private int |
depth
Maximum walk depth for ASTs to which this ruleset is applied
|
private boolean |
honorHidden
Honor hidden processing mode flag.
|
static int |
INPUT_TREE
Indicates this ruleset will iterate over an AST structure
|
static int |
INPUT_VIEW
Indicates this ruleset will iterate over a filtered list of ASTs
|
private int |
inputMode
Input mode (tree or view) associated with this ruleset
|
RULE_ASCENT, RULE_DESCENT, RULE_INIT, RULE_NEXT_CHILD, RULE_NONE, RULE_POST, RULE_WALK
MSG_DEBUG, MSG_NONE, MSG_STATUS, MSG_TRACE
Constructor and Description |
---|
RuleSet(RuleContainer parent)
Constructor which assigns enclosing scope.
|
Modifier and Type | Method and Description |
---|---|
int |
getDepth()
Get the maximum walk depth, where 0 indicates all levels should be
visited.
|
(package private) int |
getInputMode()
Gets the input mode currently associated with this ruleset.
|
boolean |
isHonorHidden()
Gets the flag that determines if the hidden status of an AST node
should be honored.
|
void |
setDepth(int depth)
Set the maximum walk depth, where 0 indicates all levels should be
visited.
|
void |
setHonorHidden(boolean hide)
Sets the flag that determines if the hidden status of an AST node
should be honored.
|
void |
setInputMode(int inputMode)
Set the input mode for use with this ruleset.
|
addRule, addRuleSet, apply, cleanup, getDebugLevel, getEnclosingScope, getFunction, getFunctionContainer, getWorker, hasType, include, isContainer, putFunction, registerVariable, registerVariableValue, registerWorker, registerWorker, ruleList, setDebugLevel
public static final int INPUT_TREE
public static final int INPUT_VIEW
private int inputMode
private int depth
private boolean honorHidden
public RuleSet(RuleContainer parent)
parent
- Rule container which provides enclosing scope to this ruleset.int getInputMode()
INPUT_TREE
or INPUT_VIEW
.setInputMode(int)
public void setInputMode(int inputMode)
CommonAstSupport
. This view
is passed along to the next ruleset in the pipeline and is used as
the basis for that ruleset's iteration if its input mode is set to
INPUT_VIEW
.inputMode
- INPUT_TREE
to apply this ruleset against an AST
directly; INPUT_VIEW
to apply this ruleset
against a filtered view of ASTs.public int getDepth()
public void setDepth(int depth)
depth
- Maximum walk depth.public boolean isHonorHidden()
true
if a node's hidden flag should be honored.public void setHonorHidden(boolean hide)
hide
- true
if a node's hidden flag should be honored.