Пример #1
0
def analizeFuncCall(file):
	try:
		ast = getPHPAst(file)
		funcCalls = reduce(add, (node.find('Expr_FuncCall') for node in ast), [])
		return Counter(call.name.parts[0] for call in funcCalls)
	except: # todo:fix
		print 'analizeFuncCall talk that something was wrong with file %s ' % file
		return Counter()
Пример #2
0
Файл: test.py Проект: defuz/p2py
def generate(file):
	processor = Processor(stdScope)
	phpAst = getPHPAst(file)
	pythonAst = processor.translate(phpAst)
	return to_source(pythonAst)