|
Class: ProgrammingLanguage
Object
|
+--ProgrammingLanguage
|
+--STXJavaScriptLanguage
|
+--SmalltalkLanguage
- Package:
- stx:libbasic
- Category:
- Kernel-Languages
- Version:
- rev:
1.50
date: 2019/06/27 10:38:16
- user: cg
- file: ProgrammingLanguage.st directory: libbasic
- module: stx stc-classLibrary: libbasic
provide info about which tools are to be used for code in
a programming language
Signal constants
-
languageQuerySignal
-
accessing
-
all
-
Anwers a collection of all available languages
usage example(s):
-
allSortedByNameExcept: filterBlock
-
Anwers a collection of all available languages
usage example(s):
ProgrammingLanguage allSortedByNameExcept:#isSmalltalk
|
-
current
-
ProgrammingLanguage current
-
instance
-
return this language's singleton
enumerating
-
allDetect: aBlock ifNone: exceptionValue
-
-
allDo: aBlock
-
ProgrammingLanguage allDo:[:l | Transcript showCR:l ]
initialization
-
initialize
-
(comment from inherited method)
called only once - initialize signals
instance creation
-
forFile: aFilename
-
Answers a language for given source file. If none is found,
SmalltalkLanguage is returned (to provide backward compatibility)
-
forStream: aStream
-
Answers a language for given source stream. If none is found,
SmalltalkLanguage is returned (to provide backward compatibility)
-
named: aString
-
ProgrammingLanguage named: 'Smalltalk'
ProgrammingLanguage named: 'JavaScript'
ProgrammingLanguage named: 'Ruby'
-
named: aString ifNone: aBlock
-
private
-
instancesDetect: detectBlock ifNone: failBlock
-
detect a langauge instance for which detectBlock returns true;
failBlock otherwise
queries
-
isAbstract
-
testing
-
isAvailable: langName
-
ProgrammingLanguage isAvailable: 'Smalltalk'
ProgrammingLanguage isAvailable: 'Ruby'
ProgrammingLanguage isAvailable: 'Haskell'
accessing
-
id
-
Return a unique integer id of this language.
For languages built into the VM, it must be < 32.
This id is used as index to various structures used by runtime
(bytecode set ?).
cg: this ought to be better documented - I have no idea, where it is used
** This method raises an error - it must be redefined in concrete classes **
-
imports
-
To make it polymorph with NameSpace for
selector-namespace enabled systems
-
lookup
-
-
name
-
Answers a human-readable name of myself:
'Smalltalk' for SmalltalkLanguage,
'Ruby' for RubyLanguage
...
Here, a fallback using the class name is generated.
-
sourceFileSuffix
-
Answers a default suffix for source files, i.e. 'st' for Smalltalk,
'js' for JavaScript or 'rb' for Ruby', etc.
** This method raises an error - it must be redefined in concrete classes **
-
toolbox ( an extension from the stx:libtool package )
-
Answer a toolbox for receiver. A toolbox is used by language-agnostic tools (such as
class browser) to perform language-specific tasks (search for implementors,
build implementor menu and so on. If nil is returned, no toolbox available
accessing-classes
-
codeGeneratorClass
-
Answer a class suitable for generating code (such as getters, setters, etc.)
It is ok to return nil, which means that no code can be generated automagically
-
compilerClass
-
Answer a class suitable for compiling a source code in 'my' language.
If nil is returned, no compiler is available (eg. language is for editors only)
-
compilerClassForInteractiveTools
-
Answer a compiler class suitable for usage in interactive tools.
Such class may better integrate into the IDE and register for undo/redo
and/or do more checks and so on. Defaults to #compilerClass
-
compilerWithBreakpointSupportClass
-
Answer a class suitable for compiling a source code with breakpoints
in 'my' language. If there is none, return nil.
-
evaluatorClass
-
Answer a class suitable for evaluating a doIt in 'my' language
-
explainerClass
-
Answers a class used by browser and debugger to
show some hints about the code. It is OK to return
nil, which means that there is no explainer for given
language.
-
formatterClass
-
Answer a class suitable for prettyPrinting (indenting) code in 'my' language.
It is ok to return nil, which means that the browser will not be able to prettyprint.
-
lookupClass
-
-
metaClass
-
will be used for new classes (in the class wizard);
a fallback here
-
parserClass
-
Answer a class suitable for parsing a source code in 'my' language
** This method raises an error - it must be redefined in concrete classes **
-
sourceFileReaderClass
-
Answers a class that can be used for reading & compiling source files
** This method raises an error - it must be redefined in concrete classes **
-
sourceFileWriterClass
-
Answers a class is used for source file writing (i.e. file-out)
** This method raises an error - it must be redefined in concrete classes **
-
syntaxHighlighterClass
-
Answers a class used by browser and debugger to colorize code.
It is OK to return nil, which means that the code is shown as-is
-
toolboxClass ( an extension from the stx:libtool package )
-
Answer a 'toolbox class'. A toolbox is used by language-agnostic tools (such as
class browser) to perform language-specific tasks (search for implementors,
build implementor menu and so on. If nil is returned, no toolbox available
-
valuePrinterClass
-
Answers a class used by the workspace to print a value.
If nil, the regular printOn: method is called for
displaying
-
displayString ( an extension from the stx:libtool package )
-
(comment from inherited method)
return a string used when displaying the receiver in a view;
for example an Inspector. This is usually the same as printString,
but sometimes redefined for a better look.
Notice: displayString and displayOn: are for developers, debugging and inspectors,
whereas printString and printOn: are for the program to print data.
Note: the base method (used by the inspector) is #displayOn:.
So you should implement #displayOn: instead of #displayString in subclasses.
printing & storing
-
printOn: aStream
-
append a printed representation of the receiver to the argument, aStream
-
storeOn: aStream
-
ProgrammingLanguage instance storeString
SmalltalkLanguage instance storeString
queries
-
canReadSourceFile: aFilename
-
Answers true iff file contains source code in 'my' language
-
defaultSelectorNameSpacePrefix
-
no namespace by default"
-
supportsExtensionMethods
-
Answer true iff this language supports extension methods
source queries
-
bracketStrings
-
used for autoindent
-
commentStrings
-
EOL comment
-
methodDefinitionTemplateForSelector: aSelector
-
given a selector, return a prototype definition string
usage example(s):
SmalltalkLanguage instance methodDefinitionTemplateForSelector:#foo
SmalltalkLanguage instance methodDefinitionTemplateForSelector:#+
SmalltalkLanguage instance methodDefinitionTemplateForSelector:#foo:bar:baz:
|
-
methodDefinitionTemplateForSelector: arg1 andArgumentNames: arg2
-
raise an error: must be redefined in concrete subclass(es)
** This method raises an error - it must be redefined in concrete classes **
testing
-
isGroovy
-
true iff this is the Groovy language
-
isJava
-
true iff this is the Java language
-
isJavaLike
-
true if receiver is kind of Java language (based on Java)
-
isProgrammingLanguage
-
(comment from inherited method)
return true if the receiver is a programming language.
False is returned here - the method is only redefined in
ProgrammingLanguage.
-
isRuby
-
true iff this is the ruby language
-
isSTXJavaScript
-
true iff this is the ST/X-javascript language
-
isSmalltalk
-
true iff this is the smalltalk language
utilities - file in/file out
-
fileIn: aFilename
-
-
fileInStream: aStream
-
utilities - source code
-
methodSourceForVersionMethodCVS: versionString
-
-
methodTemplate
-
return a method definition template string (or nil)
usage example(s):
^ writerClass methodTemplate
|
-
methodTemplateForDocumentation
-
return a documentation method definition template string (or nil)
-
methodTemplateForPackageDocumentation
-
return a documentation method definition template string (or nil) for packages
-
methodTemplateForVersionMethodCVS
-
-
parenthesisSpecificationForEditor
-
-
versionMethodTemplateForCVS
-
raise an error: must be redefined in concrete subclass(es)
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
writeComment: aStringOrStringCollection on: aStream
-
Utility method - writes a comment to a stream,
using proper syntax
|