<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to bugs</title><link>https://sourceforge.net/p/simpleparse/bugs/</link><description>Recent changes to bugs</description><atom:link href="https://sourceforge.net/p/simpleparse/bugs/feed.rss" rel="self"/><language>en</language><lastBuildDate>Thu, 31 May 2012 23:56:32 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/simpleparse/bugs/feed.rss" rel="self" type="application/rss+xml"/><item><title>Use of Generators is not thread safe</title><link>https://sourceforge.net/p/simpleparse/bugs/3/</link><description>&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;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Robert Brewer</dc:creator><pubDate>Thu, 31 May 2012 23:56:32 -0000</pubDate><guid>https://sourceforge.net8a2f308658bcdb01dc6e579853873dcfd6100e2f</guid></item><item><title>Fatal Python error: GC object already tracked</title><link>https://sourceforge.net/p/simpleparse/bugs/2/</link><description>&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;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Thu, 17 Nov 2005 23:54:50 -0000</pubDate><guid>https://sourceforge.net89ce1a33e6d6fbfcffa1b1bf6285c61f326601a9</guid></item><item><title>Optional children of repeating f/o group</title><link>https://sourceforge.net/p/simpleparse/bugs/1/</link><description>&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;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Mike C. Fletcher</dc:creator><pubDate>Sun, 30 Jun 2002 21:20:41 -0000</pubDate><guid>https://sourceforge.net24a96ae703a9b9fabfd097e7d86367aca9ee8916</guid></item></channel></rss>