1 //===--- PrintParserActions.cpp - Implement -parse-print-callbacks mode ---===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This code simply runs the preprocessor on the input file and prints out the
11 // result. This is the traditional behavior of the -E option.
13 //===----------------------------------------------------------------------===//
15 #include "clang/Frontend/Utils.h"
16 #include "clang/Parse/Action.h"
17 #include "clang/Parse/DeclSpec.h"
18 #include "llvm/Support/raw_ostream.h"
19 using namespace clang;
22 class ParserPrintActions : public MinimalAction {
23 llvm::raw_ostream& Out;
26 ParserPrintActions(Preprocessor &PP, llvm::raw_ostream& OS)
27 : MinimalAction(PP), Out(OS) {}
29 // Printing Functions which also must call MinimalAction
31 /// ActOnDeclarator - This callback is invoked when a declarator is parsed
32 /// and 'Init' specifies the initializer if any. This is for things like:
33 /// "int X = 4" or "typedef int foo".
34 virtual DeclPtrTy ActOnDeclarator(Scope *S, Declarator &D) {
35 Out << __FUNCTION__ << " ";
36 if (IdentifierInfo *II = D.getIdentifier()) {
37 Out << "'" << II->getName() << "'";
43 // Pass up to EmptyActions so that the symbol table is maintained right.
44 return MinimalAction::ActOnDeclarator(S, D);
46 /// ActOnPopScope - This callback is called immediately before the specified
47 /// scope is popped and deleted.
48 virtual void ActOnPopScope(SourceLocation Loc, Scope *S) {
49 Out << __FUNCTION__ << "\n";
50 return MinimalAction::ActOnPopScope(Loc, S);
53 /// ActOnTranslationUnitScope - This callback is called once, immediately
54 /// after creating the translation unit scope (in Parser::Initialize).
55 virtual void ActOnTranslationUnitScope(SourceLocation Loc, Scope *S) {
56 Out << __FUNCTION__ << "\n";
57 MinimalAction::ActOnTranslationUnitScope(Loc, S);
61 Action::DeclPtrTy ActOnStartClassInterface(SourceLocation AtInterfaceLoc,
62 IdentifierInfo *ClassName,
63 SourceLocation ClassLoc,
64 IdentifierInfo *SuperName,
65 SourceLocation SuperLoc,
66 const DeclPtrTy *ProtoRefs,
67 unsigned NumProtocols,
68 SourceLocation EndProtoLoc,
69 AttributeList *AttrList) {
70 Out << __FUNCTION__ << "\n";
71 return MinimalAction::ActOnStartClassInterface(AtInterfaceLoc,
74 ProtoRefs, NumProtocols,
75 EndProtoLoc, AttrList);
78 /// ActOnForwardClassDeclaration -
79 /// Scope will always be top level file scope.
80 Action::DeclPtrTy ActOnForwardClassDeclaration(SourceLocation AtClassLoc,
81 IdentifierInfo **IdentList,
83 Out << __FUNCTION__ << "\n";
84 return MinimalAction::ActOnForwardClassDeclaration(AtClassLoc, IdentList,
90 /// ActOnParamDeclarator - This callback is invoked when a parameter
91 /// declarator is parsed. This callback only occurs for functions
92 /// with prototypes. S is the function prototype scope for the
93 /// parameters (C++ [basic.scope.proto]).
94 virtual DeclPtrTy ActOnParamDeclarator(Scope *S, Declarator &D) {
95 Out << __FUNCTION__ << " ";
96 if (IdentifierInfo *II = D.getIdentifier()) {
97 Out << "'" << II->getName() << "'";
105 /// AddInitializerToDecl - This action is called immediately after
106 /// ParseDeclarator (when an initializer is present). The code is factored
107 /// this way to make sure we are able to handle the following:
108 /// void func() { int xx = xx; }
109 /// This allows ActOnDeclarator to register "xx" prior to parsing the
110 /// initializer. The declaration above should still result in a warning,
111 /// since the reference to "xx" is uninitialized.
112 virtual void AddInitializerToDecl(DeclPtrTy Dcl, FullExprArg Init) {
113 Out << __FUNCTION__ << "\n";
116 /// FinalizeDeclaratorGroup - After a sequence of declarators are parsed,
117 /// this gives the actions implementation a chance to process the group as
119 virtual DeclGroupPtrTy FinalizeDeclaratorGroup(Scope *S, const DeclSpec& DS,
122 Out << __FUNCTION__ << "\n";
123 return DeclGroupPtrTy();
126 /// ActOnStartOfFunctionDef - This is called at the start of a function
127 /// definition, instead of calling ActOnDeclarator. The Declarator includes
128 /// information about formal arguments that are part of this function.
129 virtual DeclPtrTy ActOnStartOfFunctionDef(Scope *FnBodyScope,
131 Out << __FUNCTION__ << "\n";
135 /// ActOnStartOfFunctionDef - This is called at the start of a function
136 /// definition, after the FunctionDecl has already been created.
137 virtual DeclPtrTy ActOnStartOfFunctionDef(Scope *FnBodyScope, DeclPtrTy D) {
138 Out << __FUNCTION__ << "\n";
142 virtual void ActOnStartOfObjCMethodDef(Scope *FnBodyScope, DeclPtrTy D) {
143 Out << __FUNCTION__ << "\n";
146 /// ActOnFunctionDefBody - This is called when a function body has completed
147 /// parsing. Decl is the DeclTy returned by ParseStartOfFunctionDef.
148 virtual DeclPtrTy ActOnFinishFunctionBody(DeclPtrTy Decl, StmtArg Body) {
149 Out << __FUNCTION__ << "\n";
153 virtual DeclPtrTy ActOnFileScopeAsmDecl(SourceLocation Loc,
155 Out << __FUNCTION__ << "\n";
159 /// ParsedFreeStandingDeclSpec - This method is invoked when a declspec with
160 /// no declarator (e.g. "struct foo;") is parsed.
161 virtual DeclPtrTy ParsedFreeStandingDeclSpec(Scope *S, DeclSpec &DS) {
162 Out << __FUNCTION__ << "\n";
166 /// ActOnLinkageSpec - Parsed a C++ linkage-specification that
167 /// contained braces. Lang/StrSize contains the language string that
168 /// was parsed at location Loc. Decls/NumDecls provides the
169 /// declarations parsed inside the linkage specification.
170 virtual DeclPtrTy ActOnLinkageSpec(SourceLocation Loc,
171 SourceLocation LBrace,
172 SourceLocation RBrace, const char *Lang,
174 DeclPtrTy *Decls, unsigned NumDecls) {
175 Out << __FUNCTION__ << "\n";
179 /// ActOnLinkageSpec - Parsed a C++ linkage-specification without
180 /// braces. Lang/StrSize contains the language string that was
181 /// parsed at location Loc. D is the declaration parsed.
182 virtual DeclPtrTy ActOnLinkageSpec(SourceLocation Loc, const char *Lang,
183 unsigned StrSize, DeclPtrTy D) {
187 //===------------------------------------------------------------------===//
188 // Type Parsing Callbacks.
189 //===------------------------------------------------------------------===//
191 virtual TypeResult ActOnTypeName(Scope *S, Declarator &D) {
192 Out << __FUNCTION__ << "\n";
196 virtual DeclPtrTy ActOnTag(Scope *S, unsigned TagType, TagKind TK,
197 SourceLocation KWLoc, const CXXScopeSpec &SS,
198 IdentifierInfo *Name, SourceLocation NameLoc,
199 AttributeList *Attr, AccessSpecifier AS,
201 // TagType is an instance of DeclSpec::TST, indicating what kind of tag this
202 // is (struct/union/enum/class).
203 Out << __FUNCTION__ << "\n";
207 /// Act on @defs() element found when parsing a structure. ClassName is the
208 /// name of the referenced class.
209 virtual void ActOnDefs(Scope *S, DeclPtrTy TagD, SourceLocation DeclStart,
210 IdentifierInfo *ClassName,
211 llvm::SmallVectorImpl<DeclPtrTy> &Decls) {
212 Out << __FUNCTION__ << "\n";
215 virtual DeclPtrTy ActOnField(Scope *S, DeclPtrTy TagD,
216 SourceLocation DeclStart,
217 Declarator &D, ExprTy *BitfieldWidth) {
218 Out << __FUNCTION__ << "\n";
222 virtual DeclPtrTy ActOnIvar(Scope *S, SourceLocation DeclStart,
223 Declarator &D, ExprTy *BitfieldWidth,
224 tok::ObjCKeywordKind visibility) {
225 Out << __FUNCTION__ << "\n";
229 virtual void ActOnFields(Scope* S, SourceLocation RecLoc, DeclPtrTy TagDecl,
230 DeclPtrTy *Fields, unsigned NumFields,
231 SourceLocation LBrac, SourceLocation RBrac,
232 AttributeList *AttrList) {
233 Out << __FUNCTION__ << "\n";
236 virtual DeclPtrTy ActOnEnumConstant(Scope *S, DeclPtrTy EnumDecl,
237 DeclPtrTy LastEnumConstant,
238 SourceLocation IdLoc,IdentifierInfo *Id,
239 SourceLocation EqualLoc, ExprTy *Val) {
240 Out << __FUNCTION__ << "\n";
244 virtual void ActOnEnumBody(SourceLocation EnumLoc, SourceLocation LBraceLoc,
245 SourceLocation RBraceLoc, DeclPtrTy EnumDecl,
246 DeclPtrTy *Elements, unsigned NumElements) {
247 Out << __FUNCTION__ << "\n";
250 //===------------------------------------------------------------------===//
251 // Statement Parsing Callbacks.
252 //===------------------------------------------------------------------===//
254 virtual OwningStmtResult ActOnNullStmt(SourceLocation SemiLoc) {
255 Out << __FUNCTION__ << "\n";
259 virtual OwningStmtResult ActOnCompoundStmt(SourceLocation L,
263 Out << __FUNCTION__ << "\n";
266 virtual OwningStmtResult ActOnDeclStmt(DeclGroupPtrTy Decl,
267 SourceLocation StartLoc,
268 SourceLocation EndLoc) {
269 Out << __FUNCTION__ << "\n";
273 virtual OwningStmtResult ActOnExprStmt(FullExprArg Expr) {
274 Out << __FUNCTION__ << "\n";
275 return OwningStmtResult(*this, Expr->release());
278 /// ActOnCaseStmt - Note that this handles the GNU 'case 1 ... 4' extension,
279 /// which can specify an RHS value.
280 virtual OwningStmtResult ActOnCaseStmt(SourceLocation CaseLoc,
282 SourceLocation DotDotDotLoc,
284 SourceLocation ColonLoc) {
285 Out << __FUNCTION__ << "\n";
288 virtual OwningStmtResult ActOnDefaultStmt(SourceLocation DefaultLoc,
289 SourceLocation ColonLoc,
290 StmtArg SubStmt, Scope *CurScope){
291 Out << __FUNCTION__ << "\n";
295 virtual OwningStmtResult ActOnLabelStmt(SourceLocation IdentLoc,
297 SourceLocation ColonLoc,
299 Out << __FUNCTION__ << "\n";
303 virtual OwningStmtResult ActOnIfStmt(SourceLocation IfLoc,
304 FullExprArg CondVal, StmtArg ThenVal,
305 SourceLocation ElseLoc,
307 Out << __FUNCTION__ << "\n";
311 virtual OwningStmtResult ActOnStartOfSwitchStmt(ExprArg Cond) {
312 Out << __FUNCTION__ << "\n";
316 virtual OwningStmtResult ActOnFinishSwitchStmt(SourceLocation SwitchLoc,
319 Out << __FUNCTION__ << "\n";
323 virtual OwningStmtResult ActOnWhileStmt(SourceLocation WhileLoc,
324 FullExprArg Cond, StmtArg Body) {
325 Out << __FUNCTION__ << "\n";
328 virtual OwningStmtResult ActOnDoStmt(SourceLocation DoLoc, StmtArg Body,
329 SourceLocation WhileLoc, ExprArg Cond){
330 Out << __FUNCTION__ << "\n";
333 virtual OwningStmtResult ActOnForStmt(SourceLocation ForLoc,
334 SourceLocation LParenLoc,
335 StmtArg First, ExprArg Second,
336 ExprArg Third, SourceLocation RParenLoc,
338 Out << __FUNCTION__ << "\n";
341 virtual OwningStmtResult ActOnObjCForCollectionStmt(
342 SourceLocation ForColLoc,
343 SourceLocation LParenLoc,
344 StmtArg First, ExprArg Second,
345 SourceLocation RParenLoc, StmtArg Body) {
346 Out << __FUNCTION__ << "\n";
349 virtual OwningStmtResult ActOnGotoStmt(SourceLocation GotoLoc,
350 SourceLocation LabelLoc,
351 IdentifierInfo *LabelII) {
352 Out << __FUNCTION__ << "\n";
355 virtual OwningStmtResult ActOnIndirectGotoStmt(SourceLocation GotoLoc,
356 SourceLocation StarLoc,
358 Out << __FUNCTION__ << "\n";
361 virtual OwningStmtResult ActOnContinueStmt(SourceLocation ContinueLoc,
363 Out << __FUNCTION__ << "\n";
366 virtual OwningStmtResult ActOnBreakStmt(SourceLocation GotoLoc,
368 Out << __FUNCTION__ << "\n";
371 virtual OwningStmtResult ActOnReturnStmt(SourceLocation ReturnLoc,
372 FullExprArg RetValExp) {
373 Out << __FUNCTION__ << "\n";
376 virtual OwningStmtResult ActOnAsmStmt(SourceLocation AsmLoc,
382 MultiExprArg Constraints,
385 MultiExprArg Clobbers,
386 SourceLocation RParenLoc) {
387 Out << __FUNCTION__ << "\n";
391 // Objective-c statements
392 virtual OwningStmtResult ActOnObjCAtCatchStmt(SourceLocation AtLoc,
393 SourceLocation RParen,
394 DeclPtrTy Parm, StmtArg Body,
396 Out << __FUNCTION__ << "\n";
400 virtual OwningStmtResult ActOnObjCAtFinallyStmt(SourceLocation AtLoc,
402 Out << __FUNCTION__ << "\n";
406 virtual OwningStmtResult ActOnObjCAtTryStmt(SourceLocation AtLoc,
407 StmtArg Try, StmtArg Catch,
409 Out << __FUNCTION__ << "\n";
413 virtual OwningStmtResult ActOnObjCAtThrowStmt(SourceLocation AtLoc,
416 Out << __FUNCTION__ << "\n";
420 virtual OwningStmtResult ActOnObjCAtSynchronizedStmt(SourceLocation AtLoc,
423 Out << __FUNCTION__ << "\n";
428 virtual DeclPtrTy ActOnExceptionDeclarator(Scope *S, Declarator &D) {
429 Out << __FUNCTION__ << "\n";
433 virtual OwningStmtResult ActOnCXXCatchBlock(SourceLocation CatchLoc,
434 DeclPtrTy ExceptionDecl,
435 StmtArg HandlerBlock) {
436 Out << __FUNCTION__ << "\n";
440 virtual OwningStmtResult ActOnCXXTryBlock(SourceLocation TryLoc,
442 MultiStmtArg Handlers) {
443 Out << __FUNCTION__ << "\n";
447 //===------------------------------------------------------------------===//
448 // Expression Parsing Callbacks.
449 //===------------------------------------------------------------------===//
451 // Primary Expressions.
453 /// ActOnIdentifierExpr - Parse an identifier in expression context.
454 /// 'HasTrailingLParen' indicates whether or not the identifier has a '('
455 /// token immediately after it.
456 virtual OwningExprResult ActOnIdentifierExpr(Scope *S, SourceLocation Loc,
458 bool HasTrailingLParen,
459 const CXXScopeSpec *SS,
460 bool isAddressOfOperand) {
461 Out << __FUNCTION__ << "\n";
465 virtual OwningExprResult ActOnCXXOperatorFunctionIdExpr(
466 Scope *S, SourceLocation OperatorLoc,
467 OverloadedOperatorKind Op,
468 bool HasTrailingLParen, const CXXScopeSpec &SS,
469 bool isAddressOfOperand) {
470 Out << __FUNCTION__ << "\n";
474 virtual OwningExprResult ActOnCXXConversionFunctionExpr(
475 Scope *S, SourceLocation OperatorLoc,
476 TypeTy *Type, bool HasTrailingLParen,
477 const CXXScopeSpec &SS,bool isAddressOfOperand) {
478 Out << __FUNCTION__ << "\n";
482 virtual OwningExprResult ActOnPredefinedExpr(SourceLocation Loc,
483 tok::TokenKind Kind) {
484 Out << __FUNCTION__ << "\n";
488 virtual OwningExprResult ActOnCharacterConstant(const Token &) {
489 Out << __FUNCTION__ << "\n";
493 virtual OwningExprResult ActOnNumericConstant(const Token &) {
494 Out << __FUNCTION__ << "\n";
498 /// ActOnStringLiteral - The specified tokens were lexed as pasted string
499 /// fragments (e.g. "foo" "bar" L"baz").
500 virtual OwningExprResult ActOnStringLiteral(const Token *Toks,
502 Out << __FUNCTION__ << "\n";
506 virtual OwningExprResult ActOnParenExpr(SourceLocation L, SourceLocation R,
508 Out << __FUNCTION__ << "\n";
509 return move(Val); // Default impl returns operand.
512 // Postfix Expressions.
513 virtual OwningExprResult ActOnPostfixUnaryOp(Scope *S, SourceLocation OpLoc,
516 Out << __FUNCTION__ << "\n";
519 virtual OwningExprResult ActOnArraySubscriptExpr(Scope *S, ExprArg Base,
522 SourceLocation RLoc) {
523 Out << __FUNCTION__ << "\n";
526 virtual OwningExprResult ActOnMemberReferenceExpr(Scope *S, ExprArg Base,
527 SourceLocation OpLoc,
528 tok::TokenKind OpKind,
529 SourceLocation MemberLoc,
530 IdentifierInfo &Member,
531 DeclPtrTy ImplDecl) {
532 Out << __FUNCTION__ << "\n";
536 virtual OwningExprResult ActOnCallExpr(Scope *S, ExprArg Fn,
537 SourceLocation LParenLoc,
539 SourceLocation *CommaLocs,
540 SourceLocation RParenLoc) {
541 Out << __FUNCTION__ << "\n";
545 // Unary Operators. 'Tok' is the token for the operator.
546 virtual OwningExprResult ActOnUnaryOp(Scope *S, SourceLocation OpLoc,
547 tok::TokenKind Op, ExprArg Input) {
548 Out << __FUNCTION__ << "\n";
551 virtual OwningExprResult
552 ActOnSizeOfAlignOfExpr(SourceLocation OpLoc, bool isSizeof, bool isType,
553 void *TyOrEx, const SourceRange &ArgRange) {
554 Out << __FUNCTION__ << "\n";
558 virtual OwningExprResult ActOnCompoundLiteral(SourceLocation LParen,
560 SourceLocation RParen,
562 Out << __FUNCTION__ << "\n";
565 virtual OwningExprResult ActOnInitList(SourceLocation LParenLoc,
566 MultiExprArg InitList,
567 SourceLocation RParenLoc) {
568 Out << __FUNCTION__ << "\n";
571 virtual OwningExprResult ActOnCastExpr(SourceLocation LParenLoc, TypeTy *Ty,
572 SourceLocation RParenLoc,ExprArg Op){
573 Out << __FUNCTION__ << "\n";
577 virtual OwningExprResult ActOnBinOp(Scope *S, SourceLocation TokLoc,
579 ExprArg LHS, ExprArg RHS) {
580 Out << __FUNCTION__ << "\n";
584 /// ActOnConditionalOp - Parse a ?: operation. Note that 'LHS' may be null
585 /// in the case of a the GNU conditional expr extension.
586 virtual OwningExprResult ActOnConditionalOp(SourceLocation QuestionLoc,
587 SourceLocation ColonLoc,
588 ExprArg Cond, ExprArg LHS,
590 Out << __FUNCTION__ << "\n";
594 //===--------------------- GNU Extension Expressions ------------------===//
596 virtual OwningExprResult ActOnAddrLabel(SourceLocation OpLoc,
597 SourceLocation LabLoc,
598 IdentifierInfo *LabelII) {// "&&foo"
599 Out << __FUNCTION__ << "\n";
603 virtual OwningExprResult ActOnStmtExpr(SourceLocation LPLoc,
605 SourceLocation RPLoc) { // "({..})"
606 Out << __FUNCTION__ << "\n";
610 virtual OwningExprResult ActOnBuiltinOffsetOf(Scope *S,
611 SourceLocation BuiltinLoc,
612 SourceLocation TypeLoc,
614 OffsetOfComponent *CompPtr,
615 unsigned NumComponents,
616 SourceLocation RParenLoc) {
617 Out << __FUNCTION__ << "\n";
621 // __builtin_types_compatible_p(type1, type2)
622 virtual OwningExprResult ActOnTypesCompatibleExpr(SourceLocation BuiltinLoc,
623 TypeTy *arg1,TypeTy *arg2,
624 SourceLocation RPLoc) {
625 Out << __FUNCTION__ << "\n";
628 // __builtin_choose_expr(constExpr, expr1, expr2)
629 virtual OwningExprResult ActOnChooseExpr(SourceLocation BuiltinLoc,
630 ExprArg cond, ExprArg expr1,
632 SourceLocation RPLoc) {
633 Out << __FUNCTION__ << "\n";
637 // __builtin_va_arg(expr, type)
638 virtual OwningExprResult ActOnVAArg(SourceLocation BuiltinLoc,
639 ExprArg expr, TypeTy *type,
640 SourceLocation RPLoc) {
641 Out << __FUNCTION__ << "\n";
645 virtual OwningExprResult ActOnGNUNullExpr(SourceLocation TokenLoc) {
646 Out << __FUNCTION__ << "\n";
650 virtual void ActOnBlockStart(SourceLocation CaretLoc, Scope *CurScope) {
651 Out << __FUNCTION__ << "\n";
654 virtual void ActOnBlockArguments(Declarator &ParamInfo, Scope *CurScope) {
655 Out << __FUNCTION__ << "\n";
658 virtual void ActOnBlockError(SourceLocation CaretLoc, Scope *CurScope) {
659 Out << __FUNCTION__ << "\n";
662 virtual OwningExprResult ActOnBlockStmtExpr(SourceLocation CaretLoc,
665 Out << __FUNCTION__ << "\n";
669 virtual DeclPtrTy ActOnStartNamespaceDef(Scope *S, SourceLocation IdentLoc,
670 IdentifierInfo *Ident,
671 SourceLocation LBrace) {
672 Out << __FUNCTION__ << "\n";
676 virtual void ActOnFinishNamespaceDef(DeclPtrTy Dcl, SourceLocation RBrace) {
677 Out << __FUNCTION__ << "\n";
682 // FIXME: AttrList should be deleted by this function, but the definition
683 // would have to be available.
684 virtual DeclPtrTy ActOnUsingDirective(Scope *CurScope,
685 SourceLocation UsingLoc,
686 SourceLocation NamespcLoc,
687 const CXXScopeSpec &SS,
688 SourceLocation IdentLoc,
689 IdentifierInfo *NamespcName,
690 AttributeList *AttrList) {
691 Out << __FUNCTION__ << "\n";
696 virtual void ActOnParamDefaultArgument(DeclPtrTy param,
697 SourceLocation EqualLoc,
699 Out << __FUNCTION__ << "\n";
702 virtual void ActOnParamUnparsedDefaultArgument(DeclPtrTy param,
703 SourceLocation EqualLoc) {
704 Out << __FUNCTION__ << "\n";
707 virtual void ActOnParamDefaultArgumentError(DeclPtrTy param) {
708 Out << __FUNCTION__ << "\n";
711 virtual void AddCXXDirectInitializerToDecl(DeclPtrTy Dcl,
712 SourceLocation LParenLoc,
714 SourceLocation *CommaLocs,
715 SourceLocation RParenLoc) {
716 Out << __FUNCTION__ << "\n";
720 virtual void ActOnStartDelayedCXXMethodDeclaration(Scope *S,
723 Out << __FUNCTION__ << "\n";
726 virtual void ActOnDelayedCXXMethodParameter(Scope *S, DeclPtrTy Param) {
727 Out << __FUNCTION__ << "\n";
730 virtual void ActOnFinishDelayedCXXMethodDeclaration(Scope *S,
732 Out << __FUNCTION__ << "\n";
735 virtual DeclPtrTy ActOnStaticAssertDeclaration(SourceLocation AssertLoc,
737 ExprArg AssertMessageExpr) {
738 Out << __FUNCTION__ << "\n";
742 virtual OwningExprResult ActOnCXXNamedCast(SourceLocation OpLoc,
744 SourceLocation LAngleBracketLoc,
746 SourceLocation RAngleBracketLoc,
747 SourceLocation LParenLoc,
749 SourceLocation RParenLoc) {
750 Out << __FUNCTION__ << "\n";
754 virtual OwningExprResult ActOnCXXTypeid(SourceLocation OpLoc,
755 SourceLocation LParenLoc,
756 bool isType, void *TyOrExpr,
757 SourceLocation RParenLoc) {
758 Out << __FUNCTION__ << "\n";
762 virtual OwningExprResult ActOnCXXThis(SourceLocation ThisLoc) {
763 Out << __FUNCTION__ << "\n";
767 virtual OwningExprResult ActOnCXXBoolLiteral(SourceLocation OpLoc,
768 tok::TokenKind Kind) {
769 Out << __FUNCTION__ << "\n";
773 virtual OwningExprResult ActOnCXXThrow(SourceLocation OpLoc, ExprArg Op) {
774 Out << __FUNCTION__ << "\n";
778 virtual OwningExprResult ActOnCXXTypeConstructExpr(SourceRange TypeRange,
780 SourceLocation LParenLoc,
782 SourceLocation *CommaLocs,
783 SourceLocation RParenLoc) {
784 Out << __FUNCTION__ << "\n";
788 virtual OwningExprResult ActOnCXXConditionDeclarationExpr(Scope *S,
789 SourceLocation StartLoc,
791 SourceLocation EqualLoc,
792 ExprArg AssignExprVal) {
793 Out << __FUNCTION__ << "\n";
797 virtual OwningExprResult ActOnCXXNew(SourceLocation StartLoc,
799 SourceLocation PlacementLParen,
800 MultiExprArg PlacementArgs,
801 SourceLocation PlacementRParen,
802 bool ParenTypeId, Declarator &D,
803 SourceLocation ConstructorLParen,
804 MultiExprArg ConstructorArgs,
805 SourceLocation ConstructorRParen) {
806 Out << __FUNCTION__ << "\n";
810 virtual OwningExprResult ActOnCXXDelete(SourceLocation StartLoc,
811 bool UseGlobal, bool ArrayForm,
813 Out << __FUNCTION__ << "\n";
817 virtual OwningExprResult ActOnUnaryTypeTrait(UnaryTypeTrait OTT,
818 SourceLocation KWLoc,
819 SourceLocation LParen,
821 SourceLocation RParen) {
822 Out << __FUNCTION__ << "\n";
828 MinimalAction *clang::CreatePrintParserActionsAction(Preprocessor &PP,
829 llvm::raw_ostream* OS) {
830 return new ParserPrintActions(PP, *OS);