JavaScriptCompilerWithBreakpointSupport.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Tue, 24 Sep 2013 23:18:24 +0200
branchinitialV
changeset 1180 01c6be61f29c
parent 609 258d33d9c946
child 795 6ad953a21728
permissions -rw-r--r--
checkin from stx browser
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
609
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 2013 by eXept Software AG
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
              All Rights Reserved
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
"{ Package: 'stx:libjavascript' }"
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
JavaScriptCompiler subclass:#JavaScriptCompilerWithBreakpointSupport
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
	instanceVariableNames:'breakpoints'
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
	classVariableNames:''
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	poolDictionaries:''
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	category:'Languages-JavaScript-Compiling & Parsing'
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
!
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!JavaScriptCompilerWithBreakpointSupport class methodsFor:'documentation'!
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
copyright
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
"
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
 COPYRIGHT (c) 2013 by eXept Software AG
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
              All Rights Reserved
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
 This software is furnished under a license and may be used
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
 only in accordance with the terms of that license and with the
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
 be provided or otherwise made available to, or used by, any
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 other person.  No title to or ownership of the software is
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 hereby transferred.
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
"
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
!
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
documentation
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
"
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
    I'm an experimental compiler class that supports breakpoints. 
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
    Once tested, the code might be merged to JavaScriptCompiler.
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
    [author:]
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
        code stolen from BytecodeCompilerWithBreakpointSupport
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
    [instance variables:]
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
    [class variables:]
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
    [see also:]
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
"
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
! !
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
!JavaScriptCompilerWithBreakpointSupport methodsFor:'adding breakpoint'!
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
possiblyWrapABreakPointAround:aBlock
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
    "refactored Jan's original code; changed to not wrap an already wrapped expression"
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
    | expr bpnt tokenPositionBefore tokenLineNrBefore |
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
    tokenPositionBefore := tokenPosition ? source position.
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
    tokenLineNrBefore := tokenLineNr.
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
    "/ find the very first breakpoint, which is right after the
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
    "/ current line start, and remove it from the breakpoints collection,
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
    "/ incl. all before. This removes breakpoints on empty lines or inside strings etc.
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
    [
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
        breakpoints notEmpty
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
        and:[breakpoints first position < tokenPositionBefore]
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
    ] whileTrue:[
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
        bpnt := breakpoints removeFirst
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
    ].
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
    expr := aBlock value.
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
    bpnt isNil ifTrue:[^expr].
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
    expr isBreakPointNode ifTrue:[^expr].
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
    tokenPositionBefore = tokenPosition ifTrue:[
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
        "/ nothing scanned - happens with unaryExpression which does not find anything,
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
        "/ but returns due to a ')' or ']' token.
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
        ^expr
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
    ].
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
    bpnt isReached:true.
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
    "/ Transcript show:'adding breakpoint '; show:bpnt; show:' before: '; showCR:expr.
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
    ^ BreakpointNode new
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
        breakpoint: bpnt;
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
        expression: expr;
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
        lineNumber:(bpnt line ? tokenLineNrBefore);
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
        yourself
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
    "Created: / 05-07-2011 / 21:11:19 / cg"
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
!
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
possiblyWrapABreakPointBefore:aBlock
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
    "refactored Jan's original code; changed to not wrap an already wrapped expression"
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
    | stat bpnt tokenPositionBefore tokenLineNrBefore |
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
    tokenPositionBefore := tokenPosition ? source position.
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
    tokenLineNrBefore := tokenLineNr.
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
    "/ find the very first breakpoint, which is right after the
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
    "/ current line start, and remove it from the breakpoints collection,
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
    "/ incl. all before. This removes breakpoints on empty lines or inside strings etc.
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
    [
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
        breakpoints notEmpty
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
        and:[breakpoints first position < tokenPositionBefore]
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
    ] whileTrue:[
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
        bpnt := breakpoints removeFirst
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
    ].
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
    stat := aBlock value.
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
    bpnt isNil ifTrue:[^stat].
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
    ((stat isKindOf:JavaScriptParser::StatementBlockNode)
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
        and:[stat statements first isBreakPointNode]) ifTrue:[^stat].
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   120
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
    tokenPositionBefore = tokenPosition ifTrue:[
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
        "/ nothing scanned - happens with unaryExpression which does not find anything,
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
        "/ but returns due to a ')' or ']' token.
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
        ^stat
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
    ].
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
    bpnt isReached:true.
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
    "/ Transcript show:'adding breakpoint '; show:bpnt; show:' before: '; showCR:expr.
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
    ^ JavaScriptParser::StatementBlockNode new
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
        statements:{
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
                BreakpointNode new
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
                    breakpoint: bpnt;
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
                    expression: nil;
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
                    lineNumber:(bpnt line ? tokenLineNrBefore);
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
                    yourself
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
                .
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
                stat
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
        }
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
    "Created: / 22-07-2013 / 15:42:08 / cg"
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
!
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
removeMissedBreakpointsBefore:aPosition
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
    [
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
        breakpoints notEmpty
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
        and:[breakpoints first position < aPosition]
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
    ] whileTrue:[
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
        breakpoints removeFirst
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
    ].
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
    "Created: / 05-07-2011 / 23:13:25 / cg"
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
! !
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   155
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
!JavaScriptCompilerWithBreakpointSupport methodsFor:'parsing-expressions'!
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   158
addExpression
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
    ^ self possiblyWrapABreakPointAround:[super addExpression]
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   161
    "Created: / 22-07-2013 / 15:36:03 / cg"
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   162
!
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   163
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   164
block
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   165
    |blockNode|
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
    self removeMissedBreakpointsBefore:source position.
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
    blockNode := super block.
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   169
    self removeMissedBreakpointsBefore:blockNode endPosition+2.
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   170
    ^ blockNode
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   171
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   172
    "Created: / 05-07-2011 / 22:56:19 / cg"
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   173
!
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   174
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
expression
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   176
    ^ self possiblyWrapABreakPointAround:[super expression]
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   177
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
    "Created: / 16-06-2011 / 14:58:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
    "Modified: / 05-07-2011 / 21:11:38 / cg"
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   180
!
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   181
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
primaryExpression
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   183
    ^ self possiblyWrapABreakPointAround:[super primaryExpression]
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   184
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   185
    "Created: / 22-07-2013 / 15:37:04 / cg"
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   186
!
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   188
unaryExpression
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
    ^ self possiblyWrapABreakPointAround:[super unaryExpression]
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
    "Created: / 05-07-2011 / 23:08:54 / cg"
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
! !
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
!JavaScriptCompilerWithBreakpointSupport methodsFor:'parsing-statements'!
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
statement
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   197
    ^ self possiblyWrapABreakPointBefore:[super statement]
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
    "Created: / 22-07-2013 / 15:42:53 / cg"
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
! !
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
!JavaScriptCompilerWithBreakpointSupport methodsFor:'private'!
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
breakpoints:aCollection
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
    breakpoints := aCollection copy sort:[:a :b|a position < b position].
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   206
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
    "Created: / 16-06-2011 / 14:35:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
    "Created: / 05-07-2011 / 21:37:28 / cg"
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   209
!
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   210
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   211
methodClass
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   212
    ^ methodClass ? JavaScriptFunctionWithBreakpoints
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   213
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
    "Created: / 22-07-2013 / 15:53:54 / cg"
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
!
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   216
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   217
notifying: anObject
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   218
    super notifying: anObject.
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   219
    anObject notNil ifTrue:[
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   220
        breakpoints isNil ifTrue:[
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   221
            self breakpoints:(anObject perform: #breakpoints ifNotUnderstood:#()).
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   222
        ]
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   223
    ]
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   224
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   225
    "Created: / 16-06-2011 / 14:35:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   226
    "Modified: / 05-07-2011 / 21:48:37 / cg"
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
! !
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   228
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
!JavaScriptCompilerWithBreakpointSupport class methodsFor:'documentation'!
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   230
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   231
version
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   232
    ^ '$Header$'
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   233
!
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   234
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   235
version_CVS
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
    ^ '$Header$'
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   237
! !
258d33d9c946 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   238