Home | History | Annotate | Download | only in Antlr3.Runtime

Lines Matching refs:state

70          *  State of a lexer, parser, or tree parser are collected into a state
71 * object so the state can be shared. This sharing is needed to
73 * and other state variables. It's a kind of explicit multiple
74 * inheritance via delegation of methods and shared state.
77 protected internal RecognizerSharedState state;
84 public BaseRecognizer( RecognizerSharedState state )
86 if ( state == null )
88 state = new RecognizerSharedState();
90 this.state = state;
104 /** <summary>reset the parser's state; subclasses must rewinds the input stream</summary> */
108 if ( state == null )
110 return; // no shared state work to do
112 state._fsp = -1;
113 state.errorRecovery = false;
114 state.lastErrorIndex = -1;
115 state.failed = false;
116 state.syntaxErrors = 0;
118 state.backtracking = 0;
119 for ( int i = 0; state.ruleMemo != null && i < state.ruleMemo.Length; i++ )
121 state.ruleMemo[i] = null;
148 state.errorRecovery = false;
149 state.failed = false;
152 if ( state.backtracking > 0 )
154 state.failed = true;
164 state.errorRecovery = false;
165 state.failed = false;
187 if ( state._fsp >= 0 )
231 if ( state.errorRecovery )
236 state.syntaxErrors++; // don't count spurious
237 state.errorRecovery = true;
267 * for no viable alts, the decision description and state etc...
341 // "state "+nvae.stateNumber
385 return state.syntaxErrors;
446 if ( state.lastErrorIndex == input.Index )
454 state.lastErrorIndex = input.Index;
635 int top = state._fsp;
639 BitSet localFollowSet = (BitSet)state.following[i];
817 if ( ( state._fsp + 1 ) >= state.following.Length )
819 Array.Resize(ref state.following, state.following.Length * 2);
821 state.following[++state._fsp] = fset;
826 state._fsp--;
876 return state.backtracking;
880 state.backtracking = value;
889 return state.failed;
960 if ( state.ruleMemo[ruleIndex] == null )
962 state.ruleMemo[ruleIndex] = new Dictionary<int, int>();
966 if ( !state.ruleMemo[ruleIndex].TryGetValue( ruleStartIndex, out stopIndex ) )
995 state.failed = true;
999 //System.out.println("seen rule "+ruleIndex+" before; skipping ahead to @"+(stopIndex+1)+" failed="+state.failed);
1014 int stopTokenIndex = state.failed ? MemoRuleFailed : input.Index - 1;
1015 if ( state.ruleMemo == null )
1020 if ( ruleIndex >= state.ruleMemo.Length )
1023 TraceDestination.WriteLine("!!!!!!!!! memo size is " + state.ruleMemo.Length + ", but rule index is " + ruleIndex);
1025 if ( state.ruleMemo[ruleIndex] != null )
1027 state.ruleMemo[ruleIndex][ruleStartIndex] = stopTokenIndex;
1037 for ( int i = 0; state.ruleMemo != null && i < state.ruleMemo.Length; i++ )
1039 var ruleMap = state.ruleMemo[i];
1054 if (state.backtracking > 0)
1056 TraceDestination.Write(" backtracking=" + state.backtracking);
1067 if (state.backtracking > 0)
1069 TraceDestination.Write(" backtracking=" + state.backtracking);
1070 if (state.failed)