stbc.rc
author Claus Gittinger <cg@exept.de>
Sat, 20 Jul 1996 01:00:31 +0200
changeset 128 a44dfc5513c4
parent 127 6787a765747c
child 129 7183a80c1efb
permissions -rw-r--r--
*** empty log message ***

"/
"/ $Header$
"/
"/ bytecode compiler frontend for smalltalk
"/

"/ load the files, save binary versions

|args|

args := Smalltalk commandLineArguments.
args do:[:arg |
    |inFile outFile baseName className class|

    (arg startsWith:'-') ifFalse:[
	inFile := arg asFilename.
	('loading ' , inFile name , ' ...') errorPrintCR.
	Object errorSignal handle:[:ex |
	    'error while loading: ' errorPrint. ex errorString errorPrintCR.
        ] do:[
	    Smalltalk fileIn:inFile name.
	].
	('done loading') errorPrintCR.

	baseName := inFile withoutSuffix.
	className := baseName baseName.
	outFile := baseName construct:'.cls'.

	className := Smalltalk classNameForFile:className.
	class := Smalltalk classNamed:className.
	class notNil ifTrue:[
	    ('saving ' , class name , ' ...') errorPrintCR.
	    class binaryFileOutWithSourceMode:#reference
	] ifFalse:[
	    ('no class for ' , className) errorPrintCR
	]
    ]
].
!

Smalltalk exit.
!