clang API Documentation

Classes | Public Types | Public Member Functions | Friends
clang::Parser Class Reference

#include <Parser.h>

Inheritance diagram for clang::Parser:
Inheritance graph
[legend]
Collaboration diagram for clang::Parser:
Collaboration graph
[legend]

List of all members.

Classes

class  BalancedDelimiterTracker
 RAII class that helps handle the parsing of an open/close delimiter pair, such as braces { ... } or parentheses ( ... ).
class  DeclaratorScopeObj
class  DelimiterTracker
 Tracks information about the current nesting depth of opening delimiters of each kind.
struct  FieldCallback
struct  ForRangeInit
struct  IfExistsCondition
 Describes the condition of a Microsoft __if_exists or __if_not_exists block.
struct  LateParsedAttribute
class  LateParsedClass
class  LateParsedDeclaration
struct  LateParsedDefaultArgument
struct  LateParsedMemberInitializer
struct  LateParsedMethodDeclaration
struct  LateParsedTemplatedFunction
 Contains a late templated function. Will be parsed at the end of the translation unit.
struct  LexedMethod
class  ObjCDeclContextSwitch
struct  ObjCImplParsingDataRAII
struct  ObjCPropertyCallback
struct  ParsedAttributesWithRange
struct  ParsedTemplateInfo
 Contains information about any template-specific information that has been parsed prior to parsing declaration specifiers.
class  ParseScope
class  ParseScopeFlags
 RAII object used to modify the scope flags for the current scope.
struct  ParsingClass
 Representation of a class that has been parsed, including any member function declarations or definitions that need to be parsed after the corresponding top-level class is complete.
class  ParsingClassDefinition
 RAII object used to.
class  ParsingDeclarator
 A class for parsing a declarator.
class  ParsingDeclRAIIObject
 RAII object used to inform the actions that we're currently parsing a declaration. This is active when parsing a variable's initializer, but not when parsing the body of a class or function definition.
class  ParsingDeclSpec
 A class for parsing a DeclSpec.
class  TentativeParsingAction
class  TPResult

Public Types

typedef OpaquePtr< DeclGroupRefDeclGroupPtrTy
typedef OpaquePtr< TemplateNameTemplateTy
typedef SmallVector
< TemplateParameterList *, 4 > 
TemplateParameterLists
typedef clang::ExprResult ExprResult
typedef clang::StmtResult StmtResult
typedef clang::BaseResult BaseResult
typedef clang::MemInitResult MemInitResult
typedef clang::TypeResult TypeResult
typedef ExprExprArg
typedef ASTMultiPtr< Stmt * > MultiStmtArg
typedef Sema::FullExprArg FullExprArg

Public Member Functions

 Parser (Preprocessor &PP, Sema &Actions)
 ~Parser ()
const LangOptionsgetLang () const
const TargetInfogetTargetInfo () const
PreprocessorgetPreprocessor () const
SemagetActions () const
const TokengetCurToken () const
ScopegetCurScope () const
DeclgetObjCDeclContext () const
ExprResult Owned (ExprResult res)
 Adorns a ExprResult with Actions to make it an ExprResult.
StmtResult Owned (StmtResult res)
 Adorns a StmtResult with Actions to make it an StmtResult.
ExprResult ExprError ()
StmtResult StmtError ()
ExprResult ExprError (const DiagnosticBuilder &)
StmtResult StmtError (const DiagnosticBuilder &)
ExprResult ExprEmpty ()
void ParseTranslationUnit ()
void Initialize ()
bool ParseTopLevelDecl (DeclGroupPtrTy &Result)
DiagnosticBuilder Diag (SourceLocation Loc, unsigned DiagID)
DiagnosticBuilder Diag (const Token &Tok, unsigned DiagID)

Friends

class PragmaUnusedHandler
class ColonProtectionRAIIObject
class InMessageExpressionRAIIObject
class PoisonSEHIdentifiersRAIIObject
class ParenBraceBracketBalancer

Detailed Description

Parser - This implements a parser for the C family of languages. After parsing units of the grammar, productions are invoked to handle whatever has been read.

Definition at line 77 of file Parser.h.


Member Typedef Documentation

Definition at line 222 of file Parser.h.

Definition at line 215 of file Parser.h.

Definition at line 226 of file Parser.h.

Definition at line 220 of file Parser.h.

Definition at line 228 of file Parser.h.

Definition at line 223 of file Parser.h.

Definition at line 227 of file Parser.h.

Definition at line 221 of file Parser.h.

Definition at line 218 of file Parser.h.

Definition at line 216 of file Parser.h.

Definition at line 224 of file Parser.h.


Constructor & Destructor Documentation

Parser::Parser ( Preprocessor PP,
Sema Actions 
)
Parser::~Parser ( )

Member Function Documentation

DiagnosticBuilder Parser::Diag ( SourceLocation  Loc,
unsigned  DiagID 
)

Definition at line 104 of file Parser.cpp.

References clang::DiagnosticsEngine::Report().

Referenced by CheckArrayDesignatorSyntax(), Diag(), FixDigraph(), and Initialize().

DiagnosticBuilder Parser::Diag ( const Token Tok,
unsigned  DiagID 
)

Definition at line 108 of file Parser.cpp.

References Diag(), and clang::Token::getLocation().

ExprResult clang::Parser::ExprEmpty ( ) [inline]

Definition at line 245 of file Parser.h.

ExprResult clang::Parser::ExprError ( ) [inline]

Definition at line 239 of file Parser.h.

ExprResult clang::Parser::ExprError ( const DiagnosticBuilder ) [inline]

Definition at line 242 of file Parser.h.

References ExprError().

Referenced by ExprError().

Sema& clang::Parser::getActions ( ) const [inline]

Definition at line 206 of file Parser.h.

Referenced by clang::ParseAST().

Scope* clang::Parser::getCurScope ( ) const [inline]

Definition at line 209 of file Parser.h.

References clang::Sema::getCurScope().

Referenced by Initialize(), ParseTranslationUnit(), and ~Parser().

const Token& clang::Parser::getCurToken ( ) const [inline]

Definition at line 208 of file Parser.h.

Referenced by clang::PrettyStackTraceParserEntry::print().

const LangOptions& clang::Parser::getLang ( ) const [inline]

Definition at line 203 of file Parser.h.

References clang::Preprocessor::getLangOptions().

Referenced by Initialize(), Parser(), ParseTopLevelDecl(), and ~Parser().

Decl* clang::Parser::getObjCDeclContext ( ) const [inline]

Definition at line 211 of file Parser.h.

References clang::Sema::getObjCDeclContext().

Preprocessor& clang::Parser::getPreprocessor ( ) const [inline]

Definition at line 205 of file Parser.h.

Referenced by clang::PrettyStackTraceParserEntry::print().

const TargetInfo& clang::Parser::getTargetInfo ( ) const [inline]

Definition at line 204 of file Parser.h.

References clang::Preprocessor::getTargetInfo().

void Parser::Initialize ( )
ExprResult clang::Parser::Owned ( ExprResult  res) [inline]

Adorns a ExprResult with Actions to make it an ExprResult.

Definition at line 231 of file Parser.h.

StmtResult clang::Parser::Owned ( StmtResult  res) [inline]

Adorns a StmtResult with Actions to make it an StmtResult.

Definition at line 235 of file Parser.h.

bool Parser::ParseTopLevelDecl ( DeclGroupPtrTy Result)

ParseTopLevelDecl - Parse one top-level declaration. Returns true if the EOF was encountered.

ParseTopLevelDecl - Parse one top-level declaration, return whatever the action tells us to. This returns true if the EOF was encountered.

Definition at line 470 of file Parser.cpp.

References clang::Sema::ActOnEndOfTranslationUnit(), getLang(), clang::Token::is(), and clang::Sema::SetLateTemplateParser().

Referenced by clang::ParseAST(), and ParseTranslationUnit().

void Parser::ParseTranslationUnit ( )

ParseTranslationUnit - All in one method that initializes parses, and shuts down the parser.

ParseTranslationUnit: translation-unit: [C99 6.9] external-declaration translation-unit external-declaration

Definition at line 498 of file Parser.cpp.

References getCurScope(), Initialize(), and ParseTopLevelDecl().

StmtResult clang::Parser::StmtError ( ) [inline]

Definition at line 240 of file Parser.h.

StmtResult clang::Parser::StmtError ( const DiagnosticBuilder ) [inline]

Definition at line 243 of file Parser.h.

References StmtError().

Referenced by StmtError().


Friends And Related Function Documentation

friend class ColonProtectionRAIIObject [friend]

Definition at line 79 of file Parser.h.

friend class InMessageExpressionRAIIObject [friend]

Definition at line 80 of file Parser.h.

friend class ParenBraceBracketBalancer [friend]

Definition at line 82 of file Parser.h.

friend class PoisonSEHIdentifiersRAIIObject [friend]

Definition at line 81 of file Parser.h.

friend class PragmaUnusedHandler [friend]

Definition at line 78 of file Parser.h.

Referenced by Parser().


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