Exemple #1
0
 public IfCastNode(VariableNode name, ITypeNode declare, IEvaluableNode cond, IScopeNode then)
 {
     Name      = name;
     Declare   = declare;
     Condition = cond;
     Then      = then;
 }
Exemple #2
0
 public static ITypeNode ExpressionToType(IEvaluableNode expr)
 {
     return(expr switch
     {
         VariableNode v => new TypeNode {
             Name = v.Name
         },
         ITypeNode t => t,
         _ => throw new SyntaxErrorException("not type"),
     });
 public OutputDataPin(Type type, IEvaluableNode <IEvaluableInputDataPin, IEvaluableOutputDataPin> node)
 {
     this.node = node;
     Type      = type;
 }
Exemple #4
0
 public static BlockNode ToStatementBlock(IEvaluableNode expr) => ToBlock(expr.Cast <IStatementNode>());
Exemple #5
0
 public static IfCastNode CreateIfCastNode(VariableNode name, ITypeNode declare, IEvaluableNode cond, IScopeNode then) => new IfCastNode(name, declare, cond, then).R(cond);
Exemple #6
0
 public static IfNode CreateIfNode(IEvaluableNode cond, IScopeNode then) => new IfNode(cond, then).R(cond);
Exemple #7
0
 public LetPropertyNode(IEvaluableNode recv, VariableNode name, IEvaluableNode e)
 {
     Reciever   = recv;
     Name       = name;
     Expression = e;
 }
Exemple #8
0
 public SpecializationNode(IEvaluableNode expr)
 {
     Expression = expr;
 }
Exemple #9
0
 public static LetNode CreateLetNode(VariableNode v, IEvaluableNode e) => new LetNode(v, e).R(v);
Exemple #10
0
 public static FunctionCallNode CreateFunctionCallNode(IEvaluableNode expr, params IEvaluableNode[] args) => new FunctionCallNode(expr).Return(x => x.Arguments.AddRange(args)).R(expr);
Exemple #11
0
 public static PropertyNode CreatePropertyNode(IEvaluableNode left, VariableNode right) => new PropertyNode(left, right);
Exemple #12
0
 public LetNode(VariableNode v, IEvaluableNode e)
 {
     Var        = v;
     Expression = e;
 }
Exemple #13
0
 public PropertyNode(IEvaluableNode left, VariableNode right)
 {
     Left  = left;
     Right = right;
 }
Exemple #14
0
 public FunctionCallNode(IEvaluableNode expr)
 {
     Expression = expr;
 }
Exemple #15
0
 public static LetPropertyNode CreateLetNode(IEvaluableNode left, VariableNode right, IEvaluableNode e) => new LetPropertyNode(left, right, e).R(right);
Exemple #16
0
 public IfNode(IEvaluableNode cond, IScopeNode then)
 {
     Condition = cond;
     Then      = then;
 }
Exemple #17
0
 public static LambdaExpressionNode ToLambdaExpression(IEvaluableNode expr) => new LambdaExpressionNode().Return(x => x.Statements.Add(new ImplicitReturn(expr)));
Exemple #18
0
 public ImplicitReturn(IEvaluableNode e)
 {
     Expression = e;
 }
Exemple #19
0
 public static IEnumerable <IEvaluableNode> PropertyToList(IEvaluableNode expr) => expr is PropertyNode p?PropertyToList(p.Left).Concat(p.Right) : new List <IEvaluableNode>()