Andreas Raab uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-rss.72.mcz ==================== Summary ==================== Name: Compiler-rss.72 Author: rss Time: 23 August 2009, 1:10:39 am UUID: 8e73baaa-38e9-4fa1-9f55-025566fee18e Ancestors: Compiler-ar.71 Collections-rss.118 =============== Diff against Compiler-ar.71 =============== Item was changed: ParseNode subclass: #MessageNode instanceVariableNames: 'receiver selector precedence special arguments sizes equalNode caseErrorNode' + classVariableNames: 'MacroEmitters MacroPrinters MacroSelectors MacroSizers MacroTransformers NewStyleMacroEmitters NewStyleMacroSizers StdTypers ThenFlag' - classVariableNames: 'MacroSelectors MacroEmitters MacroTransformers StdTypers NewStyleMacroEmitters MacroSizers ThenFlag NewStyleMacroSizers MacroPrinters' poolDictionaries: '' category: 'Compiler-ParseNodes'! !MessageNode commentStamp: '<historical>' prior: 0! 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.! Item was added: + ----- Method: Compiler>>format:in:notifying: (in category 'public access') ----- + format: textOrStream in: aClass notifying: aRequestor + "Compile a parse tree from the argument, textOrStream. Answer a string containing the original code, formatted nicely. If aBoolean is true, then decorate the resulting text with color and hypertext actions" + + | aNode | + self from: textOrStream + class: aClass + context: nil + notifying: aRequestor. + aNode := self format: sourceStream noPattern: false ifFail: [^ nil]. + + "aSymbol == #colorPrint ifTrue: + [^aNode asColorizedSmalltalk80Text]." "deprecating #colorPrint in favor of Shout --Ron Spengler" + + ^aNode decompileString! Item was changed: Object subclass: #ParseNode instanceVariableNames: 'comment pc' + classVariableNames: 'Bfp BtpLong CodeBases CodeLimits DblExtDoAll Dup EndMethod EndRemote Jmp JmpLimit JmpLong LdFalse LdInstLong LdInstType LdLitIndType LdLitType LdMinus1 LdNil LdSelf LdSuper LdTempType LdThisContext LdTrue LoadLong LongLongDoAll NodeFalse NodeNil NodeSelf NodeSuper NodeThisContext NodeTrue Pop Send SendLimit SendLong SendLong2 SendPlus SendType ShortStoP StdLiterals StdSelectors StdVariables Store StorePop' - classVariableNames: 'Jmp SendType Store Dup JmpLong EndRemote Send NodeSelf LdTrue BtpLong LdInstLong SendLong StdLiterals StdVariables LdThisContext StorePop SendLimit JmpLimit SendPlus Pop NodeNil LdLitIndType SendLong2 DblExtDoAll LoadLong LdLitType NodeTrue LdNil EndMethod LongLongDoAll LdSelf LdSuper NodeSuper CodeLimits LdMinus1 LdTempType StdSelectors LdFalse CodeBases ShortStoP NodeFalse NodeThisContext LdInstType Bfp' poolDictionaries: '' category: 'Compiler-ParseNodes'! !ParseNode commentStamp: '<historical>' prior: 0! This superclass of most compiler/decompiler classes declares common class variables, default messages, and the code emitters for jumps. Some of the class variables are initialized here; the rest are initialized in class VariableNode.! Item was changed: InstructionStream subclass: #Decompiler instanceVariableNames: 'constructor method instVars tempVars constTable stack statements lastPc exit caseExits lastJumpPc lastReturnPc limit hasValue blockStackBase numLocalTemps' + classVariableNames: 'ArgumentFlag CascadeFlag CaseFlag IfNilFlag' - classVariableNames: 'ArgumentFlag CascadeFlag IfNilFlag CaseFlag' poolDictionaries: '' category: 'Compiler-Kernel'! !Decompiler commentStamp: '<historical>' prior: 0! I decompile a method in three phases: Reverser: postfix byte codes -> prefix symbolic codes (nodes and atoms) Parser: prefix symbolic codes -> node tree (same as the compiler) Printer: node tree -> text (done by the nodes) instance vars: constructor method instVars tempVars constTable stack statements lastPc exit caseExits - stack of exit addresses that have been seen in the branches of caseOf:'s lastJumpPc lastReturnPc limit hasValue blockStackBase numLocaltemps - number of temps local to a block; also a flag indicating decompiling a block! Item was added: + ----- Method: Compiler class>>format:in:notifying: (in category 'evaluating') ----- + format: textOrStream in: aClass notifying: aRequestor + ^self new format: textOrStream in: aClass notifying: aRequestor! Item was removed: - ----- Method: Compiler>>format:in:notifying:contentsSymbol: (in category 'public access') ----- - format: textOrStream in: aClass notifying: aRequestor contentsSymbol: aSymbol - "Compile a parse tree from the argument, textOrStream. Answer a string containing the original code, formatted nicely. If aBoolean is true, then decorate the resulting text with color and hypertext actions" - - | aNode | - self from: textOrStream - class: aClass - context: nil - notifying: aRequestor. - aNode := self format: sourceStream noPattern: false ifFail: [^ nil]. - - aSymbol == #colorPrint ifTrue: - [^aNode asColorizedSmalltalk80Text]. - - ^aNode decompileString! Item was removed: - ----- Method: Compiler class>>format:in:notifying:contentsSymbol: (in category 'evaluating') ----- - format: textOrStream in: aClass notifying: aRequestor contentsSymbol: aSymbol - ^self new format: textOrStream in: aClass notifying: aRequestor contentsSymbol: aSymbol! |
Free forum by Nabble | Edit this page |