void BitShift(out Expression exp) { Expression second; PlusMinus(out exp); while (la.kind == 38 || la.kind == 39) { if (la.kind == 38) { Get(); } else { Get(); } Token tok = t; PlusMinus(out second); if (!ExpectInt(exp, tok, false)) { return; } if (!ExpectInt(second, tok, true)) { return; } if (tok.val == "<<") { exp = new ShiftLeft((TypedExpression <int>)exp, (TypedExpression <int>)second); } else if (tok.val == ">>") { exp = new ShiftRight((TypedExpression <int>)exp, (TypedExpression <int>)second); } } }
public override void Visit(ShiftRight node) { ulong left = thread.Pop().Read().GetAsInt().Value; ulong right = thread.Pop().Read().GetAsInt().Value; PushInteger(left >> (int)right); }
public override bool Visit(ShiftRight node) { traverse(node.left); outputCode(" >> ", false, false); traverse(node.right); //Visit((ArithmethicBinaryExpression) node); return(true); }
public ActionResult Edit(ShiftRight.Heim.Models.Attribute attr) { using(var dtx = new HeimContext()) { if(this.ModelState.IsValid) { dtx.Entry<ShiftRight.Heim.Models.Attribute>(attr).State = System.Data.Entity.EntityState.Modified; dtx.SaveChanges(); } return RedirectToAction("Edit", "Plans", new { id = attr.PlanID }); } }
public ActionResult AddAttribute(ShiftRight.Heim.Models.Attribute attr) { using(var dtx = new HeimContext()) { if(ModelState.IsValid) { dtx.Attributes.Add(attr); dtx.SaveChanges(); } return RedirectToAction("Edit", new { id = attr.PlanID }); } }
/// <summary> /// Shift self right operator. /// </summary> /// <param name="VariableName">Variable name..</param> /// <param name="Operand">Operand.</param> /// <param name="Start">Start position in script expression.</param> /// <param name="Length">Length of expression covered by node.</param> /// <param name="Expression">Expression containing script.</param> public ShiftSelfRight(string VariableName, ScriptNode Operand, int Start, int Length, Expression Expression) : base(VariableName, Operand, Start, Length, Expression) { this.shiftRight = new ShiftRight(new VariableReference(VariableName, true, Start, Length, Expression), Operand, Start, Length, Expression); }
public virtual T Visit(ShiftRight node) { return(Visit((ArithmeticBinaryExpression)node)); }
public virtual void Visit(ShiftRight node) { }
public override bool Visit(ShiftRight node) { Visit((ArithmeticBinaryExpression)node); return(true); }
public static ParamLessInstruction GetInstructionForOperator( string operatorVal, bool twoArg = true, DatSymbolType leftSideType = DatSymbolType.Void) { ParamLessInstruction instruction = new ParamLessInstruction(); switch (operatorVal) { case "=": instruction = GetAssignInstructionForDatSymbolType(leftSideType); break; case "+=": instruction = new AssignAdd(); break; case "-=": instruction = new AssignSubtract(); break; case "*=": instruction = new AssignMultiply(); break; case "/=": instruction = new AssignDivide(); break; case "+": if (twoArg) { instruction = new Add(); } else { instruction = new Plus(); } break; case "-": if (twoArg) { instruction = new Subtract(); } else { instruction = new Minus(); } break; case "<<": instruction = new ShiftLeft(); break; case ">>": instruction = new ShiftRight(); break; case ">": instruction = new Greater(); break; case ">=": instruction = new GreaterOrEqual(); break; case "<": instruction = new Less(); break; case "<=": instruction = new LessOrEqual(); break; case "==": instruction = new Equal(); break; case "!=": instruction = new NotEqual(); break; case "!": instruction = new Not(); break; case "~": instruction = new Negate(); break; case "*": instruction = new Multiply(); break; case "/": instruction = new Divide(); break; case "%": instruction = new Modulo(); break; case "&": instruction = new BitAnd(); break; case "|": instruction = new BitOr(); break; case "&&": instruction = new LogAnd(); break; case "||": instruction = new LogOr(); break; } if (instruction == null) { throw new Exception($"'{operatorVal}' does't have insctruction"); } return(instruction); }
void BitShift(out Expression exp) { Expression second; PlusMinus(out exp); while (la.kind == 38 || la.kind == 39) { if (la.kind == 38) { Get(); } else { Get(); } Token tok = t; PlusMinus(out second); if (!ExpectInt(exp, tok, false)) { return; } if (!ExpectInt(second, tok, true)) { return; } if (tok.val == "<<") { exp = new ShiftLeft((TypedExpression<int>)exp, (TypedExpression<int>)second); } else if (tok.val == ">>") { exp = new ShiftRight((TypedExpression<int>)exp, (TypedExpression<int>)second); } } }