#ifndef VCZH_PARSING_PARSINGTREE
#define VCZH_PARSING_PARSINGTREE
#include <VlppReflection.h>
namespace
{
namespace
{
struct
{
static
const
=-
2
;
;
;
;
()
:index(
)
,row(
)
,column(
)
{
}
(
)
:index(
)
,row(
)
,column(
)
{
}
(
,
)
:index(
)
,row(
)
,column(
)
{
}
(
,
,
)
:index(
)
,row(
)
,column(
)
{
}
bool
()
const
{
return
<
0
&&
<
0
&&
<
0
;
}
static
(
const
&
,
const
&
)
{
if
(
.
() &&
.
())
{
return
0
;
}
else
if
(
.
())
{
return
-
1
;
}
else
if
(
.
())
{
return
1
;
}
else
if
(
.
>=
0
&&
.
>=
0
)
{
return
.
-
.
;
}
else
if
(
.
>=
0
&&
.
>=
0
&&
.
>=
0
&&
.
>=
0
)
{
if
(
.
==
.
)
{
return
.
-
.
;
}
else
{
return
.
-
.
;
}
}
else
{
return
0
;
}
}
bool
(
const
&
)
const
{
return
(*
this
,
)==
0
;}
bool
(
const
&
)
const
{
return
(*
this
,
)!=
0
;}
bool
(
const
&
)
const
{
return
(*
this
,
)<
0
;}
bool
(
const
&
)
const
{
return
(*
this
,
)<=
0
;}
bool
(
const
&
)
const
{
return
(*
this
,
)>
0
;}
bool
(
const
&
)
const
{
return
(*
this
,
)>=
0
;}
};
struct
{
;
;
;
()
:codeIndex(-
1
)
{
.
=-
1
;
.
=-
1
;
}
(
const
& ,
const
& ,
= -
1
)
:start(
)
, end(
)
, codeIndex(
)
{
}
(
const
regex
::
* ,
const
regex
::
* )
:codeIndex(
->
)
{
.
=
->
;
.
=
->
;
.
=
->
;
.
=
->
+
->
-
1
;
.
=
->
;
.
=
->
;
}
bool
(
const
& )
const
{
return
.
&&
==
.
;}
bool
(
const
& )
const
{
return
.
||
!=
.
;}
bool
(
const
& )
const
{
return
&&
<=
;}
bool
(
const
& )
const
{
return
.
&&
.
<=
;}
};
}
namespace
{
namespace
{
BEGIN_SERIALIZATION(parsing::ParsingTextPos)
template
<>
struct
<
parsing
::
> {
template
<
typename
>
static
void
(
&
,
parsing
::
&
) {
BEGIN_SERIALIZATION(parsing::ParsingTextRange)
template
<>
struct
<
parsing
::
> {
template
<
typename
>
static
void
(
& ,
parsing
::
& ) {
}
}
namespace
{
class
;
class
;
class
;
class
;
class
:
public
,
public
reflection
::
<
>
{
public
:
class
:
public
{
public
:
virtual
void
(
*
)=
0
;
virtual
void
(
*
)=
0
;
virtual
void
(
*
)=
0
;
};
class
:
public
,
public
{
public
:
enum
{
,
};
protected
:
;
public
:
(
);
virtual
void
(
*
);
virtual
void
(
*
);
virtual
void
(
*
);
virtual
void
(
*
);
virtual
void
(
*
);
virtual
void
(
*
);
virtual
void
(
*
)
override
;
virtual
void
(
*
)
override
;
virtual
void
(
*
)
override
;
};
protected
:
typedef
collections
::
<
<
>>
;
;
*
;
;
virtual
const
&
()=
0
;
bool
(
<
>
);
void
(
<
>
);
bool
(
<
>
);
void
(
<
>
);
public
:
(
const
& );
();
virtual
void
(
*
)=
0
;
virtual
<
>
()=
0
;
();
void
(
const
& );
void
();
void
();
*
();
const
&
();
*
(
const
&
);
* (
const
& );
*
(
const
&
);
* (
const
& );
};
class
:
public
,
public
reflection
::
<
>
{
protected
:
;
;
const
&
()
override
;
public
:
(
const
& ,
=-
1
,
const
& =
());
();
void
(
*
)
override
;
<
>
()
override
;
();
void
(
);
const
&
();
void
(
const
&
);
};
class
:
public
,
public
reflection
::
<
>
{
protected
:
typedef
collections
::
<
,
<
>>
;
typedef
collections
::
<
>
;
typedef
collections
::
<
>
;
;
;
;
const
&
()
override
;
public
:
(
const
& =
L""
,
const
& =
());
();
void
(
*
)
override
;
<
>
()
override
;
const
&
();
void
(
const
&
);
&
();
<
>
(
const
&
);
bool
(
const
&
,
<
>
);
bool
(
const
&
);
const
&
();
&
();
};
class
:
public
,
public
reflection
::
<
>
{
protected
:
typedef
collections
::
<
<
>>
;
;
;
const
&
()
override
;
public
:
(
const
& =
L""
,
const
& =
());
();
void
(
*
)
override
;
<
>
()
override
;
const
&
();
void
(
const
&
);
&
();
<
>
(
);
bool
(
,
<
>
);
bool
(
<
>
);
bool
(
,
<
>
);
bool
(
);
bool
(
*
);
(
*
);
bool
(
*
);
();
bool
();
};
class
:
public
,
public
reflection
::
<
>
{
public
:
;
collections
::
<
>
;
};
class
:
public
,
public
reflection
::
<
>
{
public
:
;
;
():tokenIndex(-
1
){}
};
class
:
public
,
public
reflection
::
<
>
{
public
:
;
const
regex
::
*
;
*
;
;
();
(
const
&
);
(
const
regex
::
*
,
const
&
);
(
*
,
const
&
);
();
};
class
:
public
{
public
:
typedef
collections
::
<
regex
::
>
;
virtual
<
>
(
<
>
,
const
&
)=
0
;
bool
(
&
,
<
>
,
const
&
)
{
<
>
=
.
<
>();
if
(
token
)
{
.
=
token
();
.
token
();
.
token
();
return
true
;
}
return
false
;
}
template
<
typename
>
bool
(
collections
::
<
>&
,
<
>
,
const
&
)
{
<
>
=
.
<
>();
if
(
arr
)
{
.
();
=
arr
();
for
(
=
0
;
i
<
count
;
i
++)
{
;
(
t
,
arr
(
i
),
);
.
(
t
);
}
return
true
;
}
return
false
;
}
template
<
typename
>
bool
(
<
>&
,
<
>
,
const
&
)
{
<
>
=
.
<
>();
if
(
obj
)
{
<
>
=
(
obj
,
);
if
(
tree
)
{
tree
();
tree
.
<
>();
return
;
}
}
return
false
;
}
};
class
IParsingPrintNodeRecorder
:
public
virtual
{
public
:
virtual
void
(
* ,
const
& ) =
0
;
};
class
ParsingEmptyPrintNodeRecorder
:
public
,
public
virtual
IParsingPrintNodeRecorder
{
public
:
ParsingEmptyPrintNodeRecorder
();
~
ParsingEmptyPrintNodeRecorder
();
void
(
* ,
const
& )
override
;
};
class
ParsingMultiplePrintNodeRecorder
:
public
,
public
virtual
IParsingPrintNodeRecorder
{
typedef
collections
::
<
<
IParsingPrintNodeRecorder
>>
;
protected
:
;
public
:
ParsingMultiplePrintNodeRecorder
();
~
ParsingMultiplePrintNodeRecorder
();
void
(
<
IParsingPrintNodeRecorder
>
);
void
(
* ,
const
& )
override
;
};
class
ParsingOriginalLocationRecorder
:
public
,
public
virtual
IParsingPrintNodeRecorder
{
protected
:
<
IParsingPrintNodeRecorder
>
;
public
:
ParsingOriginalLocationRecorder
(
<
IParsingPrintNodeRecorder
>
);
~
ParsingOriginalLocationRecorder
();
void
(
* ,
const
& )
override
;
};
class
ParsingGeneratedLocationRecorder
:
public
,
public
virtual
IParsingPrintNodeRecorder
{
typedef
collections
::
<
*,
>
;
protected
:
&
;
public
:
ParsingGeneratedLocationRecorder
(
&
);
~
ParsingGeneratedLocationRecorder
();
void
(
* ,
const
& )
override
;
};
class
ParsingUpdateLocationRecorder
:
public
,
public
virtual
IParsingPrintNodeRecorder
{
public
:
ParsingUpdateLocationRecorder
();
~
ParsingUpdateLocationRecorder
();
void
(
* ,
const
& )
override
;
};
class
:
public
stream
::
{
typedef
collections
::
<
*,
>
;
typedef
collections
::
<
>
;
protected
:
stream
::
&
;
<
IParsingPrintNodeRecorder
>
;
;
;
;
;
void
(
wchar_t
);
public
:
(
stream
::
&
,
<
IParsingPrintNodeRecorder
>
=
nullptr
,
= -
1
);
();
using
stream
::
::
;
void
(
wchar_t
)
override
;
void
(
const
wchar_t
*
,
)
override
;
void
(
*
);
void
(
*
);
};
extern
void
(
*
,
const
&
,
stream
::
&
,
const
&
=
L""
);
}
}
#endif