/* function */ public void HandleFunction(FunctionStatementBody node) { var outerPreviousScope = this.currentScopeRef.Current; var dbScope = this.currentScopeRef.Current.GetRoot(); var declarationScope = dbScope.CreateChildDeclarationScope("function", dbScope.ScopeNameResolverContext); this.currentScopeRef.Push(declarationScope); // node.Analyse.OutputType this.ExplicitVisit((FunctionStatementBody)node); this.currentScopeRef.Pop(); System.Diagnostics.Debug.Assert(ReferenceEquals(outerPreviousScope, this.currentScopeRef.Current), "previous must be restored."); }
public void ProcessFunctionStatementBody(FunctionStatementBody Function) { if (Function.Name.SchemaIdentifier == null) _smells.SendFeedBack(24, Function.Name); _smells.ProcessTsqlFragment(Function.ReturnType); if (Function.StatementList != null) { foreach (TSqlFragment Statement in Function.StatementList.Statements) { _smells.ProcessTsqlFragment(Statement); } } }
private static Function BuildFunc(FunctionStatementBody funcExpr) => new Function { Name = new[] { funcExpr.Name.DatabaseIdentifier?.Value, funcExpr.Name.SchemaIdentifier?.Value, funcExpr.Name.BaseIdentifier?.Value }.Where(x => x != null).ToArray(), Parameters = funcExpr.Parameters.ToDictionary( x => x.VariableName.Value, x => TranslateDbType(x.DataType)), Statements = funcExpr.StatementList, ReturnType = TranslateDbType(((ScalarFunctionReturnType)funcExpr.ReturnType).DataType) };
public void ProcessFunctionStatementBody(FunctionStatementBody Function) { if (Function.Name.SchemaIdentifier == null) { _smells.SendFeedBack(24, Function.Name); } _smells.ProcessTsqlFragment(Function.ReturnType); if (Function.StatementList != null) { foreach (TSqlFragment Statement in Function.StatementList.Statements) { _smells.ProcessTsqlFragment(Statement); } } }
public override void ExplicitVisit(FunctionStatementBody fragment) { _fragments.Add(fragment); }
public sealed override void ExplicitVisit(FunctionStatementBody node) { base.ExplicitVisit(node); }
public override void ExplicitVisit(FunctionStatementBody node) { this.action(node); }