eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'ParseNode':

Home

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

Class: ParseNode


Inheritance:

   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

Description:


node for parse-trees; abstract class
This is a helper class for the compiler.


Class protocol:

instance creation
o  type: t


Instance protocol:

RBParser compatibility
o  children

o  containedBy: anInterval

o  intersectsInterval: anInterval

o  nodesDo: aBlock

o  start
for RBToken compat.

o  whichNodeIntersects: anInterval
I intersect

o  whichNodeIsContainedBy: anInterval

accessing
o  enclosingBlock
Return closest enclosing block node or nil

o  endPosition
the node's last character position in the original source

o  endPosition: aCharacterPosition

o  line
Compatibility

o  lineNumber

o  lineNumber: dummy
set linenumber - ignored here

o  parent

o  parent: aParseNode

o  parenthesized

o  parenthesized: aBoolean

o  parenthized
obsolete - typo in message name - use parenthesized

o  parenthized: aBoolean
obsolete - typo in message name - use parenthesized:

o  realNode

o  selectorPartPositions: selectorPartPositions
ignored here, but implemented because sent without checking

o  selectorPosition: aCharacterPosition
ignored here

o  startPosition
the node's character position in the original source

o  startPosition: start

o  startPosition: start endPosition: end

o  type
return the nodes type

attributes access
o  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.

o  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
o  plausibilityCheckIn: aParser

code generation
o  codeForSideEffectOn: aStream inBlock: b for: aCompiler
generate code for this statement - value not needed

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

o  codeInlineOn: aStream inBlock: b valueNeeded: valueNeeded for: aCompiler
generate code for this statement - value is needed

o  codeLineNumber: nr on: codeStream for: aCompiler
generate lineNumber information

o  codeOn: aStream inBlock: codeBlock for: aCompiler

code generation helpers
o  emitPushGlobalWithLiteralIndex: litIndex on: aTokenCodeStream for: aCompiler

o  emitPushLiteral: value on: aTokenCodeStream for: aCompiler

o  emitPushLiteralIndex: index on: aTokenCodeStream for: aCompiler

o  emitSendLiteralIndex: litIndex numArgs: nargs line: lineNr on: aStream for: aCompiler

o  emitStoreGlobalWithLiteralIndex: litIndex on: aTokenCodeStream for: aCompiler

o  emitSuperSendLiteralIndex: litIndex classLiteralIndex: clsLitIndex numArgs: nargs line: lineNr on: aStream for: aCompiler

enumeration
o  allNodesDo: aBlock
evaluate aBlock for each variable-node here and in subnodes

o  allSubNodesDo: aBlock
self subclassResponsibility.

o  messageNodesDo: aBlock
evaluate aBlock for each message-node here and in subnodes

o  messageSelectors
return a collection of message selectors

o  messageSelectorsDo: aBlock
evaluate aBlock for each message-selector here and in subnodes

o  messages
return a collection of messageNodes

o  messagesDo: aBlock
evaluate aBlock for each message-node here and in subnodes

o  variableNodesDo: aBlock
evaluate aBlock for each variable-node here and in subnodes

evaluation
o  evaluate

o  evaluateForCascade

o  evaluateForCascadeIn: anEnvironment

o  evaluateIn: anEnvironment

o  isStatement

printing & storing
o  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.

o  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 **

o  printOn: aStream indent: indent parenthized: parenthized

private
o  type: t
set the nodes type

queries
o  canReuseAsArg: anotherNode

o  collectBlocksInto: aCollection

o  containsReturn

o  positionToInsertPeriodForStatementSeparation

o  precedence

o  withConstantValueDo: aBlock
return true, if this evaluates to a constant value
and evaluate aBlock with it

testing
o  isAssignment
return true, if this is a node for an assignment

o  isBinaryMessage
return true, if this is a node for a binary send

o  isBlockNode
return true, if this is a node for a block

o  isBreakPointNode

o  isBreakStatement
( an extension from the stx:libjavascript package )

o  isCascade

o  isCascadeToSuper

o  isConstant
return true, if this is a node for a constant

o  isConstantNumber
return true, if this is a node for a constant number

o  isErrorNode

o  isFunctionCallNode

o  isFunctionNode

o  isGlobal
return true, if this is a node for a global variable

o  isGlobalNamed: globalName
return true, if this is a node for a particular global variable

o  isGlobalVariable

o  isImmutable
not used with ST/X -
for JavaScript nodes return true here.

o  isImplicitJavaScriptMessage
return true, if this is a node for an implicit getter/setter send

o  isInnerFunction

o  isInnerJavaScriptBlock

o  isJAVA
Return true, if receiver is global variable node JAVA.
Used to highlight Java class references.

o  isJavaPackageReference
Return true, given node is JAVA package reference in form:
JAVA package1 package2

o  isJavaScriptAndExpression

o  isJavaScriptArrayAccess
return true, if this is a node for a javascript array reference i.e. expr[]

o  isJavaScriptBlock
return true, if this is a node for a javascript block

o  isJavaScriptClassNode

o  isJavaScriptConditionalExpression
return true, if this is a node for a ?: expression

o  isJavaScriptOrExpression

o  isLiteral
for compatibility with RB-AST

o  isLiteralArray
for compatibility with RB-AST

o  isLiteralCString
for compatibility with RB-AST

o  isLocalVariable

o  isMessage
return true, if this is a node for a message expression

o  isMethodNode

o  isMethodVariable

o  isNew
return true, if this is a new XXXX node

o  isPostIncDec
for JavaScript

o  isPreIncDec
for JavaScript

o  isPrimary
return true, if this is a node for a primary (i.e. non-send)

o  isReturnNode
return true, if this is a node for a return expression

o  isSelf
return true, if this is a self-node

o  isStatementNode
return true, if this is a statement node

o  isSuper
return true, if this is a super-node

o  isThis
for JavaScript

o  isUnaryMessage
return true, if this is a node for a unary send

o  isVariable
return true, if this is a node for a variable

o  isVariableNode
return true, if this is a node for a variable



ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Thu, 28 Mar 2024 19:11:59 GMT