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
F
flatpak-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
Marco Bubke
flatpak-qt-creator
Commits
cee87ece
Commit
cee87ece
authored
Aug 13, 2010
by
Roberto Raggi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a way to bind TranslationUnitAST nodes.
parent
93bbd32c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
10 deletions
+14
-10
src/shared/cplusplus/Bind.cpp
src/shared/cplusplus/Bind.cpp
+7
-5
src/shared/cplusplus/Bind.h
src/shared/cplusplus/Bind.h
+7
-5
No files found.
src/shared/cplusplus/Bind.cpp
View file @
cee87ece
...
...
@@ -68,8 +68,6 @@ Bind::Bind(TranslationUnit *unit)
_name
(
0
),
_declaratorId
(
0
)
{
if
(
unit
->
ast
())
translationUnit
(
unit
->
ast
()
->
asTranslationUnit
());
}
Scope
*
Bind
::
currentScope
()
const
...
...
@@ -84,6 +82,13 @@ Scope *Bind::switchScope(Scope *scope)
return
previousScope
;
}
void
Bind
::
operator
()(
TranslationUnitAST
*
ast
,
Namespace
*
globalNamespace
)
{
Scope
*
previousScope
=
switchScope
(
globalNamespace
);
translationUnit
(
ast
);
(
void
)
switchScope
(
previousScope
);
}
void
Bind
::
statement
(
StatementAST
*
ast
)
{
accept
(
ast
);
...
...
@@ -703,12 +708,9 @@ void Bind::translationUnit(TranslationUnitAST *ast)
if
(
!
ast
)
return
;
Namespace
*
globalNamespace
=
control
()
->
newNamespace
(
0
,
0
);
Scope
*
previousScope
=
switchScope
(
globalNamespace
);
for
(
DeclarationListAST
*
it
=
ast
->
declaration_list
;
it
;
it
=
it
->
next
)
{
this
->
declaration
(
it
->
value
);
}
(
void
)
switchScope
(
previousScope
);
}
bool
Bind
::
visit
(
ObjCProtocolRefsAST
*
ast
)
...
...
src/shared/cplusplus/Bind.h
View file @
cee87ece
...
...
@@ -59,6 +59,13 @@ class CPLUSPLUS_EXPORT Bind: protected ASTVisitor
public:
Bind
(
TranslationUnit
*
unit
);
void
operator
()(
TranslationUnitAST
*
ast
,
Namespace
*
globalNamespace
);
protected:
using
ASTVisitor
::
translationUnit
;
static
int
visibilityForAccessSpecifier
(
int
tokenKind
);
typedef
FullySpecifiedType
ExpressionTy
;
ExpressionTy
expression
(
ExpressionAST
*
ast
);
...
...
@@ -75,11 +82,6 @@ public:
Scope
*
currentScope
()
const
;
Scope
*
switchScope
(
Scope
*
scope
);
protected:
using
ASTVisitor
::
translationUnit
;
static
int
visibilityForAccessSpecifier
(
int
tokenKind
);
const
Name
*
objCSelectorArgument
(
ObjCSelectorArgumentAST
*
ast
,
bool
*
hasArg
);
void
attribute
(
AttributeAST
*
ast
);
FullySpecifiedType
declarator
(
DeclaratorAST
*
ast
,
const
FullySpecifiedType
&
init
,
DeclaratorIdAST
**
declaratorId
);
...
...
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