Squeak Class Documentation category index | class index  
 
MessageNode
  category: System-Compiler
  superclass: ParseNode
  subclasses: MessageAsTempNode TileMessageNode MessagePartNode

I represent a receiver and its message.

Precedence codes:
1 unary
2 binary
3 keyword
4 other

If special>0, I compile special code in-line instead of sending messages with literal methods as remotely copied contexts.

instance methods
  C translation
  asTranslatorNode

  cascading
  cascadeReceiver

  code generation
  emitCase:on:value:
emitForEffect:on:
emitForValue:on:
emitIf:on:value:
emitIfNil:on:value:
emitToDo:on:value:
emitWhile:on:value:
pc
sizeCase:value:
sizeForEffect:
sizeForValue:
sizeIf:value:
sizeIfNil:value:
sizeToDo:value:
sizeWhile:value:

  equation translation
  arguments
arguments:
eval
receiver
receiver:
selector

  initialize-release
  receiver:selector:arguments:precedence:
receiver:selector:arguments:precedence:from:
receiver:selector:arguments:precedence:from:sourceRange:
selector:

  macro transformations
  noteSpecialSelector:
toDoFromWhileWithInit:
transform:
transformAnd:
transformBoolean:
transformIfFalse:
transformIfFalseIfTrue:
transformIfNil:
transformIfNilIfNotNil:
transformIfNotNilIfNil:
transformIfTrue:
transformIfTrueIfFalse:
transformOr:
transformToDo:
transformWhile:

  printing
  asMorphicCaseOn:indent:
macroPrinter
precedence
printCaseOn:indent:
printIfNil:indent:
printIfNilNotNil:indent:
printIfOn:indent:
printKeywords:arguments:on:indent:
printKeywords:arguments:on:indent:prefix:
printOn:indent:
printOn:indent:precedence:
printParenReceiver:on:indent:
printReceiver:on:indent:
printToDoOn:indent:
printWhileOn:indent:
test

  private
  checkBlock:as:from:
ifNilReceiver
pvtCheckForPvtSelector:
receiver:arguments:precedence:
transformCase:

  testing
  canCascade
isComplex
isMessage:receiver:arguments:
isReturningIf
toDoIncrement:
toDoLimit:

  tiles
  asMorphicSyntaxIn:
morphFromKeywords:arguments:on:indent:

class methods
  class initialization
  initialize

instance methods
  C translation top  
 

asTranslatorNode

selector is sometimes a Symbol, sometimes a SelectorNode!
On top of this, numArgs is needed due to the (truly grody) use of
arguments as a place to store the extra expressions needed to generate
code for in-line to:by:do:, etc. see below, where it is used.


  cascading top  
 

cascadeReceiver

Nil out rcvr (to indicate cascade) and return what it had been.


  code generation top  
 

emitCase:on:value:


 

emitForEffect:on:

For #ifTrue:ifFalse: and #whileTrue: / #whileFalse: style messages, the pc is set to the jump instruction, so that mustBeBoolean exceptions can be shown correctly.


 

emitForValue:on:

For #ifTrue:ifFalse: and #whileTrue: / #whileFalse: style messages, the pc is set to the jump instruction, so that mustBeBoolean exceptions can be shown correctly.


 

emitIf:on:value:


 

emitIfNil:on:value:


 

emitToDo:on:value:

var _ rcvr. L1: [var <= arg1] Bfp(L2) [block body. var _ var + inc] Jmp(L1) L2:


 

emitWhile:on:value:

L1: ... Bfp(L2)|Btp(L2) ... Jmp(L1) L2:


 

pc

Used by encoder source mapping.


 

sizeCase:value:


 

sizeForEffect:


 

sizeForValue:


 

sizeIf:value:


 

sizeIfNil:value:


 

sizeToDo:value:

var _ rcvr. L1: [var <= arg1] Bfp(L2) [block body. var _ var + inc] Jmp(L1) L2:


 

sizeWhile:value:

L1: ... Bfp(L2) ... Jmp(L1) L2: nil (nil for value only);
justStmt, wholeLoop, justJump.


  equation translation top  
 

arguments


 

arguments:


 

eval

When everything in me is a constant, I can produce a value. This is only used by the Scripting system (TilePadMorph tilesFrom:in:)


 

receiver


 

receiver:

14 feb 2001 - removed return arrow


 

selector


  initialize-release top  
 

receiver:selector:arguments:precedence:

Decompile.


 

receiver:selector:arguments:precedence:from:

Compile.


 

receiver:selector:arguments:precedence:from:sourceRange:

Compile.


 

selector:


  macro transformations top  
 

noteSpecialSelector:

special > 0 denotes specially treated messages.


 

toDoFromWhileWithInit:

Return nil, or a to:do: expression equivalent to this whileTrue:


 

transform:


 

transformAnd:


 

transformBoolean:


 

transformIfFalse:


 

transformIfFalseIfTrue:


 

transformIfNil:


 

transformIfNilIfNotNil:


 

transformIfNotNilIfNil:


 

transformIfTrue:


 

transformIfTrueIfFalse:


 

transformOr:


 

transformToDo:

var _ rcvr. L1: [var <= arg1] Bfp(L2) [block body. var _ var + inc]
Jmp(L1) L2:


 

transformWhile:


  printing top  
 

asMorphicCaseOn:indent:

receiver caseOf: {[key]->[value]. ...} otherwise: [otherwise]


 

macroPrinter


 

precedence


 

printCaseOn:indent:

receiver caseOf: {[key]->[value]. ...} otherwise: [otherwise]


 

printIfNil:indent:


 

printIfNilNotNil:indent:


 

printIfOn:indent:


 

printKeywords:arguments:on:indent:


 

printKeywords:arguments:on:indent:prefix:


 

printOn:indent:

may not need this check anymore - may be fixed by the #receiver: change


 

printOn:indent:precedence:


 

printParenReceiver:on:indent:


 

printReceiver:on:indent:


 

printToDoOn:indent:


 

printWhileOn:indent:


 

test


  private top  
 

checkBlock:as:from:


 

ifNilReceiver


 

pvtCheckForPvtSelector:

If the code being compiled is trying to send a private message (e.g. 'pvtCheckForPvtSelector:') to anyone other than self, then complain to encoder.


 

receiver:arguments:precedence:


 

transformCase:


  testing top  
 

canCascade


 

isComplex

Used for pretty printing to determine whether to start a new line


 

isMessage:receiver:arguments:

Answer whether selector is selSymbol, and the predicates rcvrPred and argsPred
evaluate to true with respect to receiver and the list of arguments. If selSymbol or
either predicate is nil, it means 'don't care'. Note that argsPred takes numArgs
arguments. All block arguments are ParseNodes.


 

isReturningIf


 

toDoIncrement:

Only meant for Messages or Assignments - else return nil


 

toDoLimit:


  tiles top  
 

asMorphicSyntaxIn:

Default for missing implementations


 

morphFromKeywords:arguments:on:indent:


class methods
  class initialization top  
 

initialize

MessageNode initialize