clang 20.0.0git
Public Member Functions | List of all members
clang::ParsingDeclarator Class Reference

A class for parsing a declarator. More...

#include "clang/Parse/RAIIObjectsForParser.h"

Inheritance diagram for clang::ParsingDeclarator:
Inheritance graph
[legend]

Public Member Functions

 ParsingDeclarator (Parser &P, const ParsingDeclSpec &DS, const ParsedAttributes &DeclarationAttrs, DeclaratorContext C)
 
const ParsingDeclSpecgetDeclSpec () const
 
ParsingDeclSpecgetMutableDeclSpec () const
 
void clear ()
 
void complete (Decl *D)
 
- Public Member Functions inherited from clang::Declarator
 Declarator (const DeclSpec &DS, const ParsedAttributesView &DeclarationAttrs, DeclaratorContext C)
 DS and DeclarationAttrs must outlive the Declarator.
 
 ~Declarator ()
 
const DeclSpecgetDeclSpec () const
 getDeclSpec - Return the declaration-specifier that this declarator was declared with.
 
DeclSpecgetMutableDeclSpec ()
 getMutableDeclSpec - Return a non-const version of the DeclSpec.
 
AttributePoolgetAttributePool () const
 
const CXXScopeSpecgetCXXScopeSpec () const
 getCXXScopeSpec - Return the C++ scope specifier (global scope or nested-name-specifier) that is part of the declarator-id.
 
CXXScopeSpecgetCXXScopeSpec ()
 
UnqualifiedIdgetName ()
 Retrieve the name specified by this declarator.
 
const DecompositionDeclaratorgetDecompositionDeclarator () const
 
DeclaratorContext getContext () const
 
bool isPrototypeContext () const
 
SourceRange getSourceRange () const LLVM_READONLY
 Get the source range that spans this declarator.
 
SourceLocation getBeginLoc () const LLVM_READONLY
 
SourceLocation getEndLoc () const LLVM_READONLY
 
void SetSourceRange (SourceRange R)
 
void SetRangeBegin (SourceLocation Loc)
 SetRangeBegin - Set the start of the source range to Loc, unless it's invalid.
 
void SetRangeEnd (SourceLocation Loc)
 SetRangeEnd - Set the end of the source range to Loc, unless it's invalid.
 
void ExtendWithDeclSpec (const DeclSpec &DS)
 ExtendWithDeclSpec - Extend the declarator source range to include the given declspec, unless its location is invalid.
 
void clear ()
 Reset the contents of this Declarator.
 
bool mayOmitIdentifier () const
 mayOmitIdentifier - Return true if the identifier is either optional or not allowed.
 
bool mayHaveIdentifier () const
 mayHaveIdentifier - Return true if the identifier is either optional or required.
 
bool mayHaveDecompositionDeclarator () const
 Return true if the context permits a C++17 decomposition declarator.
 
bool mayBeFollowedByCXXDirectInit () const
 mayBeFollowedByCXXDirectInit - Return true if the declarator can be followed by a C++ direct initializer, e.g.
 
bool isPastIdentifier () const
 isPastIdentifier - Return true if we have parsed beyond the point where the name would appear.
 
bool hasName () const
 hasName - Whether this declarator has a name, which might be an identifier (accessible via getIdentifier()) or some kind of special C++ name (constructor, destructor, etc.), or a structured binding (which is not exactly a name, but occupies the same position).
 
bool isDecompositionDeclarator () const
 Return whether this declarator is a decomposition declarator.
 
const IdentifierInfogetIdentifier () const
 
SourceLocation getIdentifierLoc () const
 
void SetIdentifier (const IdentifierInfo *Id, SourceLocation IdLoc)
 Set the name of this declarator to be the given identifier.
 
void setDecompositionBindings (SourceLocation LSquareLoc, MutableArrayRef< DecompositionDeclarator::Binding > Bindings, SourceLocation RSquareLoc)
 Set the decomposition bindings for this declarator.
 
void AddTypeInfo (const DeclaratorChunk &TI, ParsedAttributes &&attrs, SourceLocation EndLoc)
 AddTypeInfo - Add a chunk to this declarator.
 
void AddTypeInfo (const DeclaratorChunk &TI, AttributePool &OtherPool, SourceLocation EndLoc)
 AddTypeInfo - Add a chunk to this declarator.
 
void AddTypeInfo (const DeclaratorChunk &TI, SourceLocation EndLoc)
 AddTypeInfo - Add a chunk to this declarator.
 
void AddInnermostTypeInfo (const DeclaratorChunk &TI)
 Add a new innermost chunk to this declarator.
 
unsigned getNumTypeObjects () const
 Return the number of types applied to this declarator.
 
const DeclaratorChunkgetTypeObject (unsigned i) const
 Return the specified TypeInfo from this declarator.
 
DeclaratorChunkgetTypeObject (unsigned i)
 
type_object_range type_objects () const
 Returns the range of type objects, from the identifier outwards.
 
void DropFirstTypeObject ()
 
const DeclaratorChunkgetInnermostNonParenChunk () const
 Return the innermost (closest to the declarator) chunk of this declarator that is not a parens chunk, or null if there are no non-parens chunks.
 
const DeclaratorChunkgetOutermostNonParenChunk () const
 Return the outermost (furthest from the declarator) chunk of this declarator that is not a parens chunk, or null if there are no non-parens chunks.
 
bool isArrayOfUnknownBound () const
 isArrayOfUnknownBound - This method returns true if the declarator is a declarator for an array of unknown bound (looking through parentheses).
 
bool isFunctionDeclarator (unsigned &idx) const
 isFunctionDeclarator - This method returns true if the declarator is a function declarator (looking through parentheses).
 
bool isFunctionDeclarator () const
 isFunctionDeclarator - Once this declarator is fully parsed and formed, this method returns true if the identifier is a function declarator (looking through parentheses).
 
DeclaratorChunk::FunctionTypeInfogetFunctionTypeInfo ()
 getFunctionTypeInfo - Retrieves the function type info object (looking through parentheses).
 
const DeclaratorChunk::FunctionTypeInfogetFunctionTypeInfo () const
 getFunctionTypeInfo - Retrieves the function type info object (looking through parentheses).
 
bool isDeclarationOfFunction () const
 Determine whether the declaration that will be produced from this declaration will be a function.
 
bool isFunctionDeclarationContext () const
 Return true if this declaration appears in a context where a function declarator would be a function declaration.
 
bool isExpressionContext () const
 Determine whether this declaration appears in a context where an expression could appear.
 
bool isFunctionDeclaratorAFunctionDeclaration () const
 Return true if a function declarator at this position would be a function declaration.
 
bool hasTrailingReturnType () const
 Determine whether a trailing return type was written (at any level) within this declarator.
 
ParsedType getTrailingReturnType () const
 Get the trailing return type appearing (at any level) within this declarator.
 
void setTrailingRequiresClause (Expr *TRC)
 Sets a trailing requires clause for this declarator.
 
ExprgetTrailingRequiresClause ()
 Sets a trailing requires clause for this declarator.
 
bool hasTrailingRequiresClause () const
 Determine whether a trailing requires clause was written in this declarator.
 
void setTemplateParameterLists (ArrayRef< TemplateParameterList * > TPLs)
 Sets the template parameter lists that preceded the declarator.
 
ArrayRef< TemplateParameterList * > getTemplateParameterLists () const
 The template parameter lists that preceded the declarator.
 
void setInventedTemplateParameterList (TemplateParameterList *Invented)
 Sets the template parameter list generated from the explicit template parameters along with any invented template parameters from placeholder-typed parameters.
 
TemplateParameterListgetInventedTemplateParameterList () const
 The template parameter list generated from the explicit template parameters along with any invented template parameters from placeholder-typed parameters, if there were any such parameters.
 
void takeAttributes (ParsedAttributes &attrs)
 takeAttributes - Takes attributes from the given parsed-attributes set and add them to this declarator.
 
const ParsedAttributesgetAttributes () const
 
ParsedAttributesgetAttributes ()
 
const ParsedAttributesViewgetDeclarationAttributes () const
 
bool hasAttributes () const
 hasAttributes - do we contain any attributes?
 
void setAsmLabel (Expr *E)
 
ExprgetAsmLabel () const
 
void setExtension (bool Val=true)
 
bool getExtension () const
 
void setObjCIvar (bool Val=true)
 
bool isObjCIvar () const
 
void setObjCWeakProperty (bool Val=true)
 
bool isObjCWeakProperty () const
 
void setInvalidType (bool Val=true)
 
bool isInvalidType () const
 
void setGroupingParens (bool flag)
 
bool hasGroupingParens () const
 
bool isFirstDeclarator () const
 
SourceLocation getCommaLoc () const
 
void setCommaLoc (SourceLocation CL)
 
bool hasEllipsis () const
 
SourceLocation getEllipsisLoc () const
 
void setEllipsisLoc (SourceLocation EL)
 
bool hasPackIndexing () const
 
ExprgetPackIndexingExpr () const
 
void setPackIndexingExpr (Expr *PI)
 
void setFunctionDefinitionKind (FunctionDefinitionKind Val)
 
bool isFunctionDefinition () const
 
FunctionDefinitionKind getFunctionDefinitionKind () const
 
void setHasInitializer (bool Val=true)
 
bool hasInitializer () const
 
bool isFirstDeclarationOfMember ()
 Returns true if this declares a real member and not a friend.
 
bool isStaticMember ()
 Returns true if this declares a static member.
 
bool isExplicitObjectMemberFunction ()
 
bool isCtorOrDtor ()
 Returns true if this declares a constructor or a destructor.
 
void setRedeclaration (bool Val)
 
bool isRedeclaration () const
 

Additional Inherited Members

- Public Types inherited from clang::Declarator
typedef SmallVectorImpl< DeclaratorChunk >::const_iterator type_object_iterator
 
typedef llvm::iterator_range< type_object_iteratortype_object_range
 

Detailed Description

A class for parsing a declarator.

Definition at line 200 of file RAIIObjectsForParser.h.

Constructor & Destructor Documentation

◆ ParsingDeclarator()

clang::ParsingDeclarator::ParsingDeclarator ( Parser P,
const ParsingDeclSpec DS,
const ParsedAttributes DeclarationAttrs,
DeclaratorContext  C 
)
inline

Definition at line 204 of file RAIIObjectsForParser.h.

Member Function Documentation

◆ clear()

void clang::ParsingDeclarator::clear ( )
inline

◆ complete()

void clang::ParsingDeclarator::complete ( Decl D)
inline

Definition at line 223 of file RAIIObjectsForParser.h.

References clang::ParsingDeclRAIIObject::complete(), and D.

◆ getDeclSpec()

const ParsingDeclSpec & clang::ParsingDeclarator::getDeclSpec ( ) const
inline

Definition at line 210 of file RAIIObjectsForParser.h.

References clang::Declarator::getDeclSpec().

Referenced by getMutableDeclSpec().

◆ getMutableDeclSpec()

ParsingDeclSpec & clang::ParsingDeclarator::getMutableDeclSpec ( ) const
inline

Definition at line 214 of file RAIIObjectsForParser.h.

References getDeclSpec().


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