Пример #1
0
        /// <summary>
        /// Visits the specified method.
        /// </summary>
        /// <param name="method">The method.</param>
        public void Visit(AbstractMethod method)
        {
            if (method == null)
            {
                throw new ArgumentNullException("method");
            }
            indent();
            string returnName = method.NameAndReturn.VariableType == null ? "void" : method.NameAndReturn.VariableType.Name;

            writer.Write("{0} {1} {2} (", method.Prefix, returnName, method.NameAndReturn.Name);
            bool isFirst = true;

            foreach (AbstractParameter parameter in method.Parameters)
            {
                if (isFirst)
                {
                    isFirst = false;
                }
                else
                {
                    writer.Write(", ");
                }

                parameter.Accept(this);
            }
            writer.WriteLine(")");
            renderBody(method.Body);
        }
        /// <summary>
        /// Visits the specified method.
        /// </summary>
        /// <param name="method">The method.</param>
        public void Visit(AbstractMethod method)
        {
            if (method == null)
                throw new ArgumentNullException("method");
            indent();
            string returnName = method.NameAndReturn.VariableType == null ? "void" : method.NameAndReturn.VariableType.Name;
            writer.Write("{0} {1} {2} (", method.Prefix, returnName, method.NameAndReturn.Name);
            bool isFirst = true;
            foreach (AbstractParameter parameter in method.Parameters)
            {
                if (isFirst)
                    isFirst = false;
                else
                    writer.Write(", ");

                parameter.Accept(this);
            }
            writer.WriteLine(")");
            renderBody(method.Body);
        }