IRDecompiler.st
changeset 42 acdc3ec6d152
parent 41 f3898a3b378d
child 43 c8afb8e4c3cc
equal deleted inserted replaced
41:f3898a3b378d 42:acdc3ec6d152
     2 
     2 
     3 IRInterpreter subclass:#IRDecompiler
     3 IRInterpreter subclass:#IRDecompiler
     4 	instanceVariableNames:'stack sp scope currentInstr valueLabelMap mapEmptyStatement'
     4 	instanceVariableNames:'stack sp scope currentInstr valueLabelMap mapEmptyStatement'
     5 	classVariableNames:''
     5 	classVariableNames:''
     6 	poolDictionaries:''
     6 	poolDictionaries:''
     7 	category:'NewCompiler-IR'
     7 	category:'IR Compiler-IR'
     8 !
     8 !
     9 
     9 
    10 IRDecompiler comment:'I interpret IRMethod instructions and generate a Smalltalk abstract syntax tree rooted at a RBMethodNode.
    10 IRDecompiler comment:'I interpret IRMethod instructions and generate a Smalltalk abstract syntax tree rooted at a RBMethodNode.
    11 This is implemented like a shift-reduce parser.  Each instruction either causes a node to be pushed on the stack (shift), or causes one or more nodes to be popped and combined into a single node which is push back on the stack (reduce).  Most reduction is done at the "label: labelNum" instruction where it tries to reduce jump structures into control messages like #ifTrue:, whileFalse:, etc.
    11 This is implemented like a shift-reduce parser.  Each instruction either causes a node to be pushed on the stack (shift), or causes one or more nodes to be popped and combined into a single node which is push back on the stack (reduce).  Most reduction is done at the "label: labelNum" instruction where it tries to reduce jump structures into control messages like #ifTrue:, whileFalse:, etc.
    12 Several pseudo nodes (RBPseudoNode and subclasses) are used to represent basic instructions that have not been reduced to real AST nodes yet.
    12 Several pseudo nodes (RBPseudoNode and subclasses) are used to represent basic instructions that have not been reduced to real AST nodes yet.
  1301 !
  1301 !
  1302 
  1302 
  1303 version_SVN
  1303 version_SVN
  1304     ^ '$Id::                                                                                                                        $'
  1304     ^ '$Id::                                                                                                                        $'
  1305 ! !
  1305 ! !
       
  1306