本文整理汇总了C++中BitSet::member方法的典型用法代码示例。如果您正苦于以下问题:C++ BitSet::member方法的具体用法?C++ BitSet::member怎么用?C++ BitSet::member使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BitSet
的用法示例。
在下文中一共展示了BitSet::member方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: match
/**Make sure current lookahead symbol matches the given set
* Throw an exception upon mismatch, which is catch by either the
* error handler or by the syntactic predicate.
*/
void Parser::match(const BitSet& b)
{
if ( DEBUG_PARSER )
std::cout << "enter match(" << "bitset" /*b.toString()*/
<< ") with LA(1)=" << LA(1) << std::endl;
if ( !b.member(LA(1)) ) {
if ( DEBUG_PARSER )
std::cout << "token mismatch: " << LA(1) << " not member of "
<< "bitset" /*b.toString()*/ << std::endl;
throw MismatchedTokenException(tokenNames, LT(1), b, false);
} else {
// mark token as consumed -- fetch next token deferred until LA/LT
consume();
}
}
示例2: match
/**Make sure current lookahead symbol matches the given set
* Throw an exception upon mismatch, which is catch by either the
* error handler or by the syntactic predicate.
*/
void Parser::match(const BitSet& b)
{
if ( DEBUG_PARSER )
{
traceIndent();
ANTLR_USE_NAMESPACE(std)cout << "enter match(" << "bitset" /*b.toString()*/
<< ") with LA(1)=" << LA(1) << ANTLR_USE_NAMESPACE(std)endl;
}
if ( !b.member(LA(1)) ) {
if ( DEBUG_PARSER )
{
traceIndent();
ANTLR_USE_NAMESPACE(std)cout << "token mismatch: " << LA(1) << " not member of "
<< "bitset" /*b.toString()*/ << ANTLR_USE_NAMESPACE(std)endl;
}
throw MismatchedTokenException(getTokenNames(), getNumTokens(), LT(1), b, false, getFilename());
} else {
// mark token as consumed -- fetch next token deferred until LA/LT
consume();
}
}
示例3: consumeUntil
/** Consume tokens until one matches the given token set */
void Parser::consumeUntil(const BitSet& set)
{
while (LA(1) != Token::EOF_TYPE && !set.member(LA(1)))
consume();
}
示例4: match
/** 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 );
}
示例5: match
/**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();
}
}