PPRepeatingParser.st
changeset 179 c7539657b514
parent 52 9ddc30d7e0ca
child 378 53d66ecfeb1b
equal deleted inserted replaced
178:992088772705 179:c7539657b514
    24 
    24 
    25 on: aParser min: aMinInteger max: aMaxInteger
    25 on: aParser min: aMinInteger max: aMaxInteger
    26 	^ (self on: aParser) setMin: aMinInteger max: aMaxInteger
    26 	^ (self on: aParser) setMin: aMinInteger max: aMaxInteger
    27 ! !
    27 ! !
    28 
    28 
       
    29 !PPRepeatingParser methodsFor:'*petitanalyzer-matching'!
       
    30 
       
    31 match: aParser inContext: aDictionary seen: anIdentitySet
       
    32 	^ (super match: aParser inContext: aDictionary seen: anIdentitySet) and: [ self min = aParser min and: [ self max = aParser max ] ]
       
    33 ! !
       
    34 
       
    35 !PPRepeatingParser methodsFor:'*petitanalyzer-testing'!
       
    36 
       
    37 isNullable
       
    38 	^ min = 0
       
    39 ! !
       
    40 
    29 !PPRepeatingParser methodsFor:'accessing'!
    41 !PPRepeatingParser methodsFor:'accessing'!
    30 
    42 
    31 max
    43 max
    32 	"Answer the maximum number of repetitions."
    44 	"Answer the maximum number of repetitions."
    33 
    45 
    39 	
    51 	
    40 	^ min
    52 	^ min
    41 ! !
    53 ! !
    42 
    54 
    43 !PPRepeatingParser methodsFor:'initialization'!
    55 !PPRepeatingParser methodsFor:'initialization'!
       
    56 
       
    57 initialize
       
    58 	super initialize.
       
    59 	self setMin: 0; setMax: SmallInteger maxVal
       
    60 !
       
    61 
       
    62 setMax: anInteger
       
    63 	max := anInteger
       
    64 !
       
    65 
       
    66 setMin: anInteger
       
    67 	min := anInteger
       
    68 !
    44 
    69 
    45 setMin: aMinInteger max: aMaxInteger
    70 setMin: aMinInteger max: aMaxInteger
    46 	min := aMinInteger.
    71 	min := aMinInteger.
    47 	max := aMaxInteger
    72 	max := aMaxInteger
    48 ! !
    73 ! !
    74 ! !
    99 ! !
    75 
   100 
    76 !PPRepeatingParser class methodsFor:'documentation'!
   101 !PPRepeatingParser class methodsFor:'documentation'!
    77 
   102 
    78 version
   103 version
    79     ^ '$Header: /cvs/stx/stx/goodies/petitparser/PPRepeatingParser.st,v 1.3 2012-05-04 22:09:29 vrany Exp $'
   104     ^ '$Header: /cvs/stx/stx/goodies/petitparser/PPRepeatingParser.st,v 1.4 2014-03-04 14:33:24 cg Exp $'
    80 !
   105 !
    81 
   106 
    82 version_CVS
   107 version_CVS
    83     ^ '$Header: /cvs/stx/stx/goodies/petitparser/PPRepeatingParser.st,v 1.3 2012-05-04 22:09:29 vrany Exp $'
   108     ^ '$Header: /cvs/stx/stx/goodies/petitparser/PPRepeatingParser.st,v 1.4 2014-03-04 14:33:24 cg Exp $'
    84 !
   109 !
    85 
   110 
    86 version_SVN
   111 version_SVN
    87     ^ '§Id: PPRepeatingParser.st 2 2010-12-17 18:44:23Z vranyj1 §'
   112     ^ '$Id: PPRepeatingParser.st,v 1.4 2014-03-04 14:33:24 cg Exp $'
    88 ! !
   113 ! !
       
   114