#include "WfCpp.h"
namespace
{
namespace
{
namespace
{
using
namespace
collections
;
using
namespace
regex
;
using
namespace
reflection
::
description
;
using
namespace
analyzer
;
class
:
public
traverse_visitor
::
{
public
:
*
;
*
=
nullptr
;
*
=
nullptr
;
*
=
nullptr
;
(
*
)
:config(
)
{
}
(
*
)
{
;
while
(
)
{
if
(
auto
=
->
.
<
>())
{
name
=
->
(
decl
.
) +
L"_"
+
name
;
}
=
->
.
();
}
return
name
;
}
void
(
WfOrderedLambdaExpression
*
)
override
{
=
L"__vwsno"
+
(
->
.
() +
1
) +
L"_"
+
->
+
L"_"
;
=
(
->
->
].
());
=
prefix
+
postfix
;
->
.
(
,
name
);
->
.
(
,
);
}
void
(
*
)
override
{
=
L"__vwsnf"
+
(
->
.
() +
1
) +
L"_"
+
->
+
L"_"
;
=
(
->
->
].
());
=
prefix
+
postfix
;
->
.
(
,
name
);
->
.
(
,
);
}
void
(
*
)
override
{
=
L"__vwsnc"
+
(
->
.
() +
1
) +
L"_"
+
->
+
L"_"
;
=
(
->
->
].
());
auto
=
->
->
];
auto
=
result
.
->
();
=
prefix
+
postfix
+
->
(
td
,
L"_"
);
->
.
(
,
name
);
->
.
(
,
);
}
void
(
*
)
override
{
if
(
!=
&& !
->
)
{
->
.
(
);
}
}
void
(
*
)
override
{
if
(
!=
&& !
->
)
{
->
.
(
);
}
}
void
(
*
)
override
{
->
.
(
,
);
->
.
(
->
->
].
(),
);
if
(!
)
{
;
if
(
auto
=
->
(
->
,
L"cpp"
,
L"File"
))
{
auto
=
->
(
att
);
CHECK_ERROR(attValue.type == runtime::WfInsType::String, L"Unexpected value in attribute: @cpp.File.");
do
{
if
(!(
attValue
.type ==
runtime
::
::
))
throw
(
L"Unexpected value in attribute: @cpp.File."
);}
while
(
0
);
file
=
attValue
.stringValue;
}
->
.
(
file
,
);
}
auto
=
;
=
;
traverse_visitor
::
::
(
);
=
oldSurroundingClassDecl
;
}
void
(
*
)
override
{
->
.
(
,
);
->
.
(
->
->
].
(),
);
}
void
(
*
)
override
{
->
.
(
,
);
->
.
(
->
->
].
(),
);
}
void
(
*
)
override
{
auto
=
;
=
->
.
();
traverse_visitor
::
::
(
);
=
old
;
}
void
(
*
)
override
{
auto
=
;
=
->
.
();
traverse_visitor
::
::
(
);
=
old
;
}
};
void
(
*
,
<
>
)
{
(
).
(
.
());
}
class
WfCppCollectClassExprInfoVisitor
:
public
empty_visitor
::
{
public
:
*
;
=
0
;
<
analyzer
::
>
;
WfCppCollectClassExprInfoVisitor
(
*
)
:config(
)
{
}
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
{
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
(
*
)
{
->
->
];
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
);)
{
memberDecl
(
this
);
}
}
};
<
::
>
::
(
<
>
)
{
using
=
<
,
<
analyzer
::
>>;
auto
=
<
>();
*
=
nullptr
;
if
(
auto
=
.
<
WfOrderedLambdaExpression
>())
{
(
info
,
(
->
ordered
.
()]
)
.Select([](
<
>
)
{
return
(
symbol
,
symbol
);
})
);
scope
=
->
ordered
.
()].
();
}
else
if
(
auto
=
.
<
>())
{
(
info
,
(
->
funcExpr
.
()]
)
.Select([](
<
>
)
{
return
(
symbol
,
symbol
);
})
);
scope
=
->
funcExpr
.
()].
();
}
else
if
(
auto
=
.
<
>())
{
WfCppCollectClassExprInfoVisitor
(
this
);
visitor
.
(
classExpr
.
());
if
(
visitor
.
)
{
(
info
,
(
visitor
.
)
.Skip(
visitor
.
)
.Select([](
<
>
)
{
return
(
symbol
,
symbol
);
})
);
(
info
,
(
visitor
.
)
.Select([](
<
>
)
{
return
(
symbol
,
symbol
);
})
);
}
scope
=
->
classExpr
.
()].
();
}
<
>
;
while
(
scope
)
{
if
(
scope
->
)
{
if
(
methodConfig
)
{
info
.
(
scope
->
);
if
(!
methodConfig
)
{
break
;
}
methodConfig
nullptr
;
}
}
if
(
scope
->
)
{
if
(
scope
->
)
{
methodConfig
scope
->
;
}
}
scope
=
scope
->
.
();
}
return
info
;
}
void
::
()
{
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
);)
{
(
this
,
module
);
}
FOREACH(Ptr<WfExpression>, lambda, lambdaExprs.Keys())
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
.
());
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
lambda
);)
{
auto
=
(
lambda
);
closureInfo
lambda
.
()];
.
(
lambda
,
closureInfo
);
}
FOREACH(Ptr<WfNewInterfaceExpression>, classExpr, classExprs.Keys())
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
.
());
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
classExpr
);)
{
auto
=
(
classExpr
);
closureInfo
classExpr
.
()];
.
(
classExpr
,
closureInfo
);
}
}
}
}
}