public bool ApplyAssignment(CodeContext codeContext, string leftOfEquals, string rightOfEquals, string newVariableDeclarationType, AssignmentOperatorType assignmentOperator) { bool succeeded = false; if (newVariableDeclarationType == null && variables.Contains(leftOfEquals)) { // Circular depenency detected! AddErrorText("Circular dependency detected on " + leftOfEquals); } else { variables.Add(leftOfEquals); try { AssignValue(newVariableDeclarationType, leftOfEquals, rightOfEquals, codeContext, assignmentOperator); succeeded = true; } catch (Exception exception) { string combined = newVariableDeclarationType + " " + leftOfEquals + " assignment " + rightOfEquals; AddErrorText("Parse error in: " + combined); mParserLog.AppendLine("Parse error for line " + combined + "\nException:\n" + exception); } variables.Remove(leftOfEquals); } return(succeeded); }
public AssignmentNode(VariableNode p_Assigned, Node p_Value, AssignmentOperatorType p_Op, PositionData p_PositionData) : base(NodeType.ASSIGMENT_OP, p_PositionData) { Assigned = p_Assigned; Value = p_Value; Op = p_Op; }
public static ExpressionType GetLinqNodeType(AssignmentOperatorType op, bool checkForOverflow) { Console.WriteLine("GetLinqNodeType:" + op); switch (op) { // case AssignmentOperatorType.Assign: // return ExpressionType.Assign; // case AssignmentOperatorType.Add: // return checkForOverflow ? ExpressionType.AddAssignChecked : ExpressionType.AddAssign; //case AssignmentOperatorType.Subtract: // return checkForOverflow ? ExpressionType.SubtractAssignChecked : ExpressionType.SubtractAssign; //case AssignmentOperatorType.Multiply: // return checkForOverflow ? ExpressionType.MultiplyAssignChecked : ExpressionType.MultiplyAssign; //case AssignmentOperatorType.Divide: // return ExpressionType.DivideAssign; //case AssignmentOperatorType.Modulus: // return ExpressionType.ModuloAssign; //case AssignmentOperatorType.ShiftLeft: // return ExpressionType.LeftShiftAssign; //case AssignmentOperatorType.ShiftRight: // return ExpressionType.RightShiftAssign; //case AssignmentOperatorType.BitwiseAnd: // return ExpressionType.AndAssign; //case AssignmentOperatorType.BitwiseOr: // return ExpressionType.OrAssign; //case AssignmentOperatorType.ExclusiveOr: // return ExpressionType.ExclusiveOrAssign; default: throw new NotSupportedException("Invalid value for AssignmentOperatorType"); } }
void TestAssignmentExpression(string program, AssignmentOperatorType op) { AssignmentExpression ae = ParseUtilCSharp.ParseExpression<AssignmentExpression>(program); Assert.AreEqual(op, ae.Operator); Assert.IsTrue(ae.Left is IdentifierExpression); Assert.IsTrue(ae.Right is IdentifierExpression); }
void TestAssignmentExpression(string program, AssignmentOperatorType op) { AssignmentExpression ae = ParseUtilCSharp.ParseExpression <AssignmentExpression>(program); Assert.AreEqual(op, ae.Operator); Assert.IsTrue(ae.Left is IdentifierExpression); Assert.IsTrue(ae.Right is IdentifierExpression); }
void TestAssignmentExpression(string program, AssignmentOperatorType op) { ExpressionStatement se = ParseUtil.ParseStatement<ExpressionStatement>(program); AssignmentExpression ae = se.Expression as AssignmentExpression; Assert.AreEqual(op, ae.Op); Assert.IsTrue(ae.Left is IdentifierExpression); Assert.IsTrue(ae.Right is IdentifierExpression); }
void VBNetTestAssignmentExpression(string program, AssignmentOperatorType op) { ExpressionStatement se = ParseUtilVBNet.ParseStatement <ExpressionStatement>(program); AssignmentExpression ae = se.Expression as AssignmentExpression; Assert.AreEqual(op, ae.Op); Assert.IsTrue(ae.Left is IdentifierExpression); Assert.IsTrue(ae.Right is IdentifierExpression); }
private static ExpressionNode AsOverloadedMethod(ContextNode context, AssignmentOperatorType op, ExpressionNode left, ExpressionNode right, SequencePoint point) { if (!OperatorMethods.ContainsKey(op)) { return(null); } string name = OperatorMethods[op]; return(BinaryOperatorNode.AsOverload(context, name, left, right, point)); }
B.BinaryOperatorType ConvertOperator(AssignmentOperatorType op, out bool isInPlace) { isInPlace = true; switch (op) { case AssignmentOperatorType.Add: return(B.BinaryOperatorType.InPlaceAddition); case AssignmentOperatorType.Assign: return(B.BinaryOperatorType.Assign); case AssignmentOperatorType.BitwiseAnd: return(B.BinaryOperatorType.InPlaceBitwiseAnd); case AssignmentOperatorType.BitwiseOr: return(B.BinaryOperatorType.InPlaceBitwiseOr); case AssignmentOperatorType.ConcatString: return(B.BinaryOperatorType.InPlaceAddition); case AssignmentOperatorType.Divide: return(B.BinaryOperatorType.InPlaceDivision); case AssignmentOperatorType.DivideInteger: return(B.BinaryOperatorType.InPlaceDivision); case AssignmentOperatorType.ExclusiveOr: return(B.BinaryOperatorType.InPlaceExclusiveOr); case AssignmentOperatorType.Modulus: isInPlace = false; return(B.BinaryOperatorType.Modulus); case AssignmentOperatorType.Multiply: return(B.BinaryOperatorType.InPlaceMultiply); case AssignmentOperatorType.Power: isInPlace = false; return(B.BinaryOperatorType.Exponentiation); case AssignmentOperatorType.ShiftLeft: return(B.BinaryOperatorType.InPlaceShiftLeft); case AssignmentOperatorType.ShiftRight: return(B.BinaryOperatorType.InPlaceShiftRight); case AssignmentOperatorType.Subtract: return(B.BinaryOperatorType.InPlaceSubtraction); default: return(B.BinaryOperatorType.None); } }
static IfElseStatement ConvertAssignment(Expression target, AssignmentOperatorType op, ConditionalExpression conditionalExpr) { var trueAssignment = new AssignmentExpression(target.Clone(), op, conditionalExpr.TrueExpression.Clone()); var falseAssignment = new AssignmentExpression(target.Clone(), op, conditionalExpr.FalseExpression.Clone()); return(new IfElseStatement(conditionalExpr.Condition.Clone(), new ExpressionStatement(trueAssignment), new ExpressionStatement(falseAssignment))); }
public static ExpressionNode Create(ContextNode context, AssignmentOperatorType op, ExpressionNode left, ExpressionNode right, SequencePoint point) { if (!left.IsSettable) { ErrorCode.NotAnLValue.ReportAndThrow(left.SequencePoint, "Left of assignment operator must be settable"); } if (!right.IsGettable) { ErrorCode.NotAnRValue.ReportAndThrow(right.SequencePoint, "Right of assignment operator must be gettable"); } var type = left.ExpressionReturnType; var overloaded = AsOverloadedMethod(context, op, left, right, point); if (overloaded != null) { return(overloaded); } if (op != AssignmentOperatorType.Assignment) { //only transform primitives if (!(context.Parser.IsPrimitive(left.ExpressionReturnType) && context.Parser.IsPrimitive(right.ExpressionReturnType))) { AssignmentMissmatch(left, right, point); } if (!left.IsGettable) { ErrorCode.NotAnRValue.ReportAndThrow(right.SequencePoint, "Left of this type of assignment operator must be gettable"); } right = BinaryOperatorNode.Create(context, AssignmentToBinary[op], left, right, point); } if (!right.ExpressionReturnType.IsAssignableTo(left.ExpressionReturnType)) { ErrorCode.TypeMismatch.ReportAndThrow(point, "Cannot assign {0} to {1}", right.ExpressionReturnType, left.ExpressionReturnType); } var instance = new AssignmentOperatorNode(point); instance.left = left; instance.right = right; instance.type = left.ExpressionReturnType; return(instance); }
private UnifiedBinaryOperator LookupAssignOperator(AssignmentOperatorType type) { switch (type) { case AssignmentOperatorType.Assign: return(UnifiedBinaryOperator.Create( "=", UnifiedBinaryOperatorKind.Assign)); case AssignmentOperatorType.Add: return(UnifiedBinaryOperator.Create( "+=", UnifiedBinaryOperatorKind.AddAssign)); case AssignmentOperatorType.Subtract: return(UnifiedBinaryOperator.Create( "-=", UnifiedBinaryOperatorKind.SubtractAssign)); case AssignmentOperatorType.Multiply: return(UnifiedBinaryOperator.Create( "*=", UnifiedBinaryOperatorKind.MultiplyAssign)); case AssignmentOperatorType.Divide: return(UnifiedBinaryOperator.Create( "/=", UnifiedBinaryOperatorKind.DivideAssign)); case AssignmentOperatorType.Modulus: return(UnifiedBinaryOperator.Create( "%=", UnifiedBinaryOperatorKind.ModuloAssign)); case AssignmentOperatorType.ShiftLeft: return(UnifiedBinaryOperator.Create( "<<=", UnifiedBinaryOperatorKind.ArithmeticLeftShiftAssign)); case AssignmentOperatorType.ShiftRight: return(UnifiedBinaryOperator.Create( ">>=", UnifiedBinaryOperatorKind.ArithmeticRightShiftAssign)); case AssignmentOperatorType.BitwiseAnd: return(UnifiedBinaryOperator.Create( "&=", UnifiedBinaryOperatorKind.AndAssign)); case AssignmentOperatorType.BitwiseOr: return(UnifiedBinaryOperator.Create( "|=", UnifiedBinaryOperatorKind.OrAssign)); case AssignmentOperatorType.ExclusiveOr: return(UnifiedBinaryOperator.Create( "^=", UnifiedBinaryOperatorKind.ExclusiveOrAssign)); } throw new ArgumentException("Unknown operator: " + type); }
public static BinaryExpressionOperator BinaryOperator(AssignmentOperatorType op) { switch (op) { case AssignmentOperatorType.Add: return(BinaryExpressionOperator.Add); case AssignmentOperatorType.Subtract: return(BinaryExpressionOperator.Subtract); case AssignmentOperatorType.Multiply: return(BinaryExpressionOperator.Multiply); case AssignmentOperatorType.Divide: return(BinaryExpressionOperator.Divide); case AssignmentOperatorType.Modulus: return(BinaryExpressionOperator.Modulus); default: throw new RedILException($"No equivalent operator for assigment operator '{op}'"); } }
private void AssignValue(string newVariableDeclarationType, string leftOfEquals, string rightOfEquals, CodeContext codeContext, AssignmentOperatorType assignOperator) { ElementRuntime elementRuntime = codeContext.ContainerInstance as ElementRuntime; IElement element = null; if (elementRuntime != null) { element = elementRuntime.AssociatedIElement; } CustomVariable customVariable = CreateCustomVariableFor(newVariableDeclarationType, leftOfEquals, rightOfEquals, elementRuntime, codeContext); if (customVariable.Name.CountOf('.') > 1) { throw new Exception("Script parsing doesn't support setting properties/fields on properties/fields. In other words, assigning something.X is okay, but not something.Position.x"); } mParserLog.AppendLine("Left side: " + leftOfEquals + " RightSide: " + rightOfEquals + " Resulting variable: " + customVariable); if (newVariableDeclarationType != null) { TopOfVariableStack[leftOfEquals] = customVariable.DefaultValue; codeContext.VariableStack.Last().Add(leftOfEquals, customVariable.DefaultValue); } else if (customVariable != null) { if (codeContext.ContainerInstance != null) { ElementRuntime runtime = codeContext.ContainerInstance as ElementRuntime; runtime.SetCustomVariable(customVariable, runtime.AssociatedIElement, customVariable.DefaultValue, true, VariableSettingOptions.LiteralSet); } else { var reference = mExpressionParser.EvaluateExpression(leftOfEquals, codeContext, ExpressionParseType.GetReference); bool wasAssigned = false; wasAssigned = TryAssignIAssignableReference(assignOperator, customVariable, reference); if (!wasAssigned) { throw new Exception("Could not assign the value"); } } } }
public static BinaryOperatorType TypeOfAssignment(AssignmentOperatorType operatorType) { switch (operatorType) { case AssignmentOperatorType.Assign: return BinaryOperatorType.Any; case AssignmentOperatorType.Add: return BinaryOperatorType.Add; case AssignmentOperatorType.Subtract: return BinaryOperatorType.Subtract; case AssignmentOperatorType.Multiply: return BinaryOperatorType.Multiply; case AssignmentOperatorType.Divide: return BinaryOperatorType.Divide; case AssignmentOperatorType.Modulus: return BinaryOperatorType.Modulus; case AssignmentOperatorType.ShiftLeft: return BinaryOperatorType.ShiftLeft; case AssignmentOperatorType.ShiftRight: return BinaryOperatorType.ShiftRight; case AssignmentOperatorType.BitwiseAnd: return BinaryOperatorType.BitwiseAnd; case AssignmentOperatorType.BitwiseOr: return BinaryOperatorType.BitwiseOr; case AssignmentOperatorType.ExclusiveOr: return BinaryOperatorType.ExclusiveOr; case AssignmentOperatorType.Any: return BinaryOperatorType.Any; default: throw new ArgumentOutOfRangeException("operatorType", operatorType, null); } }
private static bool TryAssignIAssignableReference(AssignmentOperatorType assignOperator, CustomVariable customVariable, object reference) { bool wasAssigned = false; if (reference is IAssignableReference) { if (assignOperator == AssignmentOperatorType.Assign) { ((IAssignableReference)reference).CurrentValue = customVariable.DefaultValue; wasAssigned = true; } else if (assignOperator == AssignmentOperatorType.Add) { object currentValue = ((IAssignableReference)reference).CurrentValue; object addedResult = PrimitiveOperationManager.Self.AddObjects(currentValue, customVariable.DefaultValue); ((IAssignableReference)reference).CurrentValue = addedResult; wasAssigned = true; } else if (assignOperator == AssignmentOperatorType.Subtract) { object currentValue = ((IAssignableReference)reference).CurrentValue; object addedResult = PrimitiveOperationManager.Self.SubtractObjects(currentValue, customVariable.DefaultValue); ((IAssignableReference)reference).CurrentValue = addedResult; wasAssigned = true; } else if (assignOperator == AssignmentOperatorType.Multiply) { object currentValue = ((IAssignableReference)reference).CurrentValue; object addedResult = PrimitiveOperationManager.Self.MultiplyObjects(currentValue, customVariable.DefaultValue); ((IAssignableReference)reference).CurrentValue = addedResult; wasAssigned = true; } else if (assignOperator == AssignmentOperatorType.Divide) { object currentValue = ((IAssignableReference)reference).CurrentValue; object addedResult = PrimitiveOperationManager.Self.DivideObjects(currentValue, customVariable.DefaultValue); ((IAssignableReference)reference).CurrentValue = addedResult; wasAssigned = true; } } return(wasAssigned); }
public static ExpressionType GetLinqNodeType(AssignmentOperatorType op, bool checkForOverflow) { switch (op) { case AssignmentOperatorType.Assign: return(ExpressionType.Assign); case AssignmentOperatorType.Add: return(checkForOverflow ? ExpressionType.AddAssignChecked : ExpressionType.AddAssign); case AssignmentOperatorType.Subtract: return(checkForOverflow ? ExpressionType.SubtractAssignChecked : ExpressionType.SubtractAssign); case AssignmentOperatorType.Multiply: return(checkForOverflow ? ExpressionType.MultiplyAssignChecked : ExpressionType.MultiplyAssign); case AssignmentOperatorType.Divide: return(ExpressionType.DivideAssign); case AssignmentOperatorType.Modulus: return(ExpressionType.ModuloAssign); case AssignmentOperatorType.ShiftLeft: return(ExpressionType.LeftShiftAssign); case AssignmentOperatorType.ShiftRight: return(ExpressionType.RightShiftAssign); case AssignmentOperatorType.BitwiseAnd: return(ExpressionType.AndAssign); case AssignmentOperatorType.BitwiseOr: return(ExpressionType.OrAssign); case AssignmentOperatorType.ExclusiveOr: return(ExpressionType.ExclusiveOrAssign); default: throw new NotSupportedException("Invalid value for AssignmentOperatorType"); } }
public static string GetOperatorSymbol(AssignmentOperatorType op) { switch (op) { case AssignmentOperatorType.Assign: return("="); case AssignmentOperatorType.Add: return("+="); case AssignmentOperatorType.Subtract: return("-="); case AssignmentOperatorType.Multiply: return("*="); case AssignmentOperatorType.Divide: return("/="); case AssignmentOperatorType.Modulus: return("%="); case AssignmentOperatorType.ShiftLeft: return("<<="); case AssignmentOperatorType.ShiftRight: return(">>="); case AssignmentOperatorType.BitwiseAnd: return("&="); case AssignmentOperatorType.BitwiseOr: return("|="); case AssignmentOperatorType.ExclusiveOr: return("^="); default: throw new NotSupportedException("Invalid value for AssignmentOperatorType"); } }
public static string ToCpp(this AssignmentOperatorType op) { switch (op) { case AssignmentOperatorType.Assign: return("="); case AssignmentOperatorType.Add: return("+="); case AssignmentOperatorType.BitwiseAnd: return("&="); case AssignmentOperatorType.BitwiseOr: return("|="); case AssignmentOperatorType.Divide: return("/="); case AssignmentOperatorType.ExclusiveOr: return("^="); case AssignmentOperatorType.Modulus: return("%="); case AssignmentOperatorType.Multiply: return("*="); case AssignmentOperatorType.ShiftLeft: return("<<="); case AssignmentOperatorType.ShiftRight: return(">>="); case AssignmentOperatorType.Subtract: return("+="); default: throw new Exception($"Unsupported assignment operator: {op}"); } }
/// <summary> /// Gets the binary operator for the specified compound assignment operator. /// Returns null if 'op' is not a compound assignment. /// </summary> public static BinaryOperatorType?GetCorrespondingBinaryOperator(AssignmentOperatorType op) { switch (op) { case AssignmentOperatorType.Assign: return(null); case AssignmentOperatorType.Add: return(BinaryOperatorType.Add); case AssignmentOperatorType.Subtract: return(BinaryOperatorType.Subtract); case AssignmentOperatorType.Multiply: return(BinaryOperatorType.Multiply); case AssignmentOperatorType.Divide: return(BinaryOperatorType.Divide); case AssignmentOperatorType.Modulus: return(BinaryOperatorType.Modulus); case AssignmentOperatorType.ShiftLeft: return(BinaryOperatorType.ShiftLeft); case AssignmentOperatorType.ShiftRight: return(BinaryOperatorType.ShiftRight); case AssignmentOperatorType.BitwiseAnd: return(BinaryOperatorType.BitwiseAnd); case AssignmentOperatorType.BitwiseOr: return(BinaryOperatorType.BitwiseOr); case AssignmentOperatorType.ExclusiveOr: return(BinaryOperatorType.ExclusiveOr); default: throw new NotSupportedException("Invalid value for AssignmentOperatorType"); } }
public static TokenRole GetOperatorRole(AssignmentOperatorType op) { switch (op) { case AssignmentOperatorType.Assign: return(AssignRole); case AssignmentOperatorType.Add: return(AddRole); case AssignmentOperatorType.Subtract: return(SubtractRole); case AssignmentOperatorType.Multiply: return(MultiplyRole); case AssignmentOperatorType.Divide: return(DivideRole); case AssignmentOperatorType.Modulus: return(ModulusRole); case AssignmentOperatorType.ShiftLeft: return(ShiftLeftRole); case AssignmentOperatorType.ShiftRight: return(ShiftRightRole); case AssignmentOperatorType.BitwiseAnd: return(BitwiseAndRole); case AssignmentOperatorType.BitwiseOr: return(BitwiseOrRole); case AssignmentOperatorType.ExclusiveOr: return(ExclusiveOrRole); default: throw new NotSupportedException("Invalid value for AssignmentOperatorType"); } }
public static BinaryOperatorType ToBinaryOperator(this AssignmentOperatorType op) { switch (op) { case AssignmentOperatorType.Add: return(BinaryOperatorType.Add); case AssignmentOperatorType.Subtract: return(BinaryOperatorType.Subtract); case AssignmentOperatorType.Multiply: return(BinaryOperatorType.Modulus); case AssignmentOperatorType.Divide: return(BinaryOperatorType.Divide); case AssignmentOperatorType.Modulus: return(BinaryOperatorType.Modulus); case AssignmentOperatorType.ShiftLeft: return(BinaryOperatorType.ShiftLeft); case AssignmentOperatorType.ShiftRight: return(BinaryOperatorType.ShiftRight); case AssignmentOperatorType.BitwiseAnd: return(BinaryOperatorType.BitwiseAnd); case AssignmentOperatorType.BitwiseOr: return(BinaryOperatorType.BitwiseOr); case AssignmentOperatorType.ExclusiveOr: return(BinaryOperatorType.ExclusiveOr); case AssignmentOperatorType.Assign: case AssignmentOperatorType.Any: default: throw new Exception(string.Format("Cannot convert assignment operator {0} to BinaryOperator", op)); } }
private static E.BinaryOperator GetOperator(AssignmentOperatorType @operator) { switch (@operator) { case AssignmentOperatorType.Add: return(E.BinaryOperator.Add); case AssignmentOperatorType.Subtract: return(E.BinaryOperator.Subtract); case AssignmentOperatorType.Multiply: // TODO: integer divide return(E.BinaryOperator.Multiply); case AssignmentOperatorType.Divide: return(E.BinaryOperator.Divide); case AssignmentOperatorType.Modulus: return(E.BinaryOperator.Modulo); case AssignmentOperatorType.ShiftLeft: return(E.BinaryOperator.LeftShift); case AssignmentOperatorType.ShiftRight: // TODO: Unsigned return(E.BinaryOperator.SignedRightShift); case AssignmentOperatorType.BitwiseAnd: return(E.BinaryOperator.BitwiseAnd); case AssignmentOperatorType.BitwiseOr: return(E.BinaryOperator.BitwiseOr); case AssignmentOperatorType.ExclusiveOr: return(E.BinaryOperator.BitwiseXor); default: throw GetNotImplementedException(); } }
private BinaryOperatorType GetComplexAssignOperator(AssignmentOperatorType type) { switch (type) { case AssignmentOperatorType.BitwiseOr: return(BinaryOperatorType.BitwiseOr); case AssignmentOperatorType.BitwiseAnd: return(BinaryOperatorType.BitwiseAnd); case AssignmentOperatorType.ExclusiveOr: return(BinaryOperatorType.ExclusiveOr); case AssignmentOperatorType.Add: return(BinaryOperatorType.Add); case AssignmentOperatorType.Subtract: return(BinaryOperatorType.Subtract); case AssignmentOperatorType.Divide: return(BinaryOperatorType.Divide); case AssignmentOperatorType.Modulus: return(BinaryOperatorType.Modulus); case AssignmentOperatorType.Multiply: return(BinaryOperatorType.Multiply); case AssignmentOperatorType.ShiftLeft: return(BinaryOperatorType.ShiftLeft); case AssignmentOperatorType.ShiftRight: return(BinaryOperatorType.ShiftRight); default: throw new ArgumentException(); } }
static BinaryOperatorType GetAssignmentOperator(AssignmentOperatorType op) { switch (op) { case AssignmentOperatorType.BitwiseAnd: return(BinaryOperatorType.BitwiseAnd); case AssignmentOperatorType.BitwiseOr: return(BinaryOperatorType.BitwiseOr); case AssignmentOperatorType.ExclusiveOr: return(BinaryOperatorType.ExclusiveOr); case AssignmentOperatorType.Add: return(BinaryOperatorType.Add); case AssignmentOperatorType.Subtract: return(BinaryOperatorType.Subtract); case AssignmentOperatorType.Multiply: return(BinaryOperatorType.Multiply); case AssignmentOperatorType.Divide: return(BinaryOperatorType.Divide); case AssignmentOperatorType.Modulus: return(BinaryOperatorType.Modulus); case AssignmentOperatorType.ShiftLeft: return(BinaryOperatorType.ShiftLeft); case AssignmentOperatorType.ShiftRight: return(BinaryOperatorType.ShiftRight); default: return(BinaryOperatorType.Any); } }
public static AssignmentExpression assign_To(this Expression left, AssignmentOperatorType assignmentOperator, Expression right) { return(new AssignmentExpression(left, assignmentOperator, right)); }
private void AssignmentOperator(out AssignmentOperatorType op) { op = AssignmentOperatorType.None; if (this.la.kind == 3) { base.lexer.NextToken(); op = AssignmentOperatorType.Assign; } else if (this.la.kind == 0x26) { base.lexer.NextToken(); op = AssignmentOperatorType.Add; } else if (this.la.kind == 0x27) { base.lexer.NextToken(); op = AssignmentOperatorType.Subtract; } else if (this.la.kind == 40) { base.lexer.NextToken(); op = AssignmentOperatorType.Multiply; } else if (this.la.kind == 0x29) { base.lexer.NextToken(); op = AssignmentOperatorType.Divide; } else if (this.la.kind == 0x2a) { base.lexer.NextToken(); op = AssignmentOperatorType.Modulus; } else if (this.la.kind == 0x2b) { base.lexer.NextToken(); op = AssignmentOperatorType.BitwiseAnd; } else if (this.la.kind == 0x2c) { base.lexer.NextToken(); op = AssignmentOperatorType.BitwiseOr; } else if (this.la.kind == 0x2d) { base.lexer.NextToken(); op = AssignmentOperatorType.ExclusiveOr; } else if (this.la.kind == 0x2e) { base.lexer.NextToken(); op = AssignmentOperatorType.ShiftLeft; } else if ((this.la.kind == 0x16) && (this.Peek(1).kind == 0x23)) { base.Expect(0x16); base.Expect(0x23); op = AssignmentOperatorType.ShiftRight; } else { base.SynErr(0xa9); } }
void AssignmentOperator( #line 1615 "VBNET.ATG" out AssignmentOperatorType op) { #line 1616 "VBNET.ATG" op = AssignmentOperatorType.None; switch (la.kind) { case 10: { lexer.NextToken(); #line 1617 "VBNET.ATG" op = AssignmentOperatorType.Assign; break; } case 42: { lexer.NextToken(); #line 1618 "VBNET.ATG" op = AssignmentOperatorType.ConcatString; break; } case 34: { lexer.NextToken(); #line 1619 "VBNET.ATG" op = AssignmentOperatorType.Add; break; } case 36: { lexer.NextToken(); #line 1620 "VBNET.ATG" op = AssignmentOperatorType.Subtract; break; } case 37: { lexer.NextToken(); #line 1621 "VBNET.ATG" op = AssignmentOperatorType.Multiply; break; } case 38: { lexer.NextToken(); #line 1622 "VBNET.ATG" op = AssignmentOperatorType.Divide; break; } case 39: { lexer.NextToken(); #line 1623 "VBNET.ATG" op = AssignmentOperatorType.DivideInteger; break; } case 35: { lexer.NextToken(); #line 1624 "VBNET.ATG" op = AssignmentOperatorType.Power; break; } case 40: { lexer.NextToken(); #line 1625 "VBNET.ATG" op = AssignmentOperatorType.ShiftLeft; break; } case 41: { lexer.NextToken(); #line 1626 "VBNET.ATG" op = AssignmentOperatorType.ShiftRight; break; } default: SynErr(256); break; } }
public AssignmentExpression(Expression left, AssignmentOperatorType op, Expression right) { }
public AssignmentExpression(Expression left, AssignmentOperatorType type, Expression right) { AddChild(left, LeftExpressionRole); AddChild(right, RightExpressionRole); Operator = type; }
void AssignmentOperator( #line 1655 "VBNET.ATG" out AssignmentOperatorType op) { #line 1656 "VBNET.ATG" op = AssignmentOperatorType.None; switch (la.kind) { case 20: { lexer.NextToken(); #line 1657 "VBNET.ATG" op = AssignmentOperatorType.Assign; break; } case 54: { lexer.NextToken(); #line 1658 "VBNET.ATG" op = AssignmentOperatorType.ConcatString; break; } case 46: { lexer.NextToken(); #line 1659 "VBNET.ATG" op = AssignmentOperatorType.Add; break; } case 48: { lexer.NextToken(); #line 1660 "VBNET.ATG" op = AssignmentOperatorType.Subtract; break; } case 49: { lexer.NextToken(); #line 1661 "VBNET.ATG" op = AssignmentOperatorType.Multiply; break; } case 50: { lexer.NextToken(); #line 1662 "VBNET.ATG" op = AssignmentOperatorType.Divide; break; } case 51: { lexer.NextToken(); #line 1663 "VBNET.ATG" op = AssignmentOperatorType.DivideInteger; break; } case 47: { lexer.NextToken(); #line 1664 "VBNET.ATG" op = AssignmentOperatorType.Power; break; } case 52: { lexer.NextToken(); #line 1665 "VBNET.ATG" op = AssignmentOperatorType.ShiftLeft; break; } case 53: { lexer.NextToken(); #line 1666 "VBNET.ATG" op = AssignmentOperatorType.ShiftRight; break; } default: SynErr(277); break; } }
B.BinaryOperatorType ConvertOperator(AssignmentOperatorType op, out bool isInPlace) { isInPlace = true; switch (op) { case AssignmentOperatorType.Add: return B.BinaryOperatorType.InPlaceAddition; case AssignmentOperatorType.Assign: return B.BinaryOperatorType.Assign; case AssignmentOperatorType.BitwiseAnd: return B.BinaryOperatorType.InPlaceBitwiseAnd; case AssignmentOperatorType.BitwiseOr: return B.BinaryOperatorType.InPlaceBitwiseOr; case AssignmentOperatorType.ConcatString: return B.BinaryOperatorType.InPlaceAddition; case AssignmentOperatorType.Divide: return B.BinaryOperatorType.InPlaceDivision; case AssignmentOperatorType.DivideInteger: return B.BinaryOperatorType.InPlaceDivision; case AssignmentOperatorType.ExclusiveOr: return B.BinaryOperatorType.InPlaceExclusiveOr; case AssignmentOperatorType.Modulus: isInPlace = false; return B.BinaryOperatorType.Modulus; case AssignmentOperatorType.Multiply: return B.BinaryOperatorType.InPlaceMultiply; case AssignmentOperatorType.Power: isInPlace = false; return B.BinaryOperatorType.Exponentiation; case AssignmentOperatorType.ShiftLeft: return B.BinaryOperatorType.InPlaceShiftLeft; case AssignmentOperatorType.ShiftRight: return B.BinaryOperatorType.InPlaceShiftRight; case AssignmentOperatorType.Subtract: return B.BinaryOperatorType.InPlaceSubtraction; default: return B.BinaryOperatorType.None; } }
public bool ApplyAssignment(CodeContext codeContext, string leftOfEquals, string rightOfEquals, string newVariableDeclarationType, AssignmentOperatorType assignmentOperator) { bool succeeded = false; if (newVariableDeclarationType == null && variables.Contains(leftOfEquals)) { // Circular depenency detected! AddErrorText("Circular dependency detected on " + leftOfEquals); } else { variables.Add(leftOfEquals); try { AssignValue(newVariableDeclarationType, leftOfEquals, rightOfEquals, codeContext, assignmentOperator); succeeded = true; } catch (Exception exception) { string combined = newVariableDeclarationType + " " + leftOfEquals + " assignment " + rightOfEquals; AddErrorText("Parse error in: " + combined); mParserLog.AppendLine("Parse error for line " + combined + "\nException:\n" + exception); } variables.Remove(leftOfEquals); } return succeeded; }
public AssignmentExpression(Expression left, AssignmentOperatorType op, Expression right) { Left = left; Op = op; Right = right; }
private void AssignValue(string newVariableDeclarationType, string leftOfEquals, string rightOfEquals, CodeContext codeContext, AssignmentOperatorType assignOperator) { ElementRuntime elementRuntime = codeContext.ContainerInstance as ElementRuntime; IElement element = null; if (elementRuntime != null) { element = elementRuntime.AssociatedIElement; } CustomVariable customVariable = CreateCustomVariableFor(newVariableDeclarationType, leftOfEquals, rightOfEquals, elementRuntime, codeContext); if (customVariable.Name.CountOf('.') > 1) { throw new Exception("Script parsing doesn't support setting properties/fields on properties/fields. In other words, assigning something.X is okay, but not something.Position.x"); } mParserLog.AppendLine("Left side: " + leftOfEquals + " RightSide: " + rightOfEquals + " Resulting variable: " + customVariable); if (newVariableDeclarationType != null) { TopOfVariableStack[leftOfEquals] = customVariable.DefaultValue; codeContext.VariableStack.Last().Add(leftOfEquals, customVariable.DefaultValue); } else if (customVariable != null) { if (codeContext.ContainerInstance != null) { ElementRuntime runtime = codeContext.ContainerInstance as ElementRuntime; runtime.SetCustomVariable(customVariable, runtime.AssociatedIElement, customVariable.DefaultValue, true, VariableSettingOptions.LiteralSet ); } else { var reference = mExpressionParser.EvaluateExpression(leftOfEquals, codeContext, ExpressionParseType.GetReference); bool wasAssigned = false; wasAssigned = TryAssignIAssignableReference(assignOperator, customVariable, reference); if (!wasAssigned) { throw new Exception("Could not assign the value"); } } } }
private BinaryOperatorType GetComplexAssignOperator(AssignmentOperatorType type) { switch (type) { case AssignmentOperatorType.BitwiseOr: return BinaryOperatorType.BitwiseOr; case AssignmentOperatorType.BitwiseAnd: return BinaryOperatorType.BitwiseAnd; case AssignmentOperatorType.ExclusiveOr: return BinaryOperatorType.ExclusiveOr; case AssignmentOperatorType.Add: return BinaryOperatorType.Add; case AssignmentOperatorType.Subtract: return BinaryOperatorType.Subtract; case AssignmentOperatorType.Divide: return BinaryOperatorType.Divide; case AssignmentOperatorType.Modulus: return BinaryOperatorType.Modulus; case AssignmentOperatorType.Multiply: return BinaryOperatorType.Multiply; case AssignmentOperatorType.ShiftLeft: return BinaryOperatorType.ShiftLeft; case AssignmentOperatorType.ShiftRight: return BinaryOperatorType.ShiftRight; default: throw new ArgumentException(); } }
private static bool TryAssignIAssignableReference(AssignmentOperatorType assignOperator, CustomVariable customVariable, object reference) { bool wasAssigned = false; if (reference is IAssignableReference) { if (assignOperator == AssignmentOperatorType.Assign) { ((IAssignableReference)reference).CurrentValue = customVariable.DefaultValue; wasAssigned = true; } else if (assignOperator == AssignmentOperatorType.Add) { object currentValue = ((IAssignableReference)reference).CurrentValue; object addedResult = PrimitiveOperationManager.Self.AddObjects(currentValue, customVariable.DefaultValue); ((IAssignableReference)reference).CurrentValue = addedResult; wasAssigned = true; } else if (assignOperator == AssignmentOperatorType.Subtract) { object currentValue = ((IAssignableReference)reference).CurrentValue; object addedResult = PrimitiveOperationManager.Self.SubtractObjects(currentValue, customVariable.DefaultValue); ((IAssignableReference)reference).CurrentValue = addedResult; wasAssigned = true; } else if (assignOperator == AssignmentOperatorType.Multiply) { object currentValue = ((IAssignableReference)reference).CurrentValue; object addedResult = PrimitiveOperationManager.Self.MultiplyObjects(currentValue, customVariable.DefaultValue); ((IAssignableReference)reference).CurrentValue = addedResult; wasAssigned = true; } else if (assignOperator == AssignmentOperatorType.Divide) { object currentValue = ((IAssignableReference)reference).CurrentValue; object addedResult = PrimitiveOperationManager.Self.DivideObjects(currentValue, customVariable.DefaultValue); ((IAssignableReference)reference).CurrentValue = addedResult; wasAssigned = true; } } return wasAssigned; }
void AssignmentOperator( //#line 1410 "cs.ATG" out AssignmentOperatorType op) { //#line 1411 "cs.ATG" op = AssignmentOperatorType.None; if (la.kind == 3) { lexer.NextToken(); //#line 1413 "cs.ATG" op = AssignmentOperatorType.Assign; } else if (la.kind == 38) { lexer.NextToken(); //#line 1414 "cs.ATG" op = AssignmentOperatorType.Add; } else if (la.kind == 39) { lexer.NextToken(); //#line 1415 "cs.ATG" op = AssignmentOperatorType.Subtract; } else if (la.kind == 40) { lexer.NextToken(); //#line 1416 "cs.ATG" op = AssignmentOperatorType.Multiply; } else if (la.kind == 41) { lexer.NextToken(); //#line 1417 "cs.ATG" op = AssignmentOperatorType.Divide; } else if (la.kind == 42) { lexer.NextToken(); //#line 1418 "cs.ATG" op = AssignmentOperatorType.Modulus; } else if (la.kind == 43) { lexer.NextToken(); //#line 1419 "cs.ATG" op = AssignmentOperatorType.BitwiseAnd; } else if (la.kind == 44) { lexer.NextToken(); //#line 1420 "cs.ATG" op = AssignmentOperatorType.BitwiseOr; } else if (la.kind == 45) { lexer.NextToken(); //#line 1421 "cs.ATG" op = AssignmentOperatorType.ExclusiveOr; } else if (la.kind == 46) { lexer.NextToken(); //#line 1422 "cs.ATG" op = AssignmentOperatorType.ShiftLeft; } else if ( //#line 1423 "cs.ATG" la.kind == Tokens.GreaterThan && Peek(1).kind == Tokens.GreaterEqual) { Expect(22); Expect(35); //#line 1424 "cs.ATG" op = AssignmentOperatorType.ShiftRight; } else SynErr(193); }
static IfElseStatement ConvertAssignment(Expression target, AssignmentOperatorType op, ConditionalExpression conditionalExpr) { var trueAssignment = new AssignmentExpression (target.Clone (), op, conditionalExpr.TrueExpression.Clone ()); var falseAssignment = new AssignmentExpression (target.Clone (), op, conditionalExpr.FalseExpression.Clone ()); return new IfElseStatement (conditionalExpr.Condition.Clone (), new ExpressionStatement (trueAssignment), new ExpressionStatement (falseAssignment)); }
public ResolveResult ResolveAssignment(AssignmentOperatorType op, ResolveResult lhs, ResolveResult rhs) { var linqOp = AssignmentExpression.GetLinqNodeType(op, this.CheckForOverflow); var bop = AssignmentExpression.GetCorrespondingBinaryOperator(op); if (bop == null) { return new OperatorResolveResult(lhs.Type, linqOp, lhs, this.Convert(rhs, lhs.Type)); } ResolveResult bopResult = ResolveBinaryOperator(bop.Value, lhs, rhs); OperatorResolveResult opResult = bopResult as OperatorResolveResult; if (opResult == null || opResult.Operands.Count != 2) return bopResult; return new OperatorResolveResult(lhs.Type, linqOp, opResult.UserDefinedOperatorMethod, opResult.IsLiftedOperator, new [] { lhs, opResult.Operands[1] }); }
public AssignmentExpression(Expression left, AssignmentOperatorType op, Expression right) { this.Left = left; this.Operator = op; this.Right = right; }
void AssignmentOperator( #line 1569 "VBNET.ATG" out AssignmentOperatorType op) { #line 1570 "VBNET.ATG" op = AssignmentOperatorType.None; switch (la.kind) { case 11: { lexer.NextToken(); #line 1571 "VBNET.ATG" op = AssignmentOperatorType.Assign; break; } case 41: { lexer.NextToken(); #line 1572 "VBNET.ATG" op = AssignmentOperatorType.ConcatString; break; } case 33: { lexer.NextToken(); #line 1573 "VBNET.ATG" op = AssignmentOperatorType.Add; break; } case 35: { lexer.NextToken(); #line 1574 "VBNET.ATG" op = AssignmentOperatorType.Subtract; break; } case 36: { lexer.NextToken(); #line 1575 "VBNET.ATG" op = AssignmentOperatorType.Multiply; break; } case 37: { lexer.NextToken(); #line 1576 "VBNET.ATG" op = AssignmentOperatorType.Divide; break; } case 38: { lexer.NextToken(); #line 1577 "VBNET.ATG" op = AssignmentOperatorType.DivideInteger; break; } case 34: { lexer.NextToken(); #line 1578 "VBNET.ATG" op = AssignmentOperatorType.Power; break; } case 39: { lexer.NextToken(); #line 1579 "VBNET.ATG" op = AssignmentOperatorType.ShiftLeft; break; } case 40: { lexer.NextToken(); #line 1580 "VBNET.ATG" op = AssignmentOperatorType.ShiftRight; break; } default: SynErr(239); break; } }
Expression ConvertAssignmentOperator(InvocationExpression invocation, AssignmentOperatorType op, bool? isChecked = null) { return NotSupported(invocation); }
void AssignmentOperator( #line 1430 "cs.ATG" out AssignmentOperatorType op) { #line 1431 "cs.ATG" op = AssignmentOperatorType.None; if (la.kind == 3) { lexer.NextToken(); #line 1433 "cs.ATG" op = AssignmentOperatorType.Assign; } else if (la.kind == 38) { lexer.NextToken(); #line 1434 "cs.ATG" op = AssignmentOperatorType.Add; } else if (la.kind == 39) { lexer.NextToken(); #line 1435 "cs.ATG" op = AssignmentOperatorType.Subtract; } else if (la.kind == 40) { lexer.NextToken(); #line 1436 "cs.ATG" op = AssignmentOperatorType.Multiply; } else if (la.kind == 41) { lexer.NextToken(); #line 1437 "cs.ATG" op = AssignmentOperatorType.Divide; } else if (la.kind == 42) { lexer.NextToken(); #line 1438 "cs.ATG" op = AssignmentOperatorType.Modulus; } else if (la.kind == 43) { lexer.NextToken(); #line 1439 "cs.ATG" op = AssignmentOperatorType.BitwiseAnd; } else if (la.kind == 44) { lexer.NextToken(); #line 1440 "cs.ATG" op = AssignmentOperatorType.BitwiseOr; } else if (la.kind == 45) { lexer.NextToken(); #line 1441 "cs.ATG" op = AssignmentOperatorType.ExclusiveOr; } else if (la.kind == 46) { lexer.NextToken(); #line 1442 "cs.ATG" op = AssignmentOperatorType.ShiftLeft; } else if ( #line 1443 "cs.ATG" la.kind == Tokens.GreaterThan && Peek(1).kind == Tokens.GreaterEqual) { Expect(22); Expect(35); #line 1444 "cs.ATG" op = AssignmentOperatorType.ShiftRight; } else SynErr(195); }
public static BinaryOperatorType TypeOfAssignment(AssignmentOperatorType operatorType) { switch (operatorType) { case AssignmentOperatorType.Assign: return BinaryOperatorType.Any; case AssignmentOperatorType.Add: return BinaryOperatorType.Add; case AssignmentOperatorType.Subtract: return BinaryOperatorType.Subtract; case AssignmentOperatorType.Multiply: return BinaryOperatorType.Multiply; case AssignmentOperatorType.Divide: return BinaryOperatorType.Divide; case AssignmentOperatorType.Modulus: return BinaryOperatorType.Modulus; case AssignmentOperatorType.ShiftLeft: return BinaryOperatorType.ShiftLeft; case AssignmentOperatorType.ShiftRight: return BinaryOperatorType.ShiftRight; case AssignmentOperatorType.BitwiseAnd: return BinaryOperatorType.BitwiseAnd; case AssignmentOperatorType.BitwiseOr: return BinaryOperatorType.BitwiseOr; case AssignmentOperatorType.ExclusiveOr: return BinaryOperatorType.ExclusiveOr; case AssignmentOperatorType.Any: return BinaryOperatorType.Any; default: throw new ArgumentOutOfRangeException("operatorType", operatorType, null); } }
Expression ConvertAssignmentOperator(InvocationExpression invocation, AssignmentOperatorType op, bool?isChecked = null) { return(NotSupported(invocation)); }
static bool IsBitwiseOperator (AssignmentOperatorType op) { return op == AssignmentOperatorType.BitwiseAnd || op == AssignmentOperatorType.BitwiseOr || op == AssignmentOperatorType.ExclusiveOr; }
public static AssignmentExpression assign_To(this Expression left, AssignmentOperatorType assignmentOperator, Expression right) { return new AssignmentExpression(left, assignmentOperator, right); }
void AssignmentOperator( #line 1478 "VBNET.ATG" out AssignmentOperatorType op) { #line 1479 "VBNET.ATG" op = AssignmentOperatorType.None; switch (la.kind) { case 11: { lexer.NextToken(); #line 1480 "VBNET.ATG" op = AssignmentOperatorType.Assign; break; } case 42: { lexer.NextToken(); #line 1481 "VBNET.ATG" op = AssignmentOperatorType.ConcatString; break; } case 34: { lexer.NextToken(); #line 1482 "VBNET.ATG" op = AssignmentOperatorType.Add; break; } case 36: { lexer.NextToken(); #line 1483 "VBNET.ATG" op = AssignmentOperatorType.Subtract; break; } case 37: { lexer.NextToken(); #line 1484 "VBNET.ATG" op = AssignmentOperatorType.Multiply; break; } case 38: { lexer.NextToken(); #line 1485 "VBNET.ATG" op = AssignmentOperatorType.Divide; break; } case 39: { lexer.NextToken(); #line 1486 "VBNET.ATG" op = AssignmentOperatorType.DivideInteger; break; } case 35: { lexer.NextToken(); #line 1487 "VBNET.ATG" op = AssignmentOperatorType.Power; break; } case 40: { lexer.NextToken(); #line 1488 "VBNET.ATG" op = AssignmentOperatorType.ShiftLeft; break; } case 41: { lexer.NextToken(); #line 1489 "VBNET.ATG" op = AssignmentOperatorType.ShiftRight; break; } default: SynErr(216); break; } }
void AssignmentOperator( #line 1487 "cs.ATG" out AssignmentOperatorType op) { #line 1488 "cs.ATG" op = AssignmentOperatorType.None; switch (la.kind) { case 3: { lexer.NextToken(); #line 1490 "cs.ATG" op = AssignmentOperatorType.Assign; break; } case 37: { lexer.NextToken(); #line 1491 "cs.ATG" op = AssignmentOperatorType.Add; break; } case 38: { lexer.NextToken(); #line 1492 "cs.ATG" op = AssignmentOperatorType.Subtract; break; } case 39: { lexer.NextToken(); #line 1493 "cs.ATG" op = AssignmentOperatorType.Multiply; break; } case 40: { lexer.NextToken(); #line 1494 "cs.ATG" op = AssignmentOperatorType.Divide; break; } case 41: { lexer.NextToken(); #line 1495 "cs.ATG" op = AssignmentOperatorType.Modulus; break; } case 42: { lexer.NextToken(); #line 1496 "cs.ATG" op = AssignmentOperatorType.BitwiseAnd; break; } case 43: { lexer.NextToken(); #line 1497 "cs.ATG" op = AssignmentOperatorType.BitwiseOr; break; } case 44: { lexer.NextToken(); #line 1498 "cs.ATG" op = AssignmentOperatorType.ExclusiveOr; break; } case 45: { lexer.NextToken(); #line 1499 "cs.ATG" op = AssignmentOperatorType.ShiftLeft; break; } case 46: { lexer.NextToken(); #line 1500 "cs.ATG" op = AssignmentOperatorType.ShiftRight; break; } default: SynErr(167); break; } }
public AssignmentExpression(Expression left, AssignmentOperatorType op, Expression right) { }
static bool IsBitwiseOperator(AssignmentOperatorType op) { return(op == AssignmentOperatorType.BitwiseAnd || op == AssignmentOperatorType.BitwiseOr || op == AssignmentOperatorType.ExclusiveOr); }
public AssignmentExpression(Expression left, AssignmentOperatorType op, Expression right) { this.left = left; this.op = op; this.right = right; }
void AssignmentOperator( //#line 1678 "VBNET.ATG" out AssignmentOperatorType op) { //#line 1679 "VBNET.ATG" op = AssignmentOperatorType.None; switch (la.kind) { case 20: { lexer.NextToken(); //#line 1680 "VBNET.ATG" op = AssignmentOperatorType.Assign; break; } case 54: { lexer.NextToken(); //#line 1681 "VBNET.ATG" op = AssignmentOperatorType.ConcatString; break; } case 46: { lexer.NextToken(); //#line 1682 "VBNET.ATG" op = AssignmentOperatorType.Add; break; } case 48: { lexer.NextToken(); //#line 1683 "VBNET.ATG" op = AssignmentOperatorType.Subtract; break; } case 49: { lexer.NextToken(); //#line 1684 "VBNET.ATG" op = AssignmentOperatorType.Multiply; break; } case 50: { lexer.NextToken(); //#line 1685 "VBNET.ATG" op = AssignmentOperatorType.Divide; break; } case 51: { lexer.NextToken(); //#line 1686 "VBNET.ATG" op = AssignmentOperatorType.DivideInteger; break; } case 47: { lexer.NextToken(); //#line 1687 "VBNET.ATG" op = AssignmentOperatorType.Power; break; } case 52: { lexer.NextToken(); //#line 1688 "VBNET.ATG" op = AssignmentOperatorType.ShiftLeft; break; } case 53: { lexer.NextToken(); //#line 1689 "VBNET.ATG" op = AssignmentOperatorType.ShiftRight; break; } default: SynErr(277); break; } }
void AssignmentOperator(out AssignmentOperatorType op) { op = AssignmentOperatorType.None; switch (la.kind) { case 20: { Get(); op = AssignmentOperatorType.Assign; break; } case 54: { Get(); op = AssignmentOperatorType.ConcatString; break; } case 46: { Get(); op = AssignmentOperatorType.Add; break; } case 48: { Get(); op = AssignmentOperatorType.Subtract; break; } case 49: { Get(); op = AssignmentOperatorType.Multiply; break; } case 50: { Get(); op = AssignmentOperatorType.Divide; break; } case 51: { Get(); op = AssignmentOperatorType.DivideInteger; break; } case 47: { Get(); op = AssignmentOperatorType.Power; break; } case 52: { Get(); op = AssignmentOperatorType.ShiftLeft; break; } case 53: { Get(); op = AssignmentOperatorType.ShiftRight; break; } default: SynErr(279); break; } }