static List <Node> flatten(ExpressionTreeNode root)
            {
                List <Node>        nodes   = new List <Node>();
                ExpressionTreeNode flatten = root;

                while (true)
                {
                    nodes.Add(flatten.Tree[0]);
                    if (flatten.Tree.Length == 2)
                    {
                        if (flatten.Tree[1] is ExpressionTreeNode)
                        {
                            flatten = (ExpressionTreeNode)flatten.Tree[1];
                        }
                        else
                        {
                            nodes.Add(flatten.Tree[1]);
                            break;
                        }
                    }
                }
                return(nodes);
            }
        public override Node VisitExpr(DeltinScriptParser.ExprContext context)
        {
            Node node;

            // Operations
            if (context.ChildCount == 3 && Constants.AllOperations.Contains(context.GetChild(1).GetText()))
            {
                Node   left      = Visit(context.GetChild(0));
                string operation = context.GetChild(1).GetText();
                Node   right     = Visit(context.GetChild(2));

                node = new OperationNode(left, operation, right, new Location(file, Range.GetRange(context)));
            }

            // Getting values in arrays
            else if (context.ChildCount == 4 &&
                     context.GetChild(0) is DeltinScriptParser.ExprContext &&
                     context.GetChild(1).GetText() == "[" &&
                     context.GetChild(2) is DeltinScriptParser.ExprContext &&
                     context.GetChild(3).GetText() == "]")
            {
                Node value = Visit(context.GetChild(0));
                Node index = Visit(context.GetChild(2));

                node = new ValueInArrayNode(value, index, new Location(file, Range.GetRange(context)));
            }

            // Seperator
            else if (context.SEPERATOR() != null && context.expr().Length >= 2)
            {
                node = new ExpressionTreeNode(context, this);
            }

            // Not
            else if (context.ChildCount == 2 &&
                     context.GetChild(0).GetText() == "!" &&
                     context.GetChild(1) is DeltinScriptParser.ExprContext)
            {
                Node value = Visit(context.GetChild(1));
                node = new NotNode(value, new Location(file, Range.GetRange(context)));
            }

            // Ternary Condition
            else if (context.ChildCount == 5 &&
                     context.GetChild(0) is DeltinScriptParser.ExprContext &&
                     context.GetChild(1).GetText() == "?" &&
                     context.GetChild(2) is DeltinScriptParser.ExprContext &&
                     context.GetChild(3).GetText() == ":" &&
                     context.GetChild(4) is DeltinScriptParser.ExprContext)
            {
                Node condition   = VisitExpr(context.expr(0));
                Node consequent  = VisitExpr(context.expr(1));
                Node alternative = VisitExpr(context.expr(2));
                node = new TernaryConditionalNode(condition, consequent, alternative, new Location(file, Range.GetRange(context)));
            }

            // This
            else if (context.THIS() != null)
            {
                node = new ThisNode(new Location(file, Range.GetRange(context)));
            }

            else
            {
                return(Visit(context.GetChild(0)));
            }

            return(node);
        }