clang API Documentation
RAII class that helps handle the parsing of an open/close delimiter pair, such as braces { ... } or parentheses ( ... ). More...
#include <RAIIObjectsForParser.h>
Public Member Functions | |
| BalancedDelimiterTracker (Parser &p, tok::TokenKind k, tok::TokenKind FinalToken=tok::semi) | |
| SourceLocation | getOpenLocation () const |
| SourceLocation | getCloseLocation () const |
| SourceRange | getRange () const |
| bool | consumeOpen () |
| bool | expectAndConsume (unsigned DiagID=diag::err_expected, const char *Msg="", tok::TokenKind SkipToTok=tok::unknown) |
| bool | consumeClose () |
| void | skipToEnd () |
RAII class that helps handle the parsing of an open/close delimiter pair, such as braces { ... } or parentheses ( ... ).
Definition at line 359 of file RAIIObjectsForParser.h.
| clang::BalancedDelimiterTracker::BalancedDelimiterTracker | ( | Parser & | p, |
| tok::TokenKind | k, | ||
| tok::TokenKind | FinalToken = tok::semi |
||
| ) | [inline] |
Definition at line 380 of file RAIIObjectsForParser.h.
| bool clang::BalancedDelimiterTracker::consumeClose | ( | ) | [inline] |
Definition at line 422 of file RAIIObjectsForParser.h.
References clang::Token::is().
Referenced by skipToEnd().
| bool clang::BalancedDelimiterTracker::consumeOpen | ( | ) | [inline] |
Definition at line 407 of file RAIIObjectsForParser.h.
References clang::Parser::getLangOpts(), and clang::Token::is().
| bool BalancedDelimiterTracker::expectAndConsume | ( | unsigned | DiagID = diag::err_expected, |
| const char * | Msg = "", |
||
| tok::TokenKind | SkipToTok = tok::unknown |
||
| ) |
Definition at line 1926 of file Parse/Parser.cpp.
References clang::Parser::StopAtSemi.
| SourceLocation clang::BalancedDelimiterTracker::getCloseLocation | ( | ) | const [inline] |
Definition at line 404 of file RAIIObjectsForParser.h.
| SourceLocation clang::BalancedDelimiterTracker::getOpenLocation | ( | ) | const [inline] |
Definition at line 403 of file RAIIObjectsForParser.h.
| SourceRange clang::BalancedDelimiterTracker::getRange | ( | ) | const [inline] |
Definition at line 405 of file RAIIObjectsForParser.h.
| void BalancedDelimiterTracker::skipToEnd | ( | ) |
Definition at line 1959 of file Parse/Parser.cpp.
References consumeClose(), and clang::Parser::StopBeforeMatch.