本文整理汇总了C#中AssignmentOperatorType类的典型用法代码示例。如果您正苦于以下问题:C# AssignmentOperatorType类的具体用法?C# AssignmentOperatorType怎么用?C# AssignmentOperatorType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AssignmentOperatorType类属于命名空间,在下文中一共展示了AssignmentOperatorType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestAssignmentExpression
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);
}
示例2: TestAssignmentExpression
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);
}
示例3: assign_To
public static AssignmentExpression assign_To(this Expression left, AssignmentOperatorType assignmentOperator, Expression right)
{
return new AssignmentExpression(left, assignmentOperator, right);
}
示例4: AssignmentExpression
public AssignmentExpression(Expression left, AssignmentOperatorType op, Expression right) {
Left = left;
Op = op;
Right = right;
}
示例5: AssignmentOperator
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;
}
}
示例6: AssignmentOperator
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;
}
}
示例7: AssignmentOperator
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);
}
示例8: TypeOfAssignment
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);
}
}
示例9: ConvertAssignment
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));
}
示例10: AssignmentOperator
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;
}
}
示例11: AssignmentExpression
public AssignmentExpression(Expression left, AssignmentOperatorType op, Expression right)
{
this.left = left;
this.op = op;
this.right = right;
}
示例12: AssignmentOperator
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);
}
}
示例13: ConvertOperator
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;
}
}
示例14: AssignmentOperator
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;
}
}
示例15: IsBitwiseOperator
static bool IsBitwiseOperator (AssignmentOperatorType op)
{
return op == AssignmentOperatorType.BitwiseAnd || op == AssignmentOperatorType.BitwiseOr ||
op == AssignmentOperatorType.ExclusiveOr;
}