compiler/PPCInlinedMethod.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Mon, 01 Jun 2015 22:02:17 +0100
changeset 477 b18b6cc7aabc
parent 452 9f4558b3be66
child 481 34ee0d3c72e7
permissions -rw-r--r--
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>"
! !