Lines Matching defs:is
29 // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
57 static ANTLR3_BOOLEAN mismatchIsUnwantedToken (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM is, ANTLR3_UINT32 ttype);
58 static ANTLR3_BOOLEAN mismatchIsMissingToken (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM is, pANTLR3_BITSET_LIST follow);
130 // free it when the base recognizer is freed.
260 /* Now update it to indicate this is a Mismatched token exception
277 pANTLR3_INT_STREAM is;
284 is = NULL;
295 is = ins->istream;
303 is = parser->tstream->istream;
311 is = tns->istream;
333 switch (is->type & ANTLR3_INPUT_MASK)
337 ex->c = is->_LA (is, 1); /* Current input character */
340 ex->index = is->index (is);
396 ex->input = is;
399 recognizer->state->error = ANTLR3_TRUE; /* Exception is outstanding */
420 pANTLR3_INT_STREAM is;
429 is = parser->tstream->istream;
437 is = tparser->ctnstream->tnstream->istream;
451 matchedSymbol = recognizer->getCurrentInputSymbol(recognizer, is);
453 if (is->_LA(is, 1) == ttype)
457 isis); // Consume that token from the stream
468 // Backtracking is going on
474 // We did not find the expected token and there is no backtracking
482 /// Consumes the next token, whatever it is, and resets the recognizer state
483 /// so that it is not in error.
493 pANTLR3_INT_STREAM is;
501 is = parser->tstream->istream;
509 is = tparser->ctnstream->tnstream->istream;
522 is->consume(is);
529 mismatchIsUnwantedToken(pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM is, ANTLR3_UINT32 ttype)
533 nextt = is->_LA(is, 2);
541 return ANTLR3_TRUE; // This token is unknown, but the next one is the one we wanted
545 return ANTLR3_FALSE; // Neither this token, nor the one following is the one we wanted
552 mismatchIsMissingToken(pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM is, pANTLR3_BITSET_LIST follow)
560 // There is no information about the tokens that can follow the last one
561 // hence we must say that the current one we found is not a member of the
601 /// if current token is consistent with what could come after set
602 /// then we know we're missing a token; error recovery is free to
606 /// in follow set to indicate that the fall of the start symbol is
609 if ( followClone->isMember(followClone, is->_LA(is, 1))
646 pANTLR3_INT_STREAM is;
659 is = parser->tstream->istream;
671 if (mismatchIsUnwantedToken(recognizer, is, ttype))
677 // Now update it to indicate this is an unwanted token exception
685 if (mismatchIsMissingToken(recognizer, is, follow))
691 // Now update it to indicate this is an unwanted token exception
699 // Just a mismatched token is all we can dtermine
707 /// This method sets errorRecovery to indicate the parser is recovering
723 // Invoke the debugger event if there is a debugger listening to us
786 /// Documentation below is from the Java implementation.
797 /// When you find a "no viable alt exception", the input is not
799 /// thing to do is to consume tokens until you see something that
816 /// that rule is pushed on a stack. Here are the various "local"
823 /// Upon erroneous input "[]", the call chain is
827 /// and, hence, the follow context stack is:
834 /// Notice that ')' is not included, because b would have to have
845 /// In this case, for input "[]", LA(1) is in this set so we would
849 /// exception (since LA(1) is not in the viable following token
860 /// ANTLR's error recovery mechanism is based upon original ideas:
885 /// Documentation below is from the Java runtime.
887 /// This is the set of token types that can follow a specific rule
895 /// where x in T* and alpha, beta in V*; T is set of terminals and
896 /// V is the set of terminals and non terminals. In other words,
897 /// FOLLOW(r) is the set of all tokens that can possibly follow
915 /// For input input "i=(3);", here is the derivation:
933 /// token mismatch. Upon token mismatch, if LA(1) is member of
934 /// the viable next token set, then you know there is most likely
1002 /// of the error display routines into spearate units. However, ther is little advantage
1012 pANTLR3_INT_STREAM is;
1025 // See if there is a 'filename' we can use
1053 // How we determine the next piece is dependent on which thing raised the
1064 is = parser->tstream->istream;
1088 is = tparser->ctnstream->tnstream->istream;
1120 // is to produce a perfect (in traversal terms) syntactically correct tree, so errors
1122 // in whatever way is appropriate.
1132 // is just something that should not be there and throw this exception.
1178 // in the input that was not predicted. This is the basic exception type
1188 // We were expecting to see one thing and got another. This is the
1250 // However many tokens we could have dealt with here, it is usually
1257 // TODO: This doesn;t look right - should be asking if the bit is set!!
1295 // Here you have the token that was in error which if this is
1303 // Here is where you do it though :-).
1315 /// Recover from an error found on the input stream. Mostly this is
1327 pANTLR3_INT_STREAM is;
1335 is = parser->tstream->istream;
1343 is = tparser->ctnstream->tnstream->istream;
1357 if (recognizer->state->lastErrorIndex == is->index(is))
1360 // where LT(1) is in the recovery token set so nothing is
1362 // an infinite loop; this is a failsafe.
1364 is->consume(is);
1369 recognizer->state->lastErrorIndex = is->index(is);
1402 /// LA(1) is not what we are looking for. If LA(2) has the right token,
1403 /// however, then assume LA(1) is some extra spurious token. Delete it
1409 /// If current token is consistent with what could come after
1410 /// ttype then it is ok to "insert" the missing token, else throw
1411 /// exception For example, Input "i=(3;" is clearly missing the
1424 /// is in the set of tokens that can follow the ')' token
1427 /// The exception that was passed in, in the java implementation is
1429 /// error flag and rules cascade back when this is set.
1436 pANTLR3_INT_STREAM is;
1447 is = parser->tstream->istream;
1455 is = tparser->ctnstream->tnstream->istream;
1475 // is what we are looking for then we remove the one we have discovered
1479 if ( recognizer->mismatchIsUnwantedToken(recognizer, is, ttype) == ANTLR3_TRUE)
1494 is->consume(is);
1510 matchedSymbol = recognizer->getCurrentInputSymbol(recognizer, is);
1515 is->consume(is);
1517 recognizer->state->error = ANTLR3_FALSE; // Exception is not outstanding any more
1526 if (mismatchIsMissingToken(recognizer, is, follow))
1530 matchedSymbol = recognizer->getMissingSymbol(recognizer, is, recognizer->state->exception, ttype, follow);
1541 recognizer->state->error = ANTLR3_FALSE; // Exception is not outstanding any more
1559 pANTLR3_INT_STREAM is;
1568 is = parser->tstream->istream;
1576 is = tparser->ctnstream->tnstream->istream;
1588 if (recognizer->mismatchIsMissingToken(recognizer, is, follow) == ANTLR3_TRUE)
1592 matchedSymbol = recognizer->getMissingSymbol(recognizer, is, recognizer->state->exception, ANTLR3_TOKEN_INVALID, follow);
1601 recognizer->state->error = ANTLR3_FALSE; // Exception is not outstanding any more
1613 /// This code is factored out from mismatched token and mismatched set
1625 pANTLR3_INT_STREAM is;
1633 is = parser->tstream->istream;
1641 is = tparser->ctnstream->tnstream->istream;
1657 /* The follow set is NULL, which means we don't know what can come
1685 * is consistent, then we can "insert" that token by not throwing
1688 if ( follow->isMember(follow, is->_LA(is, 1)) == ANTLR3_TRUE)
1707 /* We could not find anything viable to do, so this is going to
1721 pANTLR3_INT_STREAM is;
1729 is = parser->tstream->istream;
1737 is = tparser->ctnstream->tnstream->istream;
1751 ttype = is->_LA(is, 1);
1757 is->consume(is);
1758 ttype = is->_LA(is, 1);
1771 pANTLR3_INT_STREAM is;
1779 is = parser->tstream->istream;
1787 is = tparser->ctnstream->tnstream->istream;
1801 ttype = is->_LA(is, 1);
1807 is->consume(is);
1808 ttype = is->_LA(is, 1);
1872 * bits required to represent the largest possible stop index in the input, which is the
1873 * last character. An int stream is free to return the largest 64 bit offset if it has
1877 ruleList = antlr3IntTrieNew(63); /* Depth is theoretically 64 bits, but probably not ;-) */
1891 /* See if there is a stop index associated with the supplied start index.
1924 pANTLR3_INT_STREAM is;
1933 is = parser->tstream->istream;
1942 is = tparser->ctnstream->tnstream->istream;
1951 is = lexer->input->istream;
1964 stopIndex = recognizer->getRuleMemoization(recognizer, ruleIndex, is->index(is));
1977 is->seek(is, stopIndex+1);
1999 pANTLR3_INT_STREAM is;
2007 is = parser->tstream->istream;
2015 is = tparser->ctnstream->tnstream->istream;
2024 is = lexer->input->istream;
2035 stopIndex = recognizer->state->failed == ANTLR3_TRUE ? MEMO_RULE_FAILED : is->index(is) - 1;
2045 * return code as we don't care if it is there already.
2060 pANTLR3_INT_STREAM is;
2068 is = parser->tstream->istream;
2076 is = tparser->ctnstream->tnstream->istream;
2091 start = is->mark(is);
2100 is->rewind(is, start);
2141 recognizer->state->ruleMemo = antlr3IntTrieNew(15); /* 16 bit depth is enough for 32768 rules! */
2152 // Default implementation is for parser and assumes a token stream as supplied by the runtime.
2153 // You MAY need override this function if the standard TOKEN_STREAM is not what you are using.
2161 // Default implementation is for parser and assumes a token stream as supplied by the runtime.
2162 // You MAY need override this function if the standard COMMON_TOKEN_STREAM is not what you are using.