Search in sources :

Example 1 with DASTNode

use of edu.rice.cs.caper.bayou.core.dsl.DASTNode in project bayou by capergroup.

the class DOMSwitchStatement method BuildTree.

private DSubTree BuildTree(DSubTree Sexpr, int itPos) {
    DSubTree bodyPrev = new DSubTree();
    DSubTree caseNodes = new DSubTree();
    DSubTree bodyNext;
    for (int it1 = itPos; it1 < bodies.size(); it1++) {
        int typePrev = nodeType.get(it1);
        if (typePrev == 49) {
            // checks for 'case' statement
            bodyNext = BuildTree(Sexpr, it1 + 1);
            DASTNode caseNode = new DBranch(Sexpr.getNodesAsCalls(), bodyPrev.getNodes(), bodyNext.getNodes());
            caseNodes.addNode(caseNode);
            return caseNodes;
        } else {
            bodyPrev.addNodes(bodies.get(it1));
        }
    }
    return bodyPrev;
}
Also used : DSubTree(edu.rice.cs.caper.bayou.core.dsl.DSubTree) DASTNode(edu.rice.cs.caper.bayou.core.dsl.DASTNode) DBranch(edu.rice.cs.caper.bayou.core.dsl.DBranch)

Aggregations

DASTNode (edu.rice.cs.caper.bayou.core.dsl.DASTNode)1 DBranch (edu.rice.cs.caper.bayou.core.dsl.DBranch)1 DSubTree (edu.rice.cs.caper.bayou.core.dsl.DSubTree)1