eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'StatementNode':

Home

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

Class: StatementNode


Inheritance:

   Object
   |
   +--ParseNode
      |
      +--StatementNode
         |
         +--JavaScriptParser::JavaScriptStatementNode
         |
         +--PrimitiveNode
         |
         +--ReturnNode

Package:
stx:libcomp
Category:
System-Compiler-Support
Version:
rev: 1.54 date: 2021/01/20 10:29:10
user: cg
file: StatementNode.st directory: libcomp
module: stx stc-classLibrary: libcomp

Description:


node for parse-trees, representing statements
This is a helper class for the compiler.

copyright

COPYRIGHT (c) 1989 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  expression: e


Instance protocol:

accessing
o  expression

o  expression: something

o  isStatement

o  last
return the last statement in a list

o  lineNumber
return lineNr

o  lineNumber: something
set lineNr

o  lineNumberOfFirstMessage

o  nextStatement

o  nextStatement: s

o  parent: aParseNode

code generation
o  codeAllForSideEffectOn: aStream inBlock: b for: aCompiler

o  codeForSideEffectOn: aStream inBlock: b for: aCompiler
generate code for this statement - value not needed

o  codeOn: aStream inBlock: b for: aCompiler
generate code for this statement

converting
o  asCollectionOfStatements
returns a orderedCollection of statements,
representing the list of which the receiver is the head

enumerating
o  allMessageSelectorsDo: aBlock
evaluate aBlock for each message-selector sent by this statement and all followup statements

o  allMessagesDo: aBlock
evaluate aBlock for each message-node sent by this statement and all followup statements

o  allNodesDo: aBlock
evaluate aBlock for each node in this node and subnodes

o  allSubNodesDo: aBlock
evaluate aBlock for each subnodes

o  childrenDo: aBlock

o  do: aBlock
in st/x, statements is a linked list (not an ordered collection),
this provides some dialect compatibility (for st2js)

o  messageSelectorsDo: aBlock
evaluate aBlock for each message-selector sent by this node and subnodes

o  messagesDo: aBlock
evaluate aBlock for each message-node sent by this node and subnodes

o  nodeDo: anEnumerator
helper for parse tree walking

o  variableNodesDo: aBlock
evaluate aBlock for each variable-node in this node and subnodes

evaluation
o  evaluateAllIn: anEnvironment
this could be done more elegant - but with lots of recursion

o  evaluateExpressionIn: anEnvironment

o  evaluateIn: anEnvironment

printing & storing
o  printAllOn: aStream

o  printAllOn: aStream indent: i

o  printOn: aStream indent: i
(comment from inherited method)
append a user printed representation of the receiver to aStream.
The format is suitable for a human - not meant to be read back.

queries
o  collectBlocksInto: aCollection

o  containsReturn

o  containsReturnInAnyStatement

o  isSimpleConstant

o  isSimpleExpression

o  isSimpleVariable

o  listEndsWithReturn

testing
o  isStatementNode
(comment from inherited method)
return true, if this is a statement node

visiting
o  acceptVisitor: aVisitor
Double dispatch back to the visitor, passing my type encoded in
the selector (visitor pattern)



ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sat, 21 Dec 2024 16:40:27 GMT