|
Class: ParseNode
Object
|
+--ParseNode
|
+--AssignmentNode
|
+--BlockNode
|
+--BreakpointNode
|
+--JavaScriptClassNode
|
+--JavaScriptFunctionNode
|
+--JavaScriptParser::CommaExpression
|
+--JavaScriptParser::ConditionalNode
|
+--JavaScriptParser::JavaScriptMultiVariableNode
|
+--MessageNode
|
+--MethodNode
|
+--ParseErrorNode
|
+--PrimaryNode
|
+--ProgramNode
|
+--SelectorNode
|
+--StatementNode
- Package:
- stx:libcomp
- Category:
- System-Compiler-Support
- Version:
- rev:
1.124
date: 2024/02/13 20:10:18
- user: cg
- file: ParseNode.st directory: libcomp
- module: stx stc-classLibrary: libcomp
node for parse-trees; abstract class
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.
instance creation
-
type: t
-
queries
-
isAbstract
-
Return if this class is an abstract class.
True is returned here for myself only; false for subclasses.
Abstract subclasses must redefine this again.
RBParser compatibility
-
bestNodeFor: anInterval
-
-
children
-
-
childrenDo: aBlock
-
-
containedBy: anInterval
-
true if the interval contains me completely
-
intersectsInterval: anInterval
-
-
nodesDo: aBlock
-
-
start
-
for RBToken compat.
-
whichNodeIntersects: anInterval
-
I intersect
-
whichNodeIsContainedBy: anInterval
-
ouch: multiple children in interval
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: endIn
-
a synthetic node
-
type
-
return the node's type
attributes access
-
objectAttributes
-
return a Collection of attributes - nil if there is none.
-
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
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
codeThenDropOn: aStream inBlock: b for: aCompiler
-
generate code for this statement - value not needed
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
-
allMessageSelectorsDo: aBlock
-
evaluate aBlock for each message-node here and in subnodes
-
allMessagesDo: aBlock
-
evaluate aBlock for each message-node here and in subnodes
-
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
-
statements: statements do: aBlock
-
temporary hack
-
variableNodesDo: aBlock
-
evaluate aBlock for each variable-node here and in subnodes
evaluation
-
evaluate
-
-
evaluateForCascade
-
-
evaluateForCascadeIn: anEnvironment
-
-
evaluateIn: anEnvironment
-
** This method must be redefined in concrete classes (subclassResponsibility) **
-
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 must be redefined in concrete classes (subclassResponsibility) **
-
printOn: aStream indent: indent parenthized: parenthized
-
-
printStatementListOn: aStream indent: i
-
private
-
type: t
-
set the nodes type
queries
-
canReuseAsArg: anotherNode
-
-
collectBlocksInto: aCollection
-
-
containsReturn
-
-
parseNodeVisitorClass
-
-
positionToInsertPeriodForStatementSeparation
-
-
precedence
-
-
whoDefines: aName
-
return the node (blockNode) in which this variable is defined.
(nil if instvar, classvar or global)
-
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
-
isBlockArg
-
return true if this is a block argument
-
isBlockNode
-
return true, if this is a node for a block
-
isBlockVariable
-
return false here; to be redefined in subclass(es)
-
isBreakPointNode
-
-
isBreakStatement
( an extension from the stx:libjavascript package )
-
-
isCascade
-
-
isCascadeToSuper
-
-
isClassVariable
-
-
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 an existing! global variable
-
isGlobalNamed: globalName
-
return true, if this is a node for a particular
(and existing) global variable
-
isGlobalVariable
-
return true, if this is a node for global variable
-
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
-
return true, if this is a node for a constant
-
isLiteralArray
-
return true, if this is a node for an array constant
-
isLiteralCString
-
return true, if this is a node for a c-string constant
-
isLiteralString
-
return true, if this is a node for a string constant
-
isLocalVariable
-
return true, if this is a node for a local variable
-
isMessage
-
return true, if this is a node for a message expression
-
isMessageWithSelector: aStringOrSymbol
-
return true, if this is a node for a specific message expression
-
isMethodArg
-
-
isMethodNode
-
-
isMethodVariable
-
return true, if this is a node for a method local variable variable
-
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
-
isSequence
-
return true, if this is a sequence node (JS)
-
isStatementNode
-
return true, if this is a statement node
-
isSuper
-
return true, if this is a super-node
-
isSynthetic
-
true if I am a synthetic node (generated from embedded expression strings)
-
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
|