author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Mon, 17 Aug 2015 12:56:02 +0100 | |
changeset 516 | 3b81c9e53352 |
parent 505 | 19d830b74322 |
parent 515 | b5316ef15274 |
child 525 | 751532c8f3db |
permissions | -rw-r--r-- |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
1 |
"{ Package: 'stx:goodies/petitparser/compiler' }" |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
2 |
|
422 | 3 |
"{ NameSpace: Smalltalk }" |
4 |
||
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
5 |
Object subclass:#PPCMethod |
515
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
6 |
instanceVariableNames:'selector source category variableForReturn' |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
7 |
classVariableNames:'' |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
8 |
poolDictionaries:'' |
502
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
9 |
category:'PetitCompiler-Compiler-Codegen' |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
10 |
! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
11 |
|
399
b5b7a6db033b
Fix in PPCMethod>>addVariable: make sure variable is added only once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
393
diff
changeset
|
12 |
|
422 | 13 |
!PPCMethod class methodsFor:'as yet unclassified'! |
393
00381102a9b5
Override #new in classes that implement #initialize.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
392
diff
changeset
|
14 |
|
00381102a9b5
Override #new in classes that implement #initialize.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
392
diff
changeset
|
15 |
new |
00381102a9b5
Override #new in classes that implement #initialize.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
392
diff
changeset
|
16 |
"return an initialized instance" |
00381102a9b5
Override #new in classes that implement #initialize.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
392
diff
changeset
|
17 |
|
00381102a9b5
Override #new in classes that implement #initialize.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
392
diff
changeset
|
18 |
^ self basicNew initialize. |
00381102a9b5
Override #new in classes that implement #initialize.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
392
diff
changeset
|
19 |
! ! |
00381102a9b5
Override #new in classes that implement #initialize.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
392
diff
changeset
|
20 |
|
452
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
21 |
!PPCMethod methodsFor:'accessing'! |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
22 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
23 |
body |
515
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
24 |
self error: 'Should no longer be used'. |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
25 |
" |
452
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
26 |
^ buffer contents |
515
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
27 |
" |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
28 |
|
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
29 |
"Modified: / 17-08-2015 / 11:58:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
30 |
! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
31 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
32 |
bridge |
452
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
33 |
^ PPCBridge on: self methodName. |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
34 |
! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
35 |
|
459
4751c407bb40
Merged with PetitCompiler-JanKurs.20150510144201, PetitCompiler-Tests-JanKurs.20150510144201, PetitCompiler-Extras-Tests-JanKurs.20150510144201, PetitCompiler-Benchmarks-JanKurs.20150510144201
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
452
diff
changeset
|
36 |
category |
4751c407bb40
Merged with PetitCompiler-JanKurs.20150510144201, PetitCompiler-Tests-JanKurs.20150510144201, PetitCompiler-Extras-Tests-JanKurs.20150510144201, PetitCompiler-Benchmarks-JanKurs.20150510144201
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
452
diff
changeset
|
37 |
^ category isNil |
4751c407bb40
Merged with PetitCompiler-JanKurs.20150510144201, PetitCompiler-Tests-JanKurs.20150510144201, PetitCompiler-Extras-Tests-JanKurs.20150510144201, PetitCompiler-Benchmarks-JanKurs.20150510144201
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
452
diff
changeset
|
38 |
ifTrue: [ category := 'generated' ] |
4751c407bb40
Merged with PetitCompiler-JanKurs.20150510144201, PetitCompiler-Tests-JanKurs.20150510144201, PetitCompiler-Extras-Tests-JanKurs.20150510144201, PetitCompiler-Benchmarks-JanKurs.20150510144201
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
452
diff
changeset
|
39 |
ifFalse: [ category ] |
464
f6d77fee9811
Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
459
diff
changeset
|
40 |
|
459
4751c407bb40
Merged with PetitCompiler-JanKurs.20150510144201, PetitCompiler-Tests-JanKurs.20150510144201, PetitCompiler-Extras-Tests-JanKurs.20150510144201, PetitCompiler-Benchmarks-JanKurs.20150510144201
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
452
diff
changeset
|
41 |
! |
4751c407bb40
Merged with PetitCompiler-JanKurs.20150510144201, PetitCompiler-Tests-JanKurs.20150510144201, PetitCompiler-Extras-Tests-JanKurs.20150510144201, PetitCompiler-Benchmarks-JanKurs.20150510144201
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
452
diff
changeset
|
42 |
|
4751c407bb40
Merged with PetitCompiler-JanKurs.20150510144201, PetitCompiler-Tests-JanKurs.20150510144201, PetitCompiler-Extras-Tests-JanKurs.20150510144201, PetitCompiler-Benchmarks-JanKurs.20150510144201
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
452
diff
changeset
|
43 |
category: value |
4751c407bb40
Merged with PetitCompiler-JanKurs.20150510144201, PetitCompiler-Tests-JanKurs.20150510144201, PetitCompiler-Extras-Tests-JanKurs.20150510144201, PetitCompiler-Benchmarks-JanKurs.20150510144201
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
452
diff
changeset
|
44 |
category := value |
4751c407bb40
Merged with PetitCompiler-JanKurs.20150510144201, PetitCompiler-Tests-JanKurs.20150510144201, PetitCompiler-Extras-Tests-JanKurs.20150510144201, PetitCompiler-Benchmarks-JanKurs.20150510144201
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
452
diff
changeset
|
45 |
! |
4751c407bb40
Merged with PetitCompiler-JanKurs.20150510144201, PetitCompiler-Tests-JanKurs.20150510144201, PetitCompiler-Extras-Tests-JanKurs.20150510144201, PetitCompiler-Benchmarks-JanKurs.20150510144201
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
452
diff
changeset
|
46 |
|
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
47 |
code |
502
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
48 |
^ String streamContents: [ :s | |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
49 |
s nextPutAll: self methodName; cr. |
515
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
50 |
source codeOn: s. |
502
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
51 |
] |
438
20598d7ce9fa
Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
422
diff
changeset
|
52 |
|
502
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
53 |
"Modified: / 01-06-2015 / 21:24:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
54 |
! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
55 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
56 |
id: value |
515
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
57 |
selector := value |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
58 |
! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
59 |
|
502
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
60 |
indentationLevel |
515
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
61 |
^ source indentationLevel |
502
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
62 |
|
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
63 |
"Created: / 01-06-2015 / 21:38:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
64 |
! |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
65 |
|
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
66 |
indentationLevel: anInteger |
515
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
67 |
source indentationLevel: anInteger |
502
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
68 |
|
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
69 |
"Created: / 01-06-2015 / 21:38:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
70 |
! |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
71 |
|
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
72 |
methodName |
515
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
73 |
^ selector |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
74 |
! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
75 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
76 |
profile |
515
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
77 |
self error: 'Should no longer be used'. |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
78 |
" |
452
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
79 |
^ profile |
515
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
80 |
" |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
81 |
|
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
82 |
"Modified: / 17-08-2015 / 11:58:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
83 |
! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
84 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
85 |
profile: aBoolean |
515
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
86 |
self error: 'Should no longer be used'. |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
87 |
" |
452
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
88 |
profile := aBoolean |
515
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
89 |
" |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
90 |
|
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
91 |
"Modified: / 17-08-2015 / 11:58:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
92 |
! |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
93 |
|
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
94 |
source |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
95 |
^ source isString ifTrue:[ |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
96 |
source |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
97 |
] ifFalse:[ |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
98 |
String streamContents: [ :s | |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
99 |
s nextPutAll: self methodName; cr. |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
100 |
source sourceOn:s. |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
101 |
] |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
102 |
]. |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
103 |
|
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
104 |
"Created: / 24-07-2015 / 19:46:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
105 |
! |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
106 |
|
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
107 |
source: aString |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
108 |
source := aString |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
109 |
|
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
110 |
"Created: / 24-07-2015 / 19:48:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
452
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
111 |
! ! |
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
112 |
|
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
113 |
!PPCMethod methodsFor:'as yet unclassified'! |
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
114 |
|
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
115 |
add: string |
515
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
116 |
source add: string |
502
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
117 |
|
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
118 |
"Modified: / 01-06-2015 / 21:09:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
452
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
119 |
! |
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
120 |
|
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
121 |
addOnLine: string |
515
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
122 |
source addOnLine: string |
502
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
123 |
|
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
124 |
"Modified: / 01-06-2015 / 21:09:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
452
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
125 |
! |
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
126 |
|
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
127 |
call |
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
128 |
^ 'self ', self methodName, '.'. |
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
129 |
! |
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
130 |
|
515
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
131 |
callOn: receiver |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
132 |
^ receiver, ' ', self methodName. |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
133 |
! |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
134 |
|
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
135 |
profilingBegin |
452
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
136 |
self profile ifTrue: [ |
515
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
137 |
^ ' context methodInvoked: #', selector, '.' |
452
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
138 |
]. |
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
139 |
^ '' |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
140 |
! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
141 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
142 |
profilingEnd |
452
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
143 |
self profile ifTrue: [ |
515
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
144 |
^ ' context methodFinished: #', selector, '.' |
452
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
145 |
]. |
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
146 |
^ '' |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
147 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
148 |
|
502
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
149 |
!PPCMethod methodsFor:'code generation'! |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
150 |
|
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
151 |
code: aStringOrBlockOrRBParseNode |
515
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
152 |
source code: aStringOrBlockOrRBParseNode. |
502
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
153 |
|
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
154 |
"Created: / 01-06-2015 / 22:31:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
155 |
"Modified (format): / 01-06-2015 / 23:50:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
156 |
! |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
157 |
|
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
158 |
codeBlock: contents |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
159 |
| outerBlock innerBlock | |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
160 |
|
515
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
161 |
outerBlock := source. |
502
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
162 |
innerBlock := PPCCodeBlock new. |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
163 |
innerBlock indentationLevel: outerBlock indentationLevel + 1. |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
164 |
[ |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
165 |
outerBlock addOnLine:'['. |
515
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
166 |
source := innerBlock. |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
167 |
self codeOnLine: contents. |
502
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
168 |
] ensure:[ |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
169 |
outerBlock |
515
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
170 |
code: (String streamContents:[:s | innerBlock sourceOn:s]); |
502
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
171 |
add:']'. |
515
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
172 |
source := outerBlock. |
502
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
173 |
] |
438
20598d7ce9fa
Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
422
diff
changeset
|
174 |
|
502
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
175 |
"Created: / 01-06-2015 / 22:33:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
176 |
"Modified: / 03-06-2015 / 06:11:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
515
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
177 |
! |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
178 |
|
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
179 |
codeOnLine: aStringOrBlockOrRBParseNode |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
180 |
source codeOnLine: aStringOrBlockOrRBParseNode. |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
181 |
|
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
182 |
"Created: / 01-06-2015 / 22:31:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
183 |
"Modified (format): / 01-06-2015 / 23:50:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
502
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
184 |
! ! |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
185 |
|
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
186 |
!PPCMethod methodsFor:'code generation - indenting'! |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
187 |
|
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
188 |
dedent |
515
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
189 |
source dedent |
502
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
190 |
|
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
191 |
"Created: / 01-06-2015 / 21:32:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
192 |
! |
452
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
193 |
|
502
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
194 |
indent |
515
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
195 |
source indent |
502
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
196 |
|
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
197 |
"Created: / 01-06-2015 / 21:32:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
452
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
198 |
! |
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
199 |
|
502
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
200 |
nl |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
201 |
|
515
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
202 |
source nl |
502
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
203 |
|
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
204 |
"Created: / 01-06-2015 / 21:52:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
205 |
! ! |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
206 |
|
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
207 |
!PPCMethod methodsFor:'code generation - variables'! |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
208 |
|
515
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
209 |
addVariable: name |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
210 |
self error: 'Should no longer be used' |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
211 |
" |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
212 |
(variables includes: name) ifTrue:[ |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
213 |
self error:'Duplicate variable name, must rename'. |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
214 |
]. |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
215 |
variables add: name. |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
216 |
" |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
217 |
|
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
218 |
"Modified: / 17-08-2015 / 11:56:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
219 |
! |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
220 |
|
438
20598d7ce9fa
Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
422
diff
changeset
|
221 |
allocateReturnVariable |
20598d7ce9fa
Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
422
diff
changeset
|
222 |
|
20598d7ce9fa
Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
422
diff
changeset
|
223 |
^ variableForReturn isNil ifTrue:[ |
20598d7ce9fa
Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
422
diff
changeset
|
224 |
variableForReturn := self allocateTemporaryVariableNamed: 'retval' |
20598d7ce9fa
Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
422
diff
changeset
|
225 |
] ifFalse:[ |
20598d7ce9fa
Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
422
diff
changeset
|
226 |
variableForReturn |
20598d7ce9fa
Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
422
diff
changeset
|
227 |
]. |
20598d7ce9fa
Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
422
diff
changeset
|
228 |
|
20598d7ce9fa
Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
422
diff
changeset
|
229 |
"Created: / 23-04-2015 / 18:03:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
20598d7ce9fa
Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
422
diff
changeset
|
230 |
! |
20598d7ce9fa
Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
422
diff
changeset
|
231 |
|
502
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
232 |
allocateReturnVariableNamed: name |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
233 |
"Allocate temporary variable used for storing a parser's return value (the parsed object)" |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
234 |
|
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
235 |
variableForReturn notNil ifTrue:[ |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
236 |
self error: 'Return variable already allocated!!'. |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
237 |
^ self. |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
238 |
]. |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
239 |
variableForReturn := self allocateTemporaryVariableNamed: name. |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
240 |
^ variableForReturn |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
241 |
|
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
242 |
"Created: / 15-06-2015 / 17:52:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
243 |
! |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
244 |
|
438
20598d7ce9fa
Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
422
diff
changeset
|
245 |
allocateTemporaryVariableNamed:preferredName |
20598d7ce9fa
Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
422
diff
changeset
|
246 |
"Allocate a new variable with (preferably) given name. |
20598d7ce9fa
Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
422
diff
changeset
|
247 |
Returns a real variable name that should be used." |
20598d7ce9fa
Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
422
diff
changeset
|
248 |
|
515
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
249 |
^ source allocateTemporaryVariableNamed: preferredName |
438
20598d7ce9fa
Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
422
diff
changeset
|
250 |
|
20598d7ce9fa
Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
422
diff
changeset
|
251 |
"Created: / 23-04-2015 / 17:37:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
502
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
252 |
"Modified: / 01-06-2015 / 21:04:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
452
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
253 |
! |
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
254 |
|
502
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
255 |
returnVariable |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
256 |
^ variableForReturn |
452
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
257 |
|
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
258 |
"Created: / 23-04-2015 / 20:50:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
502
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
259 |
"Modified (format): / 15-06-2015 / 18:12:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
452
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
260 |
! |
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
261 |
|
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
262 |
returnVariable: aString |
502
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
263 |
(variableForReturn notNil and:[variableForReturn ~= aString]) ifTrue:[ |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
264 |
self error: 'Return variable already allocated with different name (''', variableForReturn , ''' vs ''', aString,''')'. |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
265 |
]. |
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
266 |
variableForReturn := aString |
452
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
267 |
|
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
268 |
"Created: / 23-04-2015 / 18:23:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
502
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
269 |
"Modified: / 15-06-2015 / 18:14:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
515
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
270 |
! |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
271 |
|
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
272 |
variables |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
273 |
self error: 'Should no longer be used'. |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
274 |
" |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
275 |
^ ' | ', (variables inject: '' into: [ :s :e | s, ' ', e]), ' |' |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
276 |
" |
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
277 |
|
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
278 |
"Modified: / 17-08-2015 / 11:54:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
438
20598d7ce9fa
Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
422
diff
changeset
|
279 |
! ! |
20598d7ce9fa
Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
422
diff
changeset
|
280 |
|
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
281 |
!PPCMethod methodsFor:'initialization'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
282 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
283 |
initialize |
515
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
284 |
source := PPCCodeBlock new. |
502
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
285 |
|
1e45d3c96ec5
Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
464
diff
changeset
|
286 |
"Modified: / 01-06-2015 / 21:33:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
438
20598d7ce9fa
Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
422
diff
changeset
|
287 |
! ! |
20598d7ce9fa
Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
422
diff
changeset
|
288 |
|
452
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
289 |
!PPCMethod methodsFor:'printing'! |
438
20598d7ce9fa
Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
422
diff
changeset
|
290 |
|
20598d7ce9fa
Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
422
diff
changeset
|
291 |
printOn:aStream |
20598d7ce9fa
Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
422
diff
changeset
|
292 |
"append a printed representation if the receiver to the argument, aStream" |
20598d7ce9fa
Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
422
diff
changeset
|
293 |
|
20598d7ce9fa
Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
422
diff
changeset
|
294 |
super printOn:aStream. |
20598d7ce9fa
Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
422
diff
changeset
|
295 |
aStream nextPutAll:' id: '. |
515
b5316ef15274
Updated to PetitCompiler-JanKurs.160, PetitCompiler-Tests-JanKurs.112, PetitCompiler-Extras-Tests-JanKurs.25, PetitCompiler-Benchmarks-JanKurs.17
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
502
diff
changeset
|
296 |
selector printOn:aStream. |
438
20598d7ce9fa
Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
422
diff
changeset
|
297 |
|
20598d7ce9fa
Updated to PetitCompiler-JanKurs.100, PetitCompiler-Tests-JanKurs.44 and PetitCompiler-Benchmarks-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
422
diff
changeset
|
298 |
"Modified: / 23-04-2015 / 12:32:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
299 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
300 |
|
452
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
301 |
!PPCMethod methodsFor:'testing'! |
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
302 |
|
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
303 |
isInline |
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
304 |
^ false |
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
305 |
! |
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
306 |
|
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
307 |
isMethod |
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
308 |
^ true |
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
309 |
! ! |
9f4558b3be66
Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
438
diff
changeset
|
310 |
|
399
b5b7a6db033b
Fix in PPCMethod>>addVariable: make sure variable is added only once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
393
diff
changeset
|
311 |
!PPCMethod class methodsFor:'documentation'! |
b5b7a6db033b
Fix in PPCMethod>>addVariable: make sure variable is added only once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
393
diff
changeset
|
312 |
|
b5b7a6db033b
Fix in PPCMethod>>addVariable: make sure variable is added only once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
393
diff
changeset
|
313 |
version_HG |
b5b7a6db033b
Fix in PPCMethod>>addVariable: make sure variable is added only once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
393
diff
changeset
|
314 |
|
b5b7a6db033b
Fix in PPCMethod>>addVariable: make sure variable is added only once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
393
diff
changeset
|
315 |
^ '$Changeset: <not expanded> $' |
b5b7a6db033b
Fix in PPCMethod>>addVariable: make sure variable is added only once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
393
diff
changeset
|
316 |
! ! |
b5b7a6db033b
Fix in PPCMethod>>addVariable: make sure variable is added only once.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
393
diff
changeset
|
317 |