#include "WfAnalyzer.h"
namespace
{
namespace
{
namespace
{
class
ValidateScopeNameDeclarationVisitor
:
public
,
public
::
,
public
::
{
public
:
enum
{
,
,
,
,
,
};
*
;
<
>
;
;
ValidateScopeNameDeclarationVisitor
(
*
,
<
>
)
:manager(
)
, name(
)
, category(
&&
?
:
)
{
}
void
(
*
)
{
;
switch
(
)
{
case
:
categoryName
=
L"type"
;
break
;
case
:
categoryName
=
L"variable"
;
break
;
case
:
categoryName
=
L"function"
;
break
;
case
:
categoryName
=
L"namespace"
;
break
;
default
:
CHECK_FAIL(L"ValidateScopeNameDeclarationVisitor::AddError(WfDeclaration*)#Internal error.");
do
{
throw
(
L"ValidateScopeNameDeclarationVisitor::AddError(WfDeclaration*)#Internal error."
);}
while
(
0
);
}
->
.
(
::
(
,
categoryName
));
}
void
(
*
)
override
{
if
(
==
)
{
=
;
}
else
if
(
!=
)
{
(
);
}
}
void
(
*
)
override
{
if
(
==
)
{
=
;
}
else
if
(
!=
)
{
(
);
}
}
void
(
*
)
override
{
if
(
==
)
{
=
;
}
else
{
(
);
}
}
void
(
*
)
override
{
CHECK_FAIL(L"ValidateScopeNameDeclarationVisitor::Visit(WfEventDeclaration*)#Internal error, ValidateDeclarationStructure function should check correctly.");
do
{
throw
(
L"ValidateScopeNameDeclarationVisitor::Visit(WfEventDeclaration*)#Internal error, ValidateDeclarationStructure function should check correctly."
);}
while
(
0
);
}
void
(
*
)
override
{
CHECK_FAIL(L"ValidateScopeNameDeclarationVisitor::Visit(WfPropertyDeclaration*)#Internal error, ValidateDeclarationStructure function should check correctly.");
do
{
throw
(
L"ValidateScopeNameDeclarationVisitor::Visit(WfPropertyDeclaration*)#Internal error, ValidateDeclarationStructure function should check correctly."
);}
while
(
0
);
}
void
(
*
)
override
{
CHECK_FAIL(L"ValidateScopeNameDeclarationVisitor::Visit(WfConstructorDeclaration*)#Internal error, ValidateDeclarationStructure function should check correctly.");
do
{
throw
(
L"ValidateScopeNameDeclarationVisitor::Visit(WfConstructorDeclaration*)#Internal error, ValidateDeclarationStructure function should check correctly."
);}
while
(
0
);
}
void
(
*
)
override
{
CHECK_FAIL(L"ValidateScopeNameDeclarationVisitor::Visit(WfDestructorDeclaration*)#Internal error, ValidateDeclarationStructure function should check correctly.");
do
{
throw
(
L"ValidateScopeNameDeclarationVisitor::Visit(WfDestructorDeclaration*)#Internal error, ValidateDeclarationStructure function should check correctly."
);}
while
(
0
);
}
void
(
*
)
override
{
if
(
==
)
{
=
;
}
else
{
(
);
}
}
void
(
*
)
override
{
if
(
==
)
{
=
;
}
else
{
(
);
}
}
void
(
*
)
override
{
if
(
==
)
{
=
;
}
else
{
(
);
}
}
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
{
CHECK_FAIL(L"ValidateScopeNameDeclarationVisitor::Visit(WfStateMachineDeclaration*)#Internal error, ValidateDeclarationStructure function should check correctly.");
do
{
throw
(
L"ValidateScopeNameDeclarationVisitor::Visit(WfStateMachineDeclaration*)#Internal error, ValidateDeclarationStructure function should check correctly."
);}
while
(
0
);
}
};
void
(
*
,
<
>
)
{
ValidateScopeNameDeclarationVisitor
(
,
);
FOREACH(Ptr<WfDeclaration>, declaration, name->declarations)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
declaration
);)
{
declaration
(&
visitor
);
}
FOREACH(Ptr<WfLexicalScopeName>, child, name->children.Values())
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
.
());
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
child
);)
{
(
,
child
);
}
}
}
}
}