1 module antlr.v4.runtime.atn.PrecedencePredicateTransition;
2 
3 import std.conv;
4 import antlr.v4.runtime.atn.AbstractPredicateTransition;
5 import antlr.v4.runtime.atn.ATNState;
6 import antlr.v4.runtime.atn.TransitionStates;
7 import antlr.v4.runtime.atn.SemanticContext;
8 
9 /**
10  * TODO add class description
11  */
12 class PrecedencePredicateTransition : AbstractPredicateTransition
13 {
14 
15     /**
16      * @uml
17      * @final
18      */
19     public int precedence;
20 
21     public this(ATNState target, int precedence)
22     {
23         super(target);
24         this.precedence = precedence;
25     }
26 
27     /**
28      * @uml
29      * @override
30      */
31     public override int getSerializationType()
32     {
33         return TransitionStates.PRECEDENCE;
34     }
35 
36     /**
37      * @uml
38      * @override
39      */
40     public override bool isEpsilon()
41     {
42         return true;
43     }
44 
45     /**
46      * @uml
47      * @override
48      */
49     public override bool matches(int symbol, int minVocabSymbol, int maxVocabSymbol)
50     {
51         return false;
52     }
53 
54     public SemanticContext.PrecedencePredicate getPredicate()
55     {
56         auto sc = new SemanticContext;
57         return sc..new PrecedencePredicate(precedence);
58     }
59 
60     /**
61      * @uml
62      * @override
63      */
64     public override string toString()
65     {
66         return to!string(precedence) ~ " >= _p";
67     }
68 
69 }