<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to bugs</title><link href="https://sourceforge.net/p/simpleparse/bugs/" rel="alternate"/><link href="https://sourceforge.net/p/simpleparse/bugs/feed.atom" rel="self"/><id>https://sourceforge.net/p/simpleparse/bugs/</id><updated>2012-05-31T23:56:32Z</updated><subtitle>Recent changes to bugs</subtitle><entry><title>Use of Generators is not thread safe</title><link href="https://sourceforge.net/p/simpleparse/bugs/3/" rel="alternate"/><published>2012-05-31T23:56:32Z</published><updated>2012-05-31T23:56:32Z</updated><author><name>Robert Brewer</name><uri>https://sourceforge.net/u/aminusfu/</uri></author><id>https://sourceforge.net8a2f308658bcdb01dc6e579853873dcfd6100e2f</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;An instance of generator.Generator is not safe to use in multiple threads simultaneously, because its buildParser method mutates its parserList state. This in itself is not a problem, but simpleparsegrammar.Parser.buildTagger and objectgenerator.LibraryElement.toParser re-use the same generators even among separate parser.Parser instances.&lt;/p&gt;
&lt;p&gt;I'm no expert in simpleparse, but my testing shows that this can be remedied with two small changes: first, for simpleparsegrammar.Parser.buildTagger, copy the SPGenerator object instead of using it directly:&lt;/p&gt;
&lt;p&gt;def buildTagger( self, name=None, processor = None ):&lt;br /&gt;
"""Build the tag-table for parsing the EBNF for this parser"""&lt;br /&gt;
gen = generator.Generator()&lt;br /&gt;
gen.names = SPGenerator.names[:]&lt;br /&gt;
gen.rootObjects = SPGenerator.rootObjects[:]&lt;br /&gt;
gen.methodSource = SPGenerator.methodSource&lt;br /&gt;
gen.definitionSources = SPGenerator.definitionSources[:]&lt;/p&gt;
&lt;p&gt;return gen.buildParser( name, processor )&lt;/p&gt;
&lt;p&gt;Second, for objectgenerator.LibraryElement.toParser, make a new Parser instance for each LibraryElement() instance created in common/*.py, instead of re-using a common "_p" variable. For example, in numbers.py:&lt;/p&gt;
&lt;p&gt;for name in ["int","hex", "int_unsigned", "number", "float", "binary_number", "float_floatexp", "imaginary_number", "number_full"]:&lt;br /&gt;
c[ name ] = objectgenerator.LibraryElement(&lt;br /&gt;
generator = Parser( declaration )._generator,&lt;br /&gt;
production = name,&lt;br /&gt;
)&lt;/p&gt;
&lt;p&gt;The project is a bit complicated for me to know if this preserves semantics, but it works in my tests.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Fatal Python error: GC object already tracked</title><link href="https://sourceforge.net/p/simpleparse/bugs/2/" rel="alternate"/><published>2005-11-17T23:54:50Z</published><updated>2005-11-17T23:54:50Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.net89ce1a33e6d6fbfcffa1b1bf6285c61f326601a9</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Apperently python &amp;gt;=2.3 exposes garbage collection &lt;br /&gt;
bugs in C python API code.&lt;/p&gt;
&lt;p&gt;Setup:&lt;br /&gt;
Activestate Python 2.4.2 for windows&lt;br /&gt;
egenix-mx-base-2.1.0-2005-05-01.zip&lt;br /&gt;
SimpleParse-2.0.1a3.win32.exe&lt;/p&gt;
&lt;p&gt;Im not sure if this is a bug in SimpleParse or MxBase&lt;/p&gt;
&lt;p&gt;C:\Python24\Lib\site-&lt;br /&gt;
packages\simpleparse\tests&amp;gt;python test.py&lt;br /&gt;
None            : &lt;br /&gt;
Word : '['                     : jne=+0 : je=+1&lt;br /&gt;
'CHARBRACE'     : &lt;br /&gt;
Word : ']'                     : jne=+1 : je=+1&lt;br /&gt;
'CHARDASH'      : Word : '-&lt;br /&gt;
'                     : jne=+1 : je=+1&lt;br /&gt;
None            : SubTable : &lt;br /&gt;
&amp;lt;table&amp;gt;             : jne=+2 : je=+1&lt;br /&gt;
None            : EOF : &lt;br /&gt;
1                        : jne=-1 : je=+1&lt;br /&gt;
'CHARDASH'      : Word : '-&lt;br /&gt;
'                     : jne=+1 : je=+1&lt;br /&gt;
None            : &lt;br /&gt;
Word : ']'                     : jne=+0 : je=+1&lt;/p&gt;
&lt;p&gt;mxVersion: ('2', '1', '0')&lt;br /&gt;
..............................Fatal Python error: GC &lt;br /&gt;
object already tracked&lt;/p&gt;
&lt;p&gt;This application has requested the Runtime to &lt;br /&gt;
terminate it in an unusual way.&lt;br /&gt;
Please contact the application's support team for &lt;br /&gt;
more information.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Optional children of repeating f/o group</title><link href="https://sourceforge.net/p/simpleparse/bugs/1/" rel="alternate"/><published>2002-06-30T21:20:41Z</published><updated>2002-06-30T21:20:41Z</updated><author><name>Mike C. Fletcher</name><uri>https://sourceforge.net/u/mcfletch/</uri></author><id>https://sourceforge.net24a96ae703a9b9fabfd097e7d86367aca9ee8916</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Currently the engine cannot distinguish between a&lt;br /&gt;
compound item (such as a Table) that fails, but is&lt;br /&gt;
satisfied, and one that succeeds.  As a result, there's&lt;br /&gt;
an endless loop generated when trying to parse a&lt;br /&gt;
repeating group (f/o with a single optional or seq with&lt;br /&gt;
all optional).&lt;/p&gt;
&lt;p&gt;The approaches I can see:&lt;/p&gt;
&lt;p&gt;Make the objectgenerator code try to figure out when&lt;br /&gt;
the situation would occur and raise an error.  (This is&lt;br /&gt;
going to be ugly code: determine whether children are&lt;br /&gt;
optional (recursively (which is a problem with&lt;br /&gt;
self-referencing items)), or more precisely, whether an&lt;br /&gt;
item can match a 0-width string)&lt;/p&gt;
&lt;p&gt;Make the engine capable of reporting success, failure&lt;br /&gt;
and contentment explicitly.  Alter tag-table generators&lt;br /&gt;
to allow the third state jumps (which completely&lt;br /&gt;
changes the mx.TextTools API).  Not a great solution&lt;br /&gt;
either.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>