title: acccumulate using pyparsing
body: <p>I have some data that can be parsed using the <code>OneorMore</code> function from pyparsing. Something like,</p>
  
  <pre><code>fun = OneorMore( foo.setResultsName("foo") +  bar.setResultsname("bar") )
  </code></pre>
  
  <p>where <code>bar</code> and <code>foo</code> are 2 parsers.</p>
  
  <p>The problem with this function is that everytime that <code>OneorMore</code> match foo and bar parsers in the data stream, the corresponding values associated with the keys <code>"foo"</code> and <code>"bar"</code> are updated.But, 
  how can I accumulate all the matched values of <code>foo</code> and <code>bar</code>?</p>
  
  <p>I'm trying to implement something like the <a href="https://hackage.haskell.org/package/parsec-3.1.9/docs/Text-Parsec.html" rel="nofollow">many1</a> monadic parser in Haskell, saving the result of parsing <code>foo</code> and <code>bar</code> in an Algebraic Data type, like</p>
  
  <pre><code>data FooBar a = FooBar a a
  
  many1 :: ParsecT s u m a -&gt; ParsecT s u m [a]
  
  many1 parserFooBar :: ParsecT s u m [FooBar a]
  </code></pre>
  
  <p>How can I do this in python?</p>