clang  14.0.0git
Functions
Parsing.cpp File Reference
#include "clang/Tooling/Transformer/Parsing.h"
#include "clang/AST/Expr.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/Basic/CharInfo.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Lex/Lexer.h"
#include "clang/Tooling/Transformer/RangeSelector.h"
#include "clang/Tooling/Transformer/SourceCode.h"
#include "llvm/ADT/None.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/Error.h"
#include <string>
#include <utility>
#include <vector>
Include dependency graph for Parsing.cpp:

Go to the source code of this file.

Functions

static const llvm::StringMap< RangeSelectorOp< std::string > > & getUnaryStringSelectors ()
 
static const llvm::StringMap< RangeSelectorOp< RangeSelector > > & getUnaryRangeSelectors ()
 
static const llvm::StringMap< RangeSelectorOp< std::string, std::string > > & getBinaryStringSelectors ()
 
static const llvm::StringMap< RangeSelectorOp< RangeSelector, RangeSelector > > & getBinaryRangeSelectors ()
 
template<typename Element >
llvm::Optional< Element > findOptional (const llvm::StringMap< Element > &Map, llvm::StringRef Key)
 
template<typename ResultType >
ParseProgress< ResultType > makeParseProgress (ParseState State, ResultType Result)
 
static llvm::Error makeParseError (const ParseState &S, std::string ErrorMsg)
 
static ParseState advance (ParseState S, size_t N)
 
static StringRef consumeWhitespace (StringRef S)
 
static ExpectedProgress< llvm::NoneType > parseChar (char c, ParseState State)
 
static ExpectedProgress< std::stringparseId (ParseState State)
 
static ExpectedProgress< std::stringparseStringId (ParseState State)
 
template<typename T >
ExpectedProgress< RangeSelectorparseSingle (ParseFunction< T > ParseElement, RangeSelectorOp< T > Op, ParseState State)
 
template<typename T >
ExpectedProgress< RangeSelectorparsePair (ParseFunction< T > ParseElement, RangeSelectorOp< T, T > Op, ParseState State)
 
static ExpectedProgress< RangeSelectorparseRangeSelectorImpl (ParseState State)
 

Function Documentation

◆ advance()

static ParseState advance ( ParseState  S,
size_t  N 
)
static

◆ consumeWhitespace()

static StringRef consumeWhitespace ( StringRef  S)
static

◆ findOptional()

template<typename Element >
llvm::Optional<Element> findOptional ( const llvm::StringMap< Element > &  Map,
llvm::StringRef  Key 
)

Definition at line 124 of file Parsing.cpp.

Referenced by parseRangeSelectorImpl().

◆ getBinaryRangeSelectors()

static const llvm::StringMap<RangeSelectorOp<RangeSelector, RangeSelector> >& getBinaryRangeSelectors ( )
static

Definition at line 117 of file Parsing.cpp.

References clang::transformer::between(), and clang::transformer::enclose().

Referenced by parseRangeSelectorImpl().

◆ getBinaryStringSelectors()

static const llvm::StringMap<RangeSelectorOp<std::string, std::string> >& getBinaryStringSelectors ( )
static

Definition at line 110 of file Parsing.cpp.

References clang::transformer::encloseNodes().

Referenced by parseRangeSelectorImpl().

◆ getUnaryRangeSelectors()

static const llvm::StringMap<RangeSelectorOp<RangeSelector> >& getUnaryRangeSelectors ( )
static

◆ getUnaryStringSelectors()

static const llvm::StringMap<RangeSelectorOp<std::string> >& getUnaryStringSelectors ( )
static

◆ makeParseError()

static llvm::Error makeParseError ( const ParseState &  S,
std::string  ErrorMsg 
)
static

◆ makeParseProgress()

template<typename ResultType >
ParseProgress<ResultType> makeParseProgress ( ParseState  State,
ResultType  Result 
)

Definition at line 133 of file Parsing.cpp.

References State.

Referenced by parseChar(), parseId(), parsePair(), parseSingle(), and parseStringId().

◆ parseChar()

static ExpectedProgress<llvm::NoneType> parseChar ( char  c,
ParseState  State 
)
static

Definition at line 156 of file Parsing.cpp.

References advance(), c, consumeWhitespace(), makeParseError(), makeParseProgress(), and State.

Referenced by parsePair(), and parseSingle().

◆ parseId()

static ExpectedProgress<std::string> parseId ( ParseState  State)
static

◆ parsePair()

template<typename T >
ExpectedProgress<RangeSelector> parsePair ( ParseFunction< T >  ParseElement,
RangeSelectorOp< T, T >  Op,
ParseState  State 
)

Definition at line 216 of file Parsing.cpp.

References makeParseProgress(), P, parseChar(), and State.

Referenced by parseRangeSelectorImpl().

◆ parseRangeSelectorImpl()

static ExpectedProgress<RangeSelector> parseRangeSelectorImpl ( ParseState  State)
static

◆ parseSingle()

template<typename T >
ExpectedProgress<RangeSelector> parseSingle ( ParseFunction< T >  ParseElement,
RangeSelectorOp< T >  Op,
ParseState  State 
)

Definition at line 195 of file Parsing.cpp.

References makeParseProgress(), P, parseChar(), and State.

Referenced by parseRangeSelectorImpl().

◆ parseStringId()

static ExpectedProgress<std::string> parseStringId ( ParseState  State)
static

Definition at line 176 of file Parsing.cpp.

References advance(), c, consumeWhitespace(), Id, makeParseError(), makeParseProgress(), and State.

Referenced by parseRangeSelectorImpl().