eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'STXJavaScriptLanguage':



Class: STXJavaScriptLanguage



rev: 1.21 date: 2019/06/27 10:38:39
user: cg
file: STXJavaScriptLanguage.st directory: libjavascript
module: stx stc-classLibrary: libjavascript


provide info about which tools are to be used for the
embedded JavaScript-like language in Smalltalk (not a real JavaScript,
that's why it's called STXJavaScript)

Instance protocol:

o  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

o  name
Answers a human-readable name of myself:
'Smalltalk' for SmalltalkLanguage,
'Ruby' for RubyLanguage...

o  sourceFileSuffix
Answers a default suffix for source files, i.e.
'st' for Smalltalk, 'js' for JavaScript or 'rb' for Ruby', etc.

o  codeGeneratorClass
Answers a class that can generate code

o  compilerClass
Answer a class suitable for compiling a source code in 'my' language

o  compilerWithBreakpointSupportClass
Answer a class suitable for compiling a source code with breakpoints
in 'my' language

o  evaluatorClass
Answer a class suitable for doit evaluation in 'my' language

o  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

o  metaClass
will be used for new classes (in the class wizard)

o  parserClass
Answer a class suitable for parsing a source code in 'my' language

o  sourceFileReaderClass
Answers a class that can be used for
reading & compiling source files

o  sourceFileWriterClass
Answers a class is used for source file writing (i.e. file-out)

o  syntaxHighlighterClass
return the class to use for syntaxHighlighting (prettyPrinting) this class -
this can be redefined in special classes, to highlight classes with
Lisp, Prolog, ASN1, Basic :-) or whatever syntax.

source queries
o  bracketStrings
used for autoindent

o  commentStrings
EOL comment

o  methodDefinitionTemplateForSelector: aSelector andArgumentNames: argNames
given a selector, return a prototype definition string

usage example(s):

     STXJavaScriptLanguage instance 
        methodDefinitionTemplateForSelector:#foo andArgumentNames:#()

     STXJavaScriptLanguage instance
        methodDefinitionTemplateForSelector:#+ andArgumentNames:#('aNumber')

     STXJavaScriptLanguage instance
        methodDefinitionTemplateForSelector:#foo:bar:baz: andArgumentNames:#('fooArg' 'barArg' 'bazArg')

o  isSTXJavaScript
true iff this is the ST/X-javascript language

ST/X; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Sun, 28 May 2023 22:20:33 GMT