mirror of
https://github.com/vczh-libraries/Release.git
synced 2026-02-05 19:40:03 +08:00
2419 lines
100 KiB
C++
2419 lines
100 KiB
C++
/***********************************************************************
|
|
THIS FILE IS AUTOMATICALLY GENERATED. DO NOT MODIFY
|
|
DEVELOPER: Zihan Chen(vczh)
|
|
***********************************************************************/
|
|
#include "Vlpp.h"
|
|
#include "VlppWorkflow.h"
|
|
|
|
/***********************************************************************
|
|
EXPRESSION\WFEXPRESSIONPARSER.H
|
|
***********************************************************************/
|
|
/***********************************************************************
|
|
Vczh Library++ 3.0
|
|
Developer: Zihan Chen(vczh)
|
|
Parser::WfExpressionParser
|
|
|
|
This file is generated by: Vczh Parser Generator
|
|
***********************************************************************/
|
|
|
|
#ifndef VCZH_WORKFLOW_EXPRESSION_WFEXPRESSIONPARSER
|
|
#define VCZH_WORKFLOW_EXPRESSION_WFEXPRESSIONPARSER
|
|
|
|
|
|
namespace vl
|
|
{
|
|
namespace workflow
|
|
{
|
|
enum class WfParserTokenIndex
|
|
{
|
|
EXP = 0,
|
|
ADD = 1,
|
|
SUB = 2,
|
|
MUL = 3,
|
|
DIV = 4,
|
|
MOD = 5,
|
|
UNION = 6,
|
|
INTERSECTION = 7,
|
|
LE = 8,
|
|
GE = 9,
|
|
LT = 10,
|
|
GT = 11,
|
|
EQ = 12,
|
|
NE = 13,
|
|
ASSIGN = 14,
|
|
FAILED_THEN = 15,
|
|
QUESTION_MARK = 16,
|
|
SCOPE_DELIMITER = 17,
|
|
COLON = 18,
|
|
SEMICOLON = 19,
|
|
COMMA = 20,
|
|
DOT = 21,
|
|
OPEN_ARRAY = 22,
|
|
CLOSE_ARRAY = 23,
|
|
OPEN_BRACE = 24,
|
|
CLOSE_BRACE = 25,
|
|
OPEN_BRACKET = 26,
|
|
CLOSE_BRACKET = 27,
|
|
TYPE_VOID = 28,
|
|
TYPE_OBJECT = 29,
|
|
TYPE_INTERFACE = 30,
|
|
TYPE_INT = 31,
|
|
TYPE_UINT = 32,
|
|
TYPE_FLOAT = 33,
|
|
TYPE_DOUBLE = 34,
|
|
TYPE_STRING = 35,
|
|
TYPE_CHAR = 36,
|
|
TYPE_BOOL = 37,
|
|
KEYWORD_CONST = 38,
|
|
KEYWORD_SHL = 39,
|
|
KEYWORD_SHR = 40,
|
|
KEYWORD_XOR = 41,
|
|
KEYWORD_AND = 42,
|
|
KEYWORD_OR = 43,
|
|
KEYWORD_NOT = 44,
|
|
KEYWORD_NULL = 45,
|
|
KEYWORD_THIS = 46,
|
|
KEYWORD_TRUE = 47,
|
|
KEYWORD_FALSE = 48,
|
|
KEYWORD_LET = 49,
|
|
KEYWORD_IN = 50,
|
|
KEYWORD_RANGE = 51,
|
|
KEYWORD_NEW = 52,
|
|
KEYWORD_OF = 53,
|
|
KEYWORD_AS = 54,
|
|
KEYWORD_IS = 55,
|
|
KEYWORD_CAST = 56,
|
|
KEYWORD_FUNC = 57,
|
|
KEYWORD_TYPEOF = 58,
|
|
KEYWORD_TYPE = 59,
|
|
KEYWORD_BIND = 60,
|
|
KEYWORD_OBSERVE = 61,
|
|
KEYWORD_ON = 62,
|
|
KEYWORD_ATTACH = 63,
|
|
KEYWORD_DETACH = 64,
|
|
KEYWORD_VAR = 65,
|
|
KEYWORD_BREAK = 66,
|
|
KEYWORD_CONTINUE = 67,
|
|
KEYWORD_RETURN = 68,
|
|
KEYWORD_DELETE = 69,
|
|
KEYWORD_RAISE = 70,
|
|
KEYWORD_IF = 71,
|
|
KEYWORD_ELSE = 72,
|
|
KEYWORD_SWITCH = 73,
|
|
KEYWORD_CASE = 74,
|
|
KEYWORD_DEFAULT = 75,
|
|
KEYWORD_WHILE = 76,
|
|
KEYWORD_FOR = 77,
|
|
KEYWORD_REVERSED = 78,
|
|
KEYWORD_TRY = 79,
|
|
KEYWORD_CATCH = 80,
|
|
KEYWORD_FINALLY = 81,
|
|
KEYWORD_CLASS = 82,
|
|
KEYWORD_PROP = 83,
|
|
KEYWORD_EVENT = 84,
|
|
KEYWORD_STATIC = 85,
|
|
KEYWORD_OVERRIDE = 86,
|
|
KEYWORD_USING = 87,
|
|
KEYWORD_NAMESPACE = 88,
|
|
KEYWORD_MODULE = 89,
|
|
KEYWORD_UNIT = 90,
|
|
NAME = 91,
|
|
ORDERED_NAME = 92,
|
|
FLOAT = 93,
|
|
INTEGER = 94,
|
|
STRING = 95,
|
|
FORMATSTRING = 96,
|
|
SPACE = 97,
|
|
};
|
|
class WfType;
|
|
class WfPredefinedType;
|
|
class WfTopQualifiedType;
|
|
class WfReferenceType;
|
|
class WfRawPointerType;
|
|
class WfSharedPointerType;
|
|
class WfNullableType;
|
|
class WfEnumerableType;
|
|
class WfMapType;
|
|
class WfFunctionType;
|
|
class WfChildType;
|
|
class WfExpression;
|
|
class WfThisExpression;
|
|
class WfTopQualifiedExpression;
|
|
class WfReferenceExpression;
|
|
class WfOrderedNameExpression;
|
|
class WfOrderedLambdaExpression;
|
|
class WfMemberExpression;
|
|
class WfChildExpression;
|
|
class WfLiteralExpression;
|
|
class WfFloatingExpression;
|
|
class WfIntegerExpression;
|
|
class WfStringExpression;
|
|
class WfFormatExpression;
|
|
class WfUnaryExpression;
|
|
class WfBinaryExpression;
|
|
class WfLetVariable;
|
|
class WfLetExpression;
|
|
class WfIfExpression;
|
|
class WfRangeExpression;
|
|
class WfSetTestingExpression;
|
|
class WfConstructorArgument;
|
|
class WfConstructorExpression;
|
|
class WfInferExpression;
|
|
class WfTypeCastingExpression;
|
|
class WfTypeTestingExpression;
|
|
class WfTypeOfTypeExpression;
|
|
class WfTypeOfExpressionExpression;
|
|
class WfAttachEventExpression;
|
|
class WfDetachEventExpression;
|
|
class WfBindExpression;
|
|
class WfObserveExpression;
|
|
class WfCallExpression;
|
|
class WfStatement;
|
|
class WfBreakStatement;
|
|
class WfContinueStatement;
|
|
class WfReturnStatement;
|
|
class WfDeleteStatement;
|
|
class WfRaiseExceptionStatement;
|
|
class WfIfStatement;
|
|
class WfSwitchCase;
|
|
class WfSwitchStatement;
|
|
class WfWhileStatement;
|
|
class WfForEachStatement;
|
|
class WfTryStatement;
|
|
class WfBlockStatement;
|
|
class WfExpressionStatement;
|
|
class WfDeclaration;
|
|
class WfNamespaceDeclaration;
|
|
class WfFunctionArgument;
|
|
class WfFunctionDeclaration;
|
|
class WfFunctionExpression;
|
|
class WfVariableDeclaration;
|
|
class WfVariableStatement;
|
|
class WfEventDeclaration;
|
|
class WfPropertyDeclaration;
|
|
class WfClassMember;
|
|
class WfNewClassExpression;
|
|
class WfNewInterfaceExpression;
|
|
class WfBaseConstructorCall;
|
|
class WfConstructorDeclaration;
|
|
class WfDestructorDeclaration;
|
|
class WfClassDeclaration;
|
|
class WfModuleUsingFragment;
|
|
class WfModuleUsingNameFragment;
|
|
class WfModuleUsingWildCardFragment;
|
|
class WfModuleUsingItem;
|
|
class WfModuleUsingPath;
|
|
class WfModule;
|
|
|
|
class WfType abstract : public vl::parsing::ParsingTreeCustomBase, vl::reflection::Description<WfType>
|
|
{
|
|
public:
|
|
class IVisitor : public vl::reflection::IDescriptable, vl::reflection::Description<IVisitor>
|
|
{
|
|
public:
|
|
virtual void Visit(WfPredefinedType* node)=0;
|
|
virtual void Visit(WfTopQualifiedType* node)=0;
|
|
virtual void Visit(WfReferenceType* node)=0;
|
|
virtual void Visit(WfRawPointerType* node)=0;
|
|
virtual void Visit(WfSharedPointerType* node)=0;
|
|
virtual void Visit(WfNullableType* node)=0;
|
|
virtual void Visit(WfEnumerableType* node)=0;
|
|
virtual void Visit(WfMapType* node)=0;
|
|
virtual void Visit(WfFunctionType* node)=0;
|
|
virtual void Visit(WfChildType* node)=0;
|
|
};
|
|
|
|
virtual void Accept(WfType::IVisitor* visitor)=0;
|
|
|
|
};
|
|
|
|
enum class WfPredefinedTypeName
|
|
{
|
|
Void,
|
|
Object,
|
|
Interface,
|
|
Int,
|
|
UInt,
|
|
Float,
|
|
Double,
|
|
String,
|
|
Char,
|
|
Bool,
|
|
};
|
|
|
|
class WfPredefinedType : public WfType, vl::reflection::Description<WfPredefinedType>
|
|
{
|
|
public:
|
|
WfPredefinedTypeName name;
|
|
|
|
void Accept(WfType::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfPredefinedType> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfTopQualifiedType : public WfType, vl::reflection::Description<WfTopQualifiedType>
|
|
{
|
|
public:
|
|
vl::parsing::ParsingToken name;
|
|
|
|
void Accept(WfType::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfTopQualifiedType> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfReferenceType : public WfType, vl::reflection::Description<WfReferenceType>
|
|
{
|
|
public:
|
|
vl::parsing::ParsingToken name;
|
|
|
|
void Accept(WfType::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfReferenceType> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfRawPointerType : public WfType, vl::reflection::Description<WfRawPointerType>
|
|
{
|
|
public:
|
|
vl::Ptr<WfType> element;
|
|
|
|
void Accept(WfType::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfRawPointerType> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfSharedPointerType : public WfType, vl::reflection::Description<WfSharedPointerType>
|
|
{
|
|
public:
|
|
vl::Ptr<WfType> element;
|
|
|
|
void Accept(WfType::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfSharedPointerType> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfNullableType : public WfType, vl::reflection::Description<WfNullableType>
|
|
{
|
|
public:
|
|
vl::Ptr<WfType> element;
|
|
|
|
void Accept(WfType::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfNullableType> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfEnumerableType : public WfType, vl::reflection::Description<WfEnumerableType>
|
|
{
|
|
public:
|
|
vl::Ptr<WfType> element;
|
|
|
|
void Accept(WfType::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfEnumerableType> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
enum class WfMapWritability
|
|
{
|
|
Readonly,
|
|
Writable,
|
|
};
|
|
|
|
class WfMapType : public WfType, vl::reflection::Description<WfMapType>
|
|
{
|
|
public:
|
|
WfMapWritability writability;
|
|
vl::Ptr<WfType> key;
|
|
vl::Ptr<WfType> value;
|
|
|
|
void Accept(WfType::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfMapType> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfFunctionType : public WfType, vl::reflection::Description<WfFunctionType>
|
|
{
|
|
public:
|
|
vl::Ptr<WfType> result;
|
|
vl::collections::List<vl::Ptr<WfType>> arguments;
|
|
|
|
void Accept(WfType::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfFunctionType> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfChildType : public WfType, vl::reflection::Description<WfChildType>
|
|
{
|
|
public:
|
|
vl::Ptr<WfType> parent;
|
|
vl::parsing::ParsingToken name;
|
|
|
|
void Accept(WfType::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfChildType> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfExpression abstract : public vl::parsing::ParsingTreeCustomBase, vl::reflection::Description<WfExpression>
|
|
{
|
|
public:
|
|
class IVisitor : public vl::reflection::IDescriptable, vl::reflection::Description<IVisitor>
|
|
{
|
|
public:
|
|
virtual void Visit(WfThisExpression* node)=0;
|
|
virtual void Visit(WfTopQualifiedExpression* node)=0;
|
|
virtual void Visit(WfReferenceExpression* node)=0;
|
|
virtual void Visit(WfOrderedNameExpression* node)=0;
|
|
virtual void Visit(WfOrderedLambdaExpression* node)=0;
|
|
virtual void Visit(WfMemberExpression* node)=0;
|
|
virtual void Visit(WfChildExpression* node)=0;
|
|
virtual void Visit(WfLiteralExpression* node)=0;
|
|
virtual void Visit(WfFloatingExpression* node)=0;
|
|
virtual void Visit(WfIntegerExpression* node)=0;
|
|
virtual void Visit(WfStringExpression* node)=0;
|
|
virtual void Visit(WfFormatExpression* node)=0;
|
|
virtual void Visit(WfUnaryExpression* node)=0;
|
|
virtual void Visit(WfBinaryExpression* node)=0;
|
|
virtual void Visit(WfLetExpression* node)=0;
|
|
virtual void Visit(WfIfExpression* node)=0;
|
|
virtual void Visit(WfRangeExpression* node)=0;
|
|
virtual void Visit(WfSetTestingExpression* node)=0;
|
|
virtual void Visit(WfConstructorExpression* node)=0;
|
|
virtual void Visit(WfInferExpression* node)=0;
|
|
virtual void Visit(WfTypeCastingExpression* node)=0;
|
|
virtual void Visit(WfTypeTestingExpression* node)=0;
|
|
virtual void Visit(WfTypeOfTypeExpression* node)=0;
|
|
virtual void Visit(WfTypeOfExpressionExpression* node)=0;
|
|
virtual void Visit(WfAttachEventExpression* node)=0;
|
|
virtual void Visit(WfDetachEventExpression* node)=0;
|
|
virtual void Visit(WfBindExpression* node)=0;
|
|
virtual void Visit(WfObserveExpression* node)=0;
|
|
virtual void Visit(WfCallExpression* node)=0;
|
|
virtual void Visit(WfFunctionExpression* node)=0;
|
|
virtual void Visit(WfNewClassExpression* node)=0;
|
|
virtual void Visit(WfNewInterfaceExpression* node)=0;
|
|
};
|
|
|
|
virtual void Accept(WfExpression::IVisitor* visitor)=0;
|
|
|
|
};
|
|
|
|
class WfThisExpression : public WfExpression, vl::reflection::Description<WfThisExpression>
|
|
{
|
|
public:
|
|
|
|
void Accept(WfExpression::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfThisExpression> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfTopQualifiedExpression : public WfExpression, vl::reflection::Description<WfTopQualifiedExpression>
|
|
{
|
|
public:
|
|
vl::parsing::ParsingToken name;
|
|
|
|
void Accept(WfExpression::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfTopQualifiedExpression> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfReferenceExpression : public WfExpression, vl::reflection::Description<WfReferenceExpression>
|
|
{
|
|
public:
|
|
vl::parsing::ParsingToken name;
|
|
|
|
void Accept(WfExpression::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfReferenceExpression> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfOrderedNameExpression : public WfExpression, vl::reflection::Description<WfOrderedNameExpression>
|
|
{
|
|
public:
|
|
vl::parsing::ParsingToken name;
|
|
|
|
void Accept(WfExpression::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfOrderedNameExpression> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfOrderedLambdaExpression : public WfExpression, vl::reflection::Description<WfOrderedLambdaExpression>
|
|
{
|
|
public:
|
|
vl::Ptr<WfExpression> body;
|
|
|
|
void Accept(WfExpression::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfOrderedLambdaExpression> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfMemberExpression : public WfExpression, vl::reflection::Description<WfMemberExpression>
|
|
{
|
|
public:
|
|
vl::Ptr<WfExpression> parent;
|
|
vl::parsing::ParsingToken name;
|
|
|
|
void Accept(WfExpression::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfMemberExpression> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfChildExpression : public WfExpression, vl::reflection::Description<WfChildExpression>
|
|
{
|
|
public:
|
|
vl::Ptr<WfExpression> parent;
|
|
vl::parsing::ParsingToken name;
|
|
|
|
void Accept(WfExpression::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfChildExpression> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
enum class WfLiteralValue
|
|
{
|
|
Null,
|
|
True,
|
|
False,
|
|
};
|
|
|
|
class WfLiteralExpression : public WfExpression, vl::reflection::Description<WfLiteralExpression>
|
|
{
|
|
public:
|
|
WfLiteralValue value;
|
|
|
|
void Accept(WfExpression::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfLiteralExpression> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfFloatingExpression : public WfExpression, vl::reflection::Description<WfFloatingExpression>
|
|
{
|
|
public:
|
|
vl::parsing::ParsingToken value;
|
|
|
|
void Accept(WfExpression::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfFloatingExpression> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfIntegerExpression : public WfExpression, vl::reflection::Description<WfIntegerExpression>
|
|
{
|
|
public:
|
|
vl::parsing::ParsingToken value;
|
|
|
|
void Accept(WfExpression::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfIntegerExpression> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfStringExpression : public WfExpression, vl::reflection::Description<WfStringExpression>
|
|
{
|
|
public:
|
|
vl::parsing::ParsingToken value;
|
|
|
|
void Accept(WfExpression::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfStringExpression> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfFormatExpression : public WfExpression, vl::reflection::Description<WfFormatExpression>
|
|
{
|
|
public:
|
|
vl::parsing::ParsingToken value;
|
|
vl::Ptr<WfExpression> expandedExpression;
|
|
|
|
void Accept(WfExpression::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfFormatExpression> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
enum class WfUnaryOperator
|
|
{
|
|
Positive,
|
|
Negative,
|
|
Not,
|
|
};
|
|
|
|
class WfUnaryExpression : public WfExpression, vl::reflection::Description<WfUnaryExpression>
|
|
{
|
|
public:
|
|
WfUnaryOperator op;
|
|
vl::Ptr<WfExpression> operand;
|
|
|
|
void Accept(WfExpression::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfUnaryExpression> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
enum class WfBinaryOperator
|
|
{
|
|
Assign,
|
|
Index,
|
|
Union,
|
|
Intersect,
|
|
FailedThen,
|
|
Exp,
|
|
Add,
|
|
Sub,
|
|
Mul,
|
|
Div,
|
|
Mod,
|
|
Shl,
|
|
Shr,
|
|
LT,
|
|
GT,
|
|
LE,
|
|
GE,
|
|
EQ,
|
|
NE,
|
|
Xor,
|
|
And,
|
|
Or,
|
|
};
|
|
|
|
class WfBinaryExpression : public WfExpression, vl::reflection::Description<WfBinaryExpression>
|
|
{
|
|
public:
|
|
WfBinaryOperator op;
|
|
vl::Ptr<WfExpression> first;
|
|
vl::Ptr<WfExpression> second;
|
|
|
|
void Accept(WfExpression::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfBinaryExpression> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfLetVariable : public vl::parsing::ParsingTreeCustomBase, vl::reflection::Description<WfLetVariable>
|
|
{
|
|
public:
|
|
vl::parsing::ParsingToken name;
|
|
vl::Ptr<WfExpression> value;
|
|
|
|
static vl::Ptr<WfLetVariable> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfLetExpression : public WfExpression, vl::reflection::Description<WfLetExpression>
|
|
{
|
|
public:
|
|
vl::collections::List<vl::Ptr<WfLetVariable>> variables;
|
|
vl::Ptr<WfExpression> expression;
|
|
|
|
void Accept(WfExpression::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfLetExpression> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfIfExpression : public WfExpression, vl::reflection::Description<WfIfExpression>
|
|
{
|
|
public:
|
|
vl::Ptr<WfExpression> condition;
|
|
vl::Ptr<WfExpression> trueBranch;
|
|
vl::Ptr<WfExpression> falseBranch;
|
|
|
|
void Accept(WfExpression::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfIfExpression> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
enum class WfRangeBoundary
|
|
{
|
|
Inclusive,
|
|
Exclusive,
|
|
};
|
|
|
|
class WfRangeExpression : public WfExpression, vl::reflection::Description<WfRangeExpression>
|
|
{
|
|
public:
|
|
vl::Ptr<WfExpression> begin;
|
|
WfRangeBoundary beginBoundary;
|
|
vl::Ptr<WfExpression> end;
|
|
WfRangeBoundary endBoundary;
|
|
|
|
void Accept(WfExpression::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfRangeExpression> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
enum class WfSetTesting
|
|
{
|
|
In,
|
|
NotIn,
|
|
};
|
|
|
|
class WfSetTestingExpression : public WfExpression, vl::reflection::Description<WfSetTestingExpression>
|
|
{
|
|
public:
|
|
WfSetTesting test;
|
|
vl::Ptr<WfExpression> element;
|
|
vl::Ptr<WfExpression> collection;
|
|
|
|
void Accept(WfExpression::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfSetTestingExpression> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfConstructorArgument : public vl::parsing::ParsingTreeCustomBase, vl::reflection::Description<WfConstructorArgument>
|
|
{
|
|
public:
|
|
vl::Ptr<WfExpression> key;
|
|
vl::Ptr<WfExpression> value;
|
|
|
|
static vl::Ptr<WfConstructorArgument> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfConstructorExpression : public WfExpression, vl::reflection::Description<WfConstructorExpression>
|
|
{
|
|
public:
|
|
vl::collections::List<vl::Ptr<WfConstructorArgument>> arguments;
|
|
|
|
void Accept(WfExpression::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfConstructorExpression> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfInferExpression : public WfExpression, vl::reflection::Description<WfInferExpression>
|
|
{
|
|
public:
|
|
vl::Ptr<WfExpression> expression;
|
|
vl::Ptr<WfType> type;
|
|
|
|
void Accept(WfExpression::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfInferExpression> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
enum class WfTypeCastingStrategy
|
|
{
|
|
Strong,
|
|
Weak,
|
|
};
|
|
|
|
class WfTypeCastingExpression : public WfExpression, vl::reflection::Description<WfTypeCastingExpression>
|
|
{
|
|
public:
|
|
WfTypeCastingStrategy strategy;
|
|
vl::Ptr<WfExpression> expression;
|
|
vl::Ptr<WfType> type;
|
|
|
|
void Accept(WfExpression::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfTypeCastingExpression> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
enum class WfTypeTesting
|
|
{
|
|
IsType,
|
|
IsNotType,
|
|
IsNull,
|
|
IsNotNull,
|
|
};
|
|
|
|
class WfTypeTestingExpression : public WfExpression, vl::reflection::Description<WfTypeTestingExpression>
|
|
{
|
|
public:
|
|
WfTypeTesting test;
|
|
vl::Ptr<WfExpression> expression;
|
|
vl::Ptr<WfType> type;
|
|
|
|
void Accept(WfExpression::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfTypeTestingExpression> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfTypeOfTypeExpression : public WfExpression, vl::reflection::Description<WfTypeOfTypeExpression>
|
|
{
|
|
public:
|
|
vl::Ptr<WfType> type;
|
|
|
|
void Accept(WfExpression::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfTypeOfTypeExpression> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfTypeOfExpressionExpression : public WfExpression, vl::reflection::Description<WfTypeOfExpressionExpression>
|
|
{
|
|
public:
|
|
vl::Ptr<WfExpression> expression;
|
|
|
|
void Accept(WfExpression::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfTypeOfExpressionExpression> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfAttachEventExpression : public WfExpression, vl::reflection::Description<WfAttachEventExpression>
|
|
{
|
|
public:
|
|
vl::Ptr<WfExpression> event;
|
|
vl::Ptr<WfExpression> function;
|
|
|
|
void Accept(WfExpression::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfAttachEventExpression> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfDetachEventExpression : public WfExpression, vl::reflection::Description<WfDetachEventExpression>
|
|
{
|
|
public:
|
|
vl::Ptr<WfExpression> handler;
|
|
|
|
void Accept(WfExpression::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfDetachEventExpression> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfBindExpression : public WfExpression, vl::reflection::Description<WfBindExpression>
|
|
{
|
|
public:
|
|
vl::Ptr<WfExpression> expression;
|
|
vl::Ptr<WfExpression> expandedExpression;
|
|
|
|
void Accept(WfExpression::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfBindExpression> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
enum class WfObserveType
|
|
{
|
|
SimpleObserve,
|
|
ExtendedObserve,
|
|
};
|
|
|
|
class WfObserveExpression : public WfExpression, vl::reflection::Description<WfObserveExpression>
|
|
{
|
|
public:
|
|
vl::Ptr<WfExpression> parent;
|
|
WfObserveType observeType;
|
|
vl::parsing::ParsingToken name;
|
|
vl::Ptr<WfExpression> expression;
|
|
vl::collections::List<vl::Ptr<WfExpression>> events;
|
|
|
|
void Accept(WfExpression::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfObserveExpression> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfCallExpression : public WfExpression, vl::reflection::Description<WfCallExpression>
|
|
{
|
|
public:
|
|
vl::Ptr<WfExpression> function;
|
|
vl::collections::List<vl::Ptr<WfExpression>> arguments;
|
|
|
|
void Accept(WfExpression::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfCallExpression> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfStatement abstract : public vl::parsing::ParsingTreeCustomBase, vl::reflection::Description<WfStatement>
|
|
{
|
|
public:
|
|
class IVisitor : public vl::reflection::IDescriptable, vl::reflection::Description<IVisitor>
|
|
{
|
|
public:
|
|
virtual void Visit(WfBreakStatement* node)=0;
|
|
virtual void Visit(WfContinueStatement* node)=0;
|
|
virtual void Visit(WfReturnStatement* node)=0;
|
|
virtual void Visit(WfDeleteStatement* node)=0;
|
|
virtual void Visit(WfRaiseExceptionStatement* node)=0;
|
|
virtual void Visit(WfIfStatement* node)=0;
|
|
virtual void Visit(WfSwitchStatement* node)=0;
|
|
virtual void Visit(WfWhileStatement* node)=0;
|
|
virtual void Visit(WfForEachStatement* node)=0;
|
|
virtual void Visit(WfTryStatement* node)=0;
|
|
virtual void Visit(WfBlockStatement* node)=0;
|
|
virtual void Visit(WfExpressionStatement* node)=0;
|
|
virtual void Visit(WfVariableStatement* node)=0;
|
|
};
|
|
|
|
virtual void Accept(WfStatement::IVisitor* visitor)=0;
|
|
|
|
};
|
|
|
|
class WfBreakStatement : public WfStatement, vl::reflection::Description<WfBreakStatement>
|
|
{
|
|
public:
|
|
|
|
void Accept(WfStatement::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfBreakStatement> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfContinueStatement : public WfStatement, vl::reflection::Description<WfContinueStatement>
|
|
{
|
|
public:
|
|
|
|
void Accept(WfStatement::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfContinueStatement> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfReturnStatement : public WfStatement, vl::reflection::Description<WfReturnStatement>
|
|
{
|
|
public:
|
|
vl::Ptr<WfExpression> expression;
|
|
|
|
void Accept(WfStatement::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfReturnStatement> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfDeleteStatement : public WfStatement, vl::reflection::Description<WfDeleteStatement>
|
|
{
|
|
public:
|
|
vl::Ptr<WfExpression> expression;
|
|
|
|
void Accept(WfStatement::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfDeleteStatement> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfRaiseExceptionStatement : public WfStatement, vl::reflection::Description<WfRaiseExceptionStatement>
|
|
{
|
|
public:
|
|
vl::Ptr<WfExpression> expression;
|
|
|
|
void Accept(WfStatement::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfRaiseExceptionStatement> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfIfStatement : public WfStatement, vl::reflection::Description<WfIfStatement>
|
|
{
|
|
public:
|
|
vl::Ptr<WfType> type;
|
|
vl::parsing::ParsingToken name;
|
|
vl::Ptr<WfExpression> expression;
|
|
vl::Ptr<WfStatement> trueBranch;
|
|
vl::Ptr<WfStatement> falseBranch;
|
|
|
|
void Accept(WfStatement::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfIfStatement> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfSwitchCase : public vl::parsing::ParsingTreeCustomBase, vl::reflection::Description<WfSwitchCase>
|
|
{
|
|
public:
|
|
vl::Ptr<WfExpression> expression;
|
|
vl::Ptr<WfStatement> statement;
|
|
|
|
static vl::Ptr<WfSwitchCase> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfSwitchStatement : public WfStatement, vl::reflection::Description<WfSwitchStatement>
|
|
{
|
|
public:
|
|
vl::Ptr<WfExpression> expression;
|
|
vl::collections::List<vl::Ptr<WfSwitchCase>> caseBranches;
|
|
vl::Ptr<WfStatement> defaultBranch;
|
|
|
|
void Accept(WfStatement::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfSwitchStatement> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfWhileStatement : public WfStatement, vl::reflection::Description<WfWhileStatement>
|
|
{
|
|
public:
|
|
vl::Ptr<WfExpression> condition;
|
|
vl::Ptr<WfStatement> statement;
|
|
|
|
void Accept(WfStatement::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfWhileStatement> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
enum class WfForEachDirection
|
|
{
|
|
Normal,
|
|
Reversed,
|
|
};
|
|
|
|
class WfForEachStatement : public WfStatement, vl::reflection::Description<WfForEachStatement>
|
|
{
|
|
public:
|
|
vl::parsing::ParsingToken name;
|
|
WfForEachDirection direction;
|
|
vl::Ptr<WfExpression> collection;
|
|
vl::Ptr<WfStatement> statement;
|
|
|
|
void Accept(WfStatement::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfForEachStatement> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfTryStatement : public WfStatement, vl::reflection::Description<WfTryStatement>
|
|
{
|
|
public:
|
|
vl::Ptr<WfStatement> protectedStatement;
|
|
vl::parsing::ParsingToken name;
|
|
vl::Ptr<WfStatement> catchStatement;
|
|
vl::Ptr<WfStatement> finallyStatement;
|
|
|
|
void Accept(WfStatement::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfTryStatement> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfBlockStatement : public WfStatement, vl::reflection::Description<WfBlockStatement>
|
|
{
|
|
public:
|
|
vl::collections::List<vl::Ptr<WfStatement>> statements;
|
|
|
|
void Accept(WfStatement::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfBlockStatement> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfExpressionStatement : public WfStatement, vl::reflection::Description<WfExpressionStatement>
|
|
{
|
|
public:
|
|
vl::Ptr<WfExpression> expression;
|
|
|
|
void Accept(WfStatement::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfExpressionStatement> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfDeclaration abstract : public vl::parsing::ParsingTreeCustomBase, vl::reflection::Description<WfDeclaration>
|
|
{
|
|
public:
|
|
class IVisitor : public vl::reflection::IDescriptable, vl::reflection::Description<IVisitor>
|
|
{
|
|
public:
|
|
virtual void Visit(WfNamespaceDeclaration* node)=0;
|
|
virtual void Visit(WfFunctionDeclaration* node)=0;
|
|
virtual void Visit(WfVariableDeclaration* node)=0;
|
|
virtual void Visit(WfEventDeclaration* node)=0;
|
|
virtual void Visit(WfPropertyDeclaration* node)=0;
|
|
virtual void Visit(WfConstructorDeclaration* node)=0;
|
|
virtual void Visit(WfDestructorDeclaration* node)=0;
|
|
virtual void Visit(WfClassDeclaration* node)=0;
|
|
};
|
|
|
|
virtual void Accept(WfDeclaration::IVisitor* visitor)=0;
|
|
|
|
vl::parsing::ParsingToken name;
|
|
};
|
|
|
|
class WfNamespaceDeclaration : public WfDeclaration, vl::reflection::Description<WfNamespaceDeclaration>
|
|
{
|
|
public:
|
|
vl::collections::List<vl::Ptr<WfDeclaration>> declarations;
|
|
|
|
void Accept(WfDeclaration::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfNamespaceDeclaration> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfFunctionArgument : public vl::parsing::ParsingTreeCustomBase, vl::reflection::Description<WfFunctionArgument>
|
|
{
|
|
public:
|
|
vl::parsing::ParsingToken name;
|
|
vl::Ptr<WfType> type;
|
|
|
|
static vl::Ptr<WfFunctionArgument> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
enum class WfFunctionAnonymity
|
|
{
|
|
Named,
|
|
Anonymous,
|
|
};
|
|
|
|
class WfFunctionDeclaration : public WfDeclaration, vl::reflection::Description<WfFunctionDeclaration>
|
|
{
|
|
public:
|
|
WfFunctionAnonymity anonymity;
|
|
vl::collections::List<vl::Ptr<WfFunctionArgument>> arguments;
|
|
vl::Ptr<WfType> returnType;
|
|
vl::Ptr<WfStatement> statement;
|
|
|
|
void Accept(WfDeclaration::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfFunctionDeclaration> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfFunctionExpression : public WfExpression, vl::reflection::Description<WfFunctionExpression>
|
|
{
|
|
public:
|
|
vl::Ptr<WfFunctionDeclaration> function;
|
|
|
|
void Accept(WfExpression::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfFunctionExpression> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfVariableDeclaration : public WfDeclaration, vl::reflection::Description<WfVariableDeclaration>
|
|
{
|
|
public:
|
|
vl::Ptr<WfType> type;
|
|
vl::Ptr<WfExpression> expression;
|
|
|
|
void Accept(WfDeclaration::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfVariableDeclaration> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfVariableStatement : public WfStatement, vl::reflection::Description<WfVariableStatement>
|
|
{
|
|
public:
|
|
vl::Ptr<WfVariableDeclaration> variable;
|
|
|
|
void Accept(WfStatement::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfVariableStatement> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfEventDeclaration : public WfDeclaration, vl::reflection::Description<WfEventDeclaration>
|
|
{
|
|
public:
|
|
vl::collections::List<vl::Ptr<WfType>> arguments;
|
|
|
|
void Accept(WfDeclaration::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfEventDeclaration> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfPropertyDeclaration : public WfDeclaration, vl::reflection::Description<WfPropertyDeclaration>
|
|
{
|
|
public:
|
|
vl::Ptr<WfType> type;
|
|
vl::parsing::ParsingToken getter;
|
|
vl::parsing::ParsingToken setter;
|
|
vl::parsing::ParsingToken valueChangedEvent;
|
|
|
|
void Accept(WfDeclaration::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfPropertyDeclaration> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
enum class WfClassMemberKind
|
|
{
|
|
Static,
|
|
Override,
|
|
Normal,
|
|
};
|
|
|
|
class WfClassMember : public vl::parsing::ParsingTreeCustomBase, vl::reflection::Description<WfClassMember>
|
|
{
|
|
public:
|
|
WfClassMemberKind kind;
|
|
vl::Ptr<WfDeclaration> declaration;
|
|
|
|
static vl::Ptr<WfClassMember> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfNewClassExpression : public WfExpression, vl::reflection::Description<WfNewClassExpression>
|
|
{
|
|
public:
|
|
vl::Ptr<WfType> type;
|
|
vl::collections::List<vl::Ptr<WfExpression>> arguments;
|
|
|
|
void Accept(WfExpression::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfNewClassExpression> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfNewInterfaceExpression : public WfExpression, vl::reflection::Description<WfNewInterfaceExpression>
|
|
{
|
|
public:
|
|
vl::Ptr<WfType> type;
|
|
vl::collections::List<vl::Ptr<WfClassMember>> members;
|
|
|
|
void Accept(WfExpression::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfNewInterfaceExpression> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
enum class WfClassKind
|
|
{
|
|
Class,
|
|
Interface,
|
|
};
|
|
|
|
enum class WfConstructorType
|
|
{
|
|
Undefined,
|
|
SharedPtr,
|
|
RawPtr,
|
|
};
|
|
|
|
class WfBaseConstructorCall : public vl::parsing::ParsingTreeCustomBase, vl::reflection::Description<WfBaseConstructorCall>
|
|
{
|
|
public:
|
|
vl::Ptr<WfType> type;
|
|
vl::collections::List<vl::Ptr<WfExpression>> arguments;
|
|
|
|
static vl::Ptr<WfBaseConstructorCall> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfConstructorDeclaration : public WfDeclaration, vl::reflection::Description<WfConstructorDeclaration>
|
|
{
|
|
public:
|
|
WfConstructorType constructorType;
|
|
vl::collections::List<vl::Ptr<WfBaseConstructorCall>> baseConstructorCalls;
|
|
vl::collections::List<vl::Ptr<WfFunctionArgument>> arguments;
|
|
vl::Ptr<WfStatement> statement;
|
|
|
|
void Accept(WfDeclaration::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfConstructorDeclaration> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfDestructorDeclaration : public WfDeclaration, vl::reflection::Description<WfDestructorDeclaration>
|
|
{
|
|
public:
|
|
vl::Ptr<WfStatement> statement;
|
|
|
|
void Accept(WfDeclaration::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfDestructorDeclaration> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfClassDeclaration : public WfDeclaration, vl::reflection::Description<WfClassDeclaration>
|
|
{
|
|
public:
|
|
WfClassKind kind;
|
|
WfConstructorType constructorType;
|
|
vl::collections::List<vl::Ptr<WfType>> baseTypes;
|
|
vl::collections::List<vl::Ptr<WfClassMember>> members;
|
|
|
|
void Accept(WfDeclaration::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfClassDeclaration> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfModuleUsingFragment abstract : public vl::parsing::ParsingTreeCustomBase, vl::reflection::Description<WfModuleUsingFragment>
|
|
{
|
|
public:
|
|
class IVisitor : public vl::reflection::IDescriptable, vl::reflection::Description<IVisitor>
|
|
{
|
|
public:
|
|
virtual void Visit(WfModuleUsingNameFragment* node)=0;
|
|
virtual void Visit(WfModuleUsingWildCardFragment* node)=0;
|
|
};
|
|
|
|
virtual void Accept(WfModuleUsingFragment::IVisitor* visitor)=0;
|
|
|
|
};
|
|
|
|
class WfModuleUsingNameFragment : public WfModuleUsingFragment, vl::reflection::Description<WfModuleUsingNameFragment>
|
|
{
|
|
public:
|
|
vl::parsing::ParsingToken name;
|
|
|
|
void Accept(WfModuleUsingFragment::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfModuleUsingNameFragment> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfModuleUsingWildCardFragment : public WfModuleUsingFragment, vl::reflection::Description<WfModuleUsingWildCardFragment>
|
|
{
|
|
public:
|
|
|
|
void Accept(WfModuleUsingFragment::IVisitor* visitor)override;
|
|
|
|
static vl::Ptr<WfModuleUsingWildCardFragment> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfModuleUsingItem : public vl::parsing::ParsingTreeCustomBase, vl::reflection::Description<WfModuleUsingItem>
|
|
{
|
|
public:
|
|
vl::collections::List<vl::Ptr<WfModuleUsingFragment>> fragments;
|
|
|
|
static vl::Ptr<WfModuleUsingItem> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
class WfModuleUsingPath : public vl::parsing::ParsingTreeCustomBase, vl::reflection::Description<WfModuleUsingPath>
|
|
{
|
|
public:
|
|
vl::collections::List<vl::Ptr<WfModuleUsingItem>> items;
|
|
|
|
static vl::Ptr<WfModuleUsingPath> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
enum class WfModuleType
|
|
{
|
|
Module,
|
|
Unit,
|
|
};
|
|
|
|
class WfModule : public vl::parsing::ParsingTreeCustomBase, vl::reflection::Description<WfModule>
|
|
{
|
|
public:
|
|
WfModuleType moduleType;
|
|
vl::parsing::ParsingToken name;
|
|
vl::collections::List<vl::Ptr<WfModuleUsingPath>> paths;
|
|
vl::collections::List<vl::Ptr<WfDeclaration>> declarations;
|
|
|
|
static vl::Ptr<WfModule> Convert(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
};
|
|
|
|
extern vl::WString WfGetParserTextBuffer();
|
|
extern vl::Ptr<vl::parsing::ParsingTreeCustomBase> WfConvertParsingTreeNode(vl::Ptr<vl::parsing::ParsingTreeNode> node, const vl::collections::List<vl::regex::RegexToken>& tokens);
|
|
extern vl::Ptr<vl::parsing::tabling::ParsingTable> WfLoadTable();
|
|
|
|
extern vl::Ptr<vl::parsing::ParsingTreeNode> WfParseDeclarationAsParsingTreeNode(const vl::WString& input, vl::Ptr<vl::parsing::tabling::ParsingTable> table, vl::collections::List<vl::Ptr<vl::parsing::ParsingError>>& errors, vl::vint codeIndex = -1);
|
|
extern vl::Ptr<vl::parsing::ParsingTreeNode> WfParseDeclarationAsParsingTreeNode(const vl::WString& input, vl::Ptr<vl::parsing::tabling::ParsingTable> table, vl::vint codeIndex = -1);
|
|
extern vl::Ptr<WfDeclaration> WfParseDeclaration(const vl::WString& input, vl::Ptr<vl::parsing::tabling::ParsingTable> table, vl::collections::List<vl::Ptr<vl::parsing::ParsingError>>& errors, vl::vint codeIndex = -1);
|
|
extern vl::Ptr<WfDeclaration> WfParseDeclaration(const vl::WString& input, vl::Ptr<vl::parsing::tabling::ParsingTable> table, vl::vint codeIndex = -1);
|
|
|
|
extern vl::Ptr<vl::parsing::ParsingTreeNode> WfParseExpressionAsParsingTreeNode(const vl::WString& input, vl::Ptr<vl::parsing::tabling::ParsingTable> table, vl::collections::List<vl::Ptr<vl::parsing::ParsingError>>& errors, vl::vint codeIndex = -1);
|
|
extern vl::Ptr<vl::parsing::ParsingTreeNode> WfParseExpressionAsParsingTreeNode(const vl::WString& input, vl::Ptr<vl::parsing::tabling::ParsingTable> table, vl::vint codeIndex = -1);
|
|
extern vl::Ptr<WfExpression> WfParseExpression(const vl::WString& input, vl::Ptr<vl::parsing::tabling::ParsingTable> table, vl::collections::List<vl::Ptr<vl::parsing::ParsingError>>& errors, vl::vint codeIndex = -1);
|
|
extern vl::Ptr<WfExpression> WfParseExpression(const vl::WString& input, vl::Ptr<vl::parsing::tabling::ParsingTable> table, vl::vint codeIndex = -1);
|
|
|
|
extern vl::Ptr<vl::parsing::ParsingTreeNode> WfParseModuleAsParsingTreeNode(const vl::WString& input, vl::Ptr<vl::parsing::tabling::ParsingTable> table, vl::collections::List<vl::Ptr<vl::parsing::ParsingError>>& errors, vl::vint codeIndex = -1);
|
|
extern vl::Ptr<vl::parsing::ParsingTreeNode> WfParseModuleAsParsingTreeNode(const vl::WString& input, vl::Ptr<vl::parsing::tabling::ParsingTable> table, vl::vint codeIndex = -1);
|
|
extern vl::Ptr<WfModule> WfParseModule(const vl::WString& input, vl::Ptr<vl::parsing::tabling::ParsingTable> table, vl::collections::List<vl::Ptr<vl::parsing::ParsingError>>& errors, vl::vint codeIndex = -1);
|
|
extern vl::Ptr<WfModule> WfParseModule(const vl::WString& input, vl::Ptr<vl::parsing::tabling::ParsingTable> table, vl::vint codeIndex = -1);
|
|
|
|
extern vl::Ptr<vl::parsing::ParsingTreeNode> WfParseStatementAsParsingTreeNode(const vl::WString& input, vl::Ptr<vl::parsing::tabling::ParsingTable> table, vl::collections::List<vl::Ptr<vl::parsing::ParsingError>>& errors, vl::vint codeIndex = -1);
|
|
extern vl::Ptr<vl::parsing::ParsingTreeNode> WfParseStatementAsParsingTreeNode(const vl::WString& input, vl::Ptr<vl::parsing::tabling::ParsingTable> table, vl::vint codeIndex = -1);
|
|
extern vl::Ptr<WfStatement> WfParseStatement(const vl::WString& input, vl::Ptr<vl::parsing::tabling::ParsingTable> table, vl::collections::List<vl::Ptr<vl::parsing::ParsingError>>& errors, vl::vint codeIndex = -1);
|
|
extern vl::Ptr<WfStatement> WfParseStatement(const vl::WString& input, vl::Ptr<vl::parsing::tabling::ParsingTable> table, vl::vint codeIndex = -1);
|
|
|
|
extern vl::Ptr<vl::parsing::ParsingTreeNode> WfParseTypeAsParsingTreeNode(const vl::WString& input, vl::Ptr<vl::parsing::tabling::ParsingTable> table, vl::collections::List<vl::Ptr<vl::parsing::ParsingError>>& errors, vl::vint codeIndex = -1);
|
|
extern vl::Ptr<vl::parsing::ParsingTreeNode> WfParseTypeAsParsingTreeNode(const vl::WString& input, vl::Ptr<vl::parsing::tabling::ParsingTable> table, vl::vint codeIndex = -1);
|
|
extern vl::Ptr<WfType> WfParseType(const vl::WString& input, vl::Ptr<vl::parsing::tabling::ParsingTable> table, vl::collections::List<vl::Ptr<vl::parsing::ParsingError>>& errors, vl::vint codeIndex = -1);
|
|
extern vl::Ptr<WfType> WfParseType(const vl::WString& input, vl::Ptr<vl::parsing::tabling::ParsingTable> table, vl::vint codeIndex = -1);
|
|
}
|
|
}
|
|
namespace vl
|
|
{
|
|
namespace reflection
|
|
{
|
|
namespace description
|
|
{
|
|
#ifndef VCZH_DEBUG_NO_REFLECTION
|
|
DECL_TYPE_INFO(vl::workflow::WfType)
|
|
DECL_TYPE_INFO(vl::workflow::WfPredefinedTypeName)
|
|
DECL_TYPE_INFO(vl::workflow::WfPredefinedType)
|
|
DECL_TYPE_INFO(vl::workflow::WfTopQualifiedType)
|
|
DECL_TYPE_INFO(vl::workflow::WfReferenceType)
|
|
DECL_TYPE_INFO(vl::workflow::WfRawPointerType)
|
|
DECL_TYPE_INFO(vl::workflow::WfSharedPointerType)
|
|
DECL_TYPE_INFO(vl::workflow::WfNullableType)
|
|
DECL_TYPE_INFO(vl::workflow::WfEnumerableType)
|
|
DECL_TYPE_INFO(vl::workflow::WfMapWritability)
|
|
DECL_TYPE_INFO(vl::workflow::WfMapType)
|
|
DECL_TYPE_INFO(vl::workflow::WfFunctionType)
|
|
DECL_TYPE_INFO(vl::workflow::WfChildType)
|
|
DECL_TYPE_INFO(vl::workflow::WfExpression)
|
|
DECL_TYPE_INFO(vl::workflow::WfThisExpression)
|
|
DECL_TYPE_INFO(vl::workflow::WfTopQualifiedExpression)
|
|
DECL_TYPE_INFO(vl::workflow::WfReferenceExpression)
|
|
DECL_TYPE_INFO(vl::workflow::WfOrderedNameExpression)
|
|
DECL_TYPE_INFO(vl::workflow::WfOrderedLambdaExpression)
|
|
DECL_TYPE_INFO(vl::workflow::WfMemberExpression)
|
|
DECL_TYPE_INFO(vl::workflow::WfChildExpression)
|
|
DECL_TYPE_INFO(vl::workflow::WfLiteralValue)
|
|
DECL_TYPE_INFO(vl::workflow::WfLiteralExpression)
|
|
DECL_TYPE_INFO(vl::workflow::WfFloatingExpression)
|
|
DECL_TYPE_INFO(vl::workflow::WfIntegerExpression)
|
|
DECL_TYPE_INFO(vl::workflow::WfStringExpression)
|
|
DECL_TYPE_INFO(vl::workflow::WfFormatExpression)
|
|
DECL_TYPE_INFO(vl::workflow::WfUnaryOperator)
|
|
DECL_TYPE_INFO(vl::workflow::WfUnaryExpression)
|
|
DECL_TYPE_INFO(vl::workflow::WfBinaryOperator)
|
|
DECL_TYPE_INFO(vl::workflow::WfBinaryExpression)
|
|
DECL_TYPE_INFO(vl::workflow::WfLetVariable)
|
|
DECL_TYPE_INFO(vl::workflow::WfLetExpression)
|
|
DECL_TYPE_INFO(vl::workflow::WfIfExpression)
|
|
DECL_TYPE_INFO(vl::workflow::WfRangeBoundary)
|
|
DECL_TYPE_INFO(vl::workflow::WfRangeExpression)
|
|
DECL_TYPE_INFO(vl::workflow::WfSetTesting)
|
|
DECL_TYPE_INFO(vl::workflow::WfSetTestingExpression)
|
|
DECL_TYPE_INFO(vl::workflow::WfConstructorArgument)
|
|
DECL_TYPE_INFO(vl::workflow::WfConstructorExpression)
|
|
DECL_TYPE_INFO(vl::workflow::WfInferExpression)
|
|
DECL_TYPE_INFO(vl::workflow::WfTypeCastingStrategy)
|
|
DECL_TYPE_INFO(vl::workflow::WfTypeCastingExpression)
|
|
DECL_TYPE_INFO(vl::workflow::WfTypeTesting)
|
|
DECL_TYPE_INFO(vl::workflow::WfTypeTestingExpression)
|
|
DECL_TYPE_INFO(vl::workflow::WfTypeOfTypeExpression)
|
|
DECL_TYPE_INFO(vl::workflow::WfTypeOfExpressionExpression)
|
|
DECL_TYPE_INFO(vl::workflow::WfAttachEventExpression)
|
|
DECL_TYPE_INFO(vl::workflow::WfDetachEventExpression)
|
|
DECL_TYPE_INFO(vl::workflow::WfBindExpression)
|
|
DECL_TYPE_INFO(vl::workflow::WfObserveType)
|
|
DECL_TYPE_INFO(vl::workflow::WfObserveExpression)
|
|
DECL_TYPE_INFO(vl::workflow::WfCallExpression)
|
|
DECL_TYPE_INFO(vl::workflow::WfStatement)
|
|
DECL_TYPE_INFO(vl::workflow::WfBreakStatement)
|
|
DECL_TYPE_INFO(vl::workflow::WfContinueStatement)
|
|
DECL_TYPE_INFO(vl::workflow::WfReturnStatement)
|
|
DECL_TYPE_INFO(vl::workflow::WfDeleteStatement)
|
|
DECL_TYPE_INFO(vl::workflow::WfRaiseExceptionStatement)
|
|
DECL_TYPE_INFO(vl::workflow::WfIfStatement)
|
|
DECL_TYPE_INFO(vl::workflow::WfSwitchCase)
|
|
DECL_TYPE_INFO(vl::workflow::WfSwitchStatement)
|
|
DECL_TYPE_INFO(vl::workflow::WfWhileStatement)
|
|
DECL_TYPE_INFO(vl::workflow::WfForEachDirection)
|
|
DECL_TYPE_INFO(vl::workflow::WfForEachStatement)
|
|
DECL_TYPE_INFO(vl::workflow::WfTryStatement)
|
|
DECL_TYPE_INFO(vl::workflow::WfBlockStatement)
|
|
DECL_TYPE_INFO(vl::workflow::WfExpressionStatement)
|
|
DECL_TYPE_INFO(vl::workflow::WfDeclaration)
|
|
DECL_TYPE_INFO(vl::workflow::WfNamespaceDeclaration)
|
|
DECL_TYPE_INFO(vl::workflow::WfFunctionArgument)
|
|
DECL_TYPE_INFO(vl::workflow::WfFunctionAnonymity)
|
|
DECL_TYPE_INFO(vl::workflow::WfFunctionDeclaration)
|
|
DECL_TYPE_INFO(vl::workflow::WfFunctionExpression)
|
|
DECL_TYPE_INFO(vl::workflow::WfVariableDeclaration)
|
|
DECL_TYPE_INFO(vl::workflow::WfVariableStatement)
|
|
DECL_TYPE_INFO(vl::workflow::WfEventDeclaration)
|
|
DECL_TYPE_INFO(vl::workflow::WfPropertyDeclaration)
|
|
DECL_TYPE_INFO(vl::workflow::WfClassMemberKind)
|
|
DECL_TYPE_INFO(vl::workflow::WfClassMember)
|
|
DECL_TYPE_INFO(vl::workflow::WfNewClassExpression)
|
|
DECL_TYPE_INFO(vl::workflow::WfNewInterfaceExpression)
|
|
DECL_TYPE_INFO(vl::workflow::WfClassKind)
|
|
DECL_TYPE_INFO(vl::workflow::WfConstructorType)
|
|
DECL_TYPE_INFO(vl::workflow::WfBaseConstructorCall)
|
|
DECL_TYPE_INFO(vl::workflow::WfConstructorDeclaration)
|
|
DECL_TYPE_INFO(vl::workflow::WfDestructorDeclaration)
|
|
DECL_TYPE_INFO(vl::workflow::WfClassDeclaration)
|
|
DECL_TYPE_INFO(vl::workflow::WfModuleUsingFragment)
|
|
DECL_TYPE_INFO(vl::workflow::WfModuleUsingNameFragment)
|
|
DECL_TYPE_INFO(vl::workflow::WfModuleUsingWildCardFragment)
|
|
DECL_TYPE_INFO(vl::workflow::WfModuleUsingItem)
|
|
DECL_TYPE_INFO(vl::workflow::WfModuleUsingPath)
|
|
DECL_TYPE_INFO(vl::workflow::WfModuleType)
|
|
DECL_TYPE_INFO(vl::workflow::WfModule)
|
|
DECL_TYPE_INFO(vl::workflow::WfType::IVisitor)
|
|
DECL_TYPE_INFO(vl::workflow::WfExpression::IVisitor)
|
|
DECL_TYPE_INFO(vl::workflow::WfStatement::IVisitor)
|
|
DECL_TYPE_INFO(vl::workflow::WfDeclaration::IVisitor)
|
|
DECL_TYPE_INFO(vl::workflow::WfModuleUsingFragment::IVisitor)
|
|
|
|
BEGIN_INTERFACE_PROXY_NOPARENT_SHAREDPTR(vl::workflow::WfType::IVisitor)
|
|
void Visit(vl::workflow::WfPredefinedType* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfTopQualifiedType* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfReferenceType* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfRawPointerType* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfSharedPointerType* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfNullableType* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfEnumerableType* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfMapType* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfFunctionType* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfChildType* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
END_INTERFACE_PROXY(vl::workflow::WfType::IVisitor)
|
|
|
|
BEGIN_INTERFACE_PROXY_NOPARENT_SHAREDPTR(vl::workflow::WfExpression::IVisitor)
|
|
void Visit(vl::workflow::WfThisExpression* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfTopQualifiedExpression* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfReferenceExpression* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfOrderedNameExpression* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfOrderedLambdaExpression* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfMemberExpression* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfChildExpression* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfLiteralExpression* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfFloatingExpression* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfIntegerExpression* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfStringExpression* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfFormatExpression* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfUnaryExpression* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfBinaryExpression* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfLetExpression* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfIfExpression* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfRangeExpression* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfSetTestingExpression* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfConstructorExpression* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfInferExpression* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfTypeCastingExpression* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfTypeTestingExpression* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfTypeOfTypeExpression* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfTypeOfExpressionExpression* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfAttachEventExpression* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfDetachEventExpression* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfBindExpression* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfObserveExpression* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfCallExpression* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfFunctionExpression* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfNewClassExpression* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfNewInterfaceExpression* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
END_INTERFACE_PROXY(vl::workflow::WfExpression::IVisitor)
|
|
|
|
BEGIN_INTERFACE_PROXY_NOPARENT_SHAREDPTR(vl::workflow::WfStatement::IVisitor)
|
|
void Visit(vl::workflow::WfBreakStatement* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfContinueStatement* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfReturnStatement* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfDeleteStatement* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfRaiseExceptionStatement* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfIfStatement* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfSwitchStatement* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfWhileStatement* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfForEachStatement* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfTryStatement* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfBlockStatement* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfExpressionStatement* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfVariableStatement* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
END_INTERFACE_PROXY(vl::workflow::WfStatement::IVisitor)
|
|
|
|
BEGIN_INTERFACE_PROXY_NOPARENT_SHAREDPTR(vl::workflow::WfDeclaration::IVisitor)
|
|
void Visit(vl::workflow::WfNamespaceDeclaration* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfFunctionDeclaration* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfVariableDeclaration* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfEventDeclaration* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfPropertyDeclaration* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfConstructorDeclaration* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfDestructorDeclaration* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfClassDeclaration* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
END_INTERFACE_PROXY(vl::workflow::WfDeclaration::IVisitor)
|
|
|
|
BEGIN_INTERFACE_PROXY_NOPARENT_SHAREDPTR(vl::workflow::WfModuleUsingFragment::IVisitor)
|
|
void Visit(vl::workflow::WfModuleUsingNameFragment* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
void Visit(vl::workflow::WfModuleUsingWildCardFragment* node)override
|
|
{
|
|
INVOKE_INTERFACE_PROXY(Visit, node);
|
|
}
|
|
|
|
END_INTERFACE_PROXY(vl::workflow::WfModuleUsingFragment::IVisitor)
|
|
|
|
#endif
|
|
extern bool WfLoadTypes();
|
|
}
|
|
}
|
|
}
|
|
#endif
|
|
|
|
/***********************************************************************
|
|
EXPRESSION\WFEXPRESSION.H
|
|
***********************************************************************/
|
|
/***********************************************************************
|
|
Vczh Library++ 3.0
|
|
Developer: Zihan Chen(vczh)
|
|
Parser::WfExpression
|
|
|
|
Interfaces:
|
|
***********************************************************************/
|
|
|
|
#ifndef VCZH_WORKFLOW_EXPRESSION_WFEXPRESSION
|
|
#define VCZH_WORKFLOW_EXPRESSION_WFEXPRESSION
|
|
|
|
|
|
namespace vl
|
|
{
|
|
namespace workflow
|
|
{
|
|
/// <summary>Print a Workflow type.</summary>
|
|
/// <param name="node">The Workflow type.</param>
|
|
/// <param name="indent">The indentation.</param>
|
|
/// <param name="writer">The target writer.</param>
|
|
extern void WfPrint(Ptr<WfType> node, const WString& indent, parsing::ParsingWriter& writer);
|
|
/// <summary>Print a Workflow expression.</summary>
|
|
/// <param name="node">The Workflow expression.</param>
|
|
/// <param name="indent">The indentation.</param>
|
|
/// <param name="writer">The target writer.</param>
|
|
extern void WfPrint(Ptr<WfExpression> node, const WString& indent, parsing::ParsingWriter& writer);
|
|
/// <summary>Print a Workflow statement.</summary>
|
|
/// <param name="node">The Workflow statement.</param>
|
|
/// <param name="indent">The indentation.</param>
|
|
/// <param name="writer">The target writer.</param>
|
|
extern void WfPrint(Ptr<WfStatement> node, const WString& indent, parsing::ParsingWriter& writer);
|
|
/// <summary>Print a Workflow declaration.</summary>
|
|
/// <param name="node">The Workflow declaration.</param>
|
|
/// <param name="indent">The indentation.</param>
|
|
/// <param name="writer">The target writer.</param>
|
|
extern void WfPrint(Ptr<WfDeclaration> node, const WString& indent, parsing::ParsingWriter& writer);
|
|
/// <summary>Print a Workflow module.</summary>
|
|
/// <param name="node">The Workflow module.</param>
|
|
/// <param name="indent">The indentation.</param>
|
|
/// <param name="writer">The target writer.</param>
|
|
extern void WfPrint(Ptr<WfModule> node, const WString& indent, parsing::ParsingWriter& writer);
|
|
|
|
/// <summary>Print a Workflow type.</summary>
|
|
/// <param name="node">The Workflow type.</param>
|
|
/// <param name="indent">The indentation.</param>
|
|
/// <param name="writer">The target writer.</param>
|
|
extern void WfPrint(Ptr<WfType> node, const WString& indent, stream::TextWriter& writer);
|
|
/// <summary>Print a Workflow expression.</summary>
|
|
/// <param name="node">The Workflow expression.</param>
|
|
/// <param name="indent">The indentation.</param>
|
|
/// <param name="writer">The target writer.</param>
|
|
extern void WfPrint(Ptr<WfExpression> node, const WString& indent, stream::TextWriter& writer);
|
|
/// <summary>Print a Workflow statement.</summary>
|
|
/// <param name="node">The Workflow statement.</param>
|
|
/// <param name="indent">The indentation.</param>
|
|
/// <param name="writer">The target writer.</param>
|
|
extern void WfPrint(Ptr<WfStatement> node, const WString& indent, stream::TextWriter& writer);
|
|
/// <summary>Print a Workflow declaration.</summary>
|
|
/// <param name="node">The Workflow declaration.</param>
|
|
/// <param name="indent">The indentation.</param>
|
|
/// <param name="writer">The target writer.</param>
|
|
extern void WfPrint(Ptr<WfDeclaration> node, const WString& indent, stream::TextWriter& writer);
|
|
/// <summary>Print a Workflow module.</summary>
|
|
/// <param name="node">The Workflow module.</param>
|
|
/// <param name="indent">The indentation.</param>
|
|
/// <param name="writer">The target writer.</param>
|
|
extern void WfPrint(Ptr<WfModule> node, const WString& indent, stream::TextWriter& writer);
|
|
}
|
|
}
|
|
#endif
|
|
|
|
/***********************************************************************
|
|
ANALYZER\WFANALYZER.H
|
|
***********************************************************************/
|
|
/***********************************************************************
|
|
Vczh Library++ 3.0
|
|
Developer: Zihan Chen(vczh)
|
|
Workflow::Analyzer
|
|
|
|
Interfaces:
|
|
**********************************************************************/
|
|
|
|
#ifndef VCZH_WORKFLOW_ANALYZER_WFANALYZER
|
|
#define VCZH_WORKFLOW_ANALYZER_WFANALYZER
|
|
|
|
|
|
namespace vl
|
|
{
|
|
namespace workflow
|
|
{
|
|
namespace analyzer
|
|
{
|
|
|
|
class WfLexicalSymbol;
|
|
class WfLexicalScope;
|
|
class WfLexicalScopeManager;
|
|
|
|
/***********************************************************************
|
|
Scope
|
|
***********************************************************************/
|
|
|
|
class WfLexicalSymbol : public Object
|
|
{
|
|
public:
|
|
WString name; // name of this symbol
|
|
Ptr<WfType> type; // type of this symbol
|
|
Ptr<reflection::description::ITypeInfo> typeInfo; // reflection type info of this symbol, nullable
|
|
Ptr<WfClassMember> creatorClassMember; // nullable
|
|
Ptr<parsing::ParsingTreeCustomBase> creatorNode; // nullable
|
|
WfLexicalScope* ownerScope; // scope that contains this symbol
|
|
|
|
WfLexicalSymbol(WfLexicalScope* _ownerScope);
|
|
~WfLexicalSymbol();
|
|
|
|
WString GetFriendlyName();
|
|
};
|
|
|
|
class WfLexicalFunctionConfig : public Object
|
|
{
|
|
public:
|
|
bool lambda = false;
|
|
bool thisAccessable = false;
|
|
bool parentThisAccessable = false;
|
|
};
|
|
|
|
class WfLexicalScope : public Object
|
|
{
|
|
typedef collections::Group<WString, Ptr<WfLexicalSymbol>> TypeGroup;
|
|
public:
|
|
WfLexicalScopeManager* ownerManager; // nullable
|
|
Ptr<WfClassMember> ownerClassMember; // nullable
|
|
Ptr<parsing::ParsingTreeCustomBase> ownerNode; // nullable
|
|
|
|
Ptr<WfLexicalFunctionConfig> functionConfig;
|
|
reflection::description::ITypeDescriptor* typeOfThisExpr = nullptr; // visible members to this scope
|
|
|
|
Ptr<WfLexicalScope> parentScope; // null means that this is the root scope
|
|
TypeGroup symbols; // all symbols in this scope
|
|
|
|
WfLexicalScope(WfLexicalScopeManager* _ownerManager);
|
|
WfLexicalScope(Ptr<WfLexicalScope> _parentScope);
|
|
~WfLexicalScope();
|
|
|
|
WfLexicalScopeManager* FindManager();
|
|
Ptr<WfModule> FindModule();
|
|
Ptr<WfDeclaration> FindDeclaration();
|
|
WString GetFriendlyName();
|
|
};
|
|
|
|
/***********************************************************************
|
|
Scope Manager
|
|
***********************************************************************/
|
|
|
|
class WfLexicalScopeName : public Object
|
|
{
|
|
typedef collections::Dictionary<WString, Ptr<WfLexicalScopeName>> NameMap;
|
|
typedef collections::List<Ptr<WfDeclaration>> DeclarationList;
|
|
public:
|
|
WfLexicalScopeName* parent = nullptr;
|
|
bool imported = true;
|
|
NameMap children;
|
|
WString name;
|
|
reflection::description::ITypeDescriptor* typeDescriptor = nullptr; // type that form this name
|
|
DeclarationList declarations; // declarations that form this name
|
|
|
|
WfLexicalScopeName(bool _imported);
|
|
~WfLexicalScopeName();
|
|
|
|
Ptr<WfLexicalScopeName> AccessChild(const WString& name, bool imported);
|
|
void RemoveNonTypeDescriptorNames(WfLexicalScopeManager* manager);
|
|
WString GetFriendlyName();
|
|
};
|
|
|
|
struct ResolveExpressionResult
|
|
{
|
|
Ptr<WfLexicalScopeName> scopeName;
|
|
Ptr<WfLexicalSymbol> symbol;
|
|
reflection::description::IPropertyInfo* propertyInfo = nullptr;
|
|
reflection::description::IMethodInfo* methodInfo = nullptr;
|
|
reflection::description::IMethodInfo* constructorInfo = nullptr;
|
|
reflection::description::IEventInfo* eventInfo = nullptr;
|
|
Ptr<reflection::description::ITypeInfo> type;
|
|
Ptr<reflection::description::ITypeInfo> writableType;
|
|
Ptr<reflection::description::ITypeInfo> expectedType;
|
|
|
|
WString GetFriendlyName(bool upperCase = false)const;
|
|
|
|
static ResolveExpressionResult ScopeName(Ptr<WfLexicalScopeName> _scopeName);
|
|
static ResolveExpressionResult ReadonlySymbol(Ptr<WfLexicalSymbol> _symbol);
|
|
static ResolveExpressionResult Symbol(Ptr<WfLexicalSymbol> _symbol);
|
|
static ResolveExpressionResult ReadonlyType(Ptr<reflection::description::ITypeInfo> _type);
|
|
static ResolveExpressionResult WritableType(Ptr<reflection::description::ITypeInfo> _type);
|
|
static ResolveExpressionResult Property(reflection::description::IPropertyInfo* _propertyInfo);
|
|
static ResolveExpressionResult Method(reflection::description::IMethodInfo* _methodInfo);
|
|
static ResolveExpressionResult Constructor(reflection::description::IMethodInfo* _constructorInfo);
|
|
static ResolveExpressionResult Event(reflection::description::IEventInfo* _eventInfo);
|
|
};
|
|
|
|
struct WfLexicalCapture
|
|
{
|
|
collections::List<Ptr<WfLexicalSymbol>> symbols;
|
|
};
|
|
|
|
/// <summary>Workflow compiler.</summary>
|
|
class WfLexicalScopeManager : public Object
|
|
{
|
|
typedef reflection::description::ITypeDescriptor ITypeDescriptor;
|
|
typedef reflection::description::IMemberInfo IMemberInfo;
|
|
typedef reflection::description::IMethodInfo IMethodInfo;
|
|
|
|
typedef collections::List<Ptr<WfModule>> ModuleList;
|
|
typedef collections::List<WString> ModuleCodeList;
|
|
typedef collections::List<Ptr<parsing::ParsingError>> ParsingErrorList;
|
|
typedef collections::Dictionary<Ptr<WfNamespaceDeclaration>, Ptr<WfLexicalScopeName>> NamespaceNameMap;
|
|
typedef collections::Dictionary<ITypeDescriptor*, Ptr<WfLexicalScopeName>> TypeNameMap;
|
|
typedef collections::Dictionary<parsing::ParsingTreeCustomBase*, Ptr<WfLexicalScope>> NodeScopeMap;
|
|
typedef collections::Dictionary<Ptr<WfExpression>, ResolveExpressionResult> ExpressionResolvingMap;
|
|
typedef collections::Dictionary<parsing::ParsingTreeCustomBase*, Ptr<WfLexicalCapture>> LambdaCaptureMap;
|
|
typedef collections::Dictionary<WfFunctionDeclaration*, IMethodInfo*> InterfaceMethodImplementationMap;
|
|
typedef collections::Dictionary<Ptr<WfDeclaration>, Ptr<typeimpl::WfCustomType>> DeclarationTypeMap;
|
|
typedef collections::Dictionary<Ptr<WfDeclaration>, Ptr<IMemberInfo>> DeclarationMemberInfoMap;
|
|
|
|
typedef collections::Pair<WfConstructorDeclaration*, ITypeDescriptor*> BaseConstructorCallKey;
|
|
typedef collections::Pair<WfBaseConstructorCall*, IMethodInfo*> BaseConstructorCallValue;
|
|
typedef collections::Dictionary<BaseConstructorCallKey, BaseConstructorCallValue> BaseConstructorCallResolvingMap;
|
|
|
|
protected:
|
|
ModuleList modules;
|
|
ModuleCodeList moduleCodes;
|
|
vint usedCodeIndex = 0;
|
|
|
|
public:
|
|
Ptr<parsing::tabling::ParsingTable> parsingTable;
|
|
ParsingErrorList errors;
|
|
|
|
Ptr<WfLexicalScopeName> globalName;
|
|
NamespaceNameMap namespaceNames;
|
|
TypeNameMap typeNames;
|
|
|
|
NodeScopeMap nodeScopes; // the nearest scope for a AST
|
|
ExpressionResolvingMap expressionResolvings; // the resolving result for the expression
|
|
LambdaCaptureMap lambdaCaptures; // all captured symbols in a lambda AST
|
|
InterfaceMethodImplementationMap interfaceMethodImpls; // the IMethodInfo* that implemented by a function
|
|
DeclarationTypeMap declarationTypes; // ITypeDescriptor* for type declaration
|
|
DeclarationMemberInfoMap declarationMemberInfos; // IMemberInfo* for type description
|
|
BaseConstructorCallResolvingMap baseConstructorCallResolvings; // all base constructor call resolvings
|
|
|
|
/// <summary>Create a Workflow compiler.</summary>
|
|
/// <param name="_parsingTable">The workflow parser table. It can be retrived from [M:vl.workflow.WfLoadTable].</param>
|
|
WfLexicalScopeManager(Ptr<parsing::tabling::ParsingTable> _parsingTable);
|
|
~WfLexicalScopeManager();
|
|
|
|
/// <summary>Add a Workflow module. Syntax errors can be found at <see cref="errors"/>.</summary>
|
|
/// <param name="moduleCode">The source code of a workflow module.</param>
|
|
/// <returns>Returns the code index, which is a number representing a module in data structured used in Workflow compiler, runtime and debugger.</returns>
|
|
vint AddModule(const WString& moduleCode);
|
|
/// <summary>Add a Workflow module.</summary>
|
|
/// <param name="module">The syntax tree of a workflow module.</param>
|
|
/// <returns>Returns the code index, which is a number representing a module in data structured used in Workflow compiler, runtime and debugger.</returns>
|
|
vint AddModule(Ptr<WfModule> module);
|
|
/// <summary>Get all added modules.</summary>
|
|
/// <returns>All added modules.</returns>
|
|
ModuleList& GetModules();
|
|
/// <summary>Get all module codes. If a module is added from a syntax tree, then the source code is empty.</summary>
|
|
/// <returns>All module codes.</returns>
|
|
ModuleCodeList& GetModuleCodes();
|
|
|
|
/// <summary>Clean compiling results.</summary>
|
|
/// <param name="keepTypeDescriptorNames">Set to false to delete all cache of reflectable C++ types.</param>
|
|
/// <param name="deleteModules">Set to true to delete all added modules.</param>
|
|
void Clear(bool keepTypeDescriptorNames, bool deleteModules);
|
|
/// <summary>Compile.</summary>
|
|
/// <param name="keepTypeDescriptorNames">Set to false to delete all cache of reflectable C++ types before compiling.</param>
|
|
void Rebuild(bool keepTypeDescriptorNames);
|
|
|
|
bool ResolveMember(ITypeDescriptor* typeDescriptor, const WString& name, bool preferStatic, collections::SortedList<ITypeDescriptor*>& searchedTypes, collections::List<ResolveExpressionResult>& results);
|
|
bool ResolveName(WfLexicalScope* scope, const WString& name, collections::List<ResolveExpressionResult>& results);
|
|
Ptr<WfLexicalSymbol> GetDeclarationSymbol(WfLexicalScope* scope, WfDeclaration* node);
|
|
void CreateLambdaCapture(parsing::ParsingTreeCustomBase* node, Ptr<WfLexicalCapture> capture = nullptr);
|
|
};
|
|
|
|
/***********************************************************************
|
|
Type Analyzing
|
|
***********************************************************************/
|
|
|
|
enum class TypeFlag
|
|
{
|
|
Bool,
|
|
I1,
|
|
I2,
|
|
I4,
|
|
I8,
|
|
U1,
|
|
U2,
|
|
U4,
|
|
U8,
|
|
F4,
|
|
F8,
|
|
String,
|
|
Enum,
|
|
Struct,
|
|
Others,
|
|
Count,
|
|
Unknown = -1,
|
|
#ifdef VCZH_64
|
|
I = I8,
|
|
U = U8,
|
|
#else
|
|
I = I4,
|
|
U = U4,
|
|
#endif
|
|
};
|
|
|
|
extern TypeFlag GetTypeFlag(reflection::description::ITypeDescriptor* typeDescriptor);
|
|
extern TypeFlag GetTypeFlag(reflection::description::ITypeInfo* typeInfo);
|
|
extern Ptr<reflection::description::ITypeInfo> CreateTypeInfoFromTypeFlag(TypeFlag flag);
|
|
|
|
extern Ptr<WfType> GetTypeFromTypeInfo(reflection::description::ITypeInfo* typeInfo);
|
|
extern Ptr<WfLexicalScopeName> GetScopeNameFromReferenceType(WfLexicalScope* scope, Ptr<WfType> type);
|
|
extern Ptr<reflection::description::ITypeInfo> CreateTypeInfoFromType(WfLexicalScope* scope, Ptr<WfType> type);
|
|
|
|
extern Ptr<WfType> CopyType(Ptr<WfType> type);
|
|
extern Ptr<reflection::description::ITypeInfo> CopyTypeInfo(reflection::description::ITypeInfo* typeInfo);
|
|
extern bool CanConvertToType(reflection::description::ITypeInfo* fromType, reflection::description::ITypeInfo* toType, bool explicitly);
|
|
extern bool IsSameType(reflection::description::ITypeInfo* fromType, reflection::description::ITypeInfo* toType);
|
|
extern Ptr<reflection::description::ITypeInfo> GetMergedType(Ptr<reflection::description::ITypeInfo> firstType, Ptr<reflection::description::ITypeInfo> secondType);
|
|
extern bool IsNullAcceptableType(reflection::description::ITypeInfo* type);
|
|
|
|
extern Ptr<reflection::description::ITypeInfo> CreateTypeInfoFromMethodInfo(reflection::description::IMethodInfo* info);
|
|
|
|
extern bool IsExpressionDependOnExpectedType(WfLexicalScopeManager* manager, Ptr<WfExpression> expression);
|
|
extern WString GetExpressionName(Ptr<WfExpression> expression);
|
|
extern void SearchOrderedName(WfLexicalScope* scope, Ptr<WfDeclaration> declaration, collections::SortedList<vint>& names);
|
|
extern void SearchOrderedName(WfLexicalScope* scope, Ptr<WfStatement> statement, collections::SortedList<vint>& names);
|
|
extern void SearchOrderedName(WfLexicalScope* scope, Ptr<WfExpression> expression, collections::SortedList<vint>& names);
|
|
|
|
/***********************************************************************
|
|
Structure Analyzing
|
|
***********************************************************************/
|
|
|
|
struct ValidateStructureContext
|
|
{
|
|
WfBindExpression* currentBindExpression = nullptr;
|
|
WfObserveExpression* currentObserveExpression = nullptr;
|
|
WfStatement* currentLoopStatement = nullptr;
|
|
WfStatement* currentCatchStatement = nullptr;
|
|
|
|
ValidateStructureContext();
|
|
};
|
|
|
|
enum class ValidateTypeStragety
|
|
{
|
|
Value,
|
|
ReturnType,
|
|
BaseType,
|
|
};
|
|
extern void ValidateTypeStructure(WfLexicalScopeManager* manager, Ptr<WfType> type, ValidateTypeStragety strategy = ValidateTypeStragety::Value, WfClassDeclaration* classDecl = nullptr);
|
|
extern void ValidateModuleStructure(WfLexicalScopeManager* manager, Ptr<WfModule> module);
|
|
extern void ValidateDeclarationStructure(WfLexicalScopeManager* manager, Ptr<WfDeclaration> declaration, WfClassDeclaration* classDecl = 0 , parsing::ParsingTreeCustomBase* source = 0);
|
|
extern void ValidateStatementStructure(WfLexicalScopeManager* manager, ValidateStructureContext* context, Ptr<WfStatement>& statement);
|
|
extern void ValidateExpressionStructure(WfLexicalScopeManager* manager, ValidateStructureContext* context, Ptr<WfExpression>& expression);
|
|
|
|
/***********************************************************************
|
|
Global Name
|
|
***********************************************************************/
|
|
|
|
extern void BuildGlobalNameFromTypeDescriptors(WfLexicalScopeManager* manager);
|
|
extern void BuildGlobalNameFromModules(WfLexicalScopeManager* manager);
|
|
extern void ValidateScopeName(WfLexicalScopeManager* manager, Ptr<WfLexicalScopeName> name);
|
|
|
|
/***********************************************************************
|
|
Scope Analyzing
|
|
***********************************************************************/
|
|
|
|
extern void CompleteScopeForClassMember(WfLexicalScopeManager* manager, Ptr<typeimpl::WfCustomType> td, Ptr<WfClassDeclaration> classDecl, Ptr<WfClassMember> member);
|
|
extern void CompleteScopeForDeclaration(WfLexicalScopeManager* manager, Ptr<WfDeclaration> declaration);
|
|
extern void CompleteScopeForModule(WfLexicalScopeManager* manager, Ptr<WfModule> module);
|
|
|
|
extern void BuildScopeForModule(WfLexicalScopeManager* manager, Ptr<WfModule> module);
|
|
extern void BuildScopeForDeclaration(WfLexicalScopeManager* manager, Ptr<WfLexicalScope> parentScope, Ptr<WfDeclaration> declaration, parsing::ParsingTreeCustomBase* source, Ptr<WfClassMember> member);
|
|
extern void BuildScopeForStatement(WfLexicalScopeManager* manager, Ptr<WfLexicalScope> parentScope, Ptr<WfStatement> statement);
|
|
extern void BuildScopeForExpression(WfLexicalScopeManager* manager, Ptr<WfLexicalScope> parentScope, Ptr<WfExpression> expression);
|
|
extern bool CheckScopes_DuplicatedSymbol(WfLexicalScopeManager* manager);
|
|
extern bool CheckScopes_SymbolType(WfLexicalScopeManager* manager);
|
|
extern bool CheckScopes_BaseType(WfLexicalScopeManager* manager);
|
|
|
|
/***********************************************************************
|
|
Semantic Analyzing
|
|
***********************************************************************/
|
|
|
|
class WfObservingDependency : public Object
|
|
{
|
|
typedef collections::Group<WfExpression*, WfExpression*> DependencyGroup;
|
|
typedef collections::List<WfExpression*> ObserveList;
|
|
public:
|
|
ObserveList inputObserves;
|
|
ObserveList outputObserves;
|
|
DependencyGroup& dependencies;
|
|
|
|
WfObservingDependency(WfObservingDependency& dependency);
|
|
WfObservingDependency(DependencyGroup& _dependencies);
|
|
WfObservingDependency(DependencyGroup& _dependencies, ObserveList& _inputObserves);
|
|
|
|
void Prepare(WfExpression* observe);
|
|
void AddInternal(WfExpression* observe, WfExpression* dependedObserve);
|
|
void Add(WfExpression* observe);
|
|
void Add(WfExpression* observe, WfObservingDependency& dependency);
|
|
void TurnToInput();
|
|
void Cleanup();
|
|
};
|
|
|
|
extern void ValidateModuleSemantic(WfLexicalScopeManager* manager, Ptr<WfModule> module);
|
|
extern void ValidateClassMemberSemantic(WfLexicalScopeManager* manager, Ptr<typeimpl::WfCustomType> td, Ptr<WfClassDeclaration> classDecl, Ptr<WfClassMember> member);
|
|
extern void ValidateDeclarationSemantic(WfLexicalScopeManager* manager, Ptr<WfDeclaration> declaration);
|
|
extern void ValidateStatementSemantic(WfLexicalScopeManager* manager, Ptr<WfStatement> statement);
|
|
extern void ValidateExpressionSemantic(WfLexicalScopeManager* manager, Ptr<WfExpression> expression, Ptr<reflection::description::ITypeInfo> expectedType, collections::List<ResolveExpressionResult>& results);
|
|
extern void GetObservingDependency(WfLexicalScopeManager* manager, Ptr<WfExpression> expression, WfObservingDependency& dependency);
|
|
extern Ptr<WfExpression> ExpandObserveExpression(WfExpression* expression, collections::Dictionary<WfExpression*, WString>& cacheNames, collections::Dictionary<WString, WString>& referenceReplacement, bool useCache = true);
|
|
extern Ptr<WfExpression> CopyExpression(Ptr<WfExpression> expression);
|
|
extern Ptr<WfStatement> CopyStatement(Ptr<WfStatement> statement);
|
|
extern Ptr<WfDeclaration> CopyDeclaration(Ptr<WfDeclaration> declaration);
|
|
extern void ExpandBindExpression(WfLexicalScopeManager* manager, WfBindExpression* node);
|
|
|
|
extern Ptr<WfLexicalScopeName> GetExpressionScopeName(WfLexicalScopeManager* manager, Ptr<WfExpression> expression);
|
|
extern reflection::description::IEventInfo* GetExpressionEventInfo(WfLexicalScopeManager* manager, Ptr<WfExpression> expression);
|
|
extern void GetExpressionTypes(WfLexicalScopeManager* manager, Ptr<WfExpression> expression, Ptr<reflection::description::ITypeInfo> expectedType, bool allowEvent, collections::List<ResolveExpressionResult>& results);
|
|
extern Ptr<reflection::description::ITypeInfo> GetExpressionType(WfLexicalScopeManager* manager, Ptr<WfExpression> expression, Ptr<reflection::description::ITypeInfo> expectedType);
|
|
extern Ptr<reflection::description::ITypeInfo> GetLeftValueExpressionType(WfLexicalScopeManager* manager, Ptr<WfExpression> expression);
|
|
extern Ptr<reflection::description::ITypeInfo> GetEnumerableExpressionItemType(WfLexicalScopeManager* manager, Ptr<WfExpression> expression, Ptr<reflection::description::ITypeInfo> expectedType);
|
|
|
|
/***********************************************************************
|
|
Code Generation
|
|
***********************************************************************/
|
|
|
|
struct WfCodegenLambdaContext
|
|
{
|
|
WfFunctionDeclaration* functionDeclaration = 0;
|
|
WfFunctionExpression* functionExpression = 0;
|
|
WfOrderedLambdaExpression* orderedLambdaExpression = 0;
|
|
};
|
|
|
|
enum class WfCodegenScopeType
|
|
{
|
|
Function, // contains the whole function
|
|
Switch, // contains all switchs
|
|
Loop, // contains all loops
|
|
TryCatch, // contains try and catch, not finally
|
|
};
|
|
|
|
class WfCodegenScopeContext : public Object
|
|
{
|
|
typedef collections::List<vint> InstructionIndexList;
|
|
typedef collections::List<runtime::WfInstruction> InstructionList;
|
|
typedef collections::List<parsing::ParsingTextRange> RangeMap;
|
|
public:
|
|
WfCodegenScopeType type = WfCodegenScopeType::Function;
|
|
InstructionIndexList continueInstructions;
|
|
InstructionIndexList breakInstructions;
|
|
|
|
InstructionList exitInstructions;
|
|
RangeMap instructionCodeMappingBeforeCodegen;
|
|
RangeMap instructionCodeMappingAfterCodegen;
|
|
Ptr<WfStatement> exitStatement;
|
|
};
|
|
|
|
class WfCodegenFunctionContext : public Object
|
|
{
|
|
typedef collections::Dictionary<WfLexicalSymbol*, vint> VariableIndexMap;
|
|
typedef collections::Dictionary<vint, WfCodegenLambdaContext> ClosureIndexMap;
|
|
typedef collections::List<Ptr<WfCodegenScopeContext>> ScopeContextList;
|
|
public:
|
|
Ptr<runtime::WfAssemblyFunction> function;
|
|
VariableIndexMap capturedVariables;
|
|
VariableIndexMap arguments;
|
|
VariableIndexMap localVariables;
|
|
ClosureIndexMap closuresToCodegen;
|
|
ScopeContextList scopeContextStack;
|
|
|
|
WfCodegenFunctionContext();
|
|
|
|
Ptr<WfCodegenScopeContext> GetCurrentScopeContext();
|
|
Ptr<WfCodegenScopeContext> GetCurrentScopeContext(WfCodegenScopeType type);
|
|
Ptr<WfCodegenScopeContext> PushScopeContext(WfCodegenScopeType type);
|
|
void PopScopeContext();
|
|
};
|
|
|
|
class WfCodegenContext : public Object
|
|
{
|
|
typedef collections::Dictionary<WfLexicalSymbol*, vint> SymbolIndexMap;
|
|
typedef collections::Dictionary<WfConstructorDeclaration*, vint> ConstructorIndexMap;
|
|
typedef collections::Dictionary<WfDestructorDeclaration*, vint> DestructorIndexMap;
|
|
typedef collections::Dictionary<parsing::ParsingTreeCustomBase*, parsing::ParsingTextRange> NodePositionMap;
|
|
typedef collections::Dictionary<Ptr<WfLexicalFunctionConfig>, vint> ThisStackCountMap;
|
|
public:
|
|
Ptr<runtime::WfAssembly> assembly;
|
|
WfLexicalScopeManager* manager;
|
|
SymbolIndexMap globalVariables;
|
|
SymbolIndexMap globalFunctions;
|
|
ConstructorIndexMap constructors;
|
|
DestructorIndexMap destructors;
|
|
SymbolIndexMap closureFunctions;
|
|
Ptr<WfCodegenFunctionContext> functionContext;
|
|
NodePositionMap nodePositionsBeforeCodegen;
|
|
NodePositionMap nodePositionsAfterCodegen;
|
|
ThisStackCountMap thisStackCounts;
|
|
|
|
WfCodegenContext(Ptr<runtime::WfAssembly> _assembly, WfLexicalScopeManager* _manager);
|
|
|
|
vint AddInstruction(parsing::ParsingTreeCustomBase* node, const runtime::WfInstruction& ins);
|
|
void AddExitInstruction(parsing::ParsingTreeCustomBase* node, const runtime::WfInstruction& ins);
|
|
void ApplyExitInstructions(Ptr<WfCodegenScopeContext> scopeContext);
|
|
vint GetThisStackCount(WfLexicalScope* scope);
|
|
};
|
|
|
|
extern void GenerateFunctionDeclarationMetadata(WfCodegenContext& context, WfFunctionDeclaration* node, Ptr<runtime::WfAssemblyFunction> meta);
|
|
extern void GenerateGlobalDeclarationMetadata(WfCodegenContext& context, Ptr<WfDeclaration> declaration, const WString& namePrefix = L"");
|
|
extern void GenerateClosureInstructions(WfCodegenContext& context, Ptr<WfCodegenFunctionContext> functionContext);
|
|
extern void GenerateInitializeInstructions(WfCodegenContext& context, Ptr<WfDeclaration> declaration);
|
|
extern void GenerateDeclarationInstructions(WfCodegenContext& context, Ptr<WfDeclaration> declaration);
|
|
extern void GenerateStatementInstructions(WfCodegenContext& context, Ptr<WfStatement> statement);
|
|
extern Ptr<reflection::description::ITypeInfo> GenerateExpressionInstructions(WfCodegenContext& context, Ptr<WfExpression> expression, Ptr<reflection::description::ITypeInfo> expectedType = 0);
|
|
extern void GenerateTypeCastInstructions(WfCodegenContext& context, Ptr<reflection::description::ITypeInfo> expectedType, bool strongCast, WfExpression* node);
|
|
extern void GenerateTypeTestingInstructions(WfCodegenContext& context, Ptr<reflection::description::ITypeInfo> expectedType, WfExpression* node);
|
|
extern runtime::WfInsType GetInstructionTypeArgument(Ptr<reflection::description::ITypeInfo> expectedType);
|
|
|
|
/// <summary>Generate an assembly from a compiler. [M:vl.workflow.analyzer.WfLexicalScopeManager.Rebuild] should be called before using this function.</summary>
|
|
/// <returns>The generated assembly.</returns>
|
|
/// <param name="manager">The Workflow compiler.</param>
|
|
extern Ptr<runtime::WfAssembly> GenerateAssembly(WfLexicalScopeManager* manager);
|
|
|
|
/// <summary>Compile a Workflow program.</summary>
|
|
/// <returns>The generated assembly.</returns>
|
|
/// <param name="table">The workflow parser table. It can be retrived from [M:vl.workflow.WfLoadTable].</param>
|
|
/// <param name="manager">The workflow compiler to reuse the cache of C++ reflectable types.</param>
|
|
/// <param name="moduleCodes">All workflow module codes.</param>
|
|
/// <param name="errors">Container to get all compileing errors.</param>
|
|
extern Ptr<runtime::WfAssembly> Compile(Ptr<parsing::tabling::ParsingTable> table, WfLexicalScopeManager* manager, collections::List<WString>& moduleCodes, collections::List<Ptr<parsing::ParsingError>>& errors);
|
|
|
|
/// <summary>Compile a Workflow program.</summary>
|
|
/// <returns>The generated assembly.</returns>
|
|
/// <param name="table">The workflow parser table. It can be retrived from [M:vl.workflow.WfLoadTable].</param>
|
|
/// <param name="moduleCodes">All workflow module codes.</param>
|
|
/// <param name="errors">Container to get all compileing errors.</param>
|
|
extern Ptr<runtime::WfAssembly> Compile(Ptr<parsing::tabling::ParsingTable> table, collections::List<WString>& moduleCodes, collections::List<Ptr<parsing::ParsingError>>& errors);
|
|
|
|
/***********************************************************************
|
|
Error Messages
|
|
***********************************************************************/
|
|
|
|
struct WfErrors
|
|
{
|
|
// A: Expression error
|
|
static Ptr<parsing::ParsingError> WrongFormatStringSyntax(WfExpression* node);
|
|
static Ptr<parsing::ParsingError> WrongSimpleObserveExpression(WfExpression* node);
|
|
static Ptr<parsing::ParsingError> WrongSimpleObserveEvent(WfExpression* node);
|
|
static Ptr<parsing::ParsingError> EmptyObserveEvent(WfExpression* node);
|
|
static Ptr<parsing::ParsingError> ObserveNotInBind(WfExpression* node);
|
|
static Ptr<parsing::ParsingError> ObserveInObserveEvent(WfExpression* node);
|
|
static Ptr<parsing::ParsingError> BindInBind(WfExpression* node);
|
|
static Ptr<parsing::ParsingError> AttachInBind(WfExpression* node);
|
|
static Ptr<parsing::ParsingError> DetachInBind(WfExpression* node);
|
|
static Ptr<parsing::ParsingError> ConstructorMixMapAndList(WfExpression* node);
|
|
static Ptr<parsing::ParsingError> ConstructorMixStructAndList(WfExpression* node);
|
|
static Ptr<parsing::ParsingError> DuplicatedConstructorField(WfReferenceExpression* node);
|
|
static Ptr<parsing::ParsingError> ConstructorMixClassAndInterface(WfNewClassExpression* node);
|
|
static Ptr<parsing::ParsingError> ConstructorMixClassAndInterface(WfNewInterfaceExpression* node);
|
|
static Ptr<parsing::ParsingError> ScopeNameIsNotExpression(WfExpression* node, Ptr<WfLexicalScopeName> scopeName);
|
|
static Ptr<parsing::ParsingError> EventIsNotExpression(WfExpression* node, reflection::description::IEventInfo* eventInfo);
|
|
static Ptr<parsing::ParsingError> ExpressionIsNotScopeName(WfExpression* node);
|
|
static Ptr<parsing::ParsingError> ExpressionIsNotEvent(WfExpression* node);
|
|
static Ptr<parsing::ParsingError> ExpressionCannotResolveType(WfExpression* node, Ptr<WfLexicalSymbol> symbol);
|
|
static Ptr<parsing::ParsingError> NullCannotResolveType(WfExpression* node);
|
|
static Ptr<parsing::ParsingError> ConstructorCannotResolveType(WfExpression* node);
|
|
static Ptr<parsing::ParsingError> OrderedLambdaCannotResolveType(WfExpression* node);
|
|
static Ptr<parsing::ParsingError> NullCannotImplicitlyConvertToType(WfExpression* node, reflection::description::ITypeInfo* toType);
|
|
static Ptr<parsing::ParsingError> ConstructorCannotImplicitlyConvertToType(WfExpression* node, reflection::description::ITypeInfo* toType);
|
|
static Ptr<parsing::ParsingError> OrderedLambdaCannotImplicitlyConvertToType(WfExpression* node, reflection::description::ITypeInfo* toType);
|
|
static Ptr<parsing::ParsingError> ExpressionCannotImplicitlyConvertToType(WfExpression* node, reflection::description::ITypeInfo* fromType, reflection::description::ITypeInfo* toType);
|
|
static Ptr<parsing::ParsingError> ExpressionCannotExplicitlyConvertToType(WfExpression* node, reflection::description::ITypeInfo* fromType, reflection::description::ITypeInfo* toType);
|
|
static Ptr<parsing::ParsingError> CannotWeakCastToType(WfExpression* node, reflection::description::ITypeInfo* toType);
|
|
static Ptr<parsing::ParsingError> IntegerLiteralOutOfRange(WfIntegerExpression* node);
|
|
static Ptr<parsing::ParsingError> CannotMergeTwoType(WfExpression* node, reflection::description::ITypeInfo* firstType, reflection::description::ITypeInfo* secondType);
|
|
static Ptr<parsing::ParsingError> RangeShouldBeInteger(WfExpression* node, reflection::description::ITypeInfo* type);
|
|
static Ptr<parsing::ParsingError> UnaryOperatorOnWrongType(WfUnaryExpression* node, reflection::description::ITypeInfo* type);
|
|
static Ptr<parsing::ParsingError> BinaryOperatorOnWrongType(WfBinaryExpression* node, reflection::description::ITypeInfo* type);
|
|
static Ptr<parsing::ParsingError> IndexOperatorOnWrongType(WfBinaryExpression* node, reflection::description::ITypeInfo* containerType);
|
|
static Ptr<parsing::ParsingError> ExpressionIsNotCollection(WfExpression* node, reflection::description::ITypeInfo* type);
|
|
static Ptr<parsing::ParsingError> ExpressionIsNotFunction(WfExpression* node, reflection::description::ITypeInfo* type);
|
|
static Ptr<parsing::ParsingError> FunctionArgumentCountMismatched(parsing::ParsingTreeCustomBase* node, vint expectedCount, const ResolveExpressionResult& function);
|
|
static Ptr<parsing::ParsingError> FunctionArgumentTypeMismatched(parsing::ParsingTreeCustomBase* node, const ResolveExpressionResult& function, vint index, reflection::description::ITypeInfo* fromType, reflection::description::ITypeInfo* toType);
|
|
static Ptr<parsing::ParsingError> CannotPickOverloadedFunctions(parsing::ParsingTreeCustomBase* node, collections::List<ResolveExpressionResult>& results);
|
|
static Ptr<parsing::ParsingError> ClassContainsNoConstructor(WfExpression* node, reflection::description::ITypeInfo* type);
|
|
static Ptr<parsing::ParsingError> InterfaceContainsNoConstructor(WfExpression* node, reflection::description::ITypeInfo* type);
|
|
static Ptr<parsing::ParsingError> ConstructorReturnTypeMismatched(WfExpression* node, const ResolveExpressionResult& function, reflection::description::ITypeInfo* fromType, reflection::description::ITypeInfo* toType);
|
|
static Ptr<parsing::ParsingError> ExpressionIsNotLeftValue(WfExpression* node, const ResolveExpressionResult& result);
|
|
static Ptr<parsing::ParsingError> CannotCallMemberOutsideOfClass(WfExpression* node, const ResolveExpressionResult& result);
|
|
static Ptr<parsing::ParsingError> CannotCallMemberInStaticFunction(WfExpression* node, const ResolveExpressionResult& result);
|
|
static Ptr<parsing::ParsingError> FieldCannotInitializeUsingEachOther(WfExpression* node, const ResolveExpressionResult& result);
|
|
static Ptr<parsing::ParsingError> WrongThisExpression(WfExpression* node);
|
|
static Ptr<parsing::ParsingError> IncorrectTypeForUnion(WfExpression* node, reflection::description::ITypeInfo* type);
|
|
static Ptr<parsing::ParsingError> IncorrectTypeForIntersect(WfExpression* node, reflection::description::ITypeInfo* type);
|
|
|
|
// B: Type error
|
|
static Ptr<parsing::ParsingError> WrongVoidType(WfType* node);
|
|
static Ptr<parsing::ParsingError> WrongInterfaceType(WfType* node);
|
|
static Ptr<parsing::ParsingError> RawPointerToNonReferenceType(WfType* node, reflection::description::ITypeInfo* typeInfo = 0);
|
|
static Ptr<parsing::ParsingError> SharedPointerToNonReferenceType(WfType* node, reflection::description::ITypeInfo* typeInfo = 0);
|
|
static Ptr<parsing::ParsingError> NullableToNonReferenceType(WfType* node, reflection::description::ITypeInfo* typeInfo = 0);
|
|
static Ptr<parsing::ParsingError> ChildOfNonReferenceType(WfType* node);
|
|
static Ptr<parsing::ParsingError> TypeNotExists(WfType* node, Ptr<WfLexicalScopeName> scopeName);
|
|
static Ptr<parsing::ParsingError> TypeNotExists(WfType* node, Ptr<WfLexicalSymbol> symbol);
|
|
static Ptr<parsing::ParsingError> TypeNotForValue(WfType* node, reflection::description::ITypeInfo* typeInfo);
|
|
|
|
// C: Statement error
|
|
static Ptr<parsing::ParsingError> BreakNotInLoop(WfStatement* node);
|
|
static Ptr<parsing::ParsingError> ContinueNotInLoop(WfStatement* node);
|
|
static Ptr<parsing::ParsingError> RethrowNotInCatch(WfStatement* node);
|
|
static Ptr<parsing::ParsingError> TryMissCatchAndFinally(WfStatement* node);
|
|
static Ptr<parsing::ParsingError> ReturnMissExpression(WfStatement* node, reflection::description::ITypeInfo* type);
|
|
static Ptr<parsing::ParsingError> DeleteNonRawPointer(WfStatement* node, reflection::description::ITypeInfo* type);
|
|
static Ptr<parsing::ParsingError> CannotReturnExpression(WfStatement* node);
|
|
|
|
// D: Declaration error
|
|
static Ptr<parsing::ParsingError> FunctionShouldHaveName(WfDeclaration* node);
|
|
static Ptr<parsing::ParsingError> FunctionShouldHaveImplementation(WfDeclaration* node);
|
|
static Ptr<parsing::ParsingError> InterfaceMethodShouldNotHaveImplementation(WfDeclaration* node);
|
|
static Ptr<parsing::ParsingError> DuplicatedDeclaration(WfDeclaration* node, const WString& firstDeclarationCategory);
|
|
static Ptr<parsing::ParsingError> DuplicatedSymbol(WfDeclaration* node, Ptr<WfLexicalSymbol> symbol);
|
|
static Ptr<parsing::ParsingError> DuplicatedSymbol(WfFunctionArgument* node, Ptr<WfLexicalSymbol> symbol);
|
|
static Ptr<parsing::ParsingError> DuplicatedSymbol(WfStatement* node, Ptr<WfLexicalSymbol> symbol);
|
|
static Ptr<parsing::ParsingError> DuplicatedSymbol(WfExpression* node, Ptr<WfLexicalSymbol> symbol);
|
|
static Ptr<parsing::ParsingError> InterfaceMethodNotImplemented(WfNewInterfaceExpression* node, reflection::description::IMethodInfo* method);
|
|
static Ptr<parsing::ParsingError> InterfaceMethodNotFound(WfFunctionDeclaration* node, reflection::description::ITypeInfo* interfaceType, reflection::description::ITypeInfo* methodType);
|
|
static Ptr<parsing::ParsingError> CannotPickOverloadedInterfaceMethods(WfExpression* node, collections::List<ResolveExpressionResult>& results);
|
|
static Ptr<parsing::ParsingError> CannotPickOverloadedImplementMethods(WfFunctionDeclaration* node, reflection::description::ITypeInfo* type);
|
|
static Ptr<parsing::ParsingError> WrongDeclaration(WfEventDeclaration* node);
|
|
static Ptr<parsing::ParsingError> WrongDeclaration(WfPropertyDeclaration* node);
|
|
static Ptr<parsing::ParsingError> WrongDeclaration(WfConstructorDeclaration* node);
|
|
static Ptr<parsing::ParsingError> WrongDeclaration(WfDestructorDeclaration* node);
|
|
static Ptr<parsing::ParsingError> WrongDeclarationInInterfaceConstructor(WfDeclaration* node);
|
|
|
|
// E: Module error
|
|
static Ptr<parsing::ParsingError> WrongUsingPathWildCard(WfModuleUsingPath* node);
|
|
|
|
// F: Symbol Error
|
|
static Ptr<parsing::ParsingError> TopQualifiedSymbolNotExists(parsing::ParsingTreeCustomBase* node, const WString& name);
|
|
static Ptr<parsing::ParsingError> ChildSymbolNotExists(parsing::ParsingTreeCustomBase* node, Ptr<WfLexicalScopeName> scopeName, const WString& name);
|
|
static Ptr<parsing::ParsingError> MemberNotExists(parsing::ParsingTreeCustomBase* node, reflection::description::ITypeDescriptor* typeDescriptor, const WString& name);
|
|
static Ptr<parsing::ParsingError> ReferenceNotExists(parsing::ParsingTreeCustomBase* node, const WString& name);
|
|
static Ptr<parsing::ParsingError> TooManyTargets(parsing::ParsingTreeCustomBase* node, collections::List<ResolveExpressionResult>& results, const WString& name);
|
|
static Ptr<parsing::ParsingError> EnumItemNotExists(parsing::ParsingTreeCustomBase* node, reflection::description::ITypeDescriptor* typeDescriptor, const WString& name);
|
|
|
|
// G: Class error
|
|
static Ptr<parsing::ParsingError> NonFunctionClassMemberCannotBeStaticOrOverride(WfClassMember* node);
|
|
static Ptr<parsing::ParsingError> FunctionInNewTypeExpressionCannotBeStatic(WfClassMember* node);
|
|
static Ptr<parsing::ParsingError> WrongClassMember(WfNamespaceDeclaration* node);
|
|
static Ptr<parsing::ParsingError> PropertyGetterNotFound(WfPropertyDeclaration* node, WfClassDeclaration* classDecl);
|
|
static Ptr<parsing::ParsingError> PropertySetterNotFound(WfPropertyDeclaration* node, WfClassDeclaration* classDecl);
|
|
static Ptr<parsing::ParsingError> PropertyEventNotFound(WfPropertyDeclaration* node, WfClassDeclaration* classDecl);
|
|
static Ptr<parsing::ParsingError> TooManyPropertyGetter(WfPropertyDeclaration* node, WfClassDeclaration* classDecl);
|
|
static Ptr<parsing::ParsingError> TooManyPropertySetter(WfPropertyDeclaration* node, WfClassDeclaration* classDecl);
|
|
static Ptr<parsing::ParsingError> TooManyPropertyEvent(WfPropertyDeclaration* node, WfClassDeclaration* classDecl);
|
|
static Ptr<parsing::ParsingError> PropertyGetterTypeMismatched(WfPropertyDeclaration* node, WfClassDeclaration* classDecl);
|
|
static Ptr<parsing::ParsingError> PropertySetterTypeMismatched(WfPropertyDeclaration* node, WfClassDeclaration* classDecl);
|
|
static Ptr<parsing::ParsingError> WrongBaseType(WfClassDeclaration* node, WfType* type);
|
|
static Ptr<parsing::ParsingError> WrongBaseTypeOfClass(WfClassDeclaration* node, reflection::description::ITypeDescriptor* type);
|
|
static Ptr<parsing::ParsingError> WrongBaseTypeOfInterface(WfClassDeclaration* node, reflection::description::ITypeDescriptor* type);
|
|
static Ptr<parsing::ParsingError> WrongInterfaceBaseType(WfClassDeclaration* node, reflection::description::ITypeDescriptor* type);
|
|
static Ptr<parsing::ParsingError> ClassWithInterfaceConstructor(WfClassDeclaration* node);
|
|
static Ptr<parsing::ParsingError> OverrideShouldImplementInterfaceMethod(WfFunctionDeclaration* node);
|
|
static Ptr<parsing::ParsingError> MissingFieldType(WfVariableDeclaration* node);
|
|
static Ptr<parsing::ParsingError> DuplicatedBaseClass(WfClassDeclaration* node, reflection::description::ITypeDescriptor* type);
|
|
static Ptr<parsing::ParsingError> DuplicatedBaseInterface(WfClassDeclaration* node, reflection::description::ITypeDescriptor* type);
|
|
static Ptr<parsing::ParsingError> WrongBaseConstructorCall(WfBaseConstructorCall* node, reflection::description::ITypeDescriptor* type);
|
|
static Ptr<parsing::ParsingError> DuplicatedBaseConstructorCall(WfBaseConstructorCall* node, reflection::description::ITypeDescriptor* type);
|
|
static Ptr<parsing::ParsingError> TooManyDestructor(WfDestructorDeclaration* node, WfClassDeclaration* classDecl);
|
|
};
|
|
}
|
|
}
|
|
}
|
|
|
|
#endif
|