def visit_char(self, node, ch): c, _ = getchar(node.value[1:-1]) c = gdb.Value(ord(c)).cast(gdb.lookup_type('char')) return expr.Literal(node.value, c)
def visit_string(self, node, ch): s, tail = '', node.value[1:-1] while tail: head, tail = getchar(tail) s += head return expr.Literal(node.value, gdb.Value(s))
def visit_octal(self, node, ch): return expr.Literal(node.value, gdb.Value(int(node.value, 8)))
def visit_hexadecimal(self, node, ch): return expr.Literal(node.value, gdb.Value(int(node.value, 16)))
def visit_real(self, node, ch): return expr.Literal(node.value, gdb.Value(float(node.value)))