Codegen refactoring [1/x]: Introduced a PPCCodeBlock
A PPCCodeBlock is an abstraction of a block of statements with temporaries. This will
allow for scoped temporary management in code generator - temporary variables could
be allocated for block only. (i.e., make them block-temporaries)
"{ Package: 'stx:goodies/petitparser/compiler' }"
"{ NameSpace: Smalltalk }"
PPCMethod subclass:#PPCInlinedMethod
instanceVariableNames:''
classVariableNames:''
poolDictionaries:''
category:'PetitCompiler-Compiler-Codegen'
!
!PPCInlinedMethod methodsFor:'as yet unclassified'!
call
^ self code
!
code
^ (String streamContents:[:s | buffer codeOn:s ]) trimRight
"Modified (format): / 01-06-2015 / 21:44:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
isInline
^ true
! !
!PPCInlinedMethod methodsFor:'code generation - variables'!
allocateReturnVariable
self error: 'return variable must be assigned by the non-inlined method....'
"Created: / 23-04-2015 / 21:06:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
allocateTemporaryVariableNamed:aString
self error: 'sorry, I can''t allocate variables....'
"Created: / 23-04-2015 / 21:06:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !