MCClassTraitParser.st
author Patrik Svestka <patrik.svestka@gmail.com>
Wed, 14 Nov 2018 12:57:13 +0100
branchjv
changeset 1095 87f223484bc3
parent 613 7026d389451d
permissions -rw-r--r--
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present - All source *.st files are now Unicode UTF8 without BOM Files are in two groups (fileOut works this way in Smalltalk/X): - containing a unicode character have "{ Encoding: utf8 }" at the header - ASCII only are without the header
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1095
87f223484bc3 Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents: 613
diff changeset
     1
"{ Encoding: utf8 }"
87f223484bc3 Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents: 613
diff changeset
     2
248
512637950c48 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
"{ Package: 'stx:goodies/monticello' }"
512637950c48 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
512637950c48 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
MCDoItParser subclass:#MCClassTraitParser
512637950c48 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
	instanceVariableNames:''
512637950c48 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
	classVariableNames:''
512637950c48 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
	poolDictionaries:''
613
7026d389451d category change
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
     9
	category:'SCM-Monticello-Modeling'
248
512637950c48 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
!
512637950c48 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
512637950c48 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
512637950c48 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
!MCClassTraitParser class methodsFor:'as yet unclassified'!
512637950c48 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
512637950c48 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
pattern
512637950c48 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
	^ '*classTrait*uses:*'
512637950c48 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
! !
512637950c48 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
512637950c48 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
!MCClassTraitParser methodsFor:'as yet unclassified'!
512637950c48 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
512637950c48 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
addDefinitionsTo: aCollection
512637950c48 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
	| tokens  definition traitCompositionString |
512637950c48 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
	tokens := Scanner new scanTokens: source.
512637950c48 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
	traitCompositionString := ((ReadStream on: source)
512637950c48 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
		match: 'uses:';
512637950c48 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
		upToEnd) withBlanksTrimmed.
512637950c48 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
	definition := MCClassTraitDefinition
512637950c48 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
		baseTraitName: (tokens at: 1) 
512637950c48 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
		classTraitComposition: traitCompositionString.
512637950c48 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
	aCollection add: definition
512637950c48 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
512637950c48 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
! !
512637950c48 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
512637950c48 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
!MCClassTraitParser class methodsFor:'documentation'!
512637950c48 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
512637950c48 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
version
613
7026d389451d category change
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
    37
    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCClassTraitParser.st,v 1.3 2012-09-11 21:20:47 cg Exp $'
248
512637950c48 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
!
512637950c48 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
512637950c48 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
version_CVS
613
7026d389451d category change
Claus Gittinger <cg@exept.de>
parents: 386
diff changeset
    41
    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCClassTraitParser.st,v 1.3 2012-09-11 21:20:47 cg Exp $'
248
512637950c48 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
!
512637950c48 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
512637950c48 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
version_SVN
1095
87f223484bc3 Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents: 613
diff changeset
    45
    ^ '§Id: MCClassTraitParser.st 5 2010-08-29 07:30:29Z vranyj1 §'
248
512637950c48 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
! !