#include "WfAnalyzer.h"
namespace
{
namespace
{
namespace
{
using
namespace
reflection
::
description
;
using
namespace
typeimpl
;
class
:
public
,
public
::
,
public
::
{
public
:
*
;
<
>
;
<
>
;
<
>
;
(
*
,
<
>
,
<
>
,
<
>
)
:manager(
)
, scopeName(
)
, classDecl(
)
, td(
)
{
}
static
(
*
,
<
>
)
{
=
;
{
*
=
;
while
(
name
&&
name
!=
->
.
())
{
typeName
=
name
->
+
L"::"
+
typeName
;
name
=
name
->
;
}
}
return
typeName
;
}
static
void
(
*
,
<
>
,
<
>
,
<
>
)
{
->
.
(
,
);
if
(!
)
{
=
.
();
->
.
(
.
(),
);
}
}
static
void
(
*
,
<
>
,
<
>
)
{
=
(
,
);
<
>
;
switch
(
)
{
case
::
:
td
<
>(
typeName
);
break
;
case
::
:
td
<
>(
typeName
);
break
;
}
(
,
,
,
td
);
FOREACH(Ptr<WfDeclaration>, memberDecl, declaration->declarations)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
memberDecl
);)
{
(
,
,
,
td
);
memberDecl
(&
visitor
);
}
}
void
(
*
)
override
{
}
void
(
*
)
override
{
if
(
->
==
::
)
{
auto
=
<
>();
(
->
.
,
info
);
->
.
(
,
info
);
}
else
{
switch
(
)
{
case
::
:
{
auto
=
<
>();
(
->
.
,
info
);
->
.
(
,
info
);
}
break
;
case
::
:
{
auto
=
<
>();
(
->
.
,
info
);
->
.
(
,
info
);
}
break
;
}
}
}
void
(
*
)
override
{
auto
=
<
>(
.
(),
->
.
);
(
info
);
->
.
(
,
info
);
}
void
(
*
)
override
{
auto
=
<
>(
.
(),
->
.
);
(
info
);
->
.
(
,
info
);
}
void
(
*
)
override
{
auto
=
<
>(
.
(),
->
.
);
(
info
);
->
.
(
,
info
);
}
void
(
*
)
override
{
<
>
;
{
auto
=
<
>(
.
(),
::
);
if
(
->
==
::
)
{
typeInfo
<
>(
elementType
);
}
else
{
typeInfo
<
>(
elementType
);
}
}
auto
=
<
>(
typeInfo
);
(
info
);
->
.
(
,
info
);
}
void
(
*
)
override
{
}
void
(
*
)
override
{
auto
=
(
->
.
,
false
);
newScopeName
.
(
);
(
,
newScopeName
,
);
}
void
(
*
)
override
{
(
,
,
);
}
void
(
*
)
override
{
(
,
,
);
}
void
(
*
)
override
{
FOREACH(Ptr<WfDeclaration>, decl, node->expandedDeclarations)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
decl
);)
{
decl
(
this
);
}
}
void
(
*
)
override
{
->
((
::
*)
this
);
}
void
(
WfStateMachineDeclaration
*
)
override
{
FOREACH(Ptr<WfStateInput>, input, node->inputs)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
input
);)
{
auto
=
<
>();
(
input
.
,
info
);
->
.
(
input
,
info
);
FOREACH(Ptr<WfFunctionArgument>, argument, input->arguments)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
input
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
argument
);)
{
auto
=
<
>(
.
(),
L"<stateip-"
+
input
.
+
L">"
+
argument
.
);
(
info
);
->
.
(
argument
.
(),
info
);
}
}
FOREACH(Ptr<WfStateDeclaration>, state, node->states)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
state
);)
{
FOREACH(Ptr<WfFunctionArgument>, argument, state->arguments)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
state
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
argument
);)
{
auto
=
<
>(
.
(),
L"<statesp-"
+
state
.
+
L">"
+
argument
.
);
(
info
);
->
.
(
argument
.
(),
info
);
}
}
auto
=
<
>();
{
smInfo
<
>();
(
L"<state>CreateCoroutine"
,
smInfo
);
}
->
.
(
,
smInfo
);
}
};
class
BuildNameDeclarationVisitor
:
public
empty_visitor
::
,
public
empty_visitor
::
VirtualCseDeclarationVisitor
{
public
:
*
;
<
>
;
BuildNameDeclarationVisitor
(
*
,
<
>
)
:manager(
)
, scopeName(
)
{
}
void
(
*
)
override
{
FOREACH(Ptr<WfDeclaration>, decl, node->expandedDeclarations)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
decl
);)
{
decl
(
this
);
}
}
void
(
*
)
override
{
->
((
::
*)
this
);
}
void
(
*
)
override
{
->
.
(
,
);
FOREACH(Ptr<WfDeclaration>, subDecl, node->declarations)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
subDecl
);)
{
(
,
,
subDecl
.
());
}
}
void
(
*
)
override
{
::
(
,
,
);
}
void
(
*
)
override
{
auto
=
<
>(
->
==
::
,
::
(
,
));
::
(
,
,
,
td
);
}
void
(
*
)
override
{
auto
=
<
>(
::
(
,
));
::
(
,
,
,
td
);
}
};
void
(
*
,
<
>
,
*
)
{
auto
=
(
->
.
,
false
);
scopeName
.
(
);
BuildNameDeclarationVisitor
(
,
scopeName
);
->
(&
visitor
);
}
void
BuildGlobalNameFromModules
(
*
)
{
FOREACH(Ptr<WfModule>, module, manager->GetModules())
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
());
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
module
);)
{
FOREACH(Ptr<WfDeclaration>, decl, module->declarations)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
module
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
decl
);)
{
(
,
->
,
decl
.
());
}
}
}
}
}
}