コード例 #1
0
        public override SyntaxNode VisitQualifiedName(QualifiedNameSyntax node)
        {
            GenericNameSyntax foundNode = FindListNode(node);
            if (foundNode == null)
            {
                return base.VisitQualifiedName(node);
            }

            return ToArray(foundNode);
            //return node.ReplaceNode(foundNode, arrayNode);
        }
コード例 #2
0
 public DeltaGen(CodeGen generator)
     : base(generator)
 {
     var recursiveType = this.applyTo.RecursiveTypeFromFamily;
     if (!recursiveType.IsDefault)
     {
         this.changedPropertiesEnumTypeName = SyntaxFactory.IdentifierName(recursiveType.TypeSymbol.Name + "ChangedProperties");
         this.diffGramTypeSyntax = SyntaxFactory.QualifiedName(recursiveType.TypeSyntax, DiffGramTypeName);
         this.recursiveDiffingType = SyntaxFactory.QualifiedName(
             SyntaxFactory.IdentifierName(nameof(ImmutableObjectGraph)),
             SyntaxFactory.GenericName(nameof(ImmutableObjectGraph.IRecursiveDiffingType<uint, uint>))
                 .AddTypeArgumentListArguments(
                     this.changedPropertiesEnumTypeName,
                     this.diffGramTypeSyntax));
     }
 }
コード例 #3
0
            public override SyntaxNode VisitQualifiedName(QualifiedNameSyntax node)
            {
                bool oldAlwaysSimplify = this.alwaysSimplify;
                if (!this.alwaysSimplify)
                {
                    this.alwaysSimplify = node.HasAnnotation(Simplifier.Annotation);
                }

                var result = SimplifyExpression(
                    node,
                    newNode: base.VisitQualifiedName(node),
                    simplifier: SimplifyName);

                this.alwaysSimplify = oldAlwaysSimplify;

                return result;
            }
コード例 #4
0
        public QualifiedNameTranslation(QualifiedNameSyntax syntax, SyntaxTranslation parent) : base(syntax, parent)
        {
            Left = syntax.Left.Get<NameTranslation>(this);
            Right = syntax.Right.Get<SimpleNameTranslation>(this);

            var genericTranslation = Left as GenericNameTranslation;
            if (genericTranslation != null)
            {
                ((GenericNameTranslation)Left).ExcludeTypeParameter = true;

            }

            var simpleName = Right as SimpleNameTranslation;
            if (simpleName != null)
            {
                simpleName.DetectApplyThis = false;
                var identifierName = simpleName as IdentifierNameTranslation;
                if (genericTranslation != null && identifierName!=null)
                {
                    identifierName.TypeArgumentList = genericTranslation.TypeArgumentList;
                }
                
            }
        }
コード例 #5
0
            public override void VisitQualifiedName(QualifiedNameSyntax node)
            {
                bool seenConstructedBeforeRight = seenConstructed;

                // Visit Right first because it's smaller (to make backtracking cheaper).
                Visit(node.Right);

                bool seenConstructedBeforeLeft = seenConstructed;

                Visit(node.Left);

                // If the first time we saw a constructed type was in Left, then we need to re-visit Right
                if (!seenConstructedBeforeRight && !seenConstructedBeforeLeft && seenConstructed)
                {
                    Visit(node.Right);
                }
            }
コード例 #6
0
 public override VB.VisualBasicSyntaxNode VisitQualifiedName(CSS.QualifiedNameSyntax node)
 {
     return(VBFactory.QualifiedName((VBS.NameSyntax)node.Left.Accept(this), (VBS.SimpleNameSyntax)node.Right.Accept(this)));
 }
コード例 #7
0
        private static SimpleNameSyntax GetLeftMostSimpleName(QualifiedNameSyntax qn)
        {
            while (qn != null)
            {
                var left = qn.Left;
                var simpleName = left as SimpleNameSyntax;
                if (simpleName != null)
                {
                    return simpleName;
                }

                qn = left as QualifiedNameSyntax;
            }

            return null;
        }
コード例 #8
0
ファイル: FAQ.cs プロジェクト: Rickinio/roslyn
 public override SyntaxNode VisitQualifiedName(QualifiedNameSyntax node)
 {
     // not descending into node to simplify the whole expression
     return AnnotateNodeWithSimplifyAnnotation(node);
 }
コード例 #9
0
ファイル: Rewriter_Expression.cs プロジェクト: rexzh/SharpJs
 public override SyntaxNode VisitQualifiedName(QualifiedNameSyntax node)
 {
     if (node.Left.Kind() == SyntaxKind.IdentifierName)
     {
         var id = node.Left as IdentifierNameSyntax;
         _output.Write(id, id.Identifier.ValueText);
     }
     else
     {
         this.Visit(node.Left);
         _output.TrivialWrite(node.DotToken.ValueText);
         _output.Write(node.Right, node.Right.Identifier.ValueText);
     }
     return node;
 }
コード例 #10
0
 public override SyntaxNode VisitQualifiedName(QualifiedNameSyntax node)
 {
     _leftSideOfNames.Add(node.Left.ToString());
     _fullNames.Add(node.ToString());
     return base.VisitQualifiedName(node);
 }
コード例 #11
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="node"></param>
 public override sealed void VisitQualifiedName(QualifiedNameSyntax node)
 {
     this.OnNodeVisited(node, this.type.IsInstanceOfType(node));
     base.VisitQualifiedName(node);
 }
コード例 #12
0
ファイル: Function.cs プロジェクト: LaxLacks/ls2csc
        public FlatOperand Resolve(QualifiedNameSyntax qns, TypeInfo result_type, FlatOperand into_lvalue, List<FlatStatement> instructions)
        {
            SymbolInfo si = Model.GetSymbolInfo(qns);

            //string name = qns.Identifier.ToString();
            switch (si.Symbol.Kind)
            {
                case SymbolKind.NamedType:
                    {
                        FlatOperand fop_type = Resolve((ITypeSymbol)si.Symbol, into_lvalue, instructions);

                        if (into_lvalue != null)
                        {
                            instructions.Add(FlatStatement.REFERENCE(into_lvalue, fop_type));
                        }

                        return fop_type;
                    }
                    break;
            }
            throw new NotImplementedException(si.Symbol.Kind.ToString());
        }
コード例 #13
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="node"></param>
 public override sealed void VisitQualifiedName(QualifiedNameSyntax node)
 {
     this.OnNodeVisited(node);
     if (!this.traverseRootOnly) base.VisitQualifiedName(node);
 }
コード例 #14
0
 private string QualifiedName(QualifiedNameSyntax qns)
 {
     string qName = "";
     ChildSyntaxList idn = qns.ChildNodesAndTokens();
     foreach(SyntaxNodeOrToken snot in idn.ToArray())
     {
         if (snot.IsToken)
         {
             SyntaxToken st = (SyntaxToken)snot;
             if (st.IsKind(SyntaxKind.IdentifierToken))
             {
                 qName += st.ValueText;
             }
             else if (st.IsKind(SyntaxKind.DotToken))
             {
                 qName += ".";
             }
         }
     }
     return qName;
 }