clang 22.0.0git
clang::BalancedDelimiterTracker Class Reference

RAII class that helps handle the parsing of an open/close delimiter pair, such as braces { ... } or parentheses ( ... ). More...

#include "clang/Parse/RAIIObjectsForParser.h"

Inheritance diagram for clang::BalancedDelimiterTracker:
[legend]

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 ()
Public Member Functions inherited from clang::GreaterThanIsOperatorScope
 GreaterThanIsOperatorScope (bool &GTIO, bool Val)
 ~GreaterThanIsOperatorScope ()

Detailed Description

RAII class that helps handle the parsing of an open/close delimiter pair, such as braces { ... } or parentheses ( ... ).

Definition at line 420 of file RAIIObjectsForParser.h.

Constructor & Destructor Documentation

◆ BalancedDelimiterTracker()

clang::BalancedDelimiterTracker::BalancedDelimiterTracker ( Parser & p,
tok::TokenKind k,
tok::TokenKind FinalToken = tok::semi )
inline

Member Function Documentation

◆ consumeClose()

bool clang::BalancedDelimiterTracker::consumeClose ( )
inline

◆ consumeOpen()

bool clang::BalancedDelimiterTracker::consumeOpen ( )
inline

◆ expectAndConsume()

bool BalancedDelimiterTracker::expectAndConsume ( unsigned DiagID = diag::err_expected,
const char * Msg = "",
tok::TokenKind SkipToTok = tok::unknown )

Definition at line 2642 of file Parser.cpp.

References clang::Parser::StopAtSemi.

◆ getCloseLocation()

SourceLocation clang::BalancedDelimiterTracker::getCloseLocation ( ) const
inline

Definition at line 463 of file RAIIObjectsForParser.h.

◆ getOpenLocation()

SourceLocation clang::BalancedDelimiterTracker::getOpenLocation ( ) const
inline

Definition at line 462 of file RAIIObjectsForParser.h.

◆ getRange()

SourceRange clang::BalancedDelimiterTracker::getRange ( ) const
inline

Definition at line 464 of file RAIIObjectsForParser.h.

◆ skipToEnd()

void BalancedDelimiterTracker::skipToEnd ( )

Definition at line 2678 of file Parser.cpp.

References consumeClose(), and clang::Parser::StopBeforeMatch.


The documentation for this class was generated from the following files: