STCCompilerInterface.st
changeset 2646 de9d7a6e6315
parent 2644 51666ff4ec9f
child 2647 a47876ae33fd
equal deleted inserted replaced
2645:0c873acfa7b4 2646:de9d7a6e6315
   634     aClass allSuperclasses reverseDo:defineAction.
   634     aClass allSuperclasses reverseDo:defineAction.
   635     defineAction value:aClass.
   635     defineAction value:aClass.
   636 !
   636 !
   637 
   637 
   638 generateSTSource:aString 
   638 generateSTSource:aString 
   639     |stream definedClasses sep className|
   639     |stream definedClasses sep className modulesParentDir modulesDir|
   640 
   640 
   641     "/ generate a unique name, consisting of my processID and a sequence number
   641     "/ generate a unique name, consisting of my processID and a sequence number
   642     "/ the processId is added to allow filein of modules from different
   642     "/ the processId is added to allow filein of modules from different
   643     "/ lifes
   643     "/ lifes
   644 
   644 
   645     SequenceNumber := (SequenceNumber ? 0) + 1.
   645     SequenceNumber := (SequenceNumber ? 0) + 1.
   646 
   646 
   647     initName := 'm_' , OperatingSystem getProcessId printString, '_' , SequenceNumber printString.
   647     initName := 'm_' , OperatingSystem getProcessId printString, '_' , SequenceNumber printString.
   648 
   648 
   649     stFileName := (Filename currentDirectory construct:(initName , '.st')) name. 
   649 "/    Smalltalk isSmalltalkDevelopmentSystem ifTrue:[
       
   650 "/        modulesParentDir := Filename currentDirectory. 
       
   651 "/    ] ifFalse:[
       
   652 "/        modulesParentDir := Filename tempDirectory. 
       
   653 "/    ].
       
   654 "/    modulesDir := modulesParentDir construct:'modules'. 
       
   655     modulesDir := ParserFlags stcModulePath.
       
   656     stFileName := (modulesDir construct:(initName , '.st')) name. 
       
   657 
   650     [
   658     [
   651         stream := stFileName asFilename writeStream.
   659         stream := stFileName asFilename writeStream.
   652     ] on:FileStream openErrorSignal do:[:ex|
   660     ] on:FileStream openErrorSignal do:[:ex|
   653         originator parseError:'cannot create temporary sourcefile for compilation'.
   661         originator parseError:'cannot create temporary sourcefile for compilation'.
   654         ^ #CannotLoad
   662         ^ #CannotLoad
   705            nextChunkPut:aString;
   713            nextChunkPut:aString;
   706            space; nextPut:sep.
   714            space; nextPut:sep.
   707 
   715 
   708     stream close.
   716     stream close.
   709 
   717 
   710     "Modified: / 18-01-2011 / 18:02:39 / cg"
   718     "Modified: / 08-08-2011 / 23:23:10 / cg"
   711 !
   719 !
   712 
   720 
   713 reportCompilationError
   721 reportCompilationError
   714     |eMsg errorMessages lNr|
   722     |eMsg errorMessages lNr|
   715 
   723 
   835 ! !
   843 ! !
   836 
   844 
   837 !STCCompilerInterface class methodsFor:'documentation'!
   845 !STCCompilerInterface class methodsFor:'documentation'!
   838 
   846 
   839 version
   847 version
   840     ^ '$Header: /cvs/stx/stx/libcomp/STCCompilerInterface.st,v 1.20 2011-08-08 21:03:12 cg Exp $'
   848     ^ '$Header: /cvs/stx/stx/libcomp/STCCompilerInterface.st,v 1.21 2011-08-08 21:23:42 cg Exp $'
   841 !
   849 !
   842 
   850 
   843 version_CVS
   851 version_CVS
   844     ^ '$Header: /cvs/stx/stx/libcomp/STCCompilerInterface.st,v 1.20 2011-08-08 21:03:12 cg Exp $'
   852     ^ '$Header: /cvs/stx/stx/libcomp/STCCompilerInterface.st,v 1.21 2011-08-08 21:23:42 cg Exp $'
   845 ! !
   853 ! !
   846 
   854 
   847 STCCompilerInterface initialize!
   855 STCCompilerInterface initialize!