parsers/java/PJBlockNode.st
changeset 435 3bc08fb90133
child 642 77d5fddb6462
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/parsers/java/PJBlockNode.st	Tue Apr 21 14:57:16 2015 +0100
@@ -0,0 +1,39 @@
+"{ Package: 'stx:goodies/petitparser/parsers/java' }"
+
+"{ NameSpace: Smalltalk }"
+
+PJASTNode subclass:#PJBlockNode
+	instanceVariableNames:'statements'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'PetitJava-AST'
+!
+
+PJBlockNode comment:'A node representing a block of java code.

A block begins with: { ends with: } and has statement in between.'
+!
+
+!PJBlockNode methodsFor:'accessing'!
+
+acceptVisitor: aVisitor
+
+	^ aVisitor visitStatementBlockNode: self
+!
+
+addStatement: aStatement
+	statements add: aStatement
+!
+
+statements
+	^ statements
+!
+
+statements: aCollection
+	statements := OrderedCollection withAll: aCollection
+! !
+
+!PJBlockNode methodsFor:'initialize-release'!
+
+initialize
+	statements := OrderedCollection new
+! !
+