Commit b666d7a9 authored by Erick Gallesio's avatar Erick Gallesio

stklos-pkg claening and man page

parent b187436f
# Makefile for stklos-pkgman
# Author: Erick Gallesio [eg@essi.fr]
# Creation date: 22-Dec-2006 12:00 (eg)
# Last file update: 30-May-2007 12:53 (eg)
# Last file update: 31-May-2007 14:25 (eg)
makefiledir= $(prefix)/etc/stklos
......@@ -13,9 +13,9 @@ LEX = lang-bigloo.l lang-chicken.l lang-mzscheme.l
LEXOBJS = lang-bigloo.inc lang-chicken.inc lang-mzscheme.inc
SRC = main.stk add.stk copy.stk extract.stk install.stk lang.stk \
lang-bigloo.stk params.stk pkgball.stk \
params.stk pkgball.stk \
repository.stk rewrite.stk misc.stk tune.stk types.stk
SFLAGS = -l
SFLAGS =
RM = /bin/rm
SCC = ../utils/stklos-compile
......
......@@ -17,7 +17,7 @@
# Makefile for stklos-pkgman
# Author: Erick Gallesio [eg@essi.fr]
# Creation date: 22-Dec-2006 12:00 (eg)
# Last file update: 30-May-2007 12:53 (eg)
# Last file update: 31-May-2007 14:25 (eg)
VPATH = @srcdir@
......@@ -191,10 +191,10 @@ bin_SCRIPTS = stklos-pkg
LEX = lang-bigloo.l lang-chicken.l lang-mzscheme.l
LEXOBJS = lang-bigloo.inc lang-chicken.inc lang-mzscheme.inc
SRC = main.stk add.stk copy.stk extract.stk install.stk lang.stk \
lang-bigloo.stk params.stk pkgball.stk \
params.stk pkgball.stk \
repository.stk rewrite.stk misc.stk tune.stk types.stk
SFLAGS = -l
SFLAGS =
RM = /bin/rm
SCC = ../utils/stklos-compile
all: all-am
......
This diff is collapsed.
;;;;
;;;; lang-bigloo.stk -- Bigloo language support
;;;;
;;;; Copyright 2007 Erick Gallesio - I3S-CNRS/ESSI <eg@essi.fr>
;;;;
;;;;
;;;; 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 of the License, 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; if not, write to the Free Software
;;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
;;;; USA.
;;;;
;;;; Author: Erick Gallesio [eg@essi.fr]
;;;; Creation date: 21-Mar-2007 13:57 (eg)
;;;; Last file update: 25-Apr-2007 18:46 (eg)
;;;;
(include "lang-bigloo.inc")
;; ----------------------------------------------------------------------
;; bigloo-rewrite ...
;; ----------------------------------------------------------------------
(define (bigloo-rewrite src dir)
(define (do-rewrite in tmp)
(with-output-to-file tmp
(lambda ()
(let ((lex (lang-bigloo in)))
(let loop ((token (lexer-next-token lex)))
(unless (eq? token 'eof)
(display token)
(loop (lexer-next-token lex))))))))
(when (file-exists? src)
(let ((tmp (temporary-file-name)))
(do-rewrite src tmp)
(copy-file tmp src)
(remove-file tmp))))
;;;
;;; Register this language
;;;
(add-rewriter! 'bigloo bigloo-rewrite)
This diff is collapsed.
;;;;
;;;; lang-chicken.stk -- Chicken language support
;;;;
;;;; Copyright 2007 Erick Gallesio - I3S-CNRS/ESSI <eg@essi.fr>
;;;;
;;;;
;;;; 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 of the License, 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; if not, write to the Free Software
;;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
;;;; USA.
;;;;
;;;; Author: Erick Gallesio [eg@essi.fr]
;;;; Creation date: 21-Mar-2007 13:57 (eg)
;;;; Last file update: 5-May-2007 11:53 (eg)
;;;;
(include "lang-chicken.inc")
;; ----------------------------------------------------------------------
;; chicken-rewrite ...
;; ----------------------------------------------------------------------
(define (chicken-rewrite src dir)
(define (do-rewrite in tmp)
(with-output-to-file tmp
(lambda ()
(let ((lex (lang-chicken in)))
(let loop ((token (lexer-next-token lex)))
(unless (eq? token 'eof)
(display token)
(loop (lexer-next-token lex))))))))
(when (file-exists? src)
(let ((tmp (temporary-file-name)))
(do-rewrite src tmp)
(copy-file tmp src)
(remove-file tmp))))
;;;
;;; Register this language
;;;
(add-rewriter! 'chicken chicken-rewrite)
;;;;
;;;; lang-mzscheme.stk -- Mzscheme language support
;;;;
;;;; Copyright 2007 Erick Gallesio - I3S-CNRS/ESSI <eg@essi.fr>
;;;;
;;;;
;;;; 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 of the License, 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; if not, write to the Free Software
;;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
;;;; USA.
;;;;
;;;; Author: Erick Gallesio [eg@essi.fr]
;;;; Creation date: 21-Mar-2007 13:57 (eg)
;;;; Last file update: 5-May-2007 18:50 (eg)
;;;;
(include "lang-mzscheme.inc")
;; ----------------------------------------------------------------------
;; mzscheme-rewrite ...
;; ----------------------------------------------------------------------
(define (mzscheme-rewrite src dir)
(define (do-rewrite in tmp)
(with-output-to-file tmp
(lambda ()
(let ((lex (lang-mzscheme in)))
(let loop ((token (lexer-next-token lex)))
(unless (eq? token 'eof)
(display token)
(loop (lexer-next-token lex))))))))
(when (file-exists? src)
(let ((tmp (temporary-file-name)))
(do-rewrite src tmp)
(copy-file tmp src)
(remove-file tmp))))
;;;
;;; Register this language
;;;
(add-rewriter! 'mzscheme mzscheme-rewrite)
This diff is collapsed.
;;; Author: Erick Gallesio [eg@essi.fr]
;;; Creation date: 21-Mar-2007 13:45 (eg)
;;; Last file update: 5-May-2007 18:49 (eg)
;;; Last file update: 31-May-2007 14:44 (eg)
%%
......@@ -26,5 +26,5 @@
<<EOF>> 'eof
<<ERROR>> (error 'chicken-preprocessor "parse error ~S (line ~a)"
<<ERROR>> (error 'mzscheme-preprocessor "parse error ~S (line ~a)"
yytext (lexer-get-line))
;;;;
;;;; lang-r6rs.stk -- R6RS language support
;;;;
;;;; Copyright © 2007 Erick Gallesio - I3S-CNRS/ESSI <eg@essi.fr>
;;;;
;;;;
;;;; 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 of the License, 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; if not, write to the Free Software
;;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
;;;; USA.
;;;;
;;;; Author: Erick Gallesio [eg@essi.fr]
;;;; Creation date: 4-Apr-2007 14:44 (eg)
;;;; Last file update: 4-Apr-2007 14:44 (eg)
;;;;
......@@ -21,30 +21,42 @@
;;;;
;;;; Author: Erick Gallesio [eg@essi.fr]
;;;; Creation date: 21-Mar-2007 14:31 (eg)
;;;; Last file update: 5-May-2007 18:50 (eg)
;;;; Last file update: 31-May-2007 14:48 (eg)
;;;;
;;;
;;; Bigloo
;;;
(include "lang-bigloo.stk")
;;;
;;; Chicken
;;;
(include "lang-chicken.stk")
;;;
;;; Gambit
;;;
(include "lang-chicken.stk")
;;;
;;; R6RS
;;;
(add-rewriter! 'r6rs void)
(include "lang-bigloo.inc")
(include "lang-chicken.inc")
(include "lang-mzscheme.inc")
;; ----------------------------------------------------------------------
;; lang-rewrite ...
;; ----------------------------------------------------------------------
(define (language-rewrite lang-lex)
;; Return the function in charge of language rewriting. This
;; function takes an analyzer as parameter
(lambda (src dir)
(define (do-rewrite in tmp)
(with-output-to-file tmp
(lambda ()
(let ((lex (lang-lex in)))
(let loop ((token (lexer-next-token lex)))
(unless (eq? token 'eof)
(display token)
(loop (lexer-next-token lex))))))))
(when (file-exists? src)
(let ((tmp (temporary-file-name)))
(do-rewrite src tmp)
(copy-file tmp src)
(remove-file tmp)))))
;; ----------------------------------------------------------------------
;; Languages rewriters
;; ----------------------------------------------------------------------
(add-rewriter! 'bigloo (language-rewrite lang-bigloo))
(add-rewriter! 'chicken (language-rewrite lang-chicken))
(add-rewriter! 'gambit void)
(add-rewriter! 'mzscheme (language-rewrite lang-chicken))
(add-rewriter! 'r6rs void)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment