#include "RegexPure.h"
namespace
{
namespace
{
::
(
::
,
::
&
)
:transition(
0
)
,finalState(
0
)
,relatedFinalState(
0
)
{
=
.
();
=
.
()+
1
;
=
.
(
);
for
(
=
0
;
i
<
;
i
++)
{
[
i
]=
-
1
;
}
for
(
=
0
;
i
<
.
();
i
++)
{
=
i
];
for
(
=
range
.
;
j
<=
range
.
;
j
++)
{
[
j
]=
i
;
}
}
=
new
*[
];
for
(
=
0
;
i
<
;
i
++)
{
[
i
]=
new
[
];
for
(
=
0
;
j
<
;
j
++)
{
[
i
][
j
]=-
1
;
}
*
=
i
].
();
for
(
=
0
;
j
<
state
->
.
();
j
++)
{
*
=
state
->
j
];
switch
(
dfaTransition
->
)
{
case
::
:
{
=
.
(
dfaTransition
->
);
if
(
index
==-
1
)
{
CHECK_ERROR(false, L"PureInterpretor::PureInterpretor(Automaton::Ref, CharRange::List&)#Specified chars don't appear in the normalized char ranges.");
do
{
if
(!(
false
))
throw
(
L"PureInterpretor::PureInterpretor(Automaton::Ref, CharRange::List&)#Specified chars don't appear in the normalized char ranges."
);}
while
(
0
);
}
[
i
][
index
]=
.
(
dfaTransition
->
);
}
break
;
default
:
CHECK_ERROR(false, L"PureInterpretor::PureInterpretor(Automaton::Ref, CharRange::List&)#PureInterpretor only accepts Transition::Chars transitions.");
do
{
if
(!(
false
))
throw
(
L"PureInterpretor::PureInterpretor(Automaton::Ref, CharRange::List&)#PureInterpretor only accepts Transition::Chars transitions."
);}
while
(
0
);
}
}
}
=
new
bool
[
];
for
(
=
0
;
i
<
;
i
++)
{
[
i
]=
i
]
;
}
}
::
()
{
if
(
)
delete
[]
;
delete
[]
;
for
(
=
0
;
i
<
;
i
++)
{
delete
[]
[
i
];
}
delete
[]
;
}
bool
::
(
const
wchar_t
*
,
const
wchar_t
*
,
&
)
{
.
=
-
;
.
=-
1
;
.
=-
1
;
.
=-
1
;
=
;
=-
1
;
=-
1
;
const
wchar_t
*
=
;
while
(
currentState
!=-
1
)
{
terminateState
=
currentState
;
terminateLength
=
read
-
;
if
(
[
currentState
])
{
.
=
terminateLength
;
.
=
currentState
;
}
if
(!*
read
)
break
;
#ifdef VCZH_GCC
if(*read>=SupportedCharCount)break;
#endif
=
[*
read
++];
currentState
=
[
currentState
][
charIndex
];
}
if
(
.
==-
1
)
{
if
(
terminateLength
>
0
)
{
.
=
terminateState
;
}
.
=
terminateLength
;
return
false
;
}
else
{
return
true
;
}
}
bool
::
(
const
wchar_t
*
,
const
wchar_t
*
,
&
)
{
const
wchar_t
*
=
;
while
(*
read
)
{
if
(
(
read
,
,
))
{
return
true
;
}
read
++;
}
return
false
;
}
::
()
{
return
;
}
::
(
wchar_t
,
)
{
if
(
0
<=
&&
<
)
{
=
[
];
=
[
][
charIndex
];
return
nextState
;
}
else
{
return
-
1
;
}
}
bool
::
(
)
{
return
0
<=
&&
<
&&
[
];
}
bool
::
(
)
{
if
(
==-
1
)
return
true
;
for
(
=
0
;
i
<
;
i
++)
{
if
(
[
][
i
]!=-
1
)
{
return
false
;
}
}
return
true
;
}
void
::
()
{
if
(!
)
{
=
new
[
];
for
(
=
0
;
i
<
;
i
++)
{
[
i
]=
[
i
]?
i
:-
1
;
}
while
(
true
)
{
=
0
;
for
(
=
0
;
i
<
;
i
++)
{
if
(
[
i
]==-
1
)
{
=-
1
;
for
(
=
0
;
j
<
;
j
++)
{
=
[
i
][
j
];
if
(
nextState
!=-
1
)
{
state
=
[
nextState
];
if
(
state
!=-
1
)
{
break
;
}
}
}
if
(
state
!=-
1
)
{
[
i
]=
state
;
modifyCount
++;
}
}
}
if
(
modifyCount
==
0
)
{
break
;
}
}
}
}
::
(
)
{
return
?
[
]:-
1
;
}
}
}