compiler/PPCPlusNode.st
changeset 438 20598d7ce9fa
parent 422 116d2b2af905
child 452 9f4558b3be66
equal deleted inserted replaced
437:54b3bc9e3987 438:20598d7ce9fa
    10 !
    10 !
    11 
    11 
    12 
    12 
    13 !PPCPlusNode methodsFor:'as yet unclassified'!
    13 !PPCPlusNode methodsFor:'as yet unclassified'!
    14 
    14 
    15 compileWith: compiler effect: effect id: id
       
    16 		
       
    17 	compiler startMethod: id.
       
    18 	compiler addVariable: 'retval'.
       
    19 	compiler addVariable: 'element'.
       
    20 		
       
    21 	compiler add: 'retval := OrderedCollection new.'.
       
    22 	compiler add: 'element := '.
       
    23 	compiler callOnLine: (child compileWith: compiler).
       
    24 	compiler add: 'error ifTrue: [ ^ self error: ''at least one occurence expected'' ].'.
       
    25 	compiler add: 'retval add: element.'.
       
    26 	
       
    27 	compiler add: 'element := '.
       
    28 	compiler callOnLine: (child compileWith: compiler).
       
    29 	compiler add: '[ error ] whileFalse: ['.
       
    30 	compiler indent.
       
    31 	compiler add: 'retval add: element.'.
       
    32 	compiler add: 'element := '.
       
    33 	compiler callOnLine: (child compileWith: compiler).
       
    34 	compiler dedent.
       
    35 	compiler add: '].'.
       
    36 	compiler add: 'self clearError.'.
       
    37 	compiler add: '^ retval asArray'.
       
    38  ^ compiler stopMethod.
       
    39 !
       
    40 
       
    41 followSets: aFollowDictionary firstSets: aFirstDictionary into: aSet suchThat: aBlock
    15 followSets: aFollowDictionary firstSets: aFirstDictionary into: aSet suchThat: aBlock
    42 	| first |
    16 	| first |
    43 	super followSets: aFollowDictionary firstSets:  aFirstDictionary into: aSet suchThat: aBlock.
    17 	super followSets: aFollowDictionary firstSets:  aFirstDictionary into: aSet suchThat: aBlock.
    44 	
    18 	
    45 	first := aFirstDictionary at: self.
    19 	first := aFirstDictionary at: self.
    48 
    22 
    49 prefix
    23 prefix
    50 	^ #plus
    24 	^ #plus
    51 ! !
    25 ! !
    52 
    26 
       
    27 !PPCPlusNode methodsFor:'visiting'!
       
    28 
       
    29 accept: visitor
       
    30 	^ visitor visitPlusNode: self
       
    31 ! !
       
    32 
    53 !PPCPlusNode class methodsFor:'documentation'!
    33 !PPCPlusNode class methodsFor:'documentation'!
    54 
    34 
    55 version_HG
    35 version_HG
    56 
    36 
    57     ^ '$Changeset: <not expanded> $'
    37     ^ '$Changeset: <not expanded> $'