bitmark-grammar
Version:
50 lines (40 loc) • 1.25 kB
text/typescript
/*!
* Copyright 2016 The ANTLR Project. All rights reserved.
* Licensed under the BSD-3-Clause license. See LICENSE file in the project root for license information.
*/
// ConvertTo-TS run at 2016-10-04T11:26:35.0994191-07:00
import { AbstractPredicateTransition } from "./AbstractPredicateTransition";
import { ATNState } from "./ATNState";
import { NotNull, Override } from "../Decorators";
import { SemanticContext } from "./SemanticContext";
import { TransitionType } from "./TransitionType";
/**
*
* @author Sam Harwell
*/
export class PrecedencePredicateTransition extends AbstractPredicateTransition {
public precedence: number;
constructor( target: ATNState, precedence: number) {
super(target);
this.precedence = precedence;
}
get serializationType(): TransitionType {
return TransitionType.PRECEDENCE;
}
get isEpsilon(): boolean {
return true;
}
public matches(symbol: number, minVocabSymbol: number, maxVocabSymbol: number): boolean {
return false;
}
get predicate(): SemanticContext.PrecedencePredicate {
return new SemanticContext.PrecedencePredicate(this.precedence);
}
public toString(): string {
return this.precedence + " >= _p";
}
}