private void RemoveChoice(SymbolV symbolV)
        {
            ConcatenationD concatD = symbolV.getReference().Parent as ConcatenationD;
            if (concatD == null)
                throw new Exception("The symbol does not have a parent of type concatenationD");

            model.Functions.Delete(concatD);

            view.Functions.Delete(concatD);

            ReDraw();
        }
        private void DoubleClick(SymbolV symbolV)
        {
            if (symbolV is NonterminalTailV)
            {
                NonterminalTailV nontTail = symbolV as NonterminalTailV;

                model.setStartSymbol(nontTail.Name);

                ReDraw();
            }
        }
        public void AddChoice(SymbolV symbolV)
        {
            GrammarNodeVAddChoiceVisitor visitor = new GrammarNodeVAddChoiceVisitor(symbolV.getReference());

            startSymbol.accept(visitor);
        }
        private void Init(SymbolV ruleIn, UserControl visualisedSymbolsIn, bool isStartSymbolIn)
        {
            visualisedSymbols = visualisedSymbolsIn;
            isStartSymbol = isStartSymbolIn;

            if (isStartSymbol)
            {
                referenceHead = (NonterminalHeadV)ruleIn;
                referenceTail = null;

                setName(referenceHead.Name);

                this.Background = Global.Settings.getBrush(0);

                collapseBtn.Visibility = Visibility.Collapsed;

                if (referenceHead.Reference.IsSelected)
                    SetBorderThickness(2.0);

                rightClickMenu.Visibility = Visibility.Collapsed;
            }
            else
            {
                referenceHead = null;
                referenceTail = (NonterminalTailV)ruleIn;

                if ((referenceTail.Reference.Parent.Parent as OperationD).Children.Count == 1)
                    rightClickMenu.Items.Remove(removeChoice);

                setName(referenceTail.Name);

                this.Background = Global.Settings.getBrush(referenceTail.Level);

                if (referenceTail.Reference.Reference.IsSelected)
                    SetBorderThickness(2.0);
            }

            // change direction of nont chilren if necessary
            if (ruleIn.Direction)
            {
                // draw top to bottom
                stackPanelOuter.Orientation = Orientation.Horizontal;
                stackPanelHeading.Orientation = Orientation.Vertical;
                stackPanelInner.Orientation = Orientation.Vertical;
                stackPanelName.Orientation = Orientation.Horizontal;
                arrow_down.Visibility = Visibility.Visible;
                arrow_right.Visibility = Visibility.Collapsed;
            }

            // add child to GUI
            stackPanelInner.Children.Remove(holder);
            stackPanelInner.Children.Add(visualisedSymbols);

            // let the controller hear me y'all
            ViewController.ViewListener.Listen(this);
        }
        public void AddBefore(SymbolV symbolV, GrammarNodeD itemToAdd)
        {
            GrammarNodeVAddBeforeVisitor visitor = new GrammarNodeVAddBeforeVisitor(symbolV, itemToAdd);

            startSymbol.accept(visitor);
        }