1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 20:00:19 +02:00
guile/module/language/assembly/spec.scm
Andy Wingo 7b107cceb9 add decompilers that can take us back to assembly
* module/language/assembly/Makefile.am:
* module/language/assembly/spec.scm:
* module/language/assembly/decompile-bytecode.scm: Add a bytecode
  decompiler. Neat!

* module/language/bytecode/spec.scm (decompile-objcode):
* module/language/objcode/spec.scm (decompile-value): Add some
  "decompilers" here too.

* module/system/base/compile.scm (current-language): Since we can refer
  to languages by name, do so here -- removes the previous
  anti-circularity hack.
  (compile-file, compile): Refer to target languages by name.
  (decompile): New public function. Neat!

* module/system/base/language.scm (lookup-decompilation-order): Fix so we
  look for decompilers with the high-level language definition.
2009-01-30 12:59:29 +01:00

36 lines
1.3 KiB
Scheme

;;; Guile Virtual Machine Assembly
;; Copyright (C) 2001 Free Software Foundation, Inc.
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; see the file COPYING. If not, write to
;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
;;; Code:
(define-module (language assembly spec)
#:use-module (system base language)
#:use-module (language assembly compile-bytecode)
#:use-module (language assembly decompile-bytecode)
#:export (assembly))
(define-language assembly
#:title "Guile Virtual Machine Assembly Language"
#:version "2.0"
#:reader read
#:printer write
#:parser read ;; fixme: make a verifier?
#:compilers `((bytecode . ,compile-bytecode))
#:decompilers `((bytecode . ,decompile-bytecode))
)