8 poolDictionaries:'' |
8 poolDictionaries:'' |
9 category:'PetitCompiler-Tests-Visitors' |
9 category:'PetitCompiler-Tests-Visitors' |
10 ! |
10 ! |
11 |
11 |
12 |
12 |
13 !PPCCodeGeneratorTest methodsFor:'as yet unclassified'! |
13 !PPCCodeGeneratorTest methodsFor:'generating'! |
|
14 |
|
15 compileTree: root |
|
16 parser := configuration compile: root. |
|
17 |
|
18 ! ! |
|
19 |
|
20 !PPCCodeGeneratorTest methodsFor:'running'! |
14 |
21 |
15 context |
22 context |
16 ^ context := PPCProfilingContext new |
23 ^ context := PPCProfilingContext new |
17 ! |
24 ! |
18 |
25 |
19 setUp |
26 setUp |
20 options := PPCCompilationOptions default |
27 options := PPCCompilationOptions default |
21 profile: true; |
28 profile: true. |
22 codeGenerator: PPCCodeGenerator. |
|
23 |
29 |
24 configuration := PPCPluggableConfiguration on: [ :_self | |
30 configuration := PPCPluggableConfiguration on: [ :_self | |
25 _self cacheFirstFollow. |
31 options cacheFirstFollow ifTrue:[ |
26 _self check. |
32 _self runPass: PPCCacheFirstFollowPass. |
27 _self generate. |
33 ]. |
|
34 _self runPass: PPCCheckingVisitor. |
|
35 _self runPass: PPCUniversalCodeGenerator. |
|
36 _self generateParser. |
28 ]. |
37 ]. |
29 configuration options: options. |
38 configuration options: options. |
30 |
39 |
31 "Modified: / 24-08-2015 / 23:40:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
40 "Modified: / 04-09-2015 / 10:31:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
32 ! |
41 ! |
33 |
42 |
34 tearDown |
43 tearDown |
35 | class | |
44 | class | |
36 |
45 |
37 class := (Smalltalk at: #PPGeneratedParser ifAbsent: [nil]). |
46 class := (Smalltalk at: #PPGeneratedParser ifAbsent: [nil]). |
38 class notNil ifTrue:[ |
47 class notNil ifTrue:[ |
39 class removeFromSystem |
48 class removeFromSystem |
40 ]. |
49 ]. |
41 ! ! |
|
42 |
|
43 !PPCCodeGeneratorTest methodsFor:'generating'! |
|
44 |
|
45 compileTree: root |
|
46 parser := configuration compile: root. |
|
47 |
|
48 ! ! |
50 ! ! |
49 |
51 |
50 !PPCCodeGeneratorTest methodsFor:'testing'! |
52 !PPCCodeGeneratorTest methodsFor:'testing'! |
51 |
53 |
52 assert: whatever parse: input |
54 assert: whatever parse: input |