Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
set.path = ruleStack.slice();
followSets.push(set);
return;
}
for (let transition of s.getTransitions()) {
if (transition.serializationType == TransitionType.RULE) {
let ruleTransition: RuleTransition = transition as RuleTransition;
if (ruleStack.indexOf(ruleTransition.target.ruleIndex) != -1)
continue;
ruleStack.push(ruleTransition.target.ruleIndex);
this.collectFollowSets(transition.target, stopState, followSets, seen, ruleStack);
ruleStack.pop();
} else if (transition.serializationType == TransitionType.PREDICATE) {
if (this.checkPredicate(transition as PredicateTransition))
this.collectFollowSets(transition.target, stopState, followSets, seen, ruleStack);
} else if (transition.isEpsilon) {
this.collectFollowSets(transition.target, stopState, followSets, seen, ruleStack);
} else if (transition.serializationType == TransitionType.WILDCARD) {
let set = new FollowSetWithPath();
set.intervals = IntervalSet.of(Token.MIN_USER_TOKEN_TYPE, this.atn.maxTokenType);
set.path = ruleStack.slice();
followSets.push(set);
} else {
let label = transition.label;
if (label && label.size > 0) {
if (transition.serializationType == TransitionType.NOT_SET) {
label = label.complement(IntervalSet.of(Token.MIN_USER_TOKEN_TYPE, this.atn.maxTokenType));
}
let set = new FollowSetWithPath();