@@ -0,0 +1,2385 @@
+#!/usr/bin/env python%0A# -*- encoding: utf-8 -*-%0A#%0A# Copyright (c) 2016 ASMlover. All rights reserved.%0A#%0A# Redistribution and use in source and binary forms, with or without%0A# modification, are permitted provided that the following conditions%0A# are met:%0A#%0A#  * Redistributions of source code must retain the above copyright%0A#    notice, this list ofconditions and the following disclaimer.%0A#%0A#  * Redistributions in binary form must reproduce the above copyright%0A#    notice, this list of conditions and the following disclaimer in%0A#    the documentation and/or other materialsprovided with the%0A#    distribution.%0A#%0A# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS%0A# %22AS IS%22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT%0A# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS%0A# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE%0A# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,%0A# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,%0A# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;%0A# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER%0A# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT%0A# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN%0A# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE%0A# POSSIBILITY OF SUCH DAMAGE.%0A%0Aimport pprint%0A%0A_pp = pprint.PrettyPrinter(indent=2)%0A%0Adef _print_node(node, indent, indent_symbol):%0A    if isinstance(node, list):%0A        for child in node:%0A            for p in _print_node(child, indent, indent_symbol):%0A                yield p%0A    elif isinstance(node, int) or isinstance(node, float) or isinstance(node, str) or node is None:%0A        yield ' %7B%7D'.format(node)%0A    elif hasattr(node, 'fields'):%0A        yield '%5Cn%7B%7D%7B%7D'.format(indent_symbol * indent, type(node).__name__)%0A        for field in node.fields:%0A            yield '%5Cn%7B%7D%7B%7D:'.format(indent_symbol * (indent + 1), field, ':')%0A            for p in _print_node(getattr(node, field), indent + 2, indent_symbol):%0A                yield p%0A    else:%0A        yield '%5CnError! Unable to print %7B%7D'.format(node)%0A%0Adef print_ast(node, indent=0, indent_symbol=' ' * 4):%0A    print(''.join(_print_node(node, indent, indent_symbol)))%0A%0Adef print_tokens(tokens):%0A    _pp.pprint(tokens)%0A%0Adef print_env(env):%0A    _pp.pprint(env.as_dict())%0A

add common utils functions for pylike