Example #1
0
 public ReturnStatement(IBaseExpression expr)
 {
     IBaseExpression.CheckTypes(
         "return statement", "",
         typeof(long), expr.GetResultType()
         );
     this.expr = expr;
 }
Example #2
0
 public VarAssignStatement(Variable lhs, IBaseExpression rhs)
 {
     IBaseExpression.CheckTypes(
         "assignment to " + lhs.ToString(), "",
         typeof(long), rhs.GetResultType()
         );
     this.lhs = lhs;
     this.rhs = rhs;
 }
Example #3
0
 public IfStatement(
     IBaseExpression condition,
     IBaseStatement ifBranch,
     IBaseStatement elseBranch = null
     )
 {
     IBaseExpression.CheckTypes(
         "if condition", "",
         typeof(bool), condition.GetResultType()
         );
     this.condition  = condition;
     precalc         = (bool?)condition.Evaluate();
     this.ifBranch   = ifBranch;
     this.elseBranch = elseBranch;
 }