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