Example #1
0
        public bool IsTagged(SyntaxNode node)
        {
            bool result = false;

            if (node != null)
            {
                TaggedSyntaxTree tree = this.GetTreeFromNode(node);
                if (tree != null)
                {
                    result = tree.IsTagged(node);
                }
            }
            return(result);
        }
Example #2
0
        public TaggedSyntaxTree GetTreeFromNode(SyntaxNode node)
        {
            TaggedSyntaxTree rTree = null;

            if (this.taggedSyntaxTrees.Count > 0 && node != null)
            {
                foreach (TaggedSyntaxTree tree in this.taggedSyntaxTrees)
                {
                    if (tree.OriginalTree == node.SyntaxTree)
                    {
                        rTree = tree;
                    }
                }
            }

            return(rTree);
        }
Example #3
0
        public bool TagNode(SyntaxNode node)
        {
            bool result = false;

            if (node != null && node.SyntaxTree != null && !this.IsTagged(node))
            {
                TaggedSyntaxTree tree = this.GetTreeFromNode(node);
                if (tree == null)
                {
                    tree = new TaggedSyntaxTree(node.SyntaxTree);
                    this.taggedSyntaxTrees.Add(tree);
                }

                result = tree.TagNode(node);
            }
            return(result);
        }