PPParserResource.st
changeset 0 739fe9b7253e
child 4 90de244a7fa2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PPParserResource.st	Thu Aug 18 20:56:17 2011 +0200
@@ -0,0 +1,30 @@
+"{ Package: 'squeak:petitparser' }"
+
+TestResource subclass:#PPParserResource
+	instanceVariableNames:'parsers'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'PetitTests-Core'
+!
+
+
+!PPParserResource methodsFor:'accessing'!
+
+parserAt: aParserClass
+	"Answer a cached instance of aParserClass."
+	
+	^ parsers at: aParserClass name ifAbsentPut: [ aParserClass new ]
+! !
+
+!PPParserResource methodsFor:'running'!
+
+setUp
+	super setUp.
+	parsers := Dictionary new
+! !
+
+!PPParserResource class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id: PPParserResource.st,v 1.1 2011-08-18 18:56:17 cg Exp $'
+! !