summaryrefslogtreecommitdiff
path: root/skribe/src/stklos/eval.stk
diff options
context:
space:
mode:
authorLudovic Court`es2005-11-02 10:08:38 +0000
committerLudovic Court`es2005-11-02 10:08:38 +0000
commitb76d5e1b252967521f210eac10ddbf089dde8c6a (patch)
tree00fc81c51256991c04799d79a749bbdd5b9fad30 /skribe/src/stklos/eval.stk
parentba63b8d4780428d9f63f6ace7f49361b77401112 (diff)
parentf553cb65b157b6df9563cefa593902d59301461b (diff)
downloadskribilo-b76d5e1b252967521f210eac10ddbf089dde8c6a.tar.gz
skribilo-b76d5e1b252967521f210eac10ddbf089dde8c6a.tar.lz
skribilo-b76d5e1b252967521f210eac10ddbf089dde8c6a.zip
Cleaned up the source tree and the installation process.
Patches applied: * lcourtes@laas.fr--2005-mobile/skribilo--devel--1.2--patch-6 Cosmetic changes. * lcourtes@laas.fr--2005-mobile/skribilo--devel--1.2--patch-7 Removed useless files, integrated packages. * lcourtes@laas.fr--2005-mobile/skribilo--devel--1.2--patch-8 Removed useless files, integrated packages. * lcourtes@laas.fr--2005-mobile/skribilo--devel--1.2--patch-9 Moved the STkLos and Bigloo code to `legacy'. * lcourtes@laas.fr--2005-mobile/skribilo--devel--1.2--patch-10 Installed Autoconf/Automake machinery. Fixed a few things. * lcourtes@laas.fr--2005-mobile/skribilo--devel--1.2--patch-11 Changes related to source-highlighting and to the manual. git-archimport-id: lcourtes@laas.fr--2004-libre/skribilo--devel--1.2--patch-10
Diffstat (limited to 'skribe/src/stklos/eval.stk')
-rw-r--r--skribe/src/stklos/eval.stk149
1 files changed, 0 insertions, 149 deletions
diff --git a/skribe/src/stklos/eval.stk b/skribe/src/stklos/eval.stk
deleted file mode 100644
index 3acace9..0000000
--- a/skribe/src/stklos/eval.stk
+++ /dev/null
@@ -1,149 +0,0 @@
-;;;;
-;;;; eval.stk -- Skribe Evaluator
-;;;;
-;;;; Copyright © 2003-2004 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: 27-Jul-2003 09:15 (eg)
-;;;; Last file update: 28-Oct-2004 15:05 (eg)
-;;;;
-
-
-;; FIXME; On peut implémenter maintenant skribe-warning/node
-
-
-(define-module SKRIBE-EVAL-MODULE
- (import SKRIBE-DEBUG-MODULE SKRIBE-ENGINE-MODULE SKRIBE-VERIFY-MODULE
- SKRIBE-RESOLVE-MODULE SKRIBE-OUTPUT-MODULE)
- (export skribe-eval skribe-eval-port skribe-load skribe-load-options
- skribe-include)
-
-
-(define *skribe-loaded* '()) ;; List of already loaded files
-(define *skribe-load-options* '())
-
-(define (%evaluate expr)
- (with-handler
- (lambda (c)
- (flush-output-port (current-error-port))
- (raise c))
- (eval expr (find-module 'STklos))))
-
-;;;
-;;; SKRIBE-EVAL
-;;;
-(define (skribe-eval a e :key (env '()))
- (with-debug 2 'skribe-eval
- (debug-item "a=" a " e=" (engine-ident e))
- (let ((a2 (resolve! a e env)))
- (debug-item "resolved a=" a)
- (let ((a3 (verify a2 e)))
- (debug-item "verified a=" a3)
- (output a3 e)))))
-
-;;;
-;;; SKRIBE-EVAL-PORT
-;;;
-(define (skribe-eval-port port engine :key (env '()))
- (with-debug 2 'skribe-eval-port
- (debug-item "engine=" engine)
- (let ((e (if (symbol? engine) (find-engine engine) engine)))
- (debug-item "e=" e)
- (if (not (is-a? e <engine>))
- (skribe-error 'skribe-eval-port "Cannot find engine" engine)
- (let loop ((exp (read port)))
- (with-debug 10 'skribe-eval-port
- (debug-item "exp=" exp))
- (unless (eof-object? exp)
- (skribe-eval (%evaluate exp) e :env env)
- (loop (read port))))))))
-
-;;;
-;;; SKRIBE-LOAD
-;;;
-(define *skribe-load-options* '())
-
-(define (skribe-load-options)
- *skribe-load-options*)
-
-(define (skribe-load file :rest opt :key engine path)
- (with-debug 4 'skribe-load
- (debug-item " engine=" engine)
- (debug-item " path=" path)
- (debug-item " opt" opt)
-
- (let* ((ei (cond
- ((not engine) *skribe-engine*)
- ((engine? engine) engine)
- ((not (symbol? engine)) (skribe-error 'skribe-load
- "Illegal engine" engine))
- (else engine)))
- (path (cond
- ((not path) (skribe-path))
- ((string? path) (list path))
- ((not (and (list? path) (every? string? path)))
- (skribe-error 'skribe-load "Illegal path" path))
- (else path)))
- (filep (find-path file path)))
-
- (set! *skribe-load-options* opt)
-
- (unless (and (string? filep) (file-exists? filep))
- (skribe-error 'skribe-load
- (format "Cannot find ~S in path" file)
- *skribe-path*))
-
- ;; Load this file if not already done
- (unless (member filep *skribe-loaded*)
- (cond
- ((> *skribe-verbose* 1)
- (format (current-error-port) " [loading file: ~S ~S]\n" filep opt))
- ((> *skribe-verbose* 0)
- (format (current-error-port) " [loading file: ~S]\n" filep)))
- ;; Load it
- (with-input-from-file filep
- (lambda ()
- (skribe-eval-port (current-input-port) ei)))
- (set! *skribe-loaded* (cons filep *skribe-loaded*))))))
-
-;;;
-;;; SKRIBE-INCLUDE
-;;;
-(define (skribe-include file :optional (path (skribe-path)))
- (unless (every string? path)
- (skribe-error 'skribe-include "Illegal path" path))
-
- (let ((path (find-path file path)))
- (unless (and (string? path) (file-exists? path))
- (skribe-error 'skribe-load
- (format "Cannot find ~S in path" file)
- path))
- (when (> *skribe-verbose* 0)
- (format (current-error-port) " [including file: ~S]\n" path))
- (with-input-from-file path
- (lambda ()
- (let Loop ((exp (read (current-input-port)))
- (res '()))
- (if (eof-object? exp)
- (if (and (pair? res) (null? (cdr res)))
- (car res)
- (reverse! res))
- (Loop (read (current-input-port))
- (cons (%evaluate exp) res))))))))
-) \ No newline at end of file