#include "WfExpression.h"
namespace
{
namespace
{
using
namespace
stream
;
using
namespace
collections
;
using
namespace
parsing
;
void
(
vl
::
collections
::
<
vl
::
<
>>&
,
const
vl
::
collections
::
<
vl
::
regex
::
>&
)
{
FOREACH(Ptr<WfDeclaration>, decl, value)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
decl
);)
{
if
(!
decl
)
{
decl
<
>();
decl
decl
;
decl
=
::
;
}
}
}
void
(
vl
::
parsing
::
&
,
bool
)
{
.
([&](
&
)
{
=
?
.
.
(
2
,
.
.
() -
3
) :
.
.
(
1
,
.
.
() -
2
);
const
wchar_t
*
=
input
.
();
while
(
wchar_t
= *
reading
++)
{
if
(
c
==
L'\\'
)
{
switch
(
wchar_t
= *
reading
++)
{
case
L'r'
:
writer
.
(
'\r'
);
break
;
case
L'n'
:
writer
.
(
'\n'
);
break
;
case
L't'
:
writer
.
(
'\t'
);
break
;
default
:
writer
.
(
e
);
}
}
else
{
writer
.
(
c
);
}
}
});
}
void
(
vl
::
parsing
::
&
,
const
vl
::
collections
::
<
vl
::
regex
::
>&
)
{
(
,
true
);
}
void
(
vl
::
parsing
::
&
,
const
vl
::
collections
::
<
vl
::
regex
::
>&
)
{
(
,
false
);
}
void
(
const
&
,
&
)
{
.
(
L'\"'
);
const
wchar_t
*
=
.
();
while
(
wchar_t
= *
reading
++)
{
switch
(
c
)
{
case
'\r'
:
.
(
L"\\r"
);
break
;
case
'\n'
:
.
(
L"\\n"
);
break
;
case
'\t'
:
.
(
L"\\t"
);
break
;
case
'\"'
:
.
(
L"\\\""
);
break
;
case
'\\'
:
.
(
L"\\\\"
);
break
;
default
:
.
(
c
);
}
}
.
(
L'\"'
);
}
class
:
public
,
public
::
{
public
:
;
&
;
(
const
&
,
&
)
:indent(
), writer(
)
{
}
void
(
*
)
override
{
.
(
);
switch
(
->
)
{
case
::
:
.
(
L"void"
);
break
;
case
::
:
.
(
L"object"
);
break
;
case
::
:
.
(
L"interface"
);
break
;
case
::
:
.
(
L"int"
);
break
;
case
::
:
.
(
L"uint"
);
break
;
case
::
:
.
(
L"float"
);
break
;
case
::
:
.
(
L"double"
);
break
;
case
::
:
.
(
L"string"
);
break
;
case
::
:
.
(
L"char"
);
break
;
case
::
:
.
(
L"bool"
);
break
;
default
:
CHECK_FAIL(L"Internal error: Unknown value.");
do
{
throw
(
L"Internal error: Unknown value."
);}
while
(
0
);
}
.
(
);
}
void
(
*
)
override
{
.
(
);
.
(
L"::"
+
->
.
);
.
(
);
}
void
(
*
)
override
{
.
(
);
.
(
->
.
);
.
(
);
}
void
(
*
)
override
{
.
(
);
(
->
,
,
);
.
(
L"*"
);
.
(
);
}
void
(
*
)
override
{
.
(
);
(
->
,
,
);
.
(
L"^"
);
.
(
);
}
void
(
*
)
override
{
.
(
);
(
->
,
,
);
.
(
L"?"
);
.
(
);
}
void
(
*
)
override
{
.
(
);
(
->
,
,
);
.
(
L"{}"
);
.
(
);
}
void
(
*
)
override
{
.
(
);
switch
(
->
)
{
case
::
:
.
(
L"const "
);
break
;
case
::
:
break
;
default
:
CHECK_FAIL(L"Internal error: Unknown value.");
do
{
throw
(
L"Internal error: Unknown value."
);}
while
(
0
);
}
(
->
,
,
);
.
(
L"["
);
if
(
->
)
{
(
->
,
,
);
}
.
(
L"]"
);
.
(
);
}
void
(
*
)
override
{
.
(
);
.
(
L"observe "
);
(
->
,
,
);
.
(
L"[]"
);
.
(
);
}
void
(
*
)
override
{
.
(
);
.
(
L"(func "
);
.
(
L"("
);
FOREACH_INDEXER(Ptr<WfType>, type, index, node->arguments)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
if
(
bool
=
true
)
for
(
=
0
;
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
type
);
index
++)
{
if
(
index
>
0
)
{
.
(
L", "
);
}
(
type
,
,
);
}
.
(
L")"
);
.
(
L" : ("
);
(
->
,
,
);
.
(
L"))"
);
.
(
);
}
void
(
*
)
override
{
.
(
);
(
->
,
,
);
.
(
L"::"
);
.
(
->
.
);
.
(
);
}
};
class
:
public
,
public
::
,
public
::
,
public
::
{
public
:
;
&
;
(
const
&
,
&
)
:indent(
), writer(
)
{
}
void
(
*
)
override
{
.
(
);
.
(
L"this"
);
.
(
);
}
void
(
*
)
override
{
.
(
);
.
(
L"::"
);
.
(
->
.
);
.
(
);
}
void
(
*
)
override
{
.
(
);
.
(
->
.
);
.
(
);
}
void
(
*
)
override
{
.
(
);
.
(
->
.
);
.
(
);
}
void
(
WfOrderedLambdaExpression
*
)
override
{
.
(
);
.
(
L"["
);
(
->
,
,
);
.
(
L"]"
);
.
(
);
}
void
(
*
)
override
{
.
(
);
(
->
,
,
);
.
(
L"."
);
.
(
->
.
);
.
(
);
}
void
(
*
)
override
{
.
(
);
(
->
,
,
);
.
(
L"::"
);
.
(
->
.
);
.
(
);
}
void
(
*
)
override
{
.
(
);
switch
(
->
)
{
case
::
:
.
(
L"null"
);
break
;
case
::
:
.
(
L"true"
);
break
;
case
::
:
.
(
L"false"
);
break
;
default
:
CHECK_FAIL(L"Internal error: Unknown value.");
do
{
throw
(
L"Internal error: Unknown value."
);}
while
(
0
);
}
.
(
);
}
void
(
*
)
override
{
.
(
);
.
(
->
.
);
.
(
);
}
void
(
*
)
override
{
.
(
);
.
(
->
.
);
.
(
);
}
void
(
*
)
override
{
.
(
);
(
->
.
,
);
.
(
);
}
void
(
*
)
override
{
.
(
);
.
(
L"("
);
switch
(
->
)
{
case
::
:
.
(
L"+"
);
break
;
case
::
:
.
(
L"-"
);
break
;
case
::
:
.
(
L"!"
);
break
;
default
:
CHECK_FAIL(L"Internal error: Unknown value.");
do
{
throw
(
L"Internal error: Unknown value."
);}
while
(
0
);
}
(
->
,
,
);
.
(
L")"
);
.
(
);
}
void
(
*
)
override
{
.
(
);
if
(
->
==
::
)
{
(
->
,
,
);
.
(
L"["
);
(
->
,
,
);
.
(
L"]"
);
}
else
{
.
(
L"("
);
(
->
,
,
);
switch
(
->
)
{
case
::
:
.
(
L" = "
);
break
;
case
::
:
.
(
L" & "
);
break
;
case
::
:
.
(
L" | "
);
break
;
case
::
:
.
(
L" ?? "
);
break
;
case
::
:
.
(
L" ^ "
);
break
;
case
::
:
.
(
L" + "
);
break
;
case
::
:
.
(
L" - "
);
break
;
case
::
:
.
(
L" * "
);
break
;
case
::
:
.
(
L" / "
);
break
;
case
::
:
.
(
L" % "
);
break
;
case
::
:
.
(
L" shl "
);
break
;
case
::
:
.
(
L" shr "
);
break
;
case
::
:
.
(
L" < "
);
break
;
case
::
:
.
(
L" > "
);
break
;
case
::
:
.
(
L" <= "
);
break
;
case
::
:
.
(
L" >= "
);
break
;
case
::
:
.
(
L" == "
);
break
;
case
::
:
.
(
L" != "
);
break
;
case
::
:
.
(
L" xor "
);
break
;
case
::
:
.
(
L" and "
);
break
;
case
::
:
.
(
L" or "
);
break
;
default
:
CHECK_FAIL(L"Internal error: Unknown value.");
do
{
throw
(
L"Internal error: Unknown value."
);}
while
(
0
);
}
(
->
,
,
);
.
(
L")"
);
}
.
(
);
}
void
(
*
)
override
{
.
(
);
.
(
L"let "
);
FOREACH_INDEXER(Ptr<WfLetVariable>, var, index, node->variables)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
if
(
bool
=
true
)
for
(
=
0
;
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
var
);
index
++)
{
if
(
index
>
0
)
{
.
(
L", "
);
}
.
(
var
.
());
.
(
var
.
);
.
(
L" = "
);
(
var
,
,
);
.
(
var
.
());
}
.
(
L" in ("
);
(
->
,
,
);
.
(
L")"
);
.
(
);
}
void
(
*
)
override
{
.
(
);
(
->
,
,
);
.
(
L" ? "
);
(
->
,
,
);
.
(
L" : "
);
(
->
,
,
);
.
(
);
}
void
(
*
)
override
{
.
(
);
.
(
L"range "
);
switch
(
->
)
{
case
::
:
.
(
L"("
);
break
;
case
::
:
.
(
L"["
);
break
;
default
:
CHECK_FAIL(L"Internal error: Unknown value.");
do
{
throw
(
L"Internal error: Unknown value."
);}
while
(
0
);
}
(
->
,
,
);
.
(
L", "
);
(
->
,
,
);
switch
(
->
)
{
case
::
:
.
(
L")"
);
break
;
case
::
:
.
(
L"]"
);
break
;
default
:
CHECK_FAIL(L"Internal error: Unknown value.");
do
{
throw
(
L"Internal error: Unknown value."
);}
while
(
0
);
}
.
(
);
}
void
(
*
)
override
{
.
(
);
(
->
,
,
);
switch
(
->
)
{
case
::
:
.
(
L" in "
);
break
;
case
::
:
.
(
L" not in "
);
break
;
default
:
CHECK_FAIL(L"Internal error: Unknown value.");
do
{
throw
(
L"Internal error: Unknown value."
);}
while
(
0
);
}
(
->
,
,
);
.
(
);
}
void
(
*
)
override
{
.
(
);
.
(
L"{"
);
FOREACH_INDEXER(Ptr<WfConstructorArgument>, argument, index, node->arguments)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
if
(
bool
=
true
)
for
(
=
0
;
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
argument
);
index
++)
{
if
(
index
>
0
)
{
.
(
L" "
);
}
(
argument
,
,
);
if
(
argument
)
{
.
(
L" : "
);
(
argument
,
,
);
}
.
(
L";"
);
}
.
(
L"}"
);
.
(
);
}
void
(
*
)
override
{
.
(
);
(
->
,
,
);
.
(
L" of ("
);
(
->
,
,
);
.
(
L")"
);
.
(
);
}
void
(
*
)
override
{
.
(
);
switch
(
->
)
{
case
::
:
.
(
L"(cast ("
);
(
->
,
,
);
.
(
L") "
);
(
->
,
,
);
.
(
L")"
);
break
;
case
::
:
.
(
L"("
);
(
->
,
,
);
.
(
L" as ("
);
(
->
,
,
);
.
(
L"))"
);
break
;
default
:
CHECK_FAIL(L"Internal error: Unknown value.");
do
{
throw
(
L"Internal error: Unknown value."
);}
while
(
0
);
}
.
(
);
}
void
(
*
)
override
{
.
(
);
(
->
,
,
);
switch
(
->
)
{
case
::
:
.
(
L" is ("
);
(
->
,
,
);
.
(
L")"
);
break
;
case
::
:
.
(
L" is not ("
);
(
->
,
,
);
.
(
L")"
);
break
;
case
::
:
.
(
L" is null"
);
break
;
case
::
:
.
(
L" is not null"
);
break
;
default
:
CHECK_FAIL(L"Internal error: Unknown value.");
do
{
throw
(
L"Internal error: Unknown value."
);}
while
(
0
);
}
.
(
);
}
void
(
*
)
override
{
.
(
);
.
(
L"typeof("
);
(
->
,
,
);
.
(
L")"
);
.
(
);
}
void
(
WfTypeOfExpressionExpression
*
)
override
{
.
(
);
.
(
L"type("
);
(
->
,
,
);
.
(
L")"
);
.
(
);
}
void
(
*
)
override
{
.
(
);
.
(
L"attach("
);
(
->
,
,
);
.
(
L", "
);
(
->
,
,
);
.
(
L")"
);
.
(
);
}
void
(
*
)
override
{
.
(
);
.
(
L"detach("
);
(
->
,
,
);
.
(
L", "
);
(
->
,
,
);
.
(
L")"
);
.
(
);
}
void
(
*
)
override
{
.
(
);
(
->
,
,
);
.
(
L".observe"
);
switch
(
->
)
{
case
::
:
.
(
L" as "
);
.
(
->
.
);
break
;
case
::
:
break
;
default
:
CHECK_FAIL(L"Internal error: Unknown value.");
do
{
throw
(
L"Internal error: Unknown value."
);}
while
(
0
);
}
.
(
L"("
);
(
->
,
,
);
if
(
->
.
() >
0
)
{
.
(
L" on "
);
FOREACH_INDEXER(Ptr<WfExpression>, argument, index, node->events)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
if
(
bool
=
true
)
for
(
=
0
;
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
argument
);
index
++)
{
if
(
index
>
0
)
{
.
(
L", "
);
}
(
argument
,
,
);
}
}
.
(
L")"
);
.
(
);
}
void
(
*
)
override
{
.
(
);
(
->
,
,
);
.
(
L"("
);
FOREACH_INDEXER(Ptr<WfExpression>, argument, index, node->arguments)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
if
(
bool
=
true
)
for
(
=
0
;
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
argument
);
index
++)
{
if
(
index
>
0
)
{
.
(
L", "
);
}
(
argument
,
,
);
}
.
(
L")"
);
.
(
);
}
void
(
*
)
override
{
.
(
);
(
<
>(
->
),
,
);
.
(
);
}
void
(
*
)
override
{
.
(
);
.
(
L"new ("
);
(
->
,
,
);
.
(
L")"
);
.
(
L"("
);
FOREACH_INDEXER(Ptr<WfExpression>, argument, index, node->arguments)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
if
(
bool
=
true
)
for
(
=
0
;
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
argument
);
index
++)
{
if
(
index
>
0
)
{
.
(
L", "
);
}
(
argument
,
,
);
}
.
(
L")"
);
.
(
);
}
void
(
*
)
override
{
.
(
);
.
(
L"new ("
);
(
->
,
,
);
.
(
L")"
);
.
(
L""
);
.
(
);
.
(
L"{"
);
FOREACH_INDEXER(Ptr<WfDeclaration>, decl, index, node->declarations)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
if
(
bool
=
true
)
for
(
=
0
;
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
decl
);
index
++)
{
if
(
index
>
0
)
{
.
(
L""
);
}
.
(
+
L" "
);
(
decl
,
+
L" "
,
);
.
(
L""
);
}
.
(
);
.
(
L"}"
);
.
(
);
}
void
(
*
)
override
{
if
(
->
)
{
.
(
);
(
->
,
,
);
.
(
);
}
else
{
->
((
::
*)
this
);
}
}
void
(
*
)
override
{
.
(
);
.
(
L"$"
);
(
->
.
,
);
.
(
);
}
void
(
*
)
override
{
if
(
->
)
{
.
(
);
(
->
,
,
);
.
(
);
}
else
{
->
((
::
*)
this
);
}
}
void
(
*
)
override
{
.
(
);
.
(
L"bind("
);
(
->
,
,
);
.
(
L")"
);
.
(
);
}
void
(
*
)
override
{
.
(
);
if
(
->
.
==
L""
)
{
.
(
L"$coroutine"
);
}
else
{
.
(
L"$coroutine("
);
.
(
->
.
);
.
(
L")"
);
}
.
(
);
(
->
,
,
);
.
(
);
}
void
(
*
)
override
{
.
(
);
.
(
L"new ("
);
(
->
,
,
);
.
(
L")"
);
.
(
L"(using "
);
(
->
,
,
);
.
(
L")"
);
.
(
);
}
void
(
WfExpectedTypeCastExpression
*
)
override
{
.
(
);
switch
(
->
)
{
case
::
:
.
(
L"(cast * "
);
(
->
,
,
);
.
(
L")"
);
break
;
case
::
:
.
(
L"("
);
(
->
,
,
);
.
(
L" as *)"
);
break
;
default
:
CHECK_FAIL(L"Internal error: Unknown value.");
do
{
throw
(
L"Internal error: Unknown value."
);}
while
(
0
);
}
.
(
);
}
void
(
*
)
override
{
.
(
);
.
(
L"$."
);
.
(
->
.
);
.
(
);
}
};
class
:
public
,
public
::
,
public
::
,
public
::
,
public
::
{
public
:
;
&
;
(
const
&
,
&
)
:indent(
), writer(
)
{
}
void
(
*
)
override
{
.
(
);
.
(
L"break;"
);
.
(
);
}
void
(
*
)
override
{
.
(
);
.
(
L"continue;"
);
.
(
);
}
void
(
*
)
override
{
.
(
);
if
(
->
)
{
.
(
L"return "
);
(
->
,
,
);
.
(
L";"
);
}
else
{
.
(
L"return;"
);
}
.
(
);
}
void
(
*
)
override
{
.
(
);
.
(
L"delete "
);
(
->
,
,
);
.
(
L";"
);
.
(
);
}
void
(
WfRaiseExceptionStatement
*
)
override
{
.
(
);
if
(
->
)
{
.
(
L"raise "
);
(
->
,
,
);
.
(
L";"
);
}
else
{
.
(
L"raise;"
);
}
.
(
);
}
void
(
*
)
override
{
.
(
);
.
(
L"if ("
);
if
(
->
)
{
.
(
L"var "
);
.
(
->
.
);
.
(
L" : "
);
(
->
,
,
);
.
(
L" = "
);
}
(
->
,
,
);
.
(
L")"
);
.
(
);
(
->
,
,
);
if
(
->
)
{
.
(
L""
);
.
(
);
if
(
->
.
<
>())
{
.
(
L"else "
);
(
->
,
,
);
}
else
{
.
(
L"else"
);
.
(
);
(
->
,
,
);
}
}
.
(
);
}
void
(
*
)
override
{
.
(
);
.
(
L"while ("
);
(
->
,
,
);
.
(
L")"
);
.
(
);
(
->
,
,
);
.
(
);
}
void
(
*
)
override
{
.
(
);
.
(
L"try"
);
.
(
);
(
->
,
,
);
if
(
->
)
{
.
(
L""
);
.
(
);
.
(
L"catch ("
);
.
(
->
.
);
.
(
L")"
);
.
(
);
(
->
,
,
);
}
if
(
->
)
{
.
(
L""
);
.
(
);
.
(
L"finally"
);
.
(
);
(
->
,
,
);
}
.
(
);
}
void
(
*
)
override
{
.
(
);
.
(
L"{"
);
FOREACH(Ptr<WfStatement>, statement, node->statements)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
statement
);)
{
.
(
+
L" "
);
(
statement
,
+
L" "
,
);
.
(
L""
);
}
if
(
->
.
!=
L""
)
{
.
(
+
L" "
);
.
(
->
.
);
.
(
L":;"
);
}
.
(
);
.
(
L"}"
);
.
(
);
}
void
(
*
)
override
{
.
(
);
.
(
L"goto "
);
.
(
->
.
);
.
(
L";"
);
.
(
);
}
void
(
*
)
override
{
.
(
);
(
->
,
,
);
.
(
L";"
);
.
(
);
}
void
(
*
)
override
{
.
(
);
(
<
>(
->
),
,
);
.
(
);
}
void
(
*
)
override
{
if
(
->
)
{
.
(
);
(
->
,
,
);
.
(
);
}
else
{
->
((
::
*)
this
);
}
}
void
(
*
)
override
{
.
(
);
.
(
L"switch ("
);
(
->
,
,
);
.
(
L")"
);
.
(
);
.
(
L"{"
);
FOREACH(Ptr<WfSwitchCase>, switchCase, node->caseBranches)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
switchCase
);)
{
.
(
switchCase
.
());
.
(
);
.
(
L" case "
);
(
switchCase
,
,
);
.
(
L":"
);
.
(
+
L" "
);
(
switchCase
,
+
L" "
,
);
.
(
switchCase
.
());
.
(
L""
);
}
if
(
->
)
{
.
(
);
.
(
L" default:"
);
.
(
+
L" "
);
(
->
,
+
L" "
,
);
.
(
L""
);
}
.
(
);
.
(
L"}"
);
.
(
);
}
void
(
*
)
override
{
.
(
);
.
(
L"for ("
);
.
(
->
.
);
.
(
L" in "
);
switch
(
->
)
{
case
::
:
.
(
L"reversed "
);
break
;
case
::
:
break
;
default
:
CHECK_FAIL(L"Internal error: Unknown value.");
do
{
throw
(
L"Internal error: Unknown value."
);}
while
(
0
);
}
(
->
,
,
);
.
(
L")"
);
.
(
);
(
->
,
,
);
.
(
);
}
void
(
*
)
override
{
.
(
);
if
(
->
.
==
L""
)
{
.
(
L"$"
);
}
else
{
.
(
->
.
);
.
(
L" "
);
}
(
->
,
,
);
.
(
);
}
void
(
*
)
override
{
->
((
::
*)
this
);
}
void
(
*
)
override
{
.
(
);
if
(
->
)
{
.
(
L"$pause"
);
.
(
);
(
->
,
,
);
}
else
{
.
(
L"$pause;"
);
}
.
(
);
}
void
(
*
)
override
{
if
(
->
.
!=
L""
)
{
.
(
L"var "
);
.
(
->
.
);
.
(
L" = "
);
}
.
(
->
.
);
FOREACH_INDEXER(Ptr<WfExpression>, argument, index, node->arguments)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
if
(
bool
=
true
)
for
(
=
0
;
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
argument
);
index
++)
{
.
(
index
==
0
?
L" "
:
L", "
);
(
argument
,
,
);
}
.
(
L";"
);
}
void
(
*
)
override
{
->
((
::
*)
this
);
}
void
(
*
)
override
{
.
(
);
.
(
L"switch ("
);
switch
(
->
)
{
case
::
:
.
(
L"raise)"
);
break
;
case
::
:
.
(
L"continue)"
);
break
;
case
::
:
.
(
L"continue, return)"
);
break
;
case
::
:
.
(
L")"
);
break
;
case
::
:
.
(
L"return)"
);
break
;
default
:
CHECK_FAIL(L"Internal error: Unknown value.");
do
{
throw
(
L"Internal error: Unknown value."
);}
while
(
0
);
}
.
(
);
.
(
L"{"
);
FOREACH(Ptr<WfStateSwitchCase>, switchCase, node->caseBranches)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
switchCase
);)
{
.
(
switchCase
.
());
.
(
);
.
(
L" case "
);
.
(
switchCase
.
);
.
(
L"("
);
FOREACH_INDEXER(Ptr<WfStateSwitchArgument>, argument, index, switchCase->arguments)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
switchCase
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
if
(
bool
=
true
)
for
(
=
0
;
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
argument
);
index
++)
{
if
(
index
!=
0
)
.
(
L", "
);
.
(
argument
.
());
.
(
argument
.
);
.
(
argument
.
());
}
.
(
L"):"
);
.
(
+
L" "
);
(
switchCase
,
+
L" "
,
);
.
(
switchCase
.
());
.
(
L""
);
}
.
(
);
.
(
L"}"
);
.
(
);
}
void
(
*
)
override
{
.
(
);
switch
(
->
)
{
case
::
:
.
(
L"$goto_state "
);
break
;
case
::
:
.
(
L"push_state "
);
break
;
default
:
CHECK_FAIL(L"Internal error: Unknown value.");
do
{
throw
(
L"Internal error: Unknown value."
);}
while
(
0
);
}
.
(
->
.
);
.
(
L"("
);
FOREACH_INDEXER(Ptr<WfExpression>, argument, index, node->arguments)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
if
(
bool
=
true
)
for
(
=
0
;
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
argument
);
index
++)
{
if
(
index
!=
0
)
.
(
L", "
);
(
argument
,
,
);
}
.
(
L");"
);
.
(
);
}
};
class
:
public
,
public
::
,
public
::
,
public
::
{
public
:
;
&
;
(
const
&
,
&
)
:indent(
), writer(
)
{
}
void
(
*
)
override
{
.
(
);
.
(
L"namespace "
+
->
.
);
.
(
);
.
(
L"{"
);
FOREACH_INDEXER(Ptr<WfDeclaration>, decl, index, node->declarations)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
if
(
bool
=
true
)
for
(
=
0
;
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
decl
);
index
++)
{
if
(
index
!=
0
)
{
.
(
L""
);
}
.
(
+
L" "
);
(
decl
,
+
L" "
,
);
.
(
L""
);
}
.
(
);
.
(
L"}"
);
.
(
);
}
void
(
*
)
override
{
.
(
);
.
(
L"func "
);
switch
(
->
)
{
case
::
:
.
(
->
.
);
break
;
case
::
:
break
;
default
:
CHECK_FAIL(L"Internal error: Unknown value.");
do
{
throw
(
L"Internal error: Unknown value."
);}
while
(
0
);
}
.
(
L"("
);
FOREACH_INDEXER(Ptr<WfFunctionArgument>, argument, index, node->arguments)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
if
(
bool
=
true
)
for
(
=
0
;
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
argument
);
index
++)
{
if
(
index
>
0
)
{
.
(
L", "
);
}
.
(
argument
.
());
FOREACH(Ptr<WfAttribute>, attribute, argument->attributes)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
argument
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
attribute
);)
{
(
attribute
,
,
);
.
(
L" "
);
}
.
(
argument
.
);
.
(
L" : "
);
(
argument
,
,
);
.
(
argument
.
());
}
.
(
L")"
);
.
(
L" : ("
);
(
->
,
,
);
.
(
L")"
);
if
(
->
)
{
.
(
L""
);
.
(
);
(
->
,
,
);
}
else
{
.
(
L";"
);
}
.
(
);
}
void
(
*
)
override
{
.
(
);
.
(
L"var "
);
.
(
->
.
);
if
(
->
)
{
.
(
L" : "
);
(
->
,
,
);
}
.
(
L" = "
);
(
->
,
,
);
.
(
L";"
);
.
(
);
}
void
(
*
)
override
{
.
(
);
.
(
L"event "
);
.
(
->
.
);
.
(
L"("
);
FOREACH_INDEXER(Ptr<WfType>, type, index, node->arguments)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
if
(
bool
=
true
)
for
(
=
0
;
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
type
);
index
++)
{
if
(
index
!=
0
)
{
.
(
L", "
);
}
(
type
,
,
);
}
.
(
L");"
);
.
(
);
}
void
(
*
)
override
{
.
(
);
.
(
L"prop "
);
.
(
->
.
);
.
(
L" : "
);
(
->
,
,
);
.
(
L"{"
);
.
(
->
.
);
if
(
->
.
!=
L""
)
{
.
(
L", "
);
.
(
->
.
);
}
if
(
->
.
!=
L""
)
{
.
(
L" : "
);
.
(
->
.
);
}
.
(
L"}"
);
.
(
);
}
void
(
*
)
override
{
.
(
);
switch
(
->
)
{
case
::
:
.
(
L"new* "
);
break
;
case
::
:
.
(
L"new "
);
break
;
default
:
CHECK_FAIL(L"Internal error: Unknown value.");
do
{
throw
(
L"Internal error: Unknown value."
);}
while
(
0
);
}
.
(
L"("
);
FOREACH_INDEXER(Ptr<WfFunctionArgument>, argument, index, node->arguments)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
if
(
bool
=
true
)
for
(
=
0
;
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
argument
);
index
++)
{
if
(
index
>
0
)
{
.
(
L", "
);
}
.
(
argument
.
());
.
(
argument
.
);
.
(
L" : "
);
(
argument
,
,
);
.
(
argument
.
());
}
.
(
L")"
);
FOREACH_INDEXER(Ptr<WfBaseConstructorCall>, call, callIndex, node->baseConstructorCalls)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
if
(
bool
=
true
)
for
(
=
0
;
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
call
);
callIndex
++)
{
.
(
L""
);
.
(
+
L" "
);
if
(
callIndex
==
0
)
{
.
(
L":"
);
}
else
{
.
(
L","
);
}
.
(
call
.
());
(
call
,
+
L" "
,
);
.
(
L"("
);
FOREACH_INDEXER(Ptr<WfExpression>, argument, argumentIndex, call->arguments)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
call
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
if
(
bool
=
true
)
for
(
=
0
;
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
argument
);
argumentIndex
++)
{
if
(
argumentIndex
!=
0
)
{
.
(
L", "
);
}
(
argument
,
+
L" "
,
);
}
.
(
L")"
);
.
(
call
.
());
}
.
(
L""
);
.
(
);
(
->
,
,
);
.
(
);
}
void
(
*
)
override
{
.
(
);
.
(
L"delete"
);
.
(
);
(
->
,
,
);
.
(
);
}
void
(
*
)
override
{
.
(
);
switch
(
->
)
{
case
::
:
.
(
L"class "
);
break
;
case
::
:
.
(
L"interface "
);
break
;
default
:
CHECK_FAIL(L"Internal error: Unknown value.");
do
{
throw
(
L"Internal error: Unknown value."
);}
while
(
0
);
}
.
(
->
.
);
switch
(
->
)
{
case
::
:
switch
(
->
)
{
case
::
:
break
;
default
:
CHECK_FAIL(L"Internal error: Unknown value.");
do
{
throw
(
L"Internal error: Unknown value."
);}
while
(
0
);
}
break
;
case
::
:
switch
(
->
)
{
case
::
:
.
(
L"*"
);
case
::
:
break
;
default
:
CHECK_FAIL(L"Internal error: Unknown value.");
do
{
throw
(
L"Internal error: Unknown value."
);}
while
(
0
);
}
break
;
}
FOREACH_INDEXER(Ptr<WfType>, type, index, node->baseTypes)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
if
(
bool
=
true
)
for
(
=
0
;
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
type
);
index
++)
{
if
(
index
==
0
)
{
.
(
L" : "
);
}
else
{
.
(
L", "
);
}
(
type
,
,
);
}
.
(
L""
);
.
(
+
L"{"
);
FOREACH_INDEXER(Ptr<WfDeclaration>, decl, index, node->declarations)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
if
(
bool
=
true
)
for
(
=
0
;
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
decl
);
index
++)
{
if
(
index
>
0
)
{
.
(
L""
);
}
.
(
+
L" "
);
(
decl
,
+
L" "
,
);
.
(
L""
);
}
.
(
+
L"}"
);
.
(
);
}
void
(
*
)
override
{
.
(
);
switch
(
->
)
{
case
::
:
.
(
L"enum "
);
break
;
case
::
:
.
(
L"flagenum "
);
break
;
default
:
CHECK_FAIL(L"Internal error: Unknown value.");
do
{
throw
(
L"Internal error: Unknown value."
);}
while
(
0
);
}
.
(
->
.
);
.
(
+
L"{"
);
auto
=
+
L" "
;
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
);)
{
.
(
item
.
());
FOREACH(Ptr<WfAttribute>, attribute, item->attributes)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
item
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
attribute
);)
{
.
(
newIndent
);
(
attribute
,
newIndent
,
);
.
(
L""
);
}
.
(
newIndent
);
.
(
item
.
);
.
(
L" = "
);
switch
(
item
)
{
case
::
:
.
(
item
.
);
break
;
case
::
:
FOREACH_INDEXER(Ptr<WfEnumItemIntersection>, itemInt, index, item->intersections)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
item
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
if
(
bool
=
true
)
for
(
=
0
;
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
itemInt
);
index
++)
{
if
(
index
!=
0
)
.
(
L" | "
);
.
(
itemInt
.
);
}
break
;
default
:
CHECK_FAIL(L"Internal error: Unknown value.");
do
{
throw
(
L"Internal error: Unknown value."
);}
while
(
0
);
}
.
(
item
.
());
.
(
L","
);
}
.
(
+
L"}"
);
.
(
);
}
void
(
*
)
override
{
.
(
);
.
(
L"struct "
);
.
(
->
.
);
.
(
+
L"{"
);
auto
=
+
L" "
;
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
);)
{
.
(
member
.
());
FOREACH(Ptr<WfAttribute>, attribute, member->attributes)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
member
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
attribute
);)
{
.
(
newIndent
);
(
attribute
,
newIndent
,
);
.
(
L""
);
}
.
(
newIndent
);
.
(
member
.
);
.
(
L" : "
);
(
member
,
newIndent
,
);
.
(
L";"
);
.
(
member
.
());
}
.
(
+
L"}"
);
.
(
);
}
void
PrintExpandedDeclarations
(
<
<
>>&
)
{
FOREACH_INDEXER(Ptr<WfDeclaration>, decl, index, decls)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
if
(
bool
=
true
)
for
(
=
0
;
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
decl
);
index
++)
{
if
(
index
>
0
)
{
.
(
L""
);
.
(
);
}
(
decl
,
,
);
if
(
index
<
.
() -
1
)
{
.
(
L""
);
}
}
}
void
(
*
)
override
{
if
(
->
.
() >
0
)
{
.
(
);
PrintExpandedDeclarations
(
->
);
.
(
);
}
else
{
->
(
static_cast
<
::
*>(
this
));
}
}
void
(
WfAutoPropertyDeclaration
*
)
override
{
.
(
);
.
(
L"prop "
);
.
(
->
.
);
.
(
L" : "
);
(
->
,
,
);
if
(
->
)
{
.
(
L" = "
);
(
->
,
,
);
}
.
(
L" {"
);
switch
(
->
)
{
case
::
:
switch
(
->
)
{
case
::
:
.
(
L"const, not observe"
);
break
;
case
::
:
.
(
L"const"
);
break
;
default
:
CHECK_FAIL(L"Internal error: Unknown value.");
do
{
throw
(
L"Internal error: Unknown value."
);}
while
(
0
);
}
break
;
case
::
:
switch
(
->
)
{
case
::
:
.
(
L"not observe"
);
break
;
case
::
:
break
;
default
:
CHECK_FAIL(L"Internal error: Unknown value.");
do
{
throw
(
L"Internal error: Unknown value."
);}
while
(
0
);
}
break
;
default
:
CHECK_FAIL(L"Internal error: Unknown value.");
do
{
throw
(
L"Internal error: Unknown value."
);}
while
(
0
);
}
.
(
L"}"
);
.
(
);
}
void
(
WfCastResultInterfaceDeclaration
*
)
override
{
.
(
);
.
(
L"$interface "
);
.
(
->
.
);
.
(
L" : "
);
(
->
,
,
);
.
(
L"<"
);
(
->
,
,
);
.
(
L">;"
);
.
(
);
}
void
(
*
)
override
{
if
(
->
.
() >
0
)
{
.
(
);
PrintExpandedDeclarations
(
->
);
.
(
);
}
else
{
->
(
static_cast
<
::
*>(
this
));
}
}
void
(
WfStateMachineDeclaration
*
)
override
{
.
(
);
.
(
L"$state_machine"
);
.
(
+
L"{"
);
FOREACH_INDEXER(Ptr<WfStateInput>, input, index, node->inputs)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
if
(
bool
=
true
)
for
(
=
0
;
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
input
);
index
++)
{
if
(
index
!=
0
)
.
(
L""
);
.
(
input
.
());
.
(
+
L" $state_input "
);
.
(
input
.
);
.
(
L"("
);
FOREACH_INDEXER(Ptr<WfFunctionArgument>, argument, index, input->arguments)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
input
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
if
(
bool
=
true
)
for
(
=
0
;
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
argument
);
index
++)
{
if
(
index
>
0
)
{
.
(
L", "
);
}
.
(
argument
.
());
.
(
argument
.
);
.
(
L" : "
);
(
argument
,
,
);
.
(
argument
.
());
}
.
(
L");"
);
.
(
input
.
());
}
FOREACH_INDEXER(Ptr<WfStateDeclaration>, state, index, node->states)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
if
(
bool
=
true
)
for
(
=
0
;
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
state
);
index
++)
{
if
(
index
!=
0
||
->
.
() >
0
)
.
(
L""
);
.
(
state
.
());
.
(
+
L" $state "
);
if
(
state
.
==
L""
)
{
.
(
L"default"
);
}
else
{
.
(
state
.
);
}
.
(
L"("
);
FOREACH_INDEXER(Ptr<WfFunctionArgument>, argument, index, state->arguments)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
state
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
if
(
bool
=
true
)
for
(
=
0
;
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
argument
);
index
++)
{
if
(
index
>
0
)
{
.
(
L", "
);
}
.
(
argument
.
());
.
(
argument
.
);
.
(
L" : "
);
(
argument
,
,
);
.
(
argument
.
());
}
.
(
L")"
);
.
(
+
L" "
);
(
state
,
+
L" "
,
);
.
(
state
.
());
.
(
L""
);
}
.
(
+
L"}"
);
.
(
);
}
};
void
(
<
>
,
const
&
,
parsing
::
&
)
{
.
(
.
());
.
(
L"@"
);
.
(
.
);
.
(
L":"
);
.
(
.
);
if
(
)
{
.
(
L"("
);
(
,
,
);
.
(
L")"
);
}
.
(
.
());
}
void
(
<
>
,
const
&
,
parsing
::
&
)
{
(
,
);
(&
visitor
);
}
void
(
<
>
,
const
&
,
parsing
::
&
)
{
(
,
);
(&
visitor
);
}
void
(
<
>
,
const
&
,
parsing
::
&
)
{
(
,
);
(&
visitor
);
}
void
(
<
>
,
const
&
,
parsing
::
&
)
{
FOREACH(Ptr<WfAttribute>, attribute, node->attributes)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
attribute
);)
{
(
attribute
,
,
);
.
(
L""
);
.
(
);
}
if
(
)
{
switch
(
)
{
case
::
:
break
;
case
::
:
.
(
L"static "
);
break
;
case
::
:
.
(
L"override "
);
break
;
default
:
CHECK_FAIL(L"Internal error: Unknown value.");
do
{
throw
(
L"Internal error: Unknown value."
);}
while
(
0
);
}
}
(
,
);
(&
visitor
);
}
void
(
<
>
,
const
&
,
parsing
::
&
)
{
.
(
);
switch
(
)
{
case
::
:
.
(
L"module "
+
.
+
L";"
);
break
;
case
::
:
.
(
L"unit "
+
.
+
L";"
);
break
;
default
:
CHECK_FAIL(L"Internal error: Unknown value.");
do
{
throw
(
L"Internal error: Unknown value."
);}
while
(
0
);
}
FOREACH(Ptr<WfModuleUsingPath>, path, node->paths)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
path
);)
{
.
(
);
.
(
L"using "
);
FOREACH_INDEXER(Ptr<WfModuleUsingItem>, item, index, path->items)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
path
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
if
(
bool
=
true
)
for
(
=
0
;
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
item
);
index
++)
{
if
(
index
>
0
)
{
.
(
L"::"
);
}
FOREACH(Ptr<WfModuleUsingFragment>, fragment, item->fragments)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
item
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
fragment
);)
{
if
(
auto
=
fragment
.
<
WfModuleUsingNameFragment
>())
{
.
(
name
.
);
}
else
{
.
(
L"*"
);
}
}
}
.
(
L";"
);
}
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
);)
{
.
(
L""
);
.
(
);
(
decl
,
,
);
.
(
L""
);
}
}
void
(
<
>
,
const
&
,
stream
::
&
)
{
(
);
(
,
,
parsingWriter
);
}
void
(
<
>
,
const
&
,
stream
::
&
)
{
(
);
(
,
,
parsingWriter
);
}
void
(
<
>
,
const
&
,
stream
::
&
)
{
(
);
(
,
,
parsingWriter
);
}
void
(
<
>
,
const
&
,
stream
::
&
)
{
(
);
(
,
,
parsingWriter
);
}
void
(
<
>
,
const
&
,
stream
::
&
)
{
(
);
(
,
,
parsingWriter
);
}
void
(
<
>
,
const
&
,
stream
::
&
)
{
(
);
(
,
,
parsingWriter
);
}
}
}