parsers/java/PJTraditionalCommentsNode.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Tue, 24 Nov 2015 19:37:14 +0100
changeset 553 d83cb4945d5e
parent 436 e1c44b571db9
permissions -rw-r--r--
Oops, forgot to export PETITCOMPILER_DATA_DIRECTORY variable ...so Smalltalk code could not read it. Also fixed test for "include" scripts so they are not downloaded again when already downloaded.

"{ Package: 'stx:goodies/petitparser/parsers/java' }"

"{ NameSpace: Smalltalk }"

PJCommentsNode subclass:#PJTraditionalCommentsNode
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'PetitJava-AST'
!


!PJTraditionalCommentsNode methodsFor:'as yet unclassified'!

comment: anArray
	| temp temp2 |
	temp := OrderedCollection new.
	temp2 := anArray.
	temp2
		ifNotNil: [ 
			[ temp2 first = '*' and: temp2 second = '/' ]
				whileFalse: [ 
					temp2 first = '*'
						ifFalse: [ temp2 first second ifNotNil: [ temp add: temp2 first second ] ]
						ifTrue: [ temp2 first first ifNotNil: [ temp add: temp2 first first ] ].
					temp2 := temp2 second ].
			comment := (temp collect: #asciiValue) asByteArray asString ].
	anArray isNil
		ifTrue: [ comment := '' ]
!

printOn: aStream
	^	aStream 
		nextPutAll: 'comment value ==> ';
		nextPutAll: self comment.
  
! !

!PJTraditionalCommentsNode class methodsFor:'documentation'!

version_HG

    ^ '$Changeset: <not expanded> $'
! !