Mercurial > projects > qtd
annotate generator/parser/visitor.h @ 334:ed7018b63aa7 signals
merge 2
author | eldar1@eldar1-laptop |
---|---|
date | Sun, 07 Feb 2010 15:46:06 +0000 |
parents | 09a0f1d048f2 |
children |
rev | line source |
---|---|
1 | 1 /**************************************************************************** |
2 ** | |
52
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
3 ** Copyright (C) 1992-2009 Nokia. All rights reserved. |
1 | 4 ** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org> |
5 ** | |
6 ** This file is part of Qt Jambi. | |
7 ** | |
52
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
8 ** Commercial Usage |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
9 Licensees holding valid Qt Commercial licenses may use this file in |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
10 accordance with the Qt Commercial License Agreement provided with the |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
11 Software or, alternatively, in accordance with the terms contained in |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
12 a written agreement between you and Nokia. |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
13 |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
14 GNU Lesser General Public License Usage |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
15 Alternatively, this file may be used under the terms of the GNU Lesser |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
16 General Public License version 2.1 as published by the Free Software |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
17 Foundation and appearing in the file LICENSE.LGPL included in the |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
18 packaging of this file. Please review the following information to |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
19 ensure the GNU Lesser General Public License version 2.1 requirements |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
20 will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
21 |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
22 In addition, as a special exception, Nokia gives you certain |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
23 additional rights. These rights are described in the Nokia Qt LGPL |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
24 Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
25 package. |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
26 |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
27 GNU General Public License Usage |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
28 Alternatively, this file may be used under the terms of the GNU |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
29 General Public License version 3.0 as published by the Free Software |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
30 Foundation and appearing in the file LICENSE.GPL included in the |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
31 packaging of this file. Please review the following information to |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
32 ensure the GNU General Public License version 3.0 requirements will be |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
33 met: http://www.gnu.org/copyleft/gpl.html. |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
34 |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
35 If you are unsure which license is appropriate for your use, please |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
36 contact the sales department at qt-sales@nokia.com. |
1 | 37 |
38 ** | |
39 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | |
40 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
41 ** | |
42 ****************************************************************************/ | |
43 | |
44 | |
45 #ifndef VISITOR_H | |
46 #define VISITOR_H | |
47 | |
48 #include "ast.h" | |
49 | |
50 class Visitor | |
51 { | |
52 public: | |
53 Visitor(); | |
54 virtual ~Visitor(); | |
55 | |
56 virtual void visit(AST *node); | |
57 | |
58 protected: | |
59 virtual void visitAccessSpecifier(AccessSpecifierAST *) {} | |
60 virtual void visitAsmDefinition(AsmDefinitionAST *) {} | |
61 virtual void visitBaseClause(BaseClauseAST *) {} | |
62 virtual void visitBaseSpecifier(BaseSpecifierAST *) {} | |
63 virtual void visitBinaryExpression(BinaryExpressionAST *) {} | |
64 virtual void visitCastExpression(CastExpressionAST *) {} | |
65 virtual void visitClassMemberAccess(ClassMemberAccessAST *) {} | |
66 virtual void visitClassSpecifier(ClassSpecifierAST *) {} | |
67 virtual void visitCompoundStatement(CompoundStatementAST *) {} | |
68 virtual void visitCondition(ConditionAST *) {} | |
69 virtual void visitConditionalExpression(ConditionalExpressionAST *) {} | |
70 virtual void visitCppCastExpression(CppCastExpressionAST *) {} | |
71 virtual void visitCtorInitializer(CtorInitializerAST *) {} | |
72 virtual void visitDeclarationStatement(DeclarationStatementAST *) {} | |
73 virtual void visitDeclarator(DeclaratorAST *) {} | |
74 virtual void visitDeleteExpression(DeleteExpressionAST *) {} | |
75 virtual void visitDoStatement(DoStatementAST *) {} | |
76 virtual void visitElaboratedTypeSpecifier(ElaboratedTypeSpecifierAST *) {} | |
77 virtual void visitEnumSpecifier(EnumSpecifierAST *) {} | |
78 virtual void visitEnumerator(EnumeratorAST *) {} | |
79 virtual void visitExceptionSpecification(ExceptionSpecificationAST *) {} | |
80 virtual void visitExpressionOrDeclarationStatement(ExpressionOrDeclarationStatementAST *) {} | |
81 virtual void visitExpressionStatement(ExpressionStatementAST *) {} | |
82 virtual void visitForStatement(ForStatementAST *) {} | |
83 virtual void visitFunctionCall(FunctionCallAST *) {} | |
84 virtual void visitFunctionDefinition(FunctionDefinitionAST *) {} | |
85 virtual void visitIfStatement(IfStatementAST *) {} | |
86 virtual void visitIncrDecrExpression(IncrDecrExpressionAST *) {} | |
87 virtual void visitInitDeclarator(InitDeclaratorAST *) {} | |
88 virtual void visitInitializer(InitializerAST *) {} | |
89 virtual void visitInitializerClause(InitializerClauseAST *) {} | |
90 virtual void visitLabeledStatement(LabeledStatementAST *) {} | |
91 virtual void visitLinkageBody(LinkageBodyAST *) {} | |
92 virtual void visitLinkageSpecification(LinkageSpecificationAST *) {} | |
93 virtual void visitMemInitializer(MemInitializerAST *) {} | |
94 virtual void visitName(NameAST *) {} | |
95 virtual void visitNamespace(NamespaceAST *) {} | |
96 virtual void visitNamespaceAliasDefinition(NamespaceAliasDefinitionAST *) {} | |
97 virtual void visitNewDeclarator(NewDeclaratorAST *) {} | |
98 virtual void visitNewExpression(NewExpressionAST *) {} | |
99 virtual void visitNewInitializer(NewInitializerAST *) {} | |
100 virtual void visitNewTypeId(NewTypeIdAST *) {} | |
101 virtual void visitOperator(OperatorAST *) {} | |
102 virtual void visitOperatorFunctionId(OperatorFunctionIdAST *) {} | |
103 virtual void visitParameterDeclaration(ParameterDeclarationAST *) {} | |
104 virtual void visitParameterDeclarationClause(ParameterDeclarationClauseAST *) {} | |
105 virtual void visitPostfixExpression(PostfixExpressionAST *) {} | |
106 virtual void visitPrimaryExpression(PrimaryExpressionAST *) {} | |
107 virtual void visitPtrOperator(PtrOperatorAST *) {} | |
108 virtual void visitPtrToMember(PtrToMemberAST *) {} | |
109 virtual void visitReturnStatement(ReturnStatementAST *) {} | |
110 virtual void visitSimpleDeclaration(SimpleDeclarationAST *) {} | |
111 virtual void visitSimpleTypeSpecifier(SimpleTypeSpecifierAST *) {} | |
112 virtual void visitSizeofExpression(SizeofExpressionAST *) {} | |
113 virtual void visitStringLiteral(StringLiteralAST *) {} | |
114 virtual void visitSubscriptExpression(SubscriptExpressionAST *) {} | |
115 virtual void visitSwitchStatement(SwitchStatementAST *) {} | |
116 virtual void visitTemplateArgument(TemplateArgumentAST *) {} | |
117 virtual void visitTemplateDeclaration(TemplateDeclarationAST *) {} | |
118 virtual void visitTemplateParameter(TemplateParameterAST *) {} | |
119 virtual void visitThrowExpression(ThrowExpressionAST *) {} | |
120 virtual void visitTranslationUnit(TranslationUnitAST *) {} | |
121 virtual void visitTryBlockStatement(TryBlockStatementAST *) {} | |
122 virtual void visitTypeId(TypeIdAST *) {} | |
123 virtual void visitTypeIdentification(TypeIdentificationAST *) {} | |
124 virtual void visitTypeParameter(TypeParameterAST *) {} | |
125 virtual void visitTypedef(TypedefAST *) {} | |
126 virtual void visitUnaryExpression(UnaryExpressionAST *) {} | |
127 virtual void visitUnqualifiedName(UnqualifiedNameAST *) {} | |
128 virtual void visitUsing(UsingAST *) {} | |
129 virtual void visitUsingDirective(UsingDirectiveAST *) {} | |
130 virtual void visitWhileStatement(WhileStatementAST *) {} | |
131 virtual void visitWinDeclSpec(WinDeclSpecAST *) {} | |
132 virtual void visitQProperty(QPropertyAST *) {} | |
133 virtual void visitForwardDeclarationSpecifier(ForwardDeclarationSpecifierAST *) {} | |
134 virtual void visitQEnums(QEnumsAST *) {} | |
135 | |
136 private: | |
137 typedef void (Visitor::*visitor_fun_ptr)(AST *); | |
138 static visitor_fun_ptr _S_table[]; | |
139 }; | |
140 | |
141 template <class _Tp> | |
142 void visitNodes(Visitor *v, const ListNode<_Tp> *nodes) | |
143 { | |
144 if (!nodes) | |
145 return; | |
146 | |
147 const ListNode<_Tp> | |
148 *it = nodes->toFront(), | |
149 *end = it; | |
150 | |
151 do | |
152 { | |
153 v->visit(it->element); | |
154 it = it->next; | |
155 } | |
156 while (it != end); | |
157 } | |
158 | |
159 #endif // VISITOR_H | |
160 | |
161 // kate: space-indent on; indent-width 2; replace-tabs on; |