1
/****************************************************************************
3
** Copyright (C) 2004-2005 Trolltech AS. All rights reserved.
4
** Copyright (C) 2001-2004 Roberto Raggi
6
** This file is part of the porting application of the Qt Toolkit.
8
** This file may be distributed under the terms of the Q Public License
9
** as defined by Trolltech AS of Norway and appearing in the file
10
** LICENSE.QPL included in the packaging of this file.
12
** This file may be distributed and/or modified under the terms of the
13
** GNU General Public License version 2 as published by the Free Software
14
** Foundation and appearing in the file LICENSE.GPL included in the
15
** packaging of this file.
17
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
18
** information about Qt Commercial License Agreements.
19
** See http://www.trolltech.com/qpl/ for QPL licensing information.
20
** See http://www.trolltech.com/gpl/ for GPL licensing information.
22
** Contact info@trolltech.com if any conditions of this licensing are
25
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
28
****************************************************************************/
31
#include <qstringlist.h>
35
// ------------------------------------------------------------------------
36
AST::AST(int startToken, int count)
38
m_startToken(startToken),
39
m_endToken(startToken + count),
46
void AST::setParent(AST *parent)
49
m_parent->removeChild(this);
54
m_parent->appendChild(this);
57
void AST::appendChild(AST *child)
59
m_children = snoc(m_children, child, _pool);
62
void AST::removeChild(AST *child)
64
fprintf(stderr, "AST::removeChild child: %p not implemented yet\n", child);
67
// ------------------------------------------------------------------------
69
: m_global(false), m_unqualifiedName(0), m_classOrNamespaceNameList(0)
73
void NameAST::setGlobal(bool b)
78
void NameAST::setUnqualifiedName(ClassOrNamespaceNameAST *unqualifiedName)
80
m_unqualifiedName = unqualifiedName;
81
if (m_unqualifiedName) m_unqualifiedName->setParent(this);
84
void NameAST::addClassOrNamespaceName(ClassOrNamespaceNameAST *classOrNamespaceName)
86
if(!classOrNamespaceName)
89
classOrNamespaceName->setParent(this);
90
m_classOrNamespaceNameList = snoc(m_classOrNamespaceNameList, classOrNamespaceName, _pool);
93
// ------------------------------------------------------------------------
94
DeclarationAST::DeclarationAST()
98
// ------------------------------------------------------------------------
99
LinkageBodyAST::LinkageBodyAST()
100
: m_declarationList(0)
104
void LinkageBodyAST::addDeclaration(DeclarationAST *ast)
109
ast->setParent(this);
110
m_declarationList = snoc(m_declarationList, ast, _pool);
113
// ------------------------------------------------------------------------
114
LinkageSpecificationAST::LinkageSpecificationAST()
121
void LinkageSpecificationAST::setExternType(AST *externType)
123
m_externType = externType;
124
if (m_externType) m_externType->setParent(this);
127
void LinkageSpecificationAST::setLinkageBody(LinkageBodyAST *linkageBody)
129
m_linkageBody = linkageBody;
130
if (m_linkageBody) m_linkageBody->setParent(this);
133
void LinkageSpecificationAST::setDeclaration(DeclarationAST *decl)
135
m_declaration = decl;
136
if (m_declaration) m_declaration->setParent(this);
139
// ------------------------------------------------------------------------
140
TranslationUnitAST::TranslationUnitAST()
141
: m_declarationList(0)
143
//kdDebug(9007) << "++ TranslationUnitAST::TranslationUnitAST()" << endl;
146
void TranslationUnitAST::addDeclaration(DeclarationAST *ast)
151
ast->setParent(this);
152
m_declarationList = snoc(m_declarationList, ast, _pool);
155
// ------------------------------------------------------------------------
156
NamespaceAST::NamespaceAST()
157
: m_namespaceName(0),
162
void NamespaceAST::setNamespaceName(AST *namespaceName)
164
m_namespaceName = namespaceName;
165
if (m_namespaceName) m_namespaceName->setParent(this);
168
void NamespaceAST::setLinkageBody(LinkageBodyAST *linkageBody)
170
m_linkageBody = linkageBody;
171
if (m_linkageBody) m_linkageBody->setParent(this);
175
// ------------------------------------------------------------------------
176
NamespaceAliasAST::NamespaceAliasAST()
177
: m_namespaceName(0),
182
void NamespaceAliasAST::setNamespaceName(AST *namespaceName)
184
m_namespaceName = namespaceName;
185
if (m_namespaceName) m_namespaceName->setParent(this);
188
void NamespaceAliasAST::setAliasName(NameAST *name)
191
if (m_aliasName) m_aliasName->setParent(this);
194
// ------------------------------------------------------------------------
201
void UsingAST::setTypeName(AST *typeName)
203
m_typeName = typeName;
204
if (m_typeName) m_typeName->setParent(this);
207
void UsingAST::setName(NameAST *name)
210
if (m_name) m_name->setParent(this);
213
// ------------------------------------------------------------------------
214
UsingDirectiveAST::UsingDirectiveAST()
219
void UsingDirectiveAST::setName(NameAST *name)
222
if (m_name) m_name->setParent(this);
225
TypedefAST::TypedefAST()
227
m_initDeclaratorList(0)
231
void TypeSpecifierAST::setName(NameAST *name)
234
if (m_name) m_name->setParent(this);
237
void TypedefAST::setTypeSpec(TypeSpecifierAST *typeSpec)
239
m_typeSpec = typeSpec;
240
if (m_typeSpec) m_typeSpec->setParent(this);
243
void TypedefAST::setInitDeclaratorList(InitDeclaratorListAST *initDeclaratorList)
245
m_initDeclaratorList = initDeclaratorList;
246
if (m_initDeclaratorList) m_initDeclaratorList->setParent(this);
249
// ------------------------------------------------------------------------
250
TemplateArgumentListAST::TemplateArgumentListAST()
255
void TemplateArgumentListAST::addArgument(AST *arg)
260
arg->setParent(this);
261
m_argumentList = snoc(m_argumentList, arg, _pool);
264
// ------------------------------------------------------------------------
265
TemplateDeclarationAST::TemplateDeclarationAST()
267
m_templateParameterList(0),
272
void TemplateDeclarationAST::setExported(AST *exported)
274
m_exported = exported;
275
if (m_exported) m_exported->setParent(this);
278
void TemplateDeclarationAST::setTemplateParameterList(TemplateParameterListAST *templateParameterList)
280
m_templateParameterList = templateParameterList;
281
if (m_templateParameterList) m_templateParameterList->setParent(this);
284
void TemplateDeclarationAST::setDeclaration(DeclarationAST *declaration)
286
m_declaration = declaration;
287
if (m_declaration) m_declaration->setParent(this);
290
// ------------------------------------------------------------------------
291
ClassOrNamespaceNameAST::ClassOrNamespaceNameAST()
292
: m_name(0), m_templateArgumentList(0)
296
void ClassOrNamespaceNameAST::setName(AST *name)
299
if (m_name) m_name->setParent(this);
302
void ClassOrNamespaceNameAST::setTemplateArgumentList(TemplateArgumentListAST *templateArgumentList)
304
m_templateArgumentList = templateArgumentList;
305
if (m_templateArgumentList) m_templateArgumentList->setParent(this);
308
// ------------------------------------------------------------------------
309
TypeSpecifierAST::TypeSpecifierAST()
310
: m_name(0), m_cvQualify(0), m_cv2Qualify(0)
315
void TypeSpecifierAST::setCvQualify(AST *cvQualify)
317
m_cvQualify = cvQualify;
318
if (m_cvQualify) m_cvQualify->setParent(this);
321
void TypeSpecifierAST::setCv2Qualify(AST *cv2Qualify)
323
m_cv2Qualify = cv2Qualify;
324
if (m_cv2Qualify) m_cv2Qualify->setParent(this);
327
// ------------------------------------------------------------------------
328
ClassSpecifierAST::ClassSpecifierAST()
336
void ClassSpecifierAST::setClassKey(AST *classKey)
338
m_classKey = classKey;
339
if (m_classKey) m_classKey->setParent(this);
342
void ClassSpecifierAST::addDeclaration(DeclarationAST *declaration)
347
declaration->setParent(this);
348
m_declarationList = snoc(m_declarationList, declaration, _pool);
351
void ClassSpecifierAST::setBaseClause(BaseClauseAST *baseClause)
353
m_baseClause = baseClause;
354
if (m_baseClause) m_baseClause->setParent(this);
357
// ------------------------------------------------------------------------
358
EnumSpecifierAST::EnumSpecifierAST()
359
: m_enumeratorList(0)
363
void EnumSpecifierAST::addEnumerator(EnumeratorAST *enumerator)
368
enumerator->setParent(this);
369
m_enumeratorList = snoc(m_enumeratorList, enumerator, _pool);
373
// ------------------------------------------------------------------------
374
ElaboratedTypeSpecifierAST::ElaboratedTypeSpecifierAST()
379
void ElaboratedTypeSpecifierAST::setKind(AST *kind)
382
if (m_kind) m_kind->setParent(this);
385
// ------------------------------------------------------------------------
386
EnumeratorAST::EnumeratorAST()
392
void EnumeratorAST::setId(AST *id)
395
if (m_id) m_id->setParent(this);
398
void EnumeratorAST::setExpression(AbstractExpressionAST *expression)
400
m_expression = expression;
401
if (m_expression) m_expression->setParent(this);
404
// ------------------------------------------------------------------------
405
BaseClauseAST::BaseClauseAST()
406
: m_baseSpecifierList(0)
410
void BaseClauseAST::addBaseSpecifier(BaseSpecifierAST *baseSpecifier)
415
baseSpecifier->setParent(this);
416
m_baseSpecifierList = snoc(m_baseSpecifierList, baseSpecifier, _pool);
419
// ------------------------------------------------------------------------
420
BaseSpecifierAST::BaseSpecifierAST()
421
: m_isVirtual(0), m_access(0), m_name(0)
426
void BaseSpecifierAST::setIsVirtual(AST *isVirtual)
428
m_isVirtual = isVirtual;
429
if (m_isVirtual) m_isVirtual->setParent(this);
432
void BaseSpecifierAST::setAccess(AST *access)
435
if (m_access) m_access->setParent(this);
438
void BaseSpecifierAST::setName(NameAST *name)
441
if (m_name) m_name->setParent(this);
444
// ------------------------------------------------------------------------
445
SimpleDeclarationAST::SimpleDeclarationAST()
446
: m_functionSpecifier(0),
447
m_storageSpecifier(0),
449
m_initDeclaratorList(0),
454
void SimpleDeclarationAST::setFunctionSpecifier(AST *functionSpecifier)
456
m_functionSpecifier = functionSpecifier;
457
if (m_functionSpecifier) m_functionSpecifier->setParent(this);
460
void SimpleDeclarationAST::setStorageSpecifier(AST *storageSpecifier)
462
m_storageSpecifier = storageSpecifier;
463
if (m_storageSpecifier) m_storageSpecifier->setParent(this);
466
void SimpleDeclarationAST::setTypeSpec(TypeSpecifierAST *typeSpec)
468
m_typeSpec = typeSpec;
469
if (m_typeSpec) m_typeSpec->setParent(this);
472
void SimpleDeclarationAST::setInitDeclaratorList(InitDeclaratorListAST *initDeclaratorList)
474
m_initDeclaratorList = initDeclaratorList;
475
if (m_initDeclaratorList) m_initDeclaratorList->setParent(this);
478
void SimpleDeclarationAST::setWinDeclSpec(AST *winDeclSpec)
480
m_winDeclSpec = winDeclSpec;
481
if (m_winDeclSpec) m_winDeclSpec->setParent(this);
484
// ------------------------------------------------------------------------
485
InitDeclaratorListAST::InitDeclaratorListAST()
486
: m_initDeclaratorList(0)
490
void InitDeclaratorListAST::addInitDeclarator(InitDeclaratorAST *decl)
495
decl->setParent(this);
496
m_initDeclaratorList = snoc(m_initDeclaratorList, decl, _pool);
499
// ------------------------------------------------------------------------
500
DeclaratorAST::DeclaratorAST()
504
m_bitfieldInitialization(0),
505
m_arrayDimensionList(0),
506
m_parameterDeclarationClause(0),
508
m_exceptionSpecification(0)
512
void DeclaratorAST::setSubDeclarator(DeclaratorAST *subDeclarator)
514
m_subDeclarator = subDeclarator;
515
if (m_subDeclarator) m_subDeclarator->setParent(this);
518
void DeclaratorAST::setDeclaratorId(NameAST *declaratorId)
520
m_declaratorId = declaratorId;
521
if (m_declaratorId) m_declaratorId->setParent(this);
524
void DeclaratorAST::setBitfieldInitialization(AST *bitfieldInitialization)
526
m_bitfieldInitialization = bitfieldInitialization;
527
if (m_bitfieldInitialization) m_bitfieldInitialization->setParent(this);
530
void DeclaratorAST::addArrayDimension(AST *arrayDimension)
535
arrayDimension->setParent(this);
536
m_arrayDimensionList = snoc(m_arrayDimensionList, arrayDimension, _pool);
539
void DeclaratorAST::setParameterDeclarationClause(ParameterDeclarationClauseAST *parameterDeclarationClause)
541
m_parameterDeclarationClause = parameterDeclarationClause;
542
if (m_parameterDeclarationClause) m_parameterDeclarationClause->setParent(this);
545
void DeclaratorAST::setConstant(AST *constant)
547
m_constant = constant;
548
if (m_constant) m_constant->setParent(this);
551
void DeclaratorAST::setExceptionSpecification(AST *exceptionSpecification)
553
m_exceptionSpecification = exceptionSpecification;
554
if (m_exceptionSpecification) m_exceptionSpecification->setParent(this);
557
void DeclaratorAST::addPtrOp(AST *ptrOp)
562
ptrOp->setParent(this);
563
m_ptrOpList = snoc(m_ptrOpList, ptrOp, _pool);
566
// --------------------------------------------------------------------------
567
InitDeclaratorAST::InitDeclaratorAST()
573
void InitDeclaratorAST::setDeclarator(DeclaratorAST *declarator)
575
m_declarator = declarator;
576
if (m_declarator) m_declarator->setParent(this);
579
void InitDeclaratorAST::setInitializer(AST *initializer)
581
m_initializer = initializer;
582
if (m_initializer) m_initializer->setParent(this);
585
// --------------------------------------------------------------------------
586
FunctionDefinitionAST::FunctionDefinitionAST()
587
: m_functionSpecifier(0),
588
m_storageSpecifier(0),
596
void FunctionDefinitionAST::setFunctionSpecifier(AST *functionSpecifier)
598
m_functionSpecifier = functionSpecifier;
599
if (m_functionSpecifier) m_functionSpecifier->setParent(this);
602
void FunctionDefinitionAST::setStorageSpecifier(AST *storageSpecifier)
604
m_storageSpecifier = storageSpecifier;
605
if (m_storageSpecifier) m_storageSpecifier->setParent(this);
608
void FunctionDefinitionAST::setTypeSpec(TypeSpecifierAST *typeSpec)
610
m_typeSpec = typeSpec;
611
if (m_typeSpec) m_typeSpec->setParent(this);
614
void FunctionDefinitionAST::setInitDeclarator(InitDeclaratorAST *initDeclarator)
616
m_initDeclarator = initDeclarator;
617
if (m_initDeclarator) m_initDeclarator->setParent(this);
620
void FunctionDefinitionAST::setFunctionBody(StatementListAST *functionBody)
622
m_functionBody = functionBody;
623
if (m_functionBody) m_functionBody->setParent(this);
626
void FunctionDefinitionAST::setWinDeclSpec(AST *winDeclSpec)
628
m_winDeclSpec = winDeclSpec;
629
if (m_winDeclSpec) m_winDeclSpec->setParent(this);
632
// --------------------------------------------------------------------------
633
StatementListAST::StatementListAST()
638
void StatementListAST::addStatement(StatementAST *statement)
643
statement->setParent(this);
644
m_statementList = snoc(m_statementList, statement, _pool);
647
// --------------------------------------------------------------------------
648
IfStatementAST::IfStatementAST()
655
void IfStatementAST::setCondition(ConditionAST *condition)
657
m_condition = condition;
658
if (m_condition) m_condition->setParent(this);
661
void IfStatementAST::setStatement(StatementAST *statement)
663
m_statement = statement;
664
if (m_statement) m_statement->setParent(this);
667
void IfStatementAST::setElseStatement(StatementAST *elseStatement)
669
m_elseStatement = elseStatement;
670
if (m_elseStatement) m_elseStatement->setParent(this);
673
// --------------------------------------------------------------------------
674
WhileStatementAST::WhileStatementAST()
680
void WhileStatementAST::setCondition(ConditionAST *condition)
682
m_condition = condition;
683
if (m_condition) m_condition->setParent(this);
686
void WhileStatementAST::setStatement(StatementAST *statement)
688
m_statement = statement;
689
if (m_statement) m_statement->setParent(this);
692
// --------------------------------------------------------------------------
693
DoStatementAST::DoStatementAST()
699
void DoStatementAST::setCondition(ConditionAST *condition)
701
m_condition = condition;
702
if (m_condition) m_condition->setParent(this);
705
void DoStatementAST::setStatement(StatementAST *statement)
707
m_statement = statement;
708
if (m_statement) m_statement->setParent(this);
711
// --------------------------------------------------------------------------
712
ForStatementAST::ForStatementAST()
720
void ForStatementAST::setCondition(ConditionAST *condition)
722
m_condition = condition;
723
if (m_condition) m_condition->setParent(this);
726
void ForStatementAST::setExpression(AbstractExpressionAST *expression)
728
m_expression = expression;
729
if (m_expression) m_expression->setParent(this);
732
void ForStatementAST::setStatement(StatementAST *statement)
734
m_statement = statement;
735
if (m_statement) m_statement->setParent(this);
738
void ForStatementAST::setInitStatement(StatementAST *initStatement)
740
m_initStatement = initStatement;
741
if (m_initStatement) m_initStatement->setParent(this);
744
// --------------------------------------------------------------------------
745
SwitchStatementAST::SwitchStatementAST()
751
void SwitchStatementAST::setCondition(ConditionAST *condition)
753
m_condition = condition;
754
if (m_condition) m_condition->setParent(this);
757
void SwitchStatementAST::setStatement(StatementAST *statement)
759
m_statement = statement;
760
if (m_statement) m_statement->setParent(this);
763
// --------------------------------------------------------------------------
764
DeclarationStatementAST::DeclarationStatementAST()
769
void DeclarationStatementAST::setDeclaration(DeclarationAST *declaration)
771
m_declaration = declaration;
772
if (m_declaration) m_declaration->setParent(this);
775
// --------------------------------------------------------------------------
776
ExpressionStatementAST::ExpressionStatementAST()
781
void ExpressionStatementAST::setExpression(AbstractExpressionAST *expression)
783
m_expression = expression;
784
if (m_expression) m_expression->setParent(this);
788
// --------------------------------------------------------------------------
789
ParameterDeclarationAST::ParameterDeclarationAST()
796
void ParameterDeclarationAST::setTypeSpec(TypeSpecifierAST *typeSpec)
798
m_typeSpec = typeSpec;
799
if (m_typeSpec) m_typeSpec->setParent(this);
802
void ParameterDeclarationAST::setDeclarator(DeclaratorAST *declarator)
804
m_declarator = declarator;
805
if (m_declarator) m_declarator->setParent(this);
808
void ParameterDeclarationAST::setExpression(AbstractExpressionAST *expression)
810
m_expression = expression;
811
if (m_expression) m_expression->setParent(this);
814
// --------------------------------------------------------------------------
815
ParameterDeclarationListAST::ParameterDeclarationListAST()
820
void ParameterDeclarationListAST::addParameter(ParameterDeclarationAST *parameter)
825
parameter->setParent(this);
826
m_parameterList = snoc(m_parameterList, parameter, _pool);
829
// --------------------------------------------------------------------------
830
ParameterDeclarationClauseAST::ParameterDeclarationClauseAST()
831
: m_parameterDeclarationList(0),
836
void ParameterDeclarationClauseAST::setParameterDeclarationList(ParameterDeclarationListAST *parameterDeclarationList)
838
m_parameterDeclarationList = parameterDeclarationList;
839
if (m_parameterDeclarationList) m_parameterDeclarationList->setParent(this);
842
void ParameterDeclarationClauseAST::setEllipsis(AST *ellipsis)
844
m_ellipsis = ellipsis;
845
if (m_ellipsis) m_ellipsis->setParent(this);
848
// --------------------------------------------------------------------------
849
AccessDeclarationAST::AccessDeclarationAST()
854
void AccessDeclarationAST::addAccess(AST *access)
859
access->setParent(this);
860
m_accessList = snoc(m_accessList, access, _pool);
863
// --------------------------------------------------------------------------
864
TypeParameterAST::TypeParameterAST()
865
: m_kind(0), m_templateParameterList(0),
866
m_name(0), m_typeId(0)
871
void TypeParameterAST::setKind(AST *kind)
876
void TypeParameterAST::setTemplateParameterList(TemplateParameterListAST *templateParameterList)
878
m_templateParameterList = templateParameterList;
879
if (m_templateParameterList) m_templateParameterList->setParent(this);
882
void TypeParameterAST::setName(NameAST *name)
885
if (m_name) m_name->setParent(this);
888
void TypeParameterAST::setTypeId(AST *typeId)
891
if (m_typeId) m_typeId->setParent(this);
894
// --------------------------------------------------------------------------
895
TemplateParameterAST::TemplateParameterAST()
896
: m_typeParameter(0),
897
m_typeValueParameter(0)
901
void TemplateParameterAST::setTypeParameter(TypeParameterAST *typeParameter)
903
m_typeParameter = typeParameter;
904
if (m_typeParameter) m_typeParameter->setParent(this);
907
void TemplateParameterAST::setTypeValueParameter(ParameterDeclarationAST *typeValueParameter)
909
m_typeValueParameter = typeValueParameter;
910
if (m_typeValueParameter) m_typeValueParameter->setParent(this);
913
// --------------------------------------------------------------------------
914
TemplateParameterListAST::TemplateParameterListAST()
915
: m_templateParameterList(0)
919
void TemplateParameterListAST::addTemplateParameter(TemplateParameterAST *templateParameter)
921
if(!templateParameter)
924
templateParameter->setParent(this);
925
m_templateParameterList = snoc(m_templateParameterList, templateParameter, _pool);
928
// --------------------------------------------------------------------------
929
ConditionAST::ConditionAST()
936
void ConditionAST::setTypeSpec(TypeSpecifierAST *typeSpec)
938
m_typeSpec = typeSpec;
939
if (m_typeSpec) m_typeSpec->setParent(this);
942
void ConditionAST::setDeclarator(DeclaratorAST *declarator)
944
m_declarator = declarator;
945
if (m_declarator) m_declarator->setParent(this);
948
void ConditionAST::setExpression(AbstractExpressionAST *expression)
950
m_expression = expression;
951
if (m_expression) m_expression->setParent(this);
954
void ClassSpecifierAST::setWinDeclSpec(AST *winDeclSpec)
956
m_winDeclSpec = winDeclSpec;
957
if (m_winDeclSpec) m_winDeclSpec->setParent(this);
960
// --------------------------------------------------------------------------
961
ReturnStatementAST::ReturnStatementAST()
966
void ReturnStatementAST::setExpression(AbstractExpressionAST *expression)
968
m_expression = expression;
969
if (m_expression) m_expression->setParent(this);
972
// --------------------------------------------------------------------------
973
BinaryExpressionAST::BinaryExpressionAST()
974
: m_op(0), m_left(0), m_right(0)
978
void BinaryExpressionAST::setOp(AST *op)
982
m_op->setParent(this);
985
void BinaryExpressionAST::setLeftExpression(AbstractExpressionAST *left)
989
m_left->setParent(this);
992
void BinaryExpressionAST::setRightExpression(AbstractExpressionAST *right)
996
m_right->setParent(this);
999
// --------------------------------------------------------------------------
1000
ConditionalExpressionAST::ConditionalExpressionAST()
1001
: m_condition(0), m_left(0), m_right(0)
1005
void ConditionalExpressionAST::setCondition(AbstractExpressionAST *condition)
1007
m_condition = condition;
1009
m_condition->setParent(this);
1012
void ConditionalExpressionAST::setLeftExpression(AbstractExpressionAST *left)
1016
m_left->setParent(this);
1019
void ConditionalExpressionAST::setRightExpression(AbstractExpressionAST *right)
1023
m_right->setParent(this);
1026
// --------------------------------------------------------------------------
1027
CppCastExpressionAST::CppCastExpressionAST()
1028
: m_castOp(0), m_typeId(0), m_expression(0)
1032
void CppCastExpressionAST::setCastOp(AST *castOp)
1036
m_castOp->setParent(this);
1039
void CppCastExpressionAST::setTypeId(AST *typeId)
1043
m_typeId->setParent(this);
1046
void CppCastExpressionAST::setExpression(AbstractExpressionAST *expression)
1048
m_expression = expression;
1050
m_expression->setParent(this);
1053
// --------------------------------------------------------------------------
1054
SubscriptingAST::SubscriptingAST()
1055
: m_expression(0), m_subscript(0)
1059
void SubscriptingAST::setSubscript(AbstractExpressionAST *subscript)
1061
m_subscript = subscript;
1063
m_subscript->setParent(this);
1066
void SubscriptingAST::setExpression(AbstractExpressionAST *expression)
1068
m_expression = expression;
1070
m_expression->setParent(this);
1073
// --------------------------------------------------------------------------
1074
FunctionCallAST::FunctionCallAST()
1075
: m_expression(0), m_arguments(0)
1079
void FunctionCallAST::setExpression(AbstractExpressionAST *expression)
1081
m_expression = expression;
1083
m_expression->setParent(this);
1086
void FunctionCallAST::setArguments(AbstractExpressionAST *arguments)
1088
m_arguments = arguments;
1090
m_arguments->setParent(this);
1093
// --------------------------------------------------------------------------
1094
ExplicitTypeConversionAST::ExplicitTypeConversionAST()
1098
// --------------------------------------------------------------------------
1099
PseudoDestructorCallAST::PseudoDestructorCallAST()
1103
// --------------------------------------------------------------------------
1104
ClassMemberAccessAST::ClassMemberAccessAST()
1105
: m_op(0), m_expression(0), m_templ(0), m_name(0)
1109
void ClassMemberAccessAST::setOp(AST *op)
1113
m_op->setParent(this);
1116
void ClassMemberAccessAST::setExpression(AbstractExpressionAST *expression)
1118
m_expression = expression;
1120
m_expression->setParent(this);
1123
void ClassMemberAccessAST::setName(NameAST *name)
1127
m_name->setParent(this);
1130
// --------------------------------------------------------------------------
1131
IncrDecrAST::IncrDecrAST()
1132
: m_op(0), m_expression(0)
1136
void IncrDecrAST::setOp(AST *op)
1140
m_op->setParent(this);
1143
void IncrDecrAST::setExpression(AbstractExpressionAST *expression)
1145
m_expression = expression;
1147
m_expression->setParent(this);
1150
// --------------------------------------------------------------------------
1151
TypeIdentificationAST::TypeIdentificationAST()
1155
// --------------------------------------------------------------------------
1156
TypeIdAST::TypeIdAST()
1157
: m_typeSpecifier(0), m_declarator(0)
1161
void TypeIdAST::setTypeSpecifier(TypeSpecifierAST *typeSpecifier)
1163
m_typeSpecifier = typeSpecifier;
1164
if (m_typeSpecifier)
1165
m_typeSpecifier->setParent(this);
1168
void TypeIdAST::setDeclarator(DeclaratorAST *declarator)
1170
m_declarator = declarator;
1172
m_declarator->setParent(this);
1175
// --------------------------------------------------------------------------
1176
AbstractExpressionAST::AbstractExpressionAST()