BreakpointNode.st
author Claus Gittinger <cg@exept.de>
Thu, 23 Jan 2014 12:10:05 +0100
changeset 3349 4e6a7f9be79a
parent 3346 be36d8a09396
child 3350 3abbac991e7e
permissions -rw-r--r--
class: BreakpointNode added: #codeForCascadeOn:inBlock:for: #isMessage #receiver #selector fix to allow break in a cascade

"
 COPYRIGHT (c) 2006 by eXept Software AG
	      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.
"
"{ Package: 'stx:libcomp' }"

ParseNode subclass:#BreakpointNode
	instanceVariableNames:'breakpoint expression lineNumber'
	classVariableNames:''
	poolDictionaries:''
	category:'System-Compiler-Debugging'
!

!BreakpointNode class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 2006 by eXept Software AG
	      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.
"
!

documentation
"
    compiler support for statement breakpoints.
"
! !

!BreakpointNode methodsFor:'accessing'!

breakpoint
    ^ breakpoint
!

breakpoint:something
    breakpoint := something.
!

expression
    ^ expression
!

expression:something
    expression := something.
!

lineNumber
    ^ lineNumber
!

lineNumber:something
    lineNumber := something.
! !

!BreakpointNode methodsFor:'code generation'!

codeForCascadeOn:aStream inBlock:b for:aCompiler
    |node|

    node := MessageNode
                receiver: (ConstantNode value: breakpoint)
                selector: #break.
    node lineNumber:lineNumber.
    node codeForSideEffectOn:aStream inBlock:b for:aCompiler.
    expression notNil ifTrue:[
        expression codeForCascadeOn:aStream inBlock:b for:aCompiler
    ].
!

codeOn:aStream inBlock:codeBlock for:aCompiler
    |node|

    node := MessageNode
                receiver: (ConstantNode value: breakpoint)
                selector: #break.
    node lineNumber:lineNumber.
    node codeForSideEffectOn:aStream inBlock:codeBlock for:aCompiler.
    expression notNil ifTrue:[
        expression codeOn:aStream inBlock:codeBlock for:aCompiler
    ].

    "Created: / 16-06-2011 / 15:17:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Modified: / 22-07-2013 / 16:08:34 / cg"
! !

!BreakpointNode methodsFor:'printing'!

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."

    expression printOn:aStream indent:indent

    "Created: / 06-07-2011 / 14:31:10 / cg"
! !

!BreakpointNode methodsFor:'testing'!

isBreakPointNode
    ^ true

    "Created: / 05-07-2011 / 21:13:52 / cg"
!

isMessage
    "must forward - otherwise cascades won't work"

    ^ expression isMessage
!

receiver
    "must forward - otherwise cascades won't work"

    ^ expression receiver
!

selector
    "must forward - otherwise cascades won't work"

    ^ expression selector
! !

!BreakpointNode class methodsFor:'documentation'!

version_CVS
    ^ '$Header: /cvs/stx/stx/libcomp/BreakpointNode.st,v 1.7 2014-01-23 11:10:05 cg Exp $'
!

version_SVN
    ^ '$ Id $'
! !