parsers/java/PJBlockNode.st
changeset 435 3bc08fb90133
child 642 77d5fddb6462
equal deleted inserted replaced
434:840942b96eea 435:3bc08fb90133
       
     1 "{ Package: 'stx:goodies/petitparser/parsers/java' }"
       
     2 
       
     3 "{ NameSpace: Smalltalk }"
       
     4 
       
     5 PJASTNode subclass:#PJBlockNode
       
     6 	instanceVariableNames:'statements'
       
     7 	classVariableNames:''
       
     8 	poolDictionaries:''
       
     9 	category:'PetitJava-AST'
       
    10 !
       
    11 
       
    12 PJBlockNode comment:'A node representing a block of java code.
       
    13 
       
    14 A block begins with: { ends with: } and has statement in between.'
       
    15 !
       
    16 
       
    17 !PJBlockNode methodsFor:'accessing'!
       
    18 
       
    19 acceptVisitor: aVisitor
       
    20 
       
    21 	^ aVisitor visitStatementBlockNode: self
       
    22 !
       
    23 
       
    24 addStatement: aStatement
       
    25 	statements add: aStatement
       
    26 !
       
    27 
       
    28 statements
       
    29 	^ statements
       
    30 !
       
    31 
       
    32 statements: aCollection
       
    33 	statements := OrderedCollection withAll: aCollection
       
    34 ! !
       
    35 
       
    36 !PJBlockNode methodsFor:'initialize-release'!
       
    37 
       
    38 initialize
       
    39 	statements := OrderedCollection new
       
    40 ! !
       
    41