public MethodCallExpression(string name, Expression expression) { this.name = name; this.caller = expression; parameters = new List<Expression>(); genericArgumentTypes = new List<CsType>(); }
public static ForeachStatement Foreach(this BlockStatement blockStatement, string itemName, Expression expression, Action<BlockStatement> block) { var nestedBlockStatement = new BlockStatement(); block(nestedBlockStatement); var foreachStatement = new ForeachStatement(new NameElement(itemName), expression, nestedBlockStatement); blockStatement.AddStatement(foreachStatement); return foreachStatement; }
public static IfStatement If(this BlockStatement blockStatement, Expression expression, Action<BlockStatement> block) { var nestedBlockStatement = new BlockStatement(); block(nestedBlockStatement); var ifStatement = new IfStatement(expression, nestedBlockStatement); blockStatement.AddStatement(ifStatement); return ifStatement; }
public void AddParam(Expression param) { parameters.Add(param); }
public LambdaExpression(Expression expression) { ParamName = DefaultParamName; this.expression = expression; }
public InequalityComparison(Expression left, Expression right) : base(left, ComparisonOperator.Inequality, right) { }
public GreaterThanComparison(Expression left, Expression right) : base(left, ComparisonOperator.GreaterThan, right) { }
public static FieldStatement Init(this FieldStatement fieldStatement, Expression expression) { fieldStatement.InitValue = expression; return fieldStatement; }
public MultiplyOperation(Expression left, Expression right) { this.left = left; this.right = right; }
public ForeachStatement(NameElement itemName, Expression collection, BlockStatement body) { this.itemName = itemName; this.collection=collection; this.body = body; }
public static LambdaExpression Lambda(Expression expression) { return new LambdaExpression(expression); }
public static AssignmentExpression Assign(ReferenceExpression leftSide, Expression rightSide) { return new AssignmentExpression(leftSide, rightSide); }
public static AssignmentExpression Assign(string leftSide, Expression rightSide) { return Assign(Cs.Var(leftSide), rightSide); }
public static WhileStatement While(this BlockStatement blockStatement, Expression expression, Action<BlockStatement> block) { var nestedBlockStatement = new BlockStatement(); block(nestedBlockStatement); var whileStatement = new WhileStatement(expression, nestedBlockStatement); blockStatement.AddStatement(whileStatement); return whileStatement; }
public static ForStatement To(this ForStatement forStatement, Expression toValue) { forStatement.Condition = forStatement.Variable <= toValue; return forStatement; }
public DivideOperation(Expression left, Expression right) { this.left = left; this.right = right; }
public MinusOperation(Expression left, Expression right) { this.left = left; this.right = right; }
public ReferenceExpression(Expression owner, string name) { this.owner = owner; this.name = new NameElement(name); }
public CoalesceExpression(Expression leftExpression, Expression rightExpression) { this.leftExpression = leftExpression; this.rightExpression = rightExpression; }
public ReferenceExpression(Expression owner, ReferenceExpression reference) { this.owner = owner; this.reference = reference; }
protected Comparison(Expression left, ComparisonOperator comparisonOperator, Expression right) { this.left = !ReferenceEquals(left, null) ? left : Null; this.comparisonOperator = comparisonOperator; this.right = !ReferenceEquals(right, null) ? right : Null; }
public CastExpression(Expression castedExpression, CsType type) { this.castedExpression = castedExpression; this.type = type; }
public GreaterThanOrEqualsToComparison(Expression left, Expression right) : base(left, ComparisonOperator.GreaterThanOrEqualsTo, right) { }
public AssignmentExpression(Expression leftSide, Expression rightSide) { LeftSide = leftSide; RightSide = rightSide; }
public LessThanComparison(Expression left, Expression right) : base(left, ComparisonOperator.LessThan, right) { }
public RefExpression(Expression expression) { this.expression = expression; }
public static MethodCallExpression RefParam(this MethodCallExpression methodCallExpression, Expression refParam) { methodCallExpression.AddParam(new RefExpression(refParam)); return methodCallExpression; }
public IfStatement(Expression expression, BlockStatement body) { this.expression = expression; this.body = body; }
public YieldReturnStatement(Expression expression) { this.expression = expression; }
public PlusPlusOperation(Expression expression) { this.expression = expression; }