compiler/tests/extras/PPCompiledJavaResource.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Mon, 07 Sep 2015 11:53:38 +0100
changeset 538 16e8536f5cfb
parent 537 fb212e14d1f4
permissions -rw-r--r--
PPCConfiguration refactoring: [10/10]: Cleaned up compilation API The main compilation method is now PPParser>>compileWithOptions: Removed oither old and unused compilation methods from PPParser and other PetitCompiler classes.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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:
diff changeset
     1
"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }"
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     2
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     3
"{ NameSpace: Smalltalk }"
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     4
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     5
TestResource subclass:#PPCompiledJavaResource
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     6
	instanceVariableNames:''
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     7
	classVariableNames:''
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     8
	poolDictionaries:''
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     9
	category:'PetitCompiler-Extras-Tests-Java'
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    10
!
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    11
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    12
!PPCompiledJavaResource methodsFor:'as yet unclassified'!
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    13
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    14
setUp
537
fb212e14d1f4 PPCConfiguration refactoring: [9/10]: Renamed PPCConfiguration to PPCCompiler.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 529
diff changeset
    15
    | time  compiler |
fb212e14d1f4 PPCConfiguration refactoring: [9/10]: Renamed PPCConfiguration to PPCCompiler.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 529
diff changeset
    16
538
16e8536f5cfb PPCConfiguration refactoring: [10/10]: Cleaned up compilation API
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 537
diff changeset
    17
    compiler := PPCCompiler newWithOptions: #( #tokenize: false ).
537
fb212e14d1f4 PPCConfiguration refactoring: [9/10]: Renamed PPCConfiguration to PPCCompiler.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 529
diff changeset
    18
    compiler options parserName:#PPCompiledJavaSyntax.
fb212e14d1f4 PPCConfiguration refactoring: [9/10]: Renamed PPCConfiguration to PPCCompiler.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 529
diff changeset
    19
    time := Time 
538
16e8536f5cfb PPCConfiguration refactoring: [10/10]: Cleaned up compilation API
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 537
diff changeset
    20
            millisecondsToRun:[ compiler compile:  PPJavaSyntax new ].
537
fb212e14d1f4 PPCConfiguration refactoring: [9/10]: Renamed PPCConfiguration to PPCCompiler.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 529
diff changeset
    21
    Transcript
fb212e14d1f4 PPCConfiguration refactoring: [9/10]: Renamed PPCConfiguration to PPCCompiler.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 529
diff changeset
    22
        show:'Java Syntax compiled in: ';
fb212e14d1f4 PPCConfiguration refactoring: [9/10]: Renamed PPCConfiguration to PPCCompiler.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 529
diff changeset
    23
        show:time asString;
fb212e14d1f4 PPCConfiguration refactoring: [9/10]: Renamed PPCConfiguration to PPCCompiler.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 529
diff changeset
    24
        show:'ms';
fb212e14d1f4 PPCConfiguration refactoring: [9/10]: Renamed PPCConfiguration to PPCCompiler.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 529
diff changeset
    25
        cr.
454
a9cd5ea7cc36 Portability: fixes for Smalltalk/X
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 452
diff changeset
    26
538
16e8536f5cfb PPCConfiguration refactoring: [10/10]: Cleaned up compilation API
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 537
diff changeset
    27
    "Modified: / 07-09-2015 / 12:37:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
452
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    28
! !
9f4558b3be66 Updated to PetitCompiler-JanKurs.111, PetitCompiler-Tests-JanKurs.51, PetitCompiler-Benchmarks-JanKurs.7, added PetitCompiler-Extras-Tests-JanKurs.4
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    29