Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Q
qt-creator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tobias Hunger
qt-creator
Commits
1610356c
Commit
1610356c
authored
Aug 12, 2010
by
Roberto Raggi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Process the postfix declarators.
parent
73f1cdf3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
16 deletions
+36
-16
src/shared/cplusplus/Bind.cpp
src/shared/cplusplus/Bind.cpp
+35
-15
src/shared/cplusplus/Bind.h
src/shared/cplusplus/Bind.h
+1
-1
No files found.
src/shared/cplusplus/Bind.cpp
View file @
1610356c
...
...
@@ -681,17 +681,26 @@ bool Bind::visit(ParameterDeclarationClauseAST *ast)
return
false
;
}
void
Bind
::
parameterDeclarationClause
(
ParameterDeclarationClauseAST
*
ast
)
void
Bind
::
parameterDeclarationClause
(
ParameterDeclarationClauseAST
*
ast
,
unsigned
lparen_token
,
Function
*
fun
)
{
if
(
!
ast
)
return
;
if
(
debug_todo
)
translationUnit
()
->
warning
(
ast
->
firstToken
(),
"TODO: %s"
,
__func__
);
if
(
!
fun
)
{
translationUnit
()
->
warning
(
lparen_token
,
"undefined function"
);
return
;
}
Scope
*
previousScope
=
switchScope
(
fun
);
for
(
DeclarationListAST
*
it
=
ast
->
parameter_declaration_list
;
it
;
it
=
it
->
next
)
{
this
->
declaration
(
it
->
value
);
}
// unsigned dot_dot_dot_token = ast->dot_dot_dot_token;
if
(
ast
->
dot_dot_dot_token
)
fun
->
setVariadic
(
true
);
(
void
)
switchScope
(
previousScope
);
}
bool
Bind
::
visit
(
TranslationUnitAST
*
ast
)
...
...
@@ -950,9 +959,12 @@ void Bind::lambdaDeclarator(LambdaDeclaratorAST *ast)
if
(
debug_todo
)
translationUnit
()
->
warning
(
ast
->
firstToken
(),
"TODO: %s"
,
__func__
);
Function
*
fun
=
0
;
// ### implement me
// unsigned lparen_token = ast->lparen_token;
FullySpecifiedType
type
;
this
->
parameterDeclarationClause
(
ast
->
parameter_declaration_clause
);
this
->
parameterDeclarationClause
(
ast
->
parameter_declaration_clause
,
ast
->
lparen_token
,
fun
);
// unsigned rparen_token = ast->rparen_token;
for
(
SpecifierListAST
*
it
=
ast
->
attributes
;
it
;
it
=
it
->
next
)
{
type
=
this
->
specifier
(
it
->
value
,
type
);
...
...
@@ -2321,29 +2333,37 @@ bool Bind::visit(NestedDeclaratorAST *ast)
// PostfixDeclaratorAST
bool
Bind
::
visit
(
FunctionDeclaratorAST
*
ast
)
{
if
(
debug_todo
)
translationUnit
()
->
warning
(
ast
->
firstToken
(),
"TODO: %s"
,
__func__
);
Function
*
fun
=
control
()
->
newFunction
(
0
,
0
);
fun
->
setReturnType
(
_type
);
// unsigned lparen_token = ast->lparen_token;
this
->
parameterDeclarationClause
(
ast
->
parameters
);
this
->
parameterDeclarationClause
(
ast
->
parameters
,
ast
->
lparen_token
,
fun
);
// unsigned rparen_token = ast->rparen_token;
FullySpecifiedType
type
;
FullySpecifiedType
type
(
fun
)
;
for
(
SpecifierListAST
*
it
=
ast
->
cv_qualifier_list
;
it
;
it
=
it
->
next
)
{
type
=
this
->
specifier
(
it
->
value
,
type
);
}
// propagate the cv-qualifiers
fun
->
setConst
(
type
.
isConst
());
fun
->
setVolatile
(
type
.
isVolatile
());
this
->
exceptionSpecification
(
ast
->
exception_specification
,
type
);
this
->
trailingReturnType
(
ast
->
trailing_return_type
,
type
);
ExpressionTy
as_cpp_initializer
=
this
->
expression
(
ast
->
as_cpp_initializer
);
// Function *symbol = ast->symbol;
if
(
ast
->
as_cpp_initializer
!=
0
)
{
fun
->
setAmbiguous
(
true
);
ExpressionTy
as_cpp_initializer
=
this
->
expression
(
ast
->
as_cpp_initializer
);
}
ast
->
symbol
=
fun
;
_type
=
type
;
return
false
;
}
bool
Bind
::
visit
(
ArrayDeclaratorAST
*
ast
)
{
if
(
debug_todo
)
translationUnit
()
->
warning
(
ast
->
firstToken
(),
"TODO: %s"
,
__func__
);
// unsigned lbracket_token = ast->lbracket_token;
ExpressionTy
expression
=
this
->
expression
(
ast
->
expression
);
// unsigned rbracket_token = ast->rbracket_token;
FullySpecifiedType
type
(
control
()
->
arrayType
(
_type
));
_type
=
type
;
return
false
;
}
src/shared/cplusplus/Bind.h
View file @
1610356c
...
...
@@ -94,7 +94,7 @@ protected:
void
newInitializer
(
NewInitializerAST
*
ast
);
FullySpecifiedType
newTypeId
(
NewTypeIdAST
*
ast
);
int
cppOperator
(
OperatorAST
*
ast
);
void
parameterDeclarationClause
(
ParameterDeclarationClauseAST
*
ast
);
void
parameterDeclarationClause
(
ParameterDeclarationClauseAST
*
ast
,
unsigned
lparen_token
,
Function
*
fun
);
void
translationUnit
(
TranslationUnitAST
*
ast
);
void
objCProtocolRefs
(
ObjCProtocolRefsAST
*
ast
);
void
objCMessageArgument
(
ObjCMessageArgumentAST
*
ast
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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