compiler/PPCStarAnyNode.st
changeset 391 553a5456963b
child 392 9b297f0d949c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/compiler/PPCStarAnyNode.st	Sun Oct 26 01:03:31 2014 +0000
@@ -0,0 +1,36 @@
+"{ Package: 'stx:goodies/petitparser/compiler' }"
+
+PPCNode subclass:#PPCStarAnyNode
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'PetitCompiler-Nodes'
+!
+
+PPCStarAnyNode comment:''
+!
+
+!PPCStarAnyNode methodsFor:'as yet unclassified'!
+
+acceptsEpsilon
+	^ true
+!
+
+acceptsEpsilonOpenSet: set
+	^ true
+!
+
+compileWith: compiler effect: effect id: id
+	compiler startMethod: id.
+	compiler addVariable: 'retval size'.
+	compiler add: 'size := context size - context position.'.
+	compiler add: 'retval := Array new: size.'.
+	compiler add: '(1 to: size) do: [ :e | retval at: e put: context next ].'.
+	compiler add: '^ retval'.
+ ^ compiler stopMethod.
+!
+
+prefix
+	^ #starAny
+! !
+