|
Class: ParseNode
Object
|
+--ParseNode
|
+--AssignmentNode
|
+--BlockNode
|
+--BreakpointNode
|
+--JavaScriptClassNode
|
+--JavaScriptFunctionNode
|
+--JavaScriptParser::CommaExpression
|
+--JavaScriptParser::ConditionalNode
|
+--MessageNode
|
+--MethodNode
|
+--ParseErrorNode
|
+--PrimaryNode
|
+--ProgramNode
|
+--SelectorNode
|
+--StatementNode
- Package:
- stx:libcomp
- Category:
- System-Compiler-Support
- Version:
- rev:
1.96
date: 2019/08/11 12:19:07
- user: cg
- file: ParseNode.st directory: libcomp
- module: stx stc-classLibrary: libcomp
- Author:
- Claus Gittinger
node for parse-trees; abstract class
This is a helper class for the compiler.
instance creation
-
type: t
-
RBParser compatibility
-
children
-
-
containedBy: anInterval
-
-
intersectsInterval: anInterval
-
-
nodesDo: aBlock
-
-
start
-
for RBToken compat.
-
whichNodeIntersects: anInterval
-
I intersect
-
whichNodeIsContainedBy: anInterval
-
accessing
-
enclosingBlock
-
Return closest enclosing block node or nil
-
endPosition
-
the node's last character position in the original source
-
endPosition: aCharacterPosition
-
-
line
-
Compatibility
-
lineNumber
-
-
lineNumber: dummy
-
set linenumber - ignored here
-
parent
-
-
parent: aParseNode
-
-
parenthesized
-
-
parenthesized: aBoolean
-
-
parenthized
-
obsolete - typo in message name - use parenthesized
-
parenthized: aBoolean
-
obsolete - typo in message name - use parenthesized:
-
realNode
-
-
selectorPartPositions: selectorPartPositions
-
ignored here, but implemented because sent without checking
-
selectorPosition: aCharacterPosition
-
ignored here
-
startPosition
-
the node's character position in the original source
-
startPosition: start
-
-
startPosition: start endPosition: end
-
-
type
-
return the nodes type
attributes access
-
objectAttributes
-
(comment from inherited method)
return a Collection of attributes - nil if there is none.
The default implementation here uses a global WeakDictionary to store attributes
This may be too slow for high frequency slot access,
therefore, some classes may redefine this for better performance.
Notice the mentioning of a WeakDictionary - read the classes documentation.
-
objectAttributes: anObject
-
(comment from inherited method)
set the collection of attributes.
The default implementation here uses a global Dictionary to store
attributes which may be too slow for high frequency change&update.
Therefore, some classes may redefine this for better performance.
checks
-
plausibilityCheckIn: aParser
-
code generation
-
codeForSideEffectOn: aStream inBlock: b for: aCompiler
-
generate code for this statement - value not needed
-
codeForSimpleReturnOn: aStream inBlock: b lineNumber: lineNrOrNil for: aCompiler
-
generate code to return myself as a simple method return
-
codeInlineOn: aStream inBlock: b valueNeeded: valueNeeded for: aCompiler
-
generate code for this statement - value is needed
-
codeLineNumber: nr on: codeStream for: aCompiler
-
generate lineNumber information
-
codeOn: aStream inBlock: codeBlock for: aCompiler
-
code generation helpers
-
emitPushGlobalWithLiteralIndex: litIndex on: aTokenCodeStream for: aCompiler
-
-
emitPushLiteral: value on: aTokenCodeStream for: aCompiler
-
-
emitPushLiteralIndex: index on: aTokenCodeStream for: aCompiler
-
-
emitSendLiteralIndex: litIndex numArgs: nargs line: lineNr on: aStream for: aCompiler
-
-
emitStoreGlobalWithLiteralIndex: litIndex on: aTokenCodeStream for: aCompiler
-
-
emitSuperSendLiteralIndex: litIndex classLiteralIndex: clsLitIndex numArgs: nargs line: lineNr on: aStream for: aCompiler
-
enumeration
-
allNodesDo: aBlock
-
evaluate aBlock for each variable-node here and in subnodes
-
allSubNodesDo: aBlock
-
self subclassResponsibility.
-
messageNodesDo: aBlock
-
evaluate aBlock for each message-node here and in subnodes
-
messageSelectors
-
return a collection of message selectors
-
messageSelectorsDo: aBlock
-
evaluate aBlock for each message-selector here and in subnodes
-
messages
-
return a collection of messageNodes
-
messagesDo: aBlock
-
evaluate aBlock for each message-node here and in subnodes
-
variableNodesDo: aBlock
-
evaluate aBlock for each variable-node here and in subnodes
evaluation
-
evaluate
-
-
evaluateForCascade
-
-
evaluateForCascadeIn: anEnvironment
-
-
evaluateIn: anEnvironment
-
-
isStatement
-
printing & storing
-
printOn: aStream
-
append a user printed representation of the receiver to aStream.
The format is suitable for a human - not meant to be read back.
-
printOn: aStream indent: indent
-
append a user printed representation of the receiver to aStream.
The format is suitable for a human - not meant to be read back.
** This method raises an error - it must be redefined in concrete classes **
-
printOn: aStream indent: indent parenthized: parenthized
-
private
-
type: t
-
set the nodes type
queries
-
canReuseAsArg: anotherNode
-
-
collectBlocksInto: aCollection
-
-
containsReturn
-
-
positionToInsertPeriodForStatementSeparation
-
-
precedence
-
-
withConstantValueDo: aBlock
-
return true, if this evaluates to a constant value
and evaluate aBlock with it
testing
-
isAssignment
-
return true, if this is a node for an assignment
-
isBinaryMessage
-
return true, if this is a node for a binary send
-
isBlockNode
-
return true, if this is a node for a block
-
isBreakPointNode
-
-
isBreakStatement ( an extension from the stx:libjavascript package )
-
-
isCascade
-
-
isCascadeToSuper
-
-
isConstant
-
return true, if this is a node for a constant
-
isConstantNumber
-
return true, if this is a node for a constant number
-
isErrorNode
-
-
isFunctionCallNode
-
-
isFunctionNode
-
-
isGlobal
-
return true, if this is a node for a global variable
-
isGlobalNamed: globalName
-
return true, if this is a node for a particular global variable
-
isGlobalVariable
-
-
isImmutable
-
not used with ST/X -
for JavaScript nodes return true here.
-
isImplicitJavaScriptMessage
-
return true, if this is a node for an implicit getter/setter send
-
isInnerFunction
-
-
isInnerJavaScriptBlock
-
-
isJAVA
-
Return true, if receiver is global variable node JAVA.
Used to highlight Java class references.
-
isJavaPackageReference
-
Return true, given node is JAVA package reference in form:
JAVA package1 package2
-
isJavaScriptAndExpression
-
-
isJavaScriptArrayAccess
-
return true, if this is a node for a javascript array reference i.e. expr[]
-
isJavaScriptBlock
-
return true, if this is a node for a javascript block
-
isJavaScriptClassNode
-
-
isJavaScriptConditionalExpression
-
return true, if this is a node for a ?: expression
-
isJavaScriptOrExpression
-
-
isLiteral
-
for compatibility with RB-AST
-
isLiteralArray
-
for compatibility with RB-AST
-
isLiteralCString
-
for compatibility with RB-AST
-
isLocalVariable
-
-
isMessage
-
return true, if this is a node for a message expression
-
isMethodNode
-
-
isMethodVariable
-
-
isNew
-
return true, if this is a new XXXX node
-
isPostIncDec
-
for JavaScript
-
isPreIncDec
-
for JavaScript
-
isPrimary
-
return true, if this is a node for a primary (i.e. non-send)
-
isReturnNode
-
return true, if this is a node for a return expression
-
isSelf
-
return true, if this is a self-node
-
isStatementNode
-
return true, if this is a statement node
-
isSuper
-
return true, if this is a super-node
-
isThis
-
for JavaScript
-
isUnaryMessage
-
return true, if this is a node for a unary send
-
isVariable
-
return true, if this is a node for a variable
-
isVariableNode
-
return true, if this is a node for a variable
|