eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'RBScanner':

Home

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

Class: RBScanner


Inheritance:

   Object
   |
   +--Stream
      |
      +--RBScanner

Package:
stx:goodies/refactoryBrowser/parser
Category:
Refactory-Scanner
Version:
rev: 1.137 date: 2024/02/10 07:52:47
user: cg
file: RBScanner.st directory: goodies/refactoryBrowser/parser
module: stx stc-classLibrary: parser
Author:
cg

Description:


documentation to be added.

class:
    <a short class summary here, describing what instances represent>

responsibilities:    
    <describing what my main role is>

collaborators:    
    <describing with whom and how I talk to>

API:
    <public api and main messages>
    
example:
    <a one-line examples on how to use - can also be in a separate example method>

implementation:
    <implementation points>


[instance variables:]

[class variables:]


Related information:



Class protocol:

accessing
o  classificationTable

o  metaVariableCharacter

o  patternVariableCharacter

class initialization
o  initialize
plus-or-minus

Usage example(s):

self initializeChars: '().:;[]^' to: #special. 

Usage example(s):

        self initialize

o  initializeChars: characters to: aSymbol

instance creation
o  on: aStream

o  on: aStream errorBlock: aBlock

o  rewriteOn: aStream

o  rewriteOn: aStream errorBlock: aBlock

o  rewriteSavingCommentsOn: aStream

o  rewriteSavingCommentsOn: aStream errorBlock: aBlock

o  searchOn: aStream errorBlock: aBlock

testing
o  isSelector: aSymbol

o  isVariable: aString


Instance protocol:

accessing
o  addToCommentsBeforeToken: aCollection

o  classificationTable: anObject

o  contents
(comment from inherited method)
return the entire contents of the stream.
For a readStream, that is the rest (i.e. upToEnd),
for a writeStream, that is the collected data. As we do not know here,
what we are, this is the responsibility of a subclass...

o  currentCharacter

o  currentPosition

o  errorBlock: aBlock

o  extendedLanguage

o  extendedLanguage: aBoolean

o  flush

o  forceStringContinuation: typeOfString
a hack to enforce a fragment of an eString or iString to be returned
See parser

o  getComments

o  getCommentsAfterToken

o  getCommentsAfterTokenIfInLine: lineNrArg

o  getCommentsBeforeToken

o  ignoreComments

o  nextPut: anObject
Provide an error notification that the receiver does not
implement this message.

o  rememberTokens: aBoolean
enable token remembering.
In case of an error, this allows for the tokens which have been collected
so far to be fetched. Useful for code completion of incomplete (erroneous) code.

o  rememberedTokens
In case of an error, this allows for the tokens which have been collected
so far to be fetched. Useful for code completion of incomplete (erroneous) code.

o  saveComments

o  saveComments: aBoolean

o  tokenLineNumber

o  tokenStart

error handling
o  errorBlock

o  errorPosition

o  scannerError: aString
Evaluate the block. If it returns raise an error

initialization & release
o  allowMatchCharsInSelector: aBoolean
special for DWIM: if true, a star is allowed inside a selector,
and this will be completed by matching selectors

o  initializeForIBM

o  initializeForSmalltalkX

o  initializeForSqueak

o  initializeForVisualWorks

o  on: aStream
OrderedCollection new.

private
o  bufferContents

o  classify: aCharacter

o  previousStepPosition

o  step
fetches the next currentCharacter and assigns the classified characterType

private-scanning
o  scanAnySymbol

o  scanBinary: aClass alreadyRead: prevCharacter
This doesn't parse according to the ANSI draft. It only parses 1 or 2 letter binary tokens.

o  scanByteArray

o  scanExponentMultipler
Did not read a valid exponent, e must be start of a message send

o  scanExtendedLiterals

o  scanExtendedSymbol
scan symbols like #. which are allowed by Squeak and ST/X but aren't standard

o  scanIdentifierOrKeyword
special: c'...' or e'...' is scanned as a C-string

o  scanLiteralArray

o  scanLiteralCString: nodeClass

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  scanLiteralCharacter
$

o  scanLiteralSTXSpecialStringWithType: stringTypePrefix
stringTypePrefix is one of 'c', 'e', 'i' or 'r';
the initial quote MUST have already been read

o  scanLiteralString

o  scanLiteralString: class

o  scanName
scan over alphanumeric characters.
collect in buffer

o  scanNamespaceName

o  scanNumber
numberType is either: scanNumberIBM or scanNumberVisualWorks,

o  scanNumberIBM

o  scanNumberOfBase: anInteger
Scan a number. Return the number or nil if the current input isn't a valid number.

o  scanNumberVisualWorks
that's actually ST/X - not VisualWorks

o  scanNumberWithoutExponent
Scan an IBM number with the radix -- don't scan the exponent though

o  scanOldStyleAssignOrIdentifier
invoked when an underscore is encountered

o  scanPatternVariable
ST/X new: `' makes it a regex-string '

o  scanQualifier

o  scanSTXPrimitiveCode
scan an inline C-primitive; % { has already been read.

o  scanSpecialCharacter
bad hack - must not skip spaces after the brace

o  scanStringSymbol

o  stripCommentInto: whichCommentCollection
an EOL comment; stop is the char pos BEFORE the cr

o  stripSeparators

o  stripSeparatorsAndCommentsInto: whichCommentCollection

scanning
o  next
The EOF token should occur after the end of input

o  scanBinary: tokenClass
scan a binary selector.
Special:
in '-<digit>', the '-' is scanned as a sign;
this affects code like: 0@-1,
which has a '@' selector and -1 as arg,
not '@-' and 1 as arg.

o  scanLiteral

o  scanLiteralArrayParts

o  scanSymbol
Squeak symbols may begin with a colon

o  scanToken
fast-n-ugly. Don't write stuff like this. Has been found to cause cancer in laboratory rats. Basically a
case statement. Didn't use Dictionary because lookup is pretty slow.

testing
o  atEnd
(comment from inherited method)
return true if the end of the stream has been reached;
- we do not know here how to do it, it must be redefined in subclass

o  isReadable

o  isWritable



ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Mon, 18 Nov 2024 06:29:53 GMT