Esempio n. 1
0
def runText(progText):
    # ensures that we reset the name type tuple id between runs.
    reset();
    
    outputErrStream = StreamObj();
    rootNode = head.lexAndParse(progText,outputErrStream,2);

    if rootNode == None:
        print('\nErrors encountered\n');
        print (outputErrStream.flush());
        return;

    fDeps = slicer(rootNode);

    # turn fDeps into a dictionary
    allDepsDict = {};
    for dep in fDeps:
        allDepsDict[dep.funcName] = dep;

    toPrint = '\n\n';
    for dep in fDeps:
        toPrint += dep.jsonize(allDepsDict);
        toPrint += '\n\n';

    toPrint += '\n\n\n';
    return toPrint,rootNode;
Esempio n. 2
0
def parseTestToRun(progText):
    outputStream = testCommon.StreamLike()
    head.lexAndParse(progText, outputStream, 2)
    return outputStream.flush()
Esempio n. 3
0
def parseTestToRun(progText):
    outputStream = testCommon.StreamLike();
    head.lexAndParse(progText, outputStream, 2);
    return outputStream.flush();