#ifndef VCZH_PARSING_PARSINGSTATE
#define VCZH_PARSING_PARSINGSTATE
#include "ParsingTable.h"
namespace
{
namespace
{
namespace
{
class
:
public
{
protected
:
class
:
public
,
public
collections
::
<
>
{
protected
:
const
*
;
;
;
;
;
public
:
(
const
*
,
);
(
const
&
);
collections
::
<
>*
()
const
override
;
const
&
()
const
override
;
()
const
override
;
bool
()
override
;
void
()
override
;
};
class
:
public
,
public
collections
::
<
>
{
protected
:
const
*
;
public
:
(
const
*
);
collections
::
<
>*
()
const
override
;
};
class
:
public
,
public
collections
::
<
>
{
protected
:
const
*
;
public
:
(
const
*
);
collections
::
<
>*
()
const
override
;
};
protected
:
collections
::
<
regex
::
>&
;
<
>
;
;
;
;
(
)
const
;
(
)
const
;
public
:
(
collections
::
<
regex
::
>&
,
<
>
);
();
const
collections
::
<
>&
()
const
;
const
collections
::
<
>&
()
const
;
void
();
bool
();
()
const
;
regex
::
*
()
const
;
()
const
;
};
class
:
public
{
public
:
struct
{
regex
::
*
;
regex
::
*
;
()
:shiftToken(
0
)
,reduceToken(
0
)
{
}
};
struct
{
enum
{
,
,
,
,
,
};
;
ambiguityAffectedStackNodeCount
;
;
;
;
;
;
regex
::
*
;
::
*
;
;
;
<
collections
::
<
>>
;
(
=
)
:transitionType(
)
,ambiguityAffectedStackNodeCount(
0
)
,tableTokenIndex(-
1
)
,tableStateSource(-
1
)
,tableStateTarget(-
1
)
,tokenIndexInStream(-
1
)
,token(
0
)
,transition(
0
)
,instructionBegin(-
1
)
,instructionCount(-
1
)
{
}
bool
()
const
{
return
!=
||
!=
0
;
}
void
(
regex
::
*
,
regex
::
*
)
{
;
range
.
=
;
range
.
=
;
if
(!
)
{
new
collections
::
<
>();
}
(
range
);
}
};
struct
{
;
;
collections
::
<
>
;
regex
::
*
;
;
::
*
;
*
;
*
;
()
:currentState(-
1
)
,reduceStateCount(
0
)
,selectedRegexToken(
0
)
,selectedToken(-
1
)
,selectedItem(
0
)
,previous(
0
)
,next(
0
)
{
}
*
()
{
*
=
new
;
future
->
=
;
future
->
=
;
(
future
->
,
);
future
->
=
;
future
->
=
;
future
->
=
;
future
->
=
;
return
future
;
}
};
struct
{
collections
::
<
>
;
;
;
collections
::
<
regex
::
*>
;
regex
::
*
;
regex
::
*
;
();
(
const
::
&
);
(
const
&
);
};
private
:
;
<
>
;
collections
::
<
regex
::
>
;
<
>
;
;
;
<
>
;
public
:
(
const
&
,
<
>
,
=-
1
);
();
const
&
();
<
>
();
const
collections
::
<
regex
::
>&
();
regex
::
*
(
);
(
const
&
);
();
();
();
GetCurrentTableTokenIndex
();
const
collections
::
<
>&
();
();
void
();
bool
TestTransitionItemInFuture
(
,
*
,
::
*
,
const
collections
::
<
>*
);
::
*
(
,
*
,
const
collections
::
<
>*
);
::
*
(
,
const
collections
::
<
>*
);
void
(
::
*
,
*
,
*
);
::
(
::
*
,
regex
::
*
,
,
,
bool
);
::
(
::
*
,
regex
::
*
);
bool
(
,
*
,
*
,
const
collections
::
<
>*
);
(
,
regex
::
*
,
const
collections
::
<
>*
);
();
bool
(
,
*
);
bool
(
,
*
,
collections
::
<
*>&
);
bool
(
collections
::
<
*>&
,
,
,
collections
::
<
*>&
);
bool
(
collections
::
<
*>&
,
,
,
collections
::
<
*>&
);
bool
ExploreLeftRecursiveReduce
(
collections
::
<
*>&
,
,
,
collections
::
<
*>&
);
*
();
<
>
();
void
(
<
>
);
};
class
ParsingTransitionProcessor
:
public
{
public
:
virtual
void
()=
0
;
virtual
bool
(
const
::
&
)=
0
;
virtual
bool
GetProcessingAmbiguityBranch
()=
0
;
};
class
:
public
ParsingTransitionProcessor
{
protected
:
<
>
;
<
>
;
collections
::
<
<
>>
;
bool
processingAmbiguityBranch
;
<
>
ambiguityBranchCreatedObject
;
<
>
ambiguityBranchOperationTarget
;
ambiguityBranchSharedNodeCount
;
collections
::
<
<
>>
;
collections
::
<
<
>>
;
public
:
();
();
void
()
override
;
bool
(
const
::
&
)
override
;
bool
GetProcessingAmbiguityBranch
()
override
;
<
>
()
const
;
};
class
ParsingTransitionCollector
:
public
ParsingTransitionProcessor
{
typedef
collections
::
<
::
>
;
protected
:
;
;
collections
::
<
,
>
;
collections
::
<
,
>
;
collections
::
<
,
>
;
public
:
ParsingTransitionCollector
();
~
ParsingTransitionCollector
();
void
()
override
;
bool
(
const
::
&
)
override
;
bool
GetProcessingAmbiguityBranch
()
override
;
const
&
()
const
;
(
)
const
;
const
collections
::
<
>&
GetAmbiguityBranchesFromBegin
(
)
const
;
GetAmbiguityBeginFromBranch
(
)
const
;
};
}
}
}
#endif