Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Tobias Hunger
qt-creator
Commits
d626e639
Commit
d626e639
authored
Aug 13, 2010
by
Roberto Raggi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Process enumerators.
parent
ada42e7e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
8 deletions
+22
-8
src/shared/cplusplus/Bind.cpp
src/shared/cplusplus/Bind.cpp
+21
-7
src/shared/cplusplus/Bind.h
src/shared/cplusplus/Bind.h
+1
-1
No files found.
src/shared/cplusplus/Bind.cpp
View file @
d626e639
...
@@ -345,14 +345,23 @@ bool Bind::visit(EnumeratorAST *ast)
...
@@ -345,14 +345,23 @@ bool Bind::visit(EnumeratorAST *ast)
return
false
;
return
false
;
}
}
void
Bind
::
enumerator
(
EnumeratorAST
*
ast
)
void
Bind
::
enumerator
(
EnumeratorAST
*
ast
,
Enum
*
symbol
)
{
{
(
void
)
symbol
;
if
(
!
ast
)
if
(
!
ast
)
return
;
return
;
// unsigned identifier_token = ast->identifier_token;
// unsigned identifier_token = ast->identifier_token;
// unsigned equal_token = ast->equal_token;
// unsigned equal_token = ast->equal_token;
ExpressionTy
expression
=
this
->
expression
(
ast
->
expression
);
ExpressionTy
expression
=
this
->
expression
(
ast
->
expression
);
if
(
ast
->
identifier_token
)
{
const
Name
*
name
=
control
()
->
nameId
(
identifier
(
ast
->
identifier_token
));
Declaration
*
e
=
control
()
->
newDeclaration
(
ast
->
identifier_token
,
name
);
e
->
setType
(
control
()
->
integerType
(
IntegerType
::
Int
));
// ### introduce IntegerType::Enumerator
symbol
->
addMember
(
e
);
}
}
}
bool
Bind
::
visit
(
ExceptionSpecificationAST
*
ast
)
bool
Bind
::
visit
(
ExceptionSpecificationAST
*
ast
)
...
@@ -2325,14 +2334,19 @@ bool Bind::visit(ElaboratedTypeSpecifierAST *ast)
...
@@ -2325,14 +2334,19 @@ bool Bind::visit(ElaboratedTypeSpecifierAST *ast)
bool
Bind
::
visit
(
EnumSpecifierAST
*
ast
)
bool
Bind
::
visit
(
EnumSpecifierAST
*
ast
)
{
{
// unsigned enum_token = ast->enum_token;
unsigned
sourceLocation
=
ast
->
firstToken
();
/*const Name *name =*/
this
->
name
(
ast
->
name
);
if
(
ast
->
name
)
// unsigned lbrace_token = ast->lbrace_token;
sourceLocation
=
ast
->
name
->
firstToken
();
const
Name
*
enumName
=
this
->
name
(
ast
->
name
);
Enum
*
e
=
control
()
->
newEnum
(
sourceLocation
,
enumName
);
ast
->
symbol
=
e
;
Scope
*
previousScope
=
switchScope
(
e
);
for
(
EnumeratorListAST
*
it
=
ast
->
enumerator_list
;
it
;
it
=
it
->
next
)
{
for
(
EnumeratorListAST
*
it
=
ast
->
enumerator_list
;
it
;
it
=
it
->
next
)
{
this
->
enumerator
(
it
->
value
);
this
->
enumerator
(
it
->
value
,
e
);
}
}
// unsigned rbrace_token = ast->rbrace_token;
(
void
)
switchScope
(
previousScope
);
// Enum *symbol = ast->symbol;
return
false
;
return
false
;
}
}
...
...
src/shared/cplusplus/Bind.h
View file @
d626e639
...
@@ -93,7 +93,7 @@ protected:
...
@@ -93,7 +93,7 @@ protected:
void
qtInterfaceName
(
QtInterfaceNameAST
*
ast
);
void
qtInterfaceName
(
QtInterfaceNameAST
*
ast
);
void
baseSpecifier
(
BaseSpecifierAST
*
ast
,
unsigned
colon_token
,
Class
*
klass
);
void
baseSpecifier
(
BaseSpecifierAST
*
ast
,
unsigned
colon_token
,
Class
*
klass
);
void
ctorInitializer
(
CtorInitializerAST
*
ast
,
Function
*
fun
);
void
ctorInitializer
(
CtorInitializerAST
*
ast
,
Function
*
fun
);
void
enumerator
(
EnumeratorAST
*
ast
);
void
enumerator
(
EnumeratorAST
*
ast
,
Enum
*
symbol
);
FullySpecifiedType
exceptionSpecification
(
ExceptionSpecificationAST
*
ast
,
const
FullySpecifiedType
&
init
);
FullySpecifiedType
exceptionSpecification
(
ExceptionSpecificationAST
*
ast
,
const
FullySpecifiedType
&
init
);
void
memInitializer
(
MemInitializerAST
*
ast
,
Function
*
fun
);
void
memInitializer
(
MemInitializerAST
*
ast
,
Function
*
fun
);
const
Name
*
nestedNameSpecifier
(
NestedNameSpecifierAST
*
ast
);
const
Name
*
nestedNameSpecifier
(
NestedNameSpecifierAST
*
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