eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'ProgrammingLanguage':

Home

everywhere
www.exept.de
for:
[back]

Class: ProgrammingLanguage


Inheritance:

   Object
   |
   +--ProgrammingLanguage
      |
      +--STXJavaScriptLanguage
      |
      +--SmalltalkLanguage

Package:
stx:libbasic
Category:
Kernel-Languages
Version:
rev: 1.10 date: 2009/12/04 11:21:32
user: cg
file: ProgrammingLanguage.st directory: libbasic
module: stx stc-classLibrary: libbasic

Description:


provide info about which tools are to be used for code in
a programming language


Class protocol:

Signal constants
o  languageQuerySignal

accessing
o  all
Anwers a collection of all available languages

o  current
ProgrammingLanguage current

o  instance
return this languages singleton

enumerating
o  allDetect: aBlock ifNone: exceptionValue

o  allDo: aBlock

initialization
o  initialize

instance creation
o  forFile: aFilename
Answers a language for given source file. If none is found,
SmalltalkLanguage is returned (to provide backward compatibility)

o  forStream: aStream
Answers a language for given source stream. If none is found,
SmalltalkLanguage is returned (to provide backward compatibility)

o  named: aString

o  named: aString ifNone: aBlock

private
o  instancesDetect: detectBlock ifNone: failBlock

testing
o  isAvailable: langName


Instance protocol:

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


** This method raises an error - it must be redefined in concrete classes **

o  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 **

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

** This method raises an error - it must be redefined in concrete classes **

o  evaluatorClass
Answer a class suitable for evaluating a doIt 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
language.

o  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.

o  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 **

o  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 **

o  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 **

o  syntaxHighlighterClass
Answers a class used by browser and debugger to colorze code.
It is OK to return nil, which means that the code is shown as-is

printing & storing
o  storeOn: aStream

queries
o  canReadSourceFile: aFilename
Answers true iff file contains source code in 'my' language

testing
o  isRuby
true iff this is the ruby language

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

o  isSmalltalk
true iff this is the smalltalk language

utilities - file in/file out
o  fileIn: aFilename

o  fileInStream: aStream

utilities - source code
o  methodTemplate
return a method definition template string (or nil)

o  writeComment: aStringOrStringCollection on: aStream
Utility method - writes a comment to a stream,
using proper syntax



ST/X 6.1.1; WebServer 1.620 at exept:8081; Wed, 23 May 2012 20:44:01 GMT