66 references to Precedence
Microsoft.ML.Transforms (66)
Expression\LambdaParser.cs (32)
443
return ParseExpr(
Precedence
.None);
447
private ExprNode ParseExpr(
Precedence
precMin)
451
Contracts.Assert(
Precedence
.None <= precMin);
452
Contracts.Assert(precMin <=
Precedence
.PrefixUnary);
464
Contracts.Assert(precMin <=
Precedence
.Power);
466
node = new BinaryOpNode(TokMove(), BinaryOp.Power, node, ParseExpr(
Precedence
.PrefixUnary));
470
if (precMin >
Precedence
.Mul)
472
node = new BinaryOpNode(TokMove(), BinaryOp.Mul, node, ParseExpr(
Precedence
.Mul + 1));
475
if (precMin >
Precedence
.Mul)
477
node = new BinaryOpNode(TokMove(), BinaryOp.Div, node, ParseExpr(
Precedence
.Mul + 1));
480
if (precMin >
Precedence
.Mul)
482
node = new BinaryOpNode(TokMove(), BinaryOp.Mod, node, ParseExpr(
Precedence
.Mul + 1));
486
if (precMin >
Precedence
.Add)
488
node = new BinaryOpNode(TokMove(), BinaryOp.Sub, node, ParseExpr(
Precedence
.Add + 1));
491
if (precMin >
Precedence
.Add)
493
node = new BinaryOpNode(TokMove(), BinaryOp.Add, node, ParseExpr(
Precedence
.Add + 1));
498
if (precMin >
Precedence
.And)
500
node = new BinaryOpNode(TokMove(), BinaryOp.And, node, ParseExpr(
Precedence
.And + 1));
504
if (precMin >
Precedence
.Or)
506
node = new BinaryOpNode(TokMove(), BinaryOp.Or, node, ParseExpr(
Precedence
.Or + 1));
510
if (precMin >
Precedence
.Coalesce)
514
node = new BinaryOpNode(TokMove(), BinaryOp.Coalesce, node, ParseExpr(
Precedence
.Coalesce));
518
if (precMin >
Precedence
.Conditional)
528
if (precMin >
Precedence
.Compare)
535
if (precMin >
Precedence
.Compare)
544
if (precMin >
Precedence
.Compare)
553
if (precMin >
Precedence
.Compare)
566
node = new BinaryOpNode(TokCur, BinaryOp.Error, node, ParseExpr(
Precedence
.Error));
585
return new UnaryOpNode(TokMove(), UnaryOp.Minus, ParseExpr(
Precedence
.PrefixUnary));
590
return new UnaryOpNode(TokMove(), UnaryOp.Not, ParseExpr(
Precedence
.PrefixUnary));
639
list.Add(ParseExpr(
Precedence
.Compare + 1));
708
ExprNode node = ParseExpr(
Precedence
.None);
Expression\Printer.cs (34)
45
private bool NeedParensLeft(
Precedence
precLeft,
Precedence
precOp)
53
return precOp ==
Precedence
.Power;
56
private bool NeedParensRight(
Precedence
precOp,
Precedence
precRight)
58
if (precOp ==
Precedence
.Postfix)
71
return precOp !=
Precedence
.Power;
74
private
Precedence
GetPrec(Node node)
84
return
Precedence
.PrefixUnary;
87
return
Precedence
.Compare;
91
return
Precedence
.Primary;
97
return
Precedence
.Atomic;
101
return
Precedence
.None;
105
private
Precedence
GetPrec(BinaryOp op)
110
return
Precedence
.Or;
112
return
Precedence
.And;
115
return
Precedence
.Add;
119
return
Precedence
.Mul;
121
return
Precedence
.Power;
123
return
Precedence
.None;
126
return
Precedence
.None;
393
Precedence
prec = GetPrec(node.Arg);
395
if (prec <
Precedence
.PrefixUnary)
398
if (prec <
Precedence
.PrefixUnary)
410
Precedence
prec = GetPrec(node.Op);
411
Precedence
prec1 = GetPrec(node.Left);
412
Precedence
prec2 = GetPrec(node.Right);
440
Precedence
prec0 = GetPrec(node.Cond);
441
Precedence
prec1 = GetPrec(node.Left);
442
Precedence
prec2 = GetPrec(node.Right);
443
bool parens0 = NeedParensLeft(prec0,
Precedence
.Conditional);
477
var
prec = GetPrec(arg);
478
if (prec <=
Precedence
.Compare)
481
if (prec <=
Precedence
.Compare)