antlr4ng
Version:
Alternative JavaScript/TypeScript runtime for ANTLR4
74 lines (71 loc) • 1.66 kB
JavaScript
var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
// src/atn/Transition.ts
var Transition = class {
static {
__name(this, "Transition");
}
static INVALID = 0;
static EPSILON = 1;
static RANGE = 2;
static RULE = 3;
static PREDICATE = 4;
// e.g., {isType(input.LT(1))}
static ATOM = 5;
static ACTION = 6;
static SET = 7;
// ~(A|B) or ~atom, wildcard, which convert to next
static NOT_SET = 8;
static WILDCARD = 9;
static PRECEDENCE = 10;
/** The target of this transition. */
target;
constructor(target) {
this.target = target;
}
/**
* Determines if the transition is an "epsilon" transition.
*
* The default implementation returns `false`.
*
* @returns `true` if traversing this transition in the ATN does not
* consume an input symbol; otherwise, `false` if traversing this
* transition consumes (matches) an input symbol.
*/
get isEpsilon() {
return false;
}
get label() {
return null;
}
toString() {
return "";
}
};
// src/atn/RuleTransition.ts
var RuleTransition = class extends Transition {
static {
__name(this, "RuleTransition");
}
ruleIndex;
precedence;
followState;
constructor(ruleStart, ruleIndex, precedence, followState) {
super(ruleStart);
this.ruleIndex = ruleIndex;
this.precedence = precedence;
this.followState = followState;
}
get isEpsilon() {
return true;
}
get transitionType() {
return Transition.RULE;
}
matches(_symbol, _minVocabSymbol, _maxVocabSymbol) {
return false;
}
};
export {
RuleTransition
};