#include "WfAnalyzer.h"
namespace
{
namespace
{
namespace
{
using
namespace
collections
;
using
namespace
parsing
;
using
namespace
reflection
;
using
namespace
reflection
::
description
;
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"A0: Wrong format string syntax."
);
}
<
parsing
::
>
::
WrongSimpleObserveExpression
(
*
)
{
return
new
(
,
L"A1: Simple observe expression should observe a property under the observed object."
);
}
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"A2: Simple observe expression should react to an event under the observed object."
);
}
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"A2: Observe expression should react to at least one event."
);
}
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"A3: Observe expression should appear in a bind expression."
);
}
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"A4: Observe expression should not appear in the event expression in another observe expression."
);
}
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"A4: Bind expression should not appear in another bind expression."
);
}
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"A4: Attach expression should not appear in another bind expression."
);
}
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"A4: Detach expression should not appear in another bind expression."
);
}
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"A5: Key-value pairs are not allowed in list constructor expression."
);
}
<
parsing
::
>
::
ConstructorMixStructAndList
(
*
)
{
return
new
(
,
L"A5: Field-value pairs are expected in struct constructor expression."
);
}
<
parsing
::
>
::
DuplicatedConstructorField
(
*
)
{
return
new
(
,
L"A5: The same field cannot be assigned more than once in struct constructor expression."
);
}
<
parsing
::
>
::
ConstructorMixClassAndInterface
(
*
)
{
return
new
(
,
L"A6: Arguments are not allowed in new interface expression."
);
}
<
parsing
::
>
::
ConstructorMixClassAndInterface
(
*
)
{
return
new
(
,
L"A6: Members are not allowed in new class expression."
);
}
<
parsing
::
>
::
(
*
,
<
>
)
{
return
new
(
,
L"A7: Symbol \""
+
() +
L"\" cannot be used as an expression."
);
}
<
parsing
::
>
::
(
*
,
reflection
::
description
::
*
)
{
return
new
(
,
L"A7: Event \""
+
->
() +
L"\" of type \""
+
->
()->
() +
L"\" cannot be used as an expression."
);
}
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"A8: Expression does not reference to a declaration."
);
}
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"A8: Expression does not reference to an event."
);
}
<
parsing
::
>
::
ExpressionCannotResolveType
(
*
,
<
>
)
{
return
new
(
,
L"A9: Expression referencing to symbol \""
+
+
L"\" failed to resolve its type."
);
}
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"A9: Expression \"null\" failed to resolve its type."
);
}
<
parsing
::
>
::
ConstructorCannotResolveType
(
*
)
{
return
new
(
,
L"A9: Expression \"{}\" failed to resolve its type."
);
}
<
parsing
::
>
::
OrderedLambdaCannotResolveType
(
*
)
{
return
new
(
,
L"A9: Ordered lambda expression failed to resolve its type."
);
}
<
parsing
::
>
::
NullCannotImplicitlyConvertToType
(
*
,
reflection
::
description
::
*
)
{
return
new
(
,
L"A10: Expression \"null\" cannot implicitly convert to \""
+
->
() +
L"\"."
);
}
<
parsing
::
>
::
ConstructorCannotImplicitlyConvertToType
(
*
,
reflection
::
description
::
*
)
{
return
new
(
,
L"A10: Expression \"{}\" cannot implicitly convert to \""
+
->
() +
L"\"."
);
}
<
parsing
::
>
::
OrderedLambdaCannotImplicitlyConvertToType
(
*
,
reflection
::
description
::
*
)
{
return
new
(
,
L"A10: Ordered lambda expression cannot implicitly convert to \""
+
->
() +
L"\"."
);
}
<
parsing
::
>
::
ExpressionCannotImplicitlyConvertToType
(
*
,
reflection
::
description
::
*
,
reflection
::
description
::
*
)
{
return
new
(
,
L"A10: Expression of type \""
+
->
() +
L"\" cannot implicitly convert to \""
+
->
() +
L"\"."
);
}
<
parsing
::
>
::
ExpressionCannotExplicitlyConvertToType
(
*
,
reflection
::
description
::
*
,
reflection
::
description
::
*
)
{
return
new
(
,
L"A11: Expression of type \""
+
->
() +
L"\" cannot explicitly convert to \""
+
->
() +
L"\"."
);
}
<
parsing
::
>
::
(
*
,
reflection
::
description
::
*
)
{
return
new
(
,
L"A12: Expression cannot weakly cast to \""
+
->
() +
L"\" because it cannot be \"null\"."
);
}
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"A13: Integer literal \""
+
->
.
+
L"\" out of range."
);
}
<
parsing
::
>
::
FloatingLiteralOutOfRange
(
*
)
{
return
new
(
,
L"A13: Floating literal \""
+
->
.
+
L"\" out of range."
);
}
<
parsing
::
>
::
(
*
,
reflection
::
description
::
*
,
reflection
::
description
::
*
)
{
return
new
(
,
L"A14: Failed to merge type \""
+
->
() +
L"\" with type \""
+
->
() +
L"\" together to calculate the result type."
);
}
<
parsing
::
>
::
(
*
,
reflection
::
description
::
*
)
{
return
new
(
,
L"A15: Elements in a range expression should be integer, not \""
+
->
() +
L"\"."
);
}
<
parsing
::
>
::
(
*
,
reflection
::
description
::
*
)
{
return
new
(
,
L"A16: Unary operator cannot apply on expression of type \""
+
->
() +
L"\"."
);
}
<
parsing
::
>
::
BinaryOperatorOnWrongType
(
*
,
reflection
::
description
::
*
)
{
return
new
(
,
L"A16: Binary operator cannot apply on expression of type \""
+
->
() +
L"\"."
);
}
<
parsing
::
>
::
(
*
,
reflection
::
description
::
*
)
{
return
new
(
,
L"A17: Container of type \""
+
->
() +
L"\" cannot be accessed using index."
);
}
<
parsing
::
>
::
ExpressionIsNotCollection
(
*
,
reflection
::
description
::
*
)
{
return
new
(
,
L"A18: Expression of type \""
+
->
() +
L"\" is not an enumerable type."
);
}
<
parsing
::
>
::
(
*
,
reflection
::
description
::
*
)
{
return
new
(
,
L"A19: Expression of type \""
+
->
() +
L"\" is not an invokable function type."
);
}
<
parsing
::
>
::
FunctionArgumentCountMismatched
(
parsing
::
*
,
,
const
&
)
{
return
new
(
,
L"A20: Function "
+
.
() +
L"\" is not allowed to call with "
+
(
) +
L" arguments."
);
}
<
parsing
::
>
::
FunctionArgumentTypeMismatched
(
parsing
::
*
,
const
&
,
,
reflection
::
description
::
*
,
reflection
::
description
::
*
)
{
return
new
(
,
L"A21: The "
+
(
) +
L"-th argument of function "
+
.
() +
L" cannot implicitly convert from \""
+
->
() +
L"\" to \""
+
->
() +
L"\"."
);
}
<
parsing
::
>
::
CannotPickOverloadedFunctions
(
parsing
::
*
,
collections
::
<
>&
)
{
;
FOREACH_INDEXER(ResolveExpressionResult, result, index, results)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
>&
= ::
vl
::
collections
::
(
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
if
(
bool
=
true
)
for
(
=
0
;
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
;
__foreach_iterator__
.
(
result
);
index
++)
{
description
+=
L"\r\n\t"
;
description
result
.
();
}
return
new
(
,
L"A22: Cannot decide which function to call in multiple targets: "
+
description
+
L"."
);
}
<
parsing
::
>
::
ClassContainsNoConstructor
(
*
,
reflection
::
description
::
*
)
{
return
new
(
,
L"A23: Class \""
+
->
() +
L"\" does not contain any constructor."
);
}
<
parsing
::
>
::
InterfaceContainsNoConstructor
(
*
,
reflection
::
description
::
*
)
{
<
>
=
<
<
>>::
();
return
new
(
,
L"A23: Interface \""
+
->
() +
L"\" does not contain any constructor receiving an \""
+
proxy
() +
L"\"."
);
}
<
parsing
::
>
::
ConstructorReturnTypeMismatched
(
*
,
const
&
,
reflection
::
description
::
*
,
reflection
::
description
::
*
)
{
return
new
(
,
L"A24: The return type of "
+
.
() +
L" cannot implicitly convert from \""
+
->
() +
L"\" to \""
+
->
() +
L"\"."
);
}
<
parsing
::
>
::
(
*
,
const
&
)
{
return
new
(
,
L"A25: "
+
.
(
true
) +
L" is not assignable."
);
}
<
parsing
::
>
::
CannotCallMemberOutsideOfClass
(
*
,
const
&
)
{
return
new
(
,
L"A26: "
+
.
(
true
) +
L" cannot be called as a static member."
);
}
<
parsing
::
>
::
CannotCallMemberInStaticFunction
(
*
,
const
&
)
{
return
new
(
,
L"A27: "
+
.
(
true
) +
L" cannot be called in static functions of its class or interface."
);
}
<
parsing
::
>
::
FieldCannotInitializeUsingEachOther
(
*
,
const
&
)
{
return
new
(
,
L"A28: "
+
.
(
true
) +
L" cannot be used to initialize other fields in the same type or new interface expression."
);
}
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"A29: The \"this\" expression can only be used in class methods or functions in new interface expressions"
);
}
<
parsing
::
>
::
(
*
,
reflection
::
description
::
*
)
{
return
new
(
,
L"A30: Expression of type \""
+
->
() +
L"\" cannot be used in union (&) expression because it is not string or flag enum."
);
}
<
parsing
::
>
::
IncorrectTypeForIntersect
(
*
,
reflection
::
description
::
*
)
{
return
new
(
,
L"A30: Expression of type \""
+
->
() +
L"\" cannot be used in intersect (|) expression because it is not flag enum."
);
}
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"A31: Expression is not constant. A constant expression consists of:\r\n"
L"\tconstant primitive values\r\n"
L"\tenum items\r\n"
L"\tconstant unary (+, -, not) expressions\r\n"
L"\tconstant binary (|) expressions\r\n"
L"\tconstant range expressions\r\n"
L"\tconstant constructor expressions (to create values of structs, lists or dictionarys)\r\n"
L"\ttype() or typeof() expressions."
);
}
<
parsing
::
>
::
(
*
,
reflection
::
description
::
*
,
reflection
::
description
::
*
)
{
return
new
(
,
L"A32: Mixin cast cannot implicitly convert from \""
+
->
() +
L"\" to \""
+
->
() +
L"\". It is only for converting from an interface to a derived interface."
);
}
<
parsing
::
>
::
ExpectedTypeCastCannotResolveType
(
*
)
{
return
new
(
,
L"A33: Cannot resolve type \"*\". This expression should only appear on a place which has an explicit type, including variables and arguments."
);
}
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"B0: Void is not a type for a value."
);
}
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"B1: Interface is not a type for a value."
);
}
<
parsing
::
>
::
RawPointerToNonReferenceType
(
*
,
reflection
::
description
::
*
)
{
return
new
(
,
L"B2: A raw pointer"
+ (
?
L" \""
+
->
() +
L"\""
:
L""
) +
L" should point to a class or interface."
);
}
<
parsing
::
>
::
SharedPointerToNonReferenceType
(
*
,
reflection
::
description
::
*
)
{
return
new
(
,
L"B3: A shared pointer"
+ (
?
L" \""
+
->
() +
L"\""
:
L""
) +
L" should point to a class or interface."
);
}
<
parsing
::
>
::
NullableToNonReferenceType
(
*
,
reflection
::
description
::
*
)
{
return
new
(
,
L"B4: A nullable value"
+ (
?
L" \""
+
->
() +
L"\""
:
L""
) +
L" should point to a struct."
);
}
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"B5: Only a reference type have child types."
);
}
<
parsing
::
>
::
(
*
,
<
>
)
{
return
new
(
,
L"B6: \""
+
() +
L"\" is not a type."
);
}
<
parsing
::
>
::
(
*
,
const
&
)
{
return
new
(
,
L"B6: \""
+
.
() +
L"\" is not a type."
);
}
<
parsing
::
>
::
(
*
,
reflection
::
description
::
*
)
{
return
new
(
,
L"B7: Type \""
+
->
() +
L"\" is not a type for a value."
);
}
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"C0: Break statement should appear in a loop."
);
}
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"C1: Continue statement should appear in a loop."
);
}
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"C2: Re-raise exception statement should appear in catch."
);
}
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"C3: Try statement should not appear without both catch and finally."
);
}
<
parsing
::
>
::
(
*
,
reflection
::
description
::
*
)
{
return
new
(
,
L"C4: Return statement requires an expression of type \""
+
->
() +
L"\"."
);
}
<
parsing
::
>
::
(
*
,
reflection
::
description
::
*
)
{
return
new
(
,
L"C5: Delete statement cannot apply on an expression of type \""
+
->
() +
L"\", which is expected to be a raw pointer."
);
}
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"C6: Return statement cannot have a value inside void functions, constructors, destructors or $coroutine expressions."
);
}
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"C7: $pause statement should appear inside a $coroutine expression, and it cannot be nested."
);
}
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"C8: $Operator statement should appear inside a coroutine function (which has a functiona body like ${} or $Provider{})."
);
}
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"C8: $.Operator expression should appear inside a coroutine function (which has a functiona body like ${} or $Provider{})."
);
}
<
parsing
::
>
::
(
*
,
collections
::
<
>&
)
{
;
FOREACH(WString, candidate, candidates)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
>&
= ::
vl
::
collections
::
(
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
;
__foreach_iterator__
.
(
candidate
);)
{
description
+=
L"\r\n\t"
;
description
candidate
;
}
if
(
->
.
==
L""
)
{
return
new
(
,
L"C9: Cannot find a coroutine provider based on the function return type, all of the following types do not exist: "
+
description
+
L"."
);
}
else
{
return
new
(
,
L"C9: Cannot find a coroutine provider based on the provider name \""
+
->
.
.
(
->
.
.
() -
1
) +
L"\", all of the following types do not exist: "
+
description
+
L"."
);
}
}
<
parsing
::
>
::
(
*
,
reflection
::
description
::
*
)
{
return
new
(
,
L"C10: Static function \"ReturnAndExit\" does not exist in coroutine provider \""
+
->
() +
L"\"."
);
}
<
parsing
::
>
::
(
*
,
reflection
::
description
::
*
)
{
auto
=
->
.
.
(
->
.
.
() -
1
);
if
(
->
.
==
L""
)
{
return
new
(
,
L"C10: Static functions \""
+
operatorName
+
L"AndPause\" and \""
+
operatorName
+
L"AndRead\" do not exist in coroutine provider \""
+
->
() +
L"\"."
);
}
else
{
return
new
(
,
L"C10: Static function \""
+
operatorName
+
L"AndRead\" does not exist in coroutine provider \""
+
->
() +
L"\"."
);
}
}
<
parsing
::
>
::
(
*
,
reflection
::
description
::
*
)
{
return
new
(
,
L"C10: Static function \"QueryContext\" does not exist in coroutine provider \""
+
->
() +
L"\"."
);
}
<
parsing
::
>
::
CoOperatorCannotResolveResultType
(
*
,
collections
::
<
reflection
::
description
::
*>&
)
{
auto
=
->
.
.
(
->
.
.
() -
1
);
if
(
->
.
() ==
0
)
{
return
new
(
,
L"C11: Failed to resolve the result type of coroutine operator \""
+
operatorName
+
L"\", since there is no argument."
);
}
else
{
;
FOREACH(ITypeInfo*, type, types)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
*>&
= ::
vl
::
collections
::
(
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
*
;
__foreach_iterator__
.
(
type
);)
{
description
+=
L"\r\n\t"
;
description
type
->
();
}
return
new
(
,
L"C11: Failed to resolve the result type of coroutine operator \""
+
operatorName
+
L"\", no appropriate static function \"CastResult\" is found in the following types. It requires exactly one argument of type \"object\" with a return type which is not \"void\": "
+
description
+
L"."
);
}
}
<
parsing
::
>
::
CoProviderCreateNotExists
(
*
,
reflection
::
description
::
*
)
{
return
new
(
,
L"C12: The required static function \"Create\" does not exist in coroutine provider \""
+
->
() +
L"\". It is required to have exactly one argument of a function type, which consumes a pointer type and returns system::Coroutine^"
);
}
<
parsing
::
>
::
CoProviderCreateAndRunNotExists
(
*
,
reflection
::
description
::
*
)
{
return
new
(
,
L"C12: The required static function \"CreateAndRun\" does not exist in coroutine provider \""
+
->
() +
L"\". It is required to have exactly one argument of a function type, which consumes a pointer type and returns system::Coroutine^"
);
}
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"C13: Goto label \""
+
->
.
+
L"\" does not exists. A goto label can only jump to the end of any block statement that contains this goto statement in the current function."
);
}
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"C14: Too many goto targets \""
+
->
.
+
L"\" found."
);
}
<
parsing
::
>
::
WrongStateSwitchStatement
(
*
)
{
return
new
(
,
L"C15: $switch statement should appear inside a $state declaration."
);
}
<
parsing
::
>
::
WrongStateInvokeStatement
(
*
)
{
return
new
(
,
L"C16: $goto_state or $push_state statement should appear inside a $state declaration."
);
}
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"C17: State input \""
+
->
.
+
L"\" does not exist."
);
}
<
parsing
::
>
::
StateSwitchArgumentCountNotMatch
(
*
)
{
return
new
(
,
L"C18: The number of arguments doesn not match the declaration of state input \""
+
->
.
+
L"\"."
);
}
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"C19: State \""
+
->
.
+
L"\" does not exist."
);
}
<
parsing
::
>
::
StateArgumentCountNotMatch
(
*
)
{
return
new
(
,
L"C20: The number of arguments doesn not match the declaration of state \""
+
->
.
+
L"\"."
);
}
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"D0: Function should have a name."
);
}
<
parsing
::
>
::
FunctionShouldHaveImplementation
(
*
)
{
return
new
(
,
L"D0: Function should be implemented."
);
}
<
parsing
::
>
::
InterfaceMethodShouldNotHaveImplementation
(
*
)
{
return
new
(
,
L"D0: Interface method should not be implemented."
);
}
<
parsing
::
>
::
(
*
,
const
&
)
{
return
new
(
,
L"D1: Duplicated declaration \""
+
->
.
+
L"\", it has already beed defined as a "
+
+
L"."
);
}
<
parsing
::
>
::
(
WfStateMachineDeclaration
*
)
{
return
new
(
,
L"D1: Duplicated $state_machine declaration."
);
}
<
parsing
::
>
::
(
*
,
<
>
)
{
return
new
(
,
L"D2: Duplicated symbol \""
+
+
L"\"."
);
}
<
parsing
::
>
::
(
*
,
<
>
)
{
return
new
(
,
L"D2: Duplicated symbol \""
+
+
L"\"."
);
}
<
parsing
::
>
::
(
*
,
<
>
)
{
return
new
(
,
L"D2: Duplicated symbol \""
+
+
L"\"."
);
}
<
parsing
::
>
::
(
*
,
<
>
)
{
return
new
(
,
L"D2: Duplicated symbol \""
+
+
L"\"."
);
}
<
parsing
::
>
::
(
*
,
<
>
)
{
return
new
(
,
L"D2: Duplicated symbol \""
+
+
L"\"."
);
}
<
parsing
::
>
::
(
*
,
<
>
)
{
return
new
(
,
L"D2: Duplicated symbol \""
+
+
L"\"."
);
}
<
parsing
::
>
::
(
*
,
<
>
)
{
return
new
(
,
L"D2: Duplicated symbol \""
+
+
L"\"."
);
}
<
parsing
::
>
::
InterfaceMethodNotImplemented
(
*
,
reflection
::
description
::
*
)
{
auto
=
::
(
);
return
new
(
,
L"D3: Interface method not implemented: "
+
result
.
() +
L"."
);
}
<
parsing
::
>
::
(
*
,
reflection
::
description
::
*
,
reflection
::
description
::
*
)
{
return
new
(
,
L"D4: Interface \""
+
->
() +
L"\" does not contain method \""
+
->
.
+
L"\" which is in type \""
+
->
() +
L"\"."
);
}
<
parsing
::
>
::
CannotPickOverloadedInterfaceMethods
(
*
,
collections
::
<
>&
)
{
;
FOREACH(ResolveExpressionResult, result, results)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
>&
= ::
vl
::
collections
::
(
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
;
__foreach_iterator__
.
(
result
);)
{
description
+=
L"\r\n\t"
;
description
result
.
();
}
return
new
(
,
L"D5: Cannot decide which function to implement in multiple targets:"
+
description
+
L"."
);
}
<
parsing
::
>
::
CannotPickOverloadedImplementMethods
(
*
,
reflection
::
description
::
*
)
{
return
new
(
,
L"D6: There are some other methods named \""
+
->
.
+
L"\" whose types are also \""
+
->
() +
L"\"."
);
}
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"D7: Event \""
+
->
.
+
L"\" cannot be defined outside of classes or interfaces."
);
}
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"D7: Property \""
+
->
.
+
L"\" cannot be defined outside of classes or interfaces."
);
}
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"D7: Constructor cannot be defined outside of classes."
);
}
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"D7: Destructor cannot be defined outside of classes."
);
}
<
parsing
::
>
::
(
WfAutoPropertyDeclaration
*
)
{
return
new
(
,
L"D7: Auto-property cannot be defined outside of classes."
);
}
<
parsing
::
>
::
(
WfStateMachineDeclaration
*
)
{
return
new
(
,
L"D7: State machine cannot be defined outside of classes."
);
}
<
parsing
::
>
::
WrongDeclarationInInterfaceConstructor
(
*
)
{
return
new
(
,
L"D8: \""
+
->
.
+
L"\" cannot be defined in an new interface expression, only functions, variables and auto-properties are allowed."
);
}
<
parsing
::
>
::
EnumValuesNotConsecutiveFromZero
(
*
)
{
return
new
(
,
L"D9: Item values in enum \""
+
->
.
+
L"\" should be consecutive and starts from zero, like 0, 1, 2, 3, 4, ..."
);
}
<
parsing
::
>
::
FlagValuesNotConsecutiveFromZero
(
*
)
{
return
new
(
,
L"D9: Item values in flag enum \""
+
->
.
+
L"\" should be consecutive powers of 2 and starts from zero, like 0, 1, 2, 4, 8, ..."
);
}
<
parsing
::
>
::
(
*
,
*
)
{
return
new
(
,
L"D10: Item \""
+
->
.
+
L" does not exists in the current flag enum \""
+
->
.
+
L"\"."
);
}
<
parsing
::
>
::
(
*
,
*
)
{
return
new
(
,
L"D11: Item \""
+
->
.
+
L" already exists in the current enum \""
+
->
.
+
L"\"."
);
}
<
parsing
::
>
::
StructContainsNonValueType
(
*
,
*
)
{
return
new
(
,
L"D12: Type of member \""
+
->
.
+
L"\" of struct \""
+
->
.
+
L"\" is not value type."
);
}
<
parsing
::
>
::
StructRecursivelyIncludeItself
(
*
,
collections
::
<
reflection
::
description
::
*>&
)
{
;
FOREACH(ITypeDescriptor*, td, tds)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
*>&
= ::
vl
::
collections
::
(
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
*
;
__foreach_iterator__
.
(
td
);)
{
description
+=
L"\r\n\t"
;
description
td
->
();
}
return
new
(
,
L"D13: Recursive references are found in these struct definitions:"
+
description
+
L"."
);
}
<
parsing
::
>
::
(
*
,
*
)
{
return
new
(
,
L"D14: Member \""
+
->
.
+
L"\" already exists in struct \""
+
->
.
+
L"\"."
);
}
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"D15: Attribute \""
+
->
.
+
L":"
+
->
.
+
L"\" does not exist."
);
}
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"D15: Value of attribute \""
+
->
.
+
L":"
+
->
.
+
L"\" is missing."
);
}
<
parsing
::
>
::
StateMachineClassNotInheritFromStateMachine
(
*
)
{
return
new
(
,
L"D16: State machine class \""
+
->
.
+
L"\" should inherit from \"system::StateMachine\" directly."
);
}
<
parsing
::
>
::
(
WfStateMachineDeclaration
*
)
{
return
new
(
,
L"D17: Missing default state."
);
}
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"E0: Wild card \"*\" should only appear in the last item of the using path and should appear once."
);
}
<
parsing
::
>
::
TopQualifiedSymbolNotExists
(
parsing
::
*
,
const
&
)
{
return
new
(
,
L"F0: Top qualified symbol \""
+
+
L"\" does not exist."
);
}
<
parsing
::
>
::
(
parsing
::
*
,
<
>
,
const
&
)
{
return
new
(
,
L"F1: Symbol \""
+
+
L"\" does not exist in \""
+
() +
L"\"."
);
}
<
parsing
::
>
::
(
parsing
::
*
,
reflection
::
description
::
*
,
const
&
)
{
return
new
(
,
L"F1: Member \""
+
+
L"\" does not exist in \""
+
->
() +
L"\"."
);
}
<
parsing
::
>
::
(
parsing
::
*
,
const
&
)
{
return
new
(
,
L"F2: Symbol \""
+
+
L"\" does not exist in the current scope."
);
}
<
parsing
::
>
::
(
parsing
::
*
,
collections
::
<
>&
,
const
&
)
{
;
FOREACH_INDEXER(ResolveExpressionResult, result, index, results)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
>&
= ::
vl
::
collections
::
(
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
if
(
bool
=
true
)
for
(
=
0
;
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
;
__foreach_iterator__
.
(
result
);
index
++)
{
description
+=
L"\r\n\t"
;
description
result
.
();
}
return
new
(
,
L"F3: Symbol \""
+
+
L"\" references to too many targets: "
+
description
+
L"."
);
}
<
parsing
::
>
::
(
parsing
::
*
,
reflection
::
description
::
*
,
const
&
)
{
return
new
(
,
L"F2: Enum item \""
+
+
L"\" does not exist in enum type \""
+
->
() +
L"\"."
);
}
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"G1: Class member \""
+
->
.
+
L"\" cannot be static or override because it is not a function or a auto-property."
);
}
<
parsing
::
>
::
FunctionInNewTypeExpressionCannotBeStatic
(
*
)
{
return
new
(
,
L"G1: Class member \""
+
->
.
+
L"\" cannot be static because it is in a new interface expression."
);
}
<
parsing
::
>
::
AutoPropertyCannotBeNormalOutsideOfClass
(
*
)
{
return
new
(
,
L"G1: Auto property \""
+
->
.
+
L"\" cannot be normal outside of classes or interfaces."
);
}
<
parsing
::
>
::
AutoPropertyCannotBeStatic
(
*
)
{
return
new
(
,
L"G1: Auto property \""
+
->
.
+
L"\" cannot be static ."
);
}
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"G2: Namespace \""
+
->
.
+
L"\" cannot be a class member."
);
}
<
parsing
::
>
::
(
*
,
*
)
{
return
new
(
,
L"G3: Cannot find the getter \""
+
->
.
+
L"\" of property \""
+
->
.
+
L"\" in type \""
+
->
.
+
L"\". A property getter should be a non-static method in the same type."
);
}
<
parsing
::
>
::
(
*
,
*
)
{
return
new
(
,
L"G3: Cannot find the setter \""
+
->
.
+
L"\" of property \""
+
->
.
+
L"\" in type \""
+
->
.
+
L"\". A property setter should be a non-static method in the same type."
);
}
<
parsing
::
>
::
(
*
,
*
)
{
return
new
(
,
L"G3: Cannot find the event \""
+
->
.
+
L"\" of property \""
+
->
.
+
L"\" in type \""
+
->
.
+
L"\"."
);
}
<
parsing
::
>
::
(
*
,
*
)
{
return
new
(
,
L"G4: Too many symbols found for the getter \""
+
->
.
+
L"\" of property \""
+
->
.
+
L"\" in type \""
+
->
.
+
L"\"."
);
}
<
parsing
::
>
::
(
*
,
*
)
{
return
new
(
,
L"G4: Too many symbols found for the setter \""
+
->
.
+
L"\" of property \""
+
->
.
+
L"\" in type \""
+
->
.
+
L"\"."
);
}
<
parsing
::
>
::
(
*
,
*
)
{
return
new
(
,
L"G4: Too many symbols found for the event \""
+
->
.
+
L"\" of property \""
+
->
.
+
L"\" in type \""
+
->
.
+
L"\"."
);
}
<
parsing
::
>
::
PropertyGetterTypeMismatched
(
*
,
*
)
{
return
new
(
,
L"G5: Cannot match the getter \""
+
->
.
+
L"\" of property \""
+
->
.
+
L"\" in type \""
+
->
.
+
L"\". A property getter should have no argument, and its return type should be identical to the property type."
);
}
<
parsing
::
>
::
PropertySetterTypeMismatched
(
*
,
*
)
{
return
new
(
,
L"G5: Cannot match the setter \""
+
->
.
+
L"\" of property \""
+
->
.
+
L"\" in type \""
+
->
.
+
L"\". A property setter should have no return value and have only one argument, and the argument type should be identical to the property type."
);
}
<
parsing
::
>
::
(
*
,
*
)
{
return
new
(
,
L"G6: A base type of the type \""
+
->
.
+
L"\" should be another custom type, it cannot be any predefined type, pointer type, shared pointer type, nullable type, collection type, or function type"
);
}
<
parsing
::
>
::
(
*
,
reflection
::
description
::
*
)
{
return
new
(
,
L"G6: Base type \""
+
->
() +
L"\" of class \""
+
->
.
+
L"\" is not a class, or it is a class but it is not aggregatable."
);
}
<
parsing
::
>
::
(
*
,
reflection
::
description
::
*
)
{
return
new
(
,
L"G6: Base type \""
+
->
() +
L"\" of interface \""
+
->
.
+
L"\" is not an interface."
);
}
<
parsing
::
>
::
(
*
,
reflection
::
description
::
*
)
{
<
>
=
<
<
>>::
();
return
new
(
,
L"G6: Interface \""
+
->
() +
L"\" should contain a constructor receiving an \""
+
proxy
() +
L"\" to be the base type of \""
+
->
.
+
L"\"."
);
}
<
parsing
::
>
::
ClassWithInterfaceConstructor
(
*
)
{
return
new
(
,
L"G7: Cannot use interface constructor type on class \""
+
->
.
+
L"\"."
);
}
<
parsing
::
>
::
OverrideShouldImplementInterfaceMethod
(
*
)
{
return
new
(
,
L"G8: Function \""
+
->
.
+
L"\" cannot be override because it doesn't implement any interface methods."
);
}
<
parsing
::
>
::
OverrideShouldImplementInterfaceMethod
(
WfAutoPropertyDeclaration
*
)
{
return
new
(
,
L"G8: Auto-property \""
+
->
.
+
L"\" cannot be override because it doesn't implement any interface methods."
);
}
<
parsing
::
>
::
(
*
)
{
return
new
(
,
L"G9: Type of field \""
+
->
.
+
L"\" is missing."
);
}
<
parsing
::
>
::
(
*
,
reflection
::
description
::
*
)
{
return
new
(
,
L"G10: Class \""
+
->
.
+
L"\" inherits from another class \""
+
->
() +
L"\" for multiple times."
);
}
<
parsing
::
>
::
ClassRecursiveInheritance
(
*
,
collections
::
<
reflection
::
description
::
*>&
)
{
;
FOREACH(ITypeDescriptor*, td, tds)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
*>&
= ::
vl
::
collections
::
(
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
*
;
__foreach_iterator__
.
(
td
);)
{
description
+=
L"\r\n\t"
;
description
td
->
();
}
return
new
(
,
L"G10: Recursive inheriting are found in these class definitions:"
+
description
+
L"."
);
}
<
parsing
::
>
::
InterfaceRecursiveInheritance
(
*
,
collections
::
<
reflection
::
description
::
*>&
)
{
;
FOREACH(ITypeDescriptor*, td, tds)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
*>&
= ::
vl
::
collections
::
(
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
*
;
__foreach_iterator__
.
(
td
);)
{
description
+=
L"\r\n\t"
;
description
td
->
();
}
return
new
(
,
L"G10: Recursive inheriting are found in these interface definitions:"
+
description
+
L"."
);
}
<
parsing
::
>
::
(
*
,
reflection
::
description
::
*
)
{
return
new
(
,
L"G11: Type \""
+
->
() +
L"\" is not a base type of this class."
);
}
<
parsing
::
>
::
DuplicatedBaseConstructorCall
(
*
,
reflection
::
description
::
*
)
{
return
new
(
,
L"G12: Base type \""
+
->
() +
L"\" has already been initialized."
);
}
<
parsing
::
>
::
(
*
,
*
)
{
return
new
(
,
L"G13: Class \""
+
->
.
+
L"\" has too many destructors."
);
}
<
parsing
::
>
::
AutoPropertyShouldBeInitialized
(
WfAutoPropertyDeclaration
*
)
{
return
new
(
,
L"G13: Auto property \""
+
->
.
+
L"\" should be initialized."
);
}
<
parsing
::
>
::
AutoPropertyCannotBeInitializedInInterface
(
WfAutoPropertyDeclaration
*
,
*
)
{
return
new
(
,
L"G13: Auto property \""
+
->
.
+
L"\" cannot be initialized in interface \""
+
->
.
+
L"\"."
);
}
<
parsing
::
>
::
CppUnableToDecideClassOrder
(
*
,
collections
::
<
reflection
::
description
::
*>&
)
{
;
FOREACH(ITypeDescriptor*, td, tds)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
*>&
= ::
vl
::
collections
::
(
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
*
;
__foreach_iterator__
.
(
td
);)
{
description
+=
L"\r\n\t"
;
description
td
->
();
}
return
new
(
,
L"CPP1: (C++ Code Generation) Cannot decide order of the following classes. It is probably caused by inheritance relationships of internal classes inside these classes:"
+
description
+
L"."
);
}
<
parsing
::
>
::
CppUnableToSeparateCustomFile
(
*
,
collections
::
<
reflection
::
description
::
*>&
)
{
;
FOREACH(ITypeDescriptor*, td, tds)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
*>&
= ::
vl
::
collections
::
(
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
*
;
__foreach_iterator__
.
(
td
);)
{
description
+=
L"\r\n\t"
;
description
td
->
();
}
return
new
(
,
L"CPP2: (C++ Code Generation) @cpp:File atrribute values for these classes are invalid. Generating classes to source files specified by these attribute values will create source files which do not compile. It is probably caused by inheritance relationships of internal classes inside these classes:"
+
description
+
L"."
);
}
}
}
}