0
|
1 |
"{ Package: 'jv:statascripteditor' }"
|
|
2 |
|
|
3 |
"{ NameSpace: Smalltalk }"
|
|
4 |
|
|
5 |
Object subclass:#StataScriptLogImporter
|
|
6 |
instanceVariableNames:'script inCom'
|
|
7 |
classVariableNames:''
|
|
8 |
poolDictionaries:''
|
|
9 |
category:'Stata Script Editor'
|
|
10 |
!
|
|
11 |
|
|
12 |
|
|
13 |
!StataScriptLogImporter methodsFor:'handling'!
|
|
14 |
|
|
15 |
characterData:aString
|
|
16 |
(inCom and:[aString notEmptyOrNil]) ifTrue:[
|
|
17 |
(aString startsWith: '. ') ifTrue:[
|
|
18 |
script nextPutLine:(aString copyFrom: 3)
|
|
19 |
] ifFalse:[
|
|
20 |
script nextPutLine: aString
|
|
21 |
].
|
|
22 |
].
|
|
23 |
|
|
24 |
"Created: / 11-02-2015 / 00:32:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
25 |
!
|
|
26 |
|
|
27 |
tag: tag
|
|
28 |
inCom := tag = 'com'
|
|
29 |
|
|
30 |
"Created: / 10-02-2015 / 22:22:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
31 |
! !
|
|
32 |
|
|
33 |
!StataScriptLogImporter methodsFor:'importing'!
|
|
34 |
|
|
35 |
import: aStringOrStreamOrFilename
|
|
36 |
| parser |
|
|
37 |
|
|
38 |
script := String new writeStream.
|
|
39 |
inCom := false.
|
|
40 |
parser := StataScriptLogParser new.
|
|
41 |
parser handler: self.
|
|
42 |
parser parse: aStringOrStreamOrFilename readStream.
|
|
43 |
^ script contents.
|
|
44 |
|
|
45 |
"Created: / 10-02-2015 / 22:20:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
46 |
"Modified: / 11-02-2015 / 00:32:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
47 |
! !
|
|
48 |
|
|
49 |
!StataScriptLogImporter class methodsFor:'documentation'!
|
|
50 |
|
|
51 |
version_HG
|
|
52 |
|
|
53 |
^ '$Changeset: <not expanded> $'
|
|
54 |
! !
|
|
55 |
|