<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Brainfold &#187; parsing</title>
	<atom:link href="http://www.brainfold.org/blog/tag/parsing/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brainfold.org/blog</link>
	<description>On Python, game development and everything</description>
	<lastBuildDate>Sat, 15 May 2010 21:58:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Trabalho um pouco</title>
		<link>http://www.brainfold.org/blog/2007/11/27/trabalho-um-pouco/</link>
		<comments>http://www.brainfold.org/blog/2007/11/27/trabalho-um-pouco/#comments</comments>
		<pubDate>Mon, 26 Nov 2007 22:52:08 +0000</pubDate>
		<dc:creator>Jussi Lepistö</dc:creator>
				<category><![CDATA[Bazaar]]></category>
		<category><![CDATA[game development]]></category>
		<category><![CDATA[parsing]]></category>
		<category><![CDATA[Spineless]]></category>

		<guid isPermaLink="false">http://www.brainfold.org/blog/2007/11/27/trabalho-um-pouco/</guid>
		<description><![CDATA[In between reading for my Portuguese exam, I've actually got a bit of work done on my projects. The major changes are that I abandoned the Spineless Sourceforge project, and moved from Subversion to Bazaar for version control. The Bazaar repository is currently private, but as soon as Spineless is ready for public consumption, I [...]]]></description>
			<content:encoded><![CDATA[<p>In between reading for my Portuguese exam, I've actually got a bit of work done on my projects.</p>
<p>The major changes are that I abandoned the <a href="http://sourceforge.net/projects/spineless">Spineless Sourceforge project</a>, and moved from Subversion to <a href="http://bazaar-vcs.org/">Bazaar</a> for version control. The Bazaar repository is currently private, but as soon as Spineless is ready for public consumption, I will probably release it again on <a href="http://launchpad.net/">Launchpad</a>. It might not be soon, or it might never come to be, but if and when it does, you will be the first to know. <img src='http://www.brainfold.org/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Bazaar seems really cool and much more appropriate for me than Subversion, both now and in the future. I'm not depending on a single server anymore, but I can still keep my repository centrally located on my webhost. If it ever disappears or is unavailable for a while (or I'm on the move with my laptop), I can continue working with the local repository as normal. The biggest problem at the moment is that <a href="http://bazaar-vcs.org/TortoiseBzr">Windows Explorer integration</a> and the <a href="http://bazaar-vcs.org/BzrEclipse">Eclipse plugin</a> are still in alpha. I'll have to brave myself and try them some day.</p>
<p>I also worked a bit on the C parser. It's frankly a bit more complicated than I thought, but I'm already mostly done for my purposes. All that's left is actually generating the ctypes interface from the parsed data. I'll be in for a treat when I get to try and support the horribly convoluted <a href="http://freetype.sourceforge.net/index2.html">FreeType</a> headers, but that's a can of worms for the future. As long as I can keep the ctypes interface stable, it's not a problem to push working on a more complete parser back a while. When the parser is done, I can finally move on to reimplementing rendering with a shiny new architecture.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brainfold.org/blog/2007/11/27/trabalho-um-pouco/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tasks, tools and tribulations</title>
		<link>http://www.brainfold.org/blog/2007/11/21/tasks-tools-and-tribulations/</link>
		<comments>http://www.brainfold.org/blog/2007/11/21/tasks-tools-and-tribulations/#comments</comments>
		<pubDate>Tue, 20 Nov 2007 23:40:12 +0000</pubDate>
		<dc:creator>Jussi Lepistö</dc:creator>
				<category><![CDATA[COLLADA]]></category>
		<category><![CDATA[cooperative multitasking]]></category>
		<category><![CDATA[game development]]></category>
		<category><![CDATA[parsing]]></category>

		<guid isPermaLink="false">http://www.brainfold.org/blog/2007/11/21/tasks-tools-and-tribulations/</guid>
		<description><![CDATA[Inspired by Entity Crisis, I'm finally taking the plunge and converting my task scheduler to use generator-powered cooperative multitasking instead of normal functions. It should make both the task scheduler implementation and future task writing much more elegant. I'm also thinking of extending it later with threadable, networked and Stackless-based tasks. More on this as [...]]]></description>
			<content:encoded><![CDATA[<p>Inspired by <a href="http://entitycrisis.blogspot.com/">Entity Crisis</a>, I'm finally taking the plunge and converting my task scheduler to use generator-powered cooperative multitasking instead of normal functions. It should make both the task scheduler implementation and future task writing much more elegant. I'm also thinking of extending it later with threadable, networked and <a href="http://www.stackless.com/">Stackless</a>-based tasks. More on this as I get it done.</p>
<p>Good-ish news on the parser front: Dave Kuhlman released a new version of <a href="http://www.rexx.com/~dkuhlman/generateDS.html">generateDS</a>, which now succesfully parses the Collada schema, but the generated parser still fails to parse more complex Collada files, specifically transformation elements such as translate. I hope it's "just" a bug and not a missing feature. If it is, I just might contribute the missing features myself if needed and it's not too complex. In any case, this is promising.</p>
<p>I also started writing the C header parser using <a href="http://pyparsing.wikispaces.com/">Pyparsing</a>. It's easy enough to work with, though I wish its documentation was more decent and its interface cleaner and more Pythonic. Anyway, from the humble start it looks like it won't be too difficult a project for the small subset of C grammar I need it to understand. I already got it to recognize some preprocessor directives, now I just need it to do something with them, and then it's on to actual C grammar.</p>
<p>And I'm still waiting for  <a href="http://trac.edgewall.org/">Trac</a> 0.11  to be released, and hoping it will be easier to install than 0.10, which I never could get to work on shared webhosting.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brainfold.org/blog/2007/11/21/tasks-tools-and-tribulations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Information visualization</title>
		<link>http://www.brainfold.org/blog/2007/11/16/information-visualization/</link>
		<comments>http://www.brainfold.org/blog/2007/11/16/information-visualization/#comments</comments>
		<pubDate>Thu, 15 Nov 2007 22:18:08 +0000</pubDate>
		<dc:creator>Jussi Lepistö</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[information visualization]]></category>
		<category><![CDATA[parsing]]></category>
		<category><![CDATA[screenshots]]></category>
		<category><![CDATA[studies]]></category>

		<guid isPermaLink="false">http://www.brainfold.org/blog/2007/11/16/information-visualization/</guid>
		<description><![CDATA[First, an update on the last post: I sent mail to the developer of generateDS, and he has located the problem and is looking into it. That was quick, nice. As for parsing C, I took a look at a couple of tools, including GCC-XML, but I couldn't find anything I could readily use. So [...]]]></description>
			<content:encoded><![CDATA[<p>First, an update on the last post: I sent mail to the developer of <a href="http://www.rexx.com/~dkuhlman/generateDS.html">generateDS</a>, and he has located the problem and is looking into it. That was quick, nice. <img src='http://www.brainfold.org/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  As for parsing C, I took a look at a couple of tools, including <a href="http://www.gccxml.org/">GCC-XML</a>, but I couldn't find anything I could readily use. So I'm still counting on <a href="http://pyparsing.wikispaces.com/">Pyparsing</a> or <a href="http://www.dabeaz.com/ply/">PLY</a> to do the job. I realized <a href="http://www.pyglet.org/">Pyglet</a> is using PLY, maybe I'll look into that for insight.</p>
<p>The last few days I've been spending my programming effort on a university project. I'm on a course called "Information visualization project work", where we're supposed to design and implement a prototype of an information visualization (infovis) application. I already took the infovis introduction course and the topic seems quite interesting, especially since it's related to user interfaces which I'm very interested in. Infovis is visualization of abstract data, as opposed to scientific visualization, which is about visualizing concrete data such as air flow over a wing, or the structural integrity of a bridge. Common applications include maps (although the underlying map might visualize concrete landscape, it's almost always overlaid with abstract data such as routes) stock rates and weather charts.</p>
<p>We had three topics to choose from, and our group chose visualization of research article citations. Since there don't seem to be any suitable visualization libraries for Python, and I don't really like the GUI libraries for Python either, and I hate Java, and I don't know Flash, we chose to do the prototype in C#. It's much nicer to work with than Java, and I'm at least somewhat familiar with both the language and the .NET API. Granted, I could have tried to use IronPython, but I have no experience at all in it, so I decided not to take the risk of trying to learn it for this short project. We're using a visualization library called <a href="http://www.cs.umd.edu/hcil/piccolo/">Piccolo</a>, which at least initially seems quite nice. It's almost trivial to set up too, though the API and especially documentation is a bit confusing. Unfortunately the free version isn't really maintained or updated anymore. It would be nice if someone did something similar for Python... or maybe a library like that exists, but I just couldn't find one.</p>
<p style="text-align: center"><a title="Very early version: squares are articles, circles are authors" href="http://www.brainfold.org/blog/wp-content/uploads/2007/11/citevis_2007-11-14.png"><img src="http://www.brainfold.org/blog/wp-content/uploads/2007/11/citevis_2007-11-14.thumbnail.png" alt="Very early version: squares are articles, circles are authors" width="400" height="346" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.brainfold.org/blog/2007/11/16/information-visualization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Parsing, oh my&#8230;</title>
		<link>http://www.brainfold.org/blog/2007/11/13/parsing-oh-my/</link>
		<comments>http://www.brainfold.org/blog/2007/11/13/parsing-oh-my/#comments</comments>
		<pubDate>Tue, 13 Nov 2007 21:50:03 +0000</pubDate>
		<dc:creator>Jussi Lepistö</dc:creator>
				<category><![CDATA[COLLADA]]></category>
		<category><![CDATA[game development]]></category>
		<category><![CDATA[parsing]]></category>
		<category><![CDATA[Spineless]]></category>

		<guid isPermaLink="false">http://www.brainfold.org/blog/2007/11/13/parsing-oh-my/</guid>
		<description><![CDATA[Recently I have been thinking about parsing. There are two areas of Spineless (yes, I'm continuing to develop the engine, but only for my game project, not for the public for now) that need some kind of parsing to implement cleanly: C library support and COLLADA loading. To use C libraries from Python, I'm going [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I have been thinking about parsing. There are two areas of Spineless (yes, I'm continuing to develop the engine, but only for my game project, not for the public for now) that need some kind of parsing to implement cleanly: C library support and <a href="http://www.khronos.org/collada/">COLLADA</a> loading.</p>
<p>To use C libraries from Python, I'm going to parse their headers to generate a <a href="http://python.net/crew/theller/ctypes/">ctypes</a> interface which can then be used from Python without any compiling required. There are existing solutions, such as the <a href="http://starship.python.net/crew/theller/wiki/CodeGenerator">ctypes code generator</a>, but nothing that could be called a released product. So I'm going to see how difficult it would be to do myself. Parsing is a huge topic however, as demonstarted, for example, by this old newsgroup topic: <a href="http://www.thescripts.com/forum/thread41389.html">http://www.thescripts.com/forum/thread41389.html</a>. The two tools I'm initially considering are <a href="http://pyparsing.wikispaces.com/">Pyparsing</a>, which might be too simple (ie. tedious to do complex stuff with) for my purposes, and <a href="http://www.dabeaz.com/ply/">PLY</a>, which might be far too complex (ie. hard to learn) for this relatively simple task. Experience on either of the tools or other suggestions are really welcome, I'll be sure to post mine when I have learned more! <img src='http://www.brainfold.org/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>COLLADA, as you may know, is an XML-based 3D asset file format. Unfortunately the official API, COLLADA DOM, is a C++ library, and using C++ libraries from Python is a can of worms I'm not willing to open if I can avoid it. Until now, I have been writing code to read COLLADA files by hand, but it's really quickly getting really messy. Instead I'm going to generate a Python interface / COLLADA parser based on the XML Schema describing the file format. There's an excellent-looking tool for it too, called <a href="http://www.rexx.com/~dkuhlman/generateDS.html">generateDS</a>, but unfortunately it fails when trying to read the COLLADA XML Schema, hanging forever. I sent an e-mail to the author, and I hope he can fix the problem. Failing that, it seems I'm on my own, as there don't seem to be any Python libraries to help with parsing XML Schema. All I can find are tools for validating documents based on a schema, but that's not what I'm trying to do... Again, suggestions are welcome!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brainfold.org/blog/2007/11/13/parsing-oh-my/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
