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.51 date: 2018/04/23 20:17:22
user: cg
file: StatementNode.st directory: libcomp
module: stx stc-classLibrary: libcomp
Author:
Claus Gittinger

Description:


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


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  allNodesDo: aBlock
evaluate aBlock for each node in this node and subnodes

o  allSubNodesDo: aBlock
evaluate aBlock for each subnodes

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

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.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Mon, 26 Feb 2024 15:51:52 GMT