/// <summary>
        /// Convert the AST
        /// </summary>
        /// <param name="fragment">the sql code </param>
        /// <returns>the AST or null.</returns>
        public SqlNode Transport(ScriptDom.TSqlFragment fragment)
        {
            var astUtiltiy = (new OfaSchlupfer.MSSQLReflection.AST.AstUtility()
            {
                ParserVersion = this.ParserVersion, InitialQuotedIdentifiers = this.InitialQuotedIdentifiers
            });

            return(astUtiltiy.Transport(fragment));
        }
Beispiel #2
0
 /// <summary>
 /// Whether to SKIP analysis for problems.
 /// </summary>
 public static bool IgnoreScriptFragment(Microsoft.SqlServer.TransactSql.ScriptDom.TSqlFragment fragment)
 {
     // external (generated)
     if (fragment is ProcedureStatementBody psb && psb.MethodSpecifier != null)
     {
         return(true);
     }
     return(false);
 }
Beispiel #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SqlNode"/> class.
 /// </summary>
 /// <param name="src">the source.</param>
 public SqlNode(ScriptDom.TSqlFragment src)
 {
     this.Analyse            = new OfaSchlupfer.MSSQLReflection.SqlCode.AnalyseNodeState(this);
     this.SourceTSqlFragment = src;
 }
Beispiel #4
0
 public Issue(ScriptDom.TSqlFragment fragment, IssueLevel level, string message)
 {
     _fragment = fragment;
     _level    = level;
     _message  = message;
 }
Beispiel #5
0
 /// <summary>
 /// Convert the AST
 /// </summary>
 /// <param name="fragment">original AST</param>
 /// <returns>limited AST</returns>
 public SqlNode Transport(ScriptDom.TSqlFragment fragment)
 {
     return(Copier.Copy <SqlNode>(fragment));
 }