public ExpressionNode(Expression expr, Node parent)
        {
            Requires.NotNull(expr, nameof(expr));
            Requires.NotNull(parent, nameof(parent));

            this.Expression = expr;
            this.Parent = parent;
        }
        private bool TryParseLine(string line, out Expression expr)
        {
            Requires.NotNull(line, nameof(line));

            expr = null;
            if (CommentExpression.TryParse(line, out expr))
            {
                return true;
            }
            else if (HotkeyExpression.TryParse(line, out expr))
            {
                return true;
            }

            return false;
        }
        public bool ContainsExpression(Expression expr)
        {
            Requires.NotNull(expr, nameof(expr));

            HashSet<Node> visited = new HashSet<Node>(new[] { this.rootNode });
            Queue<Node> nodes = new Queue<Node>(new[] { this.rootNode });

            while (nodes.Any())
            {
                var node = nodes.Dequeue();

                if (node == null)
                {
                    return false;
                }

                var expressionNode = node as ExpressionNode;
                if (expressionNode != null)
                {
                    if (expressionNode.Expression.Equals(expr))
                    {
                        return true;
                    }
                }

                foreach (var child in node.Children)
                {
                    if (!visited.Contains(child))
                    {
                        visited.Add(child);
                        nodes.Enqueue(child);
                    }
                }
            }

            return false;
        }
 public void AddExpression(Expression expr)
 {
     Requires.NotNull(expr, nameof(expr));
     this.rootNode.AddChild(new ExpressionNode(expr, this.rootNode));
 }