12047
|
1 |
"
|
|
2 |
COPYRIGHT (c) 2009 by eXept Software AG
|
|
3 |
All Rights Reserved
|
|
4 |
|
|
5 |
This software is furnished under a license and may be used
|
|
6 |
only in accordance with the terms of that license and with the
|
|
7 |
inclusion of the above copyright notice. This software may not
|
|
8 |
be provided or otherwise made available to, or used by, any
|
|
9 |
other person. No title to or ownership of the software is
|
|
10 |
hereby transferred.
|
|
11 |
"
|
11965
|
12 |
"{ Package: 'stx:libbasic' }"
|
|
13 |
|
|
14 |
ProgrammingLanguage subclass:#SmalltalkLanguage
|
|
15 |
instanceVariableNames:''
|
|
16 |
classVariableNames:''
|
|
17 |
poolDictionaries:''
|
|
18 |
category:'Kernel-Languages'
|
|
19 |
!
|
|
20 |
|
|
21 |
!SmalltalkLanguage class methodsFor:'documentation'!
|
|
22 |
|
12047
|
23 |
copyright
|
|
24 |
"
|
|
25 |
COPYRIGHT (c) 2009 by eXept Software AG
|
|
26 |
All Rights Reserved
|
|
27 |
|
|
28 |
This software is furnished under a license and may be used
|
|
29 |
only in accordance with the terms of that license and with the
|
|
30 |
inclusion of the above copyright notice. This software may not
|
|
31 |
be provided or otherwise made available to, or used by, any
|
|
32 |
other person. No title to or ownership of the software is
|
|
33 |
hereby transferred.
|
|
34 |
"
|
11965
|
35 |
! !
|
|
36 |
|
|
37 |
!SmalltalkLanguage methodsFor:'accessing'!
|
|
38 |
|
|
39 |
name
|
|
40 |
"
|
|
41 |
Answers a human-readable name of myself:
|
|
42 |
'Smalltalk' for SmalltalkLanguage,
|
|
43 |
'Ruby' for RubyLanguage...
|
|
44 |
"
|
|
45 |
|
|
46 |
^'Smalltalk'
|
|
47 |
|
|
48 |
"Modified: / 16-08-2009 / 10:53:35 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
49 |
!
|
|
50 |
|
|
51 |
sourceFileSuffix
|
|
52 |
"
|
|
53 |
Answers a default suffix for source files, i.e.
|
|
54 |
'st' for Smalltalk, 'js' for JavaScript or 'rb' for Ruby'
|
|
55 |
"
|
|
56 |
|
|
57 |
^'st'
|
|
58 |
|
|
59 |
"Modified: / 16-08-2009 / 10:53:52 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
60 |
! !
|
|
61 |
|
|
62 |
!SmalltalkLanguage methodsFor:'accessing - classes'!
|
|
63 |
|
|
64 |
compilerClass
|
|
65 |
"
|
|
66 |
Answer a class suitable for compiling a source code
|
|
67 |
in 'my' language
|
|
68 |
"
|
|
69 |
|
|
70 |
^Smalltalk::Compiler
|
|
71 |
|
|
72 |
"Modified: / 21-08-2009 / 13:02:27 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
73 |
!
|
|
74 |
|
|
75 |
explainerClass
|
|
76 |
|
|
77 |
"
|
|
78 |
Answers a class used by browser and debugger to
|
|
79 |
show some hints about the code. It is OK to return
|
|
80 |
nil, which means that there is no explainer for given
|
|
81 |
language.
|
|
82 |
"
|
|
83 |
|
|
84 |
"return nil by default"
|
|
85 |
^Explainer
|
|
86 |
|
|
87 |
"Created: / 21-08-2009 / 08:49:29 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
88 |
!
|
|
89 |
|
|
90 |
parserClass
|
|
91 |
"
|
|
92 |
Answer a class suitable for parsing a source code
|
|
93 |
in 'my' language
|
|
94 |
"
|
|
95 |
|
|
96 |
^Smalltalk::Parser
|
|
97 |
|
|
98 |
"Modified: / 21-08-2009 / 13:02:21 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
99 |
!
|
|
100 |
|
|
101 |
sourceFileReaderClass
|
|
102 |
"
|
|
103 |
Answers a class that can be used for
|
|
104 |
reading & compiling source files
|
|
105 |
"
|
|
106 |
|
|
107 |
^SmalltalkChunkFileSourceReader
|
|
108 |
|
|
109 |
"Modified: / 16-08-2009 / 12:29:39 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
110 |
!
|
|
111 |
|
|
112 |
sourceFileWriterClass
|
|
113 |
"
|
|
114 |
Answers a class is used for source file
|
|
115 |
writing (i.e. file-out)
|
|
116 |
"
|
|
117 |
|
|
118 |
^SmalltalkChunkFileSourceWriter
|
|
119 |
|
|
120 |
"Modified: / 16-08-2009 / 09:51:41 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
121 |
! !
|
|
122 |
|
|
123 |
!SmalltalkLanguage methodsFor:'mimicry'!
|
|
124 |
|
|
125 |
, anObject
|
|
126 |
"
|
|
127 |
Emulates symbol behavior. This is sometimes required
|
|
128 |
as Smalltalk language is used by legacy code to access
|
|
129 |
current language. Future versions should contain class
|
|
130 |
Locale.
|
|
131 |
"
|
|
132 |
|
|
133 |
^Language , anObject
|
|
134 |
|
|
135 |
"Created: / 22-08-2009 / 09:33:44 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
136 |
!
|
|
137 |
|
|
138 |
asSymbol
|
|
139 |
"
|
|
140 |
Returns a language symbol. This is sometimes required
|
|
141 |
as Smalltalk language is used by legacy code to access
|
|
142 |
current language. Future versions should contain class
|
|
143 |
Locale.
|
|
144 |
"
|
|
145 |
|
|
146 |
^Language
|
|
147 |
|
|
148 |
"Created: / 22-08-2009 / 09:33:16 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
149 |
! !
|
|
150 |
|
|
151 |
!SmalltalkLanguage methodsFor:'testing'!
|
|
152 |
|
|
153 |
isSmalltalk
|
|
154 |
|
|
155 |
^true
|
|
156 |
|
|
157 |
"Created: / 16-08-2009 / 09:01:38 / Jan Vrany <vranyj1@fel.cvut.cz>"
|
|
158 |
! !
|
|
159 |
|
|
160 |
!SmalltalkLanguage class methodsFor:'documentation'!
|
|
161 |
|
|
162 |
version
|
12057
|
163 |
^ '$Header: /cvs/stx/stx/libbasic/SmalltalkLanguage.st,v 1.4 2009-09-30 12:06:45 fm Exp $'
|
12047
|
164 |
!
|
|
165 |
|
|
166 |
version_CVS
|
12057
|
167 |
^ '$Header: /cvs/stx/stx/libbasic/SmalltalkLanguage.st,v 1.4 2009-09-30 12:06:45 fm Exp $'
|
12047
|
168 |
!
|
|
169 |
|
|
170 |
version_SVN
|
12057
|
171 |
^'Id: SmalltalkLanguage.st 10468 2009-08-22 08:34:50Z vranyj1 '
|
11965
|
172 |
! !
|