Example #1
0
 /// <summary>
 /// Creates a new parse tree for a Sub 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 on the declaration, if any.</param>
 /// <param name="parameters">The parameters of the declaration.</param>
 /// <param name="implementsList">The list of implemented members.</param>
 /// <param name="handlesList">The list of handled events.</param>
 /// <param name="statements">The statements in the declaration.</param>
 /// <param name="endDeclaration">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 SubDeclaration(
     AttributeBlockCollection attributes,
     ModifierCollection modifiers,
     Location keywordLocation,
     SimpleName name,
     TypeParameterCollection typeParameters,
     ParameterCollection parameters,
     NameCollection implementsList,
     NameCollection handlesList,
     StatementCollection statements,
     EndBlockDeclaration endDeclaration,
     Span span,
     IList <Comment> comments) :
     base(
         TreeType.SubDeclaration,
         attributes,
         modifiers,
         keywordLocation,
         name,
         typeParameters,
         parameters,
         Location.Empty,
         null,
         null,
         implementsList,
         handlesList,
         statements,
         endDeclaration,
         span,
         comments)
 {
 }
        /// <summary>
        /// Constructs a new parse tree for a Get property accessor.
        /// </summary>
        /// <param name="attributes">The attributes for the parse tree.</param>
        /// <param name="modifiers">The modifiers for the parse tree.</param>
        /// <param name="getLocation">The location of the 'Get'.</param>
        /// <param name="statements">The statements in the declaration.</param>
        /// <param name="endDeclaration">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 GetAccessorDeclaration(AttributeBlockCollection attributes, ModifierCollection modifiers, Location getLocation, StatementCollection statements, EndBlockDeclaration endDeclaration, Span span, IList <Comment> comments) : base(TreeType.GetAccessorDeclaration, attributes, modifiers, span, comments)
        {
            SetParent(statements);
            SetParent(endDeclaration);

            _GetLocation    = getLocation;
            _Statements     = statements;
            _EndDeclaration = endDeclaration;
        }
        /// <summary>
        /// Constructs a new parse tree for a property accessor.
        /// </summary>
        /// <param name="attributes">The attributes for the parse tree.</param>
        /// <param name="raiseEventLocation">The location of the 'RaiseEvent'.</param>
        /// <param name="parameters">The parameters of the declaration.</param>
        /// <param name="statements">The statements in the declaration.</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 RaiseEventAccessorDeclaration(AttributeBlockCollection attributes, Location raiseEventLocation, ParameterCollection parameters, StatementCollection statements, EndBlockDeclaration endStatement, Span span, IList <Comment> comments) : base(TreeType.RaiseEventAccessorDeclaration, attributes, null, span, comments)
        {
            SetParent(parameters);
            SetParent(statements);
            SetParent(endStatement);

            _Parameters         = parameters;
            _RaiseEventLocation = raiseEventLocation;
            _Statements         = statements;
            _EndStatement       = endStatement;
        }
        /// <summary>
        /// Constructs a new parse tree for a custom property declaration.
        /// </summary>
        /// <param name="attributes">The attributes on the declaration.</param>
        /// <param name="modifiers">The modifiers on the declaration.</param>
        /// <param name="customLocation">The location of the 'Custom' keyword.</param>
        /// <param name="keywordLocation">The location of the keyword.</param>
        /// <param name="name">The name of the custom event.</param>
        /// <param name="asLocation">The location of the 'As', if any.</param>
        /// <param name="resultType">The result type, if any.</param>
        /// <param name="implementsList">The implements list.</param>
        /// <param name="accessors">The custom event accessors.</param>
        /// <param name="endDeclaration">The End Event 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 CustomEventDeclaration(AttributeBlockCollection attributes, ModifierCollection modifiers, Location customLocation, Location keywordLocation, SimpleName name, Location asLocation, TypeName resultType, NameCollection implementsList, DeclarationCollection accessors, EndBlockDeclaration endDeclaration,
                                      Span span, IList <Comment> comments) : base(TreeType.CustomEventDeclaration, attributes, modifiers, keywordLocation, name, null, null, asLocation, null, resultType,
                                                                                  span, comments)
        {
            SetParent(accessors);
            SetParent(endDeclaration);
            SetParent(implementsList);

            _CustomLocation = customLocation;
            _ImplementsList = implementsList;
            _Accessors      = accessors;
            _EndDeclaration = endDeclaration;
        }
Example #5
0
        protected MethodDeclaration(
            TreeType type,
            AttributeBlockCollection attributes,
            ModifierCollection modifiers,
            Location keywordLocation,
            SimpleName name,
            TypeParameterCollection typeParameters,
            ParameterCollection parameters,
            Location asLocation,
            AttributeBlockCollection resultTypeAttributes,
            TypeName resultType,
            NameCollection implementsList,
            NameCollection handlesList,
            StatementCollection statements,
            EndBlockDeclaration endDeclaration,
            Span span,
            IList <Comment> comments
            ) :
            base(
                type,
                attributes,
                modifiers,
                keywordLocation,
                name,
                typeParameters,
                parameters,
                asLocation,
                resultTypeAttributes,
                resultType,
                span,
                comments
                )
        {
            Debug.Assert(
                type == TreeType.SubDeclaration ||
                type == TreeType.FunctionDeclaration ||
                type == TreeType.ConstructorDeclaration ||
                type == TreeType.OperatorDeclaration ||
                type == TreeType.PropertyDeclaration
                );

            SetParent(endDeclaration);
            SetParent(implementsList);
            SetParent(handlesList);
            SetParent(statements);

            _ImplementsList = implementsList;
            _HandlesList    = handlesList;
            _Statements     = statements;
            _EndDeclaration = endDeclaration;
        }
 /// <summary>
 /// Constructs a new parse tree for a property declaration (VB6).
 /// </summary>
 /// <param name="attributes">The attributes on the declaration.</param>
 /// <param name="modifiers">The modifiers on the declaration.</param>
 /// <param name="keywordLocation">The location of the keyword.</param>
 /// <param name="name">The name of the property.</param>
 /// <param name="parameters">The parameters of the property.</param>
 /// <param name="asLocation">The location of the 'As', if any.</param>
 /// <param name="resultTypeAttributes">The attributes on the result type.</param>
 /// <param name="resultType">The result type, if any.</param>
 /// <param name="implementsList">The implements list.</param>
 /// <param name="accessors">The property accessors.</param>
 /// <param name="statements">The property statements (VB6)</param>
 /// <param name="endDeclaration">The End Property 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 PropertyDeclaration(
     AttributeBlockCollection attributes,
     ModifierCollection modifiers,
     Location keywordLocation,
     SimpleName name,
     ParameterCollection parameters,
     Location asLocation,
     AttributeBlockCollection resultTypeAttributes,
     TypeName resultType,
     NameCollection implementsList,
     GetAccessorDeclaration getAccessor,
     SetAccessorDeclaration setAccessor,
     EndBlockDeclaration endDeclaration,
     Span span,
     IList <Comment> comments
     ) :
     base(
         TreeType.PropertyDeclaration,
         attributes,
         modifiers,
         keywordLocation,
         name,
         null,
         parameters,
         asLocation,
         resultTypeAttributes,
         resultType,
         implementsList,
         null,
         null,
         endDeclaration,
         span,
         comments)
 {
     GetAccessor = getAccessor;
     SetAccessor = setAccessor;
 }
 /// <summary>
 /// Creates a new parse tree for a constructor 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="parameters">The parameters of the declaration.</param>
 /// <param name="statements">The statements in the declaration.</param>
 /// <param name="endDeclaration">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 ConstructorDeclaration(AttributeBlockCollection attributes, ModifierCollection modifiers, Location keywordLocation, SimpleName name, ParameterCollection parameters, StatementCollection statements, EndBlockDeclaration endDeclaration, Span span, IList <Comment> comments) : base(TreeType.ConstructorDeclaration, attributes, modifiers, keywordLocation, name, null, parameters, Location.Empty, null, null,
                                                                                                                                                                                                                                                                                             null, null, statements, endDeclaration, span, comments)
 {
 }
 /// <summary>
 /// Creates a new parse tree for an overloaded operator 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="operatorToken">The operator being overloaded.</param>
 /// <param name="parameters">The parameters of the declaration.</param>
 /// <param name="asLocation">The location of the 'As', if any.</param>
 /// <param name="resultTypeAttributes">The attributes on the result type, if any.</param>
 /// <param name="resultType">The result type, if any.</param>
 /// <param name="statements">The statements in the declaration.</param>
 /// <param name="endDeclaration">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 OperatorDeclaration(AttributeBlockCollection attributes, ModifierCollection modifiers, Location keywordLocation, Token operatorToken, ParameterCollection parameters, Location asLocation, AttributeBlockCollection resultTypeAttributes, TypeName resultType, StatementCollection statements, EndBlockDeclaration endDeclaration,
                            Span span, IList <Comment> comments) : base(TreeType.OperatorDeclaration, attributes, modifiers, keywordLocation, null, null, parameters, asLocation, resultTypeAttributes, resultType,
                                                                        null, null, statements, endDeclaration, span, comments)
 {
     _OperatorToken = operatorToken;
 }
Example #9
0
 /// <summary>
 /// Creates a new parse tree for a Function 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 on the declaration, if any.</param>
 /// <param name="parameters">The parameters of the declaration.</param>
 /// <param name="asLocation">The location of the 'As', if any.</param>
 /// <param name="resultTypeAttributes">The attributes on the result type, if any.</param>
 /// <param name="resultType">The result type, if any.</param>
 /// <param name="implementsList">The list of implemented members.</param>
 /// <param name="handlesList">The list of handled events.</param>
 /// <param name="statements">The statements in the declaration.</param>
 /// <param name="endDeclaration">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 FunctionDeclaration(AttributeBlockCollection attributes, ModifierCollection modifiers, Location keywordLocation, SimpleName name, TypeParameterCollection typeParameters, ParameterCollection parameters, Location asLocation, AttributeBlockCollection resultTypeAttributes, TypeName resultType, NameCollection implementsList,
                            NameCollection handlesList, StatementCollection statements, EndBlockDeclaration endDeclaration, Span span, IList <Comment> comments) : base(TreeType.FunctionDeclaration, attributes, modifiers, keywordLocation, name, typeParameters, parameters, asLocation, resultTypeAttributes, resultType,
                                                                                                                                                                        implementsList, handlesList, statements, endDeclaration, span, comments)
 {
 }