author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Mon, 17 Aug 2015 12:56:02 +0100 | |
changeset 516 | 3b81c9e53352 |
parent 503 | ff58cd9f1f3c |
parent 515 | b5316ef15274 |
child 519 | 1563dce3c5b4 |
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 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
3 |
!Character methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
4 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
5 |
ppcPrintable |
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
|
6 |
^ self asInteger > 31 and: [ self asInteger < 127 ] |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
7 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
8 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
9 |
!Object methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
10 |
|
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
|
11 |
canHavePPCId |
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
|
12 |
^ false |
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
|
13 |
! ! |
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
|
14 |
|
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
|
15 |
!Object methodsFor:'*petitcompiler'! |
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
|
16 |
|
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
|
17 |
isFsaFailure |
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
|
18 |
^ false |
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
|
19 |
! ! |
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
|
20 |
|
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
|
21 |
!Object methodsFor:'*petitcompiler'! |
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
|
22 |
|
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
23 |
isInlinedMethod |
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
|
24 |
^ false |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
25 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
26 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
27 |
!PPActionParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
28 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
29 |
asCompilerNode |
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
|
30 |
^ PPCActionNode new |
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
|
31 |
name: self name; |
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
|
32 |
block: block; |
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 |
child: parser; |
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
|
34 |
properties: properties; |
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
|
35 |
parser: self; |
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
|
36 |
yourself |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
37 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
38 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
39 |
!PPActionParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
40 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
41 |
compileWith: aPetitCompiler |
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
|
42 |
block isSymbol ifTrue: [ |
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
|
43 |
^ aPetitCompiler compileSymbolBlock: block for: self |
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
|
44 |
]. |
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
|
45 |
^ aPetitCompiler compileBlock: block for: self |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
46 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
47 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
48 |
!PPAndParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
49 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
50 |
asCompilerNode |
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
|
51 |
^ PPCAndNode new |
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
|
52 |
name: self name; |
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
|
53 |
child: parser; |
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
|
54 |
yourself |
391
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 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
57 |
!PPCharSetPredicate methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
58 |
|
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
|
59 |
= anObject |
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
|
60 |
self == anObject ifTrue: [ ^ 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
|
61 |
self class == anObject class ifFalse: [ ^ 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
|
62 |
^ classification = anObject classification |
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
|
63 |
! ! |
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
|
64 |
|
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
|
65 |
!PPCharSetPredicate methodsFor:'*petitcompiler'! |
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
|
66 |
|
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
67 |
block |
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
|
68 |
^ block |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
69 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
70 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
71 |
!PPCharSetPredicate methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
72 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
73 |
classification |
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
|
74 |
^ classification |
391
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 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
77 |
!PPCharSetPredicate methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
78 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
79 |
equals: anotherPredicate |
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
|
80 |
self == anotherPredicate ifTrue: [ ^ 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
|
81 |
self class == anotherPredicate class ifFalse: [ ^ 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
|
82 |
|
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
|
83 |
^ classification = anotherPredicate classification. |
391
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 |
|
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
|
86 |
!PPCharSetPredicate methodsFor:'*petitcompiler'! |
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
|
87 |
|
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
|
88 |
hash |
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
|
89 |
^ classification hash |
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
|
90 |
! ! |
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
|
91 |
|
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
92 |
!PPChoiceParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
93 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
94 |
asCompilerNode |
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
|
95 |
^ PPCChoiceNode new |
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
|
96 |
name: self name; |
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
|
97 |
children: parsers; |
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
|
98 |
parser: self; |
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
|
99 |
yourself |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
100 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
101 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
102 |
!PPChoiceParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
103 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
104 |
compileWith: aPetitCompiler |
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
|
105 |
^ aPetitCompiler compileChoice: self |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
106 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
107 |
|
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
|
108 |
!PPCompositeParser methodsFor:'*petitcompiler'! |
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
|
109 |
|
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
|
110 |
asCompilerNode |
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
|
111 |
^ PPCForwardNode 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
|
112 |
name: self 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
|
113 |
child: parser; |
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
|
114 |
yourself |
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
|
115 |
|
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
|
116 |
"Modified: / 22-05-2015 / 21:54:41 / 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
|
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 |
|
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
119 |
!PPContext methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
120 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
121 |
asCompiledParserContext |
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
|
122 |
^ PPCContext new |
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
|
123 |
stream: stream; |
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
|
124 |
yourself |
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 |
|
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
126 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
127 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
128 |
!PPContext methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
129 |
|
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
|
130 |
atWs |
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
|
131 |
^ false |
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
|
132 |
! ! |
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
|
133 |
|
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
|
134 |
!PPContext methodsFor:'*petitcompiler'! |
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
|
135 |
|
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
136 |
comment |
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
|
137 |
^ self globalAt: #comment ifAbsent: [ nil ]. |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
138 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
139 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
140 |
!PPContext methodsFor:'*petitcompiler'! |
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 |
comment: value |
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 globalAt: #comment put: value |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
144 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
145 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
146 |
!PPContext methodsFor:'*petitcompiler'! |
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 |
compiledParser |
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
|
149 |
^ self globalAt: #compiledParser |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
150 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
151 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
152 |
!PPContext methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
153 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
154 |
compiledParser: aPPParser |
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
|
155 |
^ self globalAt: #compiledParser put: aPPParser |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
156 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
157 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
158 |
!PPContext methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
159 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
160 |
lwRemember |
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
|
161 |
^ self position |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
162 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
163 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
164 |
!PPContext methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
165 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
166 |
lwRestore: position |
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
|
167 |
^ self position: position |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
168 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
169 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
170 |
!PPContext methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
171 |
|
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 |
methodFinished: whatever |
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
|
173 |
"nothing to do" |
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
|
174 |
! ! |
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
|
175 |
|
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
|
176 |
!PPContext methodsFor:'*petitcompiler'! |
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 |
|
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
|
178 |
methodInvoked: whatever |
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
|
179 |
"nothing to do" |
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
|
180 |
! ! |
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
|
181 |
|
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
|
182 |
!PPContext methodsFor:'*petitcompiler'! |
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
|
183 |
|
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
184 |
peek: anInteger |
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
|
185 |
^ stream peek: anInteger |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
186 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
187 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
188 |
!PPContext methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
189 |
|
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
|
190 |
setWs |
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
|
191 |
"nothing to do" |
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
|
192 |
! ! |
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 |
|
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
|
194 |
!PPContext methodsFor:'*petitcompiler'! |
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
|
195 |
|
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
|
196 |
skipSeparators |
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
|
197 |
^ stream skipSeparators |
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
|
198 |
! ! |
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
|
199 |
|
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
|
200 |
!PPContext methodsFor:'*petitcompiler'! |
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
|
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 |
tokenRead: whatever |
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
|
203 |
"nothing to do" |
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
|
204 |
! ! |
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
|
205 |
|
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
|
206 |
!PPContext methodsFor:'*petitcompiler'! |
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
|
207 |
|
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
208 |
whitespace |
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
|
209 |
^ self globalAt: #whitespace ifAbsent: [ nil ]. |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
210 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
211 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
212 |
!PPContext methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
213 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
214 |
whitespace: value |
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
|
215 |
^ self globalAt: #whitespace put: value |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
216 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
217 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
218 |
!PPDelegateParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
219 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
220 |
asCompilerNode |
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
|
221 |
self class == PPDelegateParser ifTrue: [ |
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
|
222 |
^ PPCForwardNode new |
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
|
223 |
name: self name; |
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
|
224 |
child: parser; |
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
|
225 |
yourself |
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
|
226 |
]. |
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
|
227 |
^ super asCompilerNode |
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
|
228 |
|
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
|
229 |
"Modified: / 22-05-2015 / 21:53:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
230 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
231 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
232 |
!PPDelegateParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
233 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
234 |
compileWith: aPetitCompiler |
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
|
235 |
(self class == PPDelegateParser) ifTrue: [ |
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
|
236 |
(self name notNil and: [ parser name isNil ]) ifTrue: [ |
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
|
237 |
parser name: self name. |
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
|
238 |
^ parser compileWith: aPetitCompiler. |
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
|
239 |
]. |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
240 |
|
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
|
241 |
(self name notNil and: [ parser name notNil ]) ifTrue: [ |
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
|
242 |
^ aPetitCompiler compileDelegate: self. |
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
|
243 |
] |
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
|
244 |
]. |
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
|
245 |
^ super compileWith: aPetitCompiler. |
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
|
246 |
! ! |
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
|
247 |
|
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
|
248 |
!PPEndOfFileParser methodsFor:'*petitcompiler'! |
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 |
|
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
|
250 |
asCompilerNode |
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
|
251 |
^ PPCEndOfFileNode new |
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
|
252 |
name: self 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
|
253 |
yourself |
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
|
254 |
! ! |
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
|
255 |
|
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
|
256 |
!PPEndOfInputParser methodsFor:'*petitcompiler'! |
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 |
asCompilerNode |
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
|
259 |
|
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 |
^ PPCEndOfInputNode new |
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 |
name: self name; |
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 |
child: parser; |
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
|
263 |
yourself |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
264 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
265 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
266 |
!PPEpsilonParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
267 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
268 |
asCompilerNode |
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
|
269 |
^ PPCNilNode new |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
270 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
271 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
272 |
!PPEpsilonParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
273 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
274 |
compileWith: aPetitCompiler |
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
|
275 |
^ aPetitCompiler compileNil |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
276 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
277 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
278 |
!PPFailure methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
279 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
280 |
context: aPPContext |
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
|
281 |
context := aPPContext |
391
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 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
284 |
!PPFailure methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
285 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
286 |
message: text |
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
|
287 |
message := text |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
288 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
289 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
290 |
!PPFailure methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
291 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
292 |
position: anInteger |
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
|
293 |
position := anInteger |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
294 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
295 |
|
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
|
296 |
!PPJavaWhitespaceParser methodsFor:'*petitcompiler'! |
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 |
= anotherParser |
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
|
299 |
anotherParser == self ifTrue: [ ^ true ]. |
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
|
300 |
anotherParser class = self class ifFalse: [ ^ false ]. |
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
|
301 |
^ anotherParser name = self 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
|
302 |
! ! |
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
|
303 |
|
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
|
304 |
!PPJavaWhitespaceParser methodsFor:'*petitcompiler'! |
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
|
305 |
|
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
|
306 |
hash |
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
|
307 |
^ self name hash |
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
|
308 |
! ! |
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
|
309 |
|
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
310 |
!PPLiteralObjectParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
311 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
312 |
asCompilerNode |
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
|
313 |
^ PPCCharacterNode new |
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
|
314 |
character: literal; |
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
|
315 |
name: self name; |
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
|
316 |
yourself |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
317 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
318 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
319 |
!PPLiteralObjectParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
320 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
321 |
compileWith: aPetitCompiler |
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
|
322 |
^ aPetitCompiler compileCharacter: literal. |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
323 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
324 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
325 |
!PPLiteralParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
326 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
327 |
id |
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
|
328 |
^ literal printString |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
329 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
330 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
331 |
!PPLiteralSequenceParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
332 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
333 |
asCompilerNode |
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
|
334 |
^ PPCLiteralNode new |
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
|
335 |
literal: literal; |
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
|
336 |
name: self name; |
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
|
337 |
yourself |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
338 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
339 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
340 |
!PPLiteralSequenceParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
341 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
342 |
compileWith: aPetitCompiler |
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
|
343 |
^ aPetitCompiler compileLiteral: literal. |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
344 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
345 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
346 |
!PPNotParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
347 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
348 |
asCompilerNode |
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
|
349 |
^ PPCNotNode new |
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
|
350 |
child: parser; |
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
|
351 |
name: self name; |
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
|
352 |
yourself |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
353 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
354 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
355 |
!PPNotParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
356 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
357 |
compileWith: aPetitCompiler |
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
|
358 |
^ aPetitCompiler compileNot: self |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
359 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
360 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
361 |
!PPOptionalParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
362 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
363 |
asCompilerNode |
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
|
364 |
^ PPCOptionalNode new |
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
|
365 |
name: self name; |
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
|
366 |
child: parser; |
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
|
367 |
yourself |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
368 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
369 |
" ^ super asCompilerNode " |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
370 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
371 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
372 |
!PPOptionalParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
373 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
374 |
compileWith: aPetitCompiler |
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
|
375 |
^ aPetitCompiler compileOptional: self |
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
|
376 |
! ! |
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
|
377 |
|
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
|
378 |
!PPParser methodsFor:'*petitcompiler'! |
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
|
379 |
|
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
|
380 |
allNodesDo: aBlock seen: aSet |
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
|
381 |
"Iterate over all the parse nodes of the receiver, do not visit and follow the ones contained in aSet." |
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
|
382 |
|
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
|
383 |
(aSet includes: self) ifTrue: [ ^ self ]. |
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
|
384 |
aSet add: self. |
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
|
385 |
aBlock value: self. |
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
|
386 |
|
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
|
387 |
self children do: [ :each | |
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
|
388 |
each allNodesDo: aBlock seen: aSet |
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
|
389 |
] |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
390 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
391 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
392 |
!PPParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
393 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
394 |
asCompilerNode |
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
|
395 |
^ PPCUnknownNode new |
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
|
396 |
parser: self; |
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
|
397 |
name: self name; |
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
|
398 |
yourself |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
399 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
400 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
401 |
!PPParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
402 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
403 |
asCompilerTree |
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
|
404 |
^ self transform: [ :p | p asCompilerNode ] |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
405 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
406 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
407 |
!PPParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
408 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
409 |
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
|
410 |
^ self |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
411 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
412 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
413 |
!PPParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
414 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
415 |
compile |
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
|
416 |
^ self compile: PPCArguments default |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
417 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
418 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
419 |
!PPParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
420 |
|
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
|
421 |
compile: arguments |
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
|
422 |
self assert: (arguments isKindOf: PPCArguments). |
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
|
423 |
|
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
|
424 |
^ PPCConfiguration default |
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
|
425 |
arguments: arguments; |
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
|
426 |
compile: self |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
427 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
428 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
429 |
!PPParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
430 |
|
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
|
431 |
compile: arguments andParse: input |
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
|
432 |
^ (self compile: arguments) parse: input |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
433 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
434 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
435 |
!PPParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
436 |
|
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
|
437 |
compileAs: name |
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
|
438 |
| arguments | |
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
|
439 |
arguments := PPCArguments default. |
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
|
440 |
arguments name: name. |
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
|
441 |
|
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
|
442 |
^ self compile: arguments |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
443 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
444 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
445 |
!PPParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
446 |
|
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
|
447 |
compileTokenizing |
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
|
448 |
| configuration | |
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
|
449 |
configuration := PPCConfiguration tokenizing. |
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
|
450 |
^ self compileWithConfiguration: configuration |
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
|
451 |
! ! |
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
|
452 |
|
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
|
453 |
!PPParser methodsFor:'*petitcompiler'! |
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
|
454 |
|
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
|
455 |
compileWithConfiguration: configuration |
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
|
456 |
^ configuration compile: self |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
457 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
458 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
459 |
!PPParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
460 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
461 |
firstSetSuchThat: block |
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
|
462 |
self halt: 'deprecated?'. |
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
|
463 |
^ self firstSetSuchThat: block into: (OrderedCollection new) openSet: IdentitySet new. |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
464 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
465 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
466 |
!PPParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
467 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
468 |
firstSetSuchThat: block into: aCollection openSet: aSet |
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
|
469 |
(aSet includes: self) ifTrue: [ ^ aCollection ]. |
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
|
470 |
aSet add: self. |
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
|
471 |
|
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
|
472 |
(block value: self) ifTrue: [aCollection add: self. ^ aCollection ]. |
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
|
473 |
self children do: [ :child | |
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
|
474 |
child firstSetSuchThat: block into: aCollection openSet: aSet |
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
|
475 |
]. |
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
|
476 |
^ aCollection |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
477 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
478 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
479 |
!PPParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
480 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
481 |
id |
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
|
482 |
self name ifNotNil: [ ^ self name ]. |
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
|
483 |
^ self hash asString |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
484 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
485 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
486 |
!PPParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
487 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
488 |
isCompiled |
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
|
489 |
^ false |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
490 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
491 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
492 |
!PPParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
493 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
494 |
isContextFree |
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
|
495 |
^ self propertyAt: #isContextFree ifAbsentPut: |
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
|
496 |
[ self allParsers allSatisfy: [ :p | p isContextFreePrim ] ]. |
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
|
497 |
|
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
498 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
499 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
500 |
!PPParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
501 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
502 |
isContextFreePrim |
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
|
503 |
^ true |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
504 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
505 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
506 |
!PPParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
507 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
508 |
isToken |
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
|
509 |
^ false |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
510 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
511 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
512 |
!PPParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
513 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
514 |
isTokenParser |
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
|
515 |
^ false |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
516 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
517 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
518 |
!PPParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
519 |
|
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
|
520 |
javaToken |
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
|
521 |
| ws | |
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
|
522 |
ws := PPJavaWhitespaceParser new. |
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
|
523 |
^ ((ws, ((PPTokenParser on: self) tokenClass: PPJavaToken; yourself), ws) ==> #second) |
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
|
524 |
propertyAt: #'trimmingToken' put: 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
|
525 |
yourself |
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
|
526 |
! ! |
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
|
527 |
|
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
|
528 |
!PPParser methodsFor:'*petitcompiler'! |
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
|
529 |
|
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
530 |
optimize |
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
|
531 |
^ self copy |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
532 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
533 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
534 |
!PPParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
535 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
536 |
optimized |
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
|
537 |
^ self copy |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
538 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
539 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
540 |
!PPParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
541 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
542 |
trimmingToken |
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
|
543 |
| ws | |
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
|
544 |
ws := #space asParser star. |
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
|
545 |
^ ((ws, (PPTokenParser on: self), ws) ==> #second) |
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
|
546 |
propertyAt: #trimmingToken put: 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
|
547 |
yourself |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
548 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
549 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
550 |
!PPPluggableParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
551 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
552 |
acceptsEpsilon |
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
|
553 |
^ true |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
554 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
555 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
556 |
!PPPluggableParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
557 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
558 |
asCompilerNode |
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
|
559 |
^ PPCPluggableNode new |
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
|
560 |
block: block; |
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
|
561 |
name: self name; |
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
|
562 |
yourself |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
563 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
564 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
565 |
!PPPossessiveRepeatingParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
566 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
567 |
asCompilerNode |
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
|
568 |
((self min = 0) and: [ self max = SmallInteger maxVal ]) ifTrue: [ |
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
|
569 |
^ PPCStarNode new |
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
|
570 |
name: self name; |
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
|
571 |
child: parser; |
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
|
572 |
parser: self; |
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
|
573 |
yourself |
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
|
574 |
]. |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
575 |
|
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
|
576 |
((self min = 1) and: [ self max = SmallInteger maxVal ]) ifTrue: [ |
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
|
577 |
^ PPCPlusNode new |
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
|
578 |
name: self name; |
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
|
579 |
child: parser; |
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
|
580 |
parser: self; |
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
|
581 |
yourself |
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
|
582 |
]. |
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
|
583 |
^ super asCompilerNode |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
584 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
585 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
586 |
!PPPossessiveRepeatingParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
587 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
588 |
compileWith: aPetitCompiler |
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
|
589 |
((self min = 1) and: [ self max = SmallInteger maxVal ]) ifTrue: [ |
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
|
590 |
^ aPetitCompiler compilePlus: self. |
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
|
591 |
]. |
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
|
592 |
((self min = 0) and: [ self max = SmallInteger maxVal ]) ifTrue: [ |
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
|
593 |
^ aPetitCompiler compileStar: self. |
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
|
594 |
]. |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
595 |
|
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
|
596 |
^ super compileWith: aPetitCompiler. |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
597 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
598 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
599 |
!PPPredicateObjectParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
600 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
601 |
asCompilerNode |
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
|
602 |
^ PPCPredicateNode new |
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
|
603 |
name: self name; |
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
|
604 |
predicate: predicate; |
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
|
605 |
yourself |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
606 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
607 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
608 |
!PPPredicateObjectParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
609 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
610 |
compileWith: aPetitCompiler |
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
|
611 |
(predicateMessage = 'input expected') ifTrue: [ |
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
|
612 |
^ aPetitCompiler compileAny. |
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
|
613 |
]. |
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
|
614 |
^ aPetitCompiler compilePredicate: predicate. |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
615 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
616 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
617 |
!PPPredicateObjectParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
618 |
|
414
0eaf09920532
Merged JK's work on PetitCompiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
391
diff
changeset
|
619 |
firstCharSet |
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
|
620 |
^ predicate |
414
0eaf09920532
Merged JK's work on PetitCompiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
391
diff
changeset
|
621 |
! ! |
0eaf09920532
Merged JK's work on PetitCompiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
391
diff
changeset
|
622 |
|
0eaf09920532
Merged JK's work on PetitCompiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
391
diff
changeset
|
623 |
!PPPredicateObjectParser methodsFor:'*petitcompiler'! |
0eaf09920532
Merged JK's work on PetitCompiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
391
diff
changeset
|
624 |
|
0eaf09920532
Merged JK's work on PetitCompiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
391
diff
changeset
|
625 |
firstCharSetCached |
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
|
626 |
^ predicate |
414
0eaf09920532
Merged JK's work on PetitCompiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
391
diff
changeset
|
627 |
! ! |
0eaf09920532
Merged JK's work on PetitCompiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
391
diff
changeset
|
628 |
|
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
629 |
!PPSequenceParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
630 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
631 |
asCompilerNode |
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
|
632 |
^ PPCSequenceNode new |
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
|
633 |
children: parsers; |
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
|
634 |
name: self name; |
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
|
635 |
properties: properties; |
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
|
636 |
yourself |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
637 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
638 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
639 |
!PPSequenceParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
640 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
641 |
compileWith: aPetitCompiler |
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
|
642 |
^ aPetitCompiler compileSequence: self. |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
643 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
644 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
645 |
!PPSequenceParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
646 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
647 |
firstSetSuchThat: block into: aCollection openSet: aSet |
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
|
648 |
(aSet includes: self) ifTrue: [ ^ aCollection ]. |
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
|
649 |
aSet add: self. |
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
|
650 |
|
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
|
651 |
(block value: self) ifTrue: [ aCollection add: self. ^ aCollection ]. |
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
|
652 |
|
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
|
653 |
self children do: [ :child | |
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
|
654 |
child firstSetSuchThat: block into: aCollection openSet: aSet. |
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
|
655 |
child acceptsEpsilon ifFalse: [ ^ aCollection ] |
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
|
656 |
]. |
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
|
657 |
^ aCollection |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
658 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
659 |
|
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
|
660 |
!PPSequenceParser methodsFor:'*petitcompiler'! |
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
|
661 |
|
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
|
662 |
map: aBlock |
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
|
663 |
^ aBlock numArgs = self children size |
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
|
664 |
ifTrue: [ PPMappedActionParser on: self block: aBlock ] |
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
|
665 |
ifFalse: [ self error: aBlock numArgs asString , ' arguments expected.' ] |
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
|
666 |
|
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
|
667 |
"Modified: / 02-06-2015 / 17:16:36 / 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
|
668 |
! ! |
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
|
669 |
|
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
670 |
!PPSmalltalkGrammar methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
671 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
672 |
comment |
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
|
673 |
^ $" asParser, $" asParser negate star, $" asParser. |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
674 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
675 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
676 |
!PPSmalltalkGrammar methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
677 |
|
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
|
678 |
number |
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
|
679 |
| numberChars | |
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
|
680 |
numberChars := #hex asParser / 'r' asParser / 's' asParser / '-' asParser. |
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
|
681 |
^ $- asParser optional, #digit asParser, numberChars star, ('.' asParser, numberChars plus) optional. |
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
|
682 |
|
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
|
683 |
" ^ ($- asParser optional , #digit asParser) and , [ :context | |
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
|
684 |
[ (NumberParser on: context stream) nextNumber ] |
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
|
685 |
on: Error |
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
|
686 |
do: [ :err | PPFailure message: err messageText at: context position ] ] |
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
|
687 |
asParser |
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
|
688 |
" |
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
|
689 |
! ! |
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
|
690 |
|
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
|
691 |
!PPSmalltalkGrammar methodsFor:'*petitcompiler'! |
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
|
692 |
|
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
693 |
whitespace |
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
|
694 |
^ #space asParser plus |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
695 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
696 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
697 |
!PPSmalltalkTokenParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
698 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
699 |
compileWith: aPetitCompiler |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
700 |
|
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
|
701 |
^ aPetitCompiler compileSmalltalkToken: self. |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
702 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
703 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
704 |
!PPSmalltalkTokenParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
705 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
706 |
parseOnX: aPPContext |
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
|
707 |
| memento comments token | |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
708 |
|
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
|
709 |
memento := aPPContext remember. |
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
|
710 |
comments := self |
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
|
711 |
parseComments: #() |
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
|
712 |
on: aPPContext. |
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
|
713 |
token := super parseOn: aPPContext. |
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
|
714 |
token isPetitFailure ifTrue: [ |
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
|
715 |
aPPContext restore: memento. |
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
|
716 |
^ token ]. |
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
|
717 |
comments := self |
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
|
718 |
parseComments: comments |
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
|
719 |
on: aPPContext. |
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
|
720 |
^ token comments: comments |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
721 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
722 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
723 |
!PPSmalltalkTokenParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
724 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
725 |
whitespace |
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
|
726 |
^ PPSmalltalkWhitespaceParser new |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
727 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
728 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
729 |
!PPSmalltalkWhitespaceParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
730 |
|
421
7e08b31e0dae
Merged JK's version from Monticello
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
414
diff
changeset
|
731 |
= anotherParser |
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
|
732 |
anotherParser == self ifTrue: [ ^ 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
|
733 |
anotherParser class = self class ifFalse: [ ^ false ]. |
421
7e08b31e0dae
Merged JK's version from Monticello
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
414
diff
changeset
|
734 |
^ anotherParser name = self name |
7e08b31e0dae
Merged JK's version from Monticello
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
414
diff
changeset
|
735 |
! ! |
7e08b31e0dae
Merged JK's version from Monticello
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
414
diff
changeset
|
736 |
|
7e08b31e0dae
Merged JK's version from Monticello
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
414
diff
changeset
|
737 |
!PPSmalltalkWhitespaceParser methodsFor:'*petitcompiler'! |
7e08b31e0dae
Merged JK's version from Monticello
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
414
diff
changeset
|
738 |
|
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
739 |
acceptsEpsilon |
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
|
740 |
^ true |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
741 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
742 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
743 |
!PPSmalltalkWhitespaceParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
744 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
745 |
acceptsEpsilonOpenSet: set |
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
|
746 |
^ true |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
747 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
748 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
749 |
!PPSmalltalkWhitespaceParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
750 |
|
414
0eaf09920532
Merged JK's work on PetitCompiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
391
diff
changeset
|
751 |
firstCharSet |
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
|
752 |
^ PPCharSetPredicate on: [:e | 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
|
753 |
! ! |
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
|
754 |
|
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
|
755 |
!PPSmalltalkWhitespaceParser methodsFor:'*petitcompiler'! |
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
|
756 |
|
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
|
757 |
hash |
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
|
758 |
^ self name hash |
414
0eaf09920532
Merged JK's work on PetitCompiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
391
diff
changeset
|
759 |
! ! |
0eaf09920532
Merged JK's work on PetitCompiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
391
diff
changeset
|
760 |
|
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
|
761 |
!PPSmalltalkWhitespaceParser methodsFor:'*petitcompiler'! |
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
|
762 |
|
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
|
763 |
parseOn: aPPContext |
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
|
764 |
[ [aPPContext atEnd not and: [ aPPContext uncheckedPeek isSeparator ] ] |
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
|
765 |
whileTrue: [ aPPContext next ]. |
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
|
766 |
|
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
|
767 |
aPPContext atEnd not and: [ aPPContext uncheckedPeek = $" ] ] whileTrue: [ |
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
|
768 |
aPPContext next. |
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
|
769 |
"aPPContext upTo: $". |
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
|
770 |
|
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
|
771 |
[aPPContext atEnd or: [aPPContext next == $"]] whileFalse |
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
|
772 |
]. |
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
|
773 |
! ! |
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
|
774 |
|
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
775 |
!PPStream methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
776 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
777 |
peek: anInteger |
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
|
778 |
| endPosition | |
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
|
779 |
endPosition := position + anInteger min: readLimit. |
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
|
780 |
^ collection copyFrom: position+1 to: endPosition. |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
781 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
782 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
783 |
!PPToken methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
784 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
785 |
= anObject |
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
|
786 |
^ self class = anObject class and: [ self inputValue = anObject inputValue ] |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
787 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
788 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
789 |
!PPToken methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
790 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
791 |
hash |
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
|
792 |
^ self inputValue hash |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
793 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
794 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
795 |
!PPToken methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
796 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
797 |
isToken |
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
|
798 |
^ true |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
799 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
800 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
801 |
!PPTokenParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
802 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
803 |
asCompilerNode |
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
|
804 |
^ PPCTokenNode new |
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
|
805 |
name: self name; |
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
|
806 |
tokenClass: self tokenClass; |
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
|
807 |
child: parser; |
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
|
808 |
yourself |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
809 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
810 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
811 |
!PPTokenParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
812 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
813 |
displayName |
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
|
814 |
^ 'TOKEN[', parser displayName, ']' |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
815 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
816 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
817 |
!PPTokenParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
818 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
819 |
isFirstSetTerminal |
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
|
820 |
^ false |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
821 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
822 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
823 |
!PPTokenParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
824 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
825 |
isTokenParser |
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
|
826 |
^ true |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
827 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
828 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
829 |
!PPTokenParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
830 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
831 |
optimize |
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
|
832 |
^ self transform: [ :each | each optimized ] |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
833 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
834 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
835 |
!PPTokenParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
836 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
837 |
parser |
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
|
838 |
^ parser |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
839 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
840 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
841 |
!PPTokenParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
842 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
843 |
startsWith: aCharacter |
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
|
844 |
^ self first anySatisfy: [ :first | first startsWith: aCharacter ] |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
845 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
846 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
847 |
!PPTokenParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
848 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
849 |
whitespace |
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
|
850 |
^ self class whitespace |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
851 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
852 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
853 |
!PPTrimmingParser methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
854 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
855 |
asCompilerNode |
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
|
856 |
^ PPCTrimNode new |
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
|
857 |
child: parser; |
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
|
858 |
name: self name; |
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
|
859 |
parser: self; |
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
|
860 |
yourself |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
861 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
862 |
|
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
|
863 |
!RBLiteralValueNode methodsFor:'*petitcompiler'! |
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
|
864 |
|
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
|
865 |
isLiteralNumber |
516 | 866 |
((Smalltalk respondsTo: #isSmalltalk/X) and: [Smalltalk isSmalltalkX]) ifTrue:[ |
867 |
^super isLiteralNumber |
|
868 |
] ifFalse:[ |
|
869 |
"Assume Pharo..." |
|
870 |
[(NumberParser on: self sourceText ) nextNumber] on: Exception do: [ ^ false ]. |
|
871 |
^ true |
|
872 |
]. |
|
873 |
||
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
|
874 |
! ! |
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
|
875 |
|
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
|
876 |
!RBProgramNode methodsFor:'*petitcompiler'! |
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
|
877 |
|
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
|
878 |
isLiteralNumber |
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
|
879 |
^ false |
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
|
880 |
! ! |
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
|
881 |
|
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
882 |
!UndefinedObject methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
883 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
884 |
asInteger |
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
|
885 |
" |
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
|
886 |
because nil is returned as and of text on stream |
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
|
887 |
|
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
|
888 |
JK: This should be obviously rewritten in future!! |
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
|
889 |
" |
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
|
890 |
self flag: 'JK: Hack alert!!'. |
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
|
891 |
^ 256 |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
892 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
893 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
894 |
!UndefinedObject methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
895 |
|
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
|
896 |
codePoint |
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
|
897 |
" |
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
|
898 |
because nil is returned as and of text on stream |
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
|
899 |
|
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
|
900 |
JK: This should be obviously rewritten in future!! |
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
|
901 |
" |
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
|
902 |
self flag: 'JK: Hack alert!!'. |
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
|
903 |
^ 0 |
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
|
904 |
! ! |
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
|
905 |
|
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
|
906 |
!UndefinedObject methodsFor:'*petitcompiler'! |
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
|
907 |
|
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
908 |
isAlphaNumeric |
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
|
909 |
^ false |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
910 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
911 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
912 |
!UndefinedObject methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
913 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
914 |
isDigit |
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
|
915 |
^ false |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
916 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
917 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
918 |
!UndefinedObject methodsFor:'*petitcompiler'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
919 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
920 |
isLetter |
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
|
921 |
^ false |
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
922 |
! ! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
923 |
|
414
0eaf09920532
Merged JK's work on PetitCompiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
391
diff
changeset
|
924 |
!UndefinedObject methodsFor:'*petitcompiler'! |
0eaf09920532
Merged JK's work on PetitCompiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
391
diff
changeset
|
925 |
|
0eaf09920532
Merged JK's work on PetitCompiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
391
diff
changeset
|
926 |
isSeparator |
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
|
927 |
^ false |
414
0eaf09920532
Merged JK's work on PetitCompiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
391
diff
changeset
|
928 |
! ! |
0eaf09920532
Merged JK's work on PetitCompiler
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
391
diff
changeset
|
929 |
|
391
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
930 |
!stx_goodies_petitparser_compiler class methodsFor:'documentation'! |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
931 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
932 |
extensionsVersion_HG |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
933 |
|
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
934 |
^ '$Changeset: <not expanded> $' |
553a5456963b
Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff
changeset
|
935 |
! ! |