Lines Matching refs:Id
72 NodeId Id) const { in getMapped()
74 return TheMapping.getDst(Id); in getMapped()
76 return TheMapping.getSrc(Id); in getMapped()
144 const Node &getNode(NodeId Id) const { return Nodes[Id]; } in getNode()
145 Node &getMutableNode(NodeId Id) { return Nodes[Id]; } in getMutableNode() argument
146 bool isValidNodeId(NodeId Id) const { return Id >= 0 && Id < getSize(); } in isValidNodeId()
148 int getNumberOfDescendants(NodeId Id) const;
149 bool isInSubtree(NodeId Id, NodeId SubtreeRoot) const;
150 int findPositionInParent(NodeId Id, bool Shifted = false) const;
156 std::string getNodeValue(NodeId Id) const;
191 int Id = 0, Depth = 0; member
198 NodeId MyId = Id; in PreTraverse()
211 ++Id; in PreTraverse()
222 N.RightMostDescendant = Id - 1; in PostTraverse()
284 std::function<void(NodeId)> Traverse = [&](NodeId Id) { in getSubtreePostorder() argument
285 const Node &N = Tree.getNode(Id); in getSubtreePostorder()
288 Postorder.push_back(Id); in getSubtreePostorder()
309 std::function<void(NodeId)> PostorderTraverse = [&](NodeId Id) { in initTree() argument
310 for (NodeId Child : getNode(Id).Children) in initTree()
312 PostorderIds[Id] = PostorderId; in initTree()
331 int SyntaxTree::Impl::getNumberOfDescendants(NodeId Id) const { in getNumberOfDescendants()
332 return getNode(Id).RightMostDescendant - Id + 1; in getNumberOfDescendants()
335 bool SyntaxTree::Impl::isInSubtree(NodeId Id, NodeId SubtreeRoot) const { in isInSubtree() argument
336 return Id >= SubtreeRoot && Id <= getNode(SubtreeRoot).RightMostDescendant; in isInSubtree()
339 int SyntaxTree::Impl::findPositionInParent(NodeId Id, bool Shifted) const { in findPositionInParent() argument
340 NodeId Parent = getNode(Id).Parent; in findPositionInParent()
348 if (Siblings[I] == Id) { in findPositionInParent()
409 std::string SyntaxTree::Impl::getNodeValue(NodeId Id) const { in getNodeValue()
410 return getNodeValue(getNode(Id)); in getNodeValue()
475 int Id = 0; member
477 explicit SNodeId(int Id) : Id(Id) {} in SNodeId()
480 operator int() const { return Id; } in operator int()
481 SNodeId &operator++() { return ++Id, *this; } in operator ++()
482 SNodeId &operator--() { return --Id, *this; } in operator --()
483 SNodeId operator+(int Other) const { return SNodeId(Id + Other); } in operator +()
504 NodeId getIdInRoot(SNodeId Id) const { in getIdInRoot()
505 assert(Id > 0 && Id <= getSize() && "Invalid subtree node index."); in getIdInRoot()
506 return RootIds[Id - 1]; in getIdInRoot()
508 const Node &getNode(SNodeId Id) const { in getNode()
509 return Tree.getNode(getIdInRoot(Id)); in getNode()
511 SNodeId getLeftMostDescendant(SNodeId Id) const { in getLeftMostDescendant()
512 assert(Id > 0 && Id <= getSize() && "Invalid subtree node index."); in getLeftMostDescendant()
513 return LeftMostDescendants[Id - 1]; in getLeftMostDescendant()
519 std::string getNodeValue(SNodeId Id) const { in getNodeValue()
520 return Tree.getNodeValue(getIdInRoot(Id)); in getNodeValue()
750 void open(NodeId Id) { in open() argument
751 for (NodeId Child : Tree.getNode(Id).Children) in open()
764 for (size_t Id = 0, E = N1.Children.size(); Id < E; ++Id) in identical() local
765 if (!identical(N1.Children[Id], N2.Children[Id])) in identical()
871 for (NodeId Id : L1.pop()) in matchTopDown() local
872 L1.open(Id); in matchTopDown()
876 for (NodeId Id : L2.pop()) in matchTopDown() local
877 L2.open(Id); in matchTopDown()
966 NodeId ASTDiff::getMapped(const SyntaxTree &SourceTree, NodeId Id) const { in getMapped()
967 return DiffImpl->getMapped(SourceTree.TreeImpl, Id); in getMapped()
978 const Node &SyntaxTree::getNode(NodeId Id) const { in getNode()
979 return TreeImpl->getNode(Id); in getNode()
989 int SyntaxTree::findPositionInParent(NodeId Id) const { in findPositionInParent()
990 return TreeImpl->findPositionInParent(Id); in findPositionInParent()
1009 std::string SyntaxTree::getNodeValue(NodeId Id) const { in getNodeValue()
1010 return TreeImpl->getNodeValue(Id); in getNodeValue()