ProgrammingLanguage.st
author Claus Gittinger <cg@exept.de>
Tue, 06 Sep 2011 08:36:30 +0200
changeset 13635 b07e00f94949
parent 13425 352177aa4eb1
child 13819 095f081028fc
permissions -rw-r--r--
searchForPreRequisites:withSubProjects: duplicate code from jv refactored; fix: extended classes are also prerequisites
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13425
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
     1
"
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
     2
 COPYRIGHT (c) 2006 by eXept Software AG
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
     3
              All Rights Reserved
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
     4
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
     5
 This software is furnished under a license and may be used
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
     6
 only in accordance with the terms of that license and with the
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
     8
 be provided or otherwise made available to, or used by, any
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
     9
 other person.  No title to or ownership of the software is
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
    10
 hereby transferred.
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
    11
"
11964
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    12
"{ Package: 'stx:libbasic' }"
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    13
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    14
Object subclass:#ProgrammingLanguage
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    15
	instanceVariableNames:''
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    16
	classVariableNames:'LanguageQuerySignal'
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    17
	poolDictionaries:''
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    18
	category:'Kernel-Languages'
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    19
!
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    20
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    21
ProgrammingLanguage class instanceVariableNames:'Instance'
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    22
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    23
"
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    24
 No other class instance variables are inherited by this class.
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    25
"
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    26
!
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    27
12101
715a89a8a8bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12099
diff changeset
    28
!ProgrammingLanguage class methodsFor:'documentation'!
715a89a8a8bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12099
diff changeset
    29
13425
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
    30
copyright
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
    31
"
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
    32
 COPYRIGHT (c) 2006 by eXept Software AG
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
    33
              All Rights Reserved
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
    34
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
    35
 This software is furnished under a license and may be used
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
    36
 only in accordance with the terms of that license and with the
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
    37
 inclusion of the above copyright notice.   This software may not
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
    38
 be provided or otherwise made available to, or used by, any
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
    39
 other person.  No title to or ownership of the software is
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
    40
 hereby transferred.
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
    41
"
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
    42
!
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
    43
12101
715a89a8a8bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12099
diff changeset
    44
documentation
715a89a8a8bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12099
diff changeset
    45
"
715a89a8a8bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12099
diff changeset
    46
    provide info about which tools are to be used for code in
715a89a8a8bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12099
diff changeset
    47
    a programming language
715a89a8a8bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12099
diff changeset
    48
"
715a89a8a8bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 12099
diff changeset
    49
! !
11964
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    50
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    51
!ProgrammingLanguage class methodsFor:'initialization'!
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    52
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    53
initialize
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    54
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    55
     LanguageQuerySignal := 
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    56
            QuerySignal new
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    57
                nameClass:self message:#languageQuerySignal;
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    58
                notifierString:'asking for current language';
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    59
                handlerBlock:[:ex | ex proceedWith:SmalltalkLanguage instance].
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    60
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    61
    "Created: / 12-08-2009 / 14:56:11 / Jan Vrany <vranyj1@fel.cvut.cz>"
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    62
    "Modified: / 16-08-2009 / 10:36:11 / Jan Vrany <vranyj1@fel.cvut.cz>"
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    63
! !
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    64
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    65
!ProgrammingLanguage class methodsFor:'instance creation'!
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    66
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    67
forFile: aFilename 
12099
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
    68
    "Answers a language for given source file. If none is found,
11964
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    69
     SmalltalkLanguage is returned (to provide backward compatibility)"
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    70
    
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    71
    ^ self instancesDetect: [:each | each canReadSourceFile: aFilename ]
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    72
        ifNone: [ SmalltalkLanguage instance ]
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    73
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    74
    "Created: / 16-08-2009 / 10:08:44 / Jan Vrany <vranyj1@fel.cvut.cz>"
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    75
!
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    76
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    77
forStream: aStream 
12099
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
    78
    "Answers a language for given source stream. If none is found,
11964
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    79
     SmalltalkLanguage is returned (to provide backward compatibility)"
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    80
    
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    81
    aStream isFileStream ifFalse: [ ^ SmalltalkLanguage instance ].
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    82
    ^ self forFile: aStream fileName
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    83
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    84
    "Created: / 16-08-2009 / 10:56:26 / Jan Vrany <vranyj1@fel.cvut.cz>"
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    85
!
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    86
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    87
named: aString 
12990
cfa4d16e8a34 changed: #named:
Claus Gittinger <cg@exept.de>
parents: 12989
diff changeset
    88
    ^ self named:aString ifNone:[ self error: 'No language named ' , aString ].
11964
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    89
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    90
    "
12989
fef8dc59d0a3 comment/format in: #named:
Claus Gittinger <cg@exept.de>
parents: 12590
diff changeset
    91
     ProgrammingLanguage named: 'Smalltalk'
fef8dc59d0a3 comment/format in: #named:
Claus Gittinger <cg@exept.de>
parents: 12590
diff changeset
    92
     ProgrammingLanguage named: 'JavaScript' 
fef8dc59d0a3 comment/format in: #named:
Claus Gittinger <cg@exept.de>
parents: 12590
diff changeset
    93
     ProgrammingLanguage named: 'Ruby'
fef8dc59d0a3 comment/format in: #named:
Claus Gittinger <cg@exept.de>
parents: 12590
diff changeset
    94
    "
11964
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    95
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    96
    "Created: / 15-08-2009 / 22:40:26 / Jan Vrany <vranyj1@fel.cvut.cz>"
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    97
    "Modified: / 16-08-2009 / 10:58:01 / Jan Vrany <vranyj1@fel.cvut.cz>"
12990
cfa4d16e8a34 changed: #named:
Claus Gittinger <cg@exept.de>
parents: 12989
diff changeset
    98
    "Modified: / 04-08-2010 / 12:06:38 / cg"
11964
ed7b8114d08a initial checkin
fm
parents:
diff changeset
    99
!
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   100
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   101
named: aString ifNone: aBlock
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   102
    ^ self 
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   103
        instancesDetect:[:each | each name = aString ]
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   104
        ifNone: aBlock
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   105
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   106
    "Created: / 21-08-2009 / 13:07:10 / Jan Vrany <vranyj1@fel.cvut.cz>"
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   107
! !
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   108
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   109
!ProgrammingLanguage class methodsFor:'Signal constants'!
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   110
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   111
languageQuerySignal
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   112
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   113
    ^LanguageQuerySignal
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   114
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   115
    "Created: / 12-08-2009 / 14:57:07 / Jan Vrany <vranyj1@fel.cvut.cz>"
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   116
! !
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   117
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   118
!ProgrammingLanguage class methodsFor:'accessing'!
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   119
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   120
all
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   121
    "
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   122
    Anwers a collection of all available languages
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   123
    "        
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   124
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   125
    ^self allSubclasses collect:[:each|each instance]
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   126
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   127
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   128
    "
12099
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   129
     ProgrammingLanguage all
11964
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   130
    "
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   131
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   132
    "Created: / 16-08-2009 / 13:43:41 / Jan Vrany <vranyj1@fel.cvut.cz>"
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   133
!
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   134
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   135
current
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   136
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   137
    "
12099
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   138
     ProgrammingLanguage current
11964
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   139
    "
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   140
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   141
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   142
    ^LanguageQuerySignal query
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   143
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   144
    "Created: / 12-08-2009 / 15:02:59 / Jan Vrany <vranyj1@fel.cvut.cz>"
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   145
!
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   146
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   147
instance
12099
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   148
    "return this languages singleton"
11964
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   149
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   150
    Instance ifNil:[Instance := self new].
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   151
    ^Instance
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   152
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   153
    "Created: / 16-08-2009 / 10:36:37 / Jan Vrany <vranyj1@fel.cvut.cz>"
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   154
! !
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   155
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   156
!ProgrammingLanguage class methodsFor:'enumerating'!
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   157
12590
3a0b232a27fd added: #allDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents: 12181
diff changeset
   158
allDetect:aBlock ifNone:exceptionValue
3a0b232a27fd added: #allDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents: 12181
diff changeset
   159
    self allDo:[:each | (aBlock value:each) ifTrue:[^ each]].
3a0b232a27fd added: #allDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents: 12181
diff changeset
   160
    ^ exceptionValue value
3a0b232a27fd added: #allDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents: 12181
diff changeset
   161
!
11964
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   162
12590
3a0b232a27fd added: #allDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents: 12181
diff changeset
   163
allDo: aBlock
3a0b232a27fd added: #allDetect:ifNone:
Claus Gittinger <cg@exept.de>
parents: 12181
diff changeset
   164
    ^ self allSubclassesDo: [:each | aBlock value: each instance]
11964
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   165
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   166
    "Created: / 16-08-2009 / 14:07:40 / Jan Vrany <vranyj1@fel.cvut.cz>"
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   167
! !
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   168
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   169
!ProgrammingLanguage class methodsFor:'private'!
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   170
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   171
instancesDetect: detectBlock ifNone: failBlock
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   172
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   173
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   174
    self allSubclasses 
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   175
        do:[:cls|(detectBlock value: cls instance) ifTrue:[^cls instance]].
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   176
    ^failBlock value
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   177
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   178
    "Created: / 16-08-2009 / 10:57:32 / Jan Vrany <vranyj1@fel.cvut.cz>"
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   179
! !
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   180
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   181
!ProgrammingLanguage class methodsFor:'testing'!
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   182
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   183
isAvailable: langName
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   184
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   185
    self instancesDetect: [:lang|lang name = langName] ifNone: [^false].
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   186
    ^true
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   187
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   188
    "
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   189
        ProgrammingLanguage isAvailable: 'Smalltalk' 
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   190
        ProgrammingLanguage isAvailable: 'Ruby'  
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   191
        ProgrammingLanguage isAvailable: 'Haskell'   
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   192
    "
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   193
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   194
    "Created: / 21-08-2009 / 12:56:32 / Jan Vrany <vranyj1@fel.cvut.cz>"
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   195
! !
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   196
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   197
!ProgrammingLanguage methodsFor:'accessing'!
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   198
13425
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   199
id
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   200
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   201
    "Return an unique integer id of this language.
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   202
     id must be < 32.
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   203
     This id is used as index to various structures used by runtime"
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   204
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   205
    ^self subclassResponsibility
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   206
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   207
    "Created: / 17-03-2011 / 10:51:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   208
!
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   209
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   210
imports
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   211
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   212
    "To make it polymorph with NameSpace for
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   213
     selector-namespace enabled systems"
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   214
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   215
    ^self class all reject:[:lang|lang == self]
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   216
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   217
    "Created: / 20-05-2010 / 14:17:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   218
    "Modified: / 19-07-2010 / 12:14:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   219
!
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   220
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   221
lookup
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   222
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   223
    ^self lookupClass instance
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   224
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   225
    "Created: / 17-03-2011 / 10:57:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   226
!
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   227
11964
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   228
name
12099
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   229
    "Answers a human-readable name of myself:
11964
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   230
     'Smalltalk' for SmalltalkLanguage,
12099
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   231
     'Ruby' for RubyLanguage
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   232
     ...
11964
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   233
    "
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   234
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   235
    ^ self subclassResponsibility
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   236
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   237
    "Created: / 15-08-2009 / 22:38:16 / Jan Vrany <vranyj1@fel.cvut.cz>"
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   238
    "Modified: / 16-08-2009 / 10:47:21 / Jan Vrany <vranyj1@fel.cvut.cz>"
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   239
!
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   240
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   241
sourceFileSuffix
12099
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   242
    "Answers a default suffix for source files, i.e. 'st' for Smalltalk, 
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   243
     'js' for JavaScript or 'rb' for Ruby', etc."
11964
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   244
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   245
    ^self subclassResponsibility
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   246
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   247
    "Created: / 16-08-2009 / 10:42:40 / Jan Vrany <vranyj1@fel.cvut.cz>"
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   248
! !
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   249
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   250
!ProgrammingLanguage methodsFor:'accessing - classes'!
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   251
13250
3cad632753a7 added: #codeGeneratorClass
Claus Gittinger <cg@exept.de>
parents: 12990
diff changeset
   252
codeGeneratorClass
3cad632753a7 added: #codeGeneratorClass
Claus Gittinger <cg@exept.de>
parents: 12990
diff changeset
   253
    "Answer a class suitable for generating code (such as getters, setters, etc.)
3cad632753a7 added: #codeGeneratorClass
Claus Gittinger <cg@exept.de>
parents: 12990
diff changeset
   254
     It is ok to return nil, which means that no code can be generated automagically"
3cad632753a7 added: #codeGeneratorClass
Claus Gittinger <cg@exept.de>
parents: 12990
diff changeset
   255
3cad632753a7 added: #codeGeneratorClass
Claus Gittinger <cg@exept.de>
parents: 12990
diff changeset
   256
    ^ nil
3cad632753a7 added: #codeGeneratorClass
Claus Gittinger <cg@exept.de>
parents: 12990
diff changeset
   257
!
3cad632753a7 added: #codeGeneratorClass
Claus Gittinger <cg@exept.de>
parents: 12990
diff changeset
   258
11964
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   259
compilerClass
12099
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   260
    "Answer a class suitable for compiling a source code in 'my' language"
11964
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   261
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   262
    ^self subclassResponsibility
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   263
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   264
    "Created: / 21-08-2009 / 13:00:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   265
!
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   266
12099
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   267
evaluatorClass
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   268
    "Answer a class suitable for evaluating a doIt in 'my' language"
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   269
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   270
    ^ self compilerClass
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   271
!
11964
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   272
12099
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   273
explainerClass
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   274
    "Answers a class used by browser and debugger to
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   275
     show some hints about the code. It is OK to return
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   276
     nil, which means that there is no explainer for given
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   277
     language."
11964
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   278
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   279
    "return nil by default"
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   280
    ^nil
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   281
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   282
    "Created: / 21-08-2009 / 08:49:13 / Jan Vrany <vranyj1@fel.cvut.cz>"
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   283
!
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   284
12099
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   285
formatterClass
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   286
    "Answer a class suitable for prettyPrinting (indenting) code in 'my' language.
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   287
     It is ok to return nil, which means that the browser will not be able to prettyprint."
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   288
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   289
    ^ nil
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   290
!
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   291
13425
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   292
lookupClass
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   293
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   294
    ^BuiltinLookup
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   295
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   296
    "Created: / 17-03-2011 / 10:56:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   297
!
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   298
13256
9c32fe18a2ae +metaClass
Claus Gittinger <cg@exept.de>
parents: 13250
diff changeset
   299
metaClass
9c32fe18a2ae +metaClass
Claus Gittinger <cg@exept.de>
parents: 13250
diff changeset
   300
    "will be used for new classes (in the class wizard);
9c32fe18a2ae +metaClass
Claus Gittinger <cg@exept.de>
parents: 13250
diff changeset
   301
     a fallback here"
9c32fe18a2ae +metaClass
Claus Gittinger <cg@exept.de>
parents: 13250
diff changeset
   302
9c32fe18a2ae +metaClass
Claus Gittinger <cg@exept.de>
parents: 13250
diff changeset
   303
    ^ Metaclass
9c32fe18a2ae +metaClass
Claus Gittinger <cg@exept.de>
parents: 13250
diff changeset
   304
9c32fe18a2ae +metaClass
Claus Gittinger <cg@exept.de>
parents: 13250
diff changeset
   305
    "Created: / 30-01-2011 / 10:05:03 / cg"
9c32fe18a2ae +metaClass
Claus Gittinger <cg@exept.de>
parents: 13250
diff changeset
   306
!
9c32fe18a2ae +metaClass
Claus Gittinger <cg@exept.de>
parents: 13250
diff changeset
   307
11964
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   308
parserClass
12099
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   309
    "Answer a class suitable for parsing a source code in 'my' language"
11964
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   310
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   311
    ^self subclassResponsibility
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   312
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   313
    "Created: / 21-08-2009 / 13:00:30 / Jan Vrany <vranyj1@fel.cvut.cz>"
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   314
!
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   315
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   316
sourceFileReaderClass
12099
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   317
    "Answers a class that can be used for reading & compiling source files"
11964
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   318
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   319
    ^self subclassResponsibility
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   320
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   321
    "Created: / 16-08-2009 / 09:00:23 / Jan Vrany <vranyj1@fel.cvut.cz>"
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   322
!
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   323
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   324
sourceFileWriterClass
12099
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   325
    "Answers a class is used for source file writing (i.e. file-out)"
11964
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   326
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   327
    ^self subclassResponsibility
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   328
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   329
    "Created: / 16-08-2009 / 09:40:19 / Jan Vrany <vranyj1@fel.cvut.cz>"
12099
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   330
!
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   331
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   332
syntaxHighlighterClass
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   333
    "Answers a class used by browser and debugger to colorze code.
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   334
     It is OK to return nil, which means that the code is shown as-is"
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   335
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   336
    "return nil by default"
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   337
    ^nil
11964
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   338
! !
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   339
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   340
!ProgrammingLanguage methodsFor:'printing & storing'!
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   341
13425
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   342
printOn:aStream
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   343
    "append a printed representation if the receiver to the argument, aStream"
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   344
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   345
    self class printOn: aStream.
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   346
    aStream nextPutAll: ' instance'
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   347
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   348
    "Modified: / 19-06-2010 / 09:54:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   349
!
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   350
11964
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   351
storeOn:aStream
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   352
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   353
    self class == ProgrammingLanguage 
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   354
        ifTrue:
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   355
            [super storeOn:aStream]
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   356
        ifFalse:
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   357
            [aStream 
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   358
                nextPutAll:'ProgrammingLanguage';
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   359
                nextPutAll:' named: ';
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   360
                nextPutAll:self name storeString].
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   361
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   362
    "
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   363
        ProgrammingLanguage instance storeString  
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   364
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   365
        SmalltalkLanguage instance storeString 
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   366
    "
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   367
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   368
    "Created: / 16-08-2009 / 10:52:28 / Jan Vrany <vranyj1@fel.cvut.cz>"
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   369
! !
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   370
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   371
!ProgrammingLanguage methodsFor:'queries'!
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   372
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   373
canReadSourceFile: aFilename
12099
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   374
    "Answers true iff file contains source code in 'my' language"
11964
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   375
12099
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   376
    "Trivial implementation here, to be overriden by subclasses"
11964
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   377
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   378
    ^aFilename suffix = self sourceFileSuffix
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   379
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   380
    "Created: / 16-08-2009 / 10:10:33 / Jan Vrany <vranyj1@fel.cvut.cz>"
13425
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   381
!
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   382
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   383
supportsExtensionMethods
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   384
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   385
    "Answer true iff this language supports extension methods"
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   386
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   387
    ^true
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   388
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   389
    "Created: / 19-03-2011 / 10:02:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11964
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   390
! !
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   391
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   392
!ProgrammingLanguage methodsFor:'testing'!
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   393
13425
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   394
isJava
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   395
    "true iff this is the Java language"
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   396
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   397
    ^ false
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   398
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   399
    "Created: / 17-03-2011 / 10:16:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   400
!
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   401
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   402
isProgrammingLanguage
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   403
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   404
    ^true
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   405
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   406
    "Created: / 21-07-2010 / 15:14:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   407
!
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   408
12151
6f4f339cfa56 more stuff via programmingLanguage
Claus Gittinger <cg@exept.de>
parents: 12106
diff changeset
   409
isRuby
6f4f339cfa56 more stuff via programmingLanguage
Claus Gittinger <cg@exept.de>
parents: 12106
diff changeset
   410
    "true iff this is the ruby language"
6f4f339cfa56 more stuff via programmingLanguage
Claus Gittinger <cg@exept.de>
parents: 12106
diff changeset
   411
6f4f339cfa56 more stuff via programmingLanguage
Claus Gittinger <cg@exept.de>
parents: 12106
diff changeset
   412
    ^ false
6f4f339cfa56 more stuff via programmingLanguage
Claus Gittinger <cg@exept.de>
parents: 12106
diff changeset
   413
!
6f4f339cfa56 more stuff via programmingLanguage
Claus Gittinger <cg@exept.de>
parents: 12106
diff changeset
   414
6f4f339cfa56 more stuff via programmingLanguage
Claus Gittinger <cg@exept.de>
parents: 12106
diff changeset
   415
isSTXJavaScript
6f4f339cfa56 more stuff via programmingLanguage
Claus Gittinger <cg@exept.de>
parents: 12106
diff changeset
   416
    "true iff this is the ST/X-javascript language"
6f4f339cfa56 more stuff via programmingLanguage
Claus Gittinger <cg@exept.de>
parents: 12106
diff changeset
   417
6f4f339cfa56 more stuff via programmingLanguage
Claus Gittinger <cg@exept.de>
parents: 12106
diff changeset
   418
    ^ false
6f4f339cfa56 more stuff via programmingLanguage
Claus Gittinger <cg@exept.de>
parents: 12106
diff changeset
   419
!
6f4f339cfa56 more stuff via programmingLanguage
Claus Gittinger <cg@exept.de>
parents: 12106
diff changeset
   420
11964
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   421
isSmalltalk
12106
36fdc09bf6ac changed:7 methods
Claus Gittinger <cg@exept.de>
parents: 12101
diff changeset
   422
    "true iff this is the smalltalk language"
11964
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   423
12106
36fdc09bf6ac changed:7 methods
Claus Gittinger <cg@exept.de>
parents: 12101
diff changeset
   424
    ^ false
11964
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   425
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   426
    "Created: / 16-08-2009 / 09:01:27 / Jan Vrany <vranyj1@fel.cvut.cz>"
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   427
! !
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   428
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   429
!ProgrammingLanguage methodsFor:'utilities - file in/file out'!
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   430
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   431
fileIn: aFilename
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   432
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   433
    ^self sourceFileReaderClass fileIn: aFilename
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   434
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   435
    "Created: / 16-08-2009 / 13:28:17 / Jan Vrany <vranyj1@fel.cvut.cz>"
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   436
!
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   437
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   438
fileInStream: aStream
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   439
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   440
    ^self sourceFileReaderClass fileInStream: aStream
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   441
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   442
    "Created: / 16-08-2009 / 11:05:46 / Jan Vrany <vranyj1@fel.cvut.cz>"
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   443
! !
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   444
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   445
!ProgrammingLanguage methodsFor:'utilities - source code'!
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   446
12151
6f4f339cfa56 more stuff via programmingLanguage
Claus Gittinger <cg@exept.de>
parents: 12106
diff changeset
   447
methodTemplate
6f4f339cfa56 more stuff via programmingLanguage
Claus Gittinger <cg@exept.de>
parents: 12106
diff changeset
   448
    "return a method definition template string (or nil)"
6f4f339cfa56 more stuff via programmingLanguage
Claus Gittinger <cg@exept.de>
parents: 12106
diff changeset
   449
6f4f339cfa56 more stuff via programmingLanguage
Claus Gittinger <cg@exept.de>
parents: 12106
diff changeset
   450
    ^ nil
6f4f339cfa56 more stuff via programmingLanguage
Claus Gittinger <cg@exept.de>
parents: 12106
diff changeset
   451
!
6f4f339cfa56 more stuff via programmingLanguage
Claus Gittinger <cg@exept.de>
parents: 12106
diff changeset
   452
12106
36fdc09bf6ac changed:7 methods
Claus Gittinger <cg@exept.de>
parents: 12101
diff changeset
   453
writeComment:aStringOrStringCollection on:aStream 
12099
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   454
    "Utility method - writes a comment to a stream,
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   455
     using proper syntax"
11964
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   456
    
12099
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   457
    ^ self sourceFileWriterClass new 
396c8fa4a39a more queries; code cleanup
Claus Gittinger <cg@exept.de>
parents: 12056
diff changeset
   458
        fileOutComment: aStringOrStringCollection
11964
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   459
        on: aStream
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   460
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   461
    "Created: / 21-08-2009 / 09:35:07 / Jan Vrany <vranyj1@fel.cvut.cz>"
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   462
! !
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   463
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   464
!ProgrammingLanguage class methodsFor:'documentation'!
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   465
12048
03f10902431c added: #copyright
Claus Gittinger <cg@exept.de>
parents: 12012
diff changeset
   466
version_CVS
13425
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   467
    ^ '$Header: /cvs/stx/stx/libbasic/ProgrammingLanguage.st,v 1.15 2011-06-28 18:17:38 vrany Exp $'
12048
03f10902431c added: #copyright
Claus Gittinger <cg@exept.de>
parents: 12012
diff changeset
   468
!
03f10902431c added: #copyright
Claus Gittinger <cg@exept.de>
parents: 12012
diff changeset
   469
03f10902431c added: #copyright
Claus Gittinger <cg@exept.de>
parents: 12012
diff changeset
   470
version_SVN
13425
352177aa4eb1 Jan's changes
vrany
parents: 13256
diff changeset
   471
    ^ ' Id: ProgrammingLanguage.st 10643 2011-06-08 21:53:07Z vranyj1  '
11964
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   472
! !
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   473
ed7b8114d08a initial checkin
fm
parents:
diff changeset
   474
ProgrammingLanguage initialize!