Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qt-creator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tobias Hunger
qt-creator
Commits
19dd2b81
Commit
19dd2b81
authored
15 years ago
by
Roberto Raggi
Browse files
Options
Downloads
Patches
Plain Diff
Added Symbol::enclosingNamespaceScope(), Symbol::enclosingClassScope(), and so on...
parent
7b44f174
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/shared/cplusplus/Symbol.cpp
+56
-0
56 additions, 0 deletions
src/shared/cplusplus/Symbol.cpp
src/shared/cplusplus/Symbol.h
+15
-0
15 additions, 0 deletions
src/shared/cplusplus/Symbol.h
with
71 additions
and
0 deletions
src/shared/cplusplus/Symbol.cpp
+
56
−
0
View file @
19dd2b81
...
...
@@ -55,6 +55,7 @@
#include
"MemoryPool.h"
#include
"SymbolVisitor.h"
#include
"NameVisitor.h"
#include
"Scope.h"
#include
<cstddef>
#include
<cassert>
...
...
@@ -313,6 +314,61 @@ void Symbol::setScope(Scope *scope)
_scope
=
scope
;
}
Scope
*
Symbol
::
enclosingNamespaceScope
()
const
{
if
(
!
_scope
)
return
0
;
else
if
(
_scope
->
isNamespaceScope
())
return
_scope
;
return
_scope
->
enclosingNamespaceScope
();
}
Scope
*
Symbol
::
enclosingClassScope
()
const
{
if
(
!
_scope
)
return
0
;
else
if
(
_scope
->
isNamespaceScope
())
return
_scope
;
return
_scope
->
enclosingNamespaceScope
();
}
Scope
*
Symbol
::
enclosingEnumScope
()
const
{
if
(
!
_scope
)
return
0
;
else
if
(
_scope
->
isEnumScope
())
return
_scope
;
return
_scope
->
enclosingEnumScope
();
}
Scope
*
Symbol
::
enclosingFunctionScope
()
const
{
if
(
!
_scope
)
return
0
;
else
if
(
_scope
->
isFunctionScope
())
return
_scope
;
return
_scope
->
enclosingFunctionScope
();
}
Scope
*
Symbol
::
enclosingBlockScope
()
const
{
if
(
!
_scope
)
return
0
;
else
if
(
_scope
->
isBlockScope
())
return
_scope
;
return
_scope
->
enclosingBlockScope
();
}
unsigned
Symbol
::
index
()
const
{
return
_index
;
}
...
...
This diff is collapsed.
Click to expand it.
src/shared/cplusplus/Symbol.h
+
15
−
0
View file @
19dd2b81
...
...
@@ -248,6 +248,21 @@ public:
bool
isGenerated
()
const
;
/// Returns the eclosing namespace scope.
Scope
*
enclosingNamespaceScope
()
const
;
/// Returns the enclosing class scope.
Scope
*
enclosingClassScope
()
const
;
/// Returns the enclosing enum scope.
Scope
*
enclosingEnumScope
()
const
;
/// Returns the enclosing function scope.
Scope
*
enclosingFunctionScope
()
const
;
/// Returns the enclosing Block scope.
Scope
*
enclosingBlockScope
()
const
;
void
setScope
(
Scope
*
scope
);
// ### make me private
void
setSourceLocation
(
unsigned
sourceLocation
);
// ### make me private
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment