40 for(
const CFLEdge* edge : (*it).second->getOutEdges())
90 CFLNode* k = Z_edge->getDstNode();
108 CFLNode* k = Z_edge->getSrcNode();
135 addEdge(edge->getSrcID(), edge->getDstID(), edge->getEdgeKind());
168 for (
NodeID diffDst: diffDsts)
184 for (
NodeID diffSrc: diffSrcs)
206 if (
addEdge(IDMap.first, IDMap.first, X))
252 for (
NodeID diffDst: diffDsts)
275 for (
NodeID diffSrc: diffSrcs)
304 if (
addEdge(IDMap.first, IDMap.first, X))
319 for (
auto& iter:
indMap[src])
337 meld_h(x, newVNode, vChild);
343 auto it =
indMap.find(dst);
346 return (it->second.find(src) != it->second.end());
352 auto resIns =
indMap[dst].insert(std::make_pair(src, newNode));
354 return resIns.first->second;
363 for (
auto iter:
indMap[src])
379 meld_h(x, newVNode, vChild);
const Productions & getProdsFromSingleRHS(const Symbol sym) const
const Productions & getProdsFromFirstRHS(const Symbol sym) const
const Productions & getProdsFromSecondRHS(const Symbol sym) const
const Symbol & getFirstRHSSymbol(const Production &prod) const
const Symbol & getLHSSymbol(const Production &prod) const
const bool hasProdsFromFirstRHS(const Symbol sym) const
const bool hasProdsFromSecondRHS(const Symbol sym) const
Productions & getEpsilonProds()
const Symbol & getSecondRHSSymbol(const Production &prod) const
const bool hasProdsFromSingleRHS(const Symbol sym) const
GEdgeKind getEdgeKind() const
virtual const CFLEdge * addCFLEdge(CFLNode *src, CFLNode *dst, CFLEdge::GEdgeFlag label)
const CFLEdgeSet & getCFLEdges() const
const CFLEdge::CFLEdgeSetTy & getOutEdgeWithTy(GrammarBase::Symbol s)
const CFLEdge::CFLEdgeSetTy & getInEdgeWithTy(GrammarBase::Symbol s)
virtual void solve()
Start solving.
static double numOfChecks
virtual void processCFLEdge(const CFLEdge *Y_edge)
Process CFLEdge.
virtual void initialize()
Initialize worklist.
CFGrammar::Production Production
const CFLEdge * popFromWorklist()
Worklist operations.
virtual bool pushIntoWorklist(const CFLEdge *item)
virtual bool isWorklistEmpty()
NodeType * getSrcNode() const
NodeType * getDstNode() const
iterator begin()
Iterators.
NodeType * getGNode(NodeID id) const
Get a node.
Symbol strToSymbol(const std::string str) const
void insertEdge_h(TreeNode *u, TreeNode *v)
add v into desc(x) as a child of u
virtual void initialize()
Initialize worklist.
void meld(NodeID x, TreeNode *uNode, TreeNode *vNode)
TreeNode * getNode_h(NodeID src, NodeID dst)
Get the node dst in tree(src)
void meld_h(NodeID x, TreeNode *uNode, TreeNode *vNode)
bool hasInd_h(NodeID src, NodeID dst)
void addArc_h(NodeID src, NodeID dst)
void addArc(NodeID src, NodeID dst)
TreeNode * addInd_h(NodeID src, NodeID dst)
Add a node dst to tree(src)
Map< NodeID, std::unordered_map< NodeID, TreeNode * > > indMap
virtual void processCFLEdge(const CFLEdge *Y_edge)
Process CFLEdge.
bool hasEdge(const NodeID src, const NodeID dst, const Label ty)
find src -> find src[ty] -> find dst in set
virtual void processCFLEdge(const CFLEdge *Y_edge)
Process CFLEdge.
NodeBS addEdges(const NodeID src, const NodeBS &dstData, const Label ty)
add edges and return the set of added edges (dst) for src
bool addEdge(const NodeID src, const NodeID dst, const Label ty)
virtual void initialize()
Initialize worklist.
virtual void buildCFLData()
Init CFLData.
NodeID getId() const
Get ID.
std::unordered_set< TreeNode * > children