|
Class: ReturnNode
Object
|
+--ParseNode
|
+--StatementNode
|
+--ReturnNode
|
+--JavaScriptParser::JavaScriptReturnNode
- Package:
- stx:libcomp
- Category:
- System-Compiler-Support
- Version:
- rev:
1.51
date: 2023/06/04 09:30:13
- user: cg
- file: ReturnNode.st directory: libcomp
- module: stx stc-classLibrary: libcomp
node for parse-trees, representing return expressions
This is a helper class for the compiler.
copyrightCOPYRIGHT (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.
accessing
-
expression: e
-
any block, which is returned cannot be inlined.
-
home
-
-
home: someOne blockHome: aBlockNode
-
-
lineNumber: something
-
set lineNr
checks
-
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
-
basicCodeOn: aStream inBlock: b for: aCompiler
-
Transcript showCR:'====> %1 [%2]' with:lineNr with:expression printString.
-
codeForSideEffectOn: aStream inBlock: b for: aCompiler
-
redefined - drop not needed since notreached
-
codeForSimpleReturnOn: aStream inBlock: b lineNumber: lineNrOrNil for: aCompiler
-
generate code to return myself as a simple method return
-
codeLocalReturnOn: aStream inBlock: b for: aCompiler
-
-
codeOn: aStream inBlock: b for: aCompiler
-
aCompiler parserFlags allowPossibleSTCCompilationProblems ifFalse:[
enumerating
-
nodeDo: anEnumerator
-
helper for parse tree walking
enumeration
-
childrenDo: aBlock
-
evaluation
-
evaluateExpressionIn: anEnvironment
-
when we arrive here, the parser context is already gone
- try block-return
printing & storing
-
printOn: aStream indent: i
-
queries
-
isJavaScriptReturnNode
-
-
isReturnNode
-
-
isSimpleConstant
-
-
isSimpleExpression
-
-
isSimpleVariable
-
visiting
-
acceptVisitor: aVisitor
-
Double dispatch back to the visitor, passing my type encoded in
the selector (visitor pattern)
|