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
b47eee88
Commit
b47eee88
authored
Nov 10, 2009
by
Roberto Raggi
Browse files
Cleanup Attributes
parent
24b6c858
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/shared/cplusplus/AST.h
View file @
b47eee88
...
...
@@ -296,7 +296,7 @@ public:
unsigned
attribute_token
;
unsigned
first_lparen_token
;
unsigned
second_lparen_token
;
AttributeAST
*
attributes
;
Attribute
List
AST
*
attributes
;
unsigned
first_rparen_token
;
unsigned
second_rparen_token
;
...
...
@@ -318,7 +318,6 @@ public:
unsigned
tag_token
;
ExpressionListAST
*
expression_list
;
unsigned
rparen_token
;
AttributeAST
*
next
;
public:
virtual
AttributeAST
*
asAttribute
()
{
return
this
;
}
...
...
src/shared/cplusplus/ASTVisit.cpp
View file @
b47eee88
...
...
@@ -42,8 +42,7 @@ void SimpleSpecifierAST::accept0(ASTVisitor *visitor)
void
AttributeSpecifierAST
::
accept0
(
ASTVisitor
*
visitor
)
{
if
(
visitor
->
visit
(
this
))
{
for
(
AttributeAST
*
it
=
attributes
;
it
;
it
=
it
->
next
)
accept
(
it
,
visitor
);
accept
(
attributes
,
visitor
);
}
visitor
->
endVisit
(
this
);
}
...
...
src/shared/cplusplus/ASTfwd.h
View file @
b47eee88
...
...
@@ -201,6 +201,7 @@ typedef List<MemInitializerAST *> MemInitializerListAST;
typedef
List
<
NewArrayDeclaratorAST
*>
NewArrayDeclaratorListAST
;
typedef
List
<
PostfixAST
*>
PostfixListAST
;
typedef
List
<
PostfixDeclaratorAST
*>
PostfixDeclaratorListAST
;
typedef
List
<
AttributeAST
*>
AttributeListAST
;
typedef
List
<
NameAST
*>
ObjCIdentifierListAST
;
typedef
List
<
ObjCMessageArgumentAST
*>
ObjCMessageArgumentListAST
;
...
...
src/shared/cplusplus/Parser.cpp
View file @
b47eee88
...
...
@@ -2689,32 +2689,24 @@ bool Parser::parseAttributeSpecifier(SpecifierAST *&node)
return
true
;
}
bool
Parser
::
parseAttributeList
(
AttributeAST
*&
node
)
bool
Parser
::
parseAttributeList
(
Attribute
List
AST
*&
node
)
// ### create the AST
{
DEBUG_THIS_RULE
();
AttributeAST
**
attribute_ptr
=
&
node
;
while
(
LA
()
==
T_IDENTIFIER
||
LA
()
==
T_CONST
)
{
AttributeAST
*
ast
=
new
(
_pool
)
AttributeAST
;
ast
->
identifier_token
=
consumeToken
();
if
(
LA
()
==
T_LPAREN
)
{
ast
->
lparen_token
=
consumeToken
();
if
(
LA
()
==
T_IDENTIFIER
&&
(
LA
(
2
)
==
T_COMMA
||
LA
(
2
)
==
T_RPAREN
))
{
ast
->
tag_token
=
consumeToken
();
if
(
LA
()
==
T_COMMA
)
parseExpressionList
(
ast
->
expression_list
);
}
else
{
parseExpressionList
(
ast
->
expression_list
);
}
match
(
T_RPAREN
,
&
ast
->
rparen_token
);
while
(
LA
()
==
T_CONST
||
LA
()
==
T_IDENTIFIER
)
{
if
(
LA
()
==
T_CONST
)
consumeToken
();
else
if
(
LA
()
==
T_IDENTIFIER
)
{
ExpressionAST
*
expression
=
0
;
parseExpression
(
expression
);
}
*
attribute_ptr
=
ast
;
if
(
LA
()
!=
T_COMMA
)
break
;
consumeToken
();
attribute_ptr
=
&
(
*
attribute_ptr
)
->
next
;
consumeToken
();
// skip T_COMMA
}
return
true
;
}
...
...
src/shared/cplusplus/Parser.h
View file @
b47eee88
...
...
@@ -190,7 +190,7 @@ public:
bool
parseBuiltinTypeSpecifier
(
SpecifierAST
*&
node
);
bool
parseAttributeSpecifier
(
SpecifierAST
*&
node
);
bool
parseAttributeList
(
AttributeAST
*&
node
);
bool
parseAttributeList
(
Attribute
List
AST
*&
node
);
bool
parseSimpleTypeSpecifier
(
SpecifierAST
*&
node
)
{
return
parseDeclSpecifierSeq
(
node
,
true
,
true
);
}
...
...
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