private Element GetTargetElement(AendringDefinitionGrammarParser.InsertAfterChainExpContext context)
        {
            //return null;
            var firstContext = context.elementChainExp()?.Accept(new ElementChainVisitor());
            var lastContext = context.lastElementExp()?.Accept(new ElementVisitor());
            var chain = new[] { firstContext, lastContext }.Where(element => element != null).ToArray();

            return(SetupParentChain(chain));
        }
        public override AendringDefinition VisitInsertAfterChainExp(AendringDefinitionGrammarParser.InsertAfterChainExpContext context)
        {
            var target = GetTargetElement(context);

            if (context.quotedTextChangeExp() != null)
            {
                target.SubElementTargets = new[] { context.quotedTextChangeExp().Accept(SubElementTargetVisitor.NewInstance) }
            }
            ;
            return(BuildAendringDefintion(target, AktionType.IndsaetEfter));
        }