#include "WfAnalyzer.h"
namespace
{
namespace
{
namespace
{
using
namespace
collections
;
using
namespace
parsing
;
using
namespace
reflection
;
using
namespace
reflection
::
description
;
using
namespace
typeimpl
;
class
CompleteScopeForClassMemberVisitor
:
public
,
public
::
,
public
::
{
public
:
*
;
<
>
;
<
>
;
CompleteScopeForClassMemberVisitor
(
*
,
<
>
,
<
>
)
:manager(
)
, td(
)
{
}
void
(
*
)
override
{
}
void
(
*
)
override
{
auto
=
->
];
auto
=
->
].
<
>();
FOREACH(Ptr<WfFunctionArgument>, argument, node->arguments)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
argument
);)
{
if
(
auto
=
(
scope
.
(),
argument
))
{
auto
=
<
>(
info
.
(),
argument
.
,
typeInfo
);
info
(
paramInfo
);
}
}
if
(
auto
=
(
scope
.
(),
->
))
{
info
(
typeInfo
);
}
}
void
(
*
)
override
{
auto
=
->
];
if
(
auto
=
(
scope
.
(),
->
))
{
auto
=
->
].
<
>();
info
(
typeInfo
);
}
}
void
(
*
)
override
{
auto
=
->
];
auto
=
<
>();
{
auto
=
<
>();
voidType
=
::
;
type
voidType
;
}
FOREACH(Ptr<WfType>, argument, node->arguments)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
argument
);)
{
type
.
(
argument
);
}
if
(
auto
=
(
scope
.
(),
type
))
{
auto
=
->
].
<
>();
info
(
typeInfo
);
}
}
void
(
*
)
override
{
auto
=
->
];
auto
=
->
].
<
>();
if
(
->
.
!=
L""
)
{
info
(
dynamic_cast
<
*>(
(
->
.
,
false
)->
(
0
)));
}
if
(
->
.
!=
L""
)
{
info
(
dynamic_cast
<
*>(
(
->
.
,
false
)->
(
0
)));
}
if
(
->
.
!=
L""
)
{
info
(
dynamic_cast
<
*>(
(
->
.
,
false
)));
}
}
void
(
*
)
override
{
auto
=
->
];
auto
=
->
].
<
>();
FOREACH(Ptr<WfFunctionArgument>, argument, node->arguments)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
argument
);)
{
if
(
auto
=
(
scope
.
(),
argument
))
{
auto
=
<
>(
info
.
(),
argument
.
,
typeInfo
);
info
(
paramInfo
);
}
}
}
void
(
*
)
override
{
}
void
(
*
)
override
{
CompleteScopeForDeclaration
(
,
);
}
void
(
*
)
override
{
CompleteScopeForDeclaration
(
,
);
}
void
(
*
)
override
{
CompleteScopeForDeclaration
(
,
);
}
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
{
auto
=
->
];
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
.
()];
method
(
<
void
>::
());
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
);)
{
if
(
auto
=
(
scope
.
(),
argument
))
{
auto
=
->
argument
.
()];
field
(
typeInfo
);
method
(
<
>(
method
.
(),
argument
.
,
typeInfo
));
}
}
}
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
);)
{
if
(
auto
=
(
scope
.
(),
argument
))
{
auto
=
->
argument
.
()];
field
(
typeInfo
);
}
}
}
auto
&
=
->
];
smInfo
(
<
>(
smInfo
.
(),
L"<state>startState"
,
<
>::
()));
smInfo
(
<
void
>::
());
}
static
void
(
*
,
<
>
,
<
>
,
<
>
)
{
CompleteScopeForClassMemberVisitor
(
,
,
);
(&
visitor
);
}
};
class
CompleteScopeForDeclarationVisitor
:
public
,
public
::
,
public
::
{
public
:
*
;
<
>
;
CompleteScopeForDeclarationVisitor
(
*
,
<
>
)
:manager(
)
, declaration(
)
{
}
void
(
*
)
override
{
FOREACH(Ptr<WfDeclaration>, decl, node->declarations)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
decl
);)
{
CompleteScopeForDeclaration
(
,
decl
);
}
}
void
(
*
)
override
{
}
void
(
*
)
override
{
}
void
(
*
)
override
{
}
void
(
*
)
override
{
}
void
(
*
)
override
{
}
void
(
*
)
override
{
}
void
(
*
)
override
{
auto
=
->
];
auto
=
->
].
<
>();
if
(
->
.
() >
0
)
{
FOREACH(Ptr<WfType>, baseType, node->baseTypes)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
baseType
);)
{
if
(
auto
=
GetScopeNameFromReferenceType
(
scope
.
(),
baseType
))
{
if
(
scopeName
)
{
td
(
scopeName
);
}
}
}
}
else
if
(
->
==
::
)
{
td
(
description
::
<
>());
}
else
if
(
->
==
::
)
{
td
(
description
::
<
>());
}
if
(
->
==
::
)
{
switch
(
->
)
{
case
::
:
{
auto
=
<
>(
td
.
(),
::
);
auto
=
<
>(
elementType
);
auto
=
<
>(
pointerType
);
td
(
ctor
);
}
break
;
case
::
:
{
auto
=
<
>(
td
.
(),
::
);
auto
=
<
>(
elementType
);
auto
=
<
>(
pointerType
);
td
(
ctor
);
}
break
;
default
:;
}
}
FOREACH(Ptr<WfDeclaration>, memberDecl, node->declarations)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
memberDecl
);)
{
CompleteScopeForClassMember
(
,
td
,
,
memberDecl
);
}
}
void
(
*
)
override
{
auto
=
->
].
<
>();
<
,
>
;
FOREACH(Ptr<WfEnumItem>, item, node->items)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
item
);)
{
=
0
;
switch
(
item
)
{
case
::
:
TypedValueSerializerProvider
<
>::
(
item
.
,
value
);
break
;
case
::
:
FOREACH(Ptr<WfEnumItemIntersection>, itemInt, item->intersections)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
item
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
itemInt
);)
{
value
|=
items
itemInt
.
];
}
break
;
}
td
(
item
.
,
value
);
items
.
(
item
.
,
value
);
}
}
void
(
*
)
override
{
auto
=
->
];
auto
=
->
].
<
>();
FOREACH(Ptr<WfStructMember>, member, node->members)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
member
);)
{
if
(
auto
=
(
scope
.
(),
member
))
{
auto
=
<
>(
td
.
(),
member
.
);
field
(
typeInfo
);
td
(
field
);
}
}
}
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
);
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
(
WfStateMachineDeclaration
*
)
override
{
}
static
void
(
*
,
<
>
)
{
CompleteScopeForDeclarationVisitor
(
,
);
(&
visitor
);
}
};
void
CompleteScopeForClassMember
(
*
,
<
>
,
<
>
,
<
>
)
{
CompleteScopeForClassMemberVisitor
::
(
,
,
,
);
}
void
CompleteScopeForDeclaration
(
*
,
<
>
)
{
CompleteScopeForDeclarationVisitor
::
(
,
);
}
void
(
*
,
<
>
)
{
FOREACH(Ptr<WfDeclaration>, declaration, module->declarations)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
declaration
);)
{
CompleteScopeForDeclaration
(
,
declaration
);
}
}
}
}
}