~ubuntu-branches/debian/sid/kdevelop/sid

« back to all changes in this revision

Viewing changes to languages/cpp/codegen/ast/astchange.h

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy Lainé
  • Date: 2010-05-05 07:21:55 UTC
  • mfrom: (1.2.3 upstream) (5.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100505072155-h78lx19pu04sbhtn
Tags: 4:4.0.0-2
* Upload to unstable (Closes: #579947, #481832).
* Acknowledge obsolete NMU fixes (Closes: #562410, #546961).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
   Copyright 2008 Hamish Rodda <rodda@kde.org>
 
3
 
 
4
   This library is free software; you can redistribute it and/or
 
5
   modify it under the terms of the GNU Library General Public
 
6
   License version 2 as published by the Free Software Foundation.
 
7
 
 
8
   This library is distributed in the hope that it will be useful,
 
9
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
11
   Library General Public License for more details.
 
12
 
 
13
   You should have received a copy of the GNU Library General Public License
 
14
   along with this library; see the file COPYING.LIB.  If not, write to
 
15
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
16
   Boston, MA 02110-1301, USA.
 
17
*/
 
18
 
 
19
#ifndef ASTCHANGE_H
 
20
#define ASTCHANGE_H
 
21
 
 
22
#include <language/codegen/astchangeset.h>
 
23
 
 
24
#include "ast.h"
 
25
 
 
26
class AccessSpecifierChange;
 
27
class AsmDefinitionChange;
 
28
class BaseClauseChange;
 
29
class BaseSpecifierChange;
 
30
class BinaryExpressionChange;
 
31
class CastExpressionChange;
 
32
class ClassMemberAccessChange;
 
33
class ClassSpecifierChange;
 
34
class CompoundStatementChange;
 
35
class ConditionChange;
 
36
class ConditionalExpressionChange;
 
37
class CppCastExpressionChange;
 
38
class CtorInitializerChange;
 
39
class DeclarationChange;
 
40
class DeclarationStatementChange;
 
41
class DeclaratorChange;
 
42
class DeleteExpressionChange;
 
43
class DoStatementChange;
 
44
class ElaboratedTypeSpecifierChange;
 
45
class EnumSpecifierChange;
 
46
class EnumeratorChange;
 
47
class ExceptionSpecificationChange;
 
48
class ExpressionChange;
 
49
class ExpressionOrDeclarationStatementChange;
 
50
class ExpressionStatementChange;
 
51
class ForStatementChange;
 
52
class FunctionCallChange;
 
53
class FunctionDefinitionChange;
 
54
class IfStatementChange;
 
55
class IncrDecrExpressionChange;
 
56
class InitDeclaratorChange;
 
57
class InitializerChange;
 
58
class InitializerClauseChange;
 
59
class JumpStatementChange;
 
60
class LabeledStatementChange;
 
61
class LinkageBodyChange;
 
62
class LinkageSpecificationChange;
 
63
class MemInitializerChange;
 
64
class NameChange;
 
65
class NamespaceChange;
 
66
class NamespaceAliasDefinitionChange;
 
67
class NewDeclaratorChange;
 
68
class NewExpressionChange;
 
69
class NewInitializerChange;
 
70
class NewTypeIdChange;
 
71
class OperatorChange;
 
72
class OperatorFunctionIdChange;
 
73
class ParameterDeclarationChange;
 
74
class ParameterDeclarationClauseChange;
 
75
class PostfixExpressionChange;
 
76
class PrimaryExpressionChange;
 
77
class PtrOperatorChange;
 
78
class PtrToMemberChange;
 
79
class ReturnStatementChange;
 
80
class SimpleDeclarationChange;
 
81
class SimpleTypeSpecifierChange;
 
82
class SizeofExpressionChange;
 
83
class StatementChange;
 
84
class StringLiteralChange;
 
85
class SubscriptExpressionChange;
 
86
class SwitchStatementChange;
 
87
class SignalSlotExpressionChange;
 
88
class TemplateArgumentChange;
 
89
class TemplateDeclarationChange;
 
90
class TemplateParameterChange;
 
91
class ThrowExpressionChange;
 
92
class TranslationUnitChange;
 
93
class TryBlockStatementChange;
 
94
class CatchStatementChange;
 
95
class TypeIdChange;
 
96
class TypeIdentificationChange;
 
97
class TypeParameterChange;
 
98
class TypeSpecifierChange;
 
99
class TypedefChange;
 
100
class UnaryExpressionChange;
 
101
class UnqualifiedNameChange;
 
102
class UsingChange;
 
103
class UsingDirectiveChange;
 
104
class WhileStatementChange;
 
105
class WinDeclSpecChange;
 
106
 
 
107
class Change
 
108
{
 
109
};
 
110
 
 
111
template <typename BaseChange, typename AstNode, typename AstChange>
 
112
class ListChange
 
113
{
 
114
public:
 
115
  ListChange(BaseChange* change);
 
116
 
 
117
  bool hasChanges();
 
118
 
 
119
  int count() const;
 
120
  AstNode* nodeAt(int index) const;
 
121
  AstChange* changeAt(int index) const;
 
122
 
 
123
  void clear();
 
124
  void insert(AstChange* change, int index);
 
125
  void append(AstChange* change);
 
126
  AstChange* change(int index);
 
127
  void remove(AstNode* node);
 
128
  void remove(AstChange* change);
 
129
 
 
130
private:
 
131
  BaseChange* m_change;
 
132
};
 
133
 
 
134
class UnqualifiedNameChange : public Change, public KDevelop::AstNodeRef<UnqualifiedNameAST>
 
135
{
 
136
  void setTilde(bool hasTilde);
 
137
  void setId(bool hasId);
 
138
  //OperatorFunctionIdChange* operatorId();
 
139
  //ListChange<UnqualifiedNameChange, TemplateArgumentAST, TemplateArgumentChange> templateArguments;
 
140
};
 
141
 
 
142
class NameChange : public Change, public KDevelop::AstNodeRef<NameAST>
 
143
{
 
144
  void setGlobal(bool global);
 
145
  ListChange<NameChange, UnqualifiedNameAST, UnqualifiedNameChange> qualifiedNames;
 
146
  UnqualifiedNameChange* changeUnqualifiedName();
 
147
};
 
148
 
 
149
class BaseClauseChange : public Change, public KDevelop::AstNodeRef<BaseClauseAST>
 
150
{
 
151
public:
 
152
  ListChange<BaseClauseChange, BaseSpecifierAST, BaseSpecifierChange> baseSpecifiers;
 
153
};
 
154
 
 
155
class BaseSpecifierChange : public Change, public KDevelop::AstNodeRef<BaseSpecifierAST>
 
156
{
 
157
public:
 
158
  bool isVirtual() const;
 
159
  void setVirtual(bool isVirtual);
 
160
 
 
161
  int accessSpecifier() const;
 
162
  void setAccessSpecifier(int token);
 
163
 
 
164
  NameChange* changeName();
 
165
};
 
166
 
 
167
class DeclarationChange
 
168
{
 
169
public:
 
170
  DeclarationChange();
 
171
 
 
172
  /*AccessSpecifierChange* accessSpecifier();
 
173
  AsmDefinitionChange* asmDefinition();
 
174
  FunctionDefinitionChange* functionDefinition();
 
175
  LinkageSpecificationChange* linkageSpecification();
 
176
  NamespaceChange* namespaceChange();
 
177
  NamespaceAliasDefinitionChange* namespaceAliasDefinition();
 
178
  SimpleDeclarationChange* simpleDeclaration();
 
179
  TemplateDeclarationChange* templateDeclaration();
 
180
  TypedefChange* typedefChange();
 
181
  UsingChange* usingChange();*/
 
182
};
 
183
 
 
184
class ClassSpecifierChange : public Change, public KDevelop::AstNodeRef<ClassSpecifierAST>
 
185
{
 
186
public:
 
187
  //WinDeclSpecChange* changeWinDeclSpec();
 
188
  void newClassKey(std::size_t class_key);
 
189
 
 
190
  NameChange* changeName();
 
191
  BaseClauseChange* changeBaseClause();
 
192
 
 
193
  ListChange<ClassSpecifierChange, DeclarationAST, DeclarationChange> members;
 
194
};
 
195
 
 
196
#endif // ASTCHANGE_H