Example #1
0
 public virtual void SetTarget(int symbol, DFAState target)
 {
     lock (this)
     {
         if (edges == null)
         {
             edges = new SingletonEdgeMap <DFAState>(minSymbol, maxSymbol);
         }
         edges = edges.Put(symbol, target);
     }
 }
Example #2
0
 public virtual void SetContextSensitive(ATN atn)
 {
     lock (this)
     {
         System.Diagnostics.Debug.Assert(!configs.IsOutermostConfigSet);
         if (IsContextSensitive)
         {
             return;
         }
         contextSymbols = new BitSet();
         contextEdges   = new SingletonEdgeMap <DFAState>(-1, atn.states.Count - 1);
     }
 }
Example #3
0
 public virtual void SetContextTarget(int invokingState, DFAState target)
 {
     lock (this)
     {
         if (!IsContextSensitive)
         {
             throw new InvalidOperationException("The state is not context sensitive.");
         }
         if (invokingState == PredictionContext.EmptyFullStateKey)
         {
             invokingState = -1;
         }
         contextEdges = contextEdges.Put(invokingState, target);
     }
 }
Example #4
0
 public DFAState(EmptyEdgeMap <DFAState> emptyEdges, EmptyEdgeMap <DFAState> emptyContextEdges, ATNConfigSet configs)
 {
     this.configs      = configs;
     this.edges        = emptyEdges;
     this.contextEdges = emptyContextEdges;
 }
Example #5
0
 public virtual void SetTarget(int symbol, DFAState target)
 {
     edges = edges.Put(symbol, target);
 }
Example #6
0
 public DFAState([NotNull] EmptyEdgeMap <DFAState> emptyEdges, [NotNull] EmptyEdgeMap <DFAState> emptyContextEdges, [NotNull] ATNConfigSet configs)
 {
     this.configs      = configs;
     this.edges        = emptyEdges;
     this.contextEdges = emptyContextEdges;
 }