PPAndParser.st
changeset 0 739fe9b7253e
child 4 90de244a7fa2
equal deleted inserted replaced
-1:000000000000 0:739fe9b7253e
       
     1 "{ Package: 'squeak:petitparser' }"
       
     2 
       
     3 PPDelegateParser subclass:#PPAndParser
       
     4 	instanceVariableNames:''
       
     5 	classVariableNames:''
       
     6 	poolDictionaries:''
       
     7 	category:'PetitParser-Parsers'
       
     8 !
       
     9 
       
    10 PPAndParser comment:'The and-predicate, a parser that succeeds whenever its delegate does, but consumes the input stream [Parr 1994, 1995].'
       
    11 !
       
    12 
       
    13 
       
    14 !PPAndParser methodsFor:'operations'!
       
    15 
       
    16 and
       
    17 	^ self
       
    18 ! !
       
    19 
       
    20 !PPAndParser methodsFor:'parsing'!
       
    21 
       
    22 parseOn: aStream
       
    23 	| element position |
       
    24 	position := aStream position.
       
    25 	element := parser parseOn: aStream.
       
    26 	aStream position: position.
       
    27 	^ element
       
    28 ! !
       
    29 
       
    30 !PPAndParser class methodsFor:'documentation'!
       
    31 
       
    32 version_SVN
       
    33     ^ '$Id: PPAndParser.st,v 1.1 2011-08-18 18:56:17 cg Exp $'
       
    34 ! !