eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'SourceFileLoader':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: SourceFileLoader


Inheritance:

   Object
   |
   +--SourceFileLoader

Package:
stx:libcomp
Category:
System-Compiler
Version:
rev: 1.49 date: 2021/11/29 18:03:18
user: cg
file: SourceFileLoader.st directory: libcomp
module: stx stc-classLibrary: libcomp

Description:


Instances of this class are created temporary during fileIn.
They get notified about any errors. Currently, all we
do here is to output the error on the Transcript;
eventually, we will open a box showing the position of the error.

Also, information found in scanned compiler directives is remembered
here, for later queries (this is required, since the fileIn mechanism
creates new parsers for every chunk - someone has to remember this
information across chunks ...).

copyright

COPYRIGHT (c) 1995 by Claus Gittinger All Rights Reserved This software is furnished under a license and may be used only in accordance with the terms of that license and with the inclusion of the above copyright notice. This software may not be provided or otherwise made available to, or used by, any other person. No title to or ownership of the software is hereby transferred.

Class protocol:

instance creation
o  on: aStream


Instance protocol:

accessing
o  reader: something
to fileIn gravel-Smalltalk sources

o  source: aString
this is optionally sent by the chunk reader,
to pass a single chunks source before its evaluated.
This allows me to show the erroneous code in a TextView
(but this is not yet implemented)

compiler queries
o  autoDefineVariables

o  currentNameSpace
sent by the compiler to ask for the current nameSpace.
This is still to be finished ...

Usage example(s):

currentNameSpace := Smalltalk defaultNameSpace

o  isWorkspace
back-query from the compiler to ask if this is an interactive view
(for error feedback)

o  packageToInstall
sent by the compiler to ask in which package new methods/classes
are to be installed.
This is still to be finished ...

o  usedNameSpaces
sent by the compiler to ask for a list of used nameSpaces.
This is still to be finished ...

o  wantChangeLog
sent by the compiler to ask if a changeLog entry should
be written. Return false here, since SourceFileLaoders are
used to read existing source files

directive processing
o  addUsedSpace: aNameSpace
sent by the compiler, whenever it encounters a 'Uses:'
directive; collect used namespaces here, for later namespace
queries

o  addUsedSpaces: aNameSpaceList
sent by the compiler, whenever it encounters a 'Uses:'
directive; collect used namespaces here, for later namespace
queries

o  requirePackage: packageName
sent by the compiler, whenever it encounters a 'Prerequisites:'
directive. For now, this is ignored.
Will use the requirePackage stuff in Smalltalk, when finished.

o  setNameSpace: aNameSpaceName
sent by the compiler, whenever it encounters a 'NameSpace:'
directive. Remember the namespace for further variable resolving
and nameSpace queries.

o  setPackage: packageName
sent by the compiler, whenever it encounters a 'Package:'
directive. Remember the package for further queries.

o  setSyntax: aSyntaxName
sent by the compiler, whenever it encounters a 'Syntax:' directive.
Remember the syntax for further parsing.

error handling
o  correctableError: aMessage position: position to: endPos from: aCompiler
correctable error notification during fileIn.
This is sent by the compiler/evaluator if it detects undefined variables-errors.

o  correctableSelectorWarning: aMessage position: position to: endPos from: aCompiler
correctable error notification during fileIn.

o  correctableWarning: aMessage position: position to: endPos from: aCompiler
correctable error notification during fileIn.
This is sent by the compiler/evaluator if it detects undefined variables-errors.

o  error: aMessage position: position to: endPos from: aCompiler
error notification during fileIn.
This is sent by the compiler/evaluator if it detects errors.

o  insertAndSelect: aString at: aCharacterPosition
ST-80 compatible error notification during fileIn.

o  showWherePosition: position to: endPos from: aCompiler
show more details about the errors/warnings position.

o  unusedVariableWarning: aString position: relPos to: relEndPos from: aCompiler
compiler notifies us of a (or some) unused variables;
hilight the error (relPos to relEndPos) and show a Box asking for continue/correct/abort;
this method should return true to the compiler if user wants the error
to be corrected; false otherwise

o  warning: aMessage position: position to: endPos from: aCompiler
warning notification during fileIn - ignore it.
This is sent by the compiler/evaluator if it detects errors.

private-accessing
o  reader: aStream wantChangeLog: aBoolean


Private classes:

    SourceFileReader


ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sat, 21 Dec 2024 15:52:51 GMT