Exemplo n.º 1
0
 private static void CheckUnaryOperatorNodeType <TInnerExpression>(UnaryOperatorBindingParserNode node, BindingTokenType operatorType)
     where TInnerExpression : BindingParserNode
 {
     Assert.IsTrue(node.Operator == operatorType);
     Assert.IsTrue(node.InnerExpression is TInnerExpression);
 }
Exemplo n.º 2
0
 private static void CheckBinaryOperatorNodeType <TLeft, TRight>(BinaryOperatorBindingParserNode node, BindingTokenType operatorType)
     where TLeft : BindingParserNode
     where TRight : BindingParserNode
 {
     Assert.IsTrue(node.Operator == operatorType);
     Assert.IsTrue(node.FirstExpression is TLeft);
     Assert.IsTrue(node.SecondExpression is TRight);
 }
Exemplo n.º 3
0
 private static void CheckUnaryOperatorNodeType <TInnerExpression>(UnaryOperatorBindingParserNode node, BindingTokenType operatorType)
     where TInnerExpression : BindingParserNode
 {
     Assert.AreEqual(operatorType, node.Operator);
     Assert.IsInstanceOfType(node.InnerExpression, typeof(TInnerExpression));
 }
Exemplo n.º 4
0
 private static void CheckBinaryOperatorNodeType <TLeft, TRight>(BinaryOperatorBindingParserNode node, BindingTokenType operatorType)
     where TLeft : BindingParserNode
     where TRight : BindingParserNode
 {
     Assert.AreEqual(operatorType, node.Operator);
     Assert.IsInstanceOfType(node.FirstExpression, typeof(TLeft));
     Assert.IsInstanceOfType(node.SecondExpression, typeof(TRight));
 }
 public BinaryOperatorBindingParserNode(BindingParserNode firstExpression, BindingParserNode secondExpression, BindingTokenType @operator)
 {
     FirstExpression  = firstExpression;
     SecondExpression = secondExpression;
     Operator         = @operator;
 }
 public UnaryOperatorBindingParserNode(BindingParserNode innerExpression, BindingTokenType @operator)
 {
     InnerExpression = innerExpression;
     Operator        = @operator;
 }
 public UnaryOperatorBindingParserNode(BindingParserNode innerExpression, BindingTokenType @operator)
 {
     InnerExpression = innerExpression;
     Operator = @operator;
 }
 public BinaryOperatorBindingParserNode(BindingParserNode firstExpression, BindingParserNode secondExpression, BindingTokenType @operator)
 {
     FirstExpression = firstExpression;
     SecondExpression = secondExpression;
     Operator = @operator;
 }
Exemplo n.º 9
0
        public static string ToDisplayString(this BindingTokenType tokenType)
        {
            switch (tokenType)
            {
            case BindingTokenType.WhiteSpace: return(" ");

            case BindingTokenType.Identifier: return("Identifier");

            case BindingTokenType.Dot: return(".");

            case BindingTokenType.Comma: return(",");

            case BindingTokenType.OpenParenthesis: return("(");

            case BindingTokenType.CloseParenthesis: return(")");

            case BindingTokenType.OpenArrayBrace: return("[");

            case BindingTokenType.CloseArrayBrace: return("]");

            case BindingTokenType.AddOperator: return("+");

            case BindingTokenType.SubtractOperator: return("-");

            case BindingTokenType.MultiplyOperator: return("*");

            case BindingTokenType.DivideOperator: return("/");

            case BindingTokenType.ModulusOperator: return("%");

            case BindingTokenType.UnsupportedOperator: return("UnsupportedOp");

            case BindingTokenType.EqualsEqualsOperator: return("==");

            case BindingTokenType.LessThanOperator: return("<");

            case BindingTokenType.LessThanEqualsOperator: return("<=");

            case BindingTokenType.GreaterThanOperator: return(">");

            case BindingTokenType.GreaterThanEqualsOperator: return(">=");

            case BindingTokenType.NotEqualsOperator: return("!=");

            case BindingTokenType.NotOperator: return("!");

            case BindingTokenType.StringLiteralToken: return("Literal");

            case BindingTokenType.NullCoalescingOperator: return("?.");

            case BindingTokenType.QuestionMarkOperator: return("?");

            case BindingTokenType.ColonOperator: return(":");

            case BindingTokenType.AndOperator: return("&");

            case BindingTokenType.AndAlsoOperator: return("&&");

            case BindingTokenType.OrOperator: return("|");

            case BindingTokenType.OrElseOperator: return("||");

            case BindingTokenType.AssignOperator: return("=");

            default: return("Unknown");
            }
        }