/// <summary>
        /// Constructs a parse tree for a namespace VBConverter.CodeParser.declaration.
        /// </summary>
        /// <param name="attributes">The attributes on the declaration.</param>
        /// <param name="modifiers">The modifiers on the declaration.</param>
        /// <param name="namespaceLocation">The location of 'Namespace'.</param>
        /// <param name="name">The name of the namespace.</param>
        /// <param name="declarations">The declarations in the namespace.</param>
        /// <param name="endDeclaration">The End Namespace statement, if any.</param>
        /// <param name="span">The location of the parse tree.</param>
        /// <param name="comments">The comments for the parse tree.</param>
        public NamespaceDeclaration(AttributeBlockCollection attributes, ModifierCollection modifiers, Location namespaceLocation, Name name, DeclarationCollection declarations, EndBlockDeclaration endDeclaration, Span span, IList <Comment> comments) : base(TreeType.NamespaceDeclaration, attributes, modifiers, span, comments)
        {
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }

            SetParent(name);
            SetParent(declarations);
            SetParent(endDeclaration);

            _NamespaceLocation = namespaceLocation;
            _Name           = name;
            _Declarations   = declarations;
            _EndDeclaration = endDeclaration;
        }
Пример #2
0
        protected BlockDeclaration(TreeType type, AttributeBlockCollection attributes, ModifierCollection modifiers, Location keywordLocation, SimpleName name, DeclarationCollection declarations, EndBlockDeclaration endDeclaration, Span span, IList <Comment> comments) : base(type, attributes, modifiers, span, comments)
        {
            Debug.Assert(type == TreeType.ClassDeclaration || type == TreeType.ModuleDeclaration || type == TreeType.InterfaceDeclaration || type == TreeType.StructureDeclaration || type == TreeType.EnumDeclaration);

            if (name == null)
            {
                throw new ArgumentNullException("name");
            }

            SetParent(name);
            SetParent(declarations);
            SetParent(endDeclaration);

            _KeywordLocation = keywordLocation;
            _Name            = name;
            _Declarations    = declarations;
            _EndDeclaration  = endDeclaration;
        }
Пример #3
0
 /// <summary>
 /// Constructs a new parse tree for a Class declaration.
 /// </summary>
 /// <param name="attributes">The attributes for the parse tree.</param>
 /// <param name="modifiers">The modifiers for the parse tree.</param>
 /// <param name="keywordLocation">The location of the keyword.</param>
 /// <param name="name">The name of the declaration.</param>
 /// <param name="typeParameters">The type parameters of the type, if any.</param>
 /// <param name="declarations">The declarations in the block.</param>
 /// <param name="endStatement">The end block declaration, if any.</param>
 /// <param name="span">The location of the parse tree.</param>
 /// <param name="comments">The comments for the parse tree.</param>
 public ClassDeclaration(AttributeBlockCollection attributes, ModifierCollection modifiers, Location keywordLocation, SimpleName name, TypeParameterCollection typeParameters, DeclarationCollection declarations, EndBlockDeclaration endStatement, Span span, IList <Comment> comments) : base(TreeType.ClassDeclaration, attributes, modifiers, keywordLocation, name, typeParameters, declarations, endStatement, span, comments
                                                                                                                                                                                                                                                                                                 )
 {
 }
Пример #4
0
        /// <summary>
        /// Constructs a parse tree for an Enum declaration.
        /// </summary>
        /// <param name="attributes">The attributes for the parse tree.</param>
        /// <param name="modifiers">The modifiers for the parse tree.</param>
        /// <param name="keywordLocation">The location of the keyword.</param>
        /// <param name="name">The name of the declaration.</param>
        /// <param name="asLocation">The location of the 'As', if any.</param>
        /// <param name="elementType">The element type of the enumerated type, if any.</param>
        /// <param name="declarations">The enumerated values.</param>
        /// <param name="endStatement">The end block declaration, if any.</param>
        /// <param name="span">The location of the parse tree.</param>
        /// <param name="comments">The comments for the parse tree.</param>
        public EnumDeclaration(AttributeBlockCollection attributes, ModifierCollection modifiers, Location keywordLocation, SimpleName name, Location asLocation, TypeName elementType, DeclarationCollection declarations, EndBlockDeclaration endStatement, Span span, IList <Comment> comments
                               ) : base(TreeType.EnumDeclaration, attributes, modifiers, keywordLocation, name, declarations, endStatement, span, comments)
        {
            SetParent(elementType);

            _AsLocation  = asLocation;
            _ElementType = elementType;
        }
        protected GenericBlockDeclaration(TreeType type, AttributeBlockCollection attributes, ModifierCollection modifiers, Location keywordLocation, SimpleName name, TypeParameterCollection typeParameters, DeclarationCollection declarations, EndBlockDeclaration endStatement, Span span, IList <Comment> comments
                                          ) : base(type, attributes, modifiers, keywordLocation, name, declarations, endStatement, span, comments)
        {
            Debug.Assert(type == TreeType.ClassDeclaration || type == TreeType.InterfaceDeclaration || type == TreeType.StructureDeclaration);

            SetParent(typeParameters);
            _TypeParameters = typeParameters;
        }