//===--- Action.h - Parser Action Interface ---------------------*- C++ -*-===////// The LLVM Compiler Infrastructure//// This file is distributed under the University of Illinois Open Source// License. See LICENSE.TXT for details.////===----------------------------------------------------------------------===////// This file defines the Action and EmptyAction interface.////===----------------------------------------------------------------------===//#ifndef LLVM_CLANG_PARSE_ACTION_H#define LLVM_CLANG_PARSE_ACTION_H#include"clang/Basic/IdentifierTable.h"#include"clang/Basic/SourceLocation.h"#include"clang/Basic/TypeTraits.h"#include"clang/Parse/AccessSpecifier.h"#include"clang/Parse/Ownership.h"namespaceclang{// Semantic.classDeclSpec;classObjCDeclSpec;classCXXScopeSpec;classDeclarator;classAttributeList;structFieldDeclarator;// Parse.classScope;classAction;classSelector;classDesignation;classInitListDesignations;// Lex.classPreprocessor;classToken;/// Action - As the parser reads the input file and recognizes the productions/// of the grammar, it invokes methods on this class to turn the parsed input/// into something useful: e.g. a parse tree.////// The callback methods that this class provides are phrased as actions that/// the parser has just done or is about to do when the method is called. They/// are not requests that the actions module do the specified action.////// All of the methods here are optional except isTypeName() and/// isCurrentClassName(), which must be specified in order for the/// parse to complete accurately. The MinimalAction class does this/// bare-minimum of tracking to implement this functionality.classAction:publicActionBase{public:/// Out-of-line virtual destructor to provide home for this class.virtual~Action();// Types - Though these don't actually enforce strong typing, they document// what types are required to be identical for the actions.typedefActionBase::ExprTyExprTy;typedefActionBase::StmtTyStmtTy;typedefvoidDeclTy;typedefvoidTypeTy;typedefvoidAttrTy;typedefvoidBaseTy;typedefvoidMemInitTy;typedefvoidCXXScopeTy;typedefvoidTemplateParamsTy;typedefvoidTemplateArgTy;/// Expr/Stmt/Type/BaseResult - Provide a unique type to wrap/// ExprTy/StmtTy/TypeTy/BaseTy, providing strong typing and/// allowing for failure.typedefActionResult<0>ExprResult;typedefActionResult<1>StmtResult;typedefActionResult<2>TypeResult;typedefActionResult<3>BaseResult;typedefActionResult<4>MemInitResult;/// Same, but with ownership.typedefASTOwningResult<&ActionBase::DeleteExpr>OwningExprResult;