示例#1
0
 public BoundAssignStatement(
     BoundExpression memberExpression,
     BoundExpression toAssignExpression,
     AssignmentOperators assignOperator,
     AssignmentStatementSyntax statementSyntax)
     : base(statementSyntax)
 {
     MemberExpression = memberExpression;
     ToAssignExpression = toAssignExpression;
     AssignOperator = assignOperator;
 }
示例#2
0
        /// <summary>
        /// Allows to enable/disable assignment operators.
        /// For security when expression are generated by the users is more safe to disable assignment operators.
        /// </summary>
        /// <param name="assignmentOperators"></param>
        /// <returns></returns>
        public Interpreter EnableAssignment(AssignmentOperators assignmentOperators)
        {
            _settings.AssignmentOperators = assignmentOperators;

            return(this);
        }
 public string ToCSharpCode(AssignmentOperators oper)
 {
     switch (oper) {
     case AssignmentOperators.Plus: return "+";
     case AssignmentOperators.Minus: return "-";
     case AssignmentOperators.Multiply: return "*";
     case AssignmentOperators.Divide: return "/";
     case AssignmentOperators.Modulo: return "%";
     case AssignmentOperators.BitwiseAnd: return "&";
     case AssignmentOperators.BitwiseOr: return "|";
     case AssignmentOperators.ShiftLeft: return "<<";
     case AssignmentOperators.ShiftRight: return ">>";
     }
     throw new ArgumentException ();
 }