chiark
/
gitweb
/
~mdw
/
sod
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
doc/syntax.tex, src/sod-module.5: Typeset `<qualifier>s' properly.
[sod]
/
src
/
frontend.lisp
diff --git
a/src/frontend.lisp
b/src/frontend.lisp
index e7b515a0683dc24b86f239d2334a2bd4d6a3dac3..68c8a9631eab5f6161629fd0603c55d89566e147 100644
(file)
--- a/
src/frontend.lisp
+++ b/
src/frontend.lisp
@@
-7,7
+7,7
@@
;;;----- Licensing notice ---------------------------------------------------
;;;
;;;----- Licensing notice ---------------------------------------------------
;;;
-;;; This file is part of the Sensble Object Design, an object system for C.
+;;; This file is part of the Sens
i
ble Object Design, an object system for C.
;;;
;;; SOD is free software; you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
;;;
;;; SOD is free software; you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
@@
-25,10
+25,16
@@
(cl:defpackage #:sod-frontend
(:use #:common-lisp #:optparse #:sod #:sod-parser)
(cl:defpackage #:sod-frontend
(:use #:common-lisp #:optparse #:sod #:sod-parser)
- (:shadowing-import-from #:optparse
"INT"
))
+ (:shadowing-import-from #:optparse
#:int
))
(cl:in-package #:sod-frontend)
(cl:in-package #:sod-frontend)
+;;;--------------------------------------------------------------------------
+;;; Preparation for dumping.
+
+(clear-the-decks)
+(exercise)
+
;;;--------------------------------------------------------------------------
;;; The main program.
;;;--------------------------------------------------------------------------
;;; The main program.
@@
-81,11
+87,11
@@
(defun main ()
;; Option definitions.
(define-program
:help "Process SOD input files to produce (e.g.) C output."
;; Option definitions.
(define-program
:help "Process SOD input files to produce (e.g.) C output."
- :version
"0.1.0"
+ :version
*sod-version*
:usage "SOURCES..."
:options (options
(help-options :short-version #\V)
:usage "SOURCES..."
:options (options
(help-options :short-version #\V)
- "
Crazy
options"
+ "
Translator
options"
(#\I "include" (:arg "DIR")
("Search DIR for module imports.")
(list *module-dirs* 'string))
(#\I "include" (:arg "DIR")
("Search DIR for module imports.")
(list *module-dirs* 'string))
@@
-110,9
+116,6
@@
(define-program
(or builtinsp args))
(die-usage))
(or builtinsp args))
(die-usage))
- ;; Prepare the builtins.
- (make-builtin-module)
-
;; Do the main parsing job.
(multiple-value-bind (hunoz nerror nwarn)
(count-and-report-errors ()
;; Do the main parsing job.
(multiple-value-bind (hunoz nerror nwarn)
(count-and-report-errors ()
@@
-166,15
+169,17
@@
(define-program
reason))
nil)))))
reason))
nil)))))
+ ;; If there are no output types then there's nothing to do.
+ (unless output-reasons
+ (error "No output types given: nothing to do"))
+
;; If we're writing the builtin module then now seems like a
;; good time to do that.
(when builtinsp
;; If we're writing the builtin module then now seems like a
;; good time to do that.
(when builtinsp
- (clear-the-decks)
(hack-module *builtin-module*))
;; Parse and write out the remaining modules.
(dolist (arg args)
(hack-module *builtin-module*))
;; Parse and write out the remaining modules.
(dolist (arg args)
- (clear-the-decks)
(hack-module (read-module arg))))))
;; Report on how well everything worked.
(hack-module (read-module arg))))))
;; Report on how well everything worked.