void TreeParser::matchNot(RefAST t, int ttype) { //ANTLR_USE_NAMESPACE(std)cout << "match(" << ttype << "); cursor is " << t.toString() << ANTLR_USE_NAMESPACE(std)endl; if ( !t || t==ASTNULL || t->getType()==ttype ) { throw MismatchedTokenException(); } }
void CommonAST::initialize(RefAST t) { setType(t->getType()); setText(t->getText()); }
void TreeParser::matchNot(RefAST t, int ttype) { if ( !t || t == ASTNULL || t->getType() == ttype ) throw MismatchedTokenException( getTokenNames(), getNumTokens(), t, ttype, true ); }
/** Make sure current lookahead symbol matches the given set * Throw an exception upon mismatch, which is caught by either the * error handler or by the syntactic predicate. */ void TreeParser::match(RefAST t, const BitSet& b) { if ( !t || t==ASTNULL || !b.member(t->getType()) ) throw MismatchedTokenException( getTokenNames(), getNumTokens(), t, b, false ); }
virtual void match(RefAST t, int ttype) { if (!t || t == ASTNULL || t->getType() != ttype ) throw MismatchedTokenException( getTokenNames(), getNumTokens(), t, ttype, false ); }
/**Make sure current lookahead symbol matches the given set * Throw an exception upon mismatch, which is caught by either the * error handler or by the syntactic predicate. */ void TreeParser::match(RefAST t, const BitSet& b) { if ( !t || t==ASTNULL || !b.member(t->getType()) ) { throw MismatchedTokenException(); } }
void TreeParser::match(RefAST t, int ttype) { if (!t || t==ASTNULL || t->getType()!=ttype) throw MismatchedTokenException(); }