Lines Matching refs:Id
73 NodeId Id) const { in getMapped()
75 return TheMapping.getDst(Id); in getMapped()
77 return TheMapping.getSrc(Id); in getMapped()
143 const Node &getNode(NodeId Id) const { return Nodes[Id]; } in getNode()
144 Node &getMutableNode(NodeId Id) { return Nodes[Id]; } in getMutableNode() argument
145 bool isValidNodeId(NodeId Id) const { return Id >= 0 && Id < getSize(); } in isValidNodeId()
147 int getNumberOfDescendants(NodeId Id) const;
148 bool isInSubtree(NodeId Id, NodeId SubtreeRoot) const;
149 int findPositionInParent(NodeId Id, bool Shifted = false) const;
155 std::string getNodeValue(NodeId Id) const;
190 int Id = 0, Depth = 0; member
197 NodeId MyId = Id; in PreTraverse()
210 ++Id; in PreTraverse()
221 N.RightMostDescendant = Id - 1; in PostTraverse()
283 std::function<void(NodeId)> Traverse = [&](NodeId Id) { in getSubtreePostorder() argument
284 const Node &N = Tree.getNode(Id); in getSubtreePostorder()
287 Postorder.push_back(Id); in getSubtreePostorder()
308 std::function<void(NodeId)> PostorderTraverse = [&](NodeId Id) { in initTree() argument
309 for (NodeId Child : getNode(Id).Children) in initTree()
311 PostorderIds[Id] = PostorderId; in initTree()
330 int SyntaxTree::Impl::getNumberOfDescendants(NodeId Id) const { in getNumberOfDescendants()
331 return getNode(Id).RightMostDescendant - Id + 1; in getNumberOfDescendants()
334 bool SyntaxTree::Impl::isInSubtree(NodeId Id, NodeId SubtreeRoot) const { in isInSubtree() argument
335 return Id >= SubtreeRoot && Id <= getNode(SubtreeRoot).RightMostDescendant; in isInSubtree()
338 int SyntaxTree::Impl::findPositionInParent(NodeId Id, bool Shifted) const { in findPositionInParent() argument
339 NodeId Parent = getNode(Id).Parent; in findPositionInParent()
347 if (Siblings[I] == Id) { in findPositionInParent()
408 std::string SyntaxTree::Impl::getNodeValue(NodeId Id) const { in getNodeValue()
409 return getNodeValue(getNode(Id)); in getNodeValue()
474 int Id = 0; member
476 explicit SNodeId(int Id) : Id(Id) {} in SNodeId()
479 operator int() const { return Id; } in operator int()
480 SNodeId &operator++() { return ++Id, *this; } in operator ++()
481 SNodeId &operator--() { return --Id, *this; } in operator --()
482 SNodeId operator+(int Other) const { return SNodeId(Id + Other); } in operator +()
503 NodeId getIdInRoot(SNodeId Id) const { in getIdInRoot()
504 assert(Id > 0 && Id <= getSize() && "Invalid subtree node index."); in getIdInRoot()
505 return RootIds[Id - 1]; in getIdInRoot()
507 const Node &getNode(SNodeId Id) const { in getNode()
508 return Tree.getNode(getIdInRoot(Id)); in getNode()
510 SNodeId getLeftMostDescendant(SNodeId Id) const { in getLeftMostDescendant()
511 assert(Id > 0 && Id <= getSize() && "Invalid subtree node index."); in getLeftMostDescendant()
512 return LeftMostDescendants[Id - 1]; in getLeftMostDescendant()
518 std::string getNodeValue(SNodeId Id) const { in getNodeValue()
519 return Tree.getNodeValue(getIdInRoot(Id)); in getNodeValue()
749 void open(NodeId Id) { in open() argument
750 for (NodeId Child : Tree.getNode(Id).Children) in open()
763 for (size_t Id = 0, E = N1.Children.size(); Id < E; ++Id) in identical() local
764 if (!identical(N1.Children[Id], N2.Children[Id])) in identical()
870 for (NodeId Id : L1.pop()) in matchTopDown() local
871 L1.open(Id); in matchTopDown()
875 for (NodeId Id : L2.pop()) in matchTopDown() local
876 L2.open(Id); in matchTopDown()
965 NodeId ASTDiff::getMapped(const SyntaxTree &SourceTree, NodeId Id) const { in getMapped()
966 return DiffImpl->getMapped(SourceTree.TreeImpl, Id); in getMapped()
977 const Node &SyntaxTree::getNode(NodeId Id) const { in getNode()
978 return TreeImpl->getNode(Id); in getNode()
988 int SyntaxTree::findPositionInParent(NodeId Id) const { in findPositionInParent()
989 return TreeImpl->findPositionInParent(Id); in findPositionInParent()
1008 std::string SyntaxTree::getNodeValue(NodeId Id) const { in getNodeValue()
1009 return TreeImpl->getNodeValue(Id); in getNodeValue()