;----------- macros for the compiler -------------
(setq sectioncamacsid "@(#)camacs.l 5.2 11/11/80") ; id for SCCS
; Copyright (c) 1980 , The Regents of the University of California.
(declare (macros t)) ; compile and save macros
; these are the compiler message producing macros. The form is
; (comp-xxxx val1 val2 val3 ... valn) , all values are printed according
; to this scheme. If vali is an atom, it is patomed, if vali is a
; list, it is evaluated and printed. If vali is N a newline is printed
; the name of the current function is printed first
; after comp-err prints the message, it does a throw to Comp-err .
; errors are preceeded by Error:
; warnings by %Warning: and
; The message is sent to the message file
`( "Error: " g-fname ": " ,@(cdr l) N))
(setq er-fatal (1+ er-fatal))
(throw nil Comp-error))))
`( "%Warning: " g-fname ": " ,@(cdr l) N)))))))
`( "%Note: " ,@(cdr l) N)))))))
`("?Error: " ,@(cdr l) N))
(setq er-fatal (1+ er-fatal)))))
; prints the lst to the given port. The lst is printed in the manner
; described above, that is atoms are patomed, and lists are evaluated
; and printed, and N prints a newline. The output is always drained.
(eval-when (compile load eval)
(cond ((null lis) `((drain)))
(t `(,(cond ((atom (car lis))
(t `(niceprint ,(car lis)))))
(t `(niceprint ,(car lis))))
,@(comp-msg (cdr lis)))))))
(patom (quotient (fix (times val 100)) 100.0)))
(prog (majlis minlis revl)
(do ((revl (reverse lis) (cdr revl)))
(cond ((eq (car revl) 'else)
(setq majlis `((t ,@minlis) ,@majlis)
((or (eq (car revl) 'then) (eq (car revl) 'thenret))
majlis `((,(car revl) ,@minlis) ,@majlis)
((eq (car revl) 'elseif))
(setq majlis `(cond ,@majlis)))
(t (setq minlis `( ,(car revl) ,@minlis)))))
; we displace the previous macro, that is we actually replace
; the if list structure with the corresponding cond, meaning
; that the expansion is done only once
(rplaca lis (car majlis))
(rplacd lis (cdr majlis))
; (Push stackname valuetoadd)
`(setq ,atm (cons ,val ,atm)))
`(prog1 (car ,val) (setq ,val (cdr ,val))))
;--- unpush macro - like pop except top value is thrown away
;--- and an increment macro
(defmacro makecomment (arg)
`(cond (fl-comments (setq g-comments (cons ,arg g-comments)))))
;--- add a comment irregardless of the fl-comments flag
(defmacro forcecomment (arg)
`(setq g-comments (cons ,arg g-comments)))
;--- write to the .s file
(defmacro sfilewrite (arg)