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;
        }
示例#4
0
 public void AddParam(Expression param)
 {
     parameters.Add(param);
 }
示例#5
0
 public LambdaExpression(Expression expression)
 {
     ParamName = DefaultParamName;
     this.expression = expression;
 }
示例#6
0
 public InequalityComparison(Expression left, Expression right)
     : base(left, ComparisonOperator.Inequality, right)
 {
 }
示例#7
0
 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;
 }
示例#9
0
 public MultiplyOperation(Expression left, Expression right)
 {
     this.left = left;
     this.right = right;
 }
示例#10
0
 public ForeachStatement(NameElement itemName, Expression collection, BlockStatement body)
 {
     this.itemName = itemName;
     this.collection=collection;
     this.body = body;
 }
示例#11
0
文件: Cs.cs 项目: jorgehmv/CsBuilder
 public static LambdaExpression Lambda(Expression expression)
 {
     return new LambdaExpression(expression);
 }
示例#12
0
文件: Cs.cs 项目: jorgehmv/CsBuilder
 public static AssignmentExpression Assign(ReferenceExpression leftSide, Expression rightSide)
 {
     return new AssignmentExpression(leftSide, rightSide);
 }
示例#13
0
文件: Cs.cs 项目: jorgehmv/CsBuilder
 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;
 }
示例#16
0
 public DivideOperation(Expression left, Expression right)
 {
     this.left = left;
     this.right = right;
 }
示例#17
0
 public MinusOperation(Expression left, Expression right)
 {
     this.left = left;
     this.right = right;
 }
示例#18
0
 public ReferenceExpression(Expression owner, string name)
 {
     this.owner = owner;
     this.name = new NameElement(name);
 }
示例#19
0
 public CoalesceExpression(Expression leftExpression, Expression rightExpression)
 {
     this.leftExpression = leftExpression;
     this.rightExpression = rightExpression;
 }
示例#20
0
 public ReferenceExpression(Expression owner, ReferenceExpression reference)
 {
     this.owner = owner;
     this.reference = reference;
 }
示例#21
0
 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;
 }
示例#22
0
 public CastExpression(Expression castedExpression, CsType type)
 {
     this.castedExpression = castedExpression;
     this.type = type;
 }
示例#23
0
 public GreaterThanOrEqualsToComparison(Expression left, Expression right)
     : base(left, ComparisonOperator.GreaterThanOrEqualsTo, right)
 {
 }
示例#24
0
 public AssignmentExpression(Expression leftSide, Expression rightSide)
 {
     LeftSide = leftSide;
     RightSide = rightSide;
 }
示例#25
0
 public LessThanComparison(Expression left, Expression right)
     : base(left, ComparisonOperator.LessThan, right)
 {
 }
示例#26
0
 public RefExpression(Expression expression)
 {
     this.expression = expression;
 }
        public static MethodCallExpression RefParam(this MethodCallExpression methodCallExpression, Expression refParam)
        {
            methodCallExpression.AddParam(new RefExpression(refParam));

            return methodCallExpression;
        }
示例#28
0
 public IfStatement(Expression expression, BlockStatement body)
 {
     this.expression = expression;
     this.body = body;
 }
示例#29
0
 public YieldReturnStatement(Expression expression)
 {
     this.expression = expression;
 }
示例#30
0
 public PlusPlusOperation(Expression expression)
 {
     this.expression = expression;
 }