public static string Dump(this SBExpression expression)
 {
     if (expression == null)
     {
         return("NO EXPRESSION");
     }
     else
     {
         return($"{expression.GetType().Name}[{expression.StartToken},{expression.EndToken}]:{expression} --> {(expression.HasCompiler() ? expression.Compiler().ToString() : "NO COMPILER")}");
     }
 }
        private static void AttachCompiler(this SBExpression expression, EV3CompilerContext context)
        {
            if (expression == null)
            {
                return;
            }

            if (expression is ArrayExpression)
            {
                expression.AttachCompiler(new ArrayExpressionCompiler((ArrayExpression)expression, context));
            }
            else if (expression is BinaryExpression)
            {
                BinaryExpression binaryExpression = (BinaryExpression)expression;
                if (binaryExpression.IsBooleanOperator())
                {
                    expression.AttachCompiler(new BooleanExpressionCompiler(binaryExpression, context));
                }
                else if (binaryExpression.IsBooleanCompareOperator())
                {
                    expression.AttachCompiler(new ComparisonExpressionCompiler(binaryExpression, context));
                }
                else
                {
                    expression.AttachCompiler(new BinaryExpressionCompiler(binaryExpression, context));
                }
            }
            else if (expression is IdentifierExpression)
            {
                expression.AttachCompiler(new IdentifierExpressionCompiler((IdentifierExpression)expression, context));
            }
            else if (expression is LiteralExpression)
            {
                expression.AttachCompiler(new LiteralExpressionCompiler((LiteralExpression)expression, context));
            }
            else if (expression is MethodCallExpression)
            {
                expression.AttachCompiler(new MethodCallExpressionCompiler((MethodCallExpression)expression, context));
            }
            else if (expression is NegativeExpression)
            {
                expression.AttachCompiler(new NegativeExpressionCompiler((NegativeExpression)expression, context));
            }
            else if (expression is PropertyExpression)
            {
                expression.AttachCompiler(new PropertyExpressionCompiler((PropertyExpression)expression, context));
            }
            else
            {
                throw new Exception("Unknown expression " + expression.GetType().Name);
            }
        }