NArrange.VisualBasic.VBParser.ParseAttribute C# (CSharp) Method

ParseAttribute() private method

Parses an attribute.
private ParseAttribute ( ReadOnlyCollection comments, bool nested ) : AttributeElement
comments ReadOnlyCollection The comments.
nested bool Whether or not the attribute is nested/chained.
return NArrange.Core.CodeElements.AttributeElement
        private AttributeElement ParseAttribute(ReadOnlyCollection<ICommentElement> comments, bool nested)
        {
            AttributeElement attributeElement = new AttributeElement();

            string typeName = CaptureTypeName(false);
            EatLineContinuation();

            //
            // Check for an attribute target
            //
            if (TryReadChar(VBSymbol.LineDelimiter))
            {
                attributeElement.Target = typeName;
                typeName = CaptureTypeName(false);
                EatLineContinuation();
            }

            attributeElement.Name = typeName;

            if (NextChar == VBSymbol.BeginParameterList)
            {
                string attributeText = ParseNestedText(
                    VBSymbol.BeginParameterList, VBSymbol.EndParameterList, true, true);
                attributeElement.BodyText = attributeText;
            }

            EatLineContinuation();

            while (!nested && TryReadChar(VBSymbol.AliasSeparator))
            {
                if (NextChar != VBSymbol.AliasSeparator)
                {
                    AttributeElement childAttributeElement = ParseAttribute(null, true);
                    if (string.IsNullOrEmpty(childAttributeElement.Target))
                    {
                        childAttributeElement.Target = attributeElement.Target;
                    }
                    attributeElement.AddChild(childAttributeElement);
                }
            }

            EatLineContinuation();

            if (!nested)
            {
                EatChar(VBSymbol.EndAttribute);
            }

            if (comments != null && comments.Count > 0)
            {
                foreach (ICommentElement comment in comments)
                {
                    attributeElement.AddHeaderComment(comment);
                }
            }

            return attributeElement;
        }

Same methods

VBParser::ParseAttribute ( ReadOnlyCollection comments ) : AttributeElement