Source

appliancekit-ng / ak-interpret-axml

#!/usr/bin/env python

from appliancekit.axml import compile_axml_file
from appliancekit.parsetree import compile_parsetree, interpret_parsetree
import json, sys
from pprint import pprint

data = compile_axml_file(sys.argv[1], phases=sys.argv[3:])
tree = compile_parsetree(data)

print "Compiled AST:"
pprint(tree)

print "Interpret results:"
interpret_parsetree(tree, {'chroot': sys.argv[2], 'simulate': 'simulate' in sys.argv, 'arch': 'x86_64', 'debarch': 'amd64'})