Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
ca34b0ca
Commit
ca34b0ca
authored
Aug 05, 2009
by
Erik Verbruggen
Browse files
Cleaned the ObjC AST up.
parent
afd9fd82
Changes
15
Hide whitespace changes
Inline
Side-by-side
src/shared/cplusplus/AST.cpp
View file @
ca34b0ca
...
...
@@ -1924,14 +1924,14 @@ unsigned IdentifierListAST::lastToken() const
}
unsigned
ObjCClassDeclarationAST
::
firstToken
()
const
unsigned
ObjCClass
Forward
DeclarationAST
::
firstToken
()
const
{
if
(
attributes
)
return
attributes
->
firstToken
();
return
class_token
;
}
unsigned
ObjCClassDeclarationAST
::
lastToken
()
const
unsigned
ObjCClass
Forward
DeclarationAST
::
lastToken
()
const
{
if
(
semicolon_token
)
return
semicolon_token
+
1
;
...
...
@@ -1941,22 +1941,17 @@ unsigned ObjCClassDeclarationAST::lastToken() const
return
it
->
name
->
lastToken
();
}
for
(
SpecifierAST
*
it
=
attributes
;
it
;
it
=
it
->
next
)
{
if
(
!
it
->
next
)
return
it
->
lastToken
();
}
return
class_token
+
1
;
}
unsigned
ObjCProtocolDeclarationAST
::
firstToken
()
const
unsigned
ObjCProtocol
Forward
DeclarationAST
::
firstToken
()
const
{
if
(
attributes
)
return
attributes
->
firstToken
();
return
protocol_token
;
}
unsigned
ObjCProtocolDeclarationAST
::
lastToken
()
const
unsigned
ObjCProtocol
Forward
DeclarationAST
::
lastToken
()
const
{
if
(
semicolon_token
)
return
semicolon_token
+
1
;
...
...
@@ -1966,69 +1961,52 @@ unsigned ObjCProtocolDeclarationAST::lastToken() const
return
it
->
name
->
lastToken
();
}
for
(
SpecifierAST
*
it
=
attributes
;
it
;
it
=
it
->
next
)
{
if
(
!
it
->
next
)
return
it
->
lastToken
();
}
return
protocol_token
+
1
;
}
unsigned
ObjCClass
InterfaceDefini
tionAST
::
firstToken
()
const
unsigned
ObjCClass
Declara
tionAST
::
firstToken
()
const
{
if
(
attributes
)
return
attributes
->
firstToken
();
return
interface_token
;
if
(
interface_token
)
return
interface_token
;
else
return
implementation_token
;
}
unsigned
ObjCClass
InterfaceDefini
tionAST
::
lastToken
()
const
unsigned
ObjCClass
Declara
tionAST
::
lastToken
()
const
{
if
(
end_token
)
return
end_token
+
1
;
if
(
member_declarations
)
return
member_declarations
->
lastToken
();
if
(
inst_vars_decl
)
return
inst_vars_decl
->
lastToken
();
if
(
superclass_identifier_token
)
return
superclass_identifier_token
+
1
;
if
(
protocol_refs
)
return
protocol_refs
->
lastToken
();
if
(
superclass
)
return
superclass
->
lastToken
();
if
(
colon_token
)
return
colon_token
+
1
;
if
(
rparen_token
)
return
rparen_token
+
1
;
if
(
category_name
)
return
category_name
->
lastToken
();
if
(
lparen_token
)
return
lparen_token
+
1
;
if
(
class_name
)
return
class_name
->
lastToken
();
for
(
SpecifierAST
*
it
=
attributes
;
it
;
it
=
it
->
next
)
{
if
(
!
it
->
next
)
return
it
->
lastToken
();
}
return
interface_token
+
1
;
}
unsigned
ObjCCategoryInterfaceDeclarationAST
::
firstToken
()
const
{
if
(
attributes
)
return
attributes
->
firstToken
();
if
(
interface_token
)
return
interface_token
+
1
;
else
return
i
nterface
_token
;
return
i
mplementation
_token
+
1
;
}
unsigned
ObjCCategoryInterfaceDeclarationAST
::
lastToken
()
const
{
if
(
end_token
)
return
end_token
+
1
;
if
(
member_declarations
)
return
member_declarations
->
lastToken
();
if
(
rparen_token
)
return
rparen_token
+
1
;
if
(
category_identifier_token
)
return
category_identifier_token
+
1
;
if
(
lparen_token
)
return
lparen_token
+
1
;
if
(
class_identifier_token
)
return
class_identifier_token
+
1
;
return
interface_token
+
1
;
}
unsigned
ObjCProtocolDefinitionAST
::
firstToken
()
const
unsigned
ObjCProtocolDeclarationAST
::
firstToken
()
const
{
if
(
attributes
)
return
attributes
->
firstToken
();
return
protocol_token
;
}
unsigned
ObjCProtocolDe
fini
tionAST
::
lastToken
()
const
unsigned
ObjCProtocolDe
clara
tionAST
::
lastToken
()
const
{
if
(
end_token
)
return
end_token
+
1
;
...
...
@@ -2403,60 +2381,6 @@ unsigned ObjCMethodDeclarationAST::lastToken() const
return
method_prototype
->
lastToken
();
}
unsigned
ObjCClassImplementationAST
::
firstToken
()
const
{
return
implementation_token
;
}
unsigned
ObjCClassImplementationAST
::
lastToken
()
const
{
if
(
end_token
)
return
end_token
+
1
;
for
(
DeclarationListAST
*
it
=
declarations
;
it
;
it
=
it
->
next
)
{
if
(
!
it
->
next
)
return
it
->
lastToken
();
}
if
(
inst_vars_decl
)
return
inst_vars_decl
->
lastToken
();
if
(
super_class_identifier
)
return
super_class_identifier
+
1
;
if
(
colon_token
)
return
colon_token
+
1
;
if
(
class_identifier
)
return
class_identifier
+
1
;
return
implementation_token
+
1
;
}
unsigned
ObjCCategoryImplementationAST
::
firstToken
()
const
{
return
implementation_token
;
}
unsigned
ObjCCategoryImplementationAST
::
lastToken
()
const
{
if
(
end_token
)
return
end_token
+
1
;
for
(
DeclarationListAST
*
it
=
declarations
;
it
;
it
=
it
->
next
)
{
if
(
!
it
->
next
)
return
it
->
lastToken
();
}
if
(
rparen_token
)
return
rparen_token
+
1
;
if
(
category_name_token
)
return
category_name_token
+
1
;
if
(
lparen_token
)
return
lparen_token
+
1
;
if
(
class_identifier
)
return
class_identifier
+
1
;
return
implementation_token
+
1
;
}
unsigned
ObjCSynthesizedPropertyAST
::
firstToken
()
const
{
if
(
property_identifier
)
...
...
src/shared/cplusplus/AST.h
View file @
ca34b0ca
...
...
@@ -197,9 +197,10 @@ public:
virtual
WhileStatementAST
*
asWhileStatement
()
{
return
0
;
}
virtual
IdentifierListAST
*
asIdentifierList
()
{
return
0
;
}
virtual
ObjCClassForwardDeclarationAST
*
asObjCClassForwarDeclaration
()
{
return
0
;
}
virtual
ObjCClassDeclarationAST
*
asObjCClassDeclaration
()
{
return
0
;
}
virtual
ObjCProtocolForwardDeclarationAST
*
asObjCProtocolForwardDeclaration
()
{
return
0
;
}
virtual
ObjCProtocolDeclarationAST
*
asObjCProtocolDeclaration
()
{
return
0
;
}
virtual
ObjCProtocolDefinitionAST
*
asObjCProtocolDefinition
()
{
return
0
;
}
virtual
ObjCProtocolRefsAST
*
asObjCProtocolRefs
()
{
return
0
;
}
virtual
ObjCMessageArgumentAST
*
asObjCMessageArgument
()
{
return
0
;
}
virtual
ObjCMessageArgumentListAST
*
asObjCMessageArgumentList
()
{
return
0
;
}
...
...
@@ -222,8 +223,6 @@ public:
virtual
ObjCMessageArgumentDeclarationListAST
*
asObjCMessageArgumentDeclarationList
()
{
return
0
;
}
virtual
ObjCMethodPrototypeAST
*
asObjCMethodPrototype
()
{
return
0
;
}
virtual
ObjCMethodDeclarationAST
*
asObjCMethodDeclaration
()
{
return
0
;
}
virtual
ObjCClassImplementationAST
*
asObjCClassImplementation
()
{
return
0
;
}
virtual
ObjCCategoryImplementationAST
*
asObjCCategoryImplementation
()
{
return
0
;
}
virtual
ObjCSynthesizedPropertyAST
*
asObjCSynthesizedProperty
()
{
return
0
;
}
virtual
ObjCSynthesizedPropertyListAST
*
asObjCSynthesizedPropertyList
()
{
return
0
;
}
virtual
ObjCSynthesizedPropertiesDeclarationAST
*
asObjCSynthesizedPropertiesDeclaration
()
{
return
0
;
}
...
...
@@ -2474,7 +2473,7 @@ protected:
class
CPLUSPLUS_EXPORT
IdentifierListAST
:
public
AST
{
public:
Simple
NameAST
*
name
;
NameAST
*
name
;
unsigned
comma_token
;
IdentifierListAST
*
next
;
...
...
@@ -2491,7 +2490,7 @@ protected:
virtual
void
accept0
(
ASTVisitor
*
visitor
);
};
class
CPLUSPLUS_EXPORT
ObjCClassDeclarationAST
:
public
DeclarationAST
class
CPLUSPLUS_EXPORT
ObjCClass
Forward
DeclarationAST
:
public
DeclarationAST
{
public:
SpecifierAST
*
attributes
;
...
...
@@ -2503,26 +2502,30 @@ public: // annotations
List
<
ObjCForwardClassDeclaration
*>
*
symbols
;
public:
virtual
ObjCClassDeclarationAST
*
asObjCClassDeclaration
()
virtual
ObjCClass
Forward
DeclarationAST
*
asObjCClass
Forward
Declaration
()
{
return
this
;
}
virtual
unsigned
firstToken
()
const
;
virtual
unsigned
lastToken
()
const
;
virtual
ObjCClassDeclarationAST
*
clone
(
MemoryPool
*
pool
)
const
;
virtual
ObjCClass
Forward
DeclarationAST
*
clone
(
MemoryPool
*
pool
)
const
;
protected:
virtual
void
accept0
(
ASTVisitor
*
visitor
);
};
class
CPLUSPLUS_EXPORT
ObjCClass
InterfaceDefini
tionAST
:
public
DeclarationAST
class
CPLUSPLUS_EXPORT
ObjCClass
Declara
tionAST
:
public
DeclarationAST
{
public:
SpecifierAST
*
attributes
;
unsigned
interface_token
;
SimpleNameAST
*
class_name
;
unsigned
implementation_token
;
NameAST
*
class_name
;
unsigned
lparen_token
;
NameAST
*
category_name
;
unsigned
rparen_token
;
unsigned
colon_token
;
unsigned
superclass
_identifier_token
;
NameAST
*
superclass
;
ObjCProtocolRefsAST
*
protocol_refs
;
ObjCInstanceVariablesDeclarationAST
*
inst_vars_decl
;
DeclarationListAST
*
member_declarations
;
...
...
@@ -2532,45 +2535,19 @@ public: // annotations
ObjCClass
*
symbol
;
public:
virtual
ObjCClassInterfaceDefinitionAST
*
asObjCClassInterfaceDefinition
()
{
return
this
;
}
virtual
unsigned
firstToken
()
const
;
virtual
unsigned
lastToken
()
const
;
virtual
ObjCClassInterfaceDefinitionAST
*
clone
(
MemoryPool
*
pool
)
const
;
protected:
virtual
void
accept0
(
ASTVisitor
*
visitor
);
};
class
CPLUSPLUS_EXPORT
ObjCCategoryInterfaceDeclarationAST
:
public
DeclarationAST
{
public:
SpecifierAST
*
attributes
;
unsigned
interface_token
;
unsigned
class_identifier_token
;
unsigned
lparen_token
;
unsigned
category_identifier_token
;
unsigned
rparen_token
;
ObjCProtocolRefsAST
*
protocol_refs
;
DeclarationListAST
*
member_declarations
;
unsigned
end_token
;
public:
virtual
ObjCCategoryInterfaceDeclarationAST
*
asObjCCategoryInterfaceDeclaration
()
virtual
ObjCClassDeclarationAST
*
asObjCClassDeclaration
()
{
return
this
;
}
virtual
unsigned
firstToken
()
const
;
virtual
unsigned
lastToken
()
const
;
virtual
ObjCC
ategoryInterface
DeclarationAST
*
clone
(
MemoryPool
*
pool
)
const
;
virtual
ObjCC
lass
DeclarationAST
*
clone
(
MemoryPool
*
pool
)
const
;
protected:
virtual
void
accept0
(
ASTVisitor
*
visitor
);
};
class
CPLUSPLUS_EXPORT
ObjCProtocolDeclarationAST
:
public
DeclarationAST
class
CPLUSPLUS_EXPORT
ObjCProtocol
Forward
DeclarationAST
:
public
DeclarationAST
{
public:
SpecifierAST
*
attributes
;
...
...
@@ -2582,24 +2559,24 @@ public: // annotations
List
<
ObjCForwardProtocolDeclaration
*>
*
symbols
;
public:
virtual
ObjCProtocolDeclarationAST
*
asObjCProtocolDeclaration
()
virtual
ObjCProtocol
Forward
DeclarationAST
*
asObjCProtocol
Forward
Declaration
()
{
return
this
;
}
virtual
unsigned
firstToken
()
const
;
virtual
unsigned
lastToken
()
const
;
virtual
ObjCProtocolDeclarationAST
*
clone
(
MemoryPool
*
pool
)
const
;
virtual
ObjCProtocol
Forward
DeclarationAST
*
clone
(
MemoryPool
*
pool
)
const
;
protected:
virtual
void
accept0
(
ASTVisitor
*
visitor
);
};
class
CPLUSPLUS_EXPORT
ObjCProtocolDe
fini
tionAST
:
public
DeclarationAST
class
CPLUSPLUS_EXPORT
ObjCProtocolDe
clara
tionAST
:
public
DeclarationAST
{
public:
SpecifierAST
*
attributes
;
unsigned
protocol_token
;
Simple
NameAST
*
name
;
NameAST
*
name
;
ObjCProtocolRefsAST
*
protocol_refs
;
DeclarationListAST
*
member_declarations
;
unsigned
end_token
;
...
...
@@ -2608,13 +2585,13 @@ public: // annotations
ObjCProtocol
*
symbol
;
public:
virtual
ObjCProtocolDe
fini
tionAST
*
asObjCProtocolDe
fini
tion
()
virtual
ObjCProtocolDe
clara
tionAST
*
asObjCProtocolDe
clara
tion
()
{
return
this
;
}
virtual
unsigned
firstToken
()
const
;
virtual
unsigned
lastToken
()
const
;
virtual
ObjCProtocolDe
fini
tionAST
*
clone
(
MemoryPool
*
pool
)
const
;
virtual
ObjCProtocolDe
clara
tionAST
*
clone
(
MemoryPool
*
pool
)
const
;
protected:
virtual
void
accept0
(
ASTVisitor
*
visitor
);
...
...
@@ -3055,54 +3032,6 @@ protected:
virtual
void
accept0
(
ASTVisitor
*
visitor
);
};
class
CPLUSPLUS_EXPORT
ObjCClassImplementationAST
:
public
DeclarationAST
{
public:
unsigned
implementation_token
;
unsigned
class_identifier
;
unsigned
colon_token
;
unsigned
super_class_identifier
;
ObjCInstanceVariablesDeclarationAST
*
inst_vars_decl
;
DeclarationListAST
*
declarations
;
unsigned
end_token
;
public:
virtual
ObjCClassImplementationAST
*
asObjCClassImplementation
()
{
return
this
;
}
virtual
unsigned
firstToken
()
const
;
virtual
unsigned
lastToken
()
const
;
virtual
ObjCClassImplementationAST
*
clone
(
MemoryPool
*
pool
)
const
;
protected:
virtual
void
accept0
(
ASTVisitor
*
visitor
);
};
class
CPLUSPLUS_EXPORT
ObjCCategoryImplementationAST
:
public
DeclarationAST
{
public:
unsigned
implementation_token
;
unsigned
class_identifier
;
unsigned
lparen_token
;
unsigned
category_name_token
;
unsigned
rparen_token
;
DeclarationListAST
*
declarations
;
unsigned
end_token
;
public:
virtual
ObjCCategoryImplementationAST
*
asObjCCategoryImplementation
()
{
return
this
;
}
virtual
unsigned
firstToken
()
const
;
virtual
unsigned
lastToken
()
const
;
virtual
ObjCCategoryImplementationAST
*
clone
(
MemoryPool
*
pool
)
const
;
protected:
virtual
void
accept0
(
ASTVisitor
*
visitor
);
};
class
CPLUSPLUS_EXPORT
ObjCSynthesizedPropertyAST
:
public
AST
{
public:
...
...
src/shared/cplusplus/ASTClone.cpp
View file @
ca34b0ca
...
...
@@ -1213,11 +1213,11 @@ IdentifierListAST *IdentifierListAST::clone(MemoryPool *pool) const
return
ast
;
}
ObjCClassDeclarationAST
*
ObjCClassDeclarationAST
::
clone
(
MemoryPool
*
pool
)
const
ObjCClass
Forward
DeclarationAST
*
ObjCClass
Forward
DeclarationAST
::
clone
(
MemoryPool
*
pool
)
const
{
ObjCClassDeclarationAST
*
ast
=
new
(
pool
)
ObjCClassDeclarationAST
;
ObjCClass
Forward
DeclarationAST
*
ast
=
new
(
pool
)
ObjCClass
Forward
DeclarationAST
;
// copy DeclarationAST
// copy ObjCClassDeclarationAST
// copy ObjCClass
Forward
DeclarationAST
if
(
attributes
)
ast
->
attributes
=
attributes
->
clone
(
pool
);
ast
->
class_token
=
class_token
;
if
(
identifier_list
)
ast
->
identifier_list
=
identifier_list
->
clone
(
pool
);
...
...
@@ -1225,16 +1225,20 @@ ObjCClassDeclarationAST *ObjCClassDeclarationAST::clone(MemoryPool *pool) const
return
ast
;
}
ObjCClass
InterfaceDefini
tionAST
*
ObjCClass
InterfaceDefini
tionAST
::
clone
(
MemoryPool
*
pool
)
const
ObjCClass
Declara
tionAST
*
ObjCClass
Declara
tionAST
::
clone
(
MemoryPool
*
pool
)
const
{
ObjCClass
InterfaceDefini
tionAST
*
ast
=
new
(
pool
)
ObjCClass
InterfaceDefini
tionAST
;
ObjCClass
Declara
tionAST
*
ast
=
new
(
pool
)
ObjCClass
Declara
tionAST
;
// copy DeclarationAST
// copy ObjCClass
Interface
DeclarationAST
// copy ObjCClassDeclarationAST
if
(
attributes
)
ast
->
attributes
=
attributes
->
clone
(
pool
);
ast
->
interface_token
=
interface_token
;
ast
->
implementation_token
=
implementation_token
;
if
(
class_name
)
ast
->
class_name
=
class_name
->
clone
(
pool
);
ast
->
lparen_token
=
lparen_token
;
if
(
category_name
)
ast
->
category_name
=
category_name
->
clone
(
pool
);
ast
->
rparen_token
=
rparen_token
;
ast
->
colon_token
=
colon_token
;
ast
->
superclass_identifier_token
=
superclass_identifier_token
;
if
(
superclass
)
ast
->
superclass
=
superclass
->
clone
(
pool
)
;
if
(
protocol_refs
)
ast
->
protocol_refs
=
protocol_refs
->
clone
(
pool
);
if
(
inst_vars_decl
)
ast
->
inst_vars_decl
=
inst_vars_decl
->
clone
(
pool
);
if
(
member_declarations
)
ast
->
member_declarations
=
member_declarations
->
clone
(
pool
);
...
...
@@ -1242,26 +1246,9 @@ ObjCClassInterfaceDefinitionAST *ObjCClassInterfaceDefinitionAST::clone(MemoryPo
return
ast
;
}
ObjC
CategoryInterface
DeclarationAST
*
ObjC
CategoryInterface
DeclarationAST
::
clone
(
MemoryPool
*
pool
)
const
ObjC
ProtocolForward
DeclarationAST
*
ObjC
ProtocolForward
DeclarationAST
::
clone
(
MemoryPool
*
pool
)
const
{
ObjCCategoryInterfaceDeclarationAST
*
ast
=
new
(
pool
)
ObjCCategoryInterfaceDeclarationAST
;
// copy DeclarationAST
// copy ObjCCategoryInterfaceDeclarationAST
if
(
attributes
)
ast
->
attributes
=
attributes
->
clone
(
pool
);
ast
->
interface_token
=
interface_token
;
ast
->
class_identifier_token
=
class_identifier_token
;
if
(
protocol_refs
)
ast
->
protocol_refs
=
protocol_refs
->
clone
(
pool
);
ast
->
lparen_token
=
lparen_token
;
ast
->
category_identifier_token
=
category_identifier_token
;
ast
->
rparen_token
=
rparen_token
;
if
(
member_declarations
)
ast
->
member_declarations
=
member_declarations
->
clone
(
pool
);
ast
->
end_token
=
end_token
;
return
ast
;
}
ObjCProtocolDeclarationAST
*
ObjCProtocolDeclarationAST
::
clone
(
MemoryPool
*
pool
)
const
{
ObjCProtocolDeclarationAST
*
ast
=
new
(
pool
)
ObjCProtocolDeclarationAST
;
ObjCProtocolForwardDeclarationAST
*
ast
=
new
(
pool
)
ObjCProtocolForwardDeclarationAST
;
if
(
attributes
)
ast
->
attributes
=
attributes
->
clone
(
pool
);
ast
->
protocol_token
=
protocol_token
;
if
(
identifier_list
)
ast
->
identifier_list
=
identifier_list
;
...
...
@@ -1269,9 +1256,9 @@ ObjCProtocolDeclarationAST *ObjCProtocolDeclarationAST::clone(MemoryPool *pool)
return
ast
;
}
ObjCProtocolDe
fini
tionAST
*
ObjCProtocolDe
fini
tionAST
::
clone
(
MemoryPool
*
pool
)
const
ObjCProtocolDe
clara
tionAST
*
ObjCProtocolDe
clara
tionAST
::
clone
(
MemoryPool
*
pool
)
const
{
ObjCProtocolDe
fini
tionAST
*
ast
=
new
(
pool
)
ObjCProtocolDe
fini
tionAST
;
ObjCProtocolDe
clara
tionAST
*
ast
=
new
(
pool
)
ObjCProtocolDe
clara
tionAST
;
if
(
attributes
)
ast
->
attributes
=
attributes
->
clone
(
pool
);
ast
->
protocol_token
=
protocol_token
;
if
(
name
)
ast
->
name
=
name
->
clone
(
pool
);
...
...
@@ -1466,32 +1453,6 @@ ObjCMethodDeclarationAST *ObjCMethodDeclarationAST::clone(MemoryPool *pool) cons
return
ast
;
}
ObjCClassImplementationAST
*
ObjCClassImplementationAST
::
clone
(
MemoryPool
*
pool
)
const
{
ObjCClassImplementationAST
*
ast
=
new
(
pool
)
ObjCClassImplementationAST
;
ast
->
implementation_token
=
implementation_token
;
ast
->
class_identifier
=
class_identifier
;
ast
->
colon_token
=
colon_token
;
ast
->
super_class_identifier
=
super_class_identifier
;
if
(
inst_vars_decl
)
ast
->
inst_vars_decl
=
inst_vars_decl
->
clone
(
pool
);
if
(
declarations
)
ast
->
declarations
=
declarations
->
clone
(
pool
);
ast
->
end_token
=
end_token
;
return
ast
;
}
ObjCCategoryImplementationAST
*
ObjCCategoryImplementationAST
::
clone
(
MemoryPool
*
pool
)
const
{
ObjCCategoryImplementationAST
*
ast
=
new
(
pool
)
ObjCCategoryImplementationAST
;
ast
->
implementation_token
=
implementation_token
;
ast
->
class_identifier
=
class_identifier
;
ast
->
lparen_token
=
lparen_token
;
ast
->
category_name_token
=
category_name_token
;
ast
->
rparen_token
=
rparen_token
;
if
(
declarations
)
ast
->
declarations
=
declarations
->
clone
(
pool
);
ast
->
end_token
=
end_token
;
return
ast
;
}
ObjCSynthesizedPropertyAST
*
ObjCSynthesizedPropertyAST
::
clone
(
MemoryPool
*
pool
)
const
{
ObjCSynthesizedPropertyAST
*
ast
=
new
(
pool
)
ObjCSynthesizedPropertyAST
;
...
...
src/shared/cplusplus/ASTVisit.cpp
View file @
ca34b0ca
...
...
@@ -1127,10 +1127,10 @@ void IdentifierListAST::accept0(ASTVisitor *visitor)
visitor
->
endVisit
(
this
);
}
void
ObjCClassDeclarationAST
::
accept0
(
ASTVisitor
*
visitor
)
void
ObjCClass
Forward
DeclarationAST
::
accept0
(
ASTVisitor
*
visitor
)
{
if
(
visitor
->
visit
(
this
))
{
// visit ObjCClassDeclarationAST
// visit ObjCClass
Forward
DeclarationAST
for
(
SpecifierAST
*
it
=
attributes
;
it
;
it
=
it
->
next
)
accept
(
it
,
visitor
);
for
(
IdentifierListAST
*
it
=
identifier_list
;
it
;
it
=
it
->
next
)
...
...
@@ -1140,13 +1140,15 @@ void ObjCClassDeclarationAST::accept0(ASTVisitor *visitor)
visitor
->
endVisit
(
this
);
}
void
ObjCClass
InterfaceDefini
tionAST
::
accept0
(
ASTVisitor
*
visitor
)
void
ObjCClass
Declara
tionAST
::
accept0
(
ASTVisitor
*
visitor
)
{
if
(
visitor
->
visit
(
this
))
{
// visit ObjCClassInterfaceDefinitionAST
for
(
SpecifierAST
*
it
=
attributes
;
it
;
it
=
it
->
next
)
accept
(
it
,
visitor
);
accept
(
class_name
,
visitor
);
accept
(
category_name
,
visitor
);
accept
(
superclass
,
visitor
);
accept
(
protocol_refs
,
visitor
);
accept
(
inst_vars_decl
,
visitor
);
for
(
DeclarationListAST
*
it
=
member_declarations
;
it
;
it
=
it
->
next
)
...
...
@@ -1156,21 +1158,7 @@ void ObjCClassInterfaceDefinitionAST::accept0(ASTVisitor *visitor)
visitor
->
endVisit
(
this
);
}
void
ObjCCategoryInterfaceDeclarationAST
::
accept0
(
ASTVisitor
*
visitor
)
{
if
(
visitor
->
visit
(
this
))
{
// visit ObjCCategoryInterfaceDeclarationAST
for
(
SpecifierAST
*
it
=
attributes
;
it
;
it
=
it
->
next
)
accept
(
it
,
visitor
);
accept
(
protocol_refs
,
visitor
);
for
(
DeclarationListAST
*
it
=
member_declarations
;
it
;
it
=
it
->
next
)
accept
(
it
,
visitor
);
// visit DeclarationAST
}
visitor
->
endVisit
(
this
);
}
void
ObjCProtocolDeclarationAST
::
accept0
(
ASTVisitor
*
visitor
)
void
ObjCProtocolForwardDeclarationAST
::
accept0
(
ASTVisitor
*
visitor
)
{
if
(
visitor
->
visit
(
this
))
{
// visit ObjCProtocolDeclarationAST
...
...
@@ -1183,10 +1171,10 @@ void ObjCProtocolDeclarationAST::accept0(ASTVisitor *visitor)
visitor
->
endVisit
(
this
);
}
void
ObjCProtocolDe
fini
tionAST
::
accept0
(
ASTVisitor
*
visitor
)
void
ObjCProtocolDe
clara
tionAST
::
accept0
(
ASTVisitor
*
visitor
)
{
if
(
visitor
->
visit
(
this
))
{
// visit ObjCProtocolDe
fini
tionAST
// visit ObjCProtocolDe
clara
tionAST
for
(
SpecifierAST
*
it
=
attributes
;
it
;
it
=
it
->
next
)
accept
(
it
,
visitor
);
accept
(
name
,
visitor
);
...
...
@@ -1412,29 +1400,6 @@ void ObjCMethodDeclarationAST::accept0(ASTVisitor *visitor)
visitor
->
endVisit
(
this
);
}
void
ObjCClassImplementationAST
::
accept0
(
ASTVisitor
*
visitor
)
{
if
(
visitor
->
visit
(
this
))
{
// visit ObjCClassImplementationAST
accept
(
inst_vars_decl
,
visitor
);
for
(
DeclarationListAST
*
it
=
declarations
;
it
;
it
=
it
->
next
)
accept
(
it
,
visitor
);
// visit DeclarationAST
<