PPTokenParser.st
changeset 0 739fe9b7253e
child 4 90de244a7fa2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PPTokenParser.st	Thu Aug 18 20:56:17 2011 +0200
@@ -0,0 +1,47 @@
+"{ Package: 'squeak:petitparser' }"
+
+PPFlattenParser subclass:#PPTokenParser
+	instanceVariableNames:'tokenClass'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'PetitParser-Parsers'
+!
+
+PPTokenParser comment:'A parser that answers a token of the range my delegate parses.
+Instance Variables:
+	tokenClass	<PPToken class>	The token sub-class to be used.'
+!
+
+
+!PPTokenParser methodsFor:'accessing'!
+
+tokenClass
+	^ tokenClass
+!
+
+tokenClass: aTokenClass
+	tokenClass := aTokenClass
+! !
+
+!PPTokenParser methodsFor:'initialization'!
+
+initialize
+	tokenClass := self defaultTokenClass
+	
+! !
+
+!PPTokenParser methodsFor:'private'!
+
+create: aCollection start: aStartInteger stop: aStopInteger
+	^ self tokenClass on: aCollection start: aStartInteger stop: aStopInteger
+!
+
+defaultTokenClass
+	^ PPToken
+! !
+
+!PPTokenParser class methodsFor:'documentation'!
+
+version_SVN
+    ^ '$Id: PPTokenParser.st,v 1.1 2011-08-18 18:56:17 cg Exp $'
+! !