コード例 #1
0
        /// <summary>
        ///     Visits and event handler usage node during syntax tree traversal.
        /// </summary>
        /// <param name="node">The Syntax Tree Node.</param>
        /// <returns>An object of type (T) from the visitor implementation of this function.</returns>
        public virtual T VisitEventHandler(ILSLEventHandlerNode node)
        {
            Visit(node.ParameterList);
            Visit(node.Code);

            return(default(T));
        }
コード例 #2
0
        /// <summary>
        ///     Build a <see cref="LSLEventSignature" /> object based off the signature of this function declaration node.
        /// </summary>
        /// <param name="eventHandlerNode">The <see cref="ILSLEventHandlerNode"/>.</param>
        /// <returns>The created <see cref="LSLEventSignature" />.</returns>
        /// <exception cref="ArgumentNullException"><paramref name="eventHandlerNode"/> is <see langword="null" />.</exception>
        public static LSLEventSignature CreateSignature(this ILSLEventHandlerNode eventHandlerNode)
        {
            if (eventHandlerNode == null)
            {
                throw new ArgumentNullException("eventHandlerNode");
            }

            return(new LSLEventSignature(eventHandlerNode.Name,
                                         eventHandlerNode.ParameterList.Parameters.Select(x => new LSLParameterSignature(x.Type, x.Name, false))));
        }