#include "ParsingAutomaton.h"
namespace
{
namespace
{
using
namespace
collections
;
using
namespace
definitions
;
namespace
{
<
>
CreateNondeterministicPDAFromEpsilonPDA
(
<
>
)
{
<
>
=
new
(
);
FOREACH(ParsingDefinitionRuleDefinition*, rule, epsilonPDA->orderedRulesDefs)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
ParsingDefinitionRuleDefinition
*>&
= ::
vl
::
collections
::
(
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
ParsingDefinitionRuleDefinition
*
;
__foreach_iterator__
.
(
rule
);)
{
<
>
=
rule
];
<
>
=
new
;
automaton
(
rule
,
newRuleInfo
);
newRuleInfo
=
automaton
(
rule
);
newRuleInfo
=
automaton
(
rule
);
newRuleInfo
=
automaton
(
rule
);
<
*,
*>
;
<
*>
;
=
0
;
oldNewStateMap
.
(
ruleInfo
,
newRuleInfo
);
oldNewStateMap
.
(
ruleInfo
,
newRuleInfo
);
oldNewStateMap
.
(
ruleInfo
,
newRuleInfo
);
scanningStates
.
(
ruleInfo
);
(
oldNewStateMap
,
scanningStates
,
automaton
);
<
*>
;
(
newStates
,
(
)
.Where([&](
<
>
) {
return
oldNewStateMap
.
().
(
s
.
()); })
.Select([&](
<
>
) {
return
oldNewStateMap
s
.
()]; })
);
(
automaton
,
newRuleInfo
,
newStates
);
(
automaton
,
newRuleInfo
,
newStates
);
newRuleInfo
=
newRuleInfo
->
0
]->
;
FOREACH(State*, state, newStates)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
*>&
= ::
vl
::
collections
::
(
newStates
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
*
;
__foreach_iterator__
.
(
state
);)
{
if
(
state
->
)
{
newRuleInfo
.
(
state
);
}
}
}
return
automaton
;
}
}
}
}