OSDN Git Service

gdb/testsuite/
[pf3gnuchains/pf3gnuchains3x.git] / cgen / cos-pprint.scm
1 ;;;; cos-pprint.scm --- pretty-print definitions for COS
2 ;;;; Copyright (C) 2005, 2009 Red Hat, Inc.
3 ;;;; This file is part of CGEN.
4 ;;;; See file COPYING.CGEN for details.
5
6 ;;; To use this with pprint.scm:
7 ;;;
8 ;;;   (load "pprint.scm")
9 ;;;   (load "cos-pprint.scm")
10 ;;;
11 ;;; You must load this file second, so it can redefine the ELIDE? and
12 ;;; ELIDED-NAME hooks.
13 ;;;
14 ;;; See the documentation in pprint.scm for details.
15
16 (define (elide? obj)
17   (or (object? obj) (class? obj)))
18
19 (define (elided-name obj)
20   (cond ((class? obj) `(class ,(class-name obj)))
21         ((object? obj)
22          `(object ,(class-name (object-class obj))
23                   ,@(if (method-present? obj 'get-name)
24                         (list (send obj 'get-name))
25                         '())))
26         (else (error "unexpected elided object"))))