eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'SunRPC::XDRScanner':

Home

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

Class: XDRScanner (in SunRPC)


Inheritance:

   Object
   |
   +--Scanner
      |
      +--SunRPC::XDRScanner

Package:
stx:goodies/communication
Category:
Net-Communication-SunRPC-XDR_IDL
Version:
rev: 1.17 date: 2024/04/22 17:44:58
user: stefan
file: SunRPC_XDRScanner.st directory: goodies/communication
module: stx stc-classLibrary: communication

Description:


scanner for XDR-definition files - provides token scanning functionality
for the XDRParser. (normally not used by its own).
XDR is the IDL of SunRPC.

copyright

COPYRIGHT (c) 2002 by eXept Software AG 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.

syntax

<<END declaration: type-specifier identifier | type-specifier identifier "[" value "]" | type-specifier identifier "<" [ value ] ">" | "opaque" identifier "[" value "]" | "opaque" identifier "<" [ value ] ">" | "string" identifier "<" [ value ] ">" | type-specifier "*" identifier | "void" value: constant | identifier type-specifier: [ "unsigned" ] "int" | [ "unsigned" ] "hyper" | "float" | "double" | "bool" | enum-type-spec | struct-type-spec | union-type-spec | identifier enum-type-spec: "enum" enum-body enum-body: "{" ( identifier "=" value ) ( "," identifier "=" value )* "}" struct-type-spec: "struct" struct-body struct-body: "{" ( declaration ";" ) ( declaration ";" )* "}" union-type-spec: "union" union-body union-body: "switch" "(" declaration ")" "{" ( "case" value ":" declaration ";" ) ( "case" value ":" declaration ";" )* [ "default" ":" declaration ";" ] "}" constant-def: "const" identifier "=" constant ";" type-def: "typedef" declaration ";" | "enum" identifier enum-body ";" | "struct" identifier struct-body ";" | "union" identifier union-body ";" program-def: "program" identifier "{" version-def version-def * "}" "=" constant ";" version-def: "version" identifier "{" procedure-def procedure-def * "}" "=" constant ";" procedure-def: type-specifier identifier "(" type-specifier ("," type-specifier )* ")" "=" constant ";" definition: type-def | constant-def | program-def specification: definition * END"

Class protocol:

initialization
o  initialize
(comment from inherited method)
initialize the classes defaults. Typically, these are changed
later in the 'private.rc' file.

o  setupActions
initialize the scanners actionTables - these are used to dispatch
into scanner methods as characters are read

Usage example(s):

     XDRScanner setupActions

o  update: something with: parameter from: changedObject
bug work-around (compiled cheap blocks loose their code)


Instance protocol:

accessing
o  newSource: aStringOrStream

o  source

initialization
o  initialize
initialize the scanner

private
o  checkForKeyword: string
check if string is a keyword (as opposed to an identifier).

o  isCommentCharacter: ch
return true, if ch is the comment-start character

o  pushBack: aToken

o  skipForClosing: closingToken with: openingToken

reading next token
o  nextCharacter
a single quote has been scanned; scan the character-string (caring for quotes).
TODO: C-escapes; \0xx; \0xxx

o  nextEq
'=' has been read - look for another '='

o  nextGT
'>' has been read - look for another '>'

o  nextLT
'<' has been read - look for another '<'

o  nextMinus
'-' has been read - look for another '-'

o  nextNumber
a digit has been read; scan a number (0xfoo / 0octal / decimal or float).
if specialFloat is true, return float value as hi.low (for version numbers)

o  nextPlus
'+' has been read - look for another '+'

o  nextSlash
'/' has been read - next could be:
'/' - EOL comment
'*' - regular comment

o  nextString
a doubled quote has been scanned; scan the string (caring for doubled quotes

o  nextToken
return the next token from my source-stream

specials
o  readingStream: aStream do: aBlock

o  restOfLine



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