#include "../Parsing.h"
#include "../ParsingDefinitions.h"
#include "../ParsingAutomaton.h"
#include "ParsingJson_Ast.h"
namespace
{
namespace
{
namespace
{
void
::
(
::
*
)
{
->
(
this
);
}
void
::
(
::
*
)
{
->
(
this
);
}
void
::
(
::
*
)
{
->
(
this
);
}
void
::
(
::
*
)
{
->
(
this
);
}
void
::
(
::
*
)
{
->
(
this
);
}
void
::
(
::
*
)
{
->
(
this
);
}
}
}
}
namespace
{
namespace
{
namespace
{
#ifndef VCZH_DEBUG_NO_REFLECTION
using
namespace
vl
::
parsing
::
json
;
#define PARSING_TOKEN_FIELD(NAME)\
CLASS_MEMBER_EXTERNALMETHOD_TEMPLATE(get_##NAME, NO_PARAMETER, vl::WString(ClassType::*)(), [](ClassType* node) { return node->NAME.value; }, L"*", L"*")\
CLASS_MEMBER_EXTERNALMETHOD_TEMPLATE(set_##NAME, { L"value" }, void(ClassType::*)(const vl::WString&), [](ClassType* node, const vl::WString& value) { node->NAME.value = value; }, L"*", L"*")\
CLASS_MEMBER_PROPERTY_REFERENCETEMPLATE(NAME, get_##NAME, set_##NAME, L"$This->$Name.value")\
IMPL_TYPE_INFO_RENAME(vl::parsing::json::JsonNode, system::JsonNode)
const
<
vl
::
parsing
::
json
::
>::
= {
L"system::JsonNode"
,
L"vl::parsing::json::JsonNode"
,
::
};
IMPL_TYPE_INFO_RENAME(vl::parsing::json::JsonLiteral, system::JsonLiteral)
const
<
vl
::
parsing
::
json
::
>::
= {
L"system::JsonLiteral"
,
L"vl::parsing::json::JsonLiteral"
,
::
};
IMPL_TYPE_INFO_RENAME(vl::parsing::json::JsonLiteral::JsonValue, system::JsonLiteral::JsonValue)
const
<
vl
::
parsing
::
json
::
::
>::
= {
L"system::JsonLiteral::JsonValue"
,
L"vl::parsing::json::JsonLiteral::JsonValue"
,
::
};
IMPL_TYPE_INFO_RENAME(vl::parsing::json::JsonString, system::JsonString)
const
<
vl
::
parsing
::
json
::
>::
= {
L"system::JsonString"
,
L"vl::parsing::json::JsonString"
,
::
};
IMPL_TYPE_INFO_RENAME(vl::parsing::json::JsonNumber, system::JsonNumber)
const
<
vl
::
parsing
::
json
::
>::
= {
L"system::JsonNumber"
,
L"vl::parsing::json::JsonNumber"
,
::
};
IMPL_TYPE_INFO_RENAME(vl::parsing::json::JsonArray, system::JsonArray)
const
<
vl
::
parsing
::
json
::
>::
= {
L"system::JsonArray"
,
L"vl::parsing::json::JsonArray"
,
::
};
IMPL_TYPE_INFO_RENAME(vl::parsing::json::JsonObjectField, system::JsonObjectField)
const
<
vl
::
parsing
::
json
::
>::
= {
L"system::JsonObjectField"
,
L"vl::parsing::json::JsonObjectField"
,
::
};
IMPL_TYPE_INFO_RENAME(vl::parsing::json::JsonObject, system::JsonObject)
const
<
vl
::
parsing
::
json
::
>::
= {
L"system::JsonObject"
,
L"vl::parsing::json::JsonObject"
,
::
};
IMPL_TYPE_INFO_RENAME(vl::parsing::json::JsonNode::IVisitor, system::JsonNode::IVisitor)
const
<
vl
::
parsing
::
json
::
::
>::
= {
L"system::JsonNode::IVisitor"
,
L"vl::parsing::json::JsonNode::IVisitor"
,
::
};
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
BEGIN_CLASS_MEMBER(JsonNode)
template
<>
struct
CustomTypeDescriptorSelector
<
> {
public
:
class
:
public
{
typedef
;
static
const
=
::
;
public
:
() :
(
, &
<
>::
) {
<
>::
SetAssociatedTypeDescriptor
(
this
); }
~
CustomTypeDescriptorImpl
() {
<
>::
SetAssociatedTypeDescriptor
(
0
); }
protected
:
bool
()
override
{
return
<
typename
<
,
<
>>::
>::
; }
void
()
override
{
CLASS_MEMBER_METHOD_OVERLOAD(Accept, {L"visitor"}, void(JsonNode::*)(JsonNode::IVisitor* visitor))
{
const
wchar_t
*
[]={
L"visitor"
};
auto
=
new
<
,
vl
::
function_lambda
::
<
void
(
::*)(
::
* visitor)>::
> (
parameterNames
, (
void
(
::*)(
::
* visitor))&
::
,
nullptr
,
nullptr
);
(
L"Accept"
,
methodInfo
);
MethodPointerBinaryDataRetriver
<
void
(
::*)(
::
* visitor)>
(&
::
);
MethodPointerBinaryDataRecorder
<
,
>::
(
binaryDataRetriver
.
(),
this
,
methodInfo
); }
END_CLASS_MEMBER(JsonNode)
if
(
GetBaseTypeDescriptorCount
() ==
0
)
(
description
::
<
>()); } }; };
BEGIN_CLASS_MEMBER(JsonLiteral)
template
<>
struct
CustomTypeDescriptorSelector
<
> {
public
:
class
:
public
{
typedef
;
static
const
=
::
;
public
:
() :
(
, &
<
>::
) {
<
>::
SetAssociatedTypeDescriptor
(
this
); }
~
CustomTypeDescriptorImpl
() {
<
>::
SetAssociatedTypeDescriptor
(
0
); }
protected
:
bool
()
override
{
return
<
typename
<
,
<
>>::
>::
; }
void
()
override
{
CLASS_MEMBER_BASE(JsonNode)
CLASS_MEMBER_CONSTRUCTOR(vl::Ptr<JsonLiteral>(), NO_PARAMETER)
{
const
wchar_t
*
[]={
L""
};
(
new
CustomConstructorInfoImpl
<
vl
::
<
>()>(
parameterNames
)); }
CLASS_MEMBER_FIELD(value)
(
new
<
,
decltype
(((
*)
0
)->
) >(
this
,
L"value"
, &
::
) );
END_CLASS_MEMBER(JsonLiteral)
if
(
GetBaseTypeDescriptorCount
() ==
0
)
(
description
::
<
>()); } }; };
BEGIN_ENUM_ITEM(JsonLiteral::JsonValue)
template
<>
struct
CustomTypeDescriptorSelector
<
::
> {
public
:
class
:
public
<
::
,
::
> {
typedef
::
;
public
:
void
()
override
{
<
::
,
::
>::
();
ENUM_ITEM_NAMESPACE(JsonLiteral::JsonValue)
ENUM_NAMESPACE_ITEM(True)
ENUM_NAMESPACE_ITEM(False)
ENUM_NAMESPACE_ITEM(Null)
END_ENUM_ITEM(JsonLiteral::JsonValue)
} }; };
BEGIN_CLASS_MEMBER(JsonString)
template
<>
struct
CustomTypeDescriptorSelector
<
> {
public
:
class
:
public
{
typedef
;
static
const
=
::
;
public
:
() :
(
, &
<
>::
) {
<
>::
SetAssociatedTypeDescriptor
(
this
); }
~
CustomTypeDescriptorImpl
() {
<
>::
SetAssociatedTypeDescriptor
(
0
); }
protected
:
bool
()
override
{
return
<
typename
<
,
<
>>::
>::
; }
void
()
override
{
CLASS_MEMBER_BASE(JsonNode)
CLASS_MEMBER_CONSTRUCTOR(vl::Ptr<JsonString>(), NO_PARAMETER)
{
const
wchar_t
*
[]={
L""
};
(
new
CustomConstructorInfoImpl
<
vl
::
<
>()>(
parameterNames
)); }
PARSING_TOKEN_FIELD(content)
{
const
wchar_t
*
[]={
L""
};
(
L"get_content"
,
new
CustomExternalMethodInfoImpl
<
,
vl
::
function_lambda
::
<
vl
::
(
::*)()>::
>(
parameterNames
, [](
*
) {
return
node
->
.
; },
L"*"
,
L"*"
) ); } {
const
wchar_t
*
[]={
L"value"
};
(
L"set_content"
,
new
CustomExternalMethodInfoImpl
<
,
vl
::
function_lambda
::
<
void
(
::*)(
const
vl
::
&)>::
>(
parameterNames
, [](
*
,
const
vl
::
&
) {
node
->
.
value
; },
L"*"
,
L"*"
) ); }
(
new
PropertyInfoImpl_StaticCpp
(
this
,
L"content"
,
dynamic_cast
<
*>(
(
L"get_content"
,
true
)->GetMethod(
0
)),
dynamic_cast
<
*>(
(
L"set_content"
,
true
)->GetMethod(
0
)),
nullptr
,
(
L"$This->$Name.value"
,
false
) ) );
END_CLASS_MEMBER(JsonString)
if
(
GetBaseTypeDescriptorCount
() ==
0
)
(
description
::
<
>()); } }; };
BEGIN_CLASS_MEMBER(JsonNumber)
template
<>
struct
CustomTypeDescriptorSelector
<
> {
public
:
class
:
public
{
typedef
;
static
const
=
::
;
public
:
() :
(
, &
<
>::
) {
<
>::
SetAssociatedTypeDescriptor
(
this
); }
~
CustomTypeDescriptorImpl
() {
<
>::
SetAssociatedTypeDescriptor
(
0
); }
protected
:
bool
()
override
{
return
<
typename
<
,
<
>>::
>::
; }
void
()
override
{
CLASS_MEMBER_BASE(JsonNode)
CLASS_MEMBER_CONSTRUCTOR(vl::Ptr<JsonNumber>(), NO_PARAMETER)
{
const
wchar_t
*
[]={
L""
};
(
new
CustomConstructorInfoImpl
<
vl
::
<
>()>(
parameterNames
)); }
PARSING_TOKEN_FIELD(content)
{
const
wchar_t
*
[]={
L""
};
(
L"get_content"
,
new
CustomExternalMethodInfoImpl
<
,
vl
::
function_lambda
::
<
vl
::
(
::*)()>::
>(
parameterNames
, [](
*
) {
return
node
->
.
; },
L"*"
,
L"*"
) ); } {
const
wchar_t
*
[]={
L"value"
};
(
L"set_content"
,
new
CustomExternalMethodInfoImpl
<
,
vl
::
function_lambda
::
<
void
(
::*)(
const
vl
::
&)>::
>(
parameterNames
, [](
*
,
const
vl
::
&
) {
node
->
.
value
; },
L"*"
,
L"*"
) ); }
(
new
PropertyInfoImpl_StaticCpp
(
this
,
L"content"
,
dynamic_cast
<
*>(
(
L"get_content"
,
true
)->GetMethod(
0
)),
dynamic_cast
<
*>(
(
L"set_content"
,
true
)->GetMethod(
0
)),
nullptr
,
(
L"$This->$Name.value"
,
false
) ) );
END_CLASS_MEMBER(JsonNumber)
if
(
GetBaseTypeDescriptorCount
() ==
0
)
(
description
::
<
>()); } }; };
BEGIN_CLASS_MEMBER(JsonArray)
template
<>
struct
CustomTypeDescriptorSelector
<
> {
public
:
class
:
public
{
typedef
;
static
const
=
::
;
public
:
() :
(
, &
<
>::
) {
<
>::
SetAssociatedTypeDescriptor
(
this
); }
~
CustomTypeDescriptorImpl
() {
<
>::
SetAssociatedTypeDescriptor
(
0
); }
protected
:
bool
()
override
{
return
<
typename
<
,
<
>>::
>::
; }
void
()
override
{
CLASS_MEMBER_BASE(JsonNode)
CLASS_MEMBER_CONSTRUCTOR(vl::Ptr<JsonArray>(), NO_PARAMETER)
{
const
wchar_t
*
[]={
L""
};
(
new
CustomConstructorInfoImpl
<
vl
::
<
>()>(
parameterNames
)); }
CLASS_MEMBER_FIELD(items)
(
new
<
,
decltype
(((
*)
0
)->
) >(
this
,
L"items"
, &
::
) );
END_CLASS_MEMBER(JsonArray)
if
(
GetBaseTypeDescriptorCount
() ==
0
)
(
description
::
<
>()); } }; };
BEGIN_CLASS_MEMBER(JsonObjectField)
template
<>
struct
CustomTypeDescriptorSelector
<
> {
public
:
class
:
public
{
typedef
;
static
const
=
::
;
public
:
() :
(
, &
<
>::
) {
<
>::
SetAssociatedTypeDescriptor
(
this
); }
~
CustomTypeDescriptorImpl
() {
<
>::
SetAssociatedTypeDescriptor
(
0
); }
protected
:
bool
()
override
{
return
<
typename
<
,
<
>>::
>::
; }
void
()
override
{
CLASS_MEMBER_BASE(JsonNode)
CLASS_MEMBER_CONSTRUCTOR(vl::Ptr<JsonObjectField>(), NO_PARAMETER)
{
const
wchar_t
*
[]={
L""
};
(
new
CustomConstructorInfoImpl
<
vl
::
<
>()>(
parameterNames
)); }
PARSING_TOKEN_FIELD(name)
{
const
wchar_t
*
[]={
L""
};
(
L"get_name"
,
new
CustomExternalMethodInfoImpl
<
,
vl
::
function_lambda
::
<
vl
::
(
::*)()>::
>(
parameterNames
, [](
*
) {
return
node
->
.
; },
L"*"
,
L"*"
) ); } {
const
wchar_t
*
[]={
L"value"
};
(
L"set_name"
,
new
CustomExternalMethodInfoImpl
<
,
vl
::
function_lambda
::
<
void
(
::*)(
const
vl
::
&)>::
>(
parameterNames
, [](
*
,
const
vl
::
&
) {
node
->
.
value
; },
L"*"
,
L"*"
) ); }
(
new
PropertyInfoImpl_StaticCpp
(
this
,
L"name"
,
dynamic_cast
<
*>(
(
L"get_name"
,
true
)->GetMethod(
0
)),
dynamic_cast
<
*>(
(
L"set_name"
,
true
)->GetMethod(
0
)),
nullptr
,
(
L"$This->$Name.value"
,
false
) ) );
CLASS_MEMBER_FIELD(value)
(
new
<
,
decltype
(((
*)
0
)->
) >(
this
,
L"value"
, &
::
) );
END_CLASS_MEMBER(JsonObjectField)
if
(
GetBaseTypeDescriptorCount
() ==
0
)
(
description
::
<
>()); } }; };
BEGIN_CLASS_MEMBER(JsonObject)
template
<>
struct
CustomTypeDescriptorSelector
<
> {
public
:
class
:
public
{
typedef
;
static
const
=
::
;
public
:
() :
(
, &
<
>::
) {
<
>::
SetAssociatedTypeDescriptor
(
this
); }
~
CustomTypeDescriptorImpl
() {
<
>::
SetAssociatedTypeDescriptor
(
0
); }
protected
:
bool
()
override
{
return
<
typename
<
,
<
>>::
>::
; }
void
()
override
{
CLASS_MEMBER_BASE(JsonNode)
CLASS_MEMBER_CONSTRUCTOR(vl::Ptr<JsonObject>(), NO_PARAMETER)
{
const
wchar_t
*
[]={
L""
};
(
new
CustomConstructorInfoImpl
<
vl
::
<
>()>(
parameterNames
)); }
CLASS_MEMBER_FIELD(fields)
(
new
<
,
decltype
(((
*)
0
)->
) >(
this
,
L"fields"
, &
::
) );
END_CLASS_MEMBER(JsonObject)
if
(
GetBaseTypeDescriptorCount
() ==
0
)
(
description
::
<
>()); } }; };
BEGIN_INTERFACE_MEMBER(JsonNode::IVisitor)
template
<>
struct
CustomTypeDescriptorSelector
<
::
> {
public
:
class
:
public
,
public
::
{
typedef
::
;
static
const
=
::
;
::
;
public
:
() :
(
::
, &
<
::
>::
) {
<
::
>::
SetAssociatedTypeDescriptor
(
this
); }
~
CustomTypeDescriptorImpl
() {
<
::
>::
SetAssociatedTypeDescriptor
(
0
); }
void
(
const
&
,
*
)
override
{
.
(
,
); }
*
(
const
&
)
override
{
();
return
]; }
protected
:
void
()
override
{ {
const
wchar_t
*
[]={
L"proxy"
};
(
new
CustomStaticMethodInfoImpl
<
decltype
(
<
::
>::
(
nullptr
))(
<
>)>(
parameterNames
, (
<
decltype
(
<
::
>::
(
nullptr
))(
<
>)>)&::
vl
::
reflection
::
description
::
<
::
>::
,
L"::"
L"vl::reflection::description::ValueInterfaceProxy<JsonNode::IVisitor>::Create"
L"($Arguments)"
,
L"::vl::Func<$Func>(&::"
L"vl::reflection::description::ValueInterfaceProxy<JsonNode::IVisitor>::Create"
L")"
) ); }
CLASS_MEMBER_METHOD_OVERLOAD(Visit, {L"node"}, void(JsonNode::IVisitor::*)(JsonLiteral* node))
{
const
wchar_t
*
[]={
L"node"
};
auto
=
new
<
,
vl
::
function_lambda
::
<
void
(
::
::*)(
* node)>::
> (
parameterNames
, (
void
(
::
::*)(
* node))&
::
,
nullptr
,
nullptr
);
(
L"Visit"
,
methodInfo
);
MethodPointerBinaryDataRetriver
<
void
(
::
::*)(
* node)>
(&
::
);
MethodPointerBinaryDataRecorder
<
,
>::
(
binaryDataRetriver
.
(),
this
,
methodInfo
); }
CLASS_MEMBER_METHOD_OVERLOAD(Visit, {L"node"}, void(JsonNode::IVisitor::*)(JsonString* node))
{
const
wchar_t
*
[]={
L"node"
};
auto
=
new
<
,
vl
::
function_lambda
::
<
void
(
::
::*)(
* node)>::
> (
parameterNames
, (
void
(
::
::*)(
* node))&
::
,
nullptr
,
nullptr
);
(
L"Visit"
,
methodInfo
);
MethodPointerBinaryDataRetriver
<
void
(
::
::*)(
* node)>
(&
::
);
MethodPointerBinaryDataRecorder
<
,
>::
(
binaryDataRetriver
.
(),
this
,
methodInfo
); }
CLASS_MEMBER_METHOD_OVERLOAD(Visit, {L"node"}, void(JsonNode::IVisitor::*)(JsonNumber* node))
{
const
wchar_t
*
[]={
L"node"
};
auto
=
new
<
,
vl
::
function_lambda
::
<
void
(
::
::*)(
* node)>::
> (
parameterNames
, (
void
(
::
::*)(
* node))&
::
,
nullptr
,
nullptr
);
(
L"Visit"
,
methodInfo
);
MethodPointerBinaryDataRetriver
<
void
(
::
::*)(
* node)>
(&
::
);
MethodPointerBinaryDataRecorder
<
,
>::
(
binaryDataRetriver
.
(),
this
,
methodInfo
); }
CLASS_MEMBER_METHOD_OVERLOAD(Visit, {L"node"}, void(JsonNode::IVisitor::*)(JsonArray* node))
{
const
wchar_t
*
[]={
L"node"
};
auto
=
new
<
,
vl
::
function_lambda
::
<
void
(
::
::*)(
* node)>::
> (
parameterNames
, (
void
(
::
::*)(
* node))&
::
,
nullptr
,
nullptr
);
(
L"Visit"
,
methodInfo
);
MethodPointerBinaryDataRetriver
<
void
(
::
::*)(
* node)>
(&
::
);
MethodPointerBinaryDataRecorder
<
,
>::
(
binaryDataRetriver
.
(),
this
,
methodInfo
); }
CLASS_MEMBER_METHOD_OVERLOAD(Visit, {L"node"}, void(JsonNode::IVisitor::*)(JsonObjectField* node))
{
const
wchar_t
*
[]={
L"node"
};
auto
=
new
<
,
vl
::
function_lambda
::
<
void
(
::
::*)(
* node)>::
> (
parameterNames
, (
void
(
::
::*)(
* node))&
::
,
nullptr
,
nullptr
);
(
L"Visit"
,
methodInfo
);
MethodPointerBinaryDataRetriver
<
void
(
::
::*)(
* node)>
(&
::
);
MethodPointerBinaryDataRecorder
<
,
>::
(
binaryDataRetriver
.
(),
this
,
methodInfo
); }
CLASS_MEMBER_METHOD_OVERLOAD(Visit, {L"node"}, void(JsonNode::IVisitor::*)(JsonObject* node))
{
const
wchar_t
*
[]={
L"node"
};
auto
=
new
<
,
vl
::
function_lambda
::
<
void
(
::
::*)(
* node)>::
> (
parameterNames
, (
void
(
::
::*)(
* node))&
::
,
nullptr
,
nullptr
);
(
L"Visit"
,
methodInfo
);
MethodPointerBinaryDataRetriver
<
void
(
::
::*)(
* node)>
(&
::
);
MethodPointerBinaryDataRecorder
<
,
>::
(
binaryDataRetriver
.
(),
this
,
methodInfo
); }
END_INTERFACE_MEMBER(JsonNode)
if
(
GetBaseTypeDescriptorCount
() ==
0
&&
==
::
)
(
description
::
<
>()); } }; };
#endif
#undef PARSING_TOKEN_FIELD
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
class
:
public
vl
::
,
public
{
public
:
void
(
*
)
{
ADD_TYPE_INFO(vl::parsing::json::JsonNode)
{
<
>
=
new
CustomTypeDescriptorSelector
<
vl
::
parsing
::
json
::
>::
();
->
(
<
vl
::
parsing
::
json
::
>::
.typeName,
type
); }
ADD_TYPE_INFO(vl::parsing::json::JsonLiteral)
{
<
>
=
new
CustomTypeDescriptorSelector
<
vl
::
parsing
::
json
::
>::
();
->
(
<
vl
::
parsing
::
json
::
>::
.typeName,
type
); }
ADD_TYPE_INFO(vl::parsing::json::JsonLiteral::JsonValue)
{
<
>
=
new
CustomTypeDescriptorSelector
<
vl
::
parsing
::
json
::
::
>::
();
->
(
<
vl
::
parsing
::
json
::
::
>::
.typeName,
type
); }
ADD_TYPE_INFO(vl::parsing::json::JsonString)
{
<
>
=
new
CustomTypeDescriptorSelector
<
vl
::
parsing
::
json
::
>::
();
->
(
<
vl
::
parsing
::
json
::
>::
.typeName,
type
); }
ADD_TYPE_INFO(vl::parsing::json::JsonNumber)
{
<
>
=
new
CustomTypeDescriptorSelector
<
vl
::
parsing
::
json
::
>::
();
->
(
<
vl
::
parsing
::
json
::
>::
.typeName,
type
); }
ADD_TYPE_INFO(vl::parsing::json::JsonArray)
{
<
>
=
new
CustomTypeDescriptorSelector
<
vl
::
parsing
::
json
::
>::
();
->
(
<
vl
::
parsing
::
json
::
>::
.typeName,
type
); }
ADD_TYPE_INFO(vl::parsing::json::JsonObjectField)
{
<
>
=
new
CustomTypeDescriptorSelector
<
vl
::
parsing
::
json
::
>::
();
->
(
<
vl
::
parsing
::
json
::
>::
.typeName,
type
); }
ADD_TYPE_INFO(vl::parsing::json::JsonObject)
{
<
>
=
new
CustomTypeDescriptorSelector
<
vl
::
parsing
::
json
::
>::
();
->
(
<
vl
::
parsing
::
json
::
>::
.typeName,
type
); }
ADD_TYPE_INFO(vl::parsing::json::JsonNode::IVisitor)
{
<
>
=
new
CustomTypeDescriptorSelector
<
vl
::
parsing
::
json
::
::
>::
();
->
(
<
vl
::
parsing
::
json
::
::
>::
.typeName,
type
); }
}
void
(
*
)
{
}
};
#endif
#endif
bool
()
{
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
*
=
();
if
(
manager
)
{
<
>
=
new
;
return
manager
->
(
loader
);
}
#endif
return
false
;
}
}
}
}