compiler/PPCMethod.st
changeset 460 87a3d30ab570
parent 453 bd5107faf4d6
parent 459 4751c407bb40
child 465 f729f6cd3c76
equal deleted inserted replaced
458:a4da1c24d84a 460:87a3d30ab570
     1 "{ Package: 'stx:goodies/petitparser/compiler' }"
     1 "{ Package: 'stx:goodies/petitparser/compiler' }"
     2 
     2 
     3 "{ NameSpace: Smalltalk }"
     3 "{ NameSpace: Smalltalk }"
     4 
     4 
     5 Object subclass:#PPCMethod
     5 Object subclass:#PPCMethod
     6 	instanceVariableNames:'buffer variables indentation id profile variableForReturn'
     6 	instanceVariableNames:'buffer variables indentation id profile variableForReturn
       
     7 		category'
     7 	classVariableNames:''
     8 	classVariableNames:''
     8 	poolDictionaries:''
     9 	poolDictionaries:''
     9 	category:'PetitCompiler-Core'
    10 	category:'PetitCompiler-Core'
    10 !
    11 !
    11 
    12 
    24     ^ buffer contents
    25     ^ buffer contents
    25 !
    26 !
    26 
    27 
    27 bridge
    28 bridge
    28     ^ PPCBridge on: self methodName.
    29     ^ PPCBridge on: self methodName.
       
    30 !
       
    31 
       
    32 category
       
    33     ^ category isNil 
       
    34         ifTrue: [ category := 'generated' ]
       
    35         ifFalse: [ category ]
       
    36 
       
    37     "Modified (format): / 12-05-2015 / 01:21:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    38 !
       
    39 
       
    40 category: value
       
    41     category := value
    29 !
    42 !
    30 
    43 
    31 code
    44 code
    32     ^ self methodName, Character cr asString,  
    45     ^ self methodName, Character cr asString,  
    33         self variables, Character cr asString,
    46         self variables, Character cr asString,
    74     ^ buffer nextPut: Character cr
    87     ^ buffer nextPut: Character cr
    75 !
    88 !
    76 
    89 
    77 profilingBegin
    90 profilingBegin
    78     self profile ifTrue: [ 
    91     self profile ifTrue: [ 
    79  		^ '  context methodInvoked: #', id, '.'	
    92  				^ '  context methodInvoked: #', id, '.'	
    80     ].
    93     ].
    81     ^ ''
    94     ^ ''
    82 !
    95 !
    83 
    96 
    84 profilingEnd
    97 profilingEnd
    85     self profile ifTrue: [ 
    98     self profile ifTrue: [ 
    86  		^ '  context methodFinished: #', id, '.'	
    99  				^ '  context methodFinished: #', id, '.'	
    87     ].
   100     ].
    88     ^ ''
   101     ^ ''
    89 ! !
   102 ! !
    90 
   103 
    91 !PPCMethod methodsFor:'code generation - variables'!
   104 !PPCMethod methodsFor:'code generation - variables'!