var files = opts.rest
if files.is_empty or opt_help.value then
- print "Usage: {sys.program_name} [options] file.pep [other_file.pep [...]]"
+ print "Usage: pep8analysis [options] file.pep [other_file.pep [...]]"
print "Options:"
opts.usage
return
print "Target file \"{filename}\" does not exist."
exit 1
end
- var ast = build_ast( filename )
+ var ast = build_ast_from_file( filename )
assert ast != null
if failed then continue
if opt_ast.value then
var printer = new ASTPrinter
printer.enter_visit(ast)
- var of = new OFStream.open("{dir}/{mangled_filename.replace(".pep", ".ast.dot")}")
+ var of = new FileWriter.open("{dir}/{mangled_filename.replace(".pep", ".ast.dot")}")
of.write printer.str
of.close
end
var cfg = build_cfg(model)
if opt_cfg.value or opt_cfg_long.value then
- var of = new OFStream.open("{dir}/{mangled_filename.replace(".pep", ".cfg.dot")}")
+ var of = new FileWriter.open("{dir}/{mangled_filename.replace(".pep", ".cfg.dot")}")
cfg.print_dot(of, opt_cfg_long.value)
of.close
end
do_types_analysis(ast, cfg)
# Print results
- var of = new OFStream.open("{dir}/{mangled_filename.replace(".pep",".analysis.dot")}")
+ var of = new FileWriter.open("{dir}/{mangled_filename.replace(".pep",".analysis.dot")}")
cfg.print_dot(of, true)
of.close
end
end
end
-redef class Object
- redef fun manager do return once new AnalysisManager
-end
-
manager.run