Esempio n. 1
0
def extractCSVCFGs(projectRoot):

    codeTreeWalker = CodeTreeWalker(projectRoot)
    codeTreeWalker.setFilenameFilterRegex('(.*)\.(csv)$')

    for metaDataFile in codeTreeWalker:
        # print metaDataFile
        processor = CSV2CFG()
        processor.processCSVRows(metaDataFile)
        processor.terminateFunction()
Esempio n. 2
0
def extractCSVCFGs(projectRoot):

    codeTreeWalker = CodeTreeWalker(projectRoot)
    codeTreeWalker.setFilenameFilterRegex('(.*)\.(csv)$')
       
    for metaDataFile in codeTreeWalker:
        # print metaDataFile
        processor = CSV2CFG()
        processor.processCSVRows(metaDataFile)
        processor.terminateFunction()
Esempio n. 3
0
def main(projectRoot):

    print('Creating index for %s' % (projectRoot))

    codeTreeWalker = CodeTreeWalker(projectRoot)
    codeTreeWalker.setFilenameFilterRegex('ast\.(csv)$')
    processor = CodeIndexCreator()

    for csvFilename in codeTreeWalker:
        processor.processCSVRows(csvFilename)
    processor.saveResults(projectRoot)
Esempio n. 4
0
def main(projectRoot):
   
    print('Creating index for %s' %(projectRoot))
    
    codeTreeWalker = CodeTreeWalker(projectRoot)
    codeTreeWalker.setFilenameFilterRegex('ast\.(csv)$')
    processor = CodeIndexCreator()
   
    for csvFilename in codeTreeWalker:
        processor.processCSVRows(csvFilename)
    processor.saveResults(projectRoot)
Esempio n. 5
0
def main(projectRoot, nodeFilter, row2StringConverter):

    codeTreeWalker = CodeTreeWalker(projectRoot)
    codeTreeWalker.setFilenameFilterRegex('ast\.pickl$')
    processor = PythonASTToPrunedAST()
    
    processor.setFilter(nodeFilter)
    processor.setRow2StringConverter(row2StringConverter)
       
    for pythonASTFilename in codeTreeWalker:
        processor.loadTreeFromFile(pythonASTFilename)
        processor.processChildren()
Esempio n. 6
0
def main(projectRoot):

    print('Creating ASTs in CSV format for %s' % (projectRoot))

    codeTreeWalker = CodeTreeWalker(projectRoot)
    codeTreeWalker.setFilenameFilterRegex('source')
    codeToCSVAST = CodeToCSVAST()

    for sourceFile in codeTreeWalker:
        dirForSourceFile = codeTreeWalker.getDirForFilename(sourceFile)
        codeToCSVAST.run(sourceFile)
        codeToCSVAST.save(dirForSourceFile)
Esempio n. 7
0
def main(projectRoot):
   
    print('Creating ASTs in CSV format for %s' %(projectRoot))
    
    codeTreeWalker = CodeTreeWalker(projectRoot)
    codeTreeWalker.setFilenameFilterRegex('source')
    codeToCSVAST = CodeToCSVAST()
    
    for sourceFile in codeTreeWalker:
        dirForSourceFile = codeTreeWalker.getDirForFilename(sourceFile)
        codeToCSVAST.run(sourceFile)
        codeToCSVAST.save(dirForSourceFile)
Esempio n. 8
0
def main(projectRoot):
   
    print('Creating pickle\'d ASTs for %s' %(projectRoot))
    
    codeTreeWalker = CodeTreeWalker(projectRoot)
    codeTreeWalker.setFilenameFilterRegex('ast\.(csv)$')
   
    for csvFilename in codeTreeWalker:
        
        processor = CSVToPythonAST()
        processor.processCSVRows(csvFilename)
        outputFilename = outFilenameFromCSVFilename(csvFilename)
        processor.saveResults(outputFilename)
Esempio n. 9
0
def main(projectRoot):

    print("Creating pickle'd ASTs for %s" % (projectRoot))

    codeTreeWalker = CodeTreeWalker(projectRoot)
    codeTreeWalker.setFilenameFilterRegex("ast\.(csv)$")

    for csvFilename in codeTreeWalker:

        processor = CSVToPythonAST()
        processor.processCSVRows(csvFilename)
        outputFilename = outFilenameFromCSVFilename(csvFilename)
        processor.saveResults(outputFilename)
Esempio n. 10
0
def main(projectRoot, f, r):
   
    print('Creating filtered CFGs for %s' %(projectRoot))
    
    codeTreeWalker = CodeTreeWalker(projectRoot)
    codeTreeWalker.setFilenameFilterRegex('cfg.pickl')
    
    for cfgFilename in codeTreeWalker:
        processor = PythonCFGToPrunedCFG()
        
        processor.setFilter(f)
        processor.setRow2StringConverter(r)
        
        processor.applyFilterToNodes(cfgFilename)
        processor.save()
Esempio n. 11
0
def main(projectRoot, f, r):

    print('Creating filtered CFGs for %s' % (projectRoot))

    codeTreeWalker = CodeTreeWalker(projectRoot)
    codeTreeWalker.setFilenameFilterRegex('cfg.pickl')

    for cfgFilename in codeTreeWalker:
        processor = PythonCFGToPrunedCFG()

        processor.setFilter(f)
        processor.setRow2StringConverter(r)

        processor.applyFilterToNodes(cfgFilename)
        processor.save()