Home | History | Annotate | Download | only in runtime

Lines Matching refs:state

10  *  @param {org.antlr.runtime.RecognizerSharedState} [state] state object with
13 org.antlr.runtime.BaseRecognizer = function(state) {
14 /** State of a lexer, parser, or tree parser are collected into a state
15 * object so the state can be shared. This sharing is needed to
17 * and other state variables. It's a kind of explicit multiple
18 * inheritance via delegation of methods and shared state.
21 this.state = state || new org.antlr.runtime.RecognizerSharedState();
69 /** Reset the parser's state. Subclasses must rewinds the input stream */
74 if (!this.state) {
75 return; // no shared state work to do
77 this.state._fsp = -1;
78 this.state.errorRecovery = false;
79 this.state.lastErrorIndex = -1;
80 this.state.failed = false;
81 this.state.syntaxErrors = 0;
83 this.state.backtracking = 0;
85 if (this.state.ruleMemo) {
86 for (i=0, len=this.state.ruleMemo.length; i<len; i++) {
87 this.state.ruleMemo[i] = null;
113 this.state.errorRecovery = false;
114 this.state.failed = false;
117 if ( this.state.backtracking>0 ) {
118 this.state.failed = true;
130 this.state.errorRecovery = false;
131 this.state.failed = false;
164 if ( this.state._fsp>=0 ) { // remove EOR if we're not the start symbol
215 * <p>If you override, make sure to update this.state.syntaxErrors if you
222 if ( this.state.errorRecovery ) {
225 this.state.syntaxErrors++;
226 this.state.errorRecovery = true;
360 return this.state.syntaxErrors;
396 if ( this.state.lastErrorIndex==input.index() ) {
403 this.state.lastErrorIndex = input.index();
590 var top = this.state._fsp,
595 localFollowSet = this.state.following[i];
763 if ( (this.state._fsp +1)>=this.state.following.length ) {
766 for (i=this.state.following.length-1; i>=0; i--) {
767 f[i] = this.state.following[i];
769 this.state.following = f;
771 this.state._fsp++;
772 this.state.following[this.state._fsp] = fset;
792 return this.state.backtracking;
843 if ( !this.state.ruleMemo[ruleIndex] ) {
844 this.state.ruleMemo[ruleIndex] = {};
847 this.state.ruleMemo[ruleIndex][ruleStartIndex];
873 this.state.failed=true;
891 var stopTokenIndex = this.state.failed ?
893 if ( !org.antlr.lang.isValue(this.state.ruleMemo) ) {
896 if ( ruleIndex >= this.state.ruleMemo.length ) {
897 throw new Error("!!!!!!!!! memo size is "+this.state.ruleMemo.length+", but rule index is "+ruleIndex);
899 if ( org.antlr.lang.isValue(this.state.ruleMemo[ruleIndex]) ) {
900 this.state.ruleMemo[ruleIndex][ruleStartIndex] = stopTokenIndex;
910 for (i = 0; this.state.ruleMemo && i < this.state.ruleMemo.length; i++) {
911 var ruleMap = this.state.ruleMemo[i];
929 if ( this.state.failed ) {
932 if ( this.state.backtracking>0 ) {
933 this.emitErrorMessage(" backtracking="+this.state.backtracking);
947 if ( this.state.failed ) {
948 this.emitErrorMessage(" failed="+this.state.failed);
950 if ( this.state.backtracking>0 ) {
951 this.emitErrorMessage(" backtracking="+this.state.backtracking);