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
f7164ae9
Commit
f7164ae9
authored
Dec 08, 2009
by
Roberto Raggi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduced TypenameArgument.
parent
2811d0ca
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
64 additions
and
0 deletions
+64
-0
src/shared/cplusplus/CPlusPlusForwardDeclarations.h
src/shared/cplusplus/CPlusPlusForwardDeclarations.h
+1
-0
src/shared/cplusplus/Control.cpp
src/shared/cplusplus/Control.cpp
+11
-0
src/shared/cplusplus/Control.h
src/shared/cplusplus/Control.h
+3
-0
src/shared/cplusplus/Symbol.cpp
src/shared/cplusplus/Symbol.cpp
+3
-0
src/shared/cplusplus/Symbol.h
src/shared/cplusplus/Symbol.h
+5
-0
src/shared/cplusplus/SymbolVisitor.h
src/shared/cplusplus/SymbolVisitor.h
+1
-0
src/shared/cplusplus/Symbols.cpp
src/shared/cplusplus/Symbols.cpp
+16
-0
src/shared/cplusplus/Symbols.h
src/shared/cplusplus/Symbols.h
+24
-0
No files found.
src/shared/cplusplus/CPlusPlusForwardDeclarations.h
View file @
f7164ae9
...
@@ -116,6 +116,7 @@ class UsingNamespaceDirective;
...
@@ -116,6 +116,7 @@ class UsingNamespaceDirective;
class
UsingDeclaration
;
class
UsingDeclaration
;
class
Declaration
;
class
Declaration
;
class
Argument
;
class
Argument
;
class
TypenameArgument
;
class
Function
;
class
Function
;
class
Namespace
;
class
Namespace
;
class
BaseClass
;
class
BaseClass
;
...
...
src/shared/cplusplus/Control.cpp
View file @
f7164ae9
...
@@ -327,6 +327,14 @@ public:
...
@@ -327,6 +327,14 @@ public:
return
argument
;
return
argument
;
}
}
TypenameArgument
*
newTypenameArgument
(
unsigned
sourceLocation
,
const
Name
*
name
)
{
TypenameArgument
*
argument
=
new
TypenameArgument
(
translationUnit
,
sourceLocation
,
name
);
symbols
.
push_back
(
argument
);
return
argument
;
}
Function
*
newFunction
(
unsigned
sourceLocation
,
const
Name
*
name
)
Function
*
newFunction
(
unsigned
sourceLocation
,
const
Name
*
name
)
{
{
Function
*
function
=
new
Function
(
translationUnit
,
Function
*
function
=
new
Function
(
translationUnit
,
...
@@ -641,6 +649,9 @@ NamedType *Control::namedType(const Name *name)
...
@@ -641,6 +649,9 @@ NamedType *Control::namedType(const Name *name)
Argument
*
Control
::
newArgument
(
unsigned
sourceLocation
,
const
Name
*
name
)
Argument
*
Control
::
newArgument
(
unsigned
sourceLocation
,
const
Name
*
name
)
{
return
d
->
newArgument
(
sourceLocation
,
name
);
}
{
return
d
->
newArgument
(
sourceLocation
,
name
);
}
TypenameArgument
*
Control
::
newTypenameArgument
(
unsigned
sourceLocation
,
const
Name
*
name
)
{
return
d
->
newTypenameArgument
(
sourceLocation
,
name
);
}
Function
*
Control
::
newFunction
(
unsigned
sourceLocation
,
const
Name
*
name
)
Function
*
Control
::
newFunction
(
unsigned
sourceLocation
,
const
Name
*
name
)
{
return
d
->
newFunction
(
sourceLocation
,
name
);
}
{
return
d
->
newFunction
(
sourceLocation
,
name
);
}
...
...
src/shared/cplusplus/Control.h
View file @
f7164ae9
...
@@ -122,6 +122,9 @@ public:
...
@@ -122,6 +122,9 @@ public:
/// Creates a new Argument symbol.
/// Creates a new Argument symbol.
Argument
*
newArgument
(
unsigned
sourceLocation
,
const
Name
*
name
=
0
);
Argument
*
newArgument
(
unsigned
sourceLocation
,
const
Name
*
name
=
0
);
/// Creates a new Argument symbol.
TypenameArgument
*
newTypenameArgument
(
unsigned
sourceLocation
,
const
Name
*
name
=
0
);
/// Creates a new Function symbol.
/// Creates a new Function symbol.
Function
*
newFunction
(
unsigned
sourceLocation
,
const
Name
*
name
=
0
);
Function
*
newFunction
(
unsigned
sourceLocation
,
const
Name
*
name
=
0
);
...
...
src/shared/cplusplus/Symbol.cpp
View file @
f7164ae9
...
@@ -463,6 +463,9 @@ bool Symbol::isDeclaration() const
...
@@ -463,6 +463,9 @@ bool Symbol::isDeclaration() const
bool
Symbol
::
isArgument
()
const
bool
Symbol
::
isArgument
()
const
{
return
asArgument
()
!=
0
;
}
{
return
asArgument
()
!=
0
;
}
bool
Symbol
::
isTypenameArgument
()
const
{
return
asTypenameArgument
()
!=
0
;
}
bool
Symbol
::
isBaseClass
()
const
bool
Symbol
::
isBaseClass
()
const
{
return
asBaseClass
()
!=
0
;
}
{
return
asBaseClass
()
!=
0
;
}
...
...
src/shared/cplusplus/Symbol.h
View file @
f7164ae9
...
@@ -204,6 +204,9 @@ public:
...
@@ -204,6 +204,9 @@ public:
/// Returns true if this Symbol is an Argument.
/// Returns true if this Symbol is an Argument.
bool
isArgument
()
const
;
bool
isArgument
()
const
;
/// Returns true if this Symbol is a Typename argument.
bool
isTypenameArgument
()
const
;
/// Returns true if this Symbol is a BaseClass.
/// Returns true if this Symbol is a BaseClass.
bool
isBaseClass
()
const
;
bool
isBaseClass
()
const
;
...
@@ -241,6 +244,7 @@ public:
...
@@ -241,6 +244,7 @@ public:
virtual
const
UsingDeclaration
*
asUsingDeclaration
()
const
{
return
0
;
}
virtual
const
UsingDeclaration
*
asUsingDeclaration
()
const
{
return
0
;
}
virtual
const
Declaration
*
asDeclaration
()
const
{
return
0
;
}
virtual
const
Declaration
*
asDeclaration
()
const
{
return
0
;
}
virtual
const
Argument
*
asArgument
()
const
{
return
0
;
}
virtual
const
Argument
*
asArgument
()
const
{
return
0
;
}
virtual
const
TypenameArgument
*
asTypenameArgument
()
const
{
return
0
;
}
virtual
const
BaseClass
*
asBaseClass
()
const
{
return
0
;
}
virtual
const
BaseClass
*
asBaseClass
()
const
{
return
0
;
}
virtual
const
ForwardClassDeclaration
*
asForwardClassDeclaration
()
const
{
return
0
;
}
virtual
const
ForwardClassDeclaration
*
asForwardClassDeclaration
()
const
{
return
0
;
}
virtual
const
ObjCBaseClass
*
asObjCBaseClass
()
const
{
return
0
;
}
virtual
const
ObjCBaseClass
*
asObjCBaseClass
()
const
{
return
0
;
}
...
@@ -262,6 +266,7 @@ public:
...
@@ -262,6 +266,7 @@ public:
virtual
UsingDeclaration
*
asUsingDeclaration
()
{
return
0
;
}
virtual
UsingDeclaration
*
asUsingDeclaration
()
{
return
0
;
}
virtual
Declaration
*
asDeclaration
()
{
return
0
;
}
virtual
Declaration
*
asDeclaration
()
{
return
0
;
}
virtual
Argument
*
asArgument
()
{
return
0
;
}
virtual
Argument
*
asArgument
()
{
return
0
;
}
virtual
TypenameArgument
*
asTypenameArgument
()
{
return
0
;
}
virtual
BaseClass
*
asBaseClass
()
{
return
0
;
}
virtual
BaseClass
*
asBaseClass
()
{
return
0
;
}
virtual
ForwardClassDeclaration
*
asForwardClassDeclaration
()
{
return
0
;
}
virtual
ForwardClassDeclaration
*
asForwardClassDeclaration
()
{
return
0
;
}
virtual
ObjCBaseClass
*
asObjCBaseClass
()
{
return
0
;
}
virtual
ObjCBaseClass
*
asObjCBaseClass
()
{
return
0
;
}
...
...
src/shared/cplusplus/SymbolVisitor.h
View file @
f7164ae9
...
@@ -72,6 +72,7 @@ public:
...
@@ -72,6 +72,7 @@ public:
virtual
bool
visit
(
UsingDeclaration
*
)
{
return
true
;
}
virtual
bool
visit
(
UsingDeclaration
*
)
{
return
true
;
}
virtual
bool
visit
(
Declaration
*
)
{
return
true
;
}
virtual
bool
visit
(
Declaration
*
)
{
return
true
;
}
virtual
bool
visit
(
Argument
*
)
{
return
true
;
}
virtual
bool
visit
(
Argument
*
)
{
return
true
;
}
virtual
bool
visit
(
TypenameArgument
*
)
{
return
true
;
}
virtual
bool
visit
(
BaseClass
*
)
{
return
true
;
}
virtual
bool
visit
(
BaseClass
*
)
{
return
true
;
}
virtual
bool
visit
(
Enum
*
)
{
return
true
;
}
virtual
bool
visit
(
Enum
*
)
{
return
true
;
}
virtual
bool
visit
(
Function
*
)
{
return
true
;
}
virtual
bool
visit
(
Function
*
)
{
return
true
;
}
...
...
src/shared/cplusplus/Symbols.cpp
View file @
f7164ae9
...
@@ -152,6 +152,22 @@ FullySpecifiedType Argument::type() const
...
@@ -152,6 +152,22 @@ FullySpecifiedType Argument::type() const
void
Argument
::
visitSymbol0
(
SymbolVisitor
*
visitor
)
void
Argument
::
visitSymbol0
(
SymbolVisitor
*
visitor
)
{
visitor
->
visit
(
this
);
}
{
visitor
->
visit
(
this
);
}
TypenameArgument
::
TypenameArgument
(
TranslationUnit
*
translationUnit
,
unsigned
sourceLocation
,
const
Name
*
name
)
:
Symbol
(
translationUnit
,
sourceLocation
,
name
)
{
}
TypenameArgument
::~
TypenameArgument
()
{
}
void
TypenameArgument
::
setType
(
const
FullySpecifiedType
&
type
)
{
_type
=
type
;
}
FullySpecifiedType
TypenameArgument
::
type
()
const
{
return
_type
;
}
void
TypenameArgument
::
visitSymbol0
(
SymbolVisitor
*
visitor
)
{
visitor
->
visit
(
this
);
}
Function
::
Function
(
TranslationUnit
*
translationUnit
,
unsigned
sourceLocation
,
const
Name
*
name
)
Function
::
Function
(
TranslationUnit
*
translationUnit
,
unsigned
sourceLocation
,
const
Name
*
name
)
:
ScopedSymbol
(
translationUnit
,
sourceLocation
,
name
),
:
ScopedSymbol
(
translationUnit
,
sourceLocation
,
name
),
_templateParameters
(
0
),
_templateParameters
(
0
),
...
...
src/shared/cplusplus/Symbols.h
View file @
f7164ae9
...
@@ -169,6 +169,30 @@ private:
...
@@ -169,6 +169,30 @@ private:
const
StringLiteral
*
_initializer
;
const
StringLiteral
*
_initializer
;
};
};
class
CPLUSPLUS_EXPORT
TypenameArgument
:
public
Symbol
{
public:
TypenameArgument
(
TranslationUnit
*
translationUnit
,
unsigned
sourceLocation
,
const
Name
*
name
);
virtual
~
TypenameArgument
();
void
setType
(
const
FullySpecifiedType
&
type
);
// Symbol's interface
virtual
FullySpecifiedType
type
()
const
;
virtual
const
TypenameArgument
*
asTypenameArgument
()
const
{
return
this
;
}
virtual
TypenameArgument
*
asTypenameArgument
()
{
return
this
;
}
protected:
virtual
void
visitSymbol0
(
SymbolVisitor
*
visitor
);
private:
FullySpecifiedType
_type
;
};
class
CPLUSPLUS_EXPORT
ScopedSymbol
:
public
Symbol
class
CPLUSPLUS_EXPORT
ScopedSymbol
:
public
Symbol
{
{
public:
public:
...
...
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