//--------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- namespace System.Data.Common.EntitySql.AST { using System; using System.Globalization; using System.Collections; using System.Collections.Generic; /// /// Represents an ast node for an inline function definition. /// internal sealed class FunctionDefinition : Node { private readonly Identifier _name; private readonly NodeList _paramDefList; private readonly Node _body; private readonly int _startPosition; private readonly int _endPosition; /// /// Initializes function definition using the name, the optional argument definitions and the body expression. /// internal FunctionDefinition(Identifier name, NodeList argDefList, Node body, int startPosition, int endPosition) { this._name = name; this._paramDefList = argDefList; this._body = body; this._startPosition = startPosition; this._endPosition = endPosition; } /// /// Returns function name. /// internal string Name { get { return this._name.Name; } } /// /// Returns optional parameter definition list. May be null. /// internal NodeList Parameters { get { return this._paramDefList; } } /// /// Returns function body. /// internal Node Body { get { return this._body; } } /// /// Returns start position of the function definition in the command text. /// internal int StartPosition { get { return this._startPosition; } } /// /// Returns end position of the function definition in the command text. /// internal int EndPosition { get { return this._endPosition; } } } }