antlr4-runtime
Version:
JavaScript runtime for ANTLR4
23 lines (19 loc) • 749 B
JavaScript
/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.
* Use is of this file is governed by the BSD 3-clause license that
* can be found in the LICENSE.txt file in the project root.
*/
import Transition from "./Transition.js";
import SetTransition from "./SetTransition.js";
export default class NotSetTransition extends SetTransition {
constructor(target, set) {
super(target, set);
this.serializationType = Transition.NOT_SET;
}
matches(symbol, minVocabSymbol, maxVocabSymbol) {
return symbol >= minVocabSymbol && symbol <= maxVocabSymbol &&
!super.matches(symbol, minVocabSymbol, maxVocabSymbol);
}
toString() {
return '~' + super.toString();
}
}