tools/icheck/parser/src/shared/cplusplus/ASTMatcher.h
changeset 0 876b1a06bc25
equal deleted inserted replaced
-1:000000000000 0:876b1a06bc25
       
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     4 ** All rights reserved.
       
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
       
     6 **
       
     7 ** This file is part of the Qt Mobility Components.
       
     8 **
       
     9 ** $QT_BEGIN_LICENSE:LGPL$
       
    10 ** No Commercial Usage
       
    11 ** This file contains pre-release code and may not be distributed.
       
    12 ** You may use this file in accordance with the terms and conditions
       
    13 ** contained in the Technology Preview License Agreement accompanying
       
    14 ** this package.
       
    15 **
       
    16 ** GNU Lesser General Public License Usage
       
    17 ** Alternatively, this file may be used under the terms of the GNU Lesser
       
    18 ** General Public License version 2.1 as published by the Free Software
       
    19 ** Foundation and appearing in the file LICENSE.LGPL included in the
       
    20 ** packaging of this file.  Please review the following information to
       
    21 ** ensure the GNU Lesser General Public License version 2.1 requirements
       
    22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
       
    23 **
       
    24 ** In addition, as a special exception, Nokia gives you certain additional
       
    25 ** rights.  These rights are described in the Nokia Qt LGPL Exception
       
    26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
       
    27 **
       
    28 ** If you have questions regarding the use of this file, please contact
       
    29 ** Nokia at qt-info@nokia.com.
       
    30 **
       
    31 **
       
    32 **
       
    33 **
       
    34 **
       
    35 **
       
    36 **
       
    37 **
       
    38 ** $QT_END_LICENSE$
       
    39 **
       
    40 ****************************************************************************/
       
    41 
       
    42 #ifndef ASTMATCHER_H
       
    43 #define ASTMATCHER_H
       
    44 
       
    45 #include "ASTfwd.h"
       
    46 
       
    47 namespace CPlusPlus {
       
    48 
       
    49 class CPLUSPLUS_EXPORT ASTMatcher
       
    50 {
       
    51 public:
       
    52     ASTMatcher();
       
    53     virtual ~ASTMatcher();
       
    54 
       
    55     virtual bool match(AccessDeclarationAST *node, AccessDeclarationAST *pattern);
       
    56 #ifdef ICHECK_BUILD
       
    57     virtual bool match(QPropertyDeclarationAST *node, QPropertyDeclarationAST *pattern);
       
    58     virtual bool match(QEnumDeclarationAST *node, QEnumDeclarationAST *pattern);
       
    59     virtual bool match(QFlagsDeclarationAST *node, QFlagsDeclarationAST *pattern);
       
    60     virtual bool match(QDeclareFlagsDeclarationAST *node, QDeclareFlagsDeclarationAST *pattern);
       
    61 #endif
       
    62     virtual bool match(ArrayAccessAST *node, ArrayAccessAST *pattern);
       
    63     virtual bool match(ArrayDeclaratorAST *node, ArrayDeclaratorAST *pattern);
       
    64     virtual bool match(ArrayInitializerAST *node, ArrayInitializerAST *pattern);
       
    65     virtual bool match(AsmDefinitionAST *node, AsmDefinitionAST *pattern);
       
    66     virtual bool match(AttributeSpecifierAST *node, AttributeSpecifierAST *pattern);
       
    67     virtual bool match(AttributeAST *node, AttributeAST *pattern);
       
    68     virtual bool match(BaseSpecifierAST *node, BaseSpecifierAST *pattern);
       
    69     virtual bool match(BinaryExpressionAST *node, BinaryExpressionAST *pattern);
       
    70     virtual bool match(BoolLiteralAST *node, BoolLiteralAST *pattern);
       
    71     virtual bool match(BreakStatementAST *node, BreakStatementAST *pattern);
       
    72     virtual bool match(CallAST *node, CallAST *pattern);
       
    73     virtual bool match(CaseStatementAST *node, CaseStatementAST *pattern);
       
    74     virtual bool match(CastExpressionAST *node, CastExpressionAST *pattern);
       
    75     virtual bool match(CatchClauseAST *node, CatchClauseAST *pattern);
       
    76     virtual bool match(ClassSpecifierAST *node, ClassSpecifierAST *pattern);
       
    77     virtual bool match(CompoundLiteralAST *node, CompoundLiteralAST *pattern);
       
    78     virtual bool match(CompoundStatementAST *node, CompoundStatementAST *pattern);
       
    79     virtual bool match(ConditionAST *node, ConditionAST *pattern);
       
    80     virtual bool match(ConditionalExpressionAST *node, ConditionalExpressionAST *pattern);
       
    81     virtual bool match(ContinueStatementAST *node, ContinueStatementAST *pattern);
       
    82     virtual bool match(ConversionFunctionIdAST *node, ConversionFunctionIdAST *pattern);
       
    83     virtual bool match(CppCastExpressionAST *node, CppCastExpressionAST *pattern);
       
    84     virtual bool match(CtorInitializerAST *node, CtorInitializerAST *pattern);
       
    85     virtual bool match(DeclaratorAST *node, DeclaratorAST *pattern);
       
    86     virtual bool match(DeclarationStatementAST *node, DeclarationStatementAST *pattern);
       
    87     virtual bool match(DeclaratorIdAST *node, DeclaratorIdAST *pattern);
       
    88     virtual bool match(DeleteExpressionAST *node, DeleteExpressionAST *pattern);
       
    89     virtual bool match(DestructorNameAST *node, DestructorNameAST *pattern);
       
    90     virtual bool match(DoStatementAST *node, DoStatementAST *pattern);
       
    91     virtual bool match(ElaboratedTypeSpecifierAST *node, ElaboratedTypeSpecifierAST *pattern);
       
    92     virtual bool match(EmptyDeclarationAST *node, EmptyDeclarationAST *pattern);
       
    93     virtual bool match(EnumSpecifierAST *node, EnumSpecifierAST *pattern);
       
    94     virtual bool match(EnumeratorAST *node, EnumeratorAST *pattern);
       
    95     virtual bool match(ExceptionDeclarationAST *node, ExceptionDeclarationAST *pattern);
       
    96     virtual bool match(ExceptionSpecificationAST *node, ExceptionSpecificationAST *pattern);
       
    97     virtual bool match(ExpressionOrDeclarationStatementAST *node, ExpressionOrDeclarationStatementAST *pattern);
       
    98     virtual bool match(ExpressionStatementAST *node, ExpressionStatementAST *pattern);
       
    99     virtual bool match(ForeachStatementAST *node, ForeachStatementAST *pattern);
       
   100     virtual bool match(ForStatementAST *node, ForStatementAST *pattern);
       
   101     virtual bool match(FunctionDeclaratorAST *node, FunctionDeclaratorAST *pattern);
       
   102     virtual bool match(FunctionDefinitionAST *node, FunctionDefinitionAST *pattern);
       
   103     virtual bool match(GotoStatementAST *node, GotoStatementAST *pattern);
       
   104     virtual bool match(IfStatementAST *node, IfStatementAST *pattern);
       
   105     virtual bool match(LabeledStatementAST *node, LabeledStatementAST *pattern);
       
   106     virtual bool match(LinkageBodyAST *node, LinkageBodyAST *pattern);
       
   107     virtual bool match(LinkageSpecificationAST *node, LinkageSpecificationAST *pattern);
       
   108     virtual bool match(MemInitializerAST *node, MemInitializerAST *pattern);
       
   109     virtual bool match(MemberAccessAST *node, MemberAccessAST *pattern);
       
   110     virtual bool match(NamedTypeSpecifierAST *node, NamedTypeSpecifierAST *pattern);
       
   111     virtual bool match(NamespaceAST *node, NamespaceAST *pattern);
       
   112     virtual bool match(NamespaceAliasDefinitionAST *node, NamespaceAliasDefinitionAST *pattern);
       
   113     virtual bool match(NestedDeclaratorAST *node, NestedDeclaratorAST *pattern);
       
   114     virtual bool match(NestedExpressionAST *node, NestedExpressionAST *pattern);
       
   115     virtual bool match(NestedNameSpecifierAST *node, NestedNameSpecifierAST *pattern);
       
   116     virtual bool match(NewPlacementAST *node, NewPlacementAST *pattern);
       
   117     virtual bool match(NewArrayDeclaratorAST *node, NewArrayDeclaratorAST *pattern);
       
   118     virtual bool match(NewExpressionAST *node, NewExpressionAST *pattern);
       
   119     virtual bool match(NewInitializerAST *node, NewInitializerAST *pattern);
       
   120     virtual bool match(NewTypeIdAST *node, NewTypeIdAST *pattern);
       
   121     virtual bool match(NumericLiteralAST *node, NumericLiteralAST *pattern);
       
   122     virtual bool match(OperatorAST *node, OperatorAST *pattern);
       
   123     virtual bool match(OperatorFunctionIdAST *node, OperatorFunctionIdAST *pattern);
       
   124     virtual bool match(ParameterDeclarationAST *node, ParameterDeclarationAST *pattern);
       
   125     virtual bool match(ParameterDeclarationClauseAST *node, ParameterDeclarationClauseAST *pattern);
       
   126     virtual bool match(PointerAST *node, PointerAST *pattern);
       
   127     virtual bool match(PointerToMemberAST *node, PointerToMemberAST *pattern);
       
   128     virtual bool match(PostIncrDecrAST *node, PostIncrDecrAST *pattern);
       
   129     virtual bool match(PostfixExpressionAST *node, PostfixExpressionAST *pattern);
       
   130     virtual bool match(QualifiedNameAST *node, QualifiedNameAST *pattern);
       
   131     virtual bool match(ReferenceAST *node, ReferenceAST *pattern);
       
   132     virtual bool match(ReturnStatementAST *node, ReturnStatementAST *pattern);
       
   133     virtual bool match(SimpleDeclarationAST *node, SimpleDeclarationAST *pattern);
       
   134     virtual bool match(SimpleNameAST *node, SimpleNameAST *pattern);
       
   135     virtual bool match(SimpleSpecifierAST *node, SimpleSpecifierAST *pattern);
       
   136     virtual bool match(SizeofExpressionAST *node, SizeofExpressionAST *pattern);
       
   137     virtual bool match(StringLiteralAST *node, StringLiteralAST *pattern);
       
   138     virtual bool match(SwitchStatementAST *node, SwitchStatementAST *pattern);
       
   139     virtual bool match(TemplateDeclarationAST *node, TemplateDeclarationAST *pattern);
       
   140     virtual bool match(TemplateIdAST *node, TemplateIdAST *pattern);
       
   141     virtual bool match(TemplateTypeParameterAST *node, TemplateTypeParameterAST *pattern);
       
   142     virtual bool match(ThisExpressionAST *node, ThisExpressionAST *pattern);
       
   143     virtual bool match(ThrowExpressionAST *node, ThrowExpressionAST *pattern);
       
   144     virtual bool match(TranslationUnitAST *node, TranslationUnitAST *pattern);
       
   145     virtual bool match(TryBlockStatementAST *node, TryBlockStatementAST *pattern);
       
   146     virtual bool match(TypeConstructorCallAST *node, TypeConstructorCallAST *pattern);
       
   147     virtual bool match(TypeIdAST *node, TypeIdAST *pattern);
       
   148     virtual bool match(TypeidExpressionAST *node, TypeidExpressionAST *pattern);
       
   149     virtual bool match(TypeofSpecifierAST *node, TypeofSpecifierAST *pattern);
       
   150     virtual bool match(TypenameCallExpressionAST *node, TypenameCallExpressionAST *pattern);
       
   151     virtual bool match(TypenameTypeParameterAST *node, TypenameTypeParameterAST *pattern);
       
   152     virtual bool match(UnaryExpressionAST *node, UnaryExpressionAST *pattern);
       
   153     virtual bool match(UsingAST *node, UsingAST *pattern);
       
   154     virtual bool match(UsingDirectiveAST *node, UsingDirectiveAST *pattern);
       
   155     virtual bool match(WhileStatementAST *node, WhileStatementAST *pattern);
       
   156     virtual bool match(QtMethodAST *node, QtMethodAST *pattern);
       
   157     virtual bool match(QtMemberDeclarationAST *node, QtMemberDeclarationAST *pattern);
       
   158     virtual bool match(ObjCClassDeclarationAST *node, ObjCClassDeclarationAST *pattern);
       
   159     virtual bool match(ObjCClassForwardDeclarationAST *node, ObjCClassForwardDeclarationAST *pattern);
       
   160     virtual bool match(ObjCProtocolDeclarationAST *node, ObjCProtocolDeclarationAST *pattern);
       
   161     virtual bool match(ObjCProtocolForwardDeclarationAST *node, ObjCProtocolForwardDeclarationAST *pattern);
       
   162     virtual bool match(ObjCProtocolRefsAST *node, ObjCProtocolRefsAST *pattern);
       
   163     virtual bool match(ObjCMessageExpressionAST *node, ObjCMessageExpressionAST *pattern);
       
   164     virtual bool match(ObjCMessageArgumentAST *node, ObjCMessageArgumentAST *pattern);
       
   165     virtual bool match(ObjCProtocolExpressionAST *node, ObjCProtocolExpressionAST *pattern);
       
   166     virtual bool match(ObjCTypeNameAST *node, ObjCTypeNameAST *pattern);
       
   167     virtual bool match(ObjCEncodeExpressionAST *node, ObjCEncodeExpressionAST *pattern);
       
   168     virtual bool match(ObjCSelectorWithoutArgumentsAST *node, ObjCSelectorWithoutArgumentsAST *pattern);
       
   169     virtual bool match(ObjCSelectorArgumentAST *node, ObjCSelectorArgumentAST *pattern);
       
   170     virtual bool match(ObjCSelectorWithArgumentsAST *node, ObjCSelectorWithArgumentsAST *pattern);
       
   171     virtual bool match(ObjCSelectorExpressionAST *node, ObjCSelectorExpressionAST *pattern);
       
   172     virtual bool match(ObjCInstanceVariablesDeclarationAST *node, ObjCInstanceVariablesDeclarationAST *pattern);
       
   173     virtual bool match(ObjCVisibilityDeclarationAST *node, ObjCVisibilityDeclarationAST *pattern);
       
   174     virtual bool match(ObjCPropertyAttributeAST *node, ObjCPropertyAttributeAST *pattern);
       
   175     virtual bool match(ObjCPropertyDeclarationAST *node, ObjCPropertyDeclarationAST *pattern);
       
   176     virtual bool match(ObjCMethodPrototypeAST *node, ObjCMethodPrototypeAST *pattern);
       
   177     virtual bool match(ObjCMethodDeclarationAST *node, ObjCMethodDeclarationAST *pattern);
       
   178     virtual bool match(ObjCMessageArgumentDeclarationAST *node, ObjCMessageArgumentDeclarationAST *pattern);
       
   179     virtual bool match(ObjCSynthesizedPropertyAST *node, ObjCSynthesizedPropertyAST *pattern);
       
   180     virtual bool match(ObjCSynthesizedPropertiesDeclarationAST *node, ObjCSynthesizedPropertiesDeclarationAST *pattern);
       
   181     virtual bool match(ObjCDynamicPropertiesDeclarationAST *node, ObjCDynamicPropertiesDeclarationAST *pattern);
       
   182     virtual bool match(ObjCFastEnumerationAST *node, ObjCFastEnumerationAST *pattern);
       
   183     virtual bool match(ObjCSynchronizedStatementAST *node, ObjCSynchronizedStatementAST *pattern);
       
   184 };
       
   185 
       
   186 } // end of namespace CPlusPlus
       
   187 
       
   188 #endif // ASTMATCHER_H