Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
6e3e293e
Commit
6e3e293e
authored
Nov 10, 2009
by
Roberto Raggi
Browse files
Removed DeclaratorListAST
Done with Erik Verbruggen
parent
77e7899e
Changes
8
Hide whitespace changes
Inline
Side-by-side
src/plugins/cpptools/cppcodecompletion.cpp
View file @
6e3e293e
...
...
@@ -1072,8 +1072,8 @@ bool CppCodeCompletion::completeConstructorOrFunction(const QList<TypeOfExpressi
if
(
doc
->
parse
(
Document
::
ParseDeclaration
))
{
doc
->
check
();
if
(
SimpleDeclarationAST
*
sd
=
doc
->
translationUnit
()
->
ast
()
->
asSimpleDeclaration
())
{
if
(
sd
->
declarators
->
declarator
->
postfix_declarators
&&
sd
->
declarators
->
declarator
->
postfix_declarators
->
asFunctionDeclarator
())
{
if
(
sd
->
declarators
->
value
->
postfix_declarators
&&
sd
->
declarators
->
value
->
postfix_declarators
->
asFunctionDeclarator
())
{
autocompleteSignature
=
true
;
}
}
...
...
src/shared/cplusplus/AST.cpp
View file @
6e3e293e
...
...
@@ -608,25 +608,6 @@ unsigned DeclaratorIdAST::lastToken() const
return
name
->
lastToken
();
}
unsigned
DeclaratorListAST
::
firstToken
()
const
{
return
declarator
->
firstToken
();
}
unsigned
DeclaratorListAST
::
lastToken
()
const
{
for
(
const
DeclaratorListAST
*
it
=
this
;
it
;
it
=
it
->
next
)
{
if
(
!
it
->
next
)
{
if
(
it
->
declarator
)
return
it
->
declarator
->
lastToken
();
}
}
return
0
;
}
unsigned
DeleteExpressionAST
::
firstToken
()
const
{
if
(
scope_token
)
...
...
src/shared/cplusplus/AST.h
View file @
6e3e293e
...
...
@@ -786,22 +786,6 @@ protected:
virtual
void
accept0
(
ASTVisitor
*
visitor
);
};
class
CPLUSPLUS_EXPORT
DeclaratorListAST
:
public
AST
{
public:
DeclaratorAST
*
declarator
;
DeclaratorListAST
*
next
;
public:
virtual
DeclaratorListAST
*
asDeclaratorList
()
{
return
this
;
}
virtual
unsigned
firstToken
()
const
;
virtual
unsigned
lastToken
()
const
;
protected:
virtual
void
accept0
(
ASTVisitor
*
visitor
);
};
class
CPLUSPLUS_EXPORT
DeleteExpressionAST
:
public
ExpressionAST
{
public:
...
...
src/shared/cplusplus/ASTVisit.cpp
View file @
6e3e293e
...
...
@@ -271,14 +271,6 @@ void ArrayDeclaratorAST::accept0(ASTVisitor *visitor)
visitor
->
endVisit
(
this
);
}
void
DeclaratorListAST
::
accept0
(
ASTVisitor
*
visitor
)
{
if
(
visitor
->
visit
(
this
))
{
accept
(
declarator
,
visitor
);
}
visitor
->
endVisit
(
this
);
}
void
DeleteExpressionAST
::
accept0
(
ASTVisitor
*
visitor
)
{
if
(
visitor
->
visit
(
this
))
{
...
...
src/shared/cplusplus/ASTVisitor.h
View file @
6e3e293e
...
...
@@ -121,7 +121,6 @@ public:
virtual
bool
visit
(
DeclaratorAST
*
)
{
return
true
;
}
virtual
bool
visit
(
DeclarationStatementAST
*
)
{
return
true
;
}
virtual
bool
visit
(
DeclaratorIdAST
*
)
{
return
true
;
}
virtual
bool
visit
(
DeclaratorListAST
*
)
{
return
true
;
}
virtual
bool
visit
(
DeleteExpressionAST
*
)
{
return
true
;
}
virtual
bool
visit
(
DestructorNameAST
*
)
{
return
true
;
}
virtual
bool
visit
(
DoStatementAST
*
)
{
return
true
;
}
...
...
@@ -254,7 +253,6 @@ public:
virtual
void
endVisit
(
DeclaratorAST
*
)
{
}
virtual
void
endVisit
(
DeclarationStatementAST
*
)
{
}
virtual
void
endVisit
(
DeclaratorIdAST
*
)
{
}
virtual
void
endVisit
(
DeclaratorListAST
*
)
{
}
virtual
void
endVisit
(
DeleteExpressionAST
*
)
{
}
virtual
void
endVisit
(
DestructorNameAST
*
)
{
}
virtual
void
endVisit
(
DoStatementAST
*
)
{
}
...
...
src/shared/cplusplus/ASTfwd.h
View file @
6e3e293e
...
...
@@ -87,7 +87,6 @@ class DeclarationAST;
class
DeclarationStatementAST
;
class
DeclaratorAST
;
class
DeclaratorIdAST
;
class
DeclaratorListAST
;
class
DeleteExpressionAST
;
class
DestructorNameAST
;
class
DoStatementAST
;
...
...
@@ -202,6 +201,7 @@ class WhileStatementAST;
typedef
List
<
ExpressionAST
*>
ExpressionListAST
;
typedef
List
<
DeclarationAST
*>
DeclarationListAST
;
typedef
List
<
StatementAST
*>
StatementListAST
;
typedef
List
<
DeclaratorAST
*>
DeclaratorListAST
;
}
// end of namespace CPlusPlus
...
...
src/shared/cplusplus/CheckDeclaration.cpp
View file @
6e3e293e
...
...
@@ -173,13 +173,13 @@ bool CheckDeclaration::visit(SimpleDeclarationAST *ast)
List
<
Declaration
*>
**
decl_it
=
&
ast
->
symbols
;
for
(
DeclaratorListAST
*
it
=
ast
->
declarators
;
it
;
it
=
it
->
next
)
{
Name
*
name
=
0
;
FullySpecifiedType
declTy
=
semantic
()
->
check
(
it
->
declarator
,
qualTy
,
FullySpecifiedType
declTy
=
semantic
()
->
check
(
it
->
value
,
qualTy
,
_scope
,
&
name
);
unsigned
location
=
locationOfDeclaratorId
(
it
->
declarator
);
unsigned
location
=
locationOfDeclaratorId
(
it
->
value
);
if
(
!
location
)
{
if
(
it
->
declarator
)
location
=
it
->
declarator
->
firstToken
();
if
(
it
->
value
)
location
=
it
->
value
->
firstToken
();
else
location
=
ast
->
firstToken
();
}
...
...
@@ -226,8 +226,8 @@ bool CheckDeclaration::visit(SimpleDeclarationAST *ast)
else
if
(
ty
.
isTypedef
())
symbol
->
setStorage
(
Symbol
::
Typedef
);
if
(
it
->
declarator
&&
it
->
declarator
->
initializer
)
{
FullySpecifiedType
initTy
=
semantic
()
->
check
(
it
->
declarator
->
initializer
,
_scope
);
if
(
it
->
value
&&
it
->
value
->
initializer
)
{
FullySpecifiedType
initTy
=
semantic
()
->
check
(
it
->
value
->
initializer
,
_scope
);
}
*
decl_it
=
new
(
translationUnit
()
->
memoryPool
())
List
<
Declaration
*>
();
...
...
src/shared/cplusplus/Parser.cpp
View file @
6e3e293e
...
...
@@ -2158,7 +2158,7 @@ bool Parser::isPointerDeclaration(DeclarationStatementAST *ast) const
if
(
SpecifierAST
*
spec
=
declaration
->
decl_specifier_seq
)
{
if
(
spec
->
asNamedTypeSpecifier
()
&&
!
spec
->
next
)
{
if
(
DeclaratorListAST
*
declarators
=
declaration
->
declarators
)
{
if
(
DeclaratorAST
*
declarator
=
declarators
->
declarator
)
{
if
(
DeclaratorAST
*
declarator
=
declarators
->
value
)
{
if
(
declarator
->
ptr_operators
&&
declarator
->
equals_token
&&
declarator
->
initializer
)
{
return
true
;
}
...
...
@@ -2180,7 +2180,7 @@ bool Parser::maybeAmbiguousStatement(DeclarationStatementAST *ast) const
if
(
SpecifierAST
*
spec
=
declaration
->
decl_specifier_seq
)
{
if
(
spec
->
asNamedTypeSpecifier
()
&&
!
spec
->
next
)
{
if
(
DeclaratorListAST
*
declarators
=
declaration
->
declarators
)
{
if
(
DeclaratorAST
*
declarator
=
declarators
->
declarator
)
{
if
(
DeclaratorAST
*
declarator
=
declarators
->
value
)
{
if
(
declarator
->
core_declarator
&&
declarator
->
core_declarator
->
asNestedDeclarator
())
{
// recognized name(id-expression)
...
...
@@ -2192,7 +2192,7 @@ bool Parser::maybeAmbiguousStatement(DeclarationStatementAST *ast) const
}
else
if
(
DeclaratorListAST
*
declarators
=
declaration
->
declarators
)
{
// no decl_specifiers...
if
(
DeclaratorAST
*
declarator
=
declarators
->
declarator
)
{
if
(
DeclaratorAST
*
declarator
=
declarators
->
value
)
{
if
(
declarator
->
postfix_declarators
&&
declarator
->
postfix_declarators
->
asFunctionDeclarator
()
&&
!
declarator
->
initializer
)
{
return
false
;
...
...
@@ -2849,7 +2849,7 @@ bool Parser::parseSimpleDeclaration(DeclarationAST *&node,
if
(
declarator
)
{
*
declarator_ptr
=
new
(
_pool
)
DeclaratorListAST
;
(
*
declarator_ptr
)
->
declarator
=
declarator
;
(
*
declarator_ptr
)
->
value
=
declarator
;
declarator_ptr
=
&
(
*
declarator_ptr
)
->
next
;
}
...
...
@@ -2860,7 +2860,7 @@ bool Parser::parseSimpleDeclaration(DeclarationAST *&node,
declarator
=
0
;
if
(
parseInitDeclarator
(
declarator
,
acceptStructDeclarator
))
{
*
declarator_ptr
=
new
(
_pool
)
DeclaratorListAST
;
(
*
declarator_ptr
)
->
declarator
=
declarator
;
(
*
declarator_ptr
)
->
value
=
declarator
;
declarator_ptr
=
&
(
*
declarator_ptr
)
->
next
;
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment