eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'ReturnNode':

Home

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

Class: ReturnNode


Inheritance:

   Object
   |
   +--ParseNode
      |
      +--StatementNode
         |
         +--ReturnNode
            |
            +--JavaScriptParser::JavaScriptReturnNode

Package:
stx:libcomp
Category:
System-Compiler-Support
Version:
rev: 1.45 date: 2014/06/13 10:24:03
user: cg
file: ReturnNode.st directory: libcomp
module: stx stc-classLibrary: libcomp
Author:
Claus Gittinger

Description:


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


Instance protocol:

accessing
o  expression: e
any block, which is returned cannot be inlined.

o  home

o  home: someOne blockHome: aBlockNode

o  lineNumber: something
set lineNr

checks
o  plausibilityCheckIn: aParser
check for return-in-return, as in
^ foo ifTrue:[ ^x]
that is (currently) not compilable by stc (generates bad C-code for it).
TODO: rewite to use lint/lint rules and apply them before accepting

code generation
o  basicCodeOn: aStream inBlock: b for: aCompiler
return from homeContext in a block

o  codeForSideEffectOn: aStream inBlock: b for: aCompiler
redefined - drop not needed since notreached

o  codeForSimpleReturnOn: aStream inBlock: b lineNumber: lineNrOrNil for: aCompiler
generate code to return myself as a simple method return

o  codeLocalReturnOn: aStream inBlock: b for: aCompiler

o  codeOn: aStream inBlock: b for: aCompiler
aCompiler parserFlags allowPossibleSTCCompilationProblems ifFalse:[

enumerating
o  nodeDo: anEnumerator
helper for parse tree walking

evaluation
o  evaluateExpressionIn: anEnvironment
when we arrive here, the parser context is already gone
- try block-return

printing & storing
o  printOn: aStream indent: i

queries
o  isConstant

o  isJavaScriptReturnNode

o  isReturnNode

o  isSimpleConstant

o  isSimpleExpression

o  isSimpleVariable

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



ST/X 7.1.0.0; WebServer 1.663 at exept.de:8081; Wed, 19 Sep 2018 05:26:30 GMT