clang 20.0.0git
Public Member Functions | List of all members
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:
Inheritance graph
[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

Definition at line 439 of file RAIIObjectsForParser.h.

References P.

Member Function Documentation

◆ consumeClose()

bool clang::BalancedDelimiterTracker::consumeClose ( )
inline

Definition at line 481 of file RAIIObjectsForParser.h.

References clang::FixItHint::CreateRemoval(), and P.

Referenced by clang::Parser::ParseOpenMPVarList(), and skipToEnd().

◆ consumeOpen()

bool clang::BalancedDelimiterTracker::consumeOpen ( )
inline

Definition at line 466 of file RAIIObjectsForParser.h.

References P.

Referenced by clang::Parser::ParseOpenMPVarList().

◆ expectAndConsume()

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

◆ 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 ( )

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