clang  6.0.0svn
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]
Collaboration diagram for clang::ParsingDeclarator:
Collaboration graph
[legend]

Public Member Functions

 ParsingDeclarator (Parser &P, const ParsingDeclSpec &DS, TheContext C)
 
const ParsingDeclSpecgetDeclSpec () const
 
ParsingDeclSpecgetMutableDeclSpec () const
 
void clear ()
 
void complete (Decl *D)
 
- Public Member Functions inherited from clang::Declarator
 Declarator (const DeclSpec &ds, TheContext C)
 
 ~Declarator ()
 
const DeclSpecgetDeclSpec () const
 getDeclSpec - Return the declaration-specifier that this declarator was declared with. More...
 
DeclSpecgetMutableDeclSpec ()
 getMutableDeclSpec - Return a non-const version of the DeclSpec. More...
 
AttributePoolgetAttributePool () const
 
const CXXScopeSpecgetCXXScopeSpec () const
 getCXXScopeSpec - Return the C++ scope specifier (global scope or nested-name-specifier) that is part of the declarator-id. More...
 
CXXScopeSpecgetCXXScopeSpec ()
 
UnqualifiedIdgetName ()
 Retrieve the name specified by this declarator. More...
 
const DecompositionDeclaratorgetDecompositionDeclarator () const
 
TheContext getContext () const
 
bool isPrototypeContext () const
 
SourceRange getSourceRange () const LLVM_READONLY
 Get the source range that spans this declarator. More...
 
SourceLocation getLocStart () const LLVM_READONLY
 
SourceLocation getLocEnd () 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. More...
 
void SetRangeEnd (SourceLocation Loc)
 SetRangeEnd - Set the end of the source range to Loc, unless it's invalid. More...
 
void ExtendWithDeclSpec (const DeclSpec &DS)
 ExtendWithDeclSpec - Extend the declarator source range to include the given declspec, unless its location is invalid. More...
 
void clear ()
 Reset the contents of this Declarator. More...
 
bool mayOmitIdentifier () const
 mayOmitIdentifier - Return true if the identifier is either optional or not allowed. More...
 
bool mayHaveIdentifier () const
 mayHaveIdentifier - Return true if the identifier is either optional or required. More...
 
bool mayHaveDecompositionDeclarator () const
 Return true if the context permits a C++17 decomposition declarator. More...
 
bool mayBeFollowedByCXXDirectInit () const
 mayBeFollowedByCXXDirectInit - Return true if the declarator can be followed by a C++ direct initializer, e.g. More...
 
bool isPastIdentifier () const
 isPastIdentifier - Return true if we have parsed beyond the point where the name would appear. More...
 
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). More...
 
bool isDecompositionDeclarator () const
 Return whether this declarator is a decomposition declarator. More...
 
IdentifierInfogetIdentifier () const
 
SourceLocation getIdentifierLoc () const
 
void SetIdentifier (IdentifierInfo *Id, SourceLocation IdLoc)
 Set the name of this declarator to be the given identifier. More...
 
void setDecompositionBindings (SourceLocation LSquareLoc, ArrayRef< DecompositionDeclarator::Binding > Bindings, SourceLocation RSquareLoc)
 Set the decomposition bindings for this declarator. More...
 
void AddTypeInfo (const DeclaratorChunk &TI, ParsedAttributes &attrs, SourceLocation EndLoc)
 AddTypeInfo - Add a chunk to this declarator. More...
 
void AddInnermostTypeInfo (const DeclaratorChunk &TI)
 Add a new innermost chunk to this declarator. More...
 
unsigned getNumTypeObjects () const
 Return the number of types applied to this declarator. More...
 
const DeclaratorChunkgetTypeObject (unsigned i) const
 Return the specified TypeInfo from this declarator. More...
 
DeclaratorChunkgetTypeObject (unsigned i)
 
type_object_range type_objects () const
 Returns the range of type objects, from the identifier outwards. More...
 
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. More...
 
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. More...
 
bool isArrayOfUnknownBound () const
 isArrayOfUnknownBound - This method returns true if the declarator is a declarator for an array of unknown bound (looking through parentheses). More...
 
bool isFunctionDeclarator (unsigned &idx) const
 isFunctionDeclarator - This method returns true if the declarator is a function declarator (looking through parentheses). More...
 
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). More...
 
DeclaratorChunk::FunctionTypeInfogetFunctionTypeInfo ()
 getFunctionTypeInfo - Retrieves the function type info object (looking through parentheses). More...
 
const DeclaratorChunk::FunctionTypeInfogetFunctionTypeInfo () const
 getFunctionTypeInfo - Retrieves the function type info object (looking through parentheses). More...
 
bool isDeclarationOfFunction () const
 Determine whether the declaration that will be produced from this declaration will be a function. More...
 
bool isFunctionDeclarationContext () const
 Return true if this declaration appears in a context where a function declarator would be a function declaration. More...
 
bool isExpressionContext () const
 Determine whether this declaration appears in a context where an expression could appear. More...
 
bool isFunctionDeclaratorAFunctionDeclaration () const
 Return true if a function declarator at this position would be a function declaration. More...
 
bool hasTrailingReturnType () const
 Determine whether a trailing return type was written (at any level) within this declarator. More...
 
void takeAttributes (ParsedAttributes &attrs, SourceLocation lastLoc)
 takeAttributes - Takes attributes from the given parsed-attributes set and add them to this declarator. More...
 
const AttributeListgetAttributes () const
 
AttributeListgetAttributes ()
 
AttributeList *& getAttrListRef ()
 
bool hasAttributes () const
 hasAttributes - do we contain any attributes? More...
 
void getCXX11AttributeRanges (SmallVectorImpl< SourceRange > &Ranges)
 Return a source range list of C++11 attributes associated with the declarator. More...
 
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)
 
void setFunctionDefinitionKind (FunctionDefinitionKind Val)
 
bool isFunctionDefinition () const
 
FunctionDefinitionKind getFunctionDefinitionKind () const
 
bool isFirstDeclarationOfMember ()
 Returns true if this declares a real member and not a friend. More...
 
bool isStaticMember ()
 Returns true if this declares a static member. More...
 
bool isCtorOrDtor ()
 Returns true if this declares a constructor or a destructor. More...
 
void setRedeclaration (bool Val)
 
bool isRedeclaration () const
 

Additional Inherited Members

- Public Types inherited from clang::Declarator
enum  TheContext {
  FileContext, PrototypeContext, ObjCResultContext, ObjCParameterContext,
  KNRTypeListContext, TypeNameContext, FunctionalCastContext, MemberContext,
  BlockContext, ForContext, InitStmtContext, ConditionContext,
  TemplateParamContext, CXXNewContext, CXXCatchContext, ObjCCatchContext,
  BlockLiteralContext, LambdaExprContext, LambdaExprParameterContext, ConversionIdContext,
  TrailingReturnContext, TemplateTypeArgContext, AliasDeclContext, AliasTemplateContext
}
 
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 201 of file RAIIObjectsForParser.h.

Constructor & Destructor Documentation

◆ ParsingDeclarator()

clang::ParsingDeclarator::ParsingDeclarator ( Parser P,
const ParsingDeclSpec DS,
TheContext  C 
)
inline

Definition at line 205 of file RAIIObjectsForParser.h.

Member Function Documentation

◆ clear()

void clang::ParsingDeclarator::clear ( )
inline

◆ complete()

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

◆ getDeclSpec()

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

◆ getMutableDeclSpec()

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

Definition at line 213 of file RAIIObjectsForParser.h.

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


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