예제 #1
0
        public static ObjectIdentifier GetIdentifierFromSqlProcedure(TSqlFragment fragment)
        {
            var identifier    = new ObjectIdentifier();
            var symbolVisitor = new ProcedureObjectNameVisitor(identifier);

            fragment.Accept(symbolVisitor);

            return(identifier);
        }
예제 #2
0
        public ComparedEntity Create(string representation)
        {
            if (representation == null)
            {
                Logger.Error($"{nameof(representation)} is null");
                throw new ArgumentNullException(nameof(representation));
            }

            var parsedFragment = _fragmentFactory.CreateFragment(representation);
            var result         = new ComparedEntity
            {
                Tree           = parsedFragment.Fragment,
                ParseErrors    = parsedFragment.ParseErrors,
                Representation = representation
            };

            var symbolVisitor = new ProcedureObjectNameVisitor(result.Identifier);

            result.Tree.Accept(symbolVisitor);

            return(result);
        }