示例#1
0
        protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
        {
            var expr = other as ParenthesizedExpression;

            return(expr != null &&
                   Expression.DoMatch(expr.Expression, match));
        }
        protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
        {
            var node = other as SimpleNameExpression;

            return(node != null &&
                   Identifier.DoMatch(node.Identifier, match));
        }
        protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
        {
            var expr = other as GetXmlNamespaceExpression;

            return(expr != null &&
                   NamespaceName.DoMatch(expr.NamespaceName, match));
        }
        protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
        {
            var node = other as MemberImportsClause;

            return(node != null &&
                   Member.DoMatch(node.Member, match));
        }
        protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
        {
            DocumentationReference o = other as DocumentationReference;

            if (!(o != null && this.SymbolKind == o.SymbolKind && this.HasParameterList == o.HasParameterList))
            {
                return(false);
            }
            if (this.SymbolKind == SymbolKind.Operator)
            {
                if (this.OperatorType != o.OperatorType)
                {
                    return(false);
                }
                if (this.OperatorType == OperatorType.Implicit || this.OperatorType == OperatorType.Explicit)
                {
                    if (!this.ConversionOperatorReturnType.DoMatch(o.ConversionOperatorReturnType, match))
                    {
                        return(false);
                    }
                }
            }
            else if (this.SymbolKind == SymbolKind.None)
            {
                if (!MatchString(this.MemberName, o.MemberName))
                {
                    return(false);
                }
                if (!this.TypeArguments.DoMatch(o.TypeArguments, match))
                {
                    return(false);
                }
            }
            return(this.Parameters.DoMatch(o.Parameters, match));
        }
示例#6
0
        protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
        {
            var expr = other as InstanceExpression;

            return(expr != null &&
                   Type == expr.Type);
        }
示例#7
0
        protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
        {
            var member = other as EnumMemberDeclaration;

            return(Attributes.DoMatch(member.Attributes, match) &&
                   Name.DoMatch(member.Name, match) &&
                   Value.DoMatch(member.Value, match));
        }
示例#8
0
        protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
        {
            var node = other as Identifier;

            return(node != null &&
                   MatchString(node.name, name) &&
                   node.TypeCharacter == TypeCharacter);
        }
        protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
        {
            var clause = other as AliasImportsClause;

            return(clause != null &&
                   Name.DoMatch(clause.Name, match) &&
                   Alias.DoMatch(clause.Alias, match));
        }
        protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
        {
            var expr = other as TypeOfIsExpression;

            return(expr != null &&
                   TypeOfExpression.DoMatch(expr.TypeOfExpression, match) &&
                   Type.DoMatch(expr.Type, match));
        }
示例#11
0
        protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
        {
            var expr = other as InterfaceMemberSpecifier;

            return(expr != null &&
                   Target.DoMatch(expr.Target, match) &&
                   Member.DoMatch(expr.Member, match));
        }
        protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
        {
            var expr = other as MemberAccessExpression;

            return(expr != null &&
                   Target.DoMatch(expr.Target, match) &&
                   MemberName.DoMatch(expr.MemberName, match) &&
                   TypeArguments.DoMatch(expr.TypeArguments, match));
        }
        protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
        {
            var ident = other as XmlLiteralString;

            return(ident != null &&
                   MatchStringXml(Value, ident.Value) &&
                   ident.startLocation == startLocation &&
                   ident.endLocation == endLocation);
        }
        protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
        {
            var ctor = other as ConstructorDeclaration;

            return(ctor != null &&
                   MatchAttributesAndModifiers(ctor, match) &&
                   Parameters.DoMatch(ctor.Parameters, match) &&
                   Body.DoMatch(ctor.Body, match));
        }
        protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
        {
            var param = other as ParameterDeclaration;

            return(param != null &&
                   MatchAttributesAndModifiers(param, match) &&
                   Name.DoMatch(param.Name, match) &&
                   OptionalValue.DoMatch(param.OptionalValue, match) &&
                   Type.DoMatch(param.Type, match));
        }
示例#16
0
        protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
        {
            var decl = other as EnumDeclaration;

            return(decl != null &&
                   MatchAttributesAndModifiers(decl, match) &&
                   Name.DoMatch(decl.Name, match) &&
                   UnderlyingType.DoMatch(decl.UnderlyingType, match) &&
                   Members.DoMatch(decl.Members, match));
        }
示例#17
0
        protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
        {
            var o = other as DelegateDeclaration;

            return(o != null &&
                   MatchAttributesAndModifiers(o, match) &&
                   IsSub == o.IsSub &&
                   TypeParameters.DoMatch(o.TypeParameters, match) &&
                   Name.DoMatch(o.Name, match) &&
                   Parameters.DoMatch(o.Parameters, match) &&
                   ReturnTypeAttributes.DoMatch(o.ReturnTypeAttributes, match) &&
                   ReturnType.DoMatch(o.ReturnType, match));
        }
示例#18
0
        protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
        {
            TypeDeclaration t = other as TypeDeclaration;

            return(t != null &&
                   MatchAttributesAndModifiers(t, match) &&
                   Members.DoMatch(t.Members, match) &&
                   ClassType == t.ClassType &&
                   Name.DoMatch(t.Name, match) &&
                   TypeParameters.DoMatch(t.TypeParameters, match) &&
                   InheritsType.DoMatch(t.InheritsType, match) &&
                   ImplementsTypes.DoMatch(t.ImplementsTypes, match));
        }
        protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
        {
            // TODO : finish
            var method = other as ExternalMethodDeclaration;

            return(method != null &&
                   MatchAttributesAndModifiers(method, match) &&
                   IsSub == method.IsSub &&
                   Name.DoMatch(method.Name, match) &&
                   Parameters.DoMatch(method.Parameters, match) &&
                   ReturnTypeAttributes.DoMatch(method.ReturnTypeAttributes, match) &&
                   ReturnType.DoMatch(method.ReturnType, match));
        }
示例#20
0
        protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
        {
            var method = other as MethodDeclaration;

            return(method != null &&
                   MatchAttributesAndModifiers(method, match) &&
                   IsSub == method.IsSub &&
                   Name.DoMatch(method.Name, match) &&
                   TypeParameters.DoMatch(method.TypeParameters, match) &&
                   Parameters.DoMatch(method.Parameters, match) &&
                   ReturnTypeAttributes.DoMatch(method.ReturnTypeAttributes, match) &&
                   ReturnType.DoMatch(method.ReturnType, match) &&
                   HandlesClause.DoMatch(method.HandlesClause, match) &&
                   ImplementsClause.DoMatch(method.ImplementsClause, match) &&
                   Body.DoMatch(method.Body, match));
        }
示例#21
0
 protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
 {
     throw new NotImplementedException();
 }
        protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
        {
            var clause = other as XmlNamespaceImportsClause;

            return(clause != null && Namespace.DoMatch(clause.Namespace, match) && Prefix.DoMatch(clause.Prefix, match));
        }
 protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
 {
     return(other != null && other.IsNull);
 }
示例#24
0
 protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
 {
     return(other is NewLineNode);
 }
示例#25
0
//		public override string ToString()
//		{
//			return string.Format("[Attribute Type={0} Arguments={1}]", Type, GetCollectionString(Arguments));
//		}

        protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
        {
            var node = other as Attribute;

            return(node != null && node.Target == Target && node.TargetKeyword.DoMatch(this.TargetKeyword, match) && node.Type.DoMatch(this.Type, match) && node.Arguments.DoMatch(this.Arguments, match));
        }
示例#26
0
        protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
        {
            var o = other as FixedVariableInitializer;

            return(o != null && MatchString(this.Name, o.Name) && this.CountExpression.DoMatch(o.CountExpression, match));
        }
示例#27
0
        protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
        {
            var node = other as AttributeBlock;

            return(node != null && Attributes.DoMatch(node.Attributes, match));
        }