'Return a string representation for this Python expression.
Raises PythonCILEError if can\'t do it.'

def _getExprRepr(self, node):

    s = None
    if isinstance(node, ast.Name):
        s = node.name
    elif isinstance(node, ast.Const):
        s = repr(node.value)
    elif isinstance(node, ast.Getattr):
        s = '.'.join([self._getExprRepr(node.expr), node.attrname])
    elif isinstance(node, ast.List):
        items = [self._getExprRepr(c) for c in node.getChildren()]
        s = ('[%s]' % ',    '.join(items))
    elif isinstance(node, ast.Tuple):
        items = [self._getExprRepr(c) for c in node.getChildren()]
        s = ('(%s)' % ',    '.join(items))
    elif (hasattr(ast, 'Set') and isinstance(node, ast.Set)):
        items = [self._getExprRepr(c) for c in node.getChildren()]
        s = ('{%s}' % ',    '.join(items))
    elif isinstance(node, ast.Dict):
        items = [('%s:    %s' % (self._getExprRepr(k), self._getExprRepr(v))) for (k, v) in node.items]
        s = ('{%s}' % ',    '.join(items))
    elif isinstance(node, ast.CallFunc):
        s = self._getExprRepr(node.node)
        s += '('
        allargs = []
        for arg in node.args:
            allargs.append(self._getExprRepr(arg))
        if node.star_args:
            for arg in node.star_args:
                allargs.append(('*' + self._getExprRepr(arg)))
        if node.dstar_args:
            for arg in node.dstar_args:
                allargs.append(('**' + self._getExprRepr(arg)))
        s += ','.join(allargs)
        s += ')'
    elif isinstance(node, ast.Subscript):
        s = ('[%s]' % self._getExprRepr(node.expr))
    elif isinstance(node, ast.Backquote):
        s = ('`%s`' % self._getExprRepr(node.expr))
    elif isinstance(node, ast.Slice):
        dumpNode(node)
        s = self._getExprRepr(node.expr)
        s += '['
        if node.lower:
            s += self._getExprRepr(node.lower)
        s += ':'
        if node.upper:
            s += self._getExprRepr(node.upper)
        s += ']'
    elif isinstance(node, ast.UnarySub):
        s = ('-' + self._getExprRepr(node.expr))
    elif isinstance(node, ast.UnaryAdd):
        s = ('+' + self._getExprRepr(node.expr))
    elif isinstance(node, ast.Add):
        s = ((self._getExprRepr(node.left) + '+') + self._getExprRepr(node.right))
    elif isinstance(node, ast.Sub):
        s = ((self._getExprRepr(node.left) + '-') + self._getExprRepr(node.right))
    elif isinstance(node, ast.Mul):
        s = ((self._getExprRepr(node.left) + '*') + self._getExprRepr(node.right))
    elif isinstance(node, ast.Div):
        s = ((self._getExprRepr(node.left) + '/') + self._getExprRepr(node.right))
    elif isinstance(node, ast.FloorDiv):
        s = ((self._getExprRepr(node.left) + '//') + self._getExprRepr(node.right))
    elif isinstance(node, ast.Mod):
        s = ((self._getExprRepr(node.left) + '%') + self._getExprRepr(node.right))
    elif isinstance(node, ast.Power):
        s = ((self._getExprRepr(node.left) + '**') + self._getExprRepr(node.right))
    elif isinstance(node, ast.LeftShift):
        s = ((self._getExprRepr(node.left) + '<<') + self._getExprRepr(node.right))
    elif isinstance(node, ast.RightShift):
        s = ((self._getExprRepr(node.left) + '>>') + self._getExprRepr(node.right))
    elif isinstance(node, ast.Keyword):
        s = ((node.name + '=') + self._getExprRepr(node.expr))
    elif isinstance(node, ast.Bitor):
        creprs = []
        for cnode in node.nodes:
            if isinstance(cnode, (ast.Const, ast.Name)):
                crepr = self._getExprRepr(cnode)
            else:
                crepr = ('(%s)' % self._getExprRepr(cnode))
            creprs.append(crepr)
        s = '|'.join(creprs)
    elif isinstance(node, ast.Bitand):
        creprs = []
        for cnode in node.nodes:
            if isinstance(cnode, (ast.Const, ast.Name)):
                crepr = self._getExprRepr(cnode)
            else:
                crepr = ('(%s)' % self._getExprRepr(cnode))
            creprs.append(crepr)
        s = '&'.join(creprs)
    elif isinstance(node, ast.Bitxor):
        creprs = []
        for cnode in node.nodes:
            if isinstance(cnode, (ast.Const, ast.Name)):
                crepr = self._getExprRepr(cnode)
            else:
                crepr = ('(%s)' % self._getExprRepr(cnode))
            creprs.append(crepr)
        s = '^'.join(creprs)
    elif isinstance(node, ast.Lambda):
        s = 'lambda'
        defaultArgsBaseIndex = (len(node.argnames) - len(node.defaults))
        if node.kwargs:
            defaultArgsBaseIndex -= 1
            if node.varargs:
                defaultArgsBaseIndex -= 1
                varargsIndex = (len(node.argnames) - 2)
            else:
                varargsIndex = None
            kwargsIndex = (len(node.argnames) - 1)
        elif node.varargs:
            defaultArgsBaseIndex -= 1
            varargsIndex = (len(node.argnames) - 1)
            kwargsIndex = None
        else:
            varargsIndex = kwargsIndex = None
        args = []
        for i in range(len(node.argnames)):
            argOrArgTuple = node.argnames[i]
            if isinstance(argOrArgTuple, tuple):
                arg = ('(%s)' % ','.join(argOrArgTuple))
                if (i >= defaultArgsBaseIndex):
                    defaultNode = node.defaults[(i - defaultArgsBaseIndex)]
                    try:
                        arg += ('=' + self._getExprRepr(defaultNode))
                    except PythonCILEError:
                        arg += (arg + '=...')
            else:
                argname = node.argnames[i]
                if (i == kwargsIndex):
                    arg = ('**' + argname)
                elif (i == varargsIndex):
                    arg = ('*' + argname)
                elif (i >= defaultArgsBaseIndex):
                    defaultNode = node.defaults[(i - defaultArgsBaseIndex)]
                    try:
                        arg = ((argname + '=') + self._getExprRepr(defaultNode))
                    except PythonCILEError:
                        arg = (argname + '=...')
                else:
                    arg = argname
            args.append(arg)
        if args:
            s += ('    ' + ','.join(args))
        try:
            s += (':    ' + self._getExprRepr(node.code))
        except PythonCILEError:
            s += ':...'
    else:
        raise PythonCILEError(("don't    know    how    to    get    string    repr    of    expression:    %r" % node))
    return s
