public static FunctionCallNode Call(AstNode function, ArgumentNode[] argumentNodes) { return(Call(null, function, argumentNodes)); }
public static FunctionCallNode Call(AstNode instance, AstNode function, ArgumentNode[] argumentNodes) { return(new FunctionCallNode(instance, function, _nodeIndex++, argumentNodes)); }
public static AssignNode Assign(AstNode left, AstNode right) { return(new AssignNode(left, right, _nodeIndex++)); }
public static IfElseNode IfElseThen(AstNode condition, AstNode ifTrue, AstNode ifFalse) { return(new IfElseNode(condition, ifTrue, ifFalse, _nodeIndex++)); }
public static LambdaNode Lambda(ParameterNode paremeterExpression, AstNode bodyExpression) { return(new LambdaNode(Parameters(new[] { paremeterExpression }), bodyExpression, true, _nodeIndex++)); }
public static ConditionalExpressionNode Conditional(AstNode condition, SyntaxToken questionToken, AstNode whenTrue, SyntaxToken colonToken, AstNode whenFalse) { return(new ConditionalExpressionNode(condition, whenTrue, whenFalse, _nodeIndex++)); }
public static MemberAccessNode MemberAccess(AstNode member, string declaringType, string memberType) { return(new MemberAccessNode(member, null, declaringType, memberType, _nodeIndex++)); }
public static CaseNode Case(AstNode test, AstNode body) { return(new CaseNode(test, body, _nodeIndex++)); }
public static ParameterNode Parameter(AstNode name) { var n = name.Value?.ToString(); return(new ParameterNode(n, "any", _nodeIndex++)); }
public static ArgumentNode Argument(AstNode item, int argIndex) { return(new ArgumentNode(item, argIndex, _nodeIndex++)); }
public static FunctionNode Function(string name, string returnType, FunctionParametersNode argumentsExpression, AstNode bodyExpression) { return(new FunctionNode(name, XzaarType.GetType(returnType), argumentsExpression, bodyExpression, _nodeIndex++)); }
public static FunctionNode Function(string name, FunctionParametersNode argumentsExpression, AstNode bodyExpression) { return(new FunctionNode(name, argumentsExpression, bodyExpression, _nodeIndex++)); }
public static LambdaNode Lambda(FunctionParametersNode paremeterExpression, AstNode bodyExpression) { return(new LambdaNode(paremeterExpression, bodyExpression, false, _nodeIndex++)); }
public static ReturnNode Return(AstNode returnNode) { return(new ReturnNode(returnNode, _nodeIndex++)); }
public static MemberAccessNode MemberAccess(AstNode member, AstNode arrayIndexer) { return(new MemberAccessNode(member, arrayIndexer, "any", "any", _nodeIndex++)); }
public static CaseNode DefaultCase(AstNode body) { return(new CaseNode(null, body, _nodeIndex++)); }
public static MemberAccessChainNode MemberAccessChain(AstNode lastAccessorNode, MemberAccessNode memberAccessNode) { return(new MemberAccessChainNode(lastAccessorNode, memberAccessNode, memberAccessNode.MemberType, _nodeIndex++)); }
public static ForeachLoopNode Foreach(AstNode variableDefinition, AstNode sourceExpression, AstNode body) { if (body != null) { body.SortChildren(); } return(new ForeachLoopNode(variableDefinition, sourceExpression, body, _nodeIndex++)); }
public void RemoveChild(AstNode node) { node.Parent = null; this.children.Remove(node); }