예제 #1
0
파일: t_cf.py 프로젝트: timtadh/slang
def analyze(s):
    name = traceback.extract_stack()[-2][2]
    ast = Parser().parse(s, lexer=Lexer())
    table, blocks, functions = il_gen.generate(ast, debug=True)
    dot('ast.%s'%name, ast.dotty(), str(ast))
    dot('blks.%s'%name, functions['f2'].entry.dotty())
    cf.analyze(table, blocks, functions, debug=True)
    dot('cf.%s'%name, functions['f2'].tree.dotty())
    return functions
예제 #2
0
파일: t_df.py 프로젝트: johngunderman/slang
def cf_analyze(s):
    table, blocks, functions = il.il_gen.generate(Parser().parse(s, lexer=Lexer()), True)
    cf.analyze(table, blocks, functions)
    return blocks, functions