compiler/tests/PPCMockCompiler.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Sun, 26 Oct 2014 22:00:05 +0000
changeset 393 00381102a9b5
parent 392 9b297f0d949c
child 422 116d2b2af905
permissions -rw-r--r--
Override #new in classes that implement #initialize. Not all Smalltalks call #initialize automatically. Actually, mose of them does not.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
391
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     1
"{ Package: 'stx:goodies/petitparser/compiler/tests' }"
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
Object subclass:#PPCMockCompiler
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     4
	instanceVariableNames:'lines'
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     5
	classVariableNames:''
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     6
	poolDictionaries:''
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     7
	category:'PetitCompiler-Tests-Core'
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
393
00381102a9b5 Override #new in classes that implement #initialize.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 392
diff changeset
    10
00381102a9b5 Override #new in classes that implement #initialize.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 392
diff changeset
    11
!PPCMockCompiler class methodsFor:'instance creation'!
00381102a9b5 Override #new in classes that implement #initialize.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 392
diff changeset
    12
00381102a9b5 Override #new in classes that implement #initialize.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 392
diff changeset
    13
new
00381102a9b5 Override #new in classes that implement #initialize.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 392
diff changeset
    14
    "return an initialized instance"
00381102a9b5 Override #new in classes that implement #initialize.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 392
diff changeset
    15
00381102a9b5 Override #new in classes that implement #initialize.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 392
diff changeset
    16
    ^ self basicNew initialize.
00381102a9b5 Override #new in classes that implement #initialize.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 392
diff changeset
    17
! !
00381102a9b5 Override #new in classes that implement #initialize.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 392
diff changeset
    18
391
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    19
!PPCMockCompiler methodsFor:'accessing'!
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    20
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    21
lines
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    22
	
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    23
	^ lines
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    24
!
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
lines: anObject
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    27
	
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    28
	lines := anObject
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    29
! !
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    30
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    31
!PPCMockCompiler methodsFor:'as yet unclassified'!
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    32
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    33
add: string
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    34
	lines add: string
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    35
!
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    36
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    37
addConstant: object as: id
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    38
	"TODO"
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    39
!
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
initialize
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    42
	super initialize.
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    43
	lines := OrderedCollection new.
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    44
! !
553a5456963b Ported PetitCompiler-(Tests).
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    45
393
00381102a9b5 Override #new in classes that implement #initialize.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 392
diff changeset
    46
!PPCMockCompiler class methodsFor:'documentation'!
00381102a9b5 Override #new in classes that implement #initialize.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 392
diff changeset
    47
00381102a9b5 Override #new in classes that implement #initialize.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 392
diff changeset
    48
version_HG
00381102a9b5 Override #new in classes that implement #initialize.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 392
diff changeset
    49
00381102a9b5 Override #new in classes that implement #initialize.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 392
diff changeset
    50
    ^ '$Changeset: <not expanded> $'
00381102a9b5 Override #new in classes that implement #initialize.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 392
diff changeset
    51
! !
00381102a9b5 Override #new in classes that implement #initialize.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 392
diff changeset
    52