ReadEvalPrintLoop.st
author Claus Gittinger <cg@exept.de>
Thu, 15 Mar 2007 22:37:49 +0100
changeset 10462 1db807a0f9e5
parent 10461 0b2935207fec
child 10463 90c8fd90d3fc
permissions -rw-r--r--
+correctableError:position:to:from
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10249
4f4b81940a34 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10248
diff changeset
     1
"
4f4b81940a34 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10248
diff changeset
     2
 COPYRIGHT (c) 2006 by eXept Software AG
4f4b81940a34 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10248
diff changeset
     3
              All Rights Reserved
4f4b81940a34 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10248
diff changeset
     4
4f4b81940a34 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10248
diff changeset
     5
 This software is furnished under a license and may be used
4f4b81940a34 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10248
diff changeset
     6
 only in accordance with the terms of that license and with the
4f4b81940a34 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10248
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
4f4b81940a34 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10248
diff changeset
     8
 be provided or otherwise made available to, or used by, any
4f4b81940a34 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10248
diff changeset
     9
 other person.  No title to or ownership of the software is
4f4b81940a34 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10248
diff changeset
    10
 hereby transferred.
4f4b81940a34 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10248
diff changeset
    11
"
10248
c00913f343f1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
"{ Package: 'stx:libbasic' }"
c00913f343f1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
c00913f343f1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
Object subclass:#ReadEvalPrintLoop
10254
e576d49220c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10253
diff changeset
    15
	instanceVariableNames:'inputStream outputStream errorStream compiler prompt
10255
a50472b6354a directives
Claus Gittinger <cg@exept.de>
parents: 10254
diff changeset
    16
		doChunkFormat traceFlag timingFlag'
10248
c00913f343f1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	classVariableNames:''
c00913f343f1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	poolDictionaries:''
10277
055777498b71 category
Claus Gittinger <cg@exept.de>
parents: 10266
diff changeset
    19
	category:'System-Support'
10248
c00913f343f1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
!
c00913f343f1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
10249
4f4b81940a34 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10248
diff changeset
    22
!ReadEvalPrintLoop class methodsFor:'documentation'!
4f4b81940a34 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10248
diff changeset
    23
4f4b81940a34 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10248
diff changeset
    24
copyright
4f4b81940a34 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10248
diff changeset
    25
"
4f4b81940a34 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10248
diff changeset
    26
 COPYRIGHT (c) 2006 by eXept Software AG
4f4b81940a34 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10248
diff changeset
    27
              All Rights Reserved
4f4b81940a34 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10248
diff changeset
    28
4f4b81940a34 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10248
diff changeset
    29
 This software is furnished under a license and may be used
4f4b81940a34 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10248
diff changeset
    30
 only in accordance with the terms of that license and with the
4f4b81940a34 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10248
diff changeset
    31
 inclusion of the above copyright notice.   This software may not
4f4b81940a34 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10248
diff changeset
    32
 be provided or otherwise made available to, or used by, any
4f4b81940a34 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10248
diff changeset
    33
 other person.  No title to or ownership of the software is
4f4b81940a34 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10248
diff changeset
    34
 hereby transferred.
4f4b81940a34 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10248
diff changeset
    35
"
10461
0b2935207fec +correctableError:position:to:
Claus Gittinger <cg@exept.de>
parents: 10277
diff changeset
    36
!
0b2935207fec +correctableError:position:to:
Claus Gittinger <cg@exept.de>
parents: 10277
diff changeset
    37
0b2935207fec +correctableError:position:to:
Claus Gittinger <cg@exept.de>
parents: 10277
diff changeset
    38
documentation
0b2935207fec +correctableError:position:to:
Claus Gittinger <cg@exept.de>
parents: 10277
diff changeset
    39
"
0b2935207fec +correctableError:position:to:
Claus Gittinger <cg@exept.de>
parents: 10277
diff changeset
    40
    A simple read-eval-print loop for non-GUI or stscript operation.
0b2935207fec +correctableError:position:to:
Claus Gittinger <cg@exept.de>
parents: 10277
diff changeset
    41
"
10249
4f4b81940a34 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10248
diff changeset
    42
! !
10248
c00913f343f1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
c00913f343f1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
!ReadEvalPrintLoop methodsFor:'accessing'!
c00913f343f1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
10462
1db807a0f9e5 +correctableError:position:to:from
Claus Gittinger <cg@exept.de>
parents: 10461
diff changeset
    46
nt loop for non-GUI or stscript operation.
1db807a0f9e5 +correctableError:position:to:from
Claus Gittinger <cg@exept.de>
parents: 10461
diff changeset
    47
"
10248
c00913f343f1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
!
c00913f343f1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
10462
1db807a0f9e5 +correctableError:position:to:from
Claus Gittinger <cg@exept.de>
parents: 10461
diff changeset
    50
!
1db807a0f9e5 +correctableError:position:to:from
Claus Gittinger <cg@exept.de>
parents: 10461
diff changeset
    51
1db807a0f9e5 +correctableError:position:to:from
Claus Gittinger <cg@exept.de>
parents: 10461
diff changeset
    52
mat:something
10254
e576d49220c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10253
diff changeset
    53
    doChunkFormat := something.
e576d49220c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10253
diff changeset
    54
e576d49220c2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10253
diff changeset
    55
    "Created: / 07-12-2006 / 18:24:04 / cg"
10248
c00913f343f1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
!
c00913f343f1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
c00913f343f1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
error:something
c00913f343f1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
    errorStream := something.
c00913f343f1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
c00913f343f1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
    "Created: / 07-12-2006 / 17:33:39 / cg"
c00913f343f1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
!
c00913f343f1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
10462
1db807a0f9e5 +correctableError:position:to:from
Claus Gittinger <cg@exept.de>
parents: 10461
diff changeset
    64
tream
10256
63993a2b4d15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10255
diff changeset
    65
    ^ errorStream ? Transcript ? Stderr
63993a2b4d15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10255
diff changeset
    66
63993a2b4d15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10255
diff changeset
    67
    "Created: / 07-12-2006 / 19:11:56 / cg"
63993a2b4d15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10255
diff changeset
    68
!
63993a2b4d15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10255
diff changeset
    69
10462
1db807a0f9e5 +correctableError:position:to:from
Claus Gittinger <cg@exept.de>
parents: 10461
diff changeset
    70
nput:something
10248
c00913f343f1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
    inputStream := something.
c00913f343f1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
c00913f343f1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
    "Modified: / 07-12-2006 / 17:33:31 / cg"
c00913f343f1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
!
c00913f343f1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
10462
1db807a0f9e5 +correctableError:position:to:from
Claus Gittinger <cg@exept.de>
parents: 10461
diff changeset
    76
"
10256
63993a2b4d15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10255
diff changeset
    77
!
63993a2b4d15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10255
diff changeset
    78
10462
1db807a0f9e5 +correctableError:position:to:from
Claus Gittinger <cg@exept.de>
parents: 10461
diff changeset
    79
tput:something
10248
c00913f343f1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
    outputStream := something.
c00913f343f1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
c00913f343f1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
    "Created: / 07-12-2006 / 17:27:48 / cg"
c00913f343f1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
!
c00913f343f1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
c00913f343f1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
! !
c00913f343f1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
10255
a50472b6354a directives
Claus Gittinger <cg@exept.de>
parents: 10254
diff changeset
    87
!ReadEvalPrintLoop methodsFor:'directives'!
a50472b6354a directives
Claus Gittinger <cg@exept.de>
parents: 10254
diff changeset
    88
10462
1db807a0f9e5 +correctableError:position:to:from
Claus Gittinger <cg@exept.de>
parents: 10461
diff changeset
    89
prompt:something
1db807a0f9e5 +correctableError:position:to:from
Claus Gittinger <cg@exept.de>
parents: 10461
diff changeset
    90
    prompt := something.
1db807a0f9e5 +correctableError:position:to:from
Claus Gittinger <cg@exept.de>
parents: 10461
diff changeset
    91
!
1db807a0f9e5 +correctableError:position:to:from
Claus Gittinger <cg@exept.de>
parents: 10461
diff changeset
    92
1db807a0f9e5 +correctableError:position:to:from
Claus Gittinger <cg@exept.de>
parents: 10461
diff changeset
    93
m
10255
a50472b6354a directives
Claus Gittinger <cg@exept.de>
parents: 10254
diff changeset
    94
    self cmd_setOrClear:lineStream to:false
a50472b6354a directives
Claus Gittinger <cg@exept.de>
parents: 10254
diff changeset
    95
a50472b6354a directives
Claus Gittinger <cg@exept.de>
parents: 10254
diff changeset
    96
    "Created: / 07-12-2006 / 19:04:50 / cg"
a50472b6354a directives
Claus Gittinger <cg@exept.de>
parents: 10254
diff changeset
    97
!
a50472b6354a directives
Claus Gittinger <cg@exept.de>
parents: 10254
diff changeset
    98
a50472b6354a directives
Claus Gittinger <cg@exept.de>
parents: 10254
diff changeset
    99
!
a50472b6354a directives
Claus Gittinger <cg@exept.de>
parents: 10254
diff changeset
   100
10462
1db807a0f9e5 +correctableError:position:to:from
Claus Gittinger <cg@exept.de>
parents: 10461
diff changeset
   101
on
10257
2bc06451585b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10256
diff changeset
   102
2bc06451585b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10256
diff changeset
   103
MiniDebugger shows its help with "?".
10255
a50472b6354a directives
Claus Gittinger <cg@exept.de>
parents: 10254
diff changeset
   104
'
a50472b6354a directives
Claus Gittinger <cg@exept.de>
parents: 10254
diff changeset
   105
a50472b6354a directives
Claus Gittinger <cg@exept.de>
parents: 10254
diff changeset
   106
    "Created: / 07-12-2006 / 18:54:20 / cg"
a50472b6354a directives
Claus Gittinger <cg@exept.de>
parents: 10254
diff changeset
   107
!
a50472b6354a directives
Claus Gittinger <cg@exept.de>
parents: 10254
diff changeset
   108
10462
1db807a0f9e5 +correctableError:position:to:from
Claus Gittinger <cg@exept.de>
parents: 10461
diff changeset
   109
m
10255
a50472b6354a directives
Claus Gittinger <cg@exept.de>
parents: 10254
diff changeset
   110
    self cmd_setOrClear:lineStream to:true
a50472b6354a directives
Claus Gittinger <cg@exept.de>
parents: 10254
diff changeset
   111
a50472b6354a directives
Claus Gittinger <cg@exept.de>
parents: 10254
diff changeset
   112
    "Modified: / 07-12-2006 / 19:04:46 / cg"
a50472b6354a directives
Claus Gittinger <cg@exept.de>
parents: 10254
diff changeset
   113
!
a50472b6354a directives
Claus Gittinger <cg@exept.de>
parents: 10254
diff changeset
   114
10462
1db807a0f9e5 +correctableError:position:to:from
Claus Gittinger <cg@exept.de>
parents: 10461
diff changeset
   115
lf errorStream nextPutLine:'?? which flag ?'.
10255
a50472b6354a directives
Claus Gittinger <cg@exept.de>
parents: 10254
diff changeset
   116
10256
63993a2b4d15 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10255
diff changeset
   117
    "Modified: / 07-12-2006 / 19:13:34 / cg"
10255
a50472b6354a directives
Claus Gittinger <cg@exept.de>
parents: 10254
diff changeset
   118
!
a50472b6354a directives
Claus Gittinger <cg@exept.de>
parents: 10254
diff changeset
   119
10462
1db807a0f9e5 +correctableError:position:to:from
Claus Gittinger <cg@exept.de>
parents: 10461
diff changeset
   120
elf errorStream nextPutLine:'?? show what ?'.
10255
a50472b6354a directives
Claus Gittinger <cg@exept.de>
parents: 10254
diff changeset
   121
10261
b429f96cf069 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10260
diff changeset
   122
    "Modified: / 07-12-2006 / 19:23:15 / cg"
10255
a50472b6354a directives
Claus Gittinger <cg@exept.de>
parents: 10254
diff changeset
   123
!
a50472b6354a directives
Claus Gittinger <cg@exept.de>
parents: 10254
diff changeset
   124
10462
1db807a0f9e5 +correctableError:position:to:from
Claus Gittinger <cg@exept.de>
parents: 10461
diff changeset
   125
houtSeparators.
10255
a50472b6354a directives
Claus Gittinger <cg@exept.de>
parents: 10254
diff changeset
   126
    Smalltalk loadPackage:pkg
a50472b6354a directives
Claus Gittinger <cg@exept.de>
parents: 10254
diff changeset
   127
a50472b6354a directives
Claus Gittinger <cg@exept.de>
parents: 10254
diff changeset
   128
    "Created: / 07-12-2006 / 19:07:56 / cg"
a50472b6354a directives
Claus Gittinger <cg@exept.de>
parents: 10254
diff changeset
   129
! !
a50472b6354a directives
Claus Gittinger <cg@exept.de>
parents: 10254
diff changeset
   130
10248
c00913f343f1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
!ReadEvalPrintLoop methodsFor:'evaluation'!
c00913f343f1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
10462
1db807a0f9e5 +correctableError:position:to:from
Claus Gittinger <cg@exept.de>
parents: 10461
diff changeset
   133
correctableError:message position:pos1 to:pos2 from:aCompiler
10461
0b2935207fec +correctableError:position:to:
Claus Gittinger <cg@exept.de>
parents: 10277
diff changeset
   134
    ^ false
0b2935207fec +correctableError:position:to:
Claus Gittinger <cg@exept.de>
parents: 10277
diff changeset
   135
!
0b2935207fec +correctableError:position:to:
Claus Gittinger <cg@exept.de>
parents: 10277
diff changeset
   136
10462
1db807a0f9e5 +correctableError:position:to:from
Claus Gittinger <cg@exept.de>
parents: 10461
diff changeset
   137
"Created: / 07-12-2006 / 18:49:17 / cg"
10248
c00913f343f1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
! !
c00913f343f1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
c00913f343f1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
!ReadEvalPrintLoop class methodsFor:'documentation'!
c00913f343f1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
c00913f343f1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
version
10462
1db807a0f9e5 +correctableError:position:to:from
Claus Gittinger <cg@exept.de>
parents: 10461
diff changeset
   143
    ^ '$Header: /cvs/stx/stx/libbasic/ReadEvalPrintLoop.st,v 1.20 2007-03-15 21:37:49 cg Exp $'
10248
c00913f343f1 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
! !